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

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

Re: Changing value for fill-column


From: wilnerthomas
Subject: Re: Changing value for fill-column
Date: Sun, 28 Aug 2022 16:51:58 +0200 (CEST)

Aug 28, 2022, 14:33 by eliz@gnu.org:

>> Date: Sun, 28 Aug 2022 16:20:14 +0200 (CEST)
>> From: wilnerthomas@tutanota.com
>> Cc: help-gnu-emacs@gnu.org
>>
>> > The doc string says:
>> >
>> >  Automatically becomes buffer-local when set.
>> >
>> > So you either need to set it in a mode-hook of each mode where you
>> > want to change the default value, or you should use setq-default to
>> > change the default value in all buffers.
>> >
>> I know how to add hook to major mode with a function but not using a 
>> variable.
>>
>> (add-hook 'prog-mode-hook #'display-fill-column-indicator-mode)
>>
>
> You need to write a function that will both set fill-column and turn
> on display-fill-column-indicator-mode.
>
I also want the new fill-column value to be taken by ruler-mode

Have done the following

     (defun column-property () 

          (setq fill-column 72))


     (add-hook 'prog-mode-hook #'column-property)

     (add-hook 'org-mode-hook #'column-property)

     (add-hook 'text-mode-hook #'column-property)

     (add-hook 'lisp-interaction-mode-hook #'column-property)

The command "C-h f setq-default"  states

     The default value of a variable is seen in buffers
     that do not have their own values for the variable.

But I want to change the value even if buffer has its own value for fill-column

 



reply via email to

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