浏览代码

Fix false positives in `org-in-verbatim-emphasis'

* lisp/org.el (org-in-verbatim-emphasis): Fix false positive when
  point is just after the closing emphasis marker.
Nicolas Goaziou 12 年之前
父节点
当前提交
f26547e320
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      lisp/org.el

+ 4 - 1
lisp/org.el

@@ -20733,7 +20733,10 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
 
 (defun org-in-verbatim-emphasis ()
   (save-match-data
-    (and (org-in-regexp org-emph-re 2) (member (match-string 3) '("=" "~")))))
+    (and (org-in-regexp org-emph-re 2)
+	 (>= (point) (match-beginning 3))
+	 (<= (point) (match-end 4))
+	 (member (match-string 3) '("=" "~")))))
 
 (defun org-goto-marker-or-bmk (marker &optional bookmark)
   "Go to MARKER, widen if necessary.  When marker is not live, try BOOKMARK."