From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Change key binding in math mode only Date: Thu, 13 Mar 2014 16:11:54 +0100 Message-ID: <87k3byrv45.fsf@bzg.ath.cx> References: <87r46hr904.fsf@gmail.com> <86eh2hpniq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO7Ij-0003Y7-6r for emacs-orgmode@gnu.org; Thu, 13 Mar 2014 11:12:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO7Id-0004Bv-7V for emacs-orgmode@gnu.org; Thu, 13 Mar 2014 11:12:05 -0400 Received: from rs249.mailgun.us ([209.61.151.249]:41149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO7Id-0004Br-2x for emacs-orgmode@gnu.org; Thu, 13 Mar 2014 11:11:59 -0400 In-Reply-To: <86eh2hpniq.fsf@gmail.com> (Rafael's message of "Tue, 04 Mar 2014 17:11:41 -0600") 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: Rafael Cc: emacs-orgmode@gnu.org Hi Rafael, Rafael writes: > I remembered that Org knows already if point is inside a math > expression, so by looking at the source I came up with the following, > that seems to work. Sorry for the noise. That's not noise... > #+BEGIN_SRC emacs-lisp > (defun org-cdlatex-real-numbers () > (interactive) > (if (org-inside-LaTeX-fragment-p) > (insert "\\mathbb{R}") > (insert "R") > )) > > (add-hook 'org-mode-hook > (lambda () > (local-set-key (kbd "R") > 'org-cdlatex-real-numbers > ))) > #+END_SRC ... that's a contribution -- thanks for it! -- Bastien