From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-pdfview-open doesn't work anymore Date: Fri, 05 Feb 2016 14:36:00 +0100 Message-ID: <87a8nfqny7.fsf@nicolasgoaziou.fr> References: <87a8nfzp44.fsf@free.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRgWO-0006aZ-SA for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 08:34:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aRgWN-0005uW-PB for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 08:34:00 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:59129) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aRgWN-0005uQ-9P for emacs-orgmode@gnu.org; Fri, 05 Feb 2016 08:33:59 -0500 In-Reply-To: (Michael Brand's message of "Fri, 5 Feb 2016 09:33:38 +0100") 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: Michael Brand Cc: Org Mode , Julien Cubizolles Hello, Michael Brand writes: > Hi Julien > > On Fri, Feb 5, 2016 at 6:46 AM, Julien Cubizolles wrote: >> I've been using org-pdfview (from >> https://github.com/markus1189/org-pdfview) to have org-mode open pdf >> files generated during export. >> >> --8<---------------cut here---------------start------------->8--- >> (pdf-tools-install) >> (eval-after-load 'org '(progn (require 'org-pdfview) >> (add-to-list 'org-file-apps '("\\.pdf\\'" . org-pdfview-open)) >> )) >> --8<---------------cut here---------------end--------------->8--- >> >> Since a recent upgrade, this fails with: >> >> --8<---------------cut here---------------start------------->8--- >> (wrong-number-of-arguments #[(link) "\304\305 \"\2031\306\307 \"\310\306\311 \"!\310\306\312 \"!\313 \307\"\210\314 >> !\210\315\316 \317 @_\320 \245!!+\207\304\321 \"\203N\306\307 \"\310\306\311 \"!\313 \307\"\210\314 >> !*\207\313 \307\"\207" [link path page height string-match "\\(.*\\)::\\([0-9]*\\)\\+\\+\\([[0-9]\\.*[0-9]*\\)" match-string 1 string-to-number 2 3 org-open-file pdf-view-goto-page image-set-window-vscroll round pdf-view-image-size frame-char-height "\\(.*\\)::\\([0-9]+\\)$"] 4 ("/home/wilk/.emacs.d/elpa/org-pdfview-20160125.1254/org-pdfview.elc" . 662)] 2) >> org-pdfview-open("/home/wilk/enseignement/2015-2016/topos/topo-tipe-beamer.pdf" "/home/wilk/enseignement/2015-2016/topos/topo-tipe-beamer.pdf") >> --8<---------------cut here---------------end--------------->8--- >> >> Is it a bug in Org-mode or should I report the issue to the org-pdfview >> author ? > > Due to lexical binding in org.el there was a change in > `org-file-apps', see Org News for version 9.0 and e. g. this thread: > http://thread.gmane.org/gmane.emacs.orgmode/104272 > I think the most convenient would be if `org-open-file' tries to find > out that `cmd' in this case is a function with only one argument and > call it with just `file'. > > @Nicolas: Is this reasonable for you to implement? I think the simplest solution may be to follow the advice in ORG-NEWS and use (lambda (file link) (org-pdfview-open file)) Regards, -- Nicolas Goaziou