reddit / emacs

global-display-fill-column-indicator-mode is not displaying a fill column indicator in some (non special) buffers.

bhrgunatha · 2022-11-07 16:43
My questions: - why doesn't to global mode activate globally? - how do I get it to do that for **all** non-special buffers? emacs version: GNU Emacs 29.0.50 I mostly use emacs-client. This doesn't happen when I run `emacs` by itself or in a terminal `emacs -nw` I'm not doing anything to check if the daemon is running in my config. Basically everything runs the same code. --- Since version 27 emacs has a built-in `display-fill-column-indicator-mode` and a global version too. Early in my init files, I create a text-mode buffer named \*text\* (naming is hard). Later on I use `(global-display-fill-column-indicator-mode 1)` and when I open a new (non special) buffer sure enough there's a fill column indicator over at the right hand side. Same when I visit elisp files, python files, .. pretty much everything. However in my generated \*text\* buffer and the \*scratch\* buffer there is no indicator. When I run `emacs -nw` or plain `emacs` works as expected and both those buffers have the indicator. With emacs-client though, in those buffers, the `global-minor-modes` **does** include `global-display-fill-column-indicator-mode` but `local-minor-modes` does **not** include `display-fill-column-indicator-mode`. In contrast I also have (use-package display-line-numbers :ensure nil :hook ((text-mode-hook . display-line-numbers-mode) (prog-mode-hook . display-line-numbers-mode))) And indeed `display-line-numbers-mode` **is** active in both the \*scratch\* buffer and my own \*text\* despite not setting those hooks until after the \*text\* buffer even using emacs-client. How can I get this behaviour in all buffers?
eli-zaretskii · 2022-11-07 17:13
Try (setq-default display-fill-column-indicator t)
bhrgunatha · 2022-11-07 18:26
That worked like a charm, thanks! Adding both of these display-fill-column-indicator t display-fill-column-indicator-character 9474 and all buffers are now behaving as expected!