[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29821: Ensure quick substitution only occurs at start of line
From: |
Noam Postavsky |
Subject: |
bug#29821: Ensure quick substitution only occurs at start of line |
Date: |
Mon, 01 Jan 2018 22:58:06 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (gnu/linux) |
Jay Kamat <jaygkamat@gmail.com> writes:
> Ah, I did notice that, but I was not sure whether it was a bug or
> desired behavior (as it seemed to occur for me even before this
> patch).
Oh right, I didn't notice because I tested with spaces. Still, I think
since we're trying to make this behave like bash, we should try to get
as close as possible.
> I've added a tiny change to the patch to fix that, but it has the side
> effect of doing:
>
>> *[j@laythe emacs-bisect]$ echo "foo"(:s/bar/baz/)
>> foo: substitution failed
>
> But I think that's an OK change, especially if we want to error out on
> ^bar^baz when no search is found.
> I also discovered another issue (which existed before as well):
>
>> *[j@laythe emacs-bisect]$ echo one one one
>> ("one" "one" "one")
>> *[j@laythe emacs-bisect]$ !!:sg/one/two
>> :sg/one/two
>> Wrong type argument: integer-or-marker-p, nil
>
> but I'd rather take a look at that later on to avoid cluttering this
> changeset. (and I'm not sure if I'm just using the feature incorrectly).
!!:gs/one/two/ seems to work. The error message could be improved
though (but yes, we should do that separately).
> +(defun eshell-history-substitution (line)
> + "Expand whole-line history substitutions by converting them to
> +!!:s/a/b/ syntax.
> +Returns nil if no match found."
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)
- bug#29821: Ensure quick substitution only occurs at start of line, Andreas Schwab, 2018/01/01
- bug#29821: Ensure quick substitution only occurs at start of line, Noam Postavsky, 2018/01/01
- bug#29821: Ensure quick substitution only occurs at start of line, Jay Kamat, 2018/01/01
- bug#29821: Ensure quick substitution only occurs at start of line,
Noam Postavsky <=
- bug#29821: Ensure quick substitution only occurs at start of line, Jay Kamat, 2018/01/02
- bug#29821: Ensure quick substitution only occurs at start of line, Noam Postavsky, 2018/01/02
- bug#29821: Ensure quick substitution only occurs at start of line, Jay Kamat, 2018/01/03
- bug#29821: Ensure quick substitution only occurs at start of line, Noam Postavsky, 2018/01/03
- bug#29821: Ensure quick substitution only occurs at start of line, Jay Kamat, 2018/01/04
- bug#29821: Ensure quick substitution only occurs at start of line, Noam Postavsky, 2018/01/04
- bug#29821: Ensure quick substitution only occurs at start of line, Jay Kamat, 2018/01/04
- bug#29821: Ensure quick substitution only occurs at start of line, Noam Postavsky, 2018/01/05