Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
1e4c6f83
Commit
1e4c6f83
authored
Dec 05, 2019
by
Juri Linkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* lisp/tab-bar.el (tab-bar-get-buffer-tab): Move code closer to its use.
parent
67815c6b
Pipeline
#4243
failed with stage
in 90 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
38 deletions
+38
-38
lisp/tab-bar.el
lisp/tab-bar.el
+38
-38
No files found.
lisp/tab-bar.el
View file @
1e4c6f83
...
...
@@ -1296,6 +1296,44 @@ in the selected frame."
((
framep
all-frames
)
(
list
all-frames
))
(
t
(
list
(
selected-frame
)))))
(
defun
tab-bar-get-buffer-tab
(
buffer-or-name
&optional
all-frames
)
"Return a tab owning a window whose buffer is BUFFER-OR-NAME.
BUFFER-OR-NAME may be a buffer or a buffer name and defaults to
the current buffer.
The optional argument ALL-FRAMES specifies the frames to consider:
- t means consider all tabs on all existing frames.
- `visible' means consider all tabs on all visible frames.
- A frame means consider all tabs on that frame only.
Any other value of ALL-FRAMES means consider all tabs on the
selected frame and no others."
(
let
((
buffer
(
if
buffer-or-name
(
get-buffer
buffer-or-name
)
(
current-buffer
))))
(
when
(
bufferp
buffer
)
(
seq-some
(
lambda
(
frame
)
(
seq-some
(
lambda
(
tab
)
(
when
(
if
(
eq
(
car
tab
)
'current-tab
)
(
get-buffer-window
buffer
frame
)
(
let*
((
state
(
cdr
(
assq
'ws
tab
)))
(
buffers
(
when
state
(
window-state-buffers
state
))))
(
or
;; non-writable window-state
(
memq
buffer
buffers
)
;; writable window-state
(
member
(
buffer-name
buffer
)
buffers
))))
(
append
tab
`
((
index
.
,
(
tab-bar--tab-index
tab
nil
frame
))
(
frame
.
,
frame
)))))
(
funcall
tab-bar-tabs-function
frame
)))
(
tab-bar--reusable-frames
all-frames
)))))
(
defun
display-buffer-in-tab
(
buffer
alist
)
"Display BUFFER in a tab.
ALIST is an association list of action symbols and values. See
...
...
@@ -1346,44 +1384,6 @@ indirectly called by the latter."
(
let
((
tab-bar-new-tab-choice
t
))
(
tab-bar-new-tab
))))))
(
defun
tab-bar-get-buffer-tab
(
buffer-or-name
&optional
all-frames
)
"Return a tab owning a window whose buffer is BUFFER-OR-NAME.
BUFFER-OR-NAME may be a buffer or a buffer name and defaults to
the current buffer.
The optional argument ALL-FRAMES specifies the frames to consider:
- t means consider all tabs on all existing frames.
- `visible' means consider all tabs on all visible frames.
- A frame means consider all tabs on that frame only.
Any other value of ALL-FRAMES means consider all tabs on the
selected frame and no others."
(
let
((
buffer
(
if
buffer-or-name
(
get-buffer
buffer-or-name
)
(
current-buffer
))))
(
when
(
bufferp
buffer
)
(
seq-some
(
lambda
(
frame
)
(
seq-some
(
lambda
(
tab
)
(
when
(
if
(
eq
(
car
tab
)
'current-tab
)
(
get-buffer-window
buffer
frame
)
(
let*
((
state
(
cdr
(
assq
'ws
tab
)))
(
buffers
(
when
state
(
window-state-buffers
state
))))
(
or
;; non-writable window-state
(
memq
buffer
buffers
)
;; writable window-state
(
member
(
buffer-name
buffer
)
buffers
))))
(
append
tab
`
((
index
.
,
(
tab-bar--tab-index
tab
nil
frame
))
(
frame
.
,
frame
)))))
(
funcall
tab-bar-tabs-function
frame
)))
(
tab-bar--reusable-frames
all-frames
)))))
(
defun
switch-to-buffer-other-tab
(
buffer-or-name
&optional
norecord
)
"Switch to buffer BUFFER-OR-NAME in another tab.
Like \\[switch-to-buffer-other-frame] (which see), but creates a new tab."
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment