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

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

Re: Undesirable sh-mode indent


From: Bob Proulx
Subject: Re: Undesirable sh-mode indent
Date: Sat, 24 Oct 2015 13:18:50 -0600
User-agent: Mutt/1.5.24 (2015-08-30)

Teemu Likonen wrote:
> There is also variable sh-indentation which I have set to the same value
> as sh-basic-offset.

That variable seems to be an undocumented interface.  The sh-script.el
documentation talks about sh-basic-offset.

;; There are various customization variables which allow tailoring to
;; a wide variety of styles.  Most of these variables are named
;; sh-indent-for-XXX and sh-indent-after-XXX.  For example.
;; sh-indent-after-if controls the indenting of a line following
;; an if statement, and sh-indent-for-fi controls the indentation
;; of the line containing the fi.
;;
;; You can set each to a numeric value, but it is often more convenient
;; to a symbol such as `+' which uses the value of variable `sh-basic-offset'.
;; By changing this one variable you can increase or decrease how much
;; indentation there is.  Valid symbols:

I filed bug #21751 in the emacs BTS on this issue.

  https://debbugs.gnu.org/21751

> > Does anyone know how to keep syntax highlighting but to disable
> > indentation? Then at least I could at least stop it from doing the
> > wrong thing without dropping all of the way to fundamental-mode.
> 
> Some new SMIE thing is, in my opinion, doing too clever and wrong things
> so I disable it: (setq sh-use-smie nil).

This is interesting and useful.  I had not heard of sh-use-smie
before.  Thanks.  I can see the defvar for it in sh-script.el but when
I try to set it the variable appears not to exist with 'emacs -Q'.  If
I simply (setq sh-use-smie nil) it appears to have no effect for me.
But this gives me a direction to investigate.

Thanks!
Bob



reply via email to

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