From mboxrd@z Thu Jan 1 00:00:00 1970 From: AW Subject: Adapting to orgmode 9.0: deprecated usage of (org-pdfview-open link) - howto ? Date: Wed, 09 Nov 2016 11:01:13 +0100 Message-ID: <7214691.semUaP70I3@linux-k2bd.site> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4Ph6-0005RY-4q for emacs-orgmode@gnu.org; Wed, 09 Nov 2016 05:01:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4Ph1-0004Gl-Am for emacs-orgmode@gnu.org; Wed, 09 Nov 2016 05:01:24 -0500 Received: from mailout12.t-online.de ([194.25.134.22]:58821) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c4Ph1-0004Bp-40 for emacs-orgmode@gnu.org; Wed, 09 Nov 2016 05:01:19 -0500 Received: from fwd29.aul.t-online.de (fwd29.aul.t-online.de [172.20.26.134]) by mailout12.t-online.de (Postfix) with SMTP id 02FB641F479F for ; Wed, 9 Nov 2016 11:01:17 +0100 (CET) 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: emacs-orgmode@gnu.org 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