Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/emacs/custom.texi
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ non-@code{nil} value). If you set a variable using the customization
buffer, you need not worry about giving it an invalid type: the
customization buffer usually only allows you to enter meaningful
values. When in doubt, use @kbd{C-h v} (@code{describe-variable}) to
check the variable's documentation string to see kind of value it
check the variable's documentation string to see what kind of value it
expects (@pxref{Examining}).

@menu
Expand Down
57 changes: 54 additions & 3 deletions doc/emacs/frames.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ Note that the Tab Bar is different from the Tab Line (@pxref{Tab Line}).
Whereas tabs on the Tab Line at the top of each window are used to
switch between buffers, tabs on the Tab Bar at the top of each frame
are used to switch between window configurations containing several
windows.
windows with buffers.

@findex tab-bar-mode
To toggle the use of tab bars, type @kbd{M-x tab-bar-mode}. This
Expand Down Expand Up @@ -1324,21 +1324,34 @@ current before calling the command that adds a new tab.
To start a new tab with other buffers, customize the variable
@code{tab-bar-new-tab-choice}.

@vindex tab-bar-new-tab-to
The variable @code{tab-bar-new-tab-to} defines where to place a new tab.
By default, a new tab is added on the right side of the current tab.

The following commands can be used to delete tabs:

@table @kbd
@item C-x t 0
@kindex C-x t 0
@findex tab-close
Close the selected tab (@code{tab-close}). It has no effect if there
is only one tab.
is only one tab, unless the variable @code{tab-bar-close-last-tab-choice}
is customized to a non-default value.

@item C-x t 1
@kindex C-x t 1
@findex tab-close-other
Close all tabs on the selected frame, except the selected one.
@end table

@vindex tab-bar-close-tab-select
The variable @code{tab-bar-close-tab-select} defines what tab to
select after closing the current tab. By default, it selects
a recently used tab.

@findex tab-undo
The command @code{tab-undo} restores the last closed tab.

The following commands can be used to switch between tabs:

@table @kbd
Expand All @@ -1358,22 +1371,60 @@ switches back to the previous Nth tab.
Switch to the previous tab. With a positive numeric argument N, it
switches to the previous Nth tab; with a negative argument −N, it
switches back to the next Nth tab.

@item C-x t @key{RET} @var{tabname} @key{RET}
Switch to the tab by its name, with completion on all tab names.
Default values are tab names sorted by recency, so you can use
@kbd{M-n} (@code{next-history-element}) to get the name of the last
visited tab, the second last, and so on.

@item @var{modifier}-@var{tabnumber}
@findex tab-select
Switch to the tab by its number. After customizing the variable
@code{tab-bar-select-tab-modifiers} to specify a @var{modifier} key, you
can select a tab by its ordinal number using the specified modifier in
combination with the tab number to select. To display the tab number
alongside the tab name, you can customize another variable
@code{tab-bar-tab-hints}. This will help you to decide what key to press
to select the tab by its number.

@item @var{modifier}-@kbd{0}
@findex tab-recent
Switch to the recent tab. The key combination is the modifier key
defined by @code{tab-bar-select-tab-modifiers} and the key @kbd{0}.
With a numeric argument N, switch to the Nth recent tab.
@end table

The following commands can be used to operate on tabs:

@table @kbd
@item C-x t r @var{tabname} @key{RET}
@findex tab-rename
Rename the current tab to @var{tabname}. You can control the
programmatic name given to a tab by default by customizing the
variable @code{tab-bar-tab-name-function}.

@item C-x t m
@findex tab-move
Move the current tab N positions to the right with a positive numeric
argument N. With a negative argument −N, it moves the current tab
argument N. With a negative argument −N, move the current tab
N positions to the left.
@end table

@findex tab-bar-history-mode
You can enable @code{tab-bar-history-mode} to remember window
configurations used in every tab, and restore them.

@table @kbd
@item tab-bar-history-back
Restore a previous window configuration used in the current tab.
This navigates back in the history of window configurations.

@item tab-bar-history-forward
Cancel restoration of the previous window configuration.
This navigates forward in the history of window configurations.
@end table

