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

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

Re: So clever it's stupid


From: Kevin Rodgers
Subject: Re: So clever it's stupid
Date: Tue, 14 Oct 2008 07:09:58 -0600
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

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





reply via email to

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