[Top][All Lists]

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

Re: Turning off sh-electric-here-document-mode?

From: Douglas Lewan
Subject: Re: Turning off sh-electric-here-document-mode?
Date: Wed, 13 May 2020 10:00:26 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 5/13/20 7:22 AM, Philipp Stephani wrote:
Am Mi., 13. Mai 2020 um 02:51 Uhr schrieb Douglas Lewan <>:
OK. I'm sure I'm missing something obvious here.

I want to turn off sh-electric-here-document-mode, but all the obvious
things seem to fail. I've put every one of the following in my .emacs,
but I still get here-documents in shell-script-mode.

(sh-electric-here-document-mode nil)

(sh-electric-here-document-mode 0)

(sh-electric-here-document-mode -1)


How do I do this? Thanks in advance.

It's a local mode, so all of those will only enable it in whatever
buffer is current while evaluating your ~/.emacs (probably the scratch
buffer). You need to customize sh-mode-hook instead.

Indeed, that's where I started. My current .emacs contains the following code:

(add-hook 'sh-mode-hook (lambda ()
      (setq sh-electric-here-document-mode nil)))

Here's the documentation for the variable sh-electric-here-document-mode:

   sh-electric-here-document-mode is a variable defined in `sh-script.el'.
   Its value is nil
   Local in buffer; global value is the same.

      Automatically becomes buffer-local when set.

   Non-nil if Sh-Electric-Here-Document mode is enabled.
   Use the command `sh-electric-here-document-mode' to change this

It's that last line that led me to try the code samples I originally posted. However, looking at its source, it's just setting sh-mode-hook, which is essentially what Philipp Stephani suggested.

I should have mentioned this in the original post: emacs version 24.5. (I know I'm a bit out of date. Has this changed?)

(908) 720 7908

"Lie and deny." It's very popular these days.

reply via email to

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