all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: 25446@debbugs.gnu.org
Subject: bug#25446: 26.0.50; [PATCH] Fix undeclared FOO-mode-{syntax,abbrev}-table warnings
Date: Sat, 14 Jan 2017 02:05:06 -0500	[thread overview]
Message-ID: <87shomxgt9.fsf@users.sourceforge.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

Tags: patch
Severity: minor

Since [1: 8db7b65] there have been a lot of "reference to free variable
`FOO-mode-syntax-table'" and `FOO-mode-abbtrev-table' warnings during
compilation.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1220 bytes --]

From bcbe6eb903d3874c3cc1fe9ab48b8a2dc9e00abb Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Sat, 14 Jan 2017 01:47:52 -0500
Subject: [PATCH v1] Fix undeclared syntax- and abbrev- table warnings

* lisp/emacs-lisp/derived.el (define-derived-mode): Unconditionally
defvar the syntax and abbrev tables so that the compiler will know that
they are dynamically bound variables.
---
 lisp/emacs-lisp/derived.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 762c762..fffe972 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -216,6 +216,7 @@ define-derived-mode
 	      (purecopy ,(format "Keymap for `%s'." child))))
        ,(if declare-syntax
 	    `(progn
+               (defvar ,syntax)
 	       (unless (boundp ',syntax)
 		 (put ',syntax 'definition-name ',child)
 		 (defvar ,syntax (make-syntax-table)))
@@ -224,6 +225,7 @@ define-derived-mode
 		      (purecopy ,(format "Syntax table for `%s'." child))))))
        ,(if declare-abbrev
 	    `(progn
+               (defvar ,abbrev)
 	       (unless (boundp ',abbrev)
 		 (put ',abbrev 'definition-name ',child)
 		 (defvar ,abbrev
-- 
2.9.3


[-- Attachment #3: Type: text/plain, Size: 108 bytes --]



1: 2016-12-12 20:03:20 -0500 8db7b65d66f01e90a05cc9f11c67667233d84ca0
  Minor fix for define-derived-mode

             reply	other threads:[~2017-01-14  7:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-14  7:05 npostavs [this message]
2017-01-20  1:31 ` bug#25446: 26.0.50; [PATCH] Fix undeclared FOO-mode-{syntax,abbrev}-table warnings npostavs

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

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

  git send-email \
    --in-reply-to=87shomxgt9.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=25446@debbugs.gnu.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.