Commit graph

192 commits

Author SHA1 Message Date
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
Juri Linkov
c0cf923b0a * lisp/tab-bar.el (tab-bar-undo-close-tab): Update tab-bar-lines (bug#54684) 2022-04-03 19:51:46 +03:00
Juri Linkov
a31be116ae * lisp/tab-bar.el (tab-bar-new-tab-to): Don't funcall const values.
Filter out the values 'clone' and 'window' of 'tab-bar-new-tab-choice'
from function call.
2022-03-20 20:59:04 +02:00
Juri Linkov
435d5c84ed * lisp/tab-bar.el: Create new unique windows with 'C-x t n' (bug#54038).
* lisp/tab-bar.el (tab-bar-new-tab-choice): Replace the value 'nil'
with explicit 'clone'.
(tab-bar-move-window-to-tab): Ignore possible side/atom window
parameters with ignore-window-parameters while deleting window.
(tab-bar-new-tab-to): When 'tab-bar-new-tab-choice' is 'clone',
create new unique windows with the same layout using window-state-get
and window-state-put.  Do the same after deleting other windows
when 'tab-bar-new-tab-choice' is 'window'.
(tab-bar-duplicate-tab): Replace the value 'nil' with 'clone' for
'tab-bar-new-tab-choice'.
2022-02-23 19:58:33 +02:00
Juri Linkov
1efc94e7ce * lisp/tab-bar.el (tab-bar-new-tab-choice): Add const 'window'. Update doc.
(tab-bar-new-tab-to): Remove window parameters 'window-side' and
'window-atom' from the old window.  Move split-window/delete-window
inside ignore-window-parameters (bug#53662).
2022-02-06 19:55:03 +02:00
Juri Linkov
96533c18b7 * lisp/tab-bar.el (tab-bar-menu-bar-button): New variable (bug#51648).
(tab-bar-format-menu-bar): Use it.
2022-01-29 21:05:55 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Juri Linkov
65cd66c7d7 * lisp/tab-bar.el (tab-bar-history-mode-map): New defvar-keymap. 2021-12-27 21:15:06 +02:00
Stefan Kangas
5640b055d6 Merge from origin/emacs-28
9bd3f78645 Make `M-x run-python' select the window again
62139aeb42 * lisp/tab-bar.el (tab-bar-switch-to-last-tab): Add 'abs' ...
ea8422204f * make-dist (manifest): Filter out msdos/autogen/* files.
b5354e989d Rewrite the "Quitting Windows" section of Emacs Lisp Refer...
64ea1a178c Fix eshell for systems that do not have subprocesses
2021-12-13 06:30:58 +01:00
Juri Linkov
62139aeb42 * lisp/tab-bar.el (tab-bar-switch-to-last-tab): Add 'abs' for precautions.
https://lists.gnu.org/archive/html/emacs-devel/2021-11/msg01149.html
2021-12-12 20:25:54 +02:00
Stefan Kangas
c66eb52453 Merge from origin/emacs-28
9c222b9c1a Port to C compilers that lack size-0 arrays
fed35a8951 Port emacsclient to Solaris 10
f35d6a9c73 * CONTRIBUTE: Improve commit message instructions
e0ee1d003a Work around IBM XL C compiler bug
6b99b6eb8b * admin/make-tarball.txt: Various clarifications.
bbf4140091 * admin/diff-tar-files: Don't assume .tar.gz.
0a50ad11db * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.
2021-12-03 06:30:26 +01:00
Juri Linkov
0a50ad11db * lisp/tab-bar.el (tab-bar-close-other-tabs): Fix regression.
* test/lisp/tab-bar-tests.el: New file.
(tab-bar-tests-close-other-tabs-with-arg): Test for regression
that closed the selected tab after selecting it.
2021-12-02 20:12:05 +02:00
Juri Linkov
eef6626b55 * lisp/tab-bar.el: 'C-x t RET' creates a new tab for non-existent tab name.
* lisp/tab-bar.el (tab-bar-switch-to-tab): Create a new tab and
rename it to NAME when can't find the tab with the given NAME (bug#51935).
2021-11-22 20:15:58 +02:00
Juri Linkov
6de588ad24 * lisp/tab-bar.el (tab-bar-history-old-minibuffer-depth): Remove variable.
(tab-bar--history-pre-change, tab-bar--history-change): Use minibuffer-depth
instead of this variable (bug#51370).
2021-11-22 19:57:59 +02:00
Stefan Kangas
c6d5fccc92 Merge from origin/emacs-28
02853edba7 Fix sorting of menus in `context-menu-local' (bug#50067).
14271d050a Fix flyspell-correct-word selected from context menu opene...
bf824843f4 * lisp/repeat.el (describe-repeat-maps): Print all bound k...
6fc94fb99e * lisp/tab-bar.el: Use 'mouse-1' for history buttons like ...
5eeaf85767 Improve documentation of window hooks
7404f4b4e0 Improve doc string of 'highlight-nonselected-windows'
2021-11-19 07:00:24 +01:00
Juri Linkov
6fc94fb99e * lisp/tab-bar.el: Use 'mouse-1' for history buttons like for 'add-tab' button
* lisp/tab-bar.el (tab-bar-mouse-down-1, tab-bar-mouse-1):
Handle clicks for 'history-back' and 'history-forward' the same way
as 'add-tab' clicks.
2021-11-18 19:36:42 +02:00
Juri Linkov
a4e789c2e3 * lisp/tab-bar.el: Optimize data usage for nil tab-bar-history-mode.
* lisp/tab-bar.el (tab-bar--tab): Add wc-history-back and
wc-history-forward only when tab-bar-history-mode is non-nil.
(tab-bar-select-tab): Use wc-history-back and
wc-history-forward only when tab-bar-history-mode is non-nil.
(tab-bar-new-tab-to): Reset tab-bar-history-back and
tab-bar-history-forward to nil.
2021-11-18 19:28:32 +02:00
Juri Linkov
5c8c3d59ea * lisp/tab-bar.el: Avoid micro-steps in tab-bar-history-back/forward.
* lisp/tab-bar.el (tab-bar-history-pre-command)
(tab-bar-history-done-command): New variables.
(tab-bar--history-pre-change): Set 'tab-bar-history-omit' and
'tab-bar-history-pre-command'.
(tab-bar--history-change): Use 'tab-bar-history-done-command' and
'tab-bar-history-pre-command' (bug#51370).
2021-11-18 19:28:32 +02:00
Juri Linkov
c25be3e7bb * lisp/tab-bar.el (tab-bar-select-tab): Add check for wc-frame (bug#51883). 2021-11-16 22:45:33 +02:00
Juri Linkov
38d905abf9 * lisp/tab-bar.el: Doc fixes for commands bound to modifier keys.
(tab-bar-select-tab-modifiers)
(tab-bar-select-tab, tab-bar-switch-to-last-tab): Doc fixes.
2021-11-16 22:40:45 +02:00
Juri Linkov
7385a7667f * lisp/tab-bar.el (tab-bar-move-repeat-map): Fix alias binding of tab-move.
(tab-bar-move-tab-backward): Put 'repeat-map' symbol property.
2021-10-24 22:22:16 +03:00
Eli Zaretskii
2b7655ca0e ; More accurate doc string for 'tab-bar-format'
* lisp/tab-bar.el (tab-bar-format): Make the doc string more
accurate.  (Bug#51247)
2021-10-21 21:09:03 +03:00
Juri Linkov
06fe499614 * lisp/tab-bar.el (tab-bar-menu-bar): New command (bug#51247).
(tab-bar-format): Rename option 'tab-bar-format-menu-global' to
'tab-bar-format-menu-bar'.
(tab-bar-format-menu-bar): Rename from 'tab-bar-format-menu-global'.
2021-10-20 19:50:29 +03:00
Juri Linkov
5a3242301d Rename tab-bar-drag-maybe to tab-bar--dragging-in-progress
* lisp/tab-bar.el (tab-bar--event-to-item, tab-bar-mouse-down-1)
(tab-bar-mouse-move-tab): Rename tab-bar-drag-maybe to
tab-bar--dragging-in-progress.

* src/xdisp.c (note_mouse_highlight): Rename tab_bar_drag_maybe to
tab_bar__dragging_in_progress.
2021-10-18 19:52:29 +03:00
Eli Zaretskii
c163fd9260 Minor fixes for recent changes in ELisp manual
* doc/lispref/windows.texi (Basic Windows, Windows and Frames)
(Selecting Windows):
* doc/lispref/objects.texi (Window Type):
* doc/lispref/frames.texi (Input Focus, Frame Layout): Fix
wording, punctuation, and indexing.
2021-10-18 17:13:18 +03:00
Juri Linkov
ce71446585 * lisp/tab-bar.el: Improve docstrings (bug#51247)
* lisp/tab-bar.el (tab-bar--key-to-number)
(tab-bar--event-to-item, tab-bar--format-tab-group)
(tab-bar--current-tab-make): Improve docstrings.
(switch-to-buffer-other-tab): Obsolete the arg NORECORD.
2021-10-17 21:28:54 +03:00
Juri Linkov
ace4ce16a3 * lisp/tab-bar.el (tab-bar-mouse-move-tab): Don't drag tab to itself. 2021-10-17 21:03:27 +03:00
Martin Rudalics
04716ca48f Add tab-bar-drag-maybe for indication of tab dragging (bug#50993)
* lisp/tab-bar.el (tab-bar--event-to-item)
(tab-bar-mouse-move-tab): Set tab-bar-drag-maybe to nil.
(tab-bar-mouse-down-1): Set tab-bar-drag-maybe to t.

* src/xdisp.c (note_mouse_highlight): Set cursor to 'hand_cursor'
when tab_bar_drag_maybe is true.
(syms_of_xdisp): New variable tab-bar-drag-maybe.
2021-10-17 20:48:45 +03:00
Juri Linkov
81e3697600 * lisp/tab-bar.el: Add a new tab on [mouse-1] instead of [down-mouse-1]
* lisp/tab-bar.el (tab-bar-mouse-down-1): Rename from
tab-bar-mouse-select-tab.  Ignore 'add-tab'.
(tab-bar-mouse-1): Rename from tab-bar-mouse-close-tab-from-button.
Use binding of 'add-tab'.
(tab-bar-map): Rebind [down-mouse-1] from tab-bar-mouse-select-tab to
tab-bar-mouse-down-1, and [mouse-1] from tab-bar-mouse-close-tab-from-button
to tab-bar-mouse-1 (bug#51246).
2021-10-17 20:27:16 +03:00
Juri Linkov
a191d3c725 Add new and fix existing docstrings in tab-bar.el and tab-line.el (bug#51247)
* lisp/tab-bar.el (tab-bar--key-to-number)
(tab-bar--event-to-item, tab-bar--format-tab)
(tab-bar--format-tab-group, tab-bar--tab, tab-bar--current-tab)
(tab-bar--current-tab-make): Add/fix docstrings.
2021-10-17 20:09:29 +03:00
Eli Zaretskii
686a03ee22 More documentation fixes in tab-bar.el
* lisp/tab-bar.el (tab-bar-detach-tab, tab-bar-move-window-to-tab)
(tab-bar-new-tab-to, tab-bar-new-tab, tab-bar-close-tab-select)
(tab-bar-close-last-tab-choice, tab-bar-tab-pre-close-functions)
(tab-bar-close-tab, tab-bar-close-tab-by-name)
(tab-bar-close-other-tabs, tab-bar-rename-tab)
(tab-bar-rename-tab-by-name, tab-bar-move-tab-to-group)
(tab-bar-change-tab-group, tab-bar-close-group-tabs)
(tab-switcher-next-line, tab-switcher-prev-line)
(tab-switcher-unmark, tab-switcher-delete, tab-switcher-select)
(tab-bar-get-buffer-tab, display-buffer-in-tab)
(display-buffer-in-new-tab, switch-to-buffer-other-tab)
(find-file-other-tab, find-file-read-only-other-tab): Doc fixes.
2021-10-17 11:42:23 +03:00
Eli Zaretskii
35920791df Improve doc strings of tab-bar commands
* lisp/tab-bar.el (tab-bar-mouse-select-tab)
(tab-bar-mouse-move-tab, tab-bar-mouse-close-tab-from-button)
(tab-bar-mouse-close-tab, tab-bar-mouse-context-menu)
(tab-bar-switch-to-next-tab, tab-bar-switch-to-prev-tab)
(tab-bar-switch-to-last-tab, tab-bar-switch-to-recent-tab)
(tab-bar-move-tab-backward, tab-bar-move-tab)
(tab-bar-move-tab-to-frame): Add/fix doc strings.
2021-10-17 10:33:34 +03:00
Juri Linkov
bb8ef1aa30 * lisp/tab-bar.el (tab-detach, tab-window-detach): New aliases.
(tab-bar-mouse-context-menu, tab-bar-duplicate-tab):
Use word "clone" in help/doc string.
2021-10-07 21:01:04 +03:00
Juri Linkov
f7e6c199bf Clone the frame window configuration in 'clone-frame'
* doc/emacs/frames.texi (Creating Frames): Mention the cloned
window configuration for clone-frame.

* lisp/frame.el (clone-frame): Change second arg to 'no-windows'
and clone window configuration when it's nil.

* lisp/tab-bar.el (tab-bar-mouse-context-menu)
(tab-bar-detach-tab): Replace "Detach" with "Move" in help/doc strings.

https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00408.html
2021-10-06 19:38:09 +03:00
Juri Linkov
0c341e6e84 * lisp/tab-bar.el (tab-bar-detach-tab): Handle frame selected by make-frame.
(tab-bar-move-window-to-tab): New command.
(tab-bar-new-tab-to): Handle the value 'window' of tab-bar-new-tab-choice.
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg02197.html
2021-10-03 20:16:32 +03:00
Juri Linkov
fd244c9e46 * lisp/tab-bar.el (tab-bar-move-tab-to-frame): Delete frame with last tab. 2021-09-29 22:40:20 +03:00
Adam Porter
ab1e11fe79 * lisp/tab-bar.el: (tab-bar-detach-tab) New command
(tab-bar-detach-tab): New command.
(tab-bar-mouse-context-menu): Add menu entry.

With thanks to Matt Beshara <m@mfa.pw> for his feedback.
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg02141.html
2021-09-29 22:37:38 +03:00
Stefan Kangas
c78e16962e ; Adjust overly long docstrings to fit 80 characters 2021-09-26 13:23:57 +02:00
Juri Linkov
a1a63bb794 * lisp/tab-bar.el (tab-bar-new-tab-to): Use ignore-window-parameters.
Suggested by Adam Porter <adam@alphapapa.net> in
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01758.html
2021-09-25 22:24:48 +03:00
Juri Linkov
b539512762 * lisp/tab-bar.el: Preserve all existing tab parameters when switching tabs.
* lisp/tab-bar.el (tab-bar--tab, tab-bar--current-tab-make):
Copy other possible tab parameters.
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01544.html
2021-09-21 20:46:14 +03:00
Juri Linkov
9e9db94423 * lisp/tab-bar.el (tab-bar-new-tab): Add optional arg 'from-number'.
(tab-bar-mouse-context-menu): Use tab-number as an arg for
'tab-bar-duplicate-tab'.
(tab-bar-duplicate-tab): Add optional arg 'from-number'.
2021-09-20 10:20:32 +03:00
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00
Juri Linkov
6d65d50f71 * lisp/tab-bar.el (tab-bar-format): Add new option tab-bar-format-menu-global
(tab-bar-format-menu-global): New function.
2021-09-15 19:03:13 +03:00
Juri Linkov
b172049717 * lisp/tab-bar.el (tab-bar-close-other-tabs): Add arg ‘tab-number’.
(tab-bar-mouse-context-menu): Bind menu-item "Close other tabs" to
tab-bar-close-other-tabs with arg ‘tab-number’.
2021-09-15 09:30:11 +03:00
Juri Linkov
cc52f6d995 * lisp/tab-bar.el: Rename args to consistent naming convention.
Use the same naming scheme for function arguments.  Use the term "index" when
arguments count from 0, and the term "number" when arguments count from 1.

* lisp/tab-bar.el (tab-bar-select-tab): Rename ‘arg’ to ‘tab-number’.
(tab-bar-move-tab-to): Rename ‘from-index’ to ‘from-number’
and ‘to-index’ to ‘to-number’.
(tab-bar-move-tab-to-frame): Rename ‘from-index’ to ‘from-number’
and ‘to-index’ to ‘to-number’.
(tab-bar-new-tab-to): Rename ‘to-index’ to ‘tab-number’.
(tab-bar-close-tab): Rename ‘arg’ to ‘tab-number’
and ‘to-index’ to ‘to-number’.
(tab-bar-rename-tab): Rename ‘arg’ to ‘tab-number’.
(tab-bar-change-tab-group): Rename ‘arg’ to ‘tab-number’.
2021-09-15 09:27:57 +03:00
Juri Linkov
3f835ad580 * lisp/tab-bar.el: Close tab only on mouse-1, not down-mouse-1 (bug#41343)
* lisp/tab-bar.el (tab-bar-mouse-select-tab): Don't close the tab
when clicked on the close button.
(tab-bar-mouse-close-tab-from-button): New function.
(tab-bar-map): Bind [mouse-1] to 'tab-bar-mouse-close-tab-from-button'.
(tab-bar-mouse-move-tab): Do nothing on non-tab events.
2021-09-14 09:42:11 +03:00
Juri Linkov
fd1379a85a Support mouse events clicked on the tab bar but outside of any tab (bug#41343)
* lisp/tab-bar.el (tab-bar--key-to-number): Return non-nil non-numeric t
when no tab is used.  Return nil for current-tab.
(tab-bar-mouse-select-tab, tab-bar-mouse-close-tab): Do nothing
when tab-bar--key-to-number returns non-nil non-numeric t
for click events outside of any tab.
(tab-bar-mouse-context-menu): Add context menu when mouse is clicked
outside of tabs.  Add "Duplicate" alongside with "Close" to the menu
used when mouse is clicked on a tab.
(toggle-tab-bar-mode-from-frame, toggle-frame-tab-bar): Move code
closer to 'tab-bar-show'.

* src/xdisp.c (handle_tab_bar_click): Return Qtab_bar with empty list
when mouse is clicked on the tab bar but outside of any tab.
2021-09-13 11:15:10 +03:00
Juri Linkov
911043845d * lisp/tab-bar.el (tab-bar-get-buffer-tab): Use 'remq' instead of 'seq-remove' 2021-09-12 21:30:06 +03:00
Juri Linkov
64c5cd5a8c * lisp/tab-bar.el: Improve logic of 'ignore-current-tab'.
* lisp/tab-bar.el (tab-bar-get-buffer-tab): Prefer the current tab
when 'ignore-current-tab' is nil.
(display-buffer-in-tab): Use alist entry 'ignore-current-tab'
as the third arg of 'tab-bar-get-buffer-tab'.  Improve docstring.

Suggested by Feng Shu <tumashu@163.com>
https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg00955.html
2021-09-12 19:10:02 +03:00