From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#59438: 29.0.50; [PATCH] Make defvar's into defcustom's in tab-line Date: Fri, 8 Sep 2023 07:43:36 -0300 Message-ID: <3847fb38-8c3f-b3fd-673e-8030713c7b77@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14049"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: 59438@debbugs.gnu.org, Juri Linkov To: Stefan Kangas , Gabriel Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 08 12:44:15 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qeYyE-0003Sy-9o for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Sep 2023 12:44:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qeYy5-0000rZ-E1; Fri, 08 Sep 2023 06:44:05 -0400 Original-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 1qeYy0-0000rF-KS for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2023 06:44:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qeYy0-0003Jr-6b for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2023 06:44:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qeYy1-0003lg-Qk for bug-gnu-emacs@gnu.org; Fri, 08 Sep 2023 06:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Sep 2023 10:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59438-submit@debbugs.gnu.org id=B59438.169416983414465 (code B ref 59438); Fri, 08 Sep 2023 10:44:01 +0000 Original-Received: (at 59438) by debbugs.gnu.org; 8 Sep 2023 10:43:54 +0000 Original-Received: from localhost ([127.0.0.1]:42286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeYxt-0003lE-Re for submit@debbugs.gnu.org; Fri, 08 Sep 2023 06:43:54 -0400 Original-Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]:45458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeYxp-0003ky-2k for 59438@debbugs.gnu.org; Fri, 08 Sep 2023 06:43:53 -0400 Original-Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-1d544a4a315so1437541fac.3 for <59438@debbugs.gnu.org>; Fri, 08 Sep 2023 03:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694169821; x=1694774621; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ELQtqlxxKmP1yg7FxMy8HJ+6NuXamFPE7LqNSpwbkz0=; b=BsVc/gI1RG1TiTIEtcSFcLiK+MUKcX9obaAAV+31eLQGwBSLR55xuTbeFnSz4JseUm hcHsrMuUKbXPkViUpRHF1LBlonmoiNWiTDNCYe0MTwmqxCTn2zJsU87TpOyJJUeGPtGr FDjT+6/MyGg7JoOxUaMaR0B0g1FDcGl+zQEH3GV7Zvu4AeIvWAamBkXl+Pbz7YiKGNNl zppmVlLr8i+Mg/a6a9UVsBUCwjjtO1yi6mIfBU8/gdLhZjX5nf2ozIHjN3RPBNzvRIdZ esKNCRs/8ElCP1FP5OQ+SGXukS0+6ziJQrQjtW6oz1ByHGnC//7QOz1k3wb5EE7fGVH/ EegQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694169821; x=1694774621; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ELQtqlxxKmP1yg7FxMy8HJ+6NuXamFPE7LqNSpwbkz0=; b=mMP438uMfj/w8BWVoORKO7xJdFczjb6PZmUoBRawNhLjqzMnC/rKRE8943K2luuptx q9NVWqDo6fI5t0XgUBOnwOQ/IYPGY2tHwjDZtSkr3S2vFgqCQyXsO/S/idpnddYtcueF 0bIEXjd11e/F0G8q4HpW8tOMsZQ1GUltUhEZdzlaxo+YzTSsRpIKzPtDLvPT307yesC4 AoghP6I2HmZPPpO8jdYuRLyWbhYV7iHItR857rdhdBbRX59T3W50jxXTXSFWlcc3uCJt bUjrPIQolxCzUYqj5KDQ3mF5wmR8vuLKVhZ4YXVFODa9rDGGgTSwjhXBR07KgtZhJ5yX ElXA== X-Gm-Message-State: AOJu0YxWpCYtF1ljVAYvrSeamh7+CzroLYi5S5phQ+8Jo9cHB4m/8gyu ppCHVd2X1ggFsVlKPEx46hc= X-Google-Smtp-Source: AGHT+IGSS2Fv0+4/dEt1VhrZe1AVjcC2BvY29qwoxfv7TwOYBFRQRsOPDKmB8iwwj0hvCxkhgQmQxQ== X-Received: by 2002:a05:6870:5689:b0:1bb:583a:db4a with SMTP id p9-20020a056870568900b001bb583adb4amr2463227oao.44.1694169820799; Fri, 08 Sep 2023 03:43:40 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id eb20-20020a056870a89400b001cce851c7basm771036oab.11.2023.09.08.03.43.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Sep 2023 03:43:40 -0700 (PDT) Content-Language: en-US In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:269747 Archived-At: On 7/9/23 18:07, Stefan Kangas wrote: > Stefan Kangas writes: > >> Gabriel writes: >> >>> Please find attached a patch that proposes the following minor changes >>> to tab-line. I can refactor the patch if we decide that some change are >>> not worth or if it's better to split it into smaller patches. >>> >>> 1) Turn the following defvar's into defcustom's: >>> >>> - `tab-line-tabs-buffer-group-function' >>> - `tab-line-tabs-buffer-group-sort-function' >>> - `tab-line-tabs-buffer-groups-sort-function' >>> >>> 2) Add conditional around function call of >>> `tab-line-tabs-buffer-groups-sort-function', in >>> `tab-line-tabs-buffer-groups'. This guards against nil values, similar >>> to how `tab-line-tabs-buffer-group-sort-function is handled, making the >>> behavior more consistent across these two (similar) variables. >>> >>> Should we announce these "new" defcustom's in NEWS? >> >> Juri, thoughts? > > Ping. Does anyone have any comments? I do have minor comments about the defcustom changes. Gabriel writes: >>From da1053e7211d8bb17769fe43650a9bcdd359aeab Mon Sep 17 00:00:00 2001 > From: Gabriel do Nascimento Ribeiro > Date: Mon, 21 Nov 2022 06:17:49 -0300 > Subject: [PATCH 1/1] Make defvar's into defcustom's in tab-line > > * lisp/tab-line.el (tab-line-tabs-buffer-group-function) > (tab-line-tabs-buffer-group-sort-function) > (tab-line-tabs-buffer-groups-sort-function): Make into defcustom's. > (Make defvar's into defcustom's in tab-line): Handle case when > variable tab-line-tabs-buffer-groups-sort-function is nil. > --- > lisp/tab-line.el | 51 ++++++++++++++++++++++++++++-------------------- > 1 file changed, 30 insertions(+), 21 deletions(-) > > diff --git a/lisp/tab-line.el b/lisp/tab-line.el > index 99a785ee3e..9b1c101718 100644 > --- a/lisp/tab-line.el > +++ b/lisp/tab-line.el > @@ -341,16 +341,26 @@ tab-line-tabs-mode-buffers > (derived-mode-p mode))) > (funcall tab-line-tabs-buffer-list-function))))) > > -(defvar tab-line-tabs-buffer-group-function nil > +(defcustom tab-line-tabs-buffer-group-function nil > "Function to add a buffer to the appropriate group of tabs. > -Takes a buffer as arg and should return a group name as a string. > -If the return value is nil, the buffer should be filtered out.") > +Takes a buffer as argument and should return a group name as a > +string. If the return value is nil, the buffer should be > + filtered out." > + :type 'function > + :group 'tab-line > + :version "29.1") Since the option can be nil, please add a choice type here. > -(defvar tab-line-tabs-buffer-group-sort-function nil > - "Function to sort buffers in a group.") > +(defcustom tab-line-tabs-buffer-group-sort-function nil > + "Function to sort buffers in a group." > + :type 'function > + :group 'tab-line > + :version "29.1") Same here. > -(defvar tab-line-tabs-buffer-groups-sort-function #'string< > - "Function to sort group names.") > +(defcustom tab-line-tabs-buffer-groups-sort-function #'string< > + "Function to sort group names." > + :type 'function > + :group 'tab-line > + :version "29.1") And version should be updated, I guess.