unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joel Reicher <joel.reicher@gmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: fill-column setq-default and add-hook
Date: Thu, 05 Dec 2024 12:46:17 +1100	[thread overview]
Message-ID: <86ser2q4uu.fsf@gmail.com> (raw)
In-Reply-To: <HJTBsLmK65IpPQ_wx6_y0_8KpeVxzPlgl0n4T9KgLirZVBcd2YeZAH6gaRh9uJqpm9B1u7tg3TLkGaxYNvLb_sB8ZAkk_O3H-sbejN9to1w=@protonmail.com> (Heime's message of "Wed, 04 Dec 2024 12:39:07 +0000")

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	other threads:[~2024-12-05  1:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-30 17:38 fill-column setq-default and add-hook Heime via Users list for the GNU Emacs text editor
2024-12-04 12:00 ` Joel Reicher
2024-12-04 12:39   ` Heime via Users list for the GNU Emacs text editor
2024-12-05  1:46     ` Joel Reicher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ser2q4uu.fsf@gmail.com \
    --to=joel.reicher@gmail.com \
    --cc=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).