commit 7f925b06ace3435d6527aabf345165a7116b241d (HEAD, refs/remotes/origin/master) Author: Sean Whitton Date: Mon Oct 6 18:34:18 2025 +0100 defvar-keymap: New ':prefix t' abbreviation * lisp/keymap.el (defvar-keymap): New ':prefix t' abbreviation. * lisp/emacs-lisp/helper.el (Helper-help-map): * lisp/vc/pcvs.el (cvs-mode-diff-map): * lisp/vc/vc-hooks.el (vc-prefix-map): * lisp/vcursor.el (vcursor-map): Use it. * doc/lispref/keymaps.texi (Creating Keymaps): * etc/NEWS: Document it. diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 61e7398067a..3e6b82fab00 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -650,11 +650,9 @@ and @var{pairs} to @code{define-keymap}, and uses the result as the default value for the variable. It signals an error if there are duplicate key bindings in @var{pairs}. -@var{options} is like the keywords in @code{define-keymap}, but -there's an additional @code{:doc} keyword that provides the doc -string for the defined variable. - -Here's an example: +@var{options} is mostly like the keywords in @code{define-keymap}. +There's an additional @code{:doc} keyword that provides the doc string +for the defined variable. Here's an example: @lisp (defvar-keymap eww-textarea-map @@ -664,6 +662,24 @@ Here's an example: "TAB" #'shr-next-link) @end lisp +The @code{:prefix} keyword can take an additional value, @code{t}, which +is an abbreviation for using @var{name} as the value of that option. +I.e. instead of writing + +@lisp +(defvar-keymap foo-map + :prefix 'foo-map + ...) +@end lisp + +you can write + +@lisp +(defvar-keymap foo-map + :prefix t + ...) +@end lisp + @kindex :repeat @kindex repeat-mode @cindex repeatable key bindings diff --git a/etc/NEWS b/etc/NEWS index c6704226232..32c5ed41d00 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3310,6 +3310,12 @@ a remote host. It must be used in conjunction with the function The column number is no longer available; the line number will be removed in next Emacs release. ++++ +** defvar-keymap can now take a ':prefix t' option. +This is an abbreviation for using the name of the keymap as the prefix +command name. E.g. (defvar-keymap foo-map :prefix t) is equivalent to +(defvar-keymap foo-map :prefix 'foo-map). + * Changes in Emacs 31.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/helper.el b/lisp/emacs-lisp/helper.el index 01dbc686437..cdbde1c475b 100644 --- a/lisp/emacs-lisp/helper.el +++ b/lisp/emacs-lisp/helper.el @@ -40,6 +40,7 @@ (defvar-keymap Helper-help-map + :prefix t "m" #'Helper-describe-mode "b" #'Helper-describe-bindings "c" #'Helper-describe-key-briefly @@ -48,7 +49,6 @@ ;;"v" #'Helper-describe-variable "?" #'Helper-help-options (help-key) #'Helper-help-options) -(fset 'Helper-help-map Helper-help-map) (defun Helper-help-scroller () (let ((blurb (or (and (boundp 'Helper-return-blurb) diff --git a/lisp/keymap.el b/lisp/keymap.el index 2dcc1db080c..98b4a026fd3 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -614,9 +614,11 @@ pairs. Available keywords are: :name If non-nil, this should be a string to use as the menu for the keymap in case you use it as a menu with `x-popup-menu'. -:prefix If non-nil, this should be a symbol to be used as a prefix - command (see `define-prefix-command'). If this is the case, - this symbol is returned instead of the map itself. +:prefix If non-nil, this should be a symbol to make into a prefix command + using the new keymap (see `define-prefix-command'). + That is, store the keymap as the symbol's function definition. + In addition, when non-nil, return the symbol instead of the + new keymap. KEY/DEFINITION pairs are as KEY and DEF in `keymap-set'. KEY can also be the special symbol `:menu', in which case DEFINITION @@ -689,6 +691,9 @@ In addition to the keywords accepted by `define-keymap', this macro also accepts a `:doc' keyword, which (if present) is used as the variable documentation string. +The `:prefix' keyword can take an additional value, t, which is an +abbreviation for using VARIABLE-NAME as the prefix command name. + The `:repeat' keyword can also be specified; it controls the `repeat-mode' behavior of the bindings in the keymap. When it is non-nil, all commands in the map will have the `repeat-map' @@ -734,10 +739,17 @@ in the echo area. (unless defs (error "Uneven number of keywords")) (cond - ((eq keyword :doc) (setq doc (pop defs))) - ((eq keyword :repeat) (setq repeat (pop defs))) - (t (push keyword opts) - (push (pop defs) opts))))) + ((eq keyword :doc) + (setq doc (pop defs))) + ((eq keyword :repeat) + (setq repeat (pop defs))) + ((and (eq keyword :prefix) (eq (car defs) t)) + (setq defs (cdr defs)) + (push keyword opts) + (push `',variable-name opts)) + (t + (push keyword opts) + (push (pop defs) opts))))) (unless (zerop (% (length defs) 2)) (error "Uneven number of key/definition pairs: %s" defs)) diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el index 27fc74d98ce..7f275c141ae 100644 --- a/lisp/vc/pcvs.el +++ b/lisp/vc/pcvs.el @@ -140,6 +140,10 @@ (defvar-keymap cvs-mode-diff-map :name "Diff" + ;; This is necessary to allow correct handling of + ;; \\[cvs-mode-diff-map] in substitute-command-keys. + :prefix t + "E" (cons "imerge" #'cvs-mode-imerge) "=" #'cvs-mode-diff "e" (cons "idiff" #'cvs-mode-idiff) @@ -150,9 +154,6 @@ "r" (cons "repository" #'cvs-mode-diff-repository) "y" (cons "yesterday" #'cvs-mode-diff-yesterday) "v" (cons "vendor" #'cvs-mode-diff-vendor)) -;; This is necessary to allow correct handling of \\[cvs-mode-diff-map] -;; in substitute-command-keys. -(fset 'cvs-mode-diff-map cvs-mode-diff-map) (defvar-keymap cvs-mode-map :full t diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index ab4b10a10a1..6b6d01bc04c 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -965,6 +965,7 @@ In the latter case, VC mode is deactivated for this buffer." ;; in the menu because they don't exist yet when the menu is built. ;; (autoload 'vc-prefix-map "vc" nil nil 'keymap) (defvar-keymap vc-prefix-map + :prefix t "a" #'vc-update-change-log "b c" #'vc-create-branch "b l" #'vc-print-branch-log @@ -1003,7 +1004,6 @@ In the latter case, VC mode is deactivated for this buffer." "w R" #'vc-move-working-tree "w a" #'vc-apply-to-other-working-tree "w A" #'vc-apply-root-to-other-working-tree) -(fset 'vc-prefix-map vc-prefix-map) (define-key ctl-x-map "v" 'vc-prefix-map) (defvar-keymap vc-incoming-prefix-map diff --git a/lisp/vcursor.el b/lisp/vcursor.el index ff381c01b12..958e2d17732 100644 --- a/lisp/vcursor.el +++ b/lisp/vcursor.el @@ -467,6 +467,10 @@ scrolling set this. It is used by the `vcursor-auto-disable' code.") (defvar-keymap vcursor-map :doc "Keymap for vcursor command." + ;; This seems unused but was done previously (Emacs 24), so is kept + ;; for now. + :prefix t + "t" #'vcursor-use-vcursor-map "C-p" #'vcursor-previous-line @@ -495,9 +499,6 @@ scrolling set this. It is used by the `vcursor-auto-disable' code.") "c" #'vcursor-compare-windows "k" #'vcursor-execute-key "M-x" #'vcursor-execute-command) -;; This seems unused, but it was done as part of define-prefix-command, -;; so let's keep it for now. -(fset 'vcursor-map vcursor-map) ;; If vcursor-key-bindings is already set on loading, bind the keys now. ;; This hybrid way of doing it retains compatibility while allowing commit 1df9cfdb135847bc3783d627e5244327a51fc1e1 Author: Michael Albinus Date: Mon Oct 6 18:10:06 2025 +0200 Don't call dbus-launch in dbus-tests.el * test/lisp/net/dbus-tests.el (dbus-test02-register-service-own-bus): Adapt test. Don't use dbus-launch, call dbus-daemon directly. See <1117059@bugs.debian.org>. See . * test/lisp/net/dbus-resources/session.conf.in: New file. It is copied from . diff --git a/test/lisp/net/dbus-resources/session.conf.in b/test/lisp/net/dbus-resources/session.conf.in new file mode 100644 index 00000000000..b461d570d57 --- /dev/null +++ b/test/lisp/net/dbus-resources/session.conf.in @@ -0,0 +1,56 @@ + + + + session + + + + + unix:tmpdir=/tmp + + @testdir@/services + + + + + + + + + + + + + + contexts/dbus_contexts + + + + + 1000000000 + 250000000 + 1000000000 + 250000000 + 1000000000 + 4096 + 120000 + 240000 + 100000 + 10000 + 100000 + 10000 + 50000 + 50000 + 50000 + + diff --git a/test/lisp/net/dbus-tests.el b/test/lisp/net/dbus-tests.el index 0669cb0bb73..e4a9502c5d1 100644 --- a/test/lisp/net/dbus-tests.el +++ b/test/lisp/net/dbus-tests.el @@ -529,30 +529,40 @@ (ert-deftest dbus-test02-register-service-own-bus () "Check service registration with an own bus. This includes initialization and closing the bus." - ;; Start bus. - (let ((output - (ignore-errors - (shell-command-to-string "env DISPLAY= dbus-launch --sh-syntax"))) - bus pid) - (skip-unless (stringp output)) - (when (string-match "DBUS_SESSION_BUS_ADDRESS='\\(.+\\)';" output) - (setq bus (match-string 1 output))) - (when (string-match "DBUS_SESSION_BUS_PID=\\([[:digit:]]+\\);" output) - (setq pid (match-string 1 output))) - (unwind-protect - (progn - (skip-unless - (dbus-ignore-errors - (and bus pid - (featurep 'dbusbind) - (dbus-init-bus bus) - (dbus-get-unique-name bus) - (dbus-register-service bus dbus--test-service)))) - ;; Run the test. - (dbus--test-register-service bus)) - - ;; Save exit. - (when pid (call-process "kill" nil nil nil pid))))) + (ert-with-temp-file tmpfile + (let (bus pid) + (with-temp-buffer + (insert-file-contents (ert-resource-file "session.conf.in")) + (search-forward "@testdir@") + (replace-match (file-name-directory tmpfile)) + (write-file tmpfile)) + + ;; Start bus. + (with-temp-buffer + (skip-unless + (zerop + (call-process + "dbus-daemon" nil t nil "--fork" + "--config-file" tmpfile "--print-address" "--print-pid"))) + (goto-char (point-min)) + (setq bus (buffer-substring (point) (line-end-position))) + (forward-line) + (setq pid (buffer-substring (point) (line-end-position)))) + + ;; Run the test. + (unwind-protect + (progn + (skip-unless + (dbus-ignore-errors + (and bus pid + (featurep 'dbusbind) + (dbus-init-bus bus) + (dbus-get-unique-name bus) + (dbus-register-service bus dbus--test-service)))) + (dbus--test-register-service bus)) + + ;; Save exit. + (when pid (call-process "kill" nil nil nil pid)))))) (ert-deftest dbus-test03-peer-interface () "Check `dbus-interface-peer' methods." commit 96358a044cfe1fbc2da1e000aa97ebbba8b2c9f2 Author: Michael Albinus Date: Mon Oct 6 16:32:12 2025 +0200 ; Fix last change in auth-source.el * lisp/auth-source.el (auth-source-search-spec): Fix thinko. (auth-source-secrets-search): Fix call of `auth-source-secrets-listify-pattern'. diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 1cef682af82..402f2617ca8 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -405,12 +405,12 @@ A fallback backend is added to ensure, that at least `read-passwd' is called." (defmacro auth-source-search-spec (spec) "Build a search spec without the ignored keys. If a search key is nil or t (match anything), skip it." - `(seq-keep + `(apply #'append (mapcar (lambda (k) (and-let* ((v (plist-get ,spec k)) ((not (eq t v))) - ((cons k (auth-source-ensure-strings v)))))) - (auth-source-search-keys spec))) + ((list k (auth-source-ensure-strings v)))))) + (auth-source-search-keys ,spec)))) (defcustom auth-source-ignore-non-existing-file t "If set non-nil, file-based backends are ignored if the file does not exist. @@ -1804,8 +1804,7 @@ authentication tokens: (items (cl-loop for search-spec in - (apply #'auth-source-secrets-listify-pattern - (auth-source-search-spec spec)) + (auth-source-secrets-listify-pattern (auth-source-search-spec spec)) nconc (cl-loop for item in (apply #'secrets-search-items coll search-spec) unless (and (stringp label) commit 1434bc97dc9b4bee6b0463c969abe905a3b2ec1f Author: Martin Rudalics Date: Mon Oct 6 10:27:27 2025 +0200 Run buffer-local window change functions in their buffers now The buffer-local-versions of 'window-buffer-change-functions', 'window-size-change-functions', 'window-selection-change-functions' and 'window-state-change-functions' are now run with the respective buffer temporarily current. Also, the local version of 'window-buffer-change-functions' is run for the buffer removed from the window too. * src/window.c (run_window_change_functions_locally) (run_window_change_functions_globally): New functions replacing 'run_window_change_functions_1'. (run_window_change_functions): Run the buffer local versions of these hooks in their respective buffers. Run 'window-buffer-change-functions' for the buffer removed from the window too. (Vwindow_buffer_change_functions, Vwindow_size_change_functions) (Vwindow_selection_change_functions) (Vwindow_state_change_functions): Mention that the buffer-local versions are run with their buffer temporarily current. * doc/lispref/windows.texi (Window Hooks): Mention that buffer-local-versions of window change functions are run with their buffer temporarily current. Also say that 'window-buffer-change-functions' will be run for removed buffer too. * etc/NEWS: Advertise changes for the buffer-local versions of window change functions. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 7a6627caa9b..48f1b878bfd 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -7415,10 +7415,14 @@ This variable specifies functions called during redisplay when window buffers have changed. The value should be a list of functions that take one argument. -Functions specified buffer-locally are called for any window showing -the corresponding buffer if that window has been created or assigned -that buffer since the last time window change functions were run. In -this case the window is passed as argument. +Functions specified buffer-locally are called for each window showing +the corresponding buffer if and only if that window has been added or +changed its buffer since the last redisplay. Note that functions may be +run twice for such a window: Once for the buffer shown in the window at +the time of the last redisplay (provided that buffer is still live) and +once for the buffer currently shown in the window. In either case the +window is passed as argument and the respective buffer is made +temporarily current. Functions specified by the default value are called for a frame if at least one window on that frame has been added, deleted or assigned @@ -7436,11 +7440,11 @@ This variable specifies functions called during redisplay when a window size change occurred. The value should be a list of functions that take one argument. -Functions specified buffer-locally are called for any window showing -the corresponding buffer if that window has been added or assigned -another buffer or changed its total or body size since the last time -window change functions were run. In this case the window is passed -as argument. +Functions specified buffer-locally are called for any window showing the +corresponding buffer if that window has been added or assigned another +buffer or changed its total or body size since the last time window +change functions were run. In this case the window is passed as +argument and the respective buffer is temporarily made current. Functions specified by the default value are called for a frame if at least one window on that frame has been added or assigned another @@ -7458,11 +7462,12 @@ This variable specifies functions called during redisplay when the selected window or a frame's selected window has changed. The value should be a list of functions that take one argument. -Functions specified buffer-locally are called for any window showing -the corresponding buffer if that window has been selected or -deselected (among all windows or among all windows on its frame) since -the last time window change functions were run. In this case the -window is passed as argument. +Functions specified buffer-locally are called for any window showing the +corresponding buffer if that window has been selected or deselected +(among all windows or among all windows on its frame) since the last +time window change functions were run. In this case the window is +passed as argument and the respective buffer is temporarily made +current. Functions specified by the default value are called for a frame if that frame has been selected or deselected or the frame's selected @@ -7481,12 +7486,13 @@ window buffer or size change occurred or the selected window or a frame's selected window has changed. The value should be a list of functions that take one argument. -Functions specified buffer-locally are called for any window showing -the corresponding buffer if that window has been added or assigned -another buffer, changed its total or body size or has been selected or +Functions specified buffer-locally are called for any window showing the +corresponding buffer if that window has been added or assigned another +buffer, changed its total or body size or has been selected or deselected (among all windows or among all windows on its frame) since -the last time window change functions were run. In this case the -window is passed as argument. +the last time window change functions were run. In this case the window +is passed as argument and the respective buffer is temporarily made +current. Functions specified by the default value are called for a frame if at least one window on that frame has been added, deleted or assigned diff --git a/etc/NEWS b/etc/NEWS index 5e02f43296b..c6704226232 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -324,6 +324,20 @@ This abnormal hook gives its client a way to save a window from getting deleted implicitly by functions like 'kill-buffer', 'bury-buffer' and 'quit-restore-window'. ++++ +*** Buffer-local window change functions run in their buffers now. +Running the buffer-local version of each of the abnormal hooks +'window-buffer-change-functions', 'window-size-change-functions' +'window-selection-change-functions' and 'window-state-change-functions' +will make the respective buffer temporarily current for running the +hook.' + ++++ +*** 'window-buffer-change-functions' is run for removed buffer too. +The buffer-local version of 'window-buffer-change-functions' may be run +twice now: Once for the buffer removed from the respective window and +once for the buffer now shown in that window. + +++ *** New user option 'quit-window-kill-buffer'. This option specifies whether 'quit-window' should preferably kill or diff --git a/src/window.c b/src/window.c index 1ac004af5e0..dee17ae445a 100644 --- a/src/window.c +++ b/src/window.c @@ -3991,47 +3991,56 @@ window_change_record (void) } -/** - * run_window_change_functions_1: - * - * Run window change functions specified by SYMBOL with argument - * WINDOW_OR_FRAME. If BUFFER is nil, WINDOW_OR_FRAME specifies a - * frame. In this case, run the default value of SYMBOL. Otherwise, - * WINDOW_OR_FRAME denotes a window showing BUFFER. In this case, run - * the buffer local value of SYMBOL in BUFFER, if any. +/** Run the buffer local value of SYMBOL in BUFFER, if any, with + argument WINDOW. WINDOW must specify a live window that shows or + recently has shown BUFFER. */ static void -run_window_change_functions_1 (Lisp_Object symbol, Lisp_Object buffer, - Lisp_Object window_or_frame) +run_window_change_functions_locally (Lisp_Object symbol, Lisp_Object buffer, + Lisp_Object window) { - Lisp_Object funs = Qnil; - if (NILP (buffer)) - funs = Fdefault_value (symbol); - else if (!NILP (Fassoc (symbol, BVAR (XBUFFER (buffer), local_var_alist), - Qnil))) - /* Don't run global value buffer-locally. */ - funs = buffer_local_value (symbol, buffer); - - while (CONSP (funs)) + if (!NILP (assq_no_quit (symbol, BVAR (XBUFFER (buffer), local_var_alist)))) { - if (!EQ (XCAR (funs), Qt) - && (NILP (buffer) - ? FRAME_LIVE_P (XFRAME (window_or_frame)) - : WINDOW_LIVE_P (window_or_frame))) + Lisp_Object funs = buffer_local_value (symbol, buffer); + + Fset_buffer (buffer); + + while (CONSP (funs)) { - /* Any function called here may change the state of any - frame. Make sure to record changes for each live frame - in window_change_record later. */ - window_change_record_frames = true; - safe_calln (XCAR (funs), window_or_frame); - } + if (!EQ (XCAR (funs), Qt)) + { + window_change_record_frames = true; + safe_calln (XCAR (funs), window); + } - funs = XCDR (funs); + funs = XCDR (funs); + } } } +/** Run the default value of SYMBOL, if any, with argument FRAME. */ +static void +run_window_change_functions_globally (Lisp_Object symbol, Lisp_Object frame) +{ + Lisp_Object funs = Fdefault_value (symbol); + + if (!NILP (funs)) + { + while (CONSP (funs)) + { + if (!EQ (XCAR (funs), Qt)) + { + window_change_record_frames = true; + safe_calln (XCAR (funs), frame); + } + + funs = XCDR (funs); + } + } +} + /** * run_window_change_functions: * @@ -4149,6 +4158,7 @@ run_window_change_functions (void) Lisp_Object window = XCAR (windows); struct window *w = XWINDOW (window); Lisp_Object buffer = WINDOW_BUFFER (w); + specpdl_ref count1 = SPECPDL_INDEX (); /* Count this window even if it has been deleted while running a hook. */ @@ -4188,12 +4198,22 @@ run_window_change_functions (void) frame_buffer_change = frame_buffer_change || window_buffer_change; frame_size_change = frame_size_change || window_size_change; + /* Prepare for running local hooks in their buffers. */ + record_unwind_current_buffer (); + if (window_buffer_change) - run_window_change_functions_1 - (Qwindow_buffer_change_functions, buffer, window); + { + if (BUFFERP (w->old_buffer) + && BUFFER_LIVE_P (XBUFFER (w->old_buffer))) + run_window_change_functions_locally + (Qwindow_buffer_change_functions, w->old_buffer, window); + + run_window_change_functions_locally + (Qwindow_buffer_change_functions, buffer, window); + } if (window_size_change && WINDOW_LIVE_P (window)) - run_window_change_functions_1 + run_window_change_functions_locally (Qwindow_size_change_functions, buffer, window); /* This window's selection has changed when it was @@ -4206,7 +4226,7 @@ run_window_change_functions (void) && (EQ (window, FRAME_OLD_SELECTED_WINDOW (f)) || EQ (window, FRAME_SELECTED_WINDOW (f))))) && WINDOW_LIVE_P (window)) - run_window_change_functions_1 + run_window_change_functions_locally (Qwindow_selection_change_functions, buffer, window); /* This window's state has changed when its buffer or size @@ -4221,8 +4241,11 @@ run_window_change_functions (void) && (EQ (window, FRAME_OLD_SELECTED_WINDOW (f)) || EQ (window, FRAME_SELECTED_WINDOW (f)))))) && WINDOW_LIVE_P (window)) - run_window_change_functions_1 + run_window_change_functions_locally (Qwindow_state_change_functions, buffer, window); + + /* Restore current buffer for running the global hooks. */ + unbind_to (count1, Qnil); } /* When the number of windows on a frame has decreased, at least @@ -4236,21 +4259,21 @@ run_window_change_functions (void) /* A frame changed buffers when one of its windows has changed its buffer or at least one window was deleted. */ if ((frame_buffer_change || window_deleted) && FRAME_LIVE_P (f)) - run_window_change_functions_1 - (Qwindow_buffer_change_functions, Qnil, frame); + run_window_change_functions_globally + (Qwindow_buffer_change_functions, frame); /* A size change occurred when at least one of the frame's windows has changed size. */ if (frame_size_change && FRAME_LIVE_P (f)) - run_window_change_functions_1 - (Qwindow_size_change_functions, Qnil, frame); + run_window_change_functions_globally + (Qwindow_size_change_functions, frame); /* A frame has changed its window selection when its selected window has changed or when it was (de-)selected. */ if ((frame_selected_change || frame_selected_window_change) && FRAME_LIVE_P (f)) - run_window_change_functions_1 - (Qwindow_selection_change_functions, Qnil, frame); + run_window_change_functions_globally + (Qwindow_selection_change_functions, frame); #if defined HAVE_TEXT_CONVERSION @@ -4272,8 +4295,8 @@ run_window_change_functions (void) || frame_size_change || frame_window_state_change) && FRAME_LIVE_P (f)) { - run_window_change_functions_1 - (Qwindow_state_change_functions, Qnil, frame); + run_window_change_functions_globally + (Qwindow_state_change_functions, frame); /* Make sure to run 'window-state-change-hook' later. */ run_window_state_change_hook = true; /* Make sure to record changes for each live frame in @@ -8959,8 +8982,12 @@ The value should be a list of functions that take one argument. Functions specified buffer-locally are called for each window showing the corresponding buffer if and only if that window has been added or -changed its buffer since the last redisplay. In this case the window -is passed as argument. +changed its buffer since the last redisplay. This means that functions +may be run twice for such a window: Once for the buffer shown in the +window at the time of the last redisplay (provided that buffer is still +live) and once for the buffer currently shown in the window. In either +case the window is passed as argument and the respective buffer is made +temporarily current. Functions specified by the default value are called for each frame if at least one window on that frame has been added, deleted or changed @@ -8975,7 +9002,8 @@ The value should be a list of functions that take one argument. Functions specified buffer-locally are called for each window showing the corresponding buffer if and only if that window has been added or changed its buffer or its total or body size since the last redisplay. -In this case the window is passed as argument. +In this case the window is passed as argument and the respective buffer +is temporarily made current. Functions specified by the default value are called for each frame if at least one window on that frame has been added or changed its buffer @@ -8991,9 +9019,9 @@ can add `frame-hide-title-bar-when-maximized' to this variable. */); The value should be a list of functions that take one argument. Functions specified buffer-locally are called for each window showing -the corresponding buffer if and only if that window has been selected -or deselected since the last redisplay. In this case the window is -passed as argument. +the corresponding buffer if and only if that window has been selected or +deselected since the last redisplay. In this case the window is passed +as argument and the respective buffer is temporarily made current. Functions specified by the default value are called for each frame if the frame's selected window has changed since the last redisplay. In @@ -9007,7 +9035,8 @@ The value should be a list of functions that take one argument. Functions specified buffer-locally are called for each window showing the corresponding buffer if and only if that window has been added, resized, changed its buffer or has been (de-)selected since the last -redisplay. In this case the window is passed as argument. +redisplay. In this case the window is passed as argument and the +respective buffer is temporarily made current. Functions specified by the default value are called for each frame if at least one window on that frame has been added, deleted, changed its