From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: make svg files open in inkscape? Date: Sat, 17 Feb 2018 18:35:00 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114989848e75bb0565736cfd" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1enEoh-0003xe-0T for emacs-orgmode@gnu.org; Sat, 17 Feb 2018 21:35:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1enEog-0006Xf-17 for emacs-orgmode@gnu.org; Sat, 17 Feb 2018 21:35:03 -0500 Received: from mail-wr0-x236.google.com ([2a00:1450:400c:c0c::236]:40038) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1enEof-0006VK-Op for emacs-orgmode@gnu.org; Sat, 17 Feb 2018 21:35:01 -0500 Received: by mail-wr0-x236.google.com with SMTP id o76so6356850wrb.7 for ; Sat, 17 Feb 2018 18:35:01 -0800 (PST) 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" To: Org Mode List --001a114989848e75bb0565736cfd Content-Type: text/plain; charset="UTF-8" Sorry, premature send... > I previously wrote this solution: https://emacs. > stackexchange.com/questions/38345/open-an-external-sketch- > drawing-application > > to make svg links open in inkscape, even if they don't already exist. > It turns out inkscape does not let you create files in a command line. > > I wanted to try using org-file-apps for this: > > #+BEGIN_SRC emacs-lisp > (defun my-svg (path link) > > (message "path: %s - %s" path link)) > > (add-to-list 'org-file-apps '("\\.svg\\'" . my-svg)) > #+END_SRC > > my-svg would eventually create a template file if the file doesn't exist, but in this form it doesn't work for files that don't exist yet. Is it expected that the files exist for file:some-file.svg when you click on them? > John > > ----------------------------------- > Professor John Kitchin > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 <(412)%20268-7803> > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > --001a114989848e75bb0565736cfd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Sorry, premature send...
I previ= ously wrote this solution:=C2=A0https://emacs.stackexchange.com/questions/38345/open-an-exter= nal-sketch-drawing-application=C2=A0

to make sv= g links open in inkscape, even if they don't already exist.
=

It turns out inkscape does not let you cre= ate files in a command line.
=C2=A0

I wanted to try using org-file-= apps for this:

#+BEGIN_SRC emacs-lisp
(defun my-svg (path link)
=C2=A0=C2=A0
=C2=A0 (messa= ge "path: %s - %s" path link))

(add-to-l= ist 'org-file-apps '("\\.svg\\'" . my-svg))
#+END_SRC


my-svg would eventually create a template file if the file doesn't exi= st, but in this form it doesn't work for files that don't exist yet= .=C2=A0

Is it expected that the files exist for fi= le:some-file.svg when you click on them?

=C2=A0
John

-----------------------------------
Profess= or John Kitchin=C2=A0
Doherty Hall A207F
Department of Chemical Engin= eering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803=

--001a114989848e75bb0565736cfd--