[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r112743: Always defvar a mode's hook
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r112743: Always defvar a mode's hook and provide a docstring. |
Date: |
Mon, 27 May 2013 12:12:52 -0400 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112743
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2013-05-27 12:12:52 -0400
message:
Always defvar a mode's hook and provide a docstring.
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
* lisp/emacs-lisp/derived.el (define-derived-mode): Always defvar the
mode hook and provide a docstring.
modified:
lisp/ChangeLog
lisp/emacs-lisp/derived.el
lisp/emacs-lisp/easy-mmode.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-05-27 13:30:21 +0000
+++ b/lisp/ChangeLog 2013-05-27 16:12:52 +0000
@@ -1,3 +1,9 @@
+2013-05-27 Stefan Monnier <address@hidden>
+
+ * emacs-lisp/easy-mmode.el (define-minor-mode):
+ * emacs-lisp/derived.el (define-derived-mode): Always defvar the
+ mode hook and provide a docstring.
+
2013-05-27 Alan Mackenzie <address@hidden>
Remove spurious syntax-table text properties inserted by C-y.
=== modified file 'lisp/emacs-lisp/derived.el'
--- a/lisp/emacs-lisp/derived.el 2013-01-02 16:13:04 +0000
+++ b/lisp/emacs-lisp/derived.el 2013-05-27 16:12:52 +0000
@@ -192,12 +192,11 @@
parent child docstring syntax abbrev))
`(progn
- (unless (get ',hook 'variable-documentation)
- (put ',hook 'variable-documentation
- (purecopy ,(format "Hook run when entering %s mode.
+ (defvar ,hook nil
+ ,(format "Hook run after entering %s mode.
No problems result if this variable is not bound.
`add-hook' automatically binds it. (This is true for all hook variables.)"
- name))))
+ name))
(unless (boundp ',map)
(put ',map 'definition-name ',child))
(with-no-warnings (defvar ,map (make-sparse-keymap)))
=== modified file 'lisp/emacs-lisp/easy-mmode.el'
--- a/lisp/emacs-lisp/easy-mmode.el 2013-05-21 07:25:14 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el 2013-05-27 16:12:52 +0000
@@ -296,6 +296,12 @@
;; up-to-here.
:autoload-end
+ (defvar ,hook nil
+ ,(format "Hook run after entering or leaving `%s'.
+No problems result if this variable is not bound.
+`add-hook' automatically binds it. (This is true for all hook variables.)"
+ mode))
+
;; Define the minor-mode keymap.
,(unless (symbolp keymap) ;nil is also a symbol.
`(defvar ,keymap-sym
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r112743: Always defvar a mode's hook and provide a docstring.,
Stefan Monnier <=