Re: Supress all automatic indentation in SGML mode

Roger Price <[email protected]> Sun, 2 Aug 2026 11:28:49 +0200 (CEST)
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
On Sun, 2 Aug 2026, [email protected] wrote:

> Roger Price <[email protected]> writes:
> 
> > I use Gnu Emacs 1:30.1 to edit SGML files on Debian 13.  Whenever I press 
> > "Enter" for a new line, the Emacs SGML mode adds two spaces. I find this useless 
> > and irritating.  I would like to suppress all automatic indentation in SGML 
> > mode.
> >
> The user option ‘sgml-basic-offset’ likely affects what you
> want to change.  Its description is:
> 
>    sgml-basic-offset is a variable defined in ‘sgml-mode.el’.
> 
>    Its value is 2
> 
>    Specifies the basic indentation level for ‘sgml-indent-line’.
> 
> Try adding:
> 
>    (setopt sgml-basic-offset 0)
> 
> to your .emacs file.  You can also try it in a running Emacs
> without restarting using:
> 
>     M-: (setopt sgml-basic-offset 0)

Thanks very much.  This saves me a lot of frustration and wasted time.

Roger

> The lyf so short, the craft so long to lerne.

So true.