unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Daniel Colascione <dancol@dancol.org>
Cc: 16160@debbugs.gnu.org
Subject: bug#16160: [PATCH] define-derived-mode clobbers syntax tables
Date: Mon, 16 Dec 2013 14:17:19 -0500	[thread overview]
Message-ID: <jwvk3f4r4m5.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <52AEE02B.8060309@dancol.org> (Daniel Colascione's message of "Mon, 16 Dec 2013 03:12:43 -0800")

> 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





  reply	other threads:[~2013-12-16 19:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 11:12 bug#16160: [PATCH] define-derived-mode clobbers syntax tables Daniel Colascione
2013-12-16 19:17 ` Stefan Monnier [this message]
2013-12-17  2:17   ` Daniel Colascione
2013-12-17  2:36     ` Stefan Monnier
2013-12-20 21:45     ` Daniel Colascione
2016-03-01  2:05       ` Lars Ingebrigtsen
2016-12-13  1:04         ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvk3f4r4m5.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=16160@debbugs.gnu.org \
    --cc=dancol@dancol.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).