]> git.eshelyaron.com Git - sweep.git/commitdiff
FIXED: correctly identify the predicate defined at start of clause
authorEshel Yaron <me@eshelyaron.com>
Thu, 8 Sep 2022 13:49:36 +0000 (16:49 +0300)
committerEshel Yaron <me@eshelyaron.com>
Thu, 8 Sep 2022 13:49:36 +0000 (16:49 +0300)
sweep.el

index 6ab1d6c34af59842593c0f3d0240bcd640913b56..f9968310676bf8871c2ff8eb0ae151d03cb04cf6 100644 (file)
--- a/sweep.el
+++ b/sweep.el
@@ -1150,12 +1150,16 @@ Interactively, a prefix arg means to prompt for BUFFER."
             (string-to-syntax "w")))))
      start end)))
 
+(defun sweep-at-beginning-of-top-term-p ()
+  (and (looking-at-p (rx (seq bol graph)))
+       (not (nth 8 (syntax-ppss)))))
 
 (defun sweep-identifier-at-point (&optional point)
   (let* ((p (or point (point)))
          (beg (save-mark-and-excursion
                 (goto-char p)
-                (sweep-beginning-of-top-term)
+                (unless (sweep-at-beginning-of-top-term-p)
+                  (sweep-beginning-of-top-term))
                 (point)))
          (end (save-mark-and-excursion
                 (goto-char p)