[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Define Keyboard Shortcut for "Open in Emacs"
From: |
Jorge A. Alfaro-Murillo |
Subject: |
Re: [O] Define Keyboard Shortcut for "Open in Emacs" |
Date: |
Fri, 03 Apr 2015 13:27:21 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
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.
Re: [O] Define Keyboard Shortcut for "Open in Emacs", Rainer M Krug, 2015/04/07