From 374efdd63e22215984bf2c8a8c54862788797130 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Tue, 18 Dec 2012 15:09:40 +0100 Subject: [PATCH] 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. --- lisp/org.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 8c6f7ec15..93ec8d6ed 100644 --- a/lisp/org.el +++ b/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. -- 2.11.4.GIT