emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo)
To: emacs-orgmode@gnu.org
Subject: Re: Define Keyboard Shortcut for "Open in Emacs"
Date: Fri, 03 Apr 2015 13:27:21 -0400	[thread overview]
Message-ID: <877fttjf5y.fsf@yale.edu> (raw)
In-Reply-To: m2y4m9xrol.fsf@krugs.de

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.

  parent reply	other threads:[~2015-04-03 17:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03 13:33 Define Keyboard Shortcut for "Open in Emacs" Rainer M Krug
2015-04-03 13:51 ` John Kitchin
2015-04-03 17:04   ` J. David Boyd
2015-04-03 17:35     ` Nicolas Goaziou
2015-04-07 13:06   ` Rainer M Krug
2015-04-03 17:27 ` Jorge A. Alfaro-Murillo [this message]
2015-04-04 21:44   ` Xavier Maillard
2015-04-04 22:56     ` Jorge A. Alfaro-Murillo
2015-04-05  4:59       ` Xavier Maillard
2015-04-06 13:44         ` Jorge A. Alfaro-Murillo
2015-04-07  4:53           ` Xavier Maillard
2015-04-07 13:09   ` Rainer M Krug

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877fttjf5y.fsf@yale.edu \
    --to=jorge.alfaro-murillo@yale.edu \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).