From 2bed3f0483e55e4fe5a4efa40e15e89b63536ed0 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 11 Feb 2012 14:13:29 -0800 Subject: Add missing :version tags to new defgroups and defcustoms * window.el (window-sides-slots): * tool-bar.el (tool-bar-position): * term/xterm.el (xterm-extra-capabilities): * ses.el (ses-self-reference-early-detection): * progmodes/verilog-mode.el (verilog-auto-declare-nettype) (verilog-auto-wire-type) (verilog-auto-delete-trailing-whitespace) (verilog-auto-reset-blocking-in-non, verilog-auto-inst-sort) (verilog-auto-tieoff-declaration): * progmodes/sql.el (sql-login-hook, sql-ansi-statement-starters) (sql-oracle-statement-starters, sql-oracle-scan-on): * progmodes/prolog.el (prolog-align-comments-flag) (prolog-indent-mline-comments-flag, prolog-object-end-to-0-flag) (prolog-left-indent-regexp, prolog-paren-indent-p) (prolog-paren-indent, prolog-parse-mode, prolog-keywords) (prolog-types, prolog-mode-specificators) (prolog-determinism-specificators, prolog-directives) (prolog-electric-newline-flag, prolog-hungry-delete-key-flag) (prolog-electric-dot-flag) (prolog-electric-dot-full-predicate-template) (prolog-electric-underscore-flag, prolog-electric-tab-flag) (prolog-electric-if-then-else-flag, prolog-electric-colon-flag) (prolog-electric-dash-flag, prolog-old-sicstus-keys-flag) (prolog-program-switches, prolog-prompt-regexp) (prolog-debug-on-string, prolog-debug-off-string) (prolog-trace-on-string, prolog-trace-off-string) (prolog-zip-on-string, prolog-zip-off-string) (prolog-use-standard-consult-compile-method-flag) (prolog-use-prolog-tokenizer-flag, prolog-imenu-flag) (prolog-imenu-max-lines, prolog-info-predicate-index) (prolog-underscore-wordchar-flag, prolog-use-sicstus-sd) (prolog-char-quote-workaround): * progmodes/cc-vars.el (c-defun-tactic): * net/tramp.el (tramp-encoding-command-interactive) (tramp-local-end-of-line): * net/soap-client.el (soap-client): * net/netrc.el (netrc-file): * net/gnutls.el (gnutls): * minibuffer.el (completion-category-overrides) (completion-cycle-threshold) (completion-pcm-complete-word-inserts-delimiters): * man.el (Man-name-local-regexp): * mail/feedmail.el (feedmail-display-full-frame): * international/characters.el (glyphless-char-display-control): * eshell/em-ls.el (eshell-ls-date-format): * emacs-lisp/cl-indent.el (lisp-lambda-list-keyword-alignment) (lisp-lambda-list-keyword-parameter-indentation) (lisp-lambda-list-keyword-parameter-alignment): * doc-view.el (doc-view-image-width, doc-view-unoconv-program): * dired-x.el (dired-omit-verbose): * cus-theme.el (custom-theme-allow-multiple-selections): * calc/calc.el (calc-highlight-selections-with-faces) (calc-lu-field-reference, calc-lu-power-reference) (calc-note-threshold): * battery.el (battery-mode-line-limit): * arc-mode.el (archive-7z-extract, archive-7z-expunge) (archive-7z-update): * allout.el (allout-prefixed-keybindings) (allout-unprefixed-keybindings) (allout-inhibit-auto-fill-on-headline) (allout-flattened-numbering-abbreviation): * allout-widgets.el (allout-widgets-auto-activation) (allout-widgets-icons-dark-subdir) (allout-widgets-icons-light-subdir, allout-widgets-icon-types) (allout-widgets-theme-dark-background) (allout-widgets-theme-light-background) (allout-widgets-item-image-properties-emacs) (allout-widgets-item-image-properties-xemacs) (allout-widgets-run-unit-tests-on-load) (allout-widgets-time-decoration-activity) (allout-widgets-hook-error-post-time) (allout-widgets-track-decoration): * gnus/sieve-manage.el (sieve-manage-default-stream): * gnus/shr.el (shr): * gnus/nnir.el (nnir-ignored-newsgroups, nnir-summary-line-format) (nnir-retrieve-headers-override-function) (nnir-imap-default-search-key, nnir-notmuch-program) (nnir-notmuch-additional-switches, nnir-notmuch-remove-prefix) (nnir-method-default-engines): * gnus/message.el (message-cite-reply-position): * gnus/gssapi.el (gssapi-program): * gnus/gravatar.el (gravatar): * gnus/gnus-sum.el (gnus-refer-thread-use-nnir): * gnus/gnus-registry.el (gnus-registry-unfollowed-addresses) (gnus-registry-max-pruned-entries): * gnus/gnus-picon.el (gnus-picon-inhibit-top-level-domains): * gnus/gnus-int.el (gnus-after-set-mark-hook) (gnus-before-update-mark-hook): * gnus/gnus-async.el (gnus-async-post-fetch-function): * gnus/auth-source.el (auth-source-cache-expiry): Add missing :version tags to new defcustoms and defgroups. --- lisp/emacs-lisp/cl-indent.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 0a690af572c..01bdfbf4bf2 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -104,6 +104,7 @@ If non-nil, alignment is done with the first keyword \(defun foo (arg1 arg2 &rest rest &key key1 key2) #|...|#)" + :version "24.1" :type 'boolean :group 'lisp-indent) @@ -111,6 +112,7 @@ If non-nil, alignment is done with the first keyword "Indentation of lambda list keyword parameters. See `lisp-lambda-list-keyword-parameter-alignment' for more information." + :version "24.1" :type 'integer :group 'lisp-indent) @@ -130,6 +132,7 @@ If non-nil, alignment is done with the first parameter \(defun foo (arg1 arg2 &key key1 key2 key3 key4) #|...|#)" + :version "24.1" :type 'boolean :group 'lisp-indent) -- cgit v1.2.3 From c60293480dbfe1c27849b84dda435b660f922131 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 20 Feb 2012 12:23:47 -0800 Subject: * lisp/emacs-lisp/authors.el (authors-aliases): Add another entry. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/authors.el | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 629b5b19d93..1512024695c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-02-20 Glenn Morris + + * emacs-lisp/authors.el (authors-aliases): Add another entry. + 2012-02-20 Leo Liu * icomplete.el (icomplete-completions): Check FROM arg before diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index bf9f500b542..495144f7252 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -1,6 +1,6 @@ ;;; authors.el --- utility for maintaining Emacs' AUTHORS file -*-coding: utf-8;-*- -;; Copyright (C) 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 2000-2012 Free Software Foundation, Inc. ;; Author: Gerd Moellmann ;; Maintainer: Kim F. Storm @@ -58,6 +58,7 @@ files.") ("David M. Koppelman" "David M. Koppelman, Koppel@Ec?e.Lsu.Edu" "David Koppelman") ("David M. Smith" "David Smith" "David M Smith") + ("David O'Toole" "David T. O'Toole") ("Deepak Goel" "D. Goel") ("Ed L. Cashin" "Ed L Cashin") ("Edward M. Reingold" "Ed Reingold" "Edward M Reingold" -- cgit v1.2.3 From 31a9ef2e3baa7e137b977f4549ad0b04f4fc9114 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 Feb 2012 20:33:46 -0500 Subject: Small authors.el updates * lisp/emacs-lisp/authors.el (authors-aliases) (authors-obsolete-files-regexps, authors-ignored-files) (authors-ambiguous-files, authors-renamed-files-alist): Add more entries. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/authors.el | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df88dd1bd5c..325d386e592 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-02-23 Glenn Morris + + * emacs-lisp/authors.el (authors-aliases) + (authors-obsolete-files-regexps, authors-ignored-files) + (authors-ambiguous-files, authors-renamed-files-alist): + Add more entries. + 2012-02-23 Juri Linkov * isearch.el (isearch-occur): Sync interactive spec with occur's diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 495144f7252..636bc23dc47 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -41,17 +41,21 @@ files.") (defconst authors-aliases '( ("Aaron S. Hawley" "Aaron Hawley") + ("Alexandru Harsanyi" "Alex Harsanyi") ("Andrew Csillag" "Drew Csillag") ("Anna M. Bigatti" "Anna Bigatti") ("Barry A. Warsaw" "Barry A. Warsaw, Century Computing, Inc." "Barry A. Warsaw, ITB" "Barry Warsaw") + ("Bill Carpenter" "WJ Carpenter") ("Bill Mann" "William F. Mann") ("Bill Rozas" "Guillermo J. Rozas") ("Björn Torkelsson" "Bjorn Torkelsson") ("Brian Fox" "Brian J. Fox") + ("Brian Sniffen" "Brian T. Sniffen") ("Christoph Wedler" "Christoph.Wedler@sap.com") ("Daniel Pfeiffer" "" "") + ("David Abrahams" "Dave Abrahams") ("David De La Harpe Golden" "David Golden") ("David Gillespie" "Dave Gillespie") ("David Kågedal" "David K..edal") @@ -93,6 +97,7 @@ files.") ("Jens-Ulrik Holger Petersen" "Jens-Ulrik Petersen") ("Jeremy Bertram Maitin-Shepard" "Jeremy Maitin-Shepard") ("Johan Bockgård" "Johan Bockgard") + ("John J Foerch" "John Foerch") ("John W. Eaton" "John Eaton") ("Jonathan I. Kamens" "Jonathan Kamens") ("Joseph Arceneaux" "Joe Arceneaux") @@ -110,6 +115,7 @@ files.") ("Kevin Greiner" "Kevin J. Greiner") ("Kim F. Storm" "Kim Storm") ("Kyle Jones" "Kyle E. Jones") + ("Lars Magne Ingebrigtsen" "Lars Ingebrigtsen") ("Marcus G. Daniels" "Marcus Daniels") ("Mark D. Baushke" "Mark D Baushke") ("Marko Kohtala" "Kohtala Marko") @@ -125,12 +131,14 @@ files.") ("Michael Sperber" "Michael Sperber \\[Mr. Preprocessor\\]") ("Mikio Nakajima" "Nakajima Mikio") ("Nelson Jose dos Santos Ferreira" "Nelson Ferreira") + ("Noorul Islam" "Noorul Islam K M") ("Paul Eggert" "eggert") ("Paul Reilly" "(pmr@legacy.pajato.com)") ("Pavel Janík" "Pavel Janík Ml." "Pavel Janik Ml." "Pavel Janik" "Pavel Janík" "Pavel@Janik.Cz") ("Pavel Kobiakov" "Pavel Kobyakov") ("Per Abrahamsen" "Per Abhiddenware") ("Per Starbäck" "Per Starback") + ("Peter J. Weisberg" "PJ Weisberg") ("Peter S. Galbraith" "Peter Galbraith") ("Peter Runestig" "Peter 'luna' Runestig") ("Peter S. Galbraith" "Peter S Galbraith") @@ -145,16 +153,19 @@ files.") ("Sacha Chua" "Sandra Jean Chua") ("Sam Steingold" "Sam Shteingold") ("Satyaki Das" "Indexed search by Satyaki Das") + ("Sébastien Vauban" "Sebastien Vauban") ;; There are other Stefans. ;;; ("Stefan Monnier" "Stefan") ("Stephen A. Wood" "(saw@cebaf.gov)") ("Steven L. Baur" "SL Baur" "Steven L Baur") ("Stewart M. Clamen" "Stewart Clamen") ("Stuart D. Herring" "Stuart Herring" "Davis Herring") + ("T.V. Raman" "T\\. V\\. Raman") ("Taichi Kawabata" "KAWABATA,? Taichi") ("Takaaki Ota" "Tak Ota") ("Takahashi Naoto" "Naoto Takahashi") ("Teodor Zlatanov" "Ted Zlatanov") + ("Thomas Dye" "Tom Dye") ("Thomas Horsley" "Tom Horsley") ; FIXME ? ("Thomas Wurgler" "Tom Wurgler") ("Tomohiko Morioka" "MORIOKA Tomohiko") @@ -223,11 +234,12 @@ If REALNAME is nil, ignore that author.") ".*loaddefs.el$" ; not obsolete, but auto-generated "\\.\\(cvs\\|git\\)ignore$" ; obsolete or uninteresting "\\.arch-inventory$" + ;; TODO lib/? Matches other things? + "m4/" "Emacs.xcodeproj" "charsets" "mapfiles" "preferences\\.\\(nib\\|gorm\\)" "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$") "List of regexps matching obsolete files. -Changes to files matching one of the regexps in this list are not -listed.") +Changes to files matching one of the regexps in this list are not listed.") (defconst authors-ignored-files '("external-lisp" @@ -258,7 +270,12 @@ listed.") "*.el" ;; Autogen: "cus-load.el" "finder-inf.el" "ldefs-boot.el" + "compile" "config.guess" "config.sub" "depcomp" + ;; Only existed briefly, then renamed: + "images/icons/allout-widgets-dark-bg" + "images/icons/allout-widgets-light-bg" ;; Never had any meaningful changes logged, now deleted: + "unidata/bidimirror.awk" "unidata/biditype.awk" "split-man" "Xkeymap.txt" "ms-7bkermit" "ulimit.hack" "gnu-hp300" "refcard.bit" "ledit.l" "forms.README" "forms-d2.dat" "CXTERM-DIC/PY.tit" "CXTERM-DIC/ZIRANMA.tit" @@ -309,29 +326,47 @@ Changes to files in this list are not listed.") "complete.el" "cpp.el" "ctxt.el" + "custom.el" + "cyrillic.el" + "czech.el" "debug.el" "dired.el" "el.el" + "eshell.el" + "ethiopic.el" + "f90.el" "files.el" "find.el" "format.el" + "generic.el" + "georgian.el" + "greek.el" "grep.el" + "hebrew.el" "imenu.el" + "indian.el" + "japanese.el" "java.el" + "lao.el" "linux.el" "locate.el" "make.el" "mode.el" "python.el" + "rmailmm.el" "semantic.el" "shell.el" "simple.el" + "slovak.el" "sort.el" "speedbar.el" "srecode.el" "table.el" "texi.el" + "thai.el" + "tibetan.el" "util.el" + "vc-bzr.el" "wisent.el") "List of basenames occurring more than once in the source.") @@ -589,6 +624,7 @@ in the repository.") ("texi/url.txi" . "url.texi") ("edt-user.doc" . "edt.texi") ("DEV-NOTES" . "nextstep") + ("org/COPYRIGHT-AND-LICENSE" . "org/README") ;; Moved to different directories. ("ctags.1" . "ctags.1") ("etags.1" . "etags.1") -- cgit v1.2.3 From 5e6e679443e5ed6127521b3b9c0f3e4e1cdc3b82 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 Feb 2012 20:52:35 -0500 Subject: More authors.el additions * lisp/emacs-lisp/authors.el (authors-aliases, authors-fixed-case) (authors-obsolete-files-regexps): Add more entries. --- lisp/ChangeLog | 2 +- lisp/emacs-lisp/authors.el | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 325d386e592..4be77a90c6c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,6 @@ 2012-02-23 Glenn Morris - * emacs-lisp/authors.el (authors-aliases) + * emacs-lisp/authors.el (authors-aliases, authors-fixed-case) (authors-obsolete-files-regexps, authors-ignored-files) (authors-ambiguous-files, authors-renamed-files-alist): Add more entries. diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 636bc23dc47..7a4f93ad0e4 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -81,6 +81,8 @@ files.") ("Gerd Möllmann" "Gerd Moellmann") ("Hallvard B. Furuseth" "Hallvard B Furuseth" "Hallvard Furuseth") ("Hrvoje Nikšić" "Hrvoje Niksic") + ;; lisp/org/ChangeLog 2010-11-11. + (nil "aaa bbb") ;; src/ChangeLog.4, 1994-01-11, since fixed. ;;; (nil "(afs@hplb.hpl.hp.com)") ;; lisp/gnus/ChangeLog.1, 1998-01-15. @@ -186,6 +188,7 @@ Each entry is of the form (REALNAME REGEXP...). If an author's name matches one of the REGEXPs, use REALNAME instead. If REALNAME is nil, ignore that author.") +;; FIXME seems it would be less fragile to check for O', Mc, etc. (defconst authors-fixed-case '("Bryan O'Sullivan" "Christian von Roques" @@ -194,6 +197,7 @@ If REALNAME is nil, ignore that author.") "David J. MacKenzie" "David McCabe" "David O'Toole" + "Devon Sean McCullough" "Dominique de Waleffe" "Edward O'Connor" "Exal de Jesus Garcia Carrillo" @@ -206,8 +210,11 @@ If REALNAME is nil, ignore that author.") "Nelson Jose dos Santos Ferreira" "Peter von der Ahe" "Peter O'Gorman" + "Piet van Oostrum" "Roland McGrath" - "Sean O'Rourke") + "Sean O'Halpin" + "Sean O'Rourke" + "Tijs van Bakel") "List of authors whose names cannot be simply capitalized.") (defvar authors-public-domain-files @@ -235,7 +242,7 @@ If REALNAME is nil, ignore that author.") "\\.\\(cvs\\|git\\)ignore$" ; obsolete or uninteresting "\\.arch-inventory$" ;; TODO lib/? Matches other things? - "m4/" "Emacs.xcodeproj" "charsets" "mapfiles" + "build-aux/" "m4/" "Emacs.xcodeproj" "charsets" "mapfiles" "preferences\\.\\(nib\\|gorm\\)" "vc-\\(rcs\\|cvs\\|sccs\\)-hooks\\.el$") "List of regexps matching obsolete files. -- cgit v1.2.3 From 342f8163602f6752cddff4c4d14e94b092178b4b Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 22 Feb 2012 20:58:53 -0500 Subject: Another authors.el alias --- lisp/emacs-lisp/authors.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 7a4f93ad0e4..f12beed3271 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -121,7 +121,7 @@ files.") ("Marcus G. Daniels" "Marcus Daniels") ("Mark D. Baushke" "Mark D Baushke") ("Marko Kohtala" "Kohtala Marko") - ("Agustín Martín" "Agustin Martin") + ("Agustín Martín" "Agustin Martin" "Agustín Martín Domingo") ("Martin Lorentzon" "Martin Lorentzson") ("Matt Swift" "Matthew Swift") ("Maxime Edouard Robert Froumentin" "Max Froumentin") -- cgit v1.2.3 From 8e911f6f933455fd1d6709dd60965fb9191e81d6 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Thu, 23 Feb 2012 03:13:48 -0500 Subject: * lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun when it might call us back infinitely. Fixes: debbugs:10797 --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/lisp.el | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee3c486d5ff..4f8fd60deaa 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-02-23 Dmitry Gutov + + * emacs-lisp/lisp.el (beginning-of-defun-raw): Don't call end-of-defun + when it might call us back infinitely (bug#10797). + 2012-02-23 Stefan Monnier * minibuffer.el (completion-table-with-context): Fix inf-loop. diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 8c53ad58612..4efdc3240cd 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -257,9 +257,8 @@ is called as a function to find the defun's beginning." (if (> arg 0) (dotimes (i arg) (funcall beginning-of-defun-function)) - ;; Better not call end-of-defun-function directly, in case - ;; it's not defined. - (end-of-defun (- arg)))))) + (dotimes (i (- arg)) + (funcall end-of-defun-function)))))) ((or defun-prompt-regexp open-paren-in-column-0-is-defun-start) (and (< arg 0) (not (eobp)) (forward-char 1)) -- cgit v1.2.3 From 2cb228f753fbaea3a86dfc1fd57b61db13624a2d Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Thu, 23 Feb 2012 18:51:22 +0000 Subject: Add new parameter :after-hook to define-minor-mode. Use this in the definition of font-lock-mode. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/modes.texi | 13 +++++++++---- lisp/ChangeLog | 12 ++++++++++++ lisp/emacs-lisp/easy-mmode.el | 7 ++++++- lisp/font-core.el | 1 + lisp/font-lock.el | 23 +++++++++++++---------- 6 files changed, 46 insertions(+), 15 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 4c69a309ca8..151a6388c7f 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-02-23 Alan Mackenzie + + * modes.texi (Defining Minor Modes): Document the new keyword + :after-hook. + 2012-02-21 Chong Yidong * files.texi (Files): Mention magic file names as arguments. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 09a96f23c5e..a4ee6f8327f 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1594,15 +1594,20 @@ anything that can be used with the @code{setf} function @var{place} can also be a cons @code{(@var{get} . @var{set})}, where @var{get} is an expression that returns the current state, and @var{set} is a function of one argument (a state) that sets it. + +@item :after-hook @var{after-hook} +This defines a single lisp form which is evaluated after the mode hooks +have run. It should not be quoted. @end table Any other keyword arguments are passed directly to the @code{defcustom} generated for the variable @var{mode}. -The command named @var{mode} first performs the standard actions such -as setting the variable named @var{mode} and then executes the -@var{body} forms, if any. It finishes by running the mode hook -variable @code{@var{mode}-hook}. +The command named @var{mode} first performs the standard actions such as +setting the variable named @var{mode} and then executes the @var{body} +forms, if any. It then runs the mode hook variable +@code{@var{mode}-hook} and finishes by evaluating any form in +@code{:after-hook}. @end defmac The initial value must be @code{nil} except in cases where (1) the diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d5951bbbe26..798df418e7d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2012-02-23 Alan Mackenzie + + * emacs-lisp/easy-mmode.el (define-minor-mode): Add extra + parameter "after-hook:" to allow the expansion to run code after + the execution of the mode hooks. + + * font-lock.el (font-lock-initial-fontify): New function extracted + from font-lock-mode-interal. + + * font-core.el (font-lock-mode): call font-lock-initial-fontify in + :after-hook. + 2012-02-23 Stefan Monnier * minibuffer.el: Make sure cycling is reset upon edit with icomplete.el. diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index dbacba6cd29..88698a1f069 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -135,6 +135,8 @@ BODY contains code to execute each time the mode is enabled or disabled. the new state, and sets it. If you specify a :variable, this function does not define a MODE variable (nor any of the terms used in :variable). +:after-hook A single lisp form which is evaluated after the mode hooks + have been run. It should not be quoted. For example, you could write (define-minor-mode foo-mode \"If enabled, foo on you!\" @@ -170,6 +172,7 @@ For example, you could write (setter nil) ;The function (if any) to set the mode var. (modefun mode) ;The minor mode function name we're defining. (require t) + (after-hook nil) (hook (intern (concat mode-name "-hook"))) (hook-on (intern (concat mode-name "-on-hook"))) (hook-off (intern (concat mode-name "-off-hook"))) @@ -197,6 +200,7 @@ For example, you could write (setq mode variable) (setq mode (car variable)) (setq setter (cdr variable)))) + (:after-hook (setq after-hook (pop body))) (t (push keyw extra-keywords) (push (pop body) extra-keywords)))) (setq keymap-sym (if (and keymap (symbolp keymap)) keymap @@ -275,7 +279,8 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. (not (equal ,last-message (current-message)))) (message ,(format "%s %%sabled" pretty-name) - (if ,mode "en" "dis")))))) + (if ,mode "en" "dis"))))) + ,@(when after-hook `(,after-hook))) (force-mode-line-update) ;; Return the new setting. ,mode) diff --git a/lisp/font-core.el b/lisp/font-core.el index f6701c0c79f..9b655319bc9 100644 --- a/lisp/font-core.el +++ b/lisp/font-core.el @@ -138,6 +138,7 @@ The above is the default behavior of `font-lock-mode'; you may specify your own function which is called when `font-lock-mode' is toggled via `font-lock-function'. " nil nil nil + :after-hook (if font-lock-mode (font-lock-initial-fontify)) ;; Don't turn on Font Lock mode if we don't have a display (we're running a ;; batch job) or if the buffer is invisible (the name starts with a space). (when (or noninteractive (eq (aref (buffer-name) 0) ?\s)) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 9f9445bdea9..a65a2c94c7d 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -629,21 +629,24 @@ Major/minor modes can set this variable if they know which option applies.") ;; Shut up the byte compiler. (defvar font-lock-face-attributes)) ; Obsolete but respected if set. +(defun font-lock-initial-fontify () + ;; The first fontification after turning the mode on. This must + ;; only be called after the mode hooks have been run. + (let ((max-size (font-lock-value-in-major-mode font-lock-maximum-size))) + (cond (font-lock-fontified + nil) + ((or (null max-size) (> max-size (buffer-size))) + (font-lock-fontify-buffer)) + (font-lock-verbose + (message "Fontifying %s...buffer size greater than font-lock-maximum-size" + (buffer-name)))))) + (defun font-lock-mode-internal (arg) ;; Turn on Font Lock mode. (when arg (add-hook 'after-change-functions 'font-lock-after-change-function t t) (font-lock-set-defaults) - (font-lock-turn-on-thing-lock) - ;; Fontify the buffer if we have to. - (let ((max-size (font-lock-value-in-major-mode font-lock-maximum-size))) - (cond (font-lock-fontified - nil) - ((or (null max-size) (> max-size (buffer-size))) - (font-lock-fontify-buffer)) - (font-lock-verbose - (message "Fontifying %s...buffer size greater than font-lock-maximum-size" - (buffer-name)))))) + (font-lock-turn-on-thing-lock)) ;; Turn off Font Lock mode. (unless font-lock-mode (remove-hook 'after-change-functions 'font-lock-after-change-function t) -- cgit v1.2.3