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

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

Re: fill-column setq-default and add-hook


From: Joel Reicher
Subject: Re: fill-column setq-default and add-hook
Date: Thu, 05 Dec 2024 12:46:17 +1100
User-agent: Gnus/5.13 (Gnus v5.13)

Heime <heimeborgia@protonmail.com> writes:

On Thursday, December 5th, 2024 at 12:00 AM, Joel Reicher <joel.reicher@gmail.com> wrote:

[...]

When you enter a mode derived from prog-mode, it will set fill-column to 72, which for that variable creates a buffer local instance of it (and sets that instance).

It acts like a global setting for all prog-mode derived buffers, rather than having to use setq on the buffer.

But it is using setq on that buffer, albeit automatically, which is important.

To have the local value for emacs-lisp-mode, one would do

(add-hook 'emacs-lisp-mode-hook (lambda () (setq fill-column 72)))

Is this how the local values for emacs-lisp-mode is set by emacs?

I'm not sure what you mean by emacs-lisp-mode having local values (or any values).

*Buffers* have local values, and you can use the activation of a particular mode to automatically set these. But if you then manually change modes in such a buffer the value will remain (unless another mechanism changes it) so it isn't really associated with the mode, and never was.

How can one make fill-column be 72 for all modes? Is this possible?

You can use setq-default to set the default value for all buffers (not modes), and make sure you have nothing changing this again or creating buffer local instances that might have different values.

Cheers,

       - Joel



reply via email to

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