From c69c6bad3c92ff2a15d893513bb627ee5f39426e Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 8 Sep 2022 16:49:36 +0300 Subject: [PATCH] FIXED: correctly identify the predicate defined at start of clause --- sweep.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sweep.el b/sweep.el index 6ab1d6c..f996831 100644 --- 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) -- 2.39.2