From f5f6d10e5d55f68d57abd2f7a947f72cb90081d0 Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Tue, 10 Dec 2013 21:19:23 -0500 Subject: [PATCH] org-element: respect the `org-use-sub-superscripts' variable * lisp/org-element.el (org-element-sub/superscript-successor): respect the `org-use-sub-superscripts' variable --- lisp/org-element.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 9183a67..d0e6bf9 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -3394,11 +3394,15 @@ CONTENTS is the contents of the object." Return value is a cons cell whose CAR is either `subscript' or `superscript' and CDR is beginning position." - (save-excursion - (unless (bolp) (backward-char)) - (when (re-search-forward org-match-substring-regexp nil t) - (cons (if (string= (match-string 2) "_") 'subscript 'superscript) - (match-beginning 2))))) + (when org-use-sub-superscripts + (save-excursion + (unless (bolp) (backward-char)) + (when (re-search-forward (if (eq org-use-sub-superscripts '{}) + org-match-substring-with-braces-regexp + org-match-substring-regexp) + nil t) + (cons (if (string= (match-string 2) "_") 'subscript 'superscript) + (match-beginning 2)))))) ;;;; Superscript -- 1.8.5.1