Subject: Re: bug#57459: Customisation before enabling display-fill-column-indicator-mode

From: Eli Zaretskii <[email-masked]>
Date: Sun, 28 Aug 2022 18:02:08 +0300

> Date: Sun, 28 Aug 2022 16:38:55 +0200 (CEST)
> From: [email-masked]
> Cc: [email-masked]
> 
> Aug 28, 2022, 14:14 by [email-masked]:
> 
> > Please show how you tried doing that, starting from "emacs -Q".  There
> > are many possible ways of customizing face attributes, and we need to
> > know which one you found not functioning in this case.
> >
> I made the following function
> 
> (defun indicator-attributes ()
> 
>      (setq display-fill-column-indicator-character ?\u2503)
> 
>      (set-face-attribute 'fill-column-indicator nil :background "green" :height 1.0))
> 
> I have another function to enable global-display-fill-column-indicator-mode
> 
> (defun  colum-indicator () 
>      (interactive) (global-display-fill-column-indicator-mode))
> 
> If I call (indicator-attributes) in my init file, then do "M-x colum-indicator" in a buffer, I get the old character.
> 
> But if I change colum-indicator to include (indicator-attributes) after setting the global mode, I get
> the correct wider character if I do "M-x colum-indicator" in a buffer.
> 
> (defun  colum-indicator ()
>  
>      (interactive) (global-display-fill-column-indicator-mode) (indicator-attributes))

It's the same issue as with fill-column:
display-fill-column-indicator-character is a variable that
automatically becomes buffer-local when set (see its doc string).  So
your setq is in effect only for a single buffer: the one in which
Emacs loads and evaluates the init file.

You should use setq-default instead.

This is not a bug.