From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark S." Subject: Re: insert picture feature request. Date: Sun, 8 May 2011 11:51:11 -0700 (PDT) Message-ID: <974092.79794.qm@web32003.mail.mud.yahoo.com> References: <115465.8886.qm@web32002.mail.mud.yahoo.com> 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]:35606) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJ94V-0002bT-6r for emacs-orgmode@gnu.org; Sun, 08 May 2011 14:51:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJ94T-0001PL-RN for emacs-orgmode@gnu.org; Sun, 08 May 2011 14:51:15 -0400 Received: from nm13.bullet.mail.sp2.yahoo.com ([98.139.91.83]:46008) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QJ94T-0001PF-HW for emacs-orgmode@gnu.org; Sun, 08 May 2011 14:51:13 -0400 In-Reply-To: <115465.8886.qm@web32002.mail.mud.yahoo.com> 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 Additional thought. Having all those pngs in the main directory will get me= ssy. I would like to put them in a sub-directory like "images". But there d= oesn't seem to be an easy way to insert that into (buffer-file-name). I've = looked, but can't seem to be a variable that just holds the current buffer = directory. Where would I start? Thanks! Mark --- On Sun, 5/8/11, Mark S. wrote: > From: Mark S. > Subject: Re: [O] insert picture feature request. > To: emacs-orgmode@gnu.org > Date: Sunday, May 8, 2011, 9:28 AM > Thanks Aankhen. >=20 > That seems to have fixed the technical problem. > Unfortunately, because of the 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 > application up at the same time, but that doesn't work on my > older screen. >=20 > So instead, I have the code grab whatever is in the > clipboard and use it. Then if I want a screen capture, I can > use whatever tool is available. Surfulator 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 images directly.=20 >=20 > As for viewing, the only way I know is to export to HTML. > Ctl-c e b is quick. I vaguely remember that there is a way > to actually view images inline in Emacs, but its not > portable or something. >=20 > Modified code below. >=20 > Thanks! > Mark >=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=C2=A0(convert-standard-filename > =C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat > =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0=C2=A0(make-temp-name > =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 (format-time-string > =C2=A0 =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 "C:\\Program > Files\\IrfanView\\i_view32.exe" nil nil nil > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > "/clippaste" (concat "/convert=3D" filename) ) > =C2=A0 (insert (concat "[[" filename "]]")) > =C2=A0 (org-display-inline-images)) >=20 >=20 > --- On Sat, 5/7/11, Aankhen wrote: >=20 > > 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 > > >=20 >