@node Dialog Boxes
@section Using Dialog Boxes
@cindex dialog boxes
Expand Down
12 changes: 10 additions & 2 deletions doc/emacs/windows.texi
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,16 @@ Selecting the previous window-local tab is the same as typing @kbd{C-x
same as @kbd{C-x @key{RIGHT}} (@code{next-buffer}). Both commands
support a numeric prefix argument as a repeat count.

You can customize the variable @code{tab-line-tabs-function} to define
the preferred contents of the tab line. By default, it displays all
buffers previously visited in the window, as described above. But you
can also set it to display a list of buffers with the same major mode
as the current buffer, or to display buffers grouped by their major
mode, where clicking on the mode name in the first tab displays a list
of all major modes where you can select another group of buffers.

Note that the Tab Line is different from the Tab Bar (@pxref{Tab Bars}).
Whereas tabs on the Tab Bar at the top of each frame are used to
switch between window configurations containing several windows,
switch between window configurations containing several windows with buffers,
tabs on the Tab Line at the top of each window are used to switch
between buffers.
between buffers in the window.
3 changes: 1 addition & 2 deletions doc/lispref/objects.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2402,8 +2402,7 @@ call @code{(make-string 3 ?a)} yields a mutable string that can be
changed via later calls to @code{aset}.

A mutable object can become constant if it is part of an expression
that is evaluated, because a program should not modify an object
that is being evaluated. The reverse does not occur: constant objects
that is evaluated. The reverse does not occur: constant objects
should stay constant.

Trying to modify a constant variable signals an error
Expand Down
16 changes: 8 additions & 8 deletions etc/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ applies, and please also update docstrings as needed.
** Emacs now uses GMP, the GNU Multiple Precision library.
By default, if 'configure' does not find a suitable libgmp, it
arranges for the included mini-gmp library to be built and used.
The new 'configure' option '--without-libgmp' uses mini-gmp even if a
The new configure option '--without-libgmp' uses mini-gmp even if a
suitable libgmp is available.

---
Expand Down Expand Up @@ -132,7 +132,7 @@ can enable it when configuring, e.g., './configure CFLAGS="-g3 -O2
** Emacs now normally uses a C pointer type instead of a C integer
type to implement Lisp_Object, which is the fundamental machine word
type internal to the Emacs Lisp interpreter. This change aims to
catch typos and supports '-fcheck-pointer-bounds'. The 'configure'
catch typos and supports '-fcheck-pointer-bounds'. The configure
option '--enable-check-lisp-object-type' is therefore no longer as
useful and so is no longer enabled by default in developer builds,
to reduce differences between developer and production builds.
Expand Down Expand Up @@ -868,7 +868,7 @@ to allow controlling how the conversion to text is done.

+++
*** The prefix key 's' was changed to 'c' for slicing commands
to avoid conflicts with image-mode key 's'. The new key 'c' still
to avoid conflicts with 'image-mode' key 's'. The new key 'c' still
has good mnemonics of "cut", "clip", "crop".

** Ido
Expand Down Expand Up @@ -2090,11 +2090,11 @@ variable for remote shells. It still defaults to "/bin/sh".

+++
*** New values of 'shell-command-dont-erase-buffer'.
This option can now have the value 'erase' to force to erase the
This user option can now have the value 'erase' to force to erase the
output buffer before execution of the command, even if the output goes
to the current buffer. Additional values 'beg-last-out',
'end-last-out', and 'save-point' control where to put point in the
output buffer after inserting the shell-command output.
output buffer after inserting the 'shell-command' output.

---
*** The new functions 'shell-command-save-pos-or-erase' and
Expand Down Expand Up @@ -3538,9 +3538,9 @@ With a prefix argument, 'image-rotate' now rotates the image at point
By default, the image will resize upon first display and whenever the
window's dimensions change. Two user options 'image-auto-resize' and
'image-auto-resize-on-window-resize' control the resizing behavior
(including the possibility to disable auto-resizing). A new key
prefix 's' contains the commands that can be used to fit the image to
the window manually.
(including the possibility to disable auto-resizing). A new prefix
key 's' contains the commands that can be used to fit the image to the
window manually.

---
*** Some 'image-mode' variables are now buffer-local.
Expand Down
20 changes: 13 additions & 7 deletions lisp/image-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,22 @@ call."
"--"
["Fit Frame to Image" image-mode-fit-frame :active t
:help "Resize frame to match image"]
["Fit Image to Window (Best Fit)" image-transform-fit-both
:help "Resize image to match the window height and width"]
["Fit to Window Height" image-transform-fit-to-height
:help "Resize image to match the window height"]
["Fit to Window Width" image-transform-fit-to-width
:help "Resize image to match the window width"]
["Fit to Window Height and Width" image-transform-fit-both
:help "Resize image to match the window height and width"]
["Zoom In" image-increase-size
:help "Enlarge the image"]
["Zoom Out" image-decrease-size
:help "Shrink the image"]
["Set Scale..." image-transform-set-scale
:help "Resize image by specified scale factor"]
["Rotate Image..." image-transform-set-rotation
["Rotate Clockwise" image-rotate
:help "Rotate the image"]
["Set Rotation..." image-transform-set-rotation
:help "Set rotation angle of the image"]
["Reset Transformations" image-transform-reset
:help "Reset all image transformations"]
"--"
Expand All @@ -524,10 +530,10 @@ call."
(image-dired default-directory))
:active default-directory
:help "Show thumbnails for all images in this directory"]
["Next Image" image-next-file :active buffer-file-name
:help "Move to next image in this directory"]
["Previous Image" image-previous-file :active buffer-file-name
:help "Move to previous image in this directory"]
["Next Image" image-next-file :active buffer-file-name
:help "Move to next image in this directory"]
["Copy File Name" image-mode-copy-file-name-as-kill
:active buffer-file-name
:help "Copy the current file name to the kill ring"]
Expand Down Expand Up @@ -565,10 +571,10 @@ call."
["Reset Animation Speed" image-reset-speed
:active image-multi-frame
:help "Reset the speed of this image's animation"]
["Next Frame" image-next-frame :active image-multi-frame
:help "Show the next frame of this image"]
["Previous Frame" image-previous-frame :active image-multi-frame
:help "Show the previous frame of this image"]
["Next Frame" image-next-frame :active image-multi-frame
:help "Show the next frame of this image"]
["Goto Frame..." image-goto-frame :active image-multi-frame
:help "Show a specific frame of this image"]
))
Expand Down
38 changes: 25 additions & 13 deletions lisp/tab-bar.el
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@


