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: Re: master 11abc4a: Merge remote-tracking branch 'origin/scratch/lexical-gnus' into trunk Date: Mon, 01 Feb 2021 21:58:36 -0500 Message-ID: References: <20210131223952.429.10439@vcs0.savannah.gnu.org> <20210131223954.A429420DF3@vcs0.savannah.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="24677"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Katsumi Yamaoka Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 02 03:59:58 2021 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 1l6lv3-0006JQ-Tl for ged-emacs-devel@m.gmane-mx.org; Tue, 02 Feb 2021 03:59:57 +0100 Original-Received: from localhost ([::1]:49532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l6lv3-0006A0-0J for ged-emacs-devel@m.gmane-mx.org; Mon, 01 Feb 2021 21:59:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6ltr-000592-47 for emacs-devel@gnu.org; Mon, 01 Feb 2021 21:58:43 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:24228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l6lto-0008HX-BR for emacs-devel@gnu.org; Mon, 01 Feb 2021 21:58:42 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 725EA8079A; Mon, 1 Feb 2021 21:58:38 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id CB2DF8070D; Mon, 1 Feb 2021 21:58:36 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1612234716; bh=zvX9R/go7Ua9PAVzZVjlw1mP6nVcqLsWb947IpGV53Q=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=lvmVlDt7XVKRLFaWQ7YRJEs7vsFf/KfAksbXqmxd8DinW8n/cYOlIbyA+J1cBvdZJ ipEvM0K9j8yTOZw/Xbgui3dXxh8hoocaktxfp935e0SK1jubhAaMNOLsJRqLjFrtc3 PXdLG+Tu7QjdBAUIr4R8gknzFCQO5d4fVQ9lAOewsaAv4z0SmgpcKXYMGXZlHVwKls eNiIG/5tMZaf2ywtrYBqgQz2u2rSOlH2nE7a4Z6XRMZ521k7Exrr7J+VNLrrQl4DNG eIEUNpE0z18oFmGy+vyj5YDN8qksY/FpRDW62x3KXH+ZU4atEBRIsB5eO8SsRc4E9g ABcoZi/AJiFcQ== Original-Received: from alfajor (76-10-182-85.dsl.teksavvy.com [76.10.182.85]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A39ED12045A; Mon, 1 Feb 2021 21:58:36 -0500 (EST) In-Reply-To: (Katsumi Yamaoka's message of "Tue, 02 Feb 2021 09:44:57 +0900") 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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:263703 Archived-At: Katsumi Yamaoka [2021-02-02 09:44:57] wrote: > On Sun, 31 Jan 2021 17:39:54 -0500, Stefan Monnier wrote: >> branch: master >> commit 11abc4aef42ceaea451c264e5a7292e765d4f31b >> Merge: cb72b83 d2341eb >> Author: Stefan Monnier >> Commit: Stefan Monnier > >> Merge remote-tracking branch 'origin/scratch/lexical-gnus' into trunk > > It's not a bug but my custom face setting got to malfunction by > this change, I think it *is* a bug ;-) > i.e., to turn lexical-binding on on the gnus files. > My custom face setting is something like the following: > > (push '((string-match "REGEX" group) . custom-face) > gnus-group-highlight) Indeed, I see that `gnus-group-highlight`s docstring explicitly mentions `group` as a variable that can be used there, so we should include it. > Where `group' is a group name; it aimed to highlight groups of > which the name match "REGEX" by `custom-face' in the Group buffer. > However, `group' is no longer a bound variable now. So, I'd like > to add `group' to an env list in `gnus-group-update-eval-form' as > the patch below. Is it ok? Thanks. Looking at the docstring, I see that `method` is also missing, and on the flip side, I see that additionally to what the docstring mentions, the code provides `total` and `group-age`. Could someone help me figure out what should happen with those extra vars? Should `total` and/or `group-age` be removed from the code in `gnus-group-update-eval-form`, or should they instead be documented in the docstring of `gnus-group-highlight` and, if so, saying what? Stefan diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 3661b6376d..25abb911a6 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -367,13 +367,15 @@ gnus-group-highlight change in a future release. For now, you can use the following variables in the Lisp expression: -group: The name of the group. -unread: The number of unread articles in the group. -method: The select method used. -mailp: Whether it's a mail group or not. -level: The level of the group. -score: The score of the group. -ticked: The number of ticked articles." +`group': The name of the group. +`unread': The number of unread articles in the group. +`method': The select method used. +`total': ?? +`mailp': Whether it's a mail group or not. +`level': The level of the group. +`score': The score of the group. +`ticked': The number of ticked articles. +`group-age': ??" :group 'gnus-group-visual :type '(repeat (cons (sexp :tag "Form") face))) (put 'gnus-group-highlight 'risky-local-variable t) @@ -401,16 +403,8 @@ gnus-group-icon-list It is also possible to change and add form fields, but currently that requires an understanding of Lisp expressions. Hopefully this will -change in a future release. For now, you can use the following -variables in the Lisp expression: - -group: The name of the group. -unread: The number of unread articles in the group. -method: The select method used. -mailp: Whether it's a mail group or not. -level: The level of the group. -score: The score of the group. -ticked: The number of ticked articles." +change in a future release. For now, you can use the same +variables in the Lisp expression as in those of `gnus-group-highlight'." :group 'gnus-group-icons :type '(repeat (cons (sexp :tag "Form") file))) (put 'gnus-group-icon-list 'risky-local-variable t) @@ -1624,7 +1618,9 @@ gnus-group-update-eval-form (marked (gnus-info-marks info)) (env (list + (cons 'group group) (cons 'unread (if (numberp (car entry)) (car entry) 0)) + (cons 'method method) (cons 'total (if active (1+ (- (cdr active) (car active))) 0)) (cons 'mailp (apply #'append