[Top][All Lists]

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

Re: Changing value for fill-column

From: Eli Zaretskii
Subject: Re: Changing value for fill-column
Date: Mon, 29 Aug 2022 14:32:00 +0300

> Date: Mon, 29 Aug 2022 10:39:50 +0200 (CEST)
> From:
> Cc:
> Aug 28, 2022, 15:32 by
> >> How do these local values get set when users do not perform setq-default 
> >> in their init file?
> >> Some modes set them up if there is no mode-hook for it already?
> >>
> >
> > Modes don't set these variables; users do.
> >
> > setq-default sets the default value, and that default value will be in
> > effect in every new buffer, unless someone -- you -- changes the value
> > in that buffer.  Since you want the same different value in all
> > buffers, you will probably not set the value in individual buffers,
> > and thus the default which you changed with setq-default will stay in
> > effect.
> >
> And once a user uses  setq-default  for a variable that variable cannot be 
> changed again.

Of course, they can: by another setq-default or by setq (the latter
possibly locally for the buffer that is the current one when the
command is invoked).

> If users do not change fill-column, how does ruler-mode set the value?

It doesn't.  It _uses_ the value set for the buffer.

> For the hook you mentioned, I have done as follows
>      (defun column-property ()  (setq fill-column 72))
>      (add-hook 'prog-mode-hook #'column-property)

OK.  Is there any problem with this?

reply via email to

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