* So clever it's stupid
@ 2008-10-14 10:57 Phil Carmody
2008-10-14 13:09 ` Kevin Rodgers
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Phil Carmody @ 2008-10-14 10:57 UTC (permalink / raw
To: help-gnu-emacs
How do I turn off the utterly obnoxious behaviour of '<' in shell mode?
(Emacs v.21.4.1)
<<<
sh-maybe-here-document is an interactive compiled Lisp function in `sh-script'.
(sh-maybe-here-document ARG)
Insert self. Without prefix, following unquoted `<' inserts here document.
The document is bounded by `sh-here-document-word'.
>>>
I give all my heredocs meaningful individual names, and certainly don't want
emacs inanely thinking that I want all the terminators called 'EOF'.
It's so completely brain-dead that if I try to type a command like
echo '<<< doing phase 2 >>>'
I don't get past the second chevron before it's shat unwanted garbage
in my file.
Similarly it doesn't seem to understand that people might want to use
both expanded and non-expanded heredocs, or sometimes want leading
tab removal, but at other times not want it. And as for herestrings,
they're right out.
Magic '<', for me, must die. How do I ensure I never ever see that
abomination again? (Unbind the key and make it self-insert in a
bunch of relevant hooks? Or is there just a variable I can set to
'off' somehow?)
Phil
--
The fact that a believer is happier than a sceptic is no more to the
point than the fact that a drunken man is happier than a sober one.
The happiness of credulity is a cheap and dangerous quality.
-- George Bernard Shaw (1856-1950), Preface to Androcles and the Lion
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: So clever it's stupid
2008-10-14 10:57 So clever it's stupid Phil Carmody
@ 2008-10-14 13:09 ` Kevin Rodgers
[not found] ` <mailman.1007.1223989809.25473.help-gnu-emacs@gnu.org>
2008-10-14 18:25 ` Xavier Maillard
2 siblings, 0 replies; 4+ messages in thread
From: Kevin Rodgers @ 2008-10-14 13:09 UTC (permalink / raw
To: help-gnu-emacs
Phil Carmody wrote:
> How do I turn off the utterly obnoxious behaviour of '<' in shell mode?
> (Emacs v.21.4.1)
>
> <<<
> sh-maybe-here-document is an interactive compiled Lisp function in `sh-script'.
> (sh-maybe-here-document ARG)
>
> Insert self. Without prefix, following unquoted `<' inserts here document.
> The document is bounded by `sh-here-document-word'.
>
> I give all my heredocs meaningful individual names, and certainly don't want
> emacs inanely thinking that I want all the terminators called 'EOF'.
>
> It's so completely brain-dead that if I try to type a command like
> echo '<<< doing phase 2 >>>'
> I don't get past the second chevron before it's shat unwanted garbage
> in my file.
>
> Similarly it doesn't seem to understand that people might want to use
> both expanded and non-expanded heredocs, or sometimes want leading
> tab removal, but at other times not want it. And as for herestrings,
> they're right out.
>
> Magic '<', for me, must die. How do I ensure I never ever see that
> abomination again? (Unbind the key and make it self-insert in a
> bunch of relevant hooks? Or is there just a variable I can set to
> 'off' somehow?)
The former:
(add-hook 'sh-mode-hook (lambda () (local-unset-key "<")))
--
Kevin Rodgers
Denver, Colorado, USA
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: So clever it's stupid
[not found] ` <mailman.1007.1223989809.25473.help-gnu-emacs@gnu.org>
@ 2008-10-14 13:21 ` Phil Carmody
0 siblings, 0 replies; 4+ messages in thread
From: Phil Carmody @ 2008-10-14 13:21 UTC (permalink / raw
To: help-gnu-emacs
Kevin Rodgers <kevin.d.rodgers@gmail.com> writes:
> Phil Carmody wrote:
>> Magic '<', for me, must die. How do I ensure I never ever see that
>> abomination again? (Unbind the key and make it self-insert in a
>> bunch of relevant hooks? Or is there just a variable I can set to
>> off' somehow?)
>
> The former:
>
> (add-hook 'sh-mode-hook (lambda () (local-unset-key "<")))
Many thanks. It looks like all of the shell subtypes share the
same major mode. So once it's hit on the head for sh, it will
be gone in csh, etc., which is good.
Phil
--
The fact that a believer is happier than a sceptic is no more to the
point than the fact that a drunken man is happier than a sober one.
The happiness of credulity is a cheap and dangerous quality.
-- George Bernard Shaw (1856-1950), Preface to Androcles and the Lion
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: So clever it's stupid
2008-10-14 10:57 So clever it's stupid Phil Carmody
2008-10-14 13:09 ` Kevin Rodgers
[not found] ` <mailman.1007.1223989809.25473.help-gnu-emacs@gnu.org>
@ 2008-10-14 18:25 ` Xavier Maillard
2 siblings, 0 replies; 4+ messages in thread
From: Xavier Maillard @ 2008-10-14 18:25 UTC (permalink / raw
To: Phil Carmody; +Cc: help-gnu-emacs
Hi,
It's so completely brain-dead that if I try to type a command like
echo '<<< doing phase 2 >>>'
Here is a workaround so you can keep the "magic-<":
C-u 3 C-q < RET
I know, it is overkill if you type this hundreds of times.
Another way to have this could be to make "<" reacting
differently according to the situation maybe using a different
input method.
Xavier
--
http://www.gnu.org
http://www.april.org
http://www.lolica.org
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-10-14 18:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-14 10:57 So clever it's stupid Phil Carmody
2008-10-14 13:09 ` Kevin Rodgers
[not found] ` <mailman.1007.1223989809.25473.help-gnu-emacs@gnu.org>
2008-10-14 13:21 ` Phil Carmody
2008-10-14 18:25 ` Xavier Maillard
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).