From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#71861: 31.0.50; Keep better track of options to be :set-after others Date: Sun, 30 Jun 2024 19:34:08 +0200 Message-ID: <87wmm6e3n3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30229"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic To: 71861@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 30 19:35:25 2024 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 1sNyST-0007fF-KG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Jun 2024 19:35:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sNySE-00081x-7b; Sun, 30 Jun 2024 13:35:10 -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 1sNyS9-00081I-MT for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2024 13:35:07 -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 1sNyS7-0005Jo-Dz for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2024 13:35:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sNyS6-0005WI-MA; Sun, 30 Jun 2024 13:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: philipk@posteo.net, bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jun 2024 17:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71861 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Philip Kaludercic Original-Received: via spool by submit@debbugs.gnu.org id=B.171976885621150 (code B ref -1); Sun, 30 Jun 2024 17:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Jun 2024 17:34:16 +0000 Original-Received: from localhost ([127.0.0.1]:58975 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNyRM-0005V4-2a for submit@debbugs.gnu.org; Sun, 30 Jun 2024 13:34:16 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:33964) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNyRJ-0005Uw-Rp for submit@debbugs.gnu.org; Sun, 30 Jun 2024 13:34:14 -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 1sNyRJ-0007wR-Jo for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2024 13:34:13 -0400 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sNyRH-0005Ep-Uj for bug-gnu-emacs@gnu.org; Sun, 30 Jun 2024 13:34:13 -0400 Original-Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-425814992aeso1708125e9.1 for ; Sun, 30 Jun 2024 10:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719768850; x=1720373650; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=K/Ed2S67G/Ed8jweqiLaU5SVZyH2A2rRzsTJqrg0I8w=; b=m3s7FbXiRuXE0RgBJMcgSGyJazUlIdl3YiegyPqQ2i5GijZe8CaUhkhWW7gOt2Y3Hv pmQ5+FqAVuKflTV6HN5S+wP8UgXwgF1V2vjLdKYpkk4kcPR/oNSyVfXbRsZrffXP+XA5 1sdfhn5UMnO3dQTsyMie1g4BAlgFBZZ9v1y1oLx0HM8e4Y66Rza39sdSfH28g5H1rOzS 67k8Fipror+83T7IKPU4J9JDkYCorb9Y7wuY0PDhuGiH7E8LYREIFJjPGy1zLaYS8Aka X4c6xQhRqjXxmDXYi49phBoVuILFIf7X692soY5eE2e8CZiJnCnaNakXnUaE3V17/gJV fAEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719768850; x=1720373650; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=K/Ed2S67G/Ed8jweqiLaU5SVZyH2A2rRzsTJqrg0I8w=; b=PKxT5DVXywxk+oMOsdVqwVgZ/XPjHhScrnNuInIkM6ePZKwRYgsg16JwQTbzAsKM9a hiqKaxrVt5NTy3bB6/g5l2MebsE56IDtGHCVOhavApkJa+0tA9wbXHByFz4UFXG05WUY 8lErIEN3U/9j5uzSn2p/Nu6jf3bGeij6OlxZ6RSWKBuE9g5nV5zTtCx37uQjms+rsq1b 2PDZTPHGtbZ6fUd1ZCeCCpzMLHYv47awnyd2pxI6vqXlJ2AOHnAbxU1vhx5Xeo37dsPt 23NMSyhT2ZHAA4q2punKzkWxui4PEAM5ao/R2VWvusmACE+R/QLNkixwFPrA9bTWld3v dNUg== X-Gm-Message-State: AOJu0YyuO0/ZMP5XpNE/q/EVVxtn2YYrE2XI6RiOrvy9ZBRG6lA+4vnS OUUbW9M+3AEHm3RR5ISxnIw8q2SmYE3bE8vHAhexIhl1bKDodXUqi4WIdw== X-Google-Smtp-Source: AGHT+IGEfw/FrOTS8102/QO8/V3H4AzriyLV+T8ccqHY7b+Cby9ey/RW1SoPLpRGxKggdT/iTHYeQQ== X-Received: by 2002:a05:600c:6b0f:b0:425:63a9:f96e with SMTP id 5b1f17b1804b1-4257a02f20emr25303815e9.36.1719768849629; Sun, 30 Jun 2024 10:34:09 -0700 (PDT) Original-Received: from amdahl30 ([2a01:e0a:253:fe0:2ef0:5dff:fed2:7b49]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4256b09a94csm117646495e9.33.2024.06.30.10.34.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Jun 2024 10:34:09 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=kevin.legouguec@gmail.com; helo=mail-wm1-x32a.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-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:288213 Archived-At: In help-gnu-emacs <877ceftlof.fsf@gmail.com>, we noted that user options that depend on each other induce some manual work to properly keep in sync. The examples in that thread were: * which-key-dont-use-unicode, consulted by * which-key-separator * which-key-ellipsis * ls-lisp-emulation, consulted by * ls-lisp-ignore-case * ls-lisp-use-string-collate * ls-lisp-dirs-first * ls-lisp-verbosity In these examples, each "sub-option" is defined with a :set-after clause on the "meta-option", i.e. they are defined with: (defcustom SUB-OPTION (FORM META-OPTION) "[=E2=80=A6]." [=E2=80=A6] :set-after '(META-OPTION) [=E2=80=A6]) Currently, for sub-options to be recomputed when users set the corresponding meta-option, maintainers must add a :set clause to the latter invoking custom-reevaluate-setting on the former: see e.g. * which-key-dont-use-unicode's :set form: :set (lambda (sym val) (custom-set-default sym val) (mapc #'custom-reevaluate-setting '(which-key-separator which-key-ellipsis))) * ls-lisp-set-options, invoked by ls-lisp-emulation's :set form: (mapc 'custom-reevaluate-setting '(ls-lisp-ignore-case ls-lisp-dirs-first ls-lisp-verbosity ls-lisp-use-string-collate)) Assisting maintainers by automating some of that would be neat. I have some half-baked ideas on the topic, but I'll tuck them in a footnote=C2=B9 and let Philip tell us about his own =F0=9F=98=89 =C2=B9 (a) (custom-add-dependencies sub-option meta-options) could be taught to store the reverse dependency to help with bookkeeping, e.g. (dolist (meta-opt meta-options) (push sub-option (get meta-opt 'custom-watchers))) This would allow maintainers of meta-options to retrieve all settings to reevaluate, instead of having to spell out the whole list (which, conceivably, they might not even know, e.g. if out-of-tree package x decides to base their defaults on in-tree package y). (b) To go further, assuming (a) is implemented, custom.el could be taught to automatically (mapc #'custom-reevaluate-setting (get opt 'custom-watchers)) after setting opt? Not sure if this is one step too far. Should this behaviour be opt-in somehow, for backward compatibility? E.g. with a new defcustom keyword for sub-options? :depends-on (META-OPTIONS=E2=80=A6) or a new form for :set-after? :set-after ((META-OPTION t)=E2=80=A6) In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) of 2024-06-23 built on amdahl30 Repository revision: 93088fc13c47fbab875f9ee173c0a66d623d91c6 Repository branch: master Windowing system distributor 'SUSE LINUX', version 11.0.12401000 System Description: openSUSE Tumbleweed Configured using: 'configure --prefix=3D/home/peniblec/apps/.emacs.2024-06-23 --with-cairo --with-sqlite3 --with-xinput2' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix