Commit 922ad43e authored by Glenn Morris's avatar Glenn Morris
Browse files

* lisp/subr.el (make-local-hook): Remove function obsolete since 21.1.

* lisp/progmodes/cc-mode.el (make-local-hook): Don't do cc-bytecomp stuff.
(c-basic-common-init, c-font-lock-init): Only call make-local-hook on
XEmacs.
* lisp/progmodes/cc-styles.el (make-local-hook): Don't do cc-bytecomp stuff.
(c-make-styles-buffer-local): Only call make-local-hook on XEmacs.

* lisp/gnu/gnus-util.el (gnus-make-local-hook): Simplify.

* etc/NEWS: Mention above change.
parent ef47f179
...@@ -551,7 +551,8 @@ frame-update-face-colors, x-frob-font-weight, x-frob-font-slant, ...@@ -551,7 +551,8 @@ frame-update-face-colors, x-frob-font-weight, x-frob-font-slant,
x-make-font-bold, x-make-font-demibold, x-make-font-unbold x-make-font-bold, x-make-font-demibold, x-make-font-unbold
x-make-font-italic, x-make-font-oblique, x-make-font-unitalic x-make-font-italic, x-make-font-oblique, x-make-font-unitalic
x-make-font-bold-italic, mldrag-drag-mode-line, mldrag-drag-vertical-line, x-make-font-bold-italic, mldrag-drag-mode-line, mldrag-drag-vertical-line,
iswitchb-default-keybindings, char-bytes, isearch-return-char iswitchb-default-keybindings, char-bytes, isearch-return-char,
make-local-hook
** The following variables and aliases, obsolete since at least Emacs 21.1, ** The following variables and aliases, obsolete since at least Emacs 21.1,
have been removed: have been removed:
......
2010-10-03 Glenn Morris <rgm@gnu.org> 2010-10-03 Glenn Morris <rgm@gnu.org>
   
* subr.el (make-local-hook): Remove function obsolete since 21.1.
* progmodes/cc-mode.el (make-local-hook): Don't do cc-bytecomp stuff.
(c-basic-common-init, c-font-lock-init): Only call make-local-hook on
XEmacs.
* progmodes/cc-styles.el (make-local-hook): Don't do cc-bytecomp stuff.
(c-make-styles-buffer-local): Only call make-local-hook on XEmacs.
* ps-def.el (leading-code-private-22, charset-bytes, charset-id) * ps-def.el (leading-code-private-22, charset-bytes, charset-id)
(charset-width, find-charset-region, chars-in-region, forward-point) (charset-width, find-charset-region, chars-in-region, forward-point)
(encode-coding-string, coding-system-p, ccl-execute-on-string) (encode-coding-string, coding-system-p, ccl-execute-on-string)
......
2010-10-03 Glenn Morris <rgm@gnu.org>
* gnus-util.el (gnus-make-local-hook): Simplify.
2010-10-02 Julien Danjou <julien@danjou.info> 2010-10-02 Julien Danjou <julien@danjou.info>
   
* gnus-util.el (gnus-iswitchb-completing-read): New function. * gnus-util.el (gnus-iswitchb-completing-read): New function.
......
...@@ -149,11 +149,9 @@ This is a compatibility function for different Emacsen." ...@@ -149,11 +149,9 @@ This is a compatibility function for different Emacsen."
;; XEmacs. In Emacs we don't need to call `make-local-hook' first. ;; XEmacs. In Emacs we don't need to call `make-local-hook' first.
;; It's harmless, though, so the main purpose of this alias is to shut ;; It's harmless, though, so the main purpose of this alias is to shut
;; up the byte compiler. ;; up the byte compiler.
(defalias 'gnus-make-local-hook (defalias 'gnus-make-local-hook (if (featurep 'xemacs)
(if (eq (get 'make-local-hook 'byte-compile) 'make-local-hook
'byte-compile-obsolete) 'ignore)
'ignore ; Emacs
'make-local-hook)) ; XEmacs
(defun gnus-delete-first (elt list) (defun gnus-delete-first (elt list)
"Delete by side effect the first occurrence of ELT as a member of LIST." "Delete by side effect the first occurrence of ELT as a member of LIST."
......
...@@ -100,7 +100,6 @@ ...@@ -100,7 +100,6 @@
(cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
(cc-bytecomp-defun set-keymap-parents) ; XEmacs (cc-bytecomp-defun set-keymap-parents) ; XEmacs
(cc-bytecomp-defun run-mode-hooks) ; Emacs 21.1 (cc-bytecomp-defun run-mode-hooks) ; Emacs 21.1
(cc-bytecomp-obsolete-fun make-local-hook) ; Marked obsolete in Emacs 21.1.
;; We set these variables during mode init, yet we don't require ;; We set these variables during mode init, yet we don't require
;; font-lock. ;; font-lock.
...@@ -600,9 +599,10 @@ that requires a literal mode spec at compile time." ...@@ -600,9 +599,10 @@ that requires a literal mode spec at compile time."
;; Install the functions that ensure that various internal caches ;; Install the functions that ensure that various internal caches
;; don't become invalid due to buffer changes. ;; don't become invalid due to buffer changes.
(make-local-hook 'before-change-functions) (when (featurep 'xemacs)
(make-local-hook 'before-change-functions)
(make-local-hook 'after-change-functions))
(add-hook 'before-change-functions 'c-before-change nil t) (add-hook 'before-change-functions 'c-before-change nil t)
(make-local-hook 'after-change-functions)
(add-hook 'after-change-functions 'c-after-change nil t) (add-hook 'after-change-functions 'c-after-change nil t)
(set (make-local-variable 'font-lock-extend-after-change-region-function) (set (make-local-variable 'font-lock-extend-after-change-region-function)
'c-extend-after-change-region)) ; Currently (2009-05) used by all 'c-extend-after-change-region)) ; Currently (2009-05) used by all
...@@ -1113,8 +1113,8 @@ This does not load the font-lock package. Use after ...@@ -1113,8 +1113,8 @@ This does not load the font-lock package. Use after
c-beginning-of-syntax c-beginning-of-syntax
(font-lock-mark-block-function (font-lock-mark-block-function
. c-mark-function))) . c-mark-function)))
(if (featurep 'xemacs)
(make-local-hook 'font-lock-mode-hook) (make-local-hook 'font-lock-mode-hook))
(add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t)) (add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t))
(defun c-extend-after-change-region (beg end old-len) (defun c-extend-after-change-region (beg end old-len)
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
;; Silence the compiler. ;; Silence the compiler.
(cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs (cc-bytecomp-defvar adaptive-fill-first-line-regexp) ; Emacs
(cc-bytecomp-obsolete-fun make-local-hook) ; Marked obsolete in Emacs 21.1.
(defvar c-style-alist (defvar c-style-alist
...@@ -649,7 +648,7 @@ any reason to call this function directly." ...@@ -649,7 +648,7 @@ any reason to call this function directly."
(mapc func varsyms) (mapc func varsyms)
;; Hooks must be handled specially ;; Hooks must be handled specially
(if this-buf-only-p (if this-buf-only-p
(make-local-hook 'c-special-indent-hook) (if (featurep 'xemacs) (make-local-hook 'c-special-indent-hook))
(with-no-warnings (make-variable-buffer-local 'c-special-indent-hook)) (with-no-warnings (make-variable-buffer-local 'c-special-indent-hook))
(setq c-style-variables-are-local-p t)) (setq c-style-variables-are-local-p t))
)) ))
......
...@@ -1163,37 +1163,6 @@ to reread, so it now uses nil to mean `no event', instead of -1." ...@@ -1163,37 +1163,6 @@ to reread, so it now uses nil to mean `no event', instead of -1."
;;;; Hook manipulation functions. ;;;; Hook manipulation functions.
(defun make-local-hook (hook)
"Make the hook HOOK local to the current buffer.
The return value is HOOK.
You never need to call this function now that `add-hook' does it for you
if its LOCAL argument is non-nil.
When a hook is local, its local and global values
work in concert: running the hook actually runs all the hook
functions listed in *either* the local value *or* the global value
of the hook variable.
This function works by making t a member of the buffer-local value,
which acts as a flag to run the hook functions in the default value as
well. This works for all normal hooks, but does not work for most
non-normal hooks yet. We will be changing the callers of non-normal
hooks so that they can handle localness; this has to be done one by
one.
This function does nothing if HOOK is already local in the current
buffer.
Do not use `make-local-variable' to make a hook variable buffer-local."
(if (local-variable-p hook)
nil
(or (boundp hook) (set hook nil))
(make-local-variable hook)
(set hook (list t)))
hook)
(make-obsolete 'make-local-hook "not necessary any more." "21.1")
(defun add-hook (hook function &optional append local) (defun add-hook (hook function &optional append local)
"Add to the value of HOOK the function FUNCTION. "Add to the value of HOOK the function FUNCTION.
FUNCTION is not added if already present. FUNCTION is not added if already present.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment