From unknown Mon Aug 11 21:13:18 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#32307 <32307@debbugs.gnu.org> To: bug#32307 <32307@debbugs.gnu.org> Subject: Status: [feature request] Add standard hooks to toggle common features Reply-To: bug#32307 <32307@debbugs.gnu.org> Date: Tue, 12 Aug 2025 04:13:18 +0000 retitle 32307 [feature request] Add standard hooks to toggle common features reassign 32307 emacs submitter 32307 Fu Yuan severity 32307 wishlist tag 32307 moreinfo thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 29 20:52:32 2018 Received: (at submit) by debbugs.gnu.org; 30 Jul 2018 00:52:33 +0000 Received: from localhost ([127.0.0.1]:34222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjwQK-0006cS-Ld for submit@debbugs.gnu.org; Sun, 29 Jul 2018 20:52:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39375) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjwQI-0006cD-TC for submit@debbugs.gnu.org; Sun, 29 Jul 2018 20:52:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjwQC-0003vZ-On for submit@debbugs.gnu.org; Sun, 29 Jul 2018 20:52:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44304) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fjwQC-0003vV-L7 for submit@debbugs.gnu.org; Sun, 29 Jul 2018 20:52:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjwQA-0004yF-R2 for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 20:52:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjwQ5-0003v6-Tq for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 20:52:22 -0400 Received: from mail-qt0-x22e.google.com ([2607:f8b0:400d:c0d::22e]:34600) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fjwQ5-0003uy-Lr for bug-gnu-emacs@gnu.org; Sun, 29 Jul 2018 20:52:17 -0400 Received: by mail-qt0-x22e.google.com with SMTP id m13-v6so10485113qth.1 for ; Sun, 29 Jul 2018 17:52:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:message-id:subject:mime-version; bh=+kbIebeZDRnAkKDe+znr6FXlH9pyq32SuQnzjkUGiSM=; b=mEkeC7LYZWVlWdNxzzU0b2J+teHqOYrMkEsuIbOH2Xc2eGbp+JHL9OB/1dR/3Ov3d6 uD1FhWI5tciA2d1qPhjZbjaVSQX6FVw/vEKoTvs9IO6BEW8dtbNnQ+O0gDYFetT/UG7s LYjrYUNZuzD1oMZ7gblZO9pHrD1z6W791GRItYyJSFtHrJuN2gGP04Aqgn67JsnNa2Bt 7avRRAw4NrfUytHUaVtpETmc2v/oY5Jj7tBPEDX3JtJmtNT6Pc/khvey4oz91TYFIjtv /jAf0iNsIyXaojS/Wy94EcSkXSucF1Okhf7kL9UQ/qMGKDgDsKK8nvcX+AxdCmVfnt9q 5fog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:message-id:subject:mime-version; bh=+kbIebeZDRnAkKDe+znr6FXlH9pyq32SuQnzjkUGiSM=; b=Mx3AAE/lKfEZfcN8KyYGezFyX1GhR9V966m6FnxO14G3xuvlnUizGc/t0KQI/hkJQP eCwQBjozJX+Mt7ESn4okbBEa/S4utaglROToe6WFfQvZmN53BEA9FjuCzs8EA506qR3V u2E/6yFBxFenw+oXmNaGV/ibv0B1fgz+bWOPkPl08Mj6PoabFAfdNstWCavPG1Q51WH/ 8N+MZDyjQG5fi020bs2a7uiXgwOrYqPX/RnfvWn0sTYXKpq+r7svUkW28TmUIE65cmQi SQLSbPVqZVGIFJ1daxB4v7lCs2KbbjEFG+4tAe3TIRvz5THsstfU1QMVuQFbRdjMhzjN onVQ== X-Gm-Message-State: AOUpUlEv8VFbJpmSRCtfNTFD8b2FGPI35/NOivQZi+kkGY8C6K63RHuz faoW6VLltYSnT5wxcPQNYoxNfseo X-Google-Smtp-Source: AAOMgpfaGny6K9N5ESKrFAvp9Dca5yUART0rHJSB0xLaG5udxcUFNpqfeqLyanD553Gv+/1qIprltw== X-Received: by 2002:a0c:f5d3:: with SMTP id q19-v6mr13670025qvm.213.1532911936212; Sun, 29 Jul 2018 17:52:16 -0700 (PDT) Received: from mail.outlook.com ([52.186.86.48]) by smtp.gmail.com with ESMTPSA id m40-v6sm6538848qtb.63.2018.07.29.17.52.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Jul 2018 17:52:15 -0700 (PDT) Date: Mon, 30 Jul 2018 00:52:14 +0000 (UTC) From: Fu Yuan To: Message-ID: <78B50EFACD052CCA.4A6DF615-D8E0-40FB-AF99-1698855A4EE9@mail.outlook.com> Subject: [feature request] Add standard hooks to toggle common features MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_11142_548524780.1532911934743" X-Mailer: Outlook for iOS and Android X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit 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: -5.0 (-----) ------=_Part_11142_548524780.1532911934743 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit By "standard features" I mean line numbering, format on save, auto-parens, etc. The current situation have these downsides: 1. complexity in configuration. Some of the packages that provide these features also provide toggling command,e.g. toggle-line-number or autoparens-mode.However, some __are not__, e.g. format on save.Toggling such feature requires users to implement their own commands.What's worse, they need to implement a toggling commandfor __each and every__ language. 2. problem when other package needs to toggle For example, I wrote a package that needs to temporarily disable auto-parens.I have to write code that handles electric-pair-mode, autoparens and paredit.Further more, byte compiler is not happybecause I was referring functions it doesn't know about. Here is my thought about it: Provide toggle commands and corresponding hook for each of these features.Feature providers add their toggle function to the proper hook.When user toggles on/off, the toggle command runs each functionin the hook with an aregument indicating that user is turning on or turning off,maybe t and nil. How do you think? Have there been similar discussions? Sincerely, Yuan ------=_Part_11142_548524780.1532911934743 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable