bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#29821: Ensure quick substitution only occurs at start of line


From: Jay Kamat
Subject: bug#29821: Ensure quick substitution only occurs at start of line
Date: Tue, 02 Jan 2018 09:48:00 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux)

Noam Postavsky <npostavs@users.sourceforge.net> writes:

> Couldn't you error here (if the line matches ^...^...^) instead of
> returning nil, and then avoid affecting the other substitution?
> (although I agree signaling an error in the other place is probably
> acceptable)

I could be missing something, but I don't think this is that easy. In
the case of a failed search for something like '!!:s/a/b/',
`eshell-history-reference' previously returned the previous line,
unmodified. I could pull the previous line and compare it with the one
returned to see if `eshell-history-reference' has modified it, but I
don't like that solution, it seems like a bit of a hack. Let me know if
you think that's better though, or if I have it wrong...

If we really want to preserve the previous behavior of
'echo "foo"(:s/bar/baz/)', I would prefer setting a lexical variable
around functions like `eshell-pred-substitute' so it can figure out
which type of substitution it's in and error accordingly.

Thanks,
-Jay





reply via email to

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