1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00
Commit Graph

818 Commits

Author SHA1 Message Date
Robert Pluim
36aa9bd818 ; Fix previous change
* lisp/window.el (display-tex-shell-buffer-action): Fix default
value's type.  (Bug#63956)
2023-06-12 19:08:31 +02:00
Eli Zaretskii
bdb0bc2b4e Fix tex-mode display-buffer issues
* lisp/window.el (display-tex-shell-buffer-action): New defcustom.
* lisp/textmodes/tex-mode.el (tex-display-shell)
(tex-cmd-doc-view, tex-recenter-output-buffer): Use it.
(Bug#63956)
2023-06-11 09:15:01 +03:00
Juri Linkov
8e61d23f71 Split windows horizontally in places that use split to create a new window.
* lisp/tab-bar.el (tab-bar-new-tab-to):
* lisp/window.el (window-state-put):
To create a new window, split horizontally instead of vertically.
Use 'window-safe-min-width' for the SIZE arg of 'split-window'.
(bug#62592)
2023-05-19 21:04:50 +03:00
Eli Zaretskii
4ec4f614c7 ; Fix incompatibility in 'display-buffer-assq-regexp'
* lisp/window.el (display-buffer-assq-regexp): Make it accept a
buffer's name again, as it did in Emacs 28.  This makes computing
the buffer's name inside the function unnecessary.
(display-buffer): Always pass the buffer's name to
'display-buffer-assq-regexp'.  (Bug#62417)
2023-03-28 14:08:29 +03:00
João Távora
edc460e3b6 Fix accidental backward-incompatible change (bug#62417)
This code used to work, but with the change of 59ecf25fc8 it stopped
working:

   (defun foop (buffer-name _alist) (string-match "foop" buffer-name))
   (add-to-list 'display-buffer-alist '(foop . display-buffer-other-frame))

This change makes it work again, restoring compatibility.

* lisp/subr.el (buffer-match-p): Fix and adjust docstring.
* lisp/window.el (display-buffer-alist): Adjust docstring.
(display-buffer-assq-regexp): Make good on promise of display-buffer-alist.
2023-03-27 12:59:14 +01:00
Eli Zaretskii
e0bf2da3db ; More accurate doc strings for 'window-at' and 'window-at-x-y'.
* lisp/window.el (window-at-x-y):
* src/window.c (Fwindow_at): Doc fix.  (Bug#61948)
2023-03-04 10:43:25 +02:00
martin rudalics
9f508cef85 Fix 'display-buffer-use-least-recent-window'
* src/window.c (Fwindow_use_time): Doc fix.
(Fwindow_bump_use_time): Bump use time of the seleceted window as
well.  Doc fix.

* lisp/window.el (display-buffer-avoid-small-windows): Remove.
All users changed.
(window--display-buffer): Bump window use time when requested.
(display-buffer--lru-window): New function.
(display-buffer-use-some-window): Use it.
(display-buffer-use-least-recent-window): Rewrite and enhance doc
string.

* doc/lispref/windows.texi (Selecting Windows)
(Buffer Display Action Functions, Buffer Display Action Alists)
(The Zen of Buffer Display): Improve and update documentation of
window selection and display facilities.
2023-02-18 19:24:59 +02:00
Eli Zaretskii
c6660a6d6d Improve documentation of 'repeat-mode' and related variables
* lisp/bindings.el (next-error-repeat-map)
(page-navigation-repeat-map, undo-repeat-map):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map): Mention repeatable commands in the doc
strings.
* lisp/repeat.el (repeat-exit-timeout, repeat-check-key)
(repeat-echo-function, repeat-mode, repeat-check-key)
(repeat-check-map, repeat-echo-message-string)
(repeat-echo-message, repeat-echo-mode-line)
(describe-repeat-maps): Improve wording of doc strings.
(describe-repeat-maps): Improve wording of the heading line.
(Bug#61183)

* doc/emacs/basic.texi (Repeating): Clarify and improve wording of
'repeat-mode' documentation.
2023-02-02 15:34:58 +02:00
Eli Zaretskii
41f497c8be Fix doc strings of window-splitting commands
* lisp/window.el (split-window-below, split-window-right): Doc
fixes.  (Bug#60886)
2023-01-26 09:59:58 +02:00
Juri Linkov
758ac5eabb Fix split-window-below for the case when split-window-keep-point is nil.
* lisp/window.el (split-window-below): Don't try to move point when
split-window-keep-point is nil and window-to-split is not the selected window
or nil (that defaults to the selected window) because code makes sense
only for the selected window.
(split-window-below, split-window-right): Improve docstrings (bug#60886)
2023-01-18 20:24:26 +02:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Juri Linkov
05d8310fb5 Use the new keyword ':repeat' in repeatable keymaps.
* lisp/bindings.el (undo-repeat-map)
(buffer-navigation-repeat-map, next-error-repeat-map)
(page-navigation-repeat-map):
* lisp/comint.el (comint-repeat-map):
* lisp/dired.el (dired-jump-map):
* lisp/outline.el (outline-navigation-repeat-map)
(outline-editing-repeat-map):
* lisp/shell.el (shell-repeat-map):
* lisp/tab-bar.el (tab-bar-switch-repeat-map)
(tab-bar-move-repeat-map):
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map):
* lisp/winner.el (winner-repeat-map):
* lisp/eshell/em-prompt.el (eshell-prompt-repeat-map):
* lisp/eshell/esh-mode.el (eshell-command-repeat-map):
Add the keyword ':repeat' to 'defvar-keymap' instead of
setting the symbol property 'repeat-map' explicitly.

* lisp/keymap.el (defvar-keymap): Check for 'props'
that is used in 'defvar-form'.
2022-12-22 10:03:09 +02:00
Eli Zaretskii
4d1e4a4893 Fix 'window-max-chars-per-line' when there are no fringes
* lisp/window.el (window-max-chars-per-line): Fix the way we
account for the fringes by calling 'window-fringes'.  (Bug#59963)
2022-12-17 14:04:14 +02:00
Eli Zaretskii
752f9dde63 ; Fix a typo in window.el
* lisp/window.el (switch-to-prev-buffer-skip-p): Fix typo.
Patch by Shuguang Sun <shuguang79@qq.com>.  (Bug#59985)
2022-12-14 17:08:46 +02:00
Juanma Barranquero
f6aa7c335f ; Typo fixes in etc/NEWS and lisp/ files 2022-11-29 22:37:18 +01:00
Stefan Kangas
ba485eb949 ; Fix typos 2022-11-18 16:02:19 +01:00
Stefan Kangas
32f36db4f8 Prefer defvar-keymap in window.el
* lisp/window.el (other-window-repeat-map)
(resize-window-repeat-map): Prefer defvar-keymap.
2022-11-17 09:34:24 +01:00
Sean Whitton
30ca49c8f6 Use '^' key for detach command bindings
* lisp/tab-bar.el (tab-prefix-map): Move tear-off-window to C-x w ^ f.
Bind tab-window-detach to C-x w ^ t.
* lisp/window.el (window-prefix-map): Bind tab-detach to C-x t ^ f.
2022-09-14 16:03:50 -07:00
Sean Whitton
1c13ecae66 Add new C-x w prefix map
* window.el (window-prefix-map): New map.
(ctl-x-map): Unbind split-root-window-below and
split-root-window-right.  Bind window-prefix-map to C-x w.
2022-09-12 07:34:13 -07:00
Stefan Kangas
1f29ee2d21 Delete many items obsolete since 24.3
* lisp/allout.el (allout-exposure-change-hook)
(allout-structure-added-hook, allout-structure-deleted-hook)
(allout-structure-shifted-hook):
* lisp/arc-mode.el (archive-extract-hooks):
* lisp/buff-menu.el (Buffer-menu-buffer+size-width):
* lisp/calendar/timeclock.el (timeclock-modeline-display)
(timeclock-modeline-display, timeclock-update-modeline):
* lisp/cedet/semantic/db-el.el
(semanticdb-elisp-sym-function-arglist):
* lisp/cedet/semantic/db-file.el (semanticdb-save-database-hooks):
* lisp/cedet/semantic/edit.el (semantic-change-hooks)
(semantic-edits-new-change-hooks)
(semantic-edits-delete-change-hooks)
(semantic-edits-reparse-change-hooks):
* lisp/cedet/semantic/lex.el (semantic-lex-reset-hooks):
* lisp/comint.el (comint--unquote&expand-filename)
(comint-unquote-filename):
* lisp/custom.el (user-variable-p):
* lisp/dired.el (dired-shrink-to-fit, dired-pop-to-buffer)
(dired-sort-set-modeline):
* lisp/ebuff-menu.el (Electric-buffer-menu-mode):
* lisp/emacs-lisp/byte-run.el (macro-declaration-function):
* lisp/emacs-lisp/checkdoc.el (custom-print-functions)
(checkdoc-comment-style-hooks):
* lisp/emacs-lisp/cl-lib.el (custom-print-functions):
* lisp/emacs-lisp/edebug.el (gud-inhibit-global-bindings):
* lisp/erc/erc-dcc.el (erc-dcc-chat-filter-hook):
* lisp/eshell/esh-mode.el (eshell-status-in-modeline):
* lisp/eshell/eshell.el (eshell-add-to-window-buffer-names)
(eshell-remove-from-window-buffer-names):
* lisp/faces.el (set-face-underline-p, font-list-limit):
* lisp/files.el (automount-dir-prefix, toggle-read-only):
* lisp/filesets.el (filesets-cache-fill-content-hooks):
* lisp/frame.el (automatic-hscrolling):
* lisp/generic-x.el (javascript-generic-mode)
(javascript-generic-mode-hook):
* lisp/gnus/gnus-start.el (gnus-subscribe-newsgroup-hooks):
* lisp/gnus/nndiary.el (nndiary-request-create-group-hooks)
(nndiary-request-update-info-hooks)
(nndiary-request-accept-article-hooks):
* lisp/htmlfontify.el (hfy-post-html-hooks):
* lisp/international/mule-cmds.el
(inactivate-current-input-method-function)
(inactivate-input-method, input-method-inactivate-hook)
(ucs-insert):
* lisp/international/quail.el (quail-inactivate)
(quail-inactivate-hook):
* lisp/international/robin.el (robin-inactivate)
(robin-inactivate-hook):
* lisp/leim/quail/hangul.el (hangul-input-method-inactivate):
* lisp/leim/quail/uni-input.el (ucs-input-inactivate):
* lisp/mail/emacsbug.el (report-emacs-bug-info):
* lisp/mh-e/mh-e.el (mh-kill-folder-suppress-prompt-hooks):
* lisp/mpc.el (mpc-string-prefix-p):
* lisp/net/rcirc.el (rcirc-print-hooks, rcirc-sentinel-hooks)
(rcirc-receive-message-hooks, rcirc-activity-hooks):
* lisp/obsolete/crisp.el (crisp-mode-modeline-string):
* lisp/pcomplete.el (pcomplete-arg-quote-list)
(pcomplete-quote-argument):
* lisp/progmodes/cc-mode.el (c-prepare-bug-report-hooks):
* lisp/progmodes/python.el (python-info-ppss-context)
(python-info-ppss-context-type)
(python-info-ppss-comment-or-string-p, python-indent)
(python-guess-indent, python-buffer, python-preoutput-result)
(python-proc, python-send-receive, python-send-string)
(python-use-skeletons):
* lisp/progmodes/sh-script.el (sh-maybe-here-document):
* lisp/replace.el (query-replace-interactive):
* lisp/strokes.el (strokes-modeline-string):
* lisp/subr.el (redraw-modeline):
* lisp/term.el (term-default-fg-color, term-default-bg-color):
* lisp/textmodes/tex-mode.el (latex-string-prefix-p)
(tex-string-prefix-p):
* lisp/url/url-parse.el (url-recreate-url-attributes):
* lisp/vc/add-log.el (change-log-acknowledgement):
* lisp/vc/ediff-wind.el
(ediff-choose-window-setup-function-automatically):
* lisp/vc/pcvs-util.el (cvs-string-prefix-p):
* lisp/vc/vc.el (vc-string-prefix-p):
* lisp/window.el (display-buffer-function):
* lisp/winner.el (winner-mode-leave-hook): Remove many functions and
variables obsolete since 24.3.

* lisp/buff-menu.el (list-buffers--refresh):
* lisp/dired.el (dired-mode-map):
* lisp/files.el (abbreviate-file-name):
* lisp/generic-x.el (generic-default-modes):
* lisp/mh-e/mh-funcs.el (mh-kill-folder):
* lisp/progmodes/hideif.el (hide-ifdef-mode-submap):
* lisp/replace.el (query-replace-read-from):
* lisp/term.el (term):
* lisp/window.el (display-buffer): Don't use above deleted
functions and variables.

* src/marker.c (Fbuffer_has_markers_at): Delete DEFUN obsolete
since 24.3.
(syms_of_marker) <Sbuffer_has_markers_at>: Delete defsubr.
* lisp/subr.el (buffer-has-markers-at): Remove obsoletion
of above deleted DEFUN.
* etc/TODO: Doc fix; don't mention above deleted function.

* admin/cus-test.el (cus-test-get-options):
* lisp/pcomplete.el: Doc fixes; don't mention removed items.
; * etc/NEWS: List removed items.
2022-09-09 11:27:30 +02:00
Hugo Heagren
6a2ee981c3 Add new functions for splitting the root window
* lisp/window.el (split-window-right): Add optional argument to
control which window is split (previously, would only split selected
window).  Update docstring.
* doc/lispref/windows.texi (Splitting Windows): Update docs for
`split-window-right'.
* lisp/window.el (split-window-below): Add optional argument to
control which window is split (previously, would only split selected
window).  Update docstring.
* doc/lispref/windows.texi (Splitting Windows): Update docs for
`split-window-below'.
* lisp/window.el (ctl-x-map): Bind `split-root-window-right' to 9 in
ctl-x-map.  This is consistent with binding other window-splitting
operations to numbers in this map.
* lisp/window.el (ctl-x-map): Bind `split-root-window-below' to 7 in
ctl-x-map.  This is consistent with binding other window-splitting
operations to numbers in this map.
* lisp/window.el (split-root-window-right): New function to split
whole frame.
* doc/lispref/windows.texi (Splitting Windows): Add documentation for
`split-root-window-right'.
* lisp/window.el (split-root-window-below): New function to split
whole frame.
* doc/lispref/windows.texi (Splitting Windows): Add documentation for
`split-root-window-below' (bug#56791).
2022-09-05 20:57:21 +02:00
Juri Linkov
35af917f18 Revert parts of 3f076a8e44 that caused test failures
* lisp/simple.el (line-move-finish):
* lisp/window.el (scroll-command--goto-goal-column):
Revert back to using truncate-partial-width-windows instead of
truncated-partial-width-window-p.  This change caused test failures
in lisp/ls-lisp-tests.log and lisp/emacs-lisp/edebug-tests.log.
2022-08-28 22:13:45 +03:00
Juri Linkov
3f076a8e44 Use truncated-partial-width-window-p in more places (bug#56815)
* lisp/simple.el (line-move, line-move-finish):
Use truncated-partial-width-window-p.

* lisp/window.el (count-screen-lines, scroll-command--goto-goal-column):
Use truncated-partial-width-window-p.
(truncated-partial-width-window-p): Replace window-width with
window-total-width.

* src/indent.c (scan_for_column): Bring the logic of using
truncated-partial-width-window-p closer to what the display engine does.
2022-08-27 22:52:03 +03:00
Martin Rudalics
939dc2ff12 Fix 'fit-frame-to-buffer' (Bug#56102)
* lisp/window.el (fit-frame-to-buffer-sizes): Fix doc-string.
Give calls to 'max' a second argument so they do something
useful.  If ONLY equals 'vertically', call
'window-text-pixel-size' with X-LIMIT nil (Bug#56102).  For
minimum sizes of the window to fit, use 'window-safe-min-size' by
default.
* doc/lispref/windows.texi (Resizing Windows): Fix descriptions of
'fit-frame-to-buffer' and 'fit-frame-to-buffer-sizes'.
2022-07-06 09:25:43 +02:00
Stefan Kangas
9d866a1f8d Make some defcustom types more restrictive
* lisp/abbrev.el (abbrev-suggest-hint-threshold):
* lisp/bookmark.el (bookmark-bmenu-file-column)
(bookmark-menu-length):
* lisp/buff-menu.el (Buffer-menu-size-width)
(Buffer-menu-mode-width):
* lisp/calendar/calendar.el (calendar-week-start-day)
(calendar-intermonth-spacing, calendar-column-width)
(calendar-day-digit-width):
* lisp/calc/calc.el (calc-undo-length):
* lisp/calendar/timeclock.el (timeclock-workday):
* lisp/comint.el (comint-buffer-maximum-size)
(comint-input-ring-size):
* lisp/doc-view.el (doc-view-resolution, doc-view-image-width):
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-max-column):
* lisp/emacs-lisp/comp.el (native-comp-debug)
(native-comp-verbose, native-comp-async-jobs-number):
* lisp/emacs-lisp/package.el (package-name-column-width)
(package-version-column-width, package-status-column-width)
(package-archive-column-width):
* lisp/eshell/esh-mode.el (eshell-buffer-maximum-lines):
* lisp/frame.el (blink-cursor-blinks):
* lisp/info.el (Info-breadcrumbs-depth):
* lisp/jit-lock.el (jit-lock-chunk-size):
* lisp/kmacro.el (kmacro-ring-max):
* lisp/menu-bar.el (yank-menu-length, yank-menu-max-items):
* lisp/midnight.el (clean-buffer-list-delay-general)
(clean-buffer-list-delay-special):
* lisp/net/dictionary.el (dictionary-port)
(dictionary-proxy-port):
* lisp/net/ldap.el (ldap-default-port):
* lisp/net/pop3.el (pop3-port, pop3-stream-length):
* lisp/net/rcirc.el (rcirc-default-port):
* lisp/net/sieve-manage.el (sieve-manage-default-port):
* lisp/play/spook.el (spook-phrase-default-count):
* lisp/play/tetris.el (tetris-buffer-width)
(tetris-buffer-height, tetris-width, tetris-height)
(tetris-top-left-x, tetris-top-left-y):
* lisp/profiler.el (profiler-sampling-interval):
* lisp/progmodes/sql.el (sql-port):
* lisp/recentf.el (recentf-max-menu-items):
* lisp/strokes.el (strokes-grid-resolution):
* lisp/tab-bar.el (tab-bar-tab-name-truncated-max):
* lisp/term/xterm.el (xterm-max-cut-length):
* lisp/time.el (display-time-interval, world-clock-timer-second):
* lisp/url/url-cache.el (url-cache-expire-time):
* lisp/url/url-cookie.el (url-cookie-save-interval):
* lisp/url/url-history.el (url-history-save-interval):
* lisp/url/url-queue.el (url-queue-parallel-processes)
(url-queue-timeout):
* lisp/url/url-vars.el (url-max-password-attempts)
(url-max-redirections):
* lisp/vc/emerge.el (emerge-min-visible-lines):
* lisp/vc/vc.el (vc-log-show-limit):
* lisp/window.el (window-min-height, window-min-width):
* lisp/winner.el (winner-ring-size): Use :type natnum.

* lisp/savehist.el (savehist-file-modes): Fix setting to nil value and
use :type natnum.
2022-07-05 18:33:29 +02:00
Juri Linkov
d7270b4445 Allow C-x 4 4, C-x 5 5, C-x t t to handle commands that use switch-to-buffer
* lisp/window.el (display-buffer-override-next-command):
Temporarily set switch-to-buffer-obey-display-actions to t,
and revert back to the original value afterwards.
This allows other-window-prefix, other-frame-prefix, other-tab-prefix,
windmove-display-in-direction to override the default behavior of
commands that use switch-to-buffer.
https://lists.gnu.org/archive/html/emacs-devel/2022-06/msg00483.html
2022-06-09 09:41:52 +03:00
Lars Ingebrigtsen
bb9c899b07 Make the goal column work for the scrolling commands, too
* doc/emacs/basic.texi (Moving Point): Document it.
* lisp/simple.el (set-goal-column): Update doc string.

* lisp/window.el (scroll-up-command, scroll-down-command): Make
the goal column take effect for these commands, too (bug#17346).
2022-06-05 21:35:56 +02:00
Lars Ingebrigtsen
1e42c2c5fc Remove window-max-characters-per-line
* doc/lispref/windows.texi (Window Sizes):
* doc/lispref/display.texi (Size of Displayed Text): Remove
documentation.
* lisp/fringe.el (fringe-mode): Point to the right function.

* lisp/window.el (window-char-pixel-width)
(window-char-pixel-height, window-max-characters-per-line): Remove
functions -- this was already added as window-max-chars-per-line.

* src/window.c (Fwindow_body_width): Adjust doc string.
2022-06-03 05:20:16 +02:00
Lars Ingebrigtsen
b2bce107b1 Further audits of single quotes in Lisp doc strings
* test/manual/etags/el-src/emacs/lisp/progmodes/etags.el
(tags-apropos-additional-actions):
* lisp/window.el (delete-window-choose-selected):
* lisp/vc/ediff-merg.el (ediff-combination-pattern):
* lisp/vc/diff.el (diff-no-select):
* lisp/tab-bar.el (tab-bar-new-tab-choice):
* lisp/simple.el (next-error-message-highlight):
(backward-delete-char-untabify):
* lisp/ses.el (ses-jump-cell-name-function):
* lisp/org/org.el (org-latex-to-html-convert-command):
* lisp/org/org-agenda.el (org-agenda-sorting-strategy):
* lisp/net/tramp.el (tramp-default-file-modes):
* lisp/net/newst-treeview.el
(newsticker-treeview-use-feed-name-from-url-list-in-treeview):
* lisp/net/eww.el (eww-auto-rename-buffer):
* lisp/mwheel.el (mouse-wheel-scroll-amount):
* lisp/mail/rmail.el (rmail-re-abbrevs):
* lisp/info.el (Info-history-forward-menu):
* lisp/gnus/nnselect.el (nnselect-retrieve-headers-override-function):
* lisp/gnus/gnus-start.el (gnus-subscribe-hierarchical-interactive):
* lisp/fringe.el (fboundp):
* lisp/eshell/esh-var.el (eshell-variable-aliases-list):
* lisp/emacs-lisp/checkdoc.el (checkdoc-column-zero-backslash-before-paren):
* lisp/dired-aux.el (dired-confirm-shell-command):
* lisp/calendar/calendar.el (calendar-time-zone-style):
* lisp/ansi-color.el (ansi-color-faces-vector):
(ansi-color-names-vector): Audit use of various single quotes in
Lisp doc strings.
2022-05-24 13:17:53 +02:00
Michael Albinus
5088ebc8eb * lisp/window.el (display-buffer-avoid-small-windows): Fix :type. 2022-05-22 14:48:30 +02:00
Eli Zaretskii
eb71446de5 ; Improve documentation of 'display-buffer-avoid-small-windows'
* lisp/window.el (display-buffer-avoid-small-windows)
(get-lru-window):
* etc/NEWS:
* doc/lispref/windows.texi (Choosing Window Options): Improve
documentation of 'display-buffer-avoid-small-windows'.
(Bug#10186)
2022-05-20 14:35:03 +03:00
Lars Ingebrigtsen
3c82e96954 Add new user option display-buffer-avoid-small-windows
* doc/lispref/windows.texi (Choosing Window Options): Document it.
* lisp/window.el (display-buffer-avoid-small-windows): New user
option (bug#10186).
(get-lru-window): Use it.
2022-05-20 12:05:43 +02:00
Lars Ingebrigtsen
a67d8e0d70 Add a new display-buffer-full-frame display action
* doc/lispref/windows.texi (Buffer Display Action Functions):
Document it.

* lisp/window.el (display-buffer-full-frame): New display action
(bug#34169).
(display-buffer--action-function-custom-type): Add.
(display-buffer): Mention it.
2022-05-18 15:33:57 +02:00
Martin Rudalics
e1c972b247 Clean up and simplify 'quit-restore-window' code
* lisp/window.el (window--quit-restore-select-window): New internal
name for 'quit-restore-select-window'.
(quit-restore-window): Use 'window--quit-restore-select-window'
instead of 'quit-restore-select-window'.  Simplify code.
2022-05-18 11:09:58 +02:00
Martin Rudalics
88e0e034ef 2022-05-14 Martin Rudalics <rudalics@gmx.at>
* lisp/window.el (quit-restore-select-window): New function.
(quit-restore-window): Call 'quit-restore-select-window' to avoid
selecting inactive minibuffer window (Bug#55403).
2022-05-14 09:19:57 +02:00
Eli Zaretskii
36e84d2289 ; Improve documentation of 'switch-to-prev-buffer-skip-regexp'
* lisp/window.el (switch-to-prev-buffer-skip-regexp):
* etc/NEWS:
* doc/lispref/windows.texi (Window History): Improve wording of
the documentation of 'switch-to-prev-buffer-skip-regexp'.
(Bug#19070)
2022-05-12 09:29:53 +03:00
Lars Ingebrigtsen
0d0dc1af59 Add new user option switch-to-prev-buffer-skip-regexp
* doc/lispref/windows.texi (Window History): Document it.
* lisp/window.el (switch-to-prev-buffer-skip): Mention it.
(switch-to-prev-buffer-skip-regexp): New user option (bug#19070).
(switch-to-prev-buffer-skip-p): Use it.
2022-05-12 03:35:49 +02:00
Sean Whitton
054062060e Factor out *scratch* initialization
* lisp/simple.el (get-scratch-buffer-create): New function, factored
out of scratch-buffer, and additionally clearing the modification flag
and calling substitute-command-keys (bug#55257).
(scratch-buffer):
* lisp/server.el (server-execute):
* lisp/startup.el (normal-no-mouse-startup-screen, command-line-1):
* lisp/window.el (last-buffer, window-normalize-buffer-to-switch-to):
* src/buffer.c (Fother_buffer, other_buffer_safely): Use it.
(syms_of_buffer): Add Qget_scratch_buffer_create.
* lisp/startup.el (startup--get-buffer-create-scratch): Delete
now-unused function.
* doc/lispref/os.texi (Summary: Sequence of Actions at Startup):
* NEWS (Incompatible changes in Emacs 29.1): Document the change.
2022-05-09 18:49:13 -07:00
Lars Ingebrigtsen
f7c56a0d73 Explain better what the interactive prefix does in scroll-down/up
* lisp/window.el (scroll-up-command, scroll-down-command):
* lisp/image-mode.el (image-scroll-up, image-scroll-down):
Actually explain what the interactive prefix does (bug#44503).
2022-05-07 15:05:45 +02:00
Lars Ingebrigtsen
730ad4a373 Make scroll-other-window respect target window remappings
* lisp/window.el (scroll-other-window, scroll-other-window-down):
Moved from window.c and change implementation so that they respect
command remappings in the target window (bug#20236).
2022-05-01 12:47:41 +02:00
Lars Ingebrigtsen
e065d08fa7 Simplify window-char-pixel-* code slightly
* lisp/window.el (window-char-pixel-width)
(window-char-pixel-height): Simplify code slightly.
2022-04-29 15:52:21 +02:00
Titus von der Malsburg
91418d27e9 Add new functions for computing character metrics for windows
* doc/lispref/display.texi (Size of Displayed Text): Document the
char functions.
* doc/lispref/windows.texi (Window Sizes): Document
window-max-characters-per-line.

* lisp/window.el (window-char-pixel-width)
(window-char-pixel-height)
(window-max-characters-per-line): New functions (bug#19395).
2022-04-29 15:14:09 +02:00
Lars Ingebrigtsen
a38b7d3e90 Tweak interactive use of delete-windows-on
* lisp/window.el (delete-windows-on): Make prompting better, and
allow specifying only the current frame interactively (bug#34749).
2022-04-26 14:32:07 +02:00
Lars Ingebrigtsen
bbf389ea6d Audit quoting the quote character in doc strings
* test/src/regex-emacs-tests.el (regex-tests-compare):
(regex-tests-compare):
(regex-tests-match):
* test/lisp/xml-tests.el (xml-parse-tests--qnames):
* test/lisp/mh-e/mh-thread-tests.el (mh-thread-tests-before-from):
* test/lisp/cedet/srecode-utest-template.el (srecode-utest-map-reset):
* test/lisp/calc/calc-tests.el (calc-tests-equal):
* lisp/window.el (get-lru-window):
(get-mru-window):
(get-largest-window):
(quit-restore-window):
(display-buffer):
* lisp/vc/vc-rcs.el (vc-rcs-consult-headers):
* lisp/url/url-auth.el (url-digest-auth-build-response):
* lisp/tutorial.el (tutorial--find-changed-keys):
* lisp/transient.el (transient-suffix-object):
* lisp/textmodes/rst.el (rst-insert-list-new-item):
* lisp/textmodes/bibtex.el (bibtex-clean-entry):
* lisp/tab-bar.el (tab-bar--key-to-number):
(toggle-frame-tab-bar):
* lisp/ses.el (ses-recalculate-cell):
(ses-define-local-printer):
(ses-prin1):
* lisp/progmodes/xref.el (xref--find-ignores-arguments):
* lisp/progmodes/verilog-mode.el (verilog-single-declaration-end):
* lisp/progmodes/tcl.el (tcl-mode-hook):
* lisp/progmodes/gdb-mi.el (gdb-get-buffer-create):
* lisp/progmodes/elisp-mode.el (elisp--xref-make-xref):
* lisp/play/dunnet.el (dun-room-objects):
* lisp/outline.el (outline--cycle-state):
* lisp/org/ox-publish.el (org-publish-find-property):
* lisp/org/ox-html.el (org-html--unlabel-latex-environment):
* lisp/org/org-table.el (org-table-collapse-header):
* lisp/org/org-plot.el (org--plot/prime-factors):
* lisp/org/org-agenda.el (org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/org/ob-lua.el (org-babel-lua-read-string):
* lisp/org/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/org/ob-core.el (org-babel-default-header-args):
* lisp/obsolete/mouse-sel.el (mouse-select):
(mouse-select-secondary):
* lisp/net/tramp.el (tramp-methods):
* lisp/net/eww.el (eww-accept-content-types):
* lisp/net/dictionary-connection.el (dictionary-connection-status):
* lisp/minibuffer.el (completion-flex--make-flex-pattern):
* lisp/mh-e/mh-mime.el (mh-have-file-command):
* lisp/mh-e/mh-limit.el (mh-subject-to-sequence):
(mh-subject-to-sequence-threaded):
(mh-subject-to-sequence-unthreaded):
* lisp/mail/feedmail.el (feedmail-queue-buffer-file-name):
(feedmail-vm-mail-mode):
* lisp/ls-lisp.el (ls-lisp--sanitize-switches):
* lisp/keymap.el (key-valid-p):
* lisp/international/ccl.el (ccl-compile-branch-blocks):
* lisp/image/image-converter.el (image-convert):
* lisp/gnus/spam.el (spam-backend-check):
* lisp/gnus/nnselect.el (nnselect-generate-artlist):
* lisp/gnus/nnmairix.el (nnmairix-widget-other):
* lisp/gnus/message.el (message-mailto):
* lisp/gnus/gnus-sum.el (gnus-collect-urls-from-article):
* lisp/gnus/gnus-search.el (gnus-search-prepare-query):
* lisp/frame.el (frame-size-history):
* lisp/eshell/esh-var.el (eshell-parse-variable-ref):
* lisp/eshell/em-dirs.el (eshell-expand-multiple-dots):
* lisp/erc/erc-backend.el (erc-bounds-of-word-at-point):
* lisp/emulation/cua-rect.el (cua--rectangle-operation):
* lisp/emacs-lisp/text-property-search.el (text-property-search-forward):
* lisp/emacs-lisp/package.el (package-desc-suffix):
* lisp/emacs-lisp/faceup.el (faceup-test-explain):
* lisp/emacs-lisp/comp.el (comp-curr-allocation-class):
(comp-alloc-class-to-container):
(comp-add-cstrs):
(comp-remove-type-hints-func):
(batch-byte+native-compile):
* lisp/emacs-lisp/cl-macs.el (cl--optimize):
* lisp/elec-pair.el (electric-pair--syntax-ppss):
* lisp/doc-view.el (doc-view-doc-type):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-alist):
(semantic-symref-hit-to-tag-via-db):
(semantic-symref-hit-to-tag-via-buffer):
* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-get-overlay):
* lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map):
* lisp/cedet/semantic/find.el (semantic-brute-find-tag-by-function):
* lisp/cedet/semantic/db.el (semanticdb-project-predicate-functions):
* lisp/cedet/semantic.el (semantic-working-type):
* lisp/cedet/ede/files.el (ede-flush-directory-hash):
* lisp/calc/calc.el (calc--header-line):
* lisp/auth-source.el (auth-source-pick-first-password):
(auth-source--decode-octal-string):
* etc/themes/modus-themes.el (modus-themes--paren):
(modus-themes--agenda-habit):
* admin/cus-test.el (cus-test-vars-with-changed-state): Fix
quoting in doc strings.  In code examples, the ' character is
quoted with \\=, and regularize 'foo to `foo', and quote strings
like "foo" instead of 'foo'.
2022-04-22 16:17:22 +02:00
Eli Zaretskii
09f905c80b ; * lisp/window.el (display-buffer-assq-regexp): Doc fix. 2022-04-16 11:41:48 +03:00
Philip Kaludercic
c3ab8f188e Improve buffer-match-p documentation
* doc/lispref/windows.texi (Choosing Window): Document that
buffer-match-p is used by display-buffer-alist.
* etc/NEWS: Mention buffer-match-p and match-buffers.
* lisp/window.el (display-buffer-alist): Update documentation as for
display-buffer-assq-regexp.
(display-buffer-assq-regexp): Rename buffer-name to buffer-or-name.
(display-buffer): Pass the buffer directly to
display-buffer-assq-regexp,.
2022-04-15 21:12:56 +02:00
Philip Kaludercic
59ecf25fc8 * window.el (display-buffer-assq-regexp): Use buffer-match 2022-04-15 10:06:36 +02:00
Martin Rudalics
15c61cb359 Init 'rest' in 'balance-windows-2' (Bug#54380)
* lisp/window.el (balance-windows-2): Give 'rest' an initial
value (Bug#54380).
2022-03-14 10:26:36 +01:00
Stefan Kangas
bee54495e9 Merge from origin/emacs-28
666e40a109 Fix 'display-line-numbers-mode' in hide-show buffers
68d134cf0f Don't check whether a deleted window is deletable (Bug#54028)
b38223a844 A friendlier error message from image-mode in an empty buffer
b7a651ba37 Update to Org 9.5.2-17-gea6b74
3a8c3f7abd ; Don't reference obsolete variables in edebug.el
2022-02-22 06:30:59 +01:00
Martin Rudalics
68d134cf0f Don't check whether a deleted window is deletable (Bug#54028)
* lisp/window.el (window-state-put): Make sure window is live
before calling 'window-deletable-p' on it (Bug#54028).
2022-02-21 16:46:23 +01:00