Rainer M Krug writes:
I would like to open pdfs in emacs (using pdf-viewer) but there
is only a shortcut (C-c C-o) to open a pdf externally, and no
shortcut for the menu item below "Open in Emacs" in the context
menu.
How can I define a shortcut for this command (or re-use C-c
C-o)?
If you want C-c C-o to open in emacs, you can configure your
org-file-apps:
#+BEGIN_SRC emacs-lisp
(eval-after-load "org"
'(if (assoc "\\.pdf\\'" org-file-apps)
(setcdr (assoc "\\.pdf\\'" org-file-apps) 'emacs)
(add-to-list 'org-file-apps '("\\.pdf\\'" . 'emacs) t)))
#+END_SRC
Alternatively, if you are on Linux, you could make your
emacsclient your default pdf-viewer:
#+BEGIN_SRC shell
xdg-mime default emacsclient.desktop application/pdf
#+END_SRC
Then the external program called by C-c C-o would also be emacs =)
Best,
--
Jorge.