fuxialexander / org-pdftools

A custom org link type for pdf-tools
GNU General Public License v3.0
335 stars 36 forks source link

org-pdftools-complete-link inserts pdfview link, not pdftools #8

Closed mohkale closed 4 years ago

mohkale commented 4 years ago

I've been having some trouble getting this plugin setup. Whenever I run org-insert-link, choose pdftools, insert a link and then try to open it; emacs says file not found. I've finally figured out that it's because the link is being written as:

[[pdfview:COM2004/Week 1/Week1a.handout.pdf::1][welcome]] buddy

but pdftools is registered (and only seems to work with) with the link:

[[pdftools:COM2004/Week 1/Week1a.handout.pdf::1][welcome]] buddy

it's this line in pdftools.el that's causing the issue. I've added the following to my config file to fix it for now.

;; register pdfview as an alias for pdftools.
(if (fboundp 'org-link-set-parameters)
    (funcall 'org-link-set-parameters
             "pdfview"
             (cdr (assoc "pdftools" org-link-parameters)))
  (org-add-link-type
   "pdfview" 'org-pdftools-open))

but this results in both pdftools and pdfview being shown as options in org-insert-link despite being aliases for each other. I'd like an upstream fix for this.