GNU bug report logs - #16160
[PATCH] define-derived-mode clobbers syntax tables

Previous Next

Package: emacs;

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 #8 received at 16160 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Daniel Colascione <dancol <at> dancol.org>
Cc: 16160 <at> debbugs.gnu.org
Subject: Re: bug#16160: [PATCH] define-derived-mode clobbers syntax tables
Date: Mon, 16 Dec 2013 14:17:19 -0500
> 1) Visit shell script with comments. See comments fontified properly.
> 2) M-x find-library sh-script RET
> 3) M-x eval-buffer
> 4) Return to shell script buffer
> 5) C-x C-v RET
> 6) Observe that comments are no longer fontified as comments.

I can't reproduce it, starting from "emacs -Q".

> -		 (put ',syntax 'definition-name ',child))
> -	       (defvar ,syntax (make-syntax-table))
> -	       (unless (get ',syntax 'variable-documentation)
> -		 (put ',syntax 'variable-documentation
> -		      (purecopy ,(format "Syntax table for `%s'." child))))))
> +		 (put ',syntax 'definition-name ',child)
> +                 (defvar ,syntax (make-syntax-table))
> +                 (unless (get ',syntax 'variable-documentation)
> +                   (put ',syntax 'variable-documentation
> +                        (purecopy ,(format "Syntax table for `%s'." child)))))))
> That is, we shouldn't touch the syntax table variable at all unless the
> variable is unbound.

But that shouldn't make much difference since none of the code you
changed should affect the var's value when it is already bound.
I'm not necessarily opposed to the change (haven't dug enough to try and
remember why it's written this way), but I'd first like to understand
why it fixes the problem you see.


        Stefan




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.