* lisp/window.el (pop-up-frame-alist, same-window-buffer-names)
(same-window-regexps, pop-up-frames, pop-up-windows): In
doc-strings say that these options are maintained for backward
compatibility only (Bug#50518).
* lisp/window.el (display-buffer-override-next-command):
Separate 'postfun' from 'clearfun', so 'clearfun' resets
'display-buffer-overriding-action', whereas 'postfun' calls
'post-function' that can select the right window in 'post-command-hook'.
* lisp/windmove.el (windmove-display-no-select): Add new choice 'ignore'.
Improve docstring.
(windmove-display-in-direction): Use new value 'ignore' of
'windmove-display-no-select'. Improve docstring.
(windmove-display-left, windmove-display-up)
(windmove-display-right, windmove-display-down): Mention
'windmove-display-no-select' in docstrings.
* doc/lispref/windows.texi (Buffers and Windows): Mention the
special handling of side windows and add a reference.
(Buffer Display Action Alists): Say explicitly that
`display-buffer-in-side-window' is dedicating to side by default.
(Dedicated Windows): Add case (4) and explain its meaning, add
a reference.
(Displaying Buffers in Side Windows): Move the paragraph about
`switch-to-(prev|next)-buffer' into a new item to emphasize the
special meaning of dedication for side windows.
* lisp/window.el (set-window-buffer-start-and-point): Restore
side dedication.
(switch-to-prev-buffer, switch-to-next-buffer): Correct return
value that should be nil instead of the same buffer in case of
no change.
(delete-windows-on): Restore side dedication.
(replace-buffer-in-windows): Update the docstring, restore side
dedication.
(quit-restore-window): Rearrange the logic so that strongly
dedicated windows are eventually deleted first. Restore the
side dedication. In the final case try to
`switch-to-prev-buffer' before deleting a window (Bug#48367).
When `delete-window' deletes its frame's selected window, this new
option allows to choose another window as replacement.
* lisp/window.el (get-lru-window, get-mru-window)
(get-largest-window): New optional argument NO-OTHER.
(window-at-pos): New function.
(delete-window-set-selected): New option.
(delete-window): Handle `delete-window-set-selected'.
* src/window.c (Fdelete_window_internal): Set the selected
window of WINDOW's frame to the first window on that frame and
let `delete-window' choose a more suitable window instead.
* doc/lispref/windows.texi (Deleting Windows): Describe new
option `delete-window-set-selected'.
(Cyclic Window Ordering): Describe new NO-OTHER argument for
`get-lru-window', `get-mru-window' and `get-largest-window'.
* etc/NEWS: Mention `delete-window-set-selected' and the NO-OTHER
argument.
* lisp/window.el (handle-select-window): Do not silently switch to
other window when minibuffer is selected and
mouse-autoselect-window is t (Bug#47969).
* lisp/window.el (window-default-font-height): Avoid signaling an
error when a client TTY frame happens to have an X-style 'display'
parameter. (Bug#48408)
(repeat-exit-timer): New variable.
(repeat-post-hook): Run idle timer with an "exit function"
returned from set-transient-map.
Suggested by Gustavo Barros <gusbrs.2016@gmail.com>.
(repeat-echo-message): Remove own previous message when input arg is nil.
* lisp/window.el (display-buffer-override-next-command): Return exitfun.
* lisp/window.el (quit-restore-window): Simplify calculation of
WINDOW's previous buffer. Avoid that killing WINDOW's previous
buffers results in a state where `quit-window' has no more
effect, by simply deleting WINDOW in that case (Bug#48367).
Copyright-paperwork-exempt: yes
Also fix some unsafe coding.
* lisp/window.el (push-window-buffer-onto-prev): New function, extracted from
(record-window-buffer): Refactor by extracting the above, and removing the now
redundant parameter DO-MINIBUF.
* src/minibuf.c (zip_minibuffer_stacks, read_minibuf): Replace calls to
get_minibuffer (0) by nth_minibuffer (0). Replace calls to
Qrecord_window_buffer by calls to Qpush_window_buffer_onto_prev.
(Factive_minibuffer_window, read_minibuf_unwind): Call abort_emacs should an
"impossible" null value be returned by nth_minibuffer.
(read_minibuf): Move the get_minibuffer_call to just after the incrementation
of minibuf_level as a precaution against a missing buffer in
Vminibuffer_list.
(nth_minibuffer): Replace XCAR by Fcar, to allow (car nil) to work.
(init_minibuf_once): Create the inactive buffer *Minibuf-0*.
(syms_of_minibuf): New DEFSYM, Qpush_window_buffer_onto_prev.
* src/window.c (restore_window_configuration): Replace some XCARs and XCDRs
by Fcar_safe and Fcdr_safe.
This fixes bug #48249 and also a situation where, with recursive minibuffers
enabled and minibuffer-follows-selected-frame t, switching frames when a
minibuffer was open would leave the mini-window selected on the old frame.
* lisp/window.el (record-window-buffer): Add extra parameter DO-MINIBUF, and
amend the code such that minibuffers only get processed when that parameter is
non-nil.
* src/minibuf.c (zip_minibuffer_stacks, read_minibuf): Call
Qrecord_window_buffer with the new argument set to Qt.
(move_minibuffers_onto_frame): Set the selected window on the old frame when
this would otherwise remain the mini-window.
This should fix bug #47766.
* lisp/window.el (window-deletable-p): Add a quote where it was missing from
minibuffer-follows-selected-frame.
* src/frame.c (check_minibuf_window): Delete the function.
(delete_frame): In place of calling check_minibuf_window, call
move_minibuffers_onto_frame, possibly to move minibuffers onto the new current
frame.
(Fmake_frame_invisible, Ficonify_frame): Remove calls to check_minibuf_window.
* src/minibuf.c (Factive_minibuffer_window): Search the frames for the active
minibuffer rather than just assuming minibuf_window has been correctly
updated.
* lisp/repeat.el (repeat-map): New autoloaded global variable.
(repeat-post-hook): Use 'repeat-map' when non-nil
and reset it to nil afterwards.
(repeat-post-hook): Keep the current prefix when
'repeat-keep-prefix' is non-nil.
* lisp/window.el (other-window-repeat-map): Add "O" that sets
'repeat-map' to 'other-window-repeat-map' before calling
'(other-window -1)'.
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg01387.html
This happened with minibuffer-follows-selected-frame set to t.
* doc/emacs/mini.texi (Basic Minibuffer): State where a command's action takes
place when a minibuffer's frame has been deleted.
* lisp/window.el (window--before-delete-windows, record-window-buffer): Take
into account that minibuffers are now recorded on w->prev_buffers field.
* src/fns.c (merge_c): New version of `merge' taking a C function, rather than
a Lisp function as the comparison function.
* src/frame.c (do_switch_frame): Pass arguments sf and for_deletion to
move_minibuffers_onnto_frame.
* src/lisp.h (top level): Declare merge_c and
move_minibuffers_onto_selected_frame.
* src/minibuf.c (MB_frame): New Lisp_Object recording the minibuffer's frame.
(choose_minibuf_frame): Remove all code except that which sets minibuf_window
to the current frame's minibuffer.
(minibuffer_ent_greater): New comparison function, passed to merge_c.
(zip_minibuffer_stacks): New function.
(move_minibuffers_onto_frame): Renamed from `move_minibuffer_onto_frame' given
two arguments, the old frame and for_deletion, and simplified. Minibuffers
are now stacked in the mini-window's ->prev_buffers field.
(read_minibuf): Several detailed amendments.
(exp_MB_frame): New Lisp_Object, the expired minibuffer's frame.
(read_minibuf_unwind): Search for the expired minibuffer's frame, rather than
taking it from (unreliable) variables. Switch temporarily to this frame for
tidying up operations.
(minibuffer_unwind): New function which pops a stacked minibuffer.
(syms_of_minibuf): Call staticpro for the two new Lisp variables.
* src/window.c (Fset_window_configuration): Don't record minibuffers with
record-window-buffer.
* src/xdisp.c (gui_consider_frame_title): Remove redundant Fselect_window,
which caused an unwanted frame switch. Amend the arguments to
format_mode_line_unwind_data to match.
* doc/emacs/basic.texi (Repeating): Document repeat-mode.
* lisp/repeat.el (repeat-exit-key): New defcustom.
(repeat-mode): New global minor mode.
(repeat-post-hook): New function.
* lisp/bindings.el (undo-repeat-map): New variable.
(undo): Put 'repeat-map' property with
'undo-repeat-map'.
(next-error-repeat-map): New variable.
(next-error, previous-error): Put 'repeat-map' property with
'next-error-repeat-map'.
* lisp/window.el (other-window-repeat-map): New variable.
(other-window): Put 'repeat-map' property with
'other-window-repeat-map'.
(resize-window-repeat-map): New variable.
(enlarge-window, enlarge-window-horizontally)
(shrink-window-horizontally, shrink-window): Put 'repeat-map'
property with 'resize-window-repeat-map'.
To scroll up/down the current displayed occurrence/error
without abandon the Occur/Grep buffer.
Add also a command 'recenter-other-window' to recenter
the other window from any kind of buffer.
* lisp/window.el (recenter-other-window): New command.
Bind recenter-other-window to S-M-C-l (Bug#46119).
* lisp/simple.el (recenter-current-error): New command.
* lisp/progmodes/grep.el (grep-mode-map):
Delete bidings for n and p.
* lisp/progmodes/compile.el (compilation-minor-mode-map):
Move here the n and p bindings.
Bind `recenter-current-error' to l.
* lisp/replace.el (occur-mode-map):
Same.
* doc/emacs/windows.texi (Other Window):
* doc/emacs/display.texi (Recentering):
Document recenter-other-window.
* etc/NEWS (Changes in Specialized Modes and Packages in Emacs 28.1):
Announce the changes.
* lisp/window.el (display-buffer-use-some-window): Remove spurious
message included in 2021-01-11 "Support using auth-source for
NickServ passwords in ERC" (bug#45340#44).
488204cdc6 (origin/emacs-27) Remove one of recently added warnings ab...
55bc1560ac Fix assertion failure in window_box_height (Bug#45737)
27743e9e70 Fix cl-concatenate inlining
32a3758c84 Fix infloop in 'pixel-scroll-mode'
74d18957b8 Fix inhibiting the default.el loading in user init file
* lisp/etc/erc-services.el (erc-nickserv-passwords): Document that
the passwords are only used when erc-prompt-for-nickserv-password
is nil.
* (erc-use-auth-source-for-nickserv-password): New customizable
variable to enable checking auth-source for NickServ passwords.
* (etc-nickserv-get-password): New function to handle the lookup
of the NickServ password from both auth-source and the
erc-nickserv-passwords variable.
* (erc-nickserv-call-identify-function): Use new
erc-nickserv-get-password function to lookup NickServ passwords.
* (erc-nickserv-identify-autodetect, erc-nickserv-identify-on-connect,
erc-nickserv-identify-on-nick-change): Call
erc-nickserv-call-identify-function when
erc-use-auth-source-for-nickserv-password is set.
* etc/NEWS: Document change (bug#45340).
In particular, add a new value to the variable, and fix several bugs apparent
with the implementation up till now.
* doc/emacs/mini.texi (Basic Minibuffer): Add a description of the new
non-nil, non-t value of minibuffer-follows-selected-frame.
* doc/emacs/trouble.texi (Quitting): Add a description of how C-g handles
recursive minibuffers when typed in one which isn't the most nested.
* doc/lispref/minibuf.texi (Intro to Minibuffers): Add an @dfn for "active
minibuffer".
(Minibuffer Commands): Document that exit-minibuffer throws an error when not
invoked from the innermost Minibuffer.
(Recursive Mini): Amend the description of the visibility of outer level
minibuffers.
(Minibuffer Misc): In the description of the minibuffer hooks, replace "the
minibuffer" with "a minibuffer".
* etc/NEWS (Entry announcing minibuffer-follows-selected-frame): Add a
description of the new non-nil, non-t value.
* lisp/cus-start.el (top level): make the customize entry for
minibuffer-follows-selected-frame a choice between three entries.
* lisp/minibuffer.el (exit-minibuffer): throw an error when we're not in the
most nested minibuffer.
(top level): Bind C-g to abort-minibuffers in minibuffer-local-map.
* lisp/window.el (window-deletable-p): return the symbol `frame' when (amongst
other things) minibuffer-follows-selected-frame is t.
* src/eval.c (internal_catch): Add a mechanism to (throw 'exit t) repeatedly
when the throw currently being processed doesn't terminate the current
minibuffer.
* src/lisp.h (this_minibuffer_depth): New extern declaration
(minibuf_level): extern declaration moved here from window.h.
* src/minibuf.c (minibuffer_follows_frame, minibuf_stays_put)
(minibuf_moves_frame_when_opened): New and amended functions to query the
value of minibuffer-follows-selected-frame.
(choose_minibuf_frame): check (minibuf > 1) in place of (minibufer > 0) at a
particular place. At another place, check that an alleged frame is so and is
live. Before selecting a non-miniwindow on a different frame, ensure it
really is a different frame.
(move_minibuffer_onto_frame): Stack up all recursive minibuffers on the target
frame. Check the minibuf_window isn't in the old frame before setting that
frame's miniwindow to an inactive minibuffer.
(Finnermost_minibuffer_p, Fabort_minibuffers): New primitives.
(this_minibuffer_depth): New function.
(read_minibuf): Record the calling frame in a variable, and switch back to it
after the recursive edit has terminated normally, using
select-frame-set-input-focus. Stack up all the recursive minibuffers on the
miniwindow where a new minibuffer is being opened. After the recursive edit,
switch the selected window away from the expired minibuffer's window.
(nth_minibuffer): New function.
(minibuffer-follows-selected-frame): Change from a DEFVAR_BOOL to a
DEFVAR_LISP.
* src/window.c (decode_next_window_args): Set *minibuf to w's mini-window's
content when that content is a minibuffer.
* src/window.h (minibuf_level) Declaration moved from here to lisp.h.
* lisp/window.el (window-sizable): Don't try to grow a mini window
when the root window's minimum height is already larger than its
actual height (Bug#45737).
* doc/lispref/windows.texi (Buffer Display Action Functions):
Document it.
* lisp/window.el (display-buffer--action-function-custom-type): Add.
(display-buffer): Mention it.
(display-buffer-use-least-recent-window): New function (bug#45688).
* src/window.c (Fwindow_bump_use_time): New function.
* lisp/windmove.el (windmove-display-in-direction)
(windmove-delete-in-direction, windmove-swap-states-in-direction):
Add 'nomini' as MINIBUF arg of window-in-direction.
* lisp/window.el (window-in-direction): Rename arg MINI to MINIBUF.
Update docstring from walk-window-tree.
Send MINIBUF arg to walk-window-tree unchanged.
f5d7fb3a2d (origin/emacs-27) Fix 'uudecode-decode-region-internal' in...
d4242177da Fix 'send-string-to-terminal' writing very long strings
9da0f4026c * lisp/subr.el (read-char-from-minibuffer): Doc fix. (Bug...
9899f74e4e Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e...
a6fcba783e Fix documentation of 'windmove-swap-states-default-keybind...
f4acd7a924 Split windows evenly when 'min-margins' parameter was set ...
* lisp/window.el (split-window): Make new window inherit any
'min-margins' parameter from WINDOW so that horizontal splits
reliably produce windows of same width (Bug#44483).
* lisp/window.el (fit-mini-frame-to-buffer,
window--resize-mini-frame, fit-frame-to-buffer,
fit-frame-to-buffer-1): By default, fit a mini frame without skipping its
buffer's leading or trailing empty lines.
* src/frame.c (resize-mini-frames): Update doc-string.
* lisp/cus-start.el (resize-mini-frames): Update for customize.
* doc/lispref/minibuf.texi (resize-mini-frames): Update description.