[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog e02f243b03 3/7: ; Fix filtering of the just cre
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog e02f243b03 3/7: ; Fix filtering of the just created body when extracting goal |
Date: |
Wed, 27 Sep 2023 16:01:32 -0400 (EDT) |
branch: elpa/sweeprolog
commit e02f243b0359006bbe019e18bd67971e01e24a81
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
; Fix filtering of the just created body when extracting goal
* sweeprolog (sweeprolog-extract-region-to-predicate): When searching
and replacing other goals subsumed by the extracted goal, use a more
robust check to filter out the newly created body term from the search
matches.
---
sweeprolog.el | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/sweeprolog.el b/sweeprolog.el
index 39f612ffa4..4a9b15737a 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -7139,7 +7139,8 @@ where in the buffer to insert the newly created
predicate."
(sweeprolog--query-once "sweep" "sweep_term_variable_names"
body)
(prolog-exception
- (user-error "Region does not contain a valid Prolog
term")))))
+ (user-error "Region does not contain a valid Prolog term"))))
+ (def-end nil))
(if (and (sweeprolog--query-once "sweep" "sweep_goal_may_cut" body)
(not (y-or-n-p (concat
"The selected goal contains a cut whose "
@@ -7182,18 +7183,15 @@ where in the buffer to insert the newly created
predicate."
".\n")))
(insert clause)
(indent-region-line-by-line def-beg (point))
+ (setq def-end (point))
(goto-char def-beg))))
(when all
- (let ((body-beg
- (+ 2 (point)
- (length head)
- (length neck)
- sweeprolog-indent-offset)))
+ (let ((def-beg (point)))
(save-excursion
(goto-char (point-min))
(let ((sweeprolog-query-replace-term-include-match-function
- (pcase-lambda (`(,beg . ,_))
- (not (= beg body-beg)))))
+ (pcase-lambda (`(,beg ,end . ,_))
+ (not (<= def-beg beg end def-end)))))
(deactivate-mark)
(sweeprolog-query-replace-term
body head "true" '(goal))))))
- [nongnu] elpa/sweeprolog updated (dba83e95e6 -> 0dd67eba55), ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog c03ac63bdb 1/7: ; (sweep_replace_update_state/7): Fix SSU guard classification, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog 659d6033f4 4/7: ; Avoid relying on 'diff-mode' faces, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog c3cccb68c9 6/7: ; Silence some byte-complier warnings, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog abdd68164a 2/7: ; (sweep_replace_term_r/12): Fix qualified head classification, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog c24190141d 5/7: ; Fix off-by-one in end of next token position for parentheses, ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog 0dd67eba55 7/7: ; Add missing ':type' for 'sweeprolog-top-level-use-pty', ELPA Syncer, 2023/09/27
- [nongnu] elpa/sweeprolog e02f243b03 3/7: ; Fix filtering of the just created body when extracting goal,
ELPA Syncer <=