From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pablo S. Casas Subject: Re: orgmode & pdf-tools Date: Sun, 24 Jul 2016 20:03:04 +0200 (CEST) Message-ID: <20160724.200304.2127422935039262718.pabloscasas@gmail.com> References: <1752382.rEMxcOGRGz@linux-k2bd.site> <1977566.qrrg7b00tQ@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]:49961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRNk1-0000fN-Iz for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 14:03:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRNjx-0006Ud-CX for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 14:03:04 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRNjx-0006UT-5t for emacs-orgmode@gnu.org; Sun, 24 Jul 2016 14:03:01 -0400 Received: by mail-wm0-f65.google.com with SMTP id i5so13586984wmg.2 for ; Sun, 24 Jul 2016 11:03:00 -0700 (PDT) In-Reply-To: <1977566.qrrg7b00tQ@linux-k2bd.site> 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: AW Cc: emacs-orgmode@gnu.org From: AW Subject: Re: [O] orgmode & pdf-tools Date: Tue, 19 Apr 2016 21:53:23 +0200 > . . . A N D openSUSE! > > Links of the form [[./foo.pdf::3]] still are being opened on p. 1 instead of > page 3. For description of my issue, see my report from April 3rd below. > > Me, being a user, I can't solve this. I'm on openSuse, current Tumbleweed. I > managed to install PDF-Tools properly, after I found out that you need to > install Cask before loading down the package via Melpa. > > Those lines below from my .emacs work in other installations, as the > maintainer of org-pdfview.el wrote. > (https://github.com/markus1189/org-pdfview/issues/10) > > I build a short .emacs, only the necessary links and packages, to orgmode and > PDF-Tools. No success. > > IS SOMEBODY READING THIS WHO USES openSUSE ? > > I tried but failed to find an error with edebug, but this seems way beyond my > skills. > > Am Sonntag, 3. April 2016, 12:19:33 CEST schrieb AW: >> Hi! >> >> Linux, Orgmode 8.3.4, org-file with many links. Recently I discovered pdf- >> tools, which can display PDFs inside Emacs, just like docview, but much >> faster. >> >> I'd like to >> >> 1. open via a given link from inside the org-file using C-c C-o >> >> 2. the PDF with pdf-tools >> >> 3. on a given page. >> >> Result: PDF is being opened, but always on p. 1 instead of e.g. page 5! >> >> .emacs: >> >> (eval-after-load 'org '(require 'org-pdfview)) >> (delete '("\\.pdf\\'" . default) org-file-apps) >> (add-to-list 'org-file-apps '("\\.pdf\\'" . org-pdfview-open)) >> (add-to-list 'org-file-apps '("\\.pdf::\\([[:digit:]]+\\)\\'" . org-pdfview- >> open)) >> >> link in org-file: >> >> [[./localfile.pdf::5]] >> >> >> Same setup works under windows with other viewer. So probably there is an >> error in those lines above. Any hints? -- Thank you! >> >> Regards, >> >> Alexander After edebugging org-open-file I found a possible solution. The documentation string for org-file-apps should be modified for the sexp case to use the link variable instead of file. #+BEGIN_SRC elisp (add-to-list 'org-file-apps '("\\.pdf\\'" . (org-pdfview-open link))) (add-to-list 'org-file-apps '("\\.pdf::\\(\\d+\\)\\'" . (org-pdfview-open link))) #+END_SRC