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

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

Re: tab-width 4 in markdown major mode


From: Frank Hrebabetzky
Subject: Re: tab-width 4 in markdown major mode
Date: Fri, 23 Apr 2021 11:16:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 22.04.21 15:15, Daniel Martín wrote:
Frank Hrebabetzky <hreba@t-online.de> writes:

Are you sure, taking a look at the definition of markdown-mode
https://github.com/jrblevin/markdown-mode/blob/master/markdown-mode.el#L9585
it seems to explicitly set the tab-width to 4.


Sorry, you are right. What i tried was C-h tab-width, which tells
value 4 and original value 8, and contains a link "customize". This
leads to the customization window with an entry mask, but the actual
value there is 8. So I don't know how to set the effective value 4 to
8.

tab-width is a buffer-local variable, which means that it can have
different values for different buffers.  As markdown-mode sets it with
setq, it sets the buffer-local value to 4, but the default remains as 8.

If you want to set tab-width to 8 everywhere, you could eval:

(setq-default tab-width 8) ;; This will set the *default* value of tab-width

And then, to override the buffer-local value set by markdown-mode:

(add-hook 'markdown-mode-hook (lambda ()
                         (setq tab-width 8)))

Hope this helps.


Thanks for the hint.
--
Frank




reply via email to

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