aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/proof-compat.el
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2008-01-25 16:08:13 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2008-01-25 16:08:13 +0000
commit59932614901a295dfb38b594aae73359c3b996ef (patch)
treeeef1d6aed2c718fd699a2a7e7aa7e0bea29f423e /lib/proof-compat.el
parentb8181856bf700074a8ef0cc906a76ba1ae69ab81 (diff)
Back patch for XEmacs 21.4 on API change to add-hook.
Diffstat (limited to 'lib/proof-compat.el')
-rw-r--r--lib/proof-compat.el30
1 files changed, 25 insertions, 5 deletions
diff --git a/lib/proof-compat.el b/lib/proof-compat.el
index 3daed534..b592ef62 100644
--- a/lib/proof-compat.el
+++ b/lib/proof-compat.el
@@ -92,13 +92,33 @@ with `path-separator'."
;; Compatibility with XEmacs 21.4, API change in add-hook
(when
- ((and (featurep 'xemacs)
- (eq emacs-major-version 21)
- (<= emacs-minor-version 4)))
-
+ (and (featurep 'xemacs)
+ (eq emacs-major-version 21)
+ (<= emacs-minor-version 4))
+
+ (fset 'old-add-hook (symbol-function 'add-hook))
(defun add-hook (hook function &optional append local)
+ "Add to the value of HOOK the function FUNCTION.
+FUNCTION is not added if already present.
+FUNCTION is added (if necessary) at the beginning of the hook list
+unless the optional argument APPEND is non-nil, in which case
+FUNCTION is added at the end.
+
+The optional fourth argument, LOCAL, if non-nil, says to modify
+the hook's buffer-local value rather than its default value.
+This makes the hook buffer-local if needed.
+To make a hook variable buffer-local, always use
+`make-local-hook', not `make-local-variable'.
+
+HOOK should be a symbol, and FUNCTION may be any valid function. If
+HOOK is void, it is first set to nil. If HOOK's value is a single
+function, it is changed to a list of functions.
+
+You can remove this hook yourself using `remove-hook'.
+
+See also `add-one-shot-hook'."
(if local (make-local-hook hook))
- (add-hook hook function append local)))
+ (old-add-hook hook function append local)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;