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#44598: [PATCH] Do not show obsolete options in customize Date: Thu, 12 Nov 2020 18:44:24 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007736d805b3efd1db" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11014"; 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 Thu Nov 12 22:51:17 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 1kdKUu-0002kT-Rm for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Nov 2020 22:51:16 +0100 Original-Received: from localhost ([::1]:41322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdKUt-0004WJ-Q6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Nov 2020 16:51:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdKOu-0005su-5p for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 16:45:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34275) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kdKOs-0003EU-8l for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 16:45:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kdKOs-0000UQ-72 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2020 16:45:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Nov 2020 21:45: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.16052174861840 (code B ref 44598); Thu, 12 Nov 2020 21:45:02 +0000 Original-Received: (at 44598) by debbugs.gnu.org; 12 Nov 2020 21:44:46 +0000 Original-Received: from localhost ([127.0.0.1]:45821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdKOb-0000Tc-Qs for submit@debbugs.gnu.org; Thu, 12 Nov 2020 16:44:46 -0500 Original-Received: from mail-wm1-f49.google.com ([209.85.128.49]:34472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kdKOY-0000TO-AY for 44598@debbugs.gnu.org; Thu, 12 Nov 2020 16:44:43 -0500 Original-Received: by mail-wm1-f49.google.com with SMTP id 23so6984598wmg.1 for <44598@debbugs.gnu.org>; Thu, 12 Nov 2020 13:44:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=Lz3gl/6HWFYr+1FAjUto4+dBcduxWAEiLuVQlsA8psM=; b=t2hcghNItZKvjnSw/Ld5etcPyzb8iX4kSJz9wI8jrKoXkvijK/TQbwM3n50JVEhtpb 3wrJbXBJgDW8OfiAtr0OUUQost/1hY4bKO6RXxTd/GdGjXdG1ZgjjG9OS8531Y+XM/h0 3MUHzppLakf+EVuSx/JQDHGNpZUgayqX+SeOwr29GKoxxDkrq6qC5CBJt9YQ+/IFSDOi FCSMVmWBRvr5eKPR34gpUlXWfAEpH5myZQbmlBn+aXa5f8u6Kx0LMieZNX/we+1VUu3k fU0CySNqRXIqgfTWqoEd6zgU4XF1F6QUqjMxn/kTFymy9SdXis1XsdCto6dcqHmuZUCG sXSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Lz3gl/6HWFYr+1FAjUto4+dBcduxWAEiLuVQlsA8psM=; b=JK/DqeV9rJzx6aNIzY7ZfQiUq4H9yb48Nlc2qilcU2pMjVE98F3d5CtadQLORgv/zX MAVuJZ6KdvQcXdCe+nK0dKfmmmCL4goS2EM4eEbjoOasZ1XLJI+IyJX7ZhZGDyESm9+q uU7ulGdM336VE6ABorY56P8VQPbU9pQ2dC2pvEm3A1gNtUnBVrkjSj6162TI5i9Q+eee BDV6IVB7q8UMmdd3LNYo4ctlEGSVAjnjpzoNCj0x6s5t1k2zKnPmqb9JjUO6tYzSu76c slXeI2eIEFcOwmGoGgNmCn4VWT/DZvSRJYMj4mZhmBH38nxSyUnJixTVuQReSuVccyKH 7WkQ== X-Gm-Message-State: AOAM530meTOmvBkZo4oEOngyFcRH2mo0g8w9ienJZ+P9lA65nmgAAePA JZMkfJUlvKNwH5XTlrKX9/mwFk9DzN/hzk0m3XUFZdELGg0= X-Google-Smtp-Source: ABdhPJyfCGNtFPYcqM4tfHUVPXlJdWsdvkROStID/T54pOqsz03hple5gkb5pk1cZTuTzETLieDg46cxGBh1U+gKuhg= X-Received: by 2002:a1c:bac1:: with SMTP id k184mr1649563wmf.76.1605217476358; Thu, 12 Nov 2020 13:44:36 -0800 (PST) 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:193186 Archived-At: --0000000000007736d805b3efd1db Content-Type: text/plain; charset="UTF-8" Stefan Kangas writes: > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -706,6 +706,10 @@ This file was a compatibility kludge which is no longer needed. > To revert to the previous behavior, > '(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'. > > +** Customize > + > +*** Customize will no longer show obsolete user options. > + Only when customizing a group, it seems. They still show up when using customize-apropos (quite common), customize-saved (for an old setting, it could be somewhat common), or when asking to customize them directly (although that could be less common). I don't know what others think, but perhaps customize-saved should still show them: after all, it is a current user saved setting. > --- a/lisp/cus-edit.el > +++ b/lisp/cus-edit.el > @@ -2505,18 +2505,6 @@ custom-comment-invisible-p > > ;;; The `custom-variable' Widget. > > -(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) > - Because of the above, perhaps it's too early to remove it? > @@ -2544,7 +2532,7 @@ custom-variable-documentation > Normally just return the docstring. But if VARIABLE automatically > becomes buffer local when set, append a message to that effect. > Also append any obsolescence information." > - (format "%s%s%s" (documentation-property variable 'variable-documentation t) > + (format "%s%s" (documentation-property variable 'variable-documentation t) > (if (and (local-variable-if-set-p variable) > (or (not (local-variable-p variable)) > (with-temp-buffer > @@ -2552,21 +2540,7 @@ custom-variable-documentation > "\n > This variable automatically becomes buffer-local when set outside Custom. > However, setting it through Custom sets the default value." > - "") > - ;; This duplicates some code from describe-variable. > - ;; TODO extract to separate utility function? > - (let* ((obsolete (get variable 'byte-obsolete-variable)) > - (use (car obsolete))) > - (if obsolete > - (concat "\n > -This variable is obsolete" > - (if (nth 2 obsolete) > - (format " since %s" (nth 2 obsolete))) > - (cond ((stringp use) (concat ";\n" use)) > - (use (format-message ";\nuse `%s' instead." > - (car obsolete))) > - (t "."))) > - "")))) > + ""))) And the same goes for this: if the option is still likely to pop up in some other Custom buffer, then this is useful information we might want to keep showing to the user. > +(defun custom--filter-obsolete-variables (items) > + "Filter obsolete variables from ITEMS." > + (seq-filter (lambda (item) > + (not (and (eq (nth 1 item) 'custom-variable) > + (get (nth 0 item) 'byte-obsolete-variable)))) > + items)) > + Nit: perhaps seq-remove? --0000000000007736d805b3efd1db Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Stefan Kangas <ste= fan@marxist.se> writes:

