* Re: [Emacs-diffs] master bc2a93d: Fix more regular expression typos
[not found] ` <20190319000239.D3DC7209E0@vcs0.savannah.gnu.org>
@ 2019-03-20 12:26 ` Stefan Monnier
2019-03-20 13:01 ` Mattias Engdegård
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2019-03-20 12:26 UTC (permalink / raw
To: Paul Eggert; +Cc: emacs-devel
> diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
> index d4ee2c3..ef285db 100644
> --- a/lisp/pcomplete.el
> +++ b/lisp/pcomplete.el
> @@ -768,7 +768,7 @@ this is `comint-dynamic-complete-functions'."
> (push (point) begins)
> (while
> (progn
> - (skip-chars-forward "^ \t\n\\")
> + (skip-chars-forward "^ \t\n")
> (when (eq (char-after) ?\\)
> (forward-char 1)
> (unless (eolp)
Hmm... no this needs to be
(skip-chars-forward "^ \t\n\\")
or
(skip-chars-forward "^ \t\n\\\\")
-- Stefan "who happened to look at it right now"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master bc2a93d: Fix more regular expression typos
2019-03-20 12:26 ` [Emacs-diffs] master bc2a93d: Fix more regular expression typos Stefan Monnier
@ 2019-03-20 13:01 ` Mattias Engdegård
2019-03-20 13:14 ` Stefan Monnier
0 siblings, 1 reply; 5+ messages in thread
From: Mattias Engdegård @ 2019-03-20 13:01 UTC (permalink / raw
To: Stefan Monnier; +Cc: Paul Eggert, emacs-devel
20 mars 2019 kl. 13.26 skrev Stefan Monnier <monnier@iro.umontreal.ca>:
>
>> (progn
>> - (skip-chars-forward "^ \t\n\\")
>> + (skip-chars-forward "^ \t\n")
>> (when (eq (char-after) ?\\)
>> (forward-char 1)
>> (unless (eolp)
>
> Hmm... no this needs to be
>
> (skip-chars-forward "^ \t\n\\")
> or
> (skip-chars-forward "^ \t\n\\\\")
Are you sure? Trailing backslashes in skip-sets have no effect, and semantically the backslash cannot reasonably be included because of the condition that follows.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master bc2a93d: Fix more regular expression typos
2019-03-20 13:01 ` Mattias Engdegård
@ 2019-03-20 13:14 ` Stefan Monnier
2019-03-20 13:33 ` Mattias Engdegård
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2019-03-20 13:14 UTC (permalink / raw
To: emacs-devel
>>> (progn
>>> - (skip-chars-forward "^ \t\n\\")
>>> + (skip-chars-forward "^ \t\n")
>>> (when (eq (char-after) ?\\)
>>> (forward-char 1)
>>> (unless (eolp)
>>
>> Hmm... no this needs to be
[...]
> Are you sure? Trailing backslashes in skip-sets have no effect, and
> semantically the backslash cannot reasonably be included because of the
> condition that follows.
Notice it's a negated skip, so with (skip-chars-forward "^ \t\n") we'll
happily skip over a backslash, and hence the subsequent (eq (char-after) ?\\)
can never be true.
The skip+when do the equivalent of a regexp "[^ \t\n\\]\\|\\\\.".
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master bc2a93d: Fix more regular expression typos
2019-03-20 13:14 ` Stefan Monnier
@ 2019-03-20 13:33 ` Mattias Engdegård
2019-03-20 16:24 ` Paul Eggert
0 siblings, 1 reply; 5+ messages in thread
From: Mattias Engdegård @ 2019-03-20 13:33 UTC (permalink / raw
To: Stefan Monnier; +Cc: emacs-devel
20 mars 2019 kl. 14.14 skrev Stefan Monnier <monnier@iro.umontreal.ca>:
>
> Notice it's a negated skip, so with (skip-chars-forward "^ \t\n") we'll
> happily skip over a backslash, and hence the subsequent (eq (char-after) ?\\)
> can never be true.
Sorry, you are right -- I didn't notice the negation. The "\\\\" should be included.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Emacs-diffs] master bc2a93d: Fix more regular expression typos
2019-03-20 13:33 ` Mattias Engdegård
@ 2019-03-20 16:24 ` Paul Eggert
0 siblings, 0 replies; 5+ messages in thread
From: Paul Eggert @ 2019-03-20 16:24 UTC (permalink / raw
To: Mattias Engdegård, Stefan Monnier; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 135 bytes --]
On 3/20/19 6:33 AM, Mattias Engdegård wrote:
> The "\\\\" should be included.
Thanks to both of you. I installed the attached.
[-- Attachment #2: 0001-Fix-pcomplete-typo-in-recent-regex-typo-fix.patch --]
[-- Type: text/x-patch, Size: 964 bytes --]
From 8c30a1c51214058f28014953fc5b23d3cf9e3826 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 20 Mar 2019 09:23:05 -0700
Subject: [PATCH] Fix pcomplete typo in recent regex typo fix
Problem reported by Stefan Monnier in:
https://lists.gnu.org/r/emacs-devel/2019-03/msg00682.html
* lisp/pcomplete.el (pcomplete-parse-comint-arguments):
Restore the trailing backslash (but two of them this time).
---
lisp/pcomplete.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index ef285db57e..d0f2a2e24d 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -768,7 +768,7 @@ pcomplete-parse-comint-arguments
(push (point) begins)
(while
(progn
- (skip-chars-forward "^ \t\n")
+ (skip-chars-forward "^ \t\n\\\\")
(when (eq (char-after) ?\\)
(forward-char 1)
(unless (eolp)
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-03-20 16:24 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20190319000234.5983.14812@vcs0.savannah.gnu.org>
[not found] ` <20190319000239.D3DC7209E0@vcs0.savannah.gnu.org>
2019-03-20 12:26 ` [Emacs-diffs] master bc2a93d: Fix more regular expression typos Stefan Monnier
2019-03-20 13:01 ` Mattias Engdegård
2019-03-20 13:14 ` Stefan Monnier
2019-03-20 13:33 ` Mattias Engdegård
2019-03-20 16:24 ` Paul Eggert
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).