From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Setting global variables (was: About zcomplete) Date: Mon, 21 Feb 2022 10:35:43 -0500 Message-ID: References: <20220220040515.zum3iodtpscj23j3.ref@Ergus> <20220220040515.zum3iodtpscj23j3@Ergus> <87wnhp4wu3.fsf@posteo.net> <20220220132708.lvuzvg2fyfpp6k76@Ergus> <87y224v767.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11543"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Ergus , Juri Linkov , emacs-devel@gnu.org To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 21 16:38:56 2022 Return-path: Envelope-to: ged-emacs-devel@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 1nMAm7-0002mR-HN for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Feb 2022 16:38:55 +0100 Original-Received: from localhost ([::1]:40768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMAm5-0005EU-Ti for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Feb 2022 10:38:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMAj9-00029V-0q for emacs-devel@gnu.org; Mon, 21 Feb 2022 10:35:51 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMAj5-0007Dc-Qy for emacs-devel@gnu.org; Mon, 21 Feb 2022 10:35:49 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C5F68441036; Mon, 21 Feb 2022 10:35:45 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7B059440BDB; Mon, 21 Feb 2022 10:35:44 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1645457744; bh=okTd5NgNMJG5JjvwGolsFyn0Cnj8MFI/P4T5CVRwobs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=NIgqSmYgAiyodjoF3NZD/8Lj1bemmsP170DfQbvzW/aZyZN1HAeaHb5xF1KWvck2T MaRpor1B6b18r12VNT+UlkS0zINlYVU0lgQ2+oezRenbK08VAgECIjG1S/Ron/QA23 Mh3u13GSmnM17TRJhARCv1NvgGE1fFVzsSn5x1aLg4mX84YVJM4XOYnUSEIHHEX225 Q7SLBFM9P3yAC5PJSQDd6M2crtut+OrcvDRSMS4zvcMAOrVRsLrVxA6jhf/2bjanEl OqnGKlVk8VLb2tcHOCXBDEgLBRqyB+/a93REZwGACHk18pf/93OlAazje7o579uaZv /R9XpM+RJyfKQ== Original-Received: from pastel (unknown [45.72.237.157]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4D3621204EB; Mon, 21 Feb 2022 10:35:44 -0500 (EST) In-Reply-To: <87y224v767.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 21 Feb 2022 10:35:28 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:286566 Archived-At: > I guess this is only of the issue that is so easy to solve on a > case-by-case basis (e.g. by setting a symbol property) that nobody has > bothered to write a general solution (e.g. by adding a keyword to > define-minor-mode that specifies what variables/user options to set when > enabled). FWIW, I've been toying with the idea of adding a kind of "advice" mechanism for variables. Basically associate with every variable a base value and a list of functions that modify it. Then minor modes can add a function to the list (which would implicitly update the var's effective value) when enabled and then remove it afterwards. Stefan