From unknown Sun Aug 17 00:59:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#58866: tab-line tab order is not preserved by desktop when customizing tab-line-tabs-function Resent-From: =?UTF-8?Q?Jo=C3=A3o?= Guerra Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2022 13:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58866 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 58866@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16670488291244 (code B ref -1); Sat, 29 Oct 2022 13:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Oct 2022 13:07:09 +0000 Received: from localhost ([127.0.0.1]:35141 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oolYL-0000K0-Gu for submit@debbugs.gnu.org; Sat, 29 Oct 2022 09:07:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:33188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oolYH-0000Jp-LY for submit@debbugs.gnu.org; Sat, 29 Oct 2022 09:07:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oolYH-0002Q7-GX for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 09:07:05 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oolYG-0000F8-3z for bug-gnu-emacs@gnu.org; Sat, 29 Oct 2022 09:07:05 -0400 Received: by mail-pj1-x1029.google.com with SMTP id d13-20020a17090a3b0d00b00213519dfe4aso6742370pjc.2 for ; Sat, 29 Oct 2022 06:07:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=a/yI31bidOjdAQGTUE7g/CgjrIBvFguGRhHq++jlCTw=; b=ET0hdqHhPW/3qDOT0lhZRVDCROlqhb4tqI0pFHmKvcfQRuBz6FYyXRY4qg6rmSrHSi 06tOeLrb45ezecfs5IX5DBcjSQDue3zm5Rhcv5MWWCoB4biIuQ/Kr+D7WvmE9R+9s0JJ AMuw10V0jhfzJtc6q2cffc8W58K10Xa+OnCCDbPcQWkHIzRnP3K/Vk9KHZQU2SVFDdzx CjxadGbQ1vhkMA23MwMeGVwF1ggBnM45Ew0eQ64MM31t9d2+zsIMFWFvwnHf+ppIW0T9 K+1YhzxAL40l49Jmm0681XdEvuX26s+JGmkEX9x42xtjpU7tIWa5p9Q2qm1CSFbT7sLT klLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=a/yI31bidOjdAQGTUE7g/CgjrIBvFguGRhHq++jlCTw=; b=B2TOQuGCexbz+XkXZpQ3UMsRNrZju2V6x1AeVBG/dtA1vgX1Kc5PsGOzSYCg4UIdrO +zzfztEAiPnY61qYXNabjJfFmX+b4qZ5yPlAGIXfnF0W/1cqN8X4VoVwHq1iWobv3H2p bBS8JxYPqV30xpw7RNYkcqT282vaGcXX7bXt+NIA7PwjiuvKXZvTlU4YTsOVXdeaF2qf ipzNn643m5Mtzgy1BBVfUcwDWNeMFmvFzRLoAE+DtzP17i1EIGvmKZGMvaDl5oIWUpog fg8A63v6SJrPFslOO09y+wv4cF3zc9zDSp0WiLVmgwK5fRWtJrZ1AcUkCRtAjVpKCHL8 c0yA== X-Gm-Message-State: ACrzQf05CfR9y+bRvfAzjTV9rdBd3Z3KspMOYz+RLQ/6XNRMXMqEMFBx 7bqMunyt+MHcE0qcP0QO0zsvPjM/picPNryyCZ6eWszo02M= X-Google-Smtp-Source: AMsMyM4a5ms/Zxiai5JGpmbc0ksHPaY7egpK/DP7T8Q/rHPuWf8SpN8hIEZR/wD/eg0xZOeUcijciGEzwdc7gLhC6IE= X-Received: by 2002:a17:902:ecd0:b0:187:791:ae9f with SMTP id a16-20020a170902ecd000b001870791ae9fmr2358384plh.32.1667048821670; Sat, 29 Oct 2022 06:07:01 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?Q?Jo=C3=A3o?= Guerra Date: Sat, 29 Oct 2022 15:06:24 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=joca.bt@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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? From unknown Sun Aug 17 00:59:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#58866: tab-line tab order is not preserved by desktop when customizing tab-line-tabs-function Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Oct 2022 17:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58866 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o?= Guerra Cc: 58866@debbugs.gnu.org Received: via spool by 58866-submit@debbugs.gnu.org id=B58866.16670662287097 (code B ref 58866); Sat, 29 Oct 2022 17:58:02 +0000 Received: (at 58866) by debbugs.gnu.org; 29 Oct 2022 17:57:08 +0000 Received: from localhost ([127.0.0.1]:36558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooq4x-0001qN-Lz for submit@debbugs.gnu.org; Sat, 29 Oct 2022 13:57:07 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:57941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooq4o-0001pJ-IA; Sat, 29 Oct 2022 13:57:00 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id DB6B1FF805; Sat, 29 Oct 2022 17:56:50 +0000 (UTC) From: Juri Linkov In-Reply-To: ("=?UTF-8?Q?Jo=C3=A3o?= Guerra"'s message of "Sat, 29 Oct 2022 15:06:24 +0200") Organization: LINKOV.NET References: Date: Sat, 29 Oct 2022 20:48:34 +0300 Message-ID: <86y1syedid.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) 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.