(defcustom tab-bar-select-tab-modifiers '()
"List of key modifiers for selecting a tab by its index digit.
Possible modifiers are `control', `meta', `shift', `hyper', `super' and
`alt'."
:type '(set :tag "Tab selection key modifiers"
"List of modifier keys for selecting a tab by its index digit.
Possible modifier keys are `control', `meta', `shift', `hyper', `super' and
`alt'. To help you to select a tab by its number, you can customize
`tab-bar-tab-hints' that will show tab numbers alongside the tab name."
:type '(set :tag "Tab selection modifier keys"
(const control)
(const meta)
(const shift)
Expand Down Expand Up @@ -310,7 +311,8 @@ If nil, don't show it at all."

(defcustom tab-bar-tab-hints nil
"Show absolute numbers on tabs in the tab bar before the tab name.
This helps to select the tab by its number using `tab-bar-select-tab'."
This helps to select the tab by its number using `tab-bar-select-tab'
and `tab-bar-select-tab-modifiers'."
:type 'boolean
:initialize 'custom-initialize-default
:set (lambda (sym val)
Expand Down Expand Up @@ -563,9 +565,10 @@ Return its existing value or a new value."

(defun tab-bar-select-tab (&optional arg)
"Switch to the tab by its absolute position ARG in the tab bar.
When this command is bound to a numeric key (with a prefix or modifier),
calling it without an argument will translate its bound numeric key
to the numeric argument. ARG counts from 1."
When this command is bound to a numeric key (with a prefix or modifier key
using `tab-bar-select-tab-modifiers'), calling it without an argument
will translate its bound numeric key to the numeric argument.
ARG counts from 1."
(interactive "P")
(unless (integerp arg)
(let ((key (event-basic-type last-command-event)))
Expand Down Expand Up @@ -664,7 +667,10 @@ to the numeric argument. ARG counts from 1."
(message "No more recent tabs"))))

(defun tab-bar-switch-to-tab (name)
"Switch to the tab by NAME."
"Switch to the tab by NAME.
Default values are tab names sorted by recency, so you can use \
\\<minibuffer-local-map>\\[next-history-element]
to get the name of the last visited tab, the second last, and so on."
(interactive
(let* ((recent-tabs (mapcar (lambda (tab)
(alist-get 'name tab))
Expand Down Expand Up @@ -789,7 +795,7 @@ After the tab is created, the hooks in
(pcase tab-bar-new-tab-to
('leftmost 0)
('rightmost (length tabs))
('left (1- (or from-index 1)))
('left (or from-index 1))
('right (1+ (or from-index 0)))
((pred functionp)
(funcall tab-bar-new-tab-to))))))
Expand Down Expand Up @@ -920,7 +926,7 @@ for the last tab on a frame is determined by
;; Select another tab before deleting the current tab
(let ((to-index (or (if to-index (1- to-index))
(pcase tab-bar-close-tab-select
('left (1- current-index))
('left (1- (if (< current-index 1) 2 current-index)))
('right (if (> (length tabs) (1+ current-index))
(1+ current-index)
(1- current-index)))
Expand Down Expand Up @@ -1004,7 +1010,7 @@ for the last tab on a frame is determined by
(unless (eq frame (selected-frame))
(select-frame-set-input-focus frame))

(let ((tabs (tab-bar-tabs)))
(let ((tabs (funcall tab-bar-tabs-function)))
(setq index (max 0 (min index (length tabs))))
(cl-pushnew tab (nthcdr index tabs))
(when (eq index 0)
Expand Down Expand Up @@ -1102,6 +1108,8 @@ function `tab-bar-tab-name-function'."
(setq tab-bar-history-omit nil)))

(defun tab-bar-history-back ()
"Restore a previous window configuration used in the current tab.
This navigates back in the history of window configurations."
(interactive)
(setq tab-bar-history-omit t)
(let* ((history (pop (gethash (selected-frame) tab-bar-history-back)))
Expand All @@ -1119,6 +1127,8 @@ function `tab-bar-tab-name-function'."
(message "No more tab back history"))))

(defun tab-bar-history-forward ()
"Cancel restoration of the previous window configuration.
This navigates forward in the history of window configurations."
(interactive)
(setq tab-bar-history-omit t)
(let* ((history (pop (gethash (selected-frame) tab-bar-history-forward)))
Expand All @@ -1136,7 +1146,9 @@ function `tab-bar-tab-name-function'."
(message "No more tab forward history"))))

(define-minor-mode tab-bar-history-mode
"Toggle tab history mode for the tab bar."
"Toggle tab history mode for the tab bar.
Tab history mode remembers window configurations used in every tab,
and can restore them."
:global t :group 'tab-bar
(if tab-bar-history-mode
(progn
Expand Down
6 changes: 5 additions & 1 deletion lisp/tab-line.el
Original file line number Diff line number Diff line change
Expand Up @@ -474,8 +474,12 @@ variable `tab-line-tabs-function'."
"Template for displaying tab line for selected window."
(let* ((tabs (funcall tab-line-tabs-function))
(cache-key (list tabs
;; handle buffer renames
(buffer-name (window-buffer))
(window-parameter nil 'tab-line-hscroll)))
;; handle tab-line scrolling
(window-parameter nil 'tab-line-hscroll)
;; for setting face 'tab-line-tab-current'
(eq (selected-window) (old-selected-window))))
(cache (window-parameter nil 'tab-line-cache)))
;; Enable auto-hscroll again after it was disabled on manual scrolling.
;; The moment to enable it is when the window-buffer was updated.
Expand Down
2 changes: 1 addition & 1 deletion src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,8 +563,8 @@ encode_terminal_code (struct glyph *src, int src_len,
{
cmp = composition_table[src->u.cmp.id];
required = cmp->glyph_len;
required *= MAX_MULTIBYTE_LENGTH;
}
required *= MAX_MULTIBYTE_LENGTH;

if (encode_terminal_src_size - nbytes < required)
{
Expand Down
Loading