unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58866: tab-line tab order is not preserved by desktop when customizing tab-line-tabs-function
@ 2022-10-29 13:06 João Guerra
  2022-10-29 17:48 ` Juri Linkov
  0 siblings, 1 reply; 2+ messages in thread
From: João Guerra @ 2022-10-29 13:06 UTC (permalink / raw)
  To: 58866

desktop is restoring the tab-line tab order on application reload when
using the default tab-line-tabs-function. When using a custom
tab-line-tabs-function the order is not being preserved. (I suspect it
could be due to how I want my tabs to behave.)

Example:

(let ((old-tabs nil))
  (defun tl-tabs ()
    (let ((new-tabs (seq-filter (lambda (buffer)
                                  (or (eq buffer (current-buffer))
                                      (buffer-file-name buffer)))
                                (buffer-list))))
      (setq old-tabs (append (seq-intersection old-tabs new-tabs)
                             (seq-difference new-tabs old-tabs))))))

(setq tab-line-tabs-function #'tl-tabs)

This makes the tab-line show all file visiting buffers in all windows
+ the current window buffer, preserving their order.

Is desktop supposed to preserve the tab order for user customizations?





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#58866: tab-line tab order is not preserved by desktop when customizing tab-line-tabs-function
  2022-10-29 13:06 bug#58866: tab-line tab order is not preserved by desktop when customizing tab-line-tabs-function João Guerra
@ 2022-10-29 17:48 ` Juri Linkov
  0 siblings, 0 replies; 2+ messages in thread
From: Juri Linkov @ 2022-10-29 17:48 UTC (permalink / raw)
  To: João Guerra; +Cc: 58866

tags 58866 notabug
close 58866 29.0.50
thanks

> desktop is restoring the tab-line tab order on application reload when
> using the default tab-line-tabs-function. When using a custom
> tab-line-tabs-function the order is not being preserved. (I suspect it
> could be due to how I want my tabs to behave.)
>
> Is desktop supposed to preserve the tab order for user customizations?

Desktop preserves the window buffer order, so the order for the default
tab-line-tabs-function is preserved in consequence.

Since you customized tab-line-tabs-function to another order
in 'old-tabs', you need also to save your variable 'old-tabs' in
your desktop.  Please look in desktop.el what hooks can you use
to serialize your variable with buffer objects to save it with
buffer names as strings.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-10-29 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 13:06 bug#58866: tab-line tab order is not preserved by desktop when customizing tab-line-tabs-function João Guerra
2022-10-29 17:48 ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).