Explorar o código

org.el (org-in-fixed-width-region-p): Rewrite using org-element.el.

* org.el (org-in-fixed-width-region-p): Rewrite using
org-element.el.

Thanks to Nicolas Goaziou for suggesting this.
Bastien Guerry %!s(int64=12) %!d(string=hai) anos
pai
achega
374efdd63e
Modificáronse 1 ficheiros con 3 adicións e 6 borrados
  1. 3 6
      lisp/org.el

+ 3 - 6
lisp/org.el

@@ -20253,12 +20253,9 @@ when point is at #+BEGIN_SRC or #+END_SRC."
 		 (move-beginning-of-line 1)
 		 (looking-at ".*#\\+\\(BEGIN\\|END\\)_SRC")))))))
 
-(defun org-in-fixed-width-region-p ()
-  "Whether point is in a fixed-width region."
-  (save-match-data
-    (save-excursion
-      (beginning-of-line 1)
-      (looking-at "^: "))))
+(defsubst org-in-fixed-width-region-p ()
+  "Is point in a fixed-width region?"
+  (eq 'fixed-width (org-element-type (org-element-at-point))))
 
 (defun org-context ()
   "Return a list of contexts of the current cursor position.