GNU bug report logs -
#39190
28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props)
Previous Next
Full log
Message #143 received at 39190 <at> debbugs.gnu.org (full text, mbox):
>> I tested this with additional patch that replaces `conf-mode` calls with
>> `conf-guess-mode`, and see that syntax font-lock now is fixed in diff-mode
>> on some conf files (not tested on all possible conf submodes).
>
> This said. Using delay-mode-hooks in the diff-syntax driver is an ugly
> hack and is the real source of the problem, so splitting conf-mode into
> two is basically a way to work around the breakage introduced by the hack.
Indeed, but it seems it's too late to redesign this in the release
branch. So unfontified conf-mode files in diff hunks is a trade-off
for not breaking the release.
As for changes in master, I tried something like this to use in
diff-syntax-fontify-props instead of direct set-auto-mode call:
(let ((buffer (make-indirect-buffer
(current-buffer)
(generate-new-buffer-name (buffer-name)))))
(funcall
(unwind-protect
(with-current-buffer buffer
(let ((buffer-file-name "/tmp/foo.el"))
(set-auto-mode)
major-mode))
(kill-buffer buffer))))
It calls set-auto-mode in a temporary buffer.
Do you think this is the right direction?
This bug report was last modified 5 years and 83 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.