[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default setting for sh-maybe-here-document-mode
From: |
Stefan Monnier |
Subject: |
Re: Default setting for sh-maybe-here-document-mode |
Date: |
Sun, 22 Feb 2015 18:24:11 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> Now I am curious, I'll probably dive in the mailing list history to find
> out more about this motivation.
I don't think there's much history about it in the mailing-list.
Using post-self-insert-hook has the advantage of being more modular than
a key-binding: you can make it do heredoc expansion in sh-script without
affecting whether it does automatic reindent (via electric-indent-mode)
or automatic pairing (via electric-pair-mode), or ...
>> > Another use-case, even if you never use here-strings, is that you
>> > want to enter a single <, but enter << instead. You would expect
>> > this mistake to be corrected with a single backspace, but it's not.
>> We could special case this, potentially, but at the same time `undo' is
>> your friend.
> I know, but for some reason I can't get the hang of using undo in the flow
> of writing text.
It's definitely more intrusive, admittedly. I'd welcome a patch which
makes backspace actually undo the expansion.
> This is a good idea, but in this case you also need to include < < -
> as a trigger.
Indeed, and probably < < ' as well.
Stefan