From d106953274d29b6be4ef7e2c442078c81a52ff2f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 11:06:07 -0400 Subject: Cleanup uses of "-hooks". * doc/emacs/custom.texi (Hooks): * doc/lispref/hooks.texi (Standard Hooks): Clarify that -hooks is deprecated. * lisp/gnus/nndiary.el (nndiary-request-create-group-functions) (nndiary-request-update-info-functions) (nndiary-request-accept-article-functions): * lisp/gnus/gnus-start.el (gnus-subscribe-newsgroup-functions): * lisp/cedet/semantic/db-file.el (semanticdb-save-database-functions): * lisp/cedet/semantic/lex.el (semantic-lex-reset-functions): * lisp/cedet/semantic/edit.el (semantic-change-functions) (semantic-edits-new-change-functions) (semantic-edits-delete-change-functions) (semantic-edits-reparse-change-functions): * lisp/htmlfontify.el (hfy-post-html-hook): * lisp/filesets.el (filesets-cache-fill-content-hook): * lisp/arc-mode.el (archive-extract-hook): * lisp/progmodes/cc-mode.el (c-prepare-bug-report-hook): * lisp/net/rcirc.el (rcirc-sentinel-functions) (rcirc-receive-message-functions, rcirc-activity-functions) (rcirc-print-functions): * lisp/net/dbus.el (dbus-event-error-functions): * lisp/emacs-lisp/eieio.el (eieio-pre-method-execution-functions): * lisp/emacs-lisp/checkdoc.el (checkdoc-style-functions) (checkdoc-comment-style-functions): Don't use "-hooks" suffix. * lisp/term/sun.el (sun-raw-prefix-hooks): * lisp/mail/sendmail.el (mail-yank-hooks): * lisp/mh-e/mh-letter.el (mh-yank-hooks): Use make-obsolete-variable. --- lisp/emacs-lisp/checkdoc.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'lisp/emacs-lisp/checkdoc.el') diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index ee8cbd2c3bc..6250edc8792 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -124,7 +124,7 @@ ;; Adding your own checks: ;; ;; You can experiment with adding your own checks by setting the -;; hooks `checkdoc-style-hooks' and `checkdoc-comment-style-hooks'. +;; hooks `checkdoc-style-functions' and `checkdoc-comment-style-hooks'. ;; Return a string which is the error you wish to report. The cursor ;; position should be preserved. ;; @@ -274,17 +274,21 @@ made in the style guide relating to order." :type 'boolean) ;;;###autoload(put 'checkdoc-arguments-in-order-flag 'safe-local-variable 'booleanp) -(defvar checkdoc-style-hooks nil - "Hooks called after the standard style check is completed. -All hooks must return nil or a string representing the error found. +(define-obsolete-variable-alias 'checkdoc-style-hooks + 'checkdoc-style-functions "24.3") +(defvar checkdoc-style-functions nil + "Hook run after the standard style check is completed. +All functions must return nil or a string representing the error found. Useful for adding new user implemented commands. Each hook is called with two parameters, (DEFUNINFO ENDPOINT). DEFUNINFO is the return value of `checkdoc-defun-info'. ENDPOINT is the location of end of the documentation string.") -(defvar checkdoc-comment-style-hooks nil - "Hooks called after the standard comment style check is completed. +(define-obsolete-variable-alias 'checkdoc-comment-style-hooks + checkdoc-comment-style-functions "24.3") +(defvar checkdoc-comment-style-functions nil + "Hook run after the standard comment style check is completed. Must return nil if no errors are found, or a string describing the problem discovered. This is useful for adding additional checks.") @@ -1843,7 +1847,7 @@ Replace with \"%s\"? " original replace) ;; and reliance on the Ispell program. (checkdoc-ispell-docstring-engine e) ;; User supplied checks - (save-excursion (checkdoc-run-hooks 'checkdoc-style-hooks fp e)) + (save-excursion (checkdoc-run-hooks 'checkdoc-style-functions fp e)) ;; Done! ))) @@ -2353,7 +2357,7 @@ Code:, and others referenced in the style guide." err (or ;; Generic Full-file checks (should be comment related) - (checkdoc-run-hooks 'checkdoc-comment-style-hooks) + (checkdoc-run-hooks 'checkdoc-comment-style-functions) err)) ;; Done with full file comment checks err))) -- cgit v1.2.3 From 76673f9c62bbc0016a1233f38be920959b1ea158 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 23 Oct 2012 13:09:22 -0400 Subject: * checkdoc.el (checkdoc-comment-style-hooks): Typo. --- lisp/emacs-lisp/checkdoc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/checkdoc.el') diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index 6250edc8792..ffa42e97221 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -286,7 +286,7 @@ DEFUNINFO is the return value of `checkdoc-defun-info'. ENDPOINT is the location of end of the documentation string.") (define-obsolete-variable-alias 'checkdoc-comment-style-hooks - checkdoc-comment-style-functions "24.3") + 'checkdoc-comment-style-functions "24.3") (defvar checkdoc-comment-style-functions nil "Hook run after the standard comment style check is completed. Must return nil if no errors are found, or a string describing the -- cgit v1.2.3 From 7b1bf1735e58fbadbe180d4bbbe3a00cf71baed4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 12 Nov 2012 19:11:46 -0800 Subject: Use new names for hooks rather than obsolete aliases * lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string): * lisp/cedet/semantic/util.el (semantic-describe-buffer): * lisp/cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token) (semantic-default-c-setup): * lisp/emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke): * lisp/gnus/gnus-diary.el (nndiary-request-create-group-functions) (nndiary-request-update-info-functions) (gnus-subscribe-newsgroup-functions) (nndiary-request-accept-article-functions): * lisp/net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): Use new names for hooks rather than obsolete aliases. * lisp/arc-mode.el: * lisp/emacs-lisp/checkdoc.el: Related comments. * etc/NEWS: Related markup. --- etc/NEWS | 1 + lisp/ChangeLog | 6 ++++++ lisp/arc-mode.el | 2 +- lisp/cedet/ChangeLog | 8 ++++++++ lisp/cedet/semantic/bovine/c.el | 6 +++--- lisp/cedet/semantic/lex-spp.el | 6 +++--- lisp/cedet/semantic/util.el | 2 +- lisp/emacs-lisp/checkdoc.el | 2 +- lisp/emacs-lisp/eieio-datadebug.el | 2 +- lisp/gnus/ChangeLog | 8 ++++++++ lisp/gnus/gnus-diary.el | 12 ++++++------ lisp/net/tramp-gvfs.el | 4 ++-- 12 files changed, 41 insertions(+), 18 deletions(-) (limited to 'lisp/emacs-lisp/checkdoc.el') diff --git a/etc/NEWS b/etc/NEWS index 623b40bb64f..00106469415 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -629,6 +629,7 @@ enabled. ** FIXME something happened to ses.el, 2012-04-17. ++++ ** Hooks renamed to avoid obsolete "-hooks" suffix: *** semantic-lex-reset-hooks -> semantic-lex-reset-functions *** semantic-change-hooks -> semantic-change-functions diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2ad7230e912..61d202433fc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-11-13 Glenn Morris + + * emacs-lisp/eieio-datadebug.el (eieio-debug-methodinvoke): + * net/tramp-gvfs.el (tramp-gvfs-dbus-event-error): + Use new names for hooks rather than obsolete aliases. + 2012-11-12 Stefan Monnier * emacs-lisp/gv.el (gv-define-simple-setter): One more fix (bug#12871). diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index cebd4302d0c..9fc91a242d2 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -96,7 +96,7 @@ ;; ;; archive-mode-hook ;; archive-foo-mode-hook -;; archive-extract-hooks +;; archive-extract-hook ;;; Code: diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog index 6de901848c7..56207c7ae57 100644 --- a/lisp/cedet/ChangeLog +++ b/lisp/cedet/ChangeLog @@ -1,3 +1,11 @@ +2012-11-13 Glenn Morris + + * semantic/lex-spp.el (semantic-lex-spp-lex-text-string): + * semantic/util.el (semantic-describe-buffer): + * semantic/bovine/c.el (semantic-c-parse-lexical-token) + (semantic-default-c-setup): + Use new names for hooks rather than obsolete aliases. + 2012-11-12 Stefan Monnier * semantic/mru-bookmark.el (semantic-mru-bookmark-mode): diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el index 02ad6e05d1a..a3d57108d1d 100644 --- a/lisp/cedet/semantic/bovine/c.el +++ b/lisp/cedet/semantic/bovine/c.el @@ -931,8 +931,8 @@ the regular parser." (setq semantic-new-buffer-fcn-was-run t) (semantic-lex-init) (semantic-clear-toplevel-cache) - (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook - t) + (remove-hook 'semantic-lex-reset-functions + 'semantic-lex-spp-reset-hook t) ) ;; Get the macro symbol table right. (setq semantic-lex-spp-dynamic-macro-symbol-obarray spp-syms) @@ -2073,7 +2073,7 @@ actually in their parent which is not accessible.") ) (setq semantic-lex-analyzer #'semantic-c-lexer) - (add-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook nil t) + (add-hook 'semantic-lex-reset-functions 'semantic-lex-spp-reset-hook nil t) (when (eq major-mode 'c++-mode) (add-to-list 'semantic-lex-c-preprocessor-symbol-map '("__cplusplus" . ""))) ) diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el index 406f2900563..ad366c2b94f 100644 --- a/lisp/cedet/semantic/lex-spp.el +++ b/lisp/cedet/semantic/lex-spp.el @@ -30,7 +30,7 @@ ;; If you use SPP in your language, be sure to specify this in your ;; semantic language setup function: ;; -;; (add-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook nil t) +;; (add-hook 'semantic-lex-reset-functions 'semantic-lex-spp-reset-hook nil t) ;; ;; ;; Special Lexical Tokens: @@ -947,8 +947,8 @@ and variable state from the current buffer." (setq semantic-new-buffer-fcn-was-run t) (semantic-lex-init) (semantic-clear-toplevel-cache) - (remove-hook 'semantic-lex-reset-hooks 'semantic-lex-spp-reset-hook - t) + (remove-hook 'semantic-lex-reset-functions + 'semantic-lex-spp-reset-hook t) )) ;; Second Cheat: copy key variables regarding macro state from the diff --git a/lisp/cedet/semantic/util.el b/lisp/cedet/semantic/util.el index 65201c4fd12..f3d30f6af5c 100644 --- a/lisp/cedet/semantic/util.el +++ b/lisp/cedet/semantic/util.el @@ -280,7 +280,7 @@ If TAG is not specified, use the tag at point." semantic-parser-name semantic-parse-tree-state semantic-lex-analyzer - semantic-lex-reset-hooks + semantic-lex-reset-functions semantic-lex-syntax-modifications ))) (dolist (V vars) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index ffa42e97221..1cbed17cbab 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -124,7 +124,7 @@ ;; Adding your own checks: ;; ;; You can experiment with adding your own checks by setting the -;; hooks `checkdoc-style-functions' and `checkdoc-comment-style-hooks'. +;; hooks `checkdoc-style-functions' and `checkdoc-comment-style-functions'. ;; Return a string which is the error you wish to report. The cursor ;; position should be preserved. ;; diff --git a/lisp/emacs-lisp/eieio-datadebug.el b/lisp/emacs-lisp/eieio-datadebug.el index ec470d21bf3..a1db1972b83 100644 --- a/lisp/emacs-lisp/eieio-datadebug.el +++ b/lisp/emacs-lisp/eieio-datadebug.el @@ -131,7 +131,7 @@ PREBUTTONTEXT is some text between PREFIX and the object button." (defun eieio-debug-methodinvoke (method class) "Show the method invocation order for METHOD with CLASS object." (interactive "aMethod: \nXClass Expression: ") - (let* ((eieio-pre-method-execution-hooks + (let* ((eieio-pre-method-execution-functions (lambda (l) (throw 'moose l) )) (data (catch 'moose (eieio-generic-call diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 8cb53de85fa..d1cf22fd971 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,11 @@ +2012-11-13 Glenn Morris + + * gnus-diary.el (nndiary-request-create-group-functions) + (nndiary-request-update-info-functions) + (gnus-subscribe-newsgroup-functions) + (nndiary-request-accept-article-functions): + Use new names for hooks rather than obsolete aliases. + 2012-10-23 Stefan Monnier * nndiary.el (nndiary-request-create-group-functions) diff --git a/lisp/gnus/gnus-diary.el b/lisp/gnus/gnus-diary.el index 854af2f5d76..bca307b19b6 100644 --- a/lisp/gnus/gnus-diary.el +++ b/lisp/gnus/gnus-diary.el @@ -277,18 +277,18 @@ Optional prefix (or REVERSE argument) means sort in reverse order." ;; Called when a group is subscribed. This is needed because groups created ;; because of mail splitting are *not* created with the back end function. -;; Thus, `nndiary-request-create-group-hooks' is inoperative. +;; Thus, `nndiary-request-create-group-functions' is inoperative. (defun gnus-diary-maybe-update-group-parameters (group) (when (eq (car (gnus-find-method-for-group group)) 'nndiary) (gnus-diary-update-group-parameters group))) -(add-hook 'nndiary-request-create-group-hooks +(add-hook 'nndiary-request-create-group-functions 'gnus-diary-update-group-parameters) -;; Now that we have `gnus-subscribe-newsgroup-hooks', this is not needed +;; Now that we have `gnus-subscribe-newsgroup-functions', this is not needed ;; anymore. Maybe I should remove this completely. -(add-hook 'nndiary-request-update-info-hooks +(add-hook 'nndiary-request-update-info-functions 'gnus-diary-update-group-parameters) -(add-hook 'gnus-subscribe-newsgroup-hooks +(add-hook 'gnus-subscribe-newsgroup-functions 'gnus-diary-maybe-update-group-parameters) @@ -384,7 +384,7 @@ If ARG (or prefix) is non-nil, force prompting for all fields." nndiary-headers) )) -(add-hook 'nndiary-request-accept-article-hooks +(add-hook 'nndiary-request-accept-article-functions (lambda () (gnus-diary-check-message nil))) (define-key message-mode-map "\C-c\C-fd" 'gnus-diary-check-message) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 60b39606d86..0aa1b8957ac 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -521,12 +521,12 @@ It is needed when D-Bus signals or errors arrive, because there is no information where to trace the message.") (defun tramp-gvfs-dbus-event-error (event err) - "Called when a D-Bus error message arrives, see `dbus-event-error-hooks'." + "Called when a D-Bus error message arrives, see `dbus-event-error-functions'." (when tramp-gvfs-dbus-event-vector (tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event) (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err)))) -(add-hook 'dbus-event-error-hooks 'tramp-gvfs-dbus-event-error) +(add-hook 'dbus-event-error-functions 'tramp-gvfs-dbus-event-error) ;; File name primitives. -- cgit v1.2.3