GNU bug report logs -
#16160
[PATCH] define-derived-mode clobbers syntax tables
Previous Next
Reported by: Daniel Colascione <dancol <at> dancol.org>
Date: Mon, 16 Dec 2013 11:14:02 UTC
Severity: normal
Tags: confirmed
Fixed in version 26.1
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #31 received at 16160-done <at> debbugs.gnu.org (full text, mbox):
Version: 26.1
>> The repro steps are incorrect. Try these:
>>
>> 1) emacs -Q
>> 2) visit a shell script
>> 3) M-x find-library sh-script RET
>> 4) C-s define-derived-mode RET
>> 5) C-M-x
>> 6) switch to your shell script buffer
>> 7) C-x C-v
>> 8) Observe that the shell script is fontified incorrectly; the syntax
>> table is now clobbered.
Fixed in 8db7b65 along the suggested lines.
So AIUI the issue is that define-derived-mode expands to
(defvar ,syntax (make-syntax-table))
Normally this has no effect if ,syntax is already bound.
But M-x eval-defun resets defvars to their default settings...
Hence if you selectively re-evaluate only the mode definition from
sh-script.el, you get the reported problem.
So I changed it to explicitly check if ,syntax is bound.
This will however now make things go wrong in the opposite way for
someone who has been playing around with customizing a syntax table that
was actually defined by define-derived-mode and wants to reset it by
re-evaluating the derived mode definition. But AFAICS there's no way to
fix both scenarios, and the second seems less likely (?) to me than the
one reported here.
This bug report was last modified 8 years and 166 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.