From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark S." Subject: Re: insert picture feature request. Date: Sun, 8 May 2011 09:28:09 -0700 (PDT) Message-ID: <115465.8886.qm@web32002.mail.mud.yahoo.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ6q3-0001ji-T3 for emacs-orgmode@gnu.org; Sun, 08 May 2011 12:28:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJ6q2-0005Ic-Lo for emacs-orgmode@gnu.org; Sun, 08 May 2011 12:28:11 -0400 Received: from nm27-vm0.bullet.mail.sp2.yahoo.com ([98.139.91.232]:37488) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QJ6q2-0005IY-B8 for emacs-orgmode@gnu.org; Sun, 08 May 2011 12:28:10 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Thanks Aankhen. That seems to have fixed the technical problem. Unfortunately, because of t= he way irfan works, all I was able to get pictures of was the emacs screen!= People with lots of screen real-estate can have emacs and their target app= lication up at the same time, but that doesn't work on my older screen. So instead, I have the code grab whatever is in the clipboard and use it. T= hen if I want a screen capture, I can use whatever tool is available. Surfu= lator has a really nice free screen capture. Also, with this approach I can= right-click on images in the browser, click "copy image" and use those ima= ges directly.=20 As for viewing, the only way I know is to export to HTML. Ctl-c e b is quic= k. I vaguely remember that there is a way to actually view images inline in= Emacs, but its not portable or something. Modified code below. Thanks! Mark (defun org-screenshot () "Take a screenshot into a time stamped unique-named file in the same directory as the org-buffer and insert a link to this file." (interactive) (setq filename (convert-standard-filename (concat (make-temp-name (concat (buffer-file-name) "_" (format-time-string "%Y%m%d_%H%M%S_")) ) ".png"))) (call-process "C:\\Program Files\\IrfanView\\i_view32.exe" nil nil nil "/clippaste" (concat "/convert=3D" filename) ) (insert (concat "[[" filename "]]")) (org-display-inline-images)) --- On Sat, 5/7/11, Aankhen wrote: > Subject: Re: [O] insert picture feature request. >=20 > I believe =E2=80=98convert-standard-filename=E2=80=99 should do it: >=20 > ,---- > | (defun org-screenshot () > |=C2=A0 "Take a screenshot into a time stamped > |=C2=A0=C2=A0=C2=A0unique-named file in the same directory > as > |=C2=A0=C2=A0=C2=A0the org-buffer and insert a link to this > file." > |=C2=A0 (interactive) > |=C2=A0 (setq filename > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 (convert-standard-filename > |=C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0(concat > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (make-temp-name > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0(concat > (buffer-file-name) > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0=C2=A0=C2=A0"_" > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0=C2=A0=C2=A0(format-time-string > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > =C2=A0 =C2=A0 "%Y%m%d_%H%M%S_")) ) ".png"))) > |=C2=A0 (call-process "i_view32.exe" nil nil nil > |=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > "/capture=3D2" (concat "/convert=3D" filename) ) > |=C2=A0 (insert (concat "[[" filename "]]")) > |=C2=A0 (org-display-inline-images)) > `---- >=20 > Seems to work here, although I=E2=80=99m unable to get the > resulting image to > display inline. >=20 > Aankhen >