> --- a/etc/NEWS
> +++ b/etc= /NEWS
> @@ -706,6 +706,10 @@ This file was a compatibility kludge whi= ch is no longer needed.
> =C2=A0To revert to the previous behavior,> =C2=A0'(setq lisp-indent-function 'lisp-indent-function)'= ; from 'lisp-mode-hook'.
> =C2=A0
> +** Customize
&g= t; +
> +*** Customize will no longer show obsolete user options.
&= gt; +

Only when customizing a group, it seems.=C2=A0 They still show= up when using
customize-apropos (quite common), customize-saved (for an= old setting,
it could be somewhat common), or when asking to customize = them directly
(although that could be less common).=C2=A0 I don't kn= ow what others think,
but perhaps customize-saved should still show them= : after all, it is a
current user saved setting.

> --- a/lisp/= cus-edit.el
> +++ b/lisp/cus-edit.el
> @@ -2505,18 +2505,6 @@ c= ustom-comment-invisible-p
> =C2=A0
> =C2=A0;;; The `custom-vari= able' Widget.
> =C2=A0
> -(defface custom-variable-obsolete=
> - =C2=A0'((((class color) (background dark))
> - =C2=A0 = =C2=A0 :foreground "light blue")
> - =C2=A0 =C2=A0(((min-co= lors 88) (class color) (background light))
> - =C2=A0 =C2=A0 :foregro= und "blue1")
> - =C2=A0 =C2=A0(((class color) (background l= ight))
> - =C2=A0 =C2=A0 :foreground "blue")
> - =C2= =A0 =C2=A0(t :slant italic))
> - =C2=A0"Face used for obsolete v= ariables."
> - =C2=A0:version "27.1"
> - =C2=A0:= group 'custom-faces)
> -

Because of the above, perhaps it&= #39;s too early to remove it?

> @@ -2544,7 +2532,7 @@ custom-vari= able-documentation
> =C2=A0Normally just return the docstring.=C2=A0 = But if VARIABLE automatically
> =C2=A0becomes buffer local when set, = append a message to that effect.
> =C2=A0Also append any obsolescence= information."
> - =C2=A0(format "%s%s%s" (documentati= on-property variable 'variable-documentation t)
> + =C2=A0(format= "%s%s" (documentation-property variable 'variable-documentat= ion t)
> =C2=A0 =C2=A0(if (and (local-variable-if-set-p variable)> =C2=A0 =C2=A0 (or (not (local-variable-p variable))
> =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (with-temp-buffer
> @@ -2552,21 +2540,7 @@ cus= tom-variable-documentation
> =C2=A0 =C2=A0 =C2=A0 =C2=A0"\n
= > =C2=A0This variable automatically becomes buffer-local when set outsid= e Custom.
> =C2=A0However, setting it through Custom sets the default= value."
> - =C2=A0 =C2=A0"")
> - =C2=A0;; Thi= s duplicates some code from describe-variable.
> - =C2=A0;; TODO ext= ract to separate utility function?
> - =C2=A0(let* ((obsolete (get v= ariable 'byte-obsolete-variable))
> - (use (car obsolete)))
= > - =C2=A0 =C2=A0(if obsolete
> - (concat "\n
> -This= variable is obsolete"
> - (if (nth 2 obsolete)
> - = =C2=A0 =C2=A0(format " since %s" (nth 2 obsolete)))
> - (= cond ((stringp use) (concat ";\n" use))
> - =C2=A0 =C2= =A0 =C2=A0(use (format-message ";\nuse `%s' instead."
>= - =C2=A0 (car obsolete)))
> - =C2=A0 =C2=A0 =C2=A0(t "= .")))
> - =C2=A0 =C2=A0 =C2=A0""))))
> + =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"")))

And the same goes= for this: if the option is still likely to pop up in
some other Custom = buffer, then this is useful information we might want
to keep showing to= the user.

> +(defun custom--filter-obsolete-variables (items)> + =C2=A0"Filter obsolete variables from ITEMS."
> + = =C2=A0(seq-filter (lambda (item)
> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(not (and (eq (nth 1 item) 'custom-variable)> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(get (nth 0 item) 'byte-obsolete-variable))))> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0items))
> +<= br>
Nit: perhaps seq-remove?
--0000000000007736d805b3efd1db--