[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/subr.el [lexbind]
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/subr.el [lexbind] |
Date: |
Thu, 20 Nov 2003 19:36:41 -0500 |
Index: emacs/lisp/subr.el
diff -c emacs/lisp/subr.el:1.307.2.3 emacs/lisp/subr.el:1.307.2.4
*** emacs/lisp/subr.el:1.307.2.3 Tue Oct 14 19:51:25 2003
--- emacs/lisp/subr.el Thu Nov 20 19:36:07 2003
***************
*** 884,914 ****
list of hooks to run in HOOK, then nothing is done. See `add-hook'.
The optional third 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."
(or (boundp hook) (set hook nil))
(or (default-boundp hook) (set-default hook nil))
! (if local (unless (local-variable-if-set-p hook)
! (set (make-local-variable hook) (list t)))
;; Detect the case where make-local-variable was used on a hook
;; and do what we used to do.
! (unless (and (consp (symbol-value hook)) (memq t (symbol-value hook)))
! (setq local t)))
! (let ((hook-value (if local (symbol-value hook) (default-value hook))))
! ;; Remove the function, for both the list and the non-list cases.
! (if (or (not (listp hook-value)) (eq (car hook-value) 'lambda))
! (if (equal hook-value function) (setq hook-value nil))
! (setq hook-value (delete function (copy-sequence hook-value))))
! ;; If the function is on the global hook, we need to shadow it locally
! ;;(when (and local (member function (default-value hook))
! ;; (not (member (cons 'not function) hook-value)))
! ;; (push (cons 'not function) hook-value))
! ;; Set the actual variable
! (if (not local)
! (set-default hook hook-value)
! (if (equal hook-value '(t))
! (kill-local-variable hook)
! (set hook hook-value)))))
(defun add-to-list (list-var element &optional append)
"Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
--- 884,915 ----
list of hooks to run in HOOK, then nothing is done. See `add-hook'.
The optional third argument, LOCAL, if non-nil, says to modify
! the hook's buffer-local value rather than its default value."
(or (boundp hook) (set hook nil))
(or (default-boundp hook) (set-default hook nil))
! ;; Do nothing if LOCAL is t but this hook has no local binding.
! (unless (and local (not (local-variable-p hook)))
;; Detect the case where make-local-variable was used on a hook
;; and do what we used to do.
! (when (and (local-variable-p hook)
! (not (and (consp (symbol-value hook))
! (memq t (symbol-value hook)))))
! (setq local t))
! (let ((hook-value (if local (symbol-value hook) (default-value hook))))
! ;; Remove the function, for both the list and the non-list cases.
! (if (or (not (listp hook-value)) (eq (car hook-value) 'lambda))
! (if (equal hook-value function) (setq hook-value nil))
! (setq hook-value (delete function (copy-sequence hook-value))))
! ;; If the function is on the global hook, we need to shadow it locally
! ;;(when (and local (member function (default-value hook))
! ;; (not (member (cons 'not function) hook-value)))
! ;; (push (cons 'not function) hook-value))
! ;; Set the actual variable
! (if (not local)
! (set-default hook hook-value)
! (if (equal hook-value '(t))
! (kill-local-variable hook)
! (set hook hook-value))))))
(defun add-to-list (list-var element &optional append)
"Add to the value of LIST-VAR the element ELEMENT if it isn't there yet.
***************
*** 1327,1334 ****
(defalias 'redraw-modeline 'force-mode-line-update)
(defun force-mode-line-update (&optional all)
! "Force the mode line of the current buffer to be redisplayed.
! With optional non-nil ALL, force redisplay of all mode lines."
(if all (save-excursion (set-buffer (other-buffer))))
(set-buffer-modified-p (buffer-modified-p)))
--- 1328,1337 ----
(defalias 'redraw-modeline 'force-mode-line-update)
(defun force-mode-line-update (&optional all)
! "Force redisplay of the current buffer's mode line and header line.
! With optional non-nil ALL, force redisplay of all mode lines and
! header lines. This function also forces recomputation of the
! menu bar menus and the frame title."
(if all (save-excursion (set-buffer (other-buffer))))
(set-buffer-modified-p (buffer-modified-p)))
***************
*** 2216,2222 ****
;; isearch-mode is deliberately excluded, since you should
;; not call it yourself.
(defvar minor-mode-list '(auto-save-mode auto-fill-mode abbrev-mode
! overwrite-mode view-mode)
"List of all minor mode functions.")
(defun add-minor-mode (toggle name &optional keymap after toggle-fun)
--- 2219,2226 ----
;; isearch-mode is deliberately excluded, since you should
;; not call it yourself.
(defvar minor-mode-list '(auto-save-mode auto-fill-mode abbrev-mode
! overwrite-mode view-mode
! hs-minor-mode)
"List of all minor mode functions.")
(defun add-minor-mode (toggle name &optional keymap after toggle-fun)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/subr.el [lexbind],
Miles Bader <=