From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: [BUG] turn-on-org-cdlatex Date: Fri, 03 Aug 2012 00:38:16 +0100 Message-ID: <87zk6c6f13.fsf@pank.lan> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx4yR-0005nd-7I for emacs-orgmode@gnu.org; Thu, 02 Aug 2012 19:38:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sx4yP-0001Rf-UH for emacs-orgmode@gnu.org; Thu, 02 Aug 2012 19:38:35 -0400 Received: from plane.gmane.org ([80.91.229.3]:47221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sx4yP-0001RP-NX for emacs-orgmode@gnu.org; Thu, 02 Aug 2012 19:38:33 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Sx4yO-0007Ck-HX for emacs-orgmode@gnu.org; Fri, 03 Aug 2012 01:38:32 +0200 Received: from 93-96-208-164.zone4.bethere.co.uk ([93.96.208.164]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Aug 2012 01:38:32 +0200 Received: from rasmus by 93-96-208-164.zone4.bethere.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Aug 2012 01:38:32 +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 Hi, It would seem there is a bug in turn-on-org-cdlatex whenever _ or ^ is called. And perhaps others. To reproduce: bash> emacs -q In *scratch* #+begin_src emacs-lisp ;; adjust the two following lines to your system (load-file "/usr/share/emacs/site-lisp/auctex/texmathp.el") (load-file "~/.emacs.d/elpa/cdlatex-4.0/cdlatex.el") (require 'cdlatex) (add-hook 'org-mode-hook 'turn-on-org-cdlatex) (switch-to-buffer "test.org") #+end_src Then M-x org-mode #+begin_src org * test insert `$' then `x' then `_' then `1', i.e. $x_1$ #+end_src I get the following backtrace Debugger entered--Lisp error: (void-variable last-command-char) (char-to-string last-command-char) (concat (char-to-string last-command-char) "{") (string= (buffer-substring (max (point-min) (- (point) 2)) (point)) (concat (char-to-string last-command-char) "{")) (if (string= (buffer-substring (max (point-min) (- (point) 2)) (point)) (concat (char-to-string last-command-char) "{")) (progn (backward-char 1) (insert last-command-char) (forward-char 1)) (insert last-command-char) (insert "{}") (forward-char -1)) (if (cdlatex-number-of-backslashes-is-odd) (insert last-command-char) (if (not (texmathp)) (cdlatex-dollar)) (if (string= (buffer-substring (max (point-min) (- (point) 2)) (point)) (concat (char-to-string last-command-char) "{")) (progn (backward-char 1) (insert last-command-char) (forward-char 1)) (insert last-command-char) (insert "{}") (forward-char -1))) cdlatex-sub-superscript() call-interactively(cdlatex-sub-superscript) org-cdlatex-underscore-caret(nil) call-interactively(org-cdlatex-underscore-caret nil nil) System: GNU Emacs 24.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.4) of 2012-08-02 on rasmus Org-mode version 7.8.11 (release_7.8.11-338-gecba55 @ /usr/share/emacs/site-lisp/org/) -- In theory, practice and theory are the same. In practice they are not