[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#38111: 27.0.50; globalized-minor-mode not enabled on get-buffer-crea
From: |
Juri Linkov |
Subject: |
bug#38111: 27.0.50; globalized-minor-mode not enabled on get-buffer-create |
Date: |
Tue, 12 Nov 2019 22:33:35 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
tags 38111 + notabug
close 38111
quit
>> This looks like a bug. I found this issue while using global-tab-line-mode,
>> but to confirm that it's unrelated to tab-line, this bug report uses another
>> globalized minor-mode global-display-fill-column-indicator-mode:
>>
>> 0. emacs -Q
>> 1. M-x global-display-fill-column-indicator-mode RET
>> 2. C-x b test1 RET
>> 3. RET ;; this inserts newline to show column indicator
>> ;; that confirms this mode is enabled in the buffer
>>
>> 4. M-: (switch-to-buffer (get-buffer-create "test2")) RET
>> 5. RET ;; no column indicator, mode not enabled
>> 6. C-h v display-fill-column-indicator-mode RET
>> ;; confirms its value is nil
>
> Sounds like globalized-minor-mode machinery sdomehow doesn't support
> the latter method of creating a buffer? Does the turn-on function of
> the mode get called in that scenario?
'C-x b' (switch-to-buffer) uses ‘window-normalize-buffer-to-switch-to’
to call after 'get-buffer-create' explicitly:
(set-buffer-major-mode buffer)
It seems this is not a problem in practice, since callers
can add set-buffer-major-mode, so closing.