1

When i click or C-c C-o on pdf link in org-mode, Emacs opens the pdf with gimp.

I don't find how to overide this behavior.

Tried with these two recipes

(require 'openwith)
(openwith-mode t)
(add-to-list  'mm-inhibit-file-name-handlers 'openwith-file-handler
(setq openwith-associations '(("\\.pdf\\'" "evince" (file))))

With first recipe, no change on behavior

(org-add-link-type "pdf" 'org-pdf-open nil)

(defun org-pdf-open (link)
  (let* ((path+page (split-string link "#page="))
         (pdf-file (car path+page))
         (page (car (cdr path+page))))
    (start-process "view-pdf" nil "evince" "--page-index" page pdf-file)))

With second recipe, no change in behavior

Can you help me ?

Best regards

  • Please explain what happened with each one of those two "recipes". BTW, I only see one "recipe". – Stefan Mar 31 '20 at 12:39
  • inline change, for the two recipes with result after change. Thanks – olopost Mar 31 '20 at 14:27
  • I'm pretty sure I've heard of people having similar problems (PDF handled by Gimp) where the culprit was linked to Emacs's handling of mailcap settings. Maybe a M-x report-emacs-bug is in order. – Stefan Mar 31 '20 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.