emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link)


From: AW
Subject: [O] Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ?
Date: Wed, 09 Nov 2016 11:01:13 +0100
User-agent: KMail/5.3.2 (Linux/4.8.6-2-default; KDE/5.27.0; x86_64; ; )

Hi!

To display a PDF from orgmode, I'm using pdf-tools and a package called org-
pdfview. 

Code from .emacs to this end:

,----
|  (eval-after-load 'org '(require 'org-pdfview))
|  (delete '("\\.pdf\\'" . default) org-file-apps)
| (add-to-list 'org-file-apps '("\\.pdf\\'" . (org-pdfview-open link)))
| (add-to-list 'org-file-apps '("\\.pdf::\\(\\d+\\)\\'" . (org-pdfview-open 
link)))
`----

Error message, when trying to open a link using C-c C-o: 

,----
| user-error: Please see Org News for version 9.0 about `org-file-apps'--
Error:
| Deprecated usage of (org-pdfview-open link)
`----

Unfortunately I'm lacking the elisp skills to understand the hint in the Org 
News:

,----
| *** ~org-file-apps~ no longer accepts S-expressions as commands
| 
| The variable now accepts functions of two arguments instead of plain
| S-expressions.  Replacing a S-expresion with an appropriate function
| is straightforward.  For example
| 
| : ("pdf" . (foo))
| 
| becomes
| 
| : ("pdf" . (lambda (file link) (foo)))
`----

OK, I don't speak lisp, but I tried this in my .emacs:

,----
| (add-to-list 'org-file-apps '("\\.pdf\\'" . (lambda (link)   ( org-pdfview-
open))))
| (add-to-list 'org-file-apps '("\\.pdf::\\(\\d+\\)\\'" . (lambda (link) (org-
pdfview-open))))
`----

Well, error message when trying to open a link to a PDF: 

,----
| user-error: Please see Org News for version 9.0 about `org-file-apps'--Lisp 
error: (lambda (link) (org-pdfview-open))
`----

Maybe someone can help me to adapt the code; would appreciate much!

Regards,

Alexander



reply via email to

[Prev in Thread] Current Thread [Next in Thread]