From mboxrd@z Thu Jan 1 00:00:00 1970 From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Subject: Re: Define Keyboard Shortcut for "Open in Emacs" Date: Fri, 03 Apr 2015 13:27:21 -0400 Message-ID: <877fttjf5y.fsf@yale.edu> References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye5NZ-0006Gp-2e for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 13:27:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ye5NT-0002iZ-TY for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 13:27:37 -0400 Received: from plane.gmane.org ([80.91.229.3]:58658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ye5NT-0002iP-NX for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 13:27:31 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ye5NR-0007DN-4R for emacs-orgmode@gnu.org; Fri, 03 Apr 2015 19:27:29 +0200 Received: from nat-130-132-173-151.central.yale.edu ([130.132.173.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Apr 2015 19:27:29 +0200 Received: from jorge.alfaro-murillo by nat-130-132-173-151.central.yale.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Apr 2015 19:27:29 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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.