From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#44598: [PATCH] Do not show obsolete options in customize Date: Fri, 13 Nov 2020 09:40:52 +0200 Message-ID: <83mtzlya9n.fsf@gnu.org> References: <83lfh743j8.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1665"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 44598@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 13 08:42:28 2020 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 1kdTj2-0000LX-Gx for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Nov 2020 08:42:28 +0100 Original-Received: from localhost ([::1]:56576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdTj1-0003su-Ij for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Nov 2020 02:42:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdTic-0003sh-Sx for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 02:42:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdTic-0006Oh-JQ for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 02:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdTic-0004dO-Fp for bug-gnu-emacs@gnu.org; Fri, 13 Nov 2020 02:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Nov 2020 07:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44598 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 44598-submit@debbugs.gnu.org id=B44598.160525327717757 (code B ref 44598); Fri, 13 Nov 2020 07:42:02 +0000 Original-Received: (at 44598) by debbugs.gnu.org; 13 Nov 2020 07:41:17 +0000 Original-Received: from localhost ([127.0.0.1]:46535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdTht-0004cK-2z for submit@debbugs.gnu.org; Fri, 13 Nov 2020 02:41:17 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:55714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdThr-0004c5-8T for 44598@debbugs.gnu.org; Fri, 13 Nov 2020 02:41:15 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42818) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdThl-00068F-Ia; Fri, 13 Nov 2020 02:41:09 -0500 Original-Received: from [176.228.60.248] (port=3126 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kdThk-00066V-Fv; Fri, 13 Nov 2020 02:41:09 -0500 In-Reply-To: (message from Stefan Kangas on Thu, 12 Nov 2020 15:56:24 -0500) 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" Xref: news.gmane.io gmane.emacs.bugs:193208 Archived-At: > Cc: eliz@gnu.org > From: Stefan Kangas > Date: Thu, 12 Nov 2020 15:56:24 -0500 > > In a recent discussion on emacs-devel,[1] You mean this one: https://lists.gnu.org/archive/html/emacs-devel/2020-09/msg01617.html > > IMO, we shouldn't show obsolete options at all in a Custom buffer, for > > the same reason why we remove them from the manuals. > > How about the attached patch? Thanks, some comments: > +** Customize > + > +*** Customize will no longer show obsolete user options. This is too general, it sounds like those options will not be shown even if the user types "M-x customize-variable" to explicitly customize an obsolete option. That's not what the patch does, does it? > -(defface custom-variable-obsolete > - '((((class color) (background dark)) > - :foreground "light blue") > - (((min-colors 88) (class color) (background light)) > - :foreground "blue1") > - (((class color) (background light)) > - :foreground "blue") > - (t :slant italic)) > - "Face used for obsolete variables." > - :version "27.1" > - :group 'custom-faces) You are removing the face, but then how will we display obsolete options when the user actually asks to customize them by name? > +(defun custom--filter-obsolete-variables (items) > + "Filter obsolete variables from ITEMS." This doesn't say what kind of object is ITEMS expected to be. > + (seq-filter (lambda (item) > + (not (and (eq (nth 1 item) 'custom-variable) > + (get (nth 0 item) 'byte-obsolete-variable)))) > + items)) Do we really need the power of seq.el here? wouldn't mapcar do the job nicely, since we have a simple list here? OTOH, if you do use seq.el, why seq-filter and not seq-remove? > +(ert-deftest cus-edit-tests-customize-group/no-obsolete () > + "Check that obsolete variables do not show up." > + (save-window-excursion > + (unwind-protect > + (progn > + (customize-group 'cus-edit-tests) > + (should-not (search-forward "Cus Edit Testvar Obsolete" nil t))) > + (when-let ((buf (get-buffer "*Customize Group: Cus Edit Tests*"))) > + (kill-buffer buf))))) This test will fail when we remove the obsolete option, right? How can we come up with a test that doesn't suffer from such maintenance problems?