From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#57639: [PATCH] Add new command 'toggle-theme' Date: Wed, 19 Oct 2022 07:20:52 +0000 Message-ID: <87edv446uj.fsf@posteo.net> References: <875yhzmz25.fsf@posteo.net> <87bkr9newj.fsf@posteo.net> <871qs57yai.fsf@gnus.org> <87y1udlzlt.fsf@posteo.net> <87o7v953uf.fsf@gnus.org> <87tu50nca7.fsf@posteo.net> <87a6652lyb.fsf@posteo.net> <875ygtqdho.fsf@gnus.org> <87wn99114w.fsf@posteo.net> <87wn98nlhq.fsf@gnus.org> <87lepo9c1e.fsf@posteo.net> <87r0zfkxzx.fsf@gnus.org> <87pmeyg24x.fsf@posteo.net> <87edvef8nc.fsf@gnus.org> <871qre2l63.fsf@posteo.net> <875ygqf7pc.fsf@gnus.org> <87r0ze15rt.fsf@posteo.net> <871qref5mq.fsf@gnus.org> <875ygohztx.fsf@posteo.net> <83tu489fm6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34160"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , larsi@gnus.org, info@protesilaos.com, 57639@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 19 09:22:28 2022 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 1ol3PH-0008cc-Lk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Oct 2022 09:22:27 +0200 Original-Received: from localhost ([::1]:33736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ol3PF-0006UV-2w for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Oct 2022 03:22:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ol3Nv-0006RA-Av for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 03:21:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56587) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ol3Nu-00087j-DX for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 03:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ol3Nu-0007Hx-92 for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2022 03:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Oct 2022 07:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57639 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57639-submit@debbugs.gnu.org id=B57639.166616406127995 (code B ref 57639); Wed, 19 Oct 2022 07:21:02 +0000 Original-Received: (at 57639) by debbugs.gnu.org; 19 Oct 2022 07:21:01 +0000 Original-Received: from localhost ([127.0.0.1]:55665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol3Nt-0007HT-5m for submit@debbugs.gnu.org; Wed, 19 Oct 2022 03:21:01 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:35885) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol3Nr-0007HG-KR for 57639@debbugs.gnu.org; Wed, 19 Oct 2022 03:21:00 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E183424002A for <57639@debbugs.gnu.org>; Wed, 19 Oct 2022 09:20:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1666164053; bh=YxBQa/fR7zXhwlAR6b9VigOHIVG3I2pwXpe96HzjeQ4=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=ErfyeNbhp/owmopQhmhW/6152e+OT0hSkDW3xuZZKvv7gyqJIxcU4wDyzhUX0cJrs d1qqOp/8jxWoDnAL27VsYXp3eSZmgYg96bPdwvgkJdi8S9lligf/1u9LBuvmo6Lmvf haArMNLJ51xyQS6jpq93B+0qaYDeP0zjEWDojKPdXk3SMFg3GLQZjJM6HaCP4qTe8c LmCa0yLqAy4zjWDYTiTjixC8GUyBdF4pIirqF6Q7mHyoiAmwOEOiM4qkOz7GULlcXu 9S4lFKniaFSBY27IU9zX/BBK5yx9dp2JGnemW0MOa8wCP/YFFlGA9AS3VF3bCs7oAy cQ5y74suJYXrw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MshwP1gjCz6tnr; Wed, 19 Oct 2022 09:20:53 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Tue, 18 Oct 2022 22:43:14 -0400") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB 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:245848 Archived-At: Stefan Monnier writes: >>> > I think you'd basically put something like the following into >>> > `loaddefs-generate--emacs-batch' -- >>> > >>> > (let ((lisp-mode-autoload-regexp >>> > "^;;;###\\(\\(noexist\\)-\\)?\\(theme-autoload\\)")) > > Hmm... `lisp-mode-autoload-regexp` is defined as a `defconst`. If we're > going to set it to some other value, we should change its definition to > a `defvar`, no? > > Also, this code should come with a comment explaining why we're doing > this silly dance (it took me a while to go from that code to here). > [ I don't understand the "noexist" thingy, BTW. Is that intended to be > a regexp that will never match? Should it use `regexp-unmatchable` > then? Or why not just "^;;;###\\(?3:theme-autoload\\)"? ] > >>> > (loaddefs-generate >>> > (expand-file-name "../etc/themes/" lisp-directory) >>> > (expand-file-name "theme-loaddefs.el" lisp-directory))) > > Note that if one of those ;;;###theme-autoload cookies is placed in > front of a function definition, it will still result in a broken: > > (autoload 'FUNCTIONNAME "etc/themes/FILENAME" ...) > > which fails because "etc/themes/FILENAME" isn't found in `load-path`. Oh, that sounds bad! >>> > Then you have to teach `loaddefs-generate--make-autoload' to generate >>> > the correct forms as a result of the `deftheme' -- which should be some >>> > `put's. >>> >>> OK, it looks like this worked. Just to recap, these are the proposed >>> changes: >> >> What, if anything, does this mean for themes that aren't bundled with >> Emacs? >> >> Also, this needs a NEWS entry. > > I see this got the following entry: > > ** Themes have special autoload cookies. > All build-in themes are scraped for ;;;###theme-autoload cookies that > are loaded along with the regular auto-loaded code. > > but I can't see any good reason why Emacs users should care about that. > It seems like a purely internal hack (and given the restrictions on > what can be autoloaded this way, we probably shouldn't advertise it too > loudly, unless accompanied with appropriate warnings). Hmm, I believe I agree in retrospect that this doesn't really help anyone. > > Stefan