From: Thibaut Verron <thibaut.verron@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Default setting for sh-maybe-here-document-mode
Date: Mon, 23 Feb 2015 09:41:33 +0100 [thread overview]
Message-ID: <CAFsi02TKHcBvfDKOVJL=D8WxqgcqnSx_B8vtwHrx6FF+mwO0FQ@mail.gmail.com> (raw)
In-Reply-To: <jwvfva0l68l.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1598 bytes --]
2015-02-23 0:24 GMT+01:00 Stefan Monnier <monnier@iro.umontreal.ca>:
> > 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 ...
>
Oh I see, too many modes abusing key rebinding have lead me to believe it
was the idiom for this kind of behavior.
>
> >> > 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.
>
With your solution of requiring an additional (printed) character after the
<, I think accidental expansion would get much rarer already.
>
> > This is a good idea, but in this case you also need to include < < -
> > as a trigger.
>
> Indeed, and probably < < ' as well.
>
By the way, the bug report is sent now, sorry for the delay, I was without
an internet connection for the week-end.
Thibaut
[-- Attachment #2: Type: text/html, Size: 2493 bytes --]
next prev parent reply other threads:[~2015-02-23 8:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-20 8:19 Default setting for sh-maybe-here-document-mode Thibaut Verron
2015-02-20 8:31 ` Eli Zaretskii
2015-02-20 8:39 ` Thibaut Verron
2015-02-20 13:58 ` Stefan Monnier
2015-02-20 15:49 ` Thibaut Verron
2015-02-20 17:08 ` Stefan Monnier
2015-02-20 17:23 ` Thibaut Verron
2015-02-22 23:24 ` Stefan Monnier
2015-02-23 8:41 ` Thibaut Verron [this message]
2015-02-21 9:12 ` Philipp Stephani
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFsi02TKHcBvfDKOVJL=D8WxqgcqnSx_B8vtwHrx6FF+mwO0FQ@mail.gmail.com' \
--to=thibaut.verron@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.