emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/orgalist d22e391 2/4: Fix lax check


From: Nicolas Goaziou
Subject: [elpa] externals/orgalist d22e391 2/4: Fix lax check
Date: Sat, 15 Sep 2018 10:59:43 -0400 (EDT)

branch: externals/orgalist
commit d22e3919c46801e95ac9ef3464509b5f88e9e99f
Author: Nicolas Goaziou <address@hidden>
Commit: Nicolas Goaziou <address@hidden>

    Fix lax check
    
    * orgalist.el (orgalist--at-item-p): Make sure boundaries are actually
      checked.  Small refactoring.
---
 orgalist.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/orgalist.el b/orgalist.el
index 3ac628d..1d6a765 100644
--- a/orgalist.el
+++ b/orgalist.el
@@ -260,11 +260,11 @@ Return nil if Orgalist mode is not active."
 
 (defun orgalist--at-item-p ()
   "Non-nil if point is at an item."
-  (and (orgalist--boundaries)            ;check context
-       (save-excursion
-         (beginning-of-line)
-         (looking-at-p
-          "[ \t]*\\(?:[-+]\\|\\(?:[a-zA-Z]\\|[0-9]+\\)\\.\\)\\([ 
\t]\\|$\\)"))))
+  (pcase (orgalist--boundaries)
+    (`(,min . ,max)
+     (and (<= min (point))
+          (>= max (point))
+          (org-match-line (concat "[ \t]*" orgalist--bullet-re))))))
 
 (defun orgalist--in-item-p ()
   "Return item beginning position when in a plain list, nil otherwise."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]