summaryrefslogtreecommitdiff
path: root/lisp/window.el
Commit message (Collapse)AuthorAgeFilesLines
* Fix 'count-screen-lines' when lines are truncatedEli Zaretskii2020-05-021-10/+26
| | | | | | * lisp/window.el (count-screen-lines): Fix the return value when lines are truncated in the window, and the end of the region is invisible due to this truncation. (Bug#40849)
* * lisp/window.el (display-buffer): Extend doc with body-function (bug#39822)Juri Linkov2020-04-031-0/+6
|
* Deprecate with-displayed-buffer-window, use body-function instead (bug#39822)Juri Linkov2020-03-301-1/+9
| | | | | | | | | | | | | | | | | * doc/lispref/display.texi (Temporary Displays): Remove defmac with-displayed-buffer-window. * doc/lispref/windows.texi (Buffer Display Action Alists): Add body-function. * lisp/window.el (with-displayed-buffer-window): Declare macro obsolete. (window--display-buffer): Call 'body-function' after displaying the buffer. * lisp/dired.el (dired-mark-pop-up): * lisp/files.el (save-buffers-kill-emacs): * lisp/minibuffer.el (minibuffer-completion-help): Replace with-displayed-buffer-window with with-current-buffer-window and add action alist entry 'body-function' with former macro body.
* Add store/restore window configuration feature for gdb-miYuan Fu2020-03-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a feature that allows a user to save a gdb window configuration (window layout) to a file with 'gdb-save-window-configuration' and load it back with 'gdb-load-window-configuration'. Set a default window configuration by setting 'gdb-default-window-configuration-file'. Add an option to make gdb preserve the window configuration that the user had before starting gdb. In window.el, add 'with-window-non-dedicated'. * lisp/progmodes/gdb-mi.el (top/level): Require 'pcase' and 'cl-seq'. (gdb--window-configuration-before): New variable. (gdb-restore-window-configuration-after-quit): New option. (gdb-window-configuration-directory, gdb-default-window-configuration-file): New variables. (gdb): Save configuration on startup. (gud-menu-map): Add "Load Layout" and "Save Layout" to menu. Add "Restore Layout After Quit" button to menu. Rename "Restore Window Layout" to "Restore Default Layout", add some help echo, and move it from "GDB-MI" menu to "GDB-WINDOWs" menu. (gdb-toggle-restore-window-configuration): New function. (gdb-get-source-buffer): New function, extracted out of 'gdb-restore-window'. (gdb-setup-windows): Add a condition branch that loads default window configuration when available. Fix docstring. (gdb-buffer-p, gdb-function-buffer-p, gdb--buffer-type, gdb-save-window-configuration, gdb-load-window-configuration): New functions. (gdb-restore-windows): Edit docstring to mention 'gdb-default-window-configuration-file'. (gdb-reset): Restore window configuration after quit. * lisp/window.el (with-window-non-dedicated): New macro.
* * lisp/window.el: Avoid `called-interactively-p`.Stefan Monnier2020-03-101-12/+16
| | | | | (other-window, delete-other-windows, next-buffer, previous-buffer): Use an `interactive` arg instead.
* Merge from origin/emacs-27Glenn Morris2020-03-071-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 72f87f8873 (origin/emacs-27) NS port documentation updates 5b19db98ad ; * etc/NEWS: correctly describe what fido-mode is fc47e3ad99 Let fido-mode users force a minibuffer-exit e734961d4c icomplete-fido-exit: New command for the M-j binding 335a9bd215 minibuffer-force-complete-and-exit: Allow input with no ma... 34132d4bf6 ; * etc/NEWS: Mark 2 entries as fully documented. d28b73841b ; * etc/NEWS: Fix the 'mml-secure-openpgp-sign-with-sender... d1d56a9fd9 ; * etc/NEWS: 'thunk-let' and 'thunk-let*' are fully docum... fc4f4efabf ; * etc/NEWS: No need to document vc-hg and mergebase chan... 9e8456cf0f ; * etc/NEWS: No need to document changes in Octave mode. 25b4d6fa28 ; * etc/NEWS: No need to document changes in map.el and se... fc4d0f86da ; * etc/NEWS: No need to document Ido news. d4ac478cb3 ; * etc/NEWS: No need to document news of doc-view.el. 08c042bd26 Document that 'byte-compile-dynamic' is obsolete 512b66abd7 ; * etc/NEWS: No need to document 'goto-address-uri-scheme... 3103c01c3e ; * etc/NEWS: Formatting fixes. 98306fdfb8 ; * etc/NEWS: No need to document deprecation of 'cl'. 6281ed58be ; * etc/NEWS: No need to document the change in 'list-proc... e252341e11 ; * etc/NEWS: 'backup-by-copying-when-privileged-mismatch'... ec5a267ddc ; * etc/NEWS: Mark 'byte-count-to-string-function' as undo... 89307ebccd ; * etc/NEWS: Mark 'completion-common-part' face entry as ... fdbe7cacfb Document the changes in 'read-answer' 10c58356e4 Document changes in lexical-binding 5cb312b5b9 Update ERC mailing list address cb1877321b Use regexp-opt to define bibtex-autokey-transcriptions. (... 3f9c340de0 Improve documentation of 'table-generate-source' 33b31dc314 Attempt to avoid rare segfaults in show_mouse_face 88c6db9196 Avoid crashes when a fontset has strange entries 1814c7e158 Fix rx error with ? and ?? 40fb20061e * lisp/emacs-lisp/rx.el (rx--string-to-intervals): Fix err... 08d7d28d35 Fix args in 'window-text-pixel-size' call in 'fit-window-t... cb1e30910e Have pulse.el preserve existing overlay priorities # Conflicts: # etc/NEWS
| * Fix args in 'window-text-pixel-size' call in 'fit-window-to-buffer'Justin Burkett2020-03-051-2/+2
| | | | | | | | | | | | | | * lisp/window.el (fit-window-to-buffer): Fix arguments in 'window-text-pixel-size' call. Copyright-paperwork-exempt: yes
* | New command make-frame-on-current-monitor to use in windmove (bug#39875)Juri Linkov2020-03-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/frame.el (make-frame-on-current-monitor): New command. * lisp/windmove.el (windmove-display-in-direction): Use make-frame-on-current-monitor for 'new-frame'. (windmove-display-new-frame): New command. (windmove-display-default-keybindings): Bind windmove-display-new-frame to 'f' key. * lisp/window.el (display-buffer-in-direction): Fix quotes in docstring.
* | Merge from origin/emacs-27Glenn Morris2020-03-041-6/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a4e4510ccd Fix handling MS-Windows keyboard input above the BMP a38bebb0c1 * etc/NEWS: More complete description of rx 'not' changes. d373647e8f ; * doc/emacs/mini.texi (Yes or No Prompts): Fix last change. 1ca6d15656 * doc/emacs/mini.texi (Yes or No Prompts): 'y-or-n-p' now ... fe1a447d52 Don't attempt to cache glyph metrics for FONT_INVALID_CODE b42b894d1d Fix fit-frame-to-buffer for multi-monitor setup 366fd4fd07 (emacs-27) ; * etc/NEWS: Fix typo. 49d3cd90bd rx: Improve 'or' compositionality (bug#37659) 6b48aedb6b * lisp/tab-line.el: Fix auto-hscrolling (bug#39649) c5f255d681 (tag: emacs-27.0.90) ; Update lisp/ldefs-boot.el 60c84ad992 ; * etc/TODO: Fix last change. 5af9e5baad ; Add an entry to TODO d424195905 Fix rx charset generation 9908b5a614 Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... 6dc2ebe00e Fix overquoting in mule.el 5cca73dd82 * src/timefns.c (time_arith): Omit incorrect comment. d767c357ca Merge branch 'emacs-27' of git.savannah.gnu.org:/srv/git/e... 4dec693f70 * lisp/vc/vc-cvs.el (vc-cvs-ignore): Copy-edit doc string ff729e3f97 ; bug#39779: Fix some typos in documentation. 696ee02c3a checkdoc: Don't mistake "cf." for sentence end # Conflicts: # etc/NEWS
| * Fix fit-frame-to-buffer for multi-monitor setupSergey Trofimov2020-03-011-6/+7
| | | | | | | | | | | | | | | | | | * lisp/window.el (fit-frame-to-buffer): Call 'frame-monitor-attributes' instead of 'display-monitor-attributes-list'. Fix geometry calculations for multiple monitors. Copyright-paperwork-exempt: yes
* | Use quit-restore-window to close tab (bug#39446)Juri Linkov2020-02-101-2/+14
|/ | | | | | | | | | | | | | | | | * lisp/tab-bar.el (display-buffer-in-new-tab): New function with code from display-buffer-in-tab. (display-buffer-in-tab): Call display-buffer-in-new-tab. (switch-to-buffer-other-tab): Instead of 'display-buffer-same-window' use '(reusable-frames . t)'. * lisp/windmove.el (windmove-display-in-direction): Set arg 'type' to 'tab' for window--display-buffer when creating a new tab. * lisp/window.el (quit-restore-window): Call tab-bar-close-tab when quit-restore type is 'tab'. (display-buffer-record-window): Set window-parameter 'quit-restore' to 'tab' for type 'tab'. (window--display-buffer): Set window-prev-buffers to nil for tab too.
* Improve doc-strings of 'quit-window' and 'quit-restore-window' (Bug#38819)Martin Rudalics2020-01-051-8/+8
| | | | | | * lisp/window.el (quit-restore-window, quit-window): Make doc-strings more consistent; add references to corresponding section of the Elisp manual (Bug#38819).
* Update copyright year to 2020Paul Eggert2020-01-011-1/+1
| | | | Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
* New functions window-state-buffers and tab-bar-get-buffer-tab (bug#38354)Juri Linkov2019-12-031-0/+9
| | | | | | | | | | * lisp/window.el (window-state-buffers): New function. * lisp/tab-bar.el (tab-bar-get-buffer-tab): New function. * lisp/emacs-lisp/seq.el (seq-some): Add autoload cookie. * lisp/desktop.el (desktop-buffers-not-to-save-function): New variable. (desktop-save-buffer-p): Use it.
* Fix previous change to (next|previous)-bufferJuanma Barranquero2019-11-261-2/+4
| | | | | | * lisp/window.el (next-buffer, previous-buffer): If no other buffer is available, signal 'user-error' only when called interactively.
* (next|previous)-buffer no longer fail silently (bug#38384)Juanma Barranquero2019-11-261-2/+4
| | | | | | | * lisp/window.el (next-buffer, previous-buffer): Signal 'user-error' if there is no buffer to switch to. * etc/NEWS: Document it.
* 2019-11-26 Martin Rudalics <rudalics@gmx.at>Martin Rudalics2019-11-261-39/+127
| | | | | | | | | | | | * lisp/window.el (switch-to-visible-buffer): Declare obsolete. (switch-to-prev-buffer-skip): New option. (switch-to-prev-buffer, switch-to-next-buffer): Obey 'switch-to-prev-buffer-skip'. * doc/lispref/windows.texi (Window History): Remove description of 'switch-to-visible-buffer'. Describe new option 'switch-to-prev-buffer-skip' * etc/NEWS: Mention switch from 'switch-to-visible-buffer' to 'switch-to-prev-buffer-skip'.
* Fix some quoting glitches in doc stringsPaul Eggert2019-11-081-35/+35
| | | | This also fixes a misplaced "only".
* In 'bury-buffer' don't try to remove current buffer from minibuffer windowMartin Rudalics2019-10-171-2/+5
| | | | | * lisp/window.el (bury-buffer): Don't try to remove current buffer from minibuffer window.
* lisp/*.el, src/*.c: Doc fixes related to returning t vs non-nilJuanma Barranquero2019-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/progmodes/flymake-proc.el (flymake-proc--find-buffer-for-file): Doc fix; return value is a buffer, not t. * lisp/progmodes/ebrowse.el (ebrowse-member-display-p): Doc fix; return value is the MEMBER argument, not nil. * lisp/files.el (hack-one-local-variable-eval-safep): * lisp/play/doctor.el (doctor-nounp, doctor-pronounp): * lisp/progmodes/flymake-proc.el (flymake-proc--check-include): * lisp/progmodes/js.el (js--broken-arrow-terminates-line-p): Doc fix; a non-nil return value is not always t. * lisp/image.el (image-type-available-p): * lisp/simple.el (region-active-p): * lisp/window.el (frame-root-window-p): * src/buffer.c (Fbuffer_live_p): * src/image.c (Finit_image_library): * src/window.c (Fwindow_minibuffer_p): Doc fix; a non-nil return value is always t. * doc/lispref/minibuf.texi (Minibuffer Windows): Doc fix.
* Fix bug recently introduced in 'fit-window-to-buffer' (Bug#37743)Martin Rudalics2019-10-141-1/+1
| | | | | * lisp/window.el (fit-window-to-buffer): Call 'window-combined-p' with right argument (Bug#37743).
* * lisp/window.el (next-buffer, previous-buffer): Add repeat count arg.Juri Linkov2019-10-141-8/+10
| | | | | * doc/emacs/buffers.texi (Select Buffer): Mention arg as repeat count. (Bug#37514)
* Minor fixes for switching to previous and next buffers (Bug#37514)Martin Rudalics2019-10-111-8/+14
| | | | | | | | | * lisp/window.el (switch-to-prev-buffer) (switch-to-next-buffer): In doc-strings add links to 'prev-buffer' and 'next-buffer'. (next-buffer, previous-buffer): Signal 'user-error' instead of 'error'. In doc-strings link to 'switch-to-prev-buffer' and 'switch-to-next-buffer'.
* Fixes for fitting windows and frames to their buffers (Bug#37563)Martin Rudalics2019-10-111-111/+141
| | | | | | | | | | | | | | * lisp/window.el (window-default-font-height) (window-default-line-height): New functions. (fit-frame-to-buffer): Interpret values of MAX-HEIGHT and MIN-HEIGHT arguments in terms of WINDOW's default line height (Bug#37563). (fit-window-to-buffer): Obey size restricting arguments even when size of WINDOW's text does not change. Do not temporarily select WINDOW and perform height/width related calculations if and only if WINDOW is accordingly combined. Interpret values of MAX-HEIGHT and MIN-HEIGHT arguments in terms of WINDOW's default line height.
* Merge branch 'feature/tabs'Juri Linkov2019-10-011-1/+4
|\
| * Frame-local tab-bar and window-local tab-line.Juri Linkov2019-08-311-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'. * etc/TODO: Remove tab-related items. * lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size. * lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines. * lisp/loadup.el: Load "tab-bar". * lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode. (menu-bar-showhide-menu): Define showhide-tab-bar. * lisp/startup.el (tab-bar-images-pixel-height): New defconst. (command-line): Reset tab-bar-mode. (x-apply-session-resources): Add "tabBar", "TabBar". * lisp/subr.el (read-key): Add tab-bar. * lisp/tab-bar.el: New file. * lisp/tab-line.el: New file. * lisp/window.el (window--dump-frame): Add tab-bar-height. * src/dispextern.h (enum window_part): Add ON_TAB_LINE. (struct glyph_matrix): Add tab_line_p. (struct glyph_row): Add tab_line_p. (MATRIX_TAB_LINE_ROW): New macro. (MATRIX_FIRST_TEXT_ROW): Handle more mode lines. (MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT. (MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT) (DESIRED_TAB_LINE_HEIGHT): New macros. (enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID. (struct it): Add tab_line_p. (tab_bar_item_idx, tab_bar_item_image): New enums. (DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN) (DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT): New constants. * src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line. (shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT. (clear_current_matrices, clear_desired_matrices): Call clear_glyph_matrix on tab_bar_window. (blank_row): Add WINDOW_TAB_LINE_HEIGHT. (required_matrix_height): Change 2 to 3. (fake_current_matrices): Reset tab_line_p. (adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window. Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES. (free_glyphs): Handle tab_bar_window. (update_frame): Handle tab_bar_window. (update_window): Handle row->tab_line_p. (scrolling_window): Change arg type from bool to int. Change header_line_p to tab_line_p. (buffer_posn_from_coords): Add window_wants_tab_line. (mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE. * src/frame.c (frame_default_tab_bar_height): New internal variable. (adjust_frame_size): Handle tab_bar_window. (make_frame): Reset tab_bar_redisplayed, tab_bar_resized and last_tab_bar_item. (Ftab_bar_pixel_width): New function. (frame_parms): Add tab-bar-lines. (gui_figure_window_size): Add new arg tabbar_p. (syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar, Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width. Add Qtab_bar_lines to frame_inhibit_implied_resize. (tab-bar-mode): New variable. * src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window, desired_tab_bar_string, current_tab_bar_string. (GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item, minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized, tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items. (fset_tab_bar_items, fset_tab_bar_window) (fset_current_tab_bar_string, fset_desired_tab_bar_string): New inlines. (FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros. (FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT): Use FRAME_TAB_BAR_LINES. * src/fringe.c (draw_fringe_bitmap_1, update_window_fringes): Add WINDOW_TAB_LINE_HEIGHT. * src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH. (x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH. * src/keyboard.c (read_char): Handle Qtab_bar. (kbd_buffer_get_event): Handle TAB_BAR_EVENT. (make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT. Handle TAB_BAR_EVENT. (tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items): New internal variables. (tab_bar_items, process_tab_bar_item, set_prop_tab_bar) (parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item): New functions. (read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar. (tab-bar-separator-image-expression): New variable. * src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line. * src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar. * src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT. (GCALIGNED_STRUCT): Add change_tab_bar_height_hook. * src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines. * src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT. * src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT. (Fwindow_tab_line_height): New function. (coordinates_in_window): Use window_wants_tab_line with CURRENT_TAB_LINE_HEIGHT. (window_relative_x_coord): Add ON_TAB_LINE. (Fcoordinates_in_window_p): Add ON_TAB_LINE. (window_from_coordinates): Add new arg tab_bar_p. (Fwindow_line_height): Use window_wants_tab_line with WINDOW_TAB_LINE_HEIGHT. (Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT. (make_window): Set tab_line_height to -1. (window_wants_tab_line): New function. (window_internal_height): Use window_wants_tab_line. (window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT. (Frecenter): Set minimize_tab_bar_window_p to 1. (GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height. (Fcurrent_window_configuration): Set frame_tab_bar_lines and frame_tab_bar_height. (set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT. (syms_of_window): Add Qtab_line_format and Swindow_tab_line_height. * src/window.h (GCALIGNED_STRUCT): Add tab_line_height. (WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES): New macros. (WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT): Add WINDOW_TAB_BAR_P. * src/xdisp.c (window_box_height): Add window_wants_tab_line with MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT. (pos_visible_p): Use window_wants_tab_line. Add WINDOW_TAB_LINE_HEIGHT. (get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT. (get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT. (remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE. (init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID. Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line. (Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT. (prepare_menu_bars): Call update_tab_bar. (update_tab_bar, build_desired_tab_bar_string) (display_tab_bar_line, tab_bar_height, Ftab_bar_height) (redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item) (handle_tab_bar_click, note_tab_bar_highlight): New functions. (compute_window_start_on_continuation_line): Use window_wants_tab_line. (try_cursor_movement): Use window_wants_tab_line with CURRENT_TAB_LINE_HEIGHT. (redisplay_window): Use window_wants_tab_line with CURRENT_TAB_LINE_HEIGHT. (try_window_reusing_current_matrix): Use window_wants_tab_line with WINDOW_TAB_LINE_HEIGHT. (Fdump_tab_bar_row): New function. (compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT. (display_line): Use window_wants_tab_line. (display_mode_line): Set tab_line_p to true if face_id is TAB_LINE_FACE_ID. (Fformat_mode_line): Handle Qtab_line and Qtab_bar. (gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT. (erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT. (show_mouse_face): Use tab_bar_window. (note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for area ON_TAB_LINE. (note_mouse_highlight): Call note_tab_bar_highlight, (expose_frame): Handle tab_bar_window. (syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height. (auto-resize-tab-bars, auto-raise-tab-bar-buttons) (tab-bar-border, tab-bar-button-margin, tab-bar-button-relief) (tab-bar-max-label-size): New variables. * src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and TAB_BAR_FACE_ID. (syms_of_xfaces): Define Qtab_bar and Qtab_line. * src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height): New functions. (xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT. (frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size. * src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief. (x_draw_image_relief): Use TAB_BAR_FACE_ID. (handle_one_xevent): Handle tab_bar_window. (x_set_window_size_1): Add FRAME_TABBAR_WIDTH. (x_create_terminal): Set change_tab_bar_height_hook. * src/xterm.h (struct x_output): Add tabbar_top_height, tabbar_bottom_height, tabbar_left_width, tabbar_right_width tabbar_widget, tabbar_in_hbox, tabbar_is_packed. (FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT, FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT, FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH, FRAME_TABBAR_WIDTH.
* | * lisp/window.el (walk-windows): Simplify to use WINDOW arg of window-list-1Juri Linkov2019-09-191-6/+10
|/ | | | instead of calling select-window (bug#35385).
* Run quit-window-hook from the correct bufferLars Ingebrigtsen2019-08-231-1/+4
| | | | | * lisp/window.el (quit-window): Run the hook from the buffer specified by the WINDOW parameter.
* Call `quit-window-hook' in the `quit-window' command onlyLars Ingebrigtsen2019-08-211-6/+3
| | | | | | | | * lisp/window.el (quit-restore-window): Don't run quit-window-hook here... (quit-window): ... but here instead. Callers that call the former programmatically can decide themselves whether to call the hook. (quit-window-hook): Fix doc string.
* Add a new hook: `quit-window-hook'Lars Ingebrigtsen2019-08-191-2/+15
| | | | | | | | | | * doc/lispref/windows.texi (Quitting Windows): Mention in. * lisp/window.el (quit-restore-window): Run the new `quit-window-hook' before doing anything else (bug#9867). (quit-window): Note that the hook will be run in the doc string. * lisp/window.el (quit-window-hook): New variable.
* Issue a message on `C-x o' and there's no other windowLars Ingebrigtsen2019-08-171-0/+5
| | | | | * lisp/window.el (other-window): Issue a message when the user types `C-x o' and there's no other window to select (bug#10999).
* Issue a message on `C-x 1' when there's nothing to doLars Ingebrigtsen2019-08-171-1/+5
| | | | | * lisp/window.el (delete-other-windows): Make `C-x 1' issue a message when there's no other windows to delete (bug#10999).
* Fix doc-strings of 'display-buffer-*' functions (Bug#19461)Martin Rudalics2019-08-051-124/+186
| | | | | | | | | | | | | | * lisp/window.el (display-buffer-in-atom-window) (display-buffer-in-side-window, display-buffer-record-window) (display-buffer-use-some-frame, display-buffer-same-window) (display-buffer-reuse-window, display-buffer-pop-up-frame) (display-buffer-pop-up-window, display-buffer-in-child-frame) (display-buffer-in-direction, display-buffer-below-selected) (display-buffer-at-bottom, display-buffer-in-previous-window) (display-buffer-use-some-window) (display-buffer--maybe-pop-up-frame-or-window) (display-buffer--maybe-pop-up-frame): Fix doc-strings (Bug#19461).
* Improve documentation of 'display-buffer-*' functionsEli Zaretskii2019-08-031-10/+82
| | | | | | | | | | | | | | | | * lisp/window.el (display-buffer-in-atom-window) (display-buffer-in-side-window, display-buffer-same-window) (display-buffer--maybe-same-window) (display-buffer-reuse-window) (display-buffer-reuse-mode-window) (display-buffer-pop-up-frame, display-buffer-pop-up-window) (display-buffer--maybe-pop-up-frame-or-window) (display-buffer--maybe-pop-up-frame) (display-buffer-in-child-frame, display-buffer-in-direction) (display-buffer-below-selected, display-buffer-at-bottom) (display-buffer-in-previous-window) (display-buffer-use-some-window, display-buffer-no-window): More details about the ALIST argument in the doc string. (Bug#19461)
* Merge from origin/emacs-26Glenn Morris2019-07-301-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8fbe462 (origin/emacs-26) ; * doc/lispref/positions.texi (List Motion... 1d9efc0 Add index for "\( in strings" (Bug#25195) 304e96f Fix doc-string of 'fit-window-to-buffer' (Bug#36848) d4c4987 Update view-mode docstring d6ca1fc ; * lisp/term.el: Add missing / to esc seq commentary. b3e2073 Fix subproc listening when setting filter to non-t (Bug#36591) f671950 * etc/NEWS.25: Belatedly announce rcirc-reconnect-delay. 7f42277 Mention term.el's \032 dir tracking in commentary (Bug#19524) 16a529e Remove upload functionality of package-x from the elisp manual 78e6c2a * etc/AUTHORS: Update. 086a56e Clarify Gravatar docs 0592467 * doc/lispref/display.texi (Defining Faces): Say a face can't... # Conflicts: # doc/emacs/programs.texi # etc/AUTHORS # lisp/term.el
| * Fix doc-string of 'fit-window-to-buffer' (Bug#36848)Martin Rudalics2019-07-301-1/+1
| | | | | | | | | | | | * lisp/window.el (fit-window-to-buffer): Fix doc-string. Suggested by Drew Adams <drew.adams@oracle.com>
* | Handle persistence of windows' scroll bar and fringes settings (Bug#36193)Martin Rudalics2019-07-221-19/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/display.texi (Fringe Size/Pos): Document new argument PERSISTENT of 'set-window-fringes'. (Scroll Bars): Document new argument PERSISTENT of 'set-window-scroll-bars'. Mention that HORIZONTAL-TYPE must be 'bottom' to show a horizontal scroll bar on mini windows. * lisp/window.el (window-min-pixel-height): For mini windows the minimum height is one line. (window--min-size-1): Use value returned by 'window-min-pixel-height' when dealing with mini windows. (window--resize-mini-window): Try to handle horizontal scroll bars and size restrictions more accurately. (window--state-put-2): Handle persistence of scroll bar settings. * src/frame.c (make_frame): Allow horizontal scroll bars in mini windows. (adjust_frame_size): Drop PIXELWISE argument in 'resize_frame_windows' calls. * src/window.c (set_window_buffer): Don't override WINDOW's scroll bar and fringe settings when marked as persistent. (resize_frame_windows): Drop fourth argument PIXELWISE - SIZE is always specified in terms of pixels. Try to handle height of mini windows more accurately. (grow_mini_window, shrink_mini_window): Use body height of mini window when calculating expected height change. Take horizontal scroll bars into account. (struct saved_window): Two new members to handle persistence of window fringes and scroll bars. (Fset_window_configuration, save_window_save): Handle persistence of fringes and scroll bars. (set_window_fringes, set_window_scroll_bars): New arguments PERSISTENT. Make dimension checks more accurate. (Fset_window_fringes): New argument PERSISTENT. (Fwindow_fringes, Fwindow_scroll_bars): Add PERSISTENT to return values. (Fset_window_scroll_bars): New argument PERSISTENT. In doc-string mention that 'bottom' must be specified to get a horizontal scroll bar in mini windows. (compare_window_configurations): Add checks for persistence of fringes and scroll bars. * src/window.h (struct window): New boolean slots 'fringes_persistent' and 'scroll_bars_persistent'. (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Allow horizontal scroll bars for mini windows. (resize_frame_windows): Remove fourth argument of 'resize_frame_windows' in external declaration. * src/xdisp.c (resize_mini_window): Use box text height to tell whether mini window height changed. (set_horizontal_scroll_bar): Set mini window's horizontal scroll bar when its type is specified as 'bottom'. * etc/NEWS: Mention new options for 'set-window-fringes' and 'set-window-scroll-bars'.
* | Have 'display-buffer-reuse-window' prefer window on selected frame (Bug#36680)Martin Rudalics2019-07-191-9/+22
| | | | | | | | | | | | | | | | * lisp/window.el (display-buffer-reuse-window): Preferably reuse window on selected frame (Bug#36680). * doc/lispref/windows.texi (Buffer Display Action Functions): Say that 'display-buffer-reuse-window' prefers window on the selected frame.
* | Revert "* lisp/calc/calc-ext.el (math-scalarp): Fix typo"Stefan Monnier2019-06-261-1/+1
| | | | | | | | This reverts commit 698ff554ac2699ec48fefc85a1307cbc4a183b0d.
* | * lisp/calc/calc-ext.el (math-scalarp): Fix typoStefan Monnier2019-06-261-1/+1
| |
* | Make winner restore point in all windows that display a bufferTino Calancha2019-06-251-0/+39
| | | | | | | | | | | | | | | | * lisp/window.el (window--before-delete-windows): New defun. (delete-window, delete-other-windows): Use it. * lisp/winner.el (winner-set): Use marker in 'window-prev-buffers' when available and different than the value returned by 'winner-get-point' (bug#23621).
* | Merge from origin/emacs-26Glenn Morris2019-06-151-7/+15
|\| | | | | | | | | | | | | | | | | f53ce87 ; ChangeLog.3 update eca2677 Fix description of 'display-buffer-in-previous-window' again ... 7be50cd Consistently use @minus{} for negative arguments # Conflicts: # ChangeLog.3
| * Fix description of 'display-buffer-in-previous-window' again (Bug#36161)Martin Rudalics2019-06-121-7/+15
| | | | | | | | | | | | | | | | | | | | | | * lisp/window.el (display-buffer-in-previous-window): Make doc-string more explicit (Bug#36161). * doc/lispref/windows.texi (Buffer Display Action Functions): Make description of 'display-buffer-in-previous-window' more explicit. (Buffer Display Action Alists): Mention 'display-buffer-in-previous-window' in description of 'reusable-frames' entry.
* | Merge from origin/emacs-26Glenn Morris2019-06-111-2/+5
|\| | | | | | | | | 5ca093d (origin/emacs-26) Fix doc of 'display-buffer-in-previous-wind... add2cac lisp/*.el: Minor docstring fixes
| * Fix doc of 'display-buffer-in-previous-window' (Bug#36161)Martin Rudalics2019-06-111-2/+5
| | | | | | | | | | | | | | * doc/lispref/windows.texi (Buffer Display Action Functions): * lisp/window.el (display-buffer-in-previous-window): Tell that 'display-buffer-in-previous-window' prefers non-selected windows (Bug#36161).
* | Add missing indentation declaration to a few macros.Philipp Stephani2019-06-111-3/+3
| | | | | | | | | | | | * lisp/window.el (with-temp-buffer-window) (with-current-buffer-window, with-displayed-buffer-window): Add missing indentation declaration
* | Consider line spacing and font height when deriving proc window sizeJohn Shahid2019-06-071-2/+4
| | | | | | | | | | | | | | * lisp/window.el (window-adjust-process-window-size): Use window-screen-lines instead of window-body-height. * lisp/term.el (term-mode): Use window-screen-lines to set the initial window height.
* | Go back to "Maintainer: emacs-devel@gnu.org"Paul Eggert2019-05-251-0/+1
| | | | | | | | | | | | Restore lines saying "Maintainer: emacs-devel@gnu.org" when there is no special maintainer for a file. Although this wasn't documented it was common practice and removing the lines didn't have consensus.
* | Fixes for "Maintainer:" and related linesPaul Eggert2019-05-191-1/+0
| | | | | | | | | | | | Mostly, this just removes "Maintainer: emacs-devel@gnu.org" lines, which are not that useful. It also cleans up and regularizes a few similar lines.
* | New buffer display action function 'display-buffer-in-direction'Martin Rudalics2019-05-191-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | * lisp/window.el (windows-sharing-edge) (window--try-to-split-window-in-direction) (display-buffer-in-direction): New functions. * doc/lispref/windows.texi (Buffer Display Action Functions): Describe new action function 'display-buffer-in-direction'. (Buffer Display Action Alists): Describe new entry 'direction'. Amend description of 'window' entry. * etc/NEWS: Mention 'display-buffer-in-direction' and 'direction' and 'window' action alist entries.