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

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

[nongnu] elpa/sweeprolog 556521bbc3: * sweep.pl (list_tail/2): Fix possi


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 556521bbc3: * sweep.pl (list_tail/2): Fix possible non-termination
Date: Wed, 4 Jan 2023 03:59:53 -0500 (EST)

branch: elpa/sweeprolog
commit 556521bbc3de285e38e598d294b2e7b24a1e6b1d
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    * sweep.pl (list_tail/2): Fix possible non-termination
---
 README.org          | 2 +-
 sweep.pl            | 2 +-
 sweeprolog-tests.el | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 757f19e650..b66ceb3011 100644
--- a/README.org
+++ b/README.org
@@ -1338,7 +1338,7 @@ command ~M-x sweeprolog-term-search~.  This command, 
bound by default to
 ~C-c C-s~ in ~sweeprolog-mode~ buffers, prompts for a Prolog term to
 search for and finds terms in the current buffer that the search term
 subsumes.  For example, to find if-then-else constructs in the current
-buffer do ~C-c C-s _ ; _ -> _ RET~.
+buffer do ~C-c C-s _ -> _ ; _ RET~.
 
 #+FINDEX: sweeprolog-term-search-repeat-forward
 #+FINDEX: sweeprolog-term-search-repeat-backward
diff --git a/sweep.pl b/sweep.pl
index e7e3c46223..c9fdf80312 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -1028,5 +1028,5 @@ sweep_match_term(parentheses_term_position(_, _, 
ContentPos), Term0, Term, From,
 sweep_match_term(quasi_quotation_position(_, _, SyntaxTerm, SyntaxPos, _), _, 
Term, From, To) :-
     sweep_match_term(SyntaxPos, SyntaxTerm, Term, From, To).
 
-list_tail([_|T0], T) :- T0 = [_|_], !, list_tail(T0, T).
+list_tail([_|T0], T) :- nonvar(T0), T0 = [_|_], !, list_tail(T0, T).
 list_tail([_|T], T).
diff --git a/sweeprolog-tests.el b/sweeprolog-tests.el
index f2d4206dab..5fa1cf8df9 100644
--- a/sweeprolog-tests.el
+++ b/sweeprolog-tests.el
@@ -85,6 +85,7 @@ foo(Baz) :- baz.
                               "pl"
                               "
 bar(bar(bar), bar{bar:bar}, [bar,bar|bar]).
+foo([Bar|Baz]).
 ")))
     (find-file-literally temp)
     (sweeprolog-mode)



reply via email to

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