From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark S." Subject: Re: insert picture feature request. Date: Sat, 7 May 2011 14:33:56 -0700 (PDT) Message-ID: <163798.45474.qm@web32007.mail.mud.yahoo.com> References: <20110504131917.GD2970@x201> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33445) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIp8R-0005Lu-GJ for emacs-orgmode@gnu.org; Sat, 07 May 2011 17:34:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIp8Q-00057l-4S for emacs-orgmode@gnu.org; Sat, 07 May 2011 17:33:59 -0400 Received: from nm7.bullet.mail.ac4.yahoo.com ([98.139.52.204]:34320) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QIp8Q-00057g-0p for emacs-orgmode@gnu.org; Sat, 07 May 2011 17:33:58 -0400 In-Reply-To: <20110504131917.GD2970@x201> 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: Russell Adams Cc: emacs-orgmode@gnu.org This is very close ... I think. The problem is that the file name needs to = be formatted for Windows. Currently its formatted using unix style forward= slashes. The file name that is passed to irfan in the call process needs t= o be formatted with Windows style backslashes. Without this fix, irfan will= complain that it doesn't recognize the file type. In other languages I cou= ld figure out how to do the replace sequence, but it would take me awhile i= n lisp. Is there a quick fix? Thanks! Mark --- On Wed, 5/4/11, Russell Adams wrote: > From: Russell Adams > Subject: Re: [O] insert picture feature request. > To: "Rainer Stengele" > Date: Wednesday, May 4, 2011, 6:19 AM > On Wed, May 04, 2011 at 12:01:53PM > +0200, Rainer Stengele wrote: >=20 > > i_view32.exe /capture=3D2 > /convert=3Dc:\capture_$U(%d%m%Y_%H%M%S).jpg >=20 > (defun org-screenshot () > =A0 "Take a screenshot into a time stamped > =A0=A0=A0unique-named file in the same directory > as > =A0=A0=A0the org-buffer and insert a link to this > file." > =A0 (interactive) > =A0 (setq filename > =A0 =A0 =A0 =A0 (concat > =A0 =A0 =A0 =A0=A0=A0(make-temp-name > =A0 =A0 =A0 =A0 =A0 (concat > (buffer-file-name) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 "_" > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0 (format-time-string > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > =A0=A0=A0"%Y%m%d_%H%M%S_")) ) ".png")) > =A0 (call-process "i_view32.exe" nil nil nil > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 > "/capture=3D2" (concat "/convert=3D" filename) ) > =A0 (insert (concat "[[" filename "]]")) > =A0 (org-display-inline-images)) >=20 > Does that work? Elisp is formatting the filename based on > the Org > buffer you're in and adding a timestamp. >=20 > ------------------------------------------------------------------ > Russell Adams=A0 =A0 =A0 =A0 =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 RLAdams@AdamsInfoServ.com >=20 > PGP Key ID:=A0 =A0=A0=A00x1160DCB3=A0 =A0 > =A0 =A0 =A0=A0=A0http://www.adamsinfoserv.com/ >=20 > Fingerprint:=A0 =A0 1723 D8CA 4280 1EC9 557F=A0 > 66E8 1154 E018 1160 DCB3 >=20 >