jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) writes: > 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 Good idea - I will keep this in mind and see. > > Alternatively, if you are on Linux, you could make your > emacsclient your default pdf-viewer: Nope - Mac. Thanks, Rainer > > #+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, -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982