emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ?
@ 2016-11-09 10:01 AW
  2016-11-09 17:00 ` Pablo S. Casas
  0 siblings, 1 reply; 3+ messages in thread
From: AW @ 2016-11-09 10:01 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ?
  2016-11-09 10:01 Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ? AW
@ 2016-11-09 17:00 ` Pablo S. Casas
  2016-11-09 19:10   ` AW
  0 siblings, 1 reply; 3+ messages in thread
From: Pablo S. Casas @ 2016-11-09 17:00 UTC (permalink / raw)
  To: AW; +Cc: emacs-orgmode

From: AW <alexander.willand@t-online.de>
Subject: [O] Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ?
Date: Wed, 09 Nov 2016 11:01:13 +0100

> 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))))
> `----

   For me it works replacing the former:
(add-to-list 'org-file-apps '("\\.pdf\\'" . (org-pdfview-open link)))
(add-to-list 'org-file-apps '("\\.pdf::\\(\\d+\\)\\'" . (org-pdfview-open link)))

by simply:

(add-to-list 'org-file-apps 
'("\\.pdf\\'" . (lambda (file link) (org-pdfview-open link))))

   Hope it helps.

   Pablo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ?
  2016-11-09 17:00 ` Pablo S. Casas
@ 2016-11-09 19:10   ` AW
  0 siblings, 0 replies; 3+ messages in thread
From: AW @ 2016-11-09 19:10 UTC (permalink / raw)
  To: Pablo S. Casas; +Cc: emacs-orgmode

Am Mittwoch, 9. November 2016, 18:00:50 CET schrieb Pablo S.  Casas:
> From: AW <alexander.willand@t-online.de>
> Subject: [O] Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open
> link) - howto ? Date: Wed, 09 Nov 2016 11:01:13 +0100
> 
> > 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))))
> > `----
> 
>    For me it works replacing the former:
> (add-to-list 'org-file-apps '("\\.pdf\\'" . (org-pdfview-open link)))
> (add-to-list 'org-file-apps '("\\.pdf::\\(\\d+\\)\\'" . (org-pdfview-open
> link)))
> 
> by simply:
> 
> (add-to-list 'org-file-apps
> '("\\.pdf\\'" . (lambda (file link) (org-pdfview-open link))))
> 
>    Hope it helps.
> 
>    Pablo

Yes! Thank you! 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-09 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09 10:01 Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ? AW
2016-11-09 17:00 ` Pablo S. Casas
2016-11-09 19:10   ` AW

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).