[Top][All Lists]

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

bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-

From: Juri Linkov
Subject: bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props)
Date: Wed, 19 Feb 2020 00:53:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> (defun conf-mode ()
>>   ...
>>   ;; `conf-mode' plays two roles: it's the parent of several sub-modes
>>   ;; but it's also the function that chooses between those submodes.
>>   ;; To tell the difference between those two cases where the function
>>   ;; might be called, we check `delay-mode-hooks'.
>>   ;; (adopted from tex-mode.el)
>>   (if (not delay-mode-hooks)
>>       ;; try to guess sub-mode of conf-mode based on buffer content
> The Right Thing™ to do is of course to split `conf-mode` into two
> functions, one for the generic entry point and the other for the shared
> parent mode.

Maybe a simpler variant would be to use some other variable to distinguish
sub-mode and its parent, instead of relying on delay-mode-hooks?

reply via email to

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