瀏覽代碼

org.el (org-raise-scripts): Handle scripts like "a_b^c"

* org.el (org-toggle-pretty-entities): Enhance messages.
(org-raise-scripts): Handle scripts like "a_b^c".

Thanks to Jae Hee Lee for reporting this.
Bastien Guerry 12 年之前
父節點
當前提交
b802df337a
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      lisp/org.el

+ 5 - 5
lisp/org.el

@@ -6211,11 +6211,11 @@ needs to be inserted at a specific position in the font-lock sequence.")
   (org-set-local 'org-pretty-entities (not org-pretty-entities))
   (org-restart-font-lock)
   (if org-pretty-entities
-      (message "Entities are displayed as UTF8 characters")
+      (message "Entities are now displayed as UTF8 characters")
     (save-restriction
       (widen)
       (org-decompose-region (point-min) (point-max))
-      (message "Entities are displayed plain"))))
+      (message "Entities are now displayed as plain text"))))
 
 (defvar org-custom-properties-overlays nil
   "List of overlays used for custom properties.")
@@ -6385,10 +6385,10 @@ and subscripts."
 	       (keyw-p (eq 'org-special-keyword (get-text-property mpos 'face))))
 	  (goto-char (point-at-bol))
 	  (setq table-p (org-looking-at-p org-table-dataline-regexp)
-		comment-p (org-looking-at-p "[ \t]*#"))
+		comment-p (org-looking-at-p "^[ \t]*#[ +]"))
 	  (goto-char pos)
-	  ;; FIXME: Should we go back one character here, for a_b^c
-	  ;; (goto-char (1- pos)) ;????????????????????
+	  ;; Handle a_b^c
+	  (if (member (char-after) '(?_ ?^)) (goto-char (1- pos)))
 	  (if (or comment-p emph-p link-p keyw-p)
 	      t
 	    (put-text-property (match-beginning 3) (match-end 0)