From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: Setting global variables (was: About zcomplete) Date: Mon, 21 Feb 2022 17:57:15 +0100 Message-ID: <20220221165715.yolhwzsu3zfsfn6e@Ergus> 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; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8294"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philip Kaludercic , Juri Linkov , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 21 18:09:53 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 1nMCC8-0001zy-Ib for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Feb 2022 18:09:52 +0100 Original-Received: from localhost ([::1]:44910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMCC7-0002uO-M6 for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Feb 2022 12:09:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMC2f-0008Gq-G9 for emacs-devel@gnu.org; Mon, 21 Feb 2022 12:00:06 -0500 Original-Received: from sonic315-42.consmr.mail.bf2.yahoo.com ([74.6.134.216]:46825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMC2b-0003of-VN for emacs-devel@gnu.org; Mon, 21 Feb 2022 12:00:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1645462795; bh=gV8eIhUW+cKY+sg6vutvJx0xuenn990Uk9Ma/tbGbzg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject:Reply-To; b=B539Qci42s4nZLIzUTwsS9EFnPH7RQnSgU+l0dfGBaHuIKVUyLHB498u5r21fqAonuu3APMPD6HcxnBuh4ENpSxH3WZiUq0d146gyNEfgFKhmxeHQ+QE0buh3uHUvWHf3OXZoTMcSW05yhrF5lyLikZNJTOoXMfl8jqO+AqxZknW7o6t8GaBq3J5pJwqavhM21izsM6QPS1ClE1M54h7IKRiKFqEFndZma7k0OCNX8tECRX+UJYcjy2ZBxhTibm+Q+Qd9XtpuIAf3Pyvrzv6IIQnVgv0rEaVHgbkTRGsI8xJvfvtq0sHhAwkp9el8HQbs5cvENmGm95V3ISP8ViBbQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1645462795; bh=oRGJtiY1mUE9AS0SKbpvljawKKwDez4mxFUlR+28XnL=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=PPgiDoHa8Lr3OPTZa2wtuG/ZSpcbTp//nmTKLjTAeHyl7kHR2rmWSBc2uQzxsH5enR24kQQrdmRy8HzeMtVrqTjpzbFM6YGWLtq70or8j53R5MaGEaZ1ezISUhJABf8xWjgI15F2bYLOB/Lk843ImT2fr6F49/cAXKCSNmKbQEYOWrqBsQBJ8uc9UEMmkcNmoHbL7HYD/3xjByk2fqkziOBzgc8MkFNDkAwy0MXRpmoRH7DefzoDc7HHDGsQ40jOZxBs0+Sj1fUL1pOjgF43vpJ1ezziKhuYmQNRWlgzqqnZ9xZTIUPQwBEV14dLITfeY1bTt1QXbZ/5ODH5zyJCRA== X-YMail-OSG: XKTQh3YVM1mFz1jtJ6HaBFzIiAWQ9DfEkh8RfsW7jUTgKXWGF5AHpWIqe6Mjd1e whBy6h7Ec5C62q_t70qCahiO_fbgD6_h9DdYeIZ5NcukpdxEF28vXn7n9gnsOK51S9HLDNFfNiTr C5iSaA7gGEq7SNvV4fZp6w_IQUpY14_cphSuvWMdrC.MpYCg0rXUX00V8Z31Gm_cEKpXQa9ygIqn VoU5lv8mBcZ5DHA05p661oxbFGp7iyyYmZVQ3CZCBW4ZxgewWxMcmVv.M6LpVSmHjgpM9XXU0wu2 r6t8sHrP4PxhNSjjuhEwMwMbmLlPi5pqq_ht_D70nGjPyPiJb9W_60i0enOXQCuh6fvHZkn4hjL2 cnrMw9MnRQnWRLfxZWsO43bAMo_Tg0tfpRa6uS1RmYELV1QVeX94Mj5i8kA4qzI.fH_6_Gztkngm YSvAJK2Mub7brSQCJkktSXqRmJGl1hbbAPl24D4ai_8vYIhzsCuJXvWQ2mB4C7ERG4.2nm8lB.z7 B22ZryeJ3_hlT7Bpm34bCywoVS2Z46zhZpx6oZLygxsRSJWCaVD3Vz7LjojieL8pM03PrE7spf.W GI96eaN7G9lSWu8kpllMUeWmbR0HSoxjI8uc9lutbX81J_PSZ9q3wiX1r5VspgrEp6GeV8Jt9Ni_ 8c8gqNfIuYEw9R8GdQUhFOkFcI4v4tMaWHDm7CAs2ftkvg0hdDdfWpm6Z.4Vp3GnSl1g0Hc_O2Qr WA9W8w3zwlRU48K3eZXm_HY5htNJc3JDl6.nKIxLGklscNEs3lu0szDFNCctBusi.QPK04BlOQtg yJNg8io.OAVXacs051NhbJQnd0jRrfKthf_mkJiX91 X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.bf2.yahoo.com with HTTP; Mon, 21 Feb 2022 16:59:55 +0000 Original-Received: by kubenode506.mail-prod1.omega.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 47de7e32d3803aa15568db09d3b0afa2; Mon, 21 Feb 2022 16:57:53 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.19797 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Received-SPF: pass client-ip=74.6.134.216; envelope-from=spacibba@aol.com; helo=sonic315-42.consmr.mail.bf2.yahoo.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, RCVD_IN_MSPIKE_H2=-0.001, 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:286568 Archived-At: On Mon, Feb 21, 2022 at 10:35:43AM -0500, Stefan Monnier wrote: >> 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 > This actually sounds very interesting... Maybe you could suggest it in #54074 ... My idea was actually to have an interface like the one of use-packages in define-minor mode... for customs (vars), hooks and bindings... so disabling the mode automatically restores the variables, removes the hooks and cleans the bindings... But in the background either your proposal or Juri's looks fine...