unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: Gnus using lexical-binding
Date: Mon, 08 Feb 2021 19:10:53 +0000	[thread overview]
Message-ID: <blcubcjm.fsf@lifelogs.com> (raw)
In-Reply-To: jwvzh0qpbru.fsf-monnier+emacs@gnu.org

Hi!

I got a probably related error after restarting Gnus, which had been
running for a while. Sorry for the late catch. I have a custom topic
function `gnus-user-format-function-topic-line' that started
complaining:

Debugger entered--Lisp error: (void-variable total-number-of-articles)
  (= 0 total-number-of-articles)
  (if (= 0 total-number-of-articles) 'font-lock-comment-face 'font-lock-function-name-face)
  (let* ((topic-face (if (= 0 total-number-of-articles) 'font-lock-comment-face 'font-lock-function-name-face)) (h (tzz-frame-font-size))) (propertize (format "%s %s" name (if (and tzz-ungradients (image-type-available-p 'svg)) (tzz-image-from-svg-string (+ 4 h) h total-number-of-articles nil) (tzz-summarize-number total-number-of-articles))) 'face topic-face))
  gnus-user-format-function-topic-line(nil)
  (format "%s[ %s ] %s\n" indentation (gnus-user-format-function-topic-line gnus-tmp-header) visible)
  (insert (format "%s[ %s ] %s\n" indentation (gnus-user-format-function-topic-line gnus-tmp-header) visible))
  eval((insert (format "%s[ %s ] %s\n" indentation (gnus-user-format-function-topic-line gnus-tmp-header) visible)) ((indentation . "    ") (visible . "") (name . "comics") (level . 2) (number-of-groups . 1) (total-number-of-articles . 1) (entries (1 ("nntp+news.gwene.org:gwene.com.xkcd" 3 ((1 . 1664)) ((unexist) (seen (1 . 417) (423 . 445) (449 . 453) (455 . 464) 468 (507 . 511) (513 . 521) (525 . 536) 538 (540 . 544) (546 . 554) (558 . 580) (584 . 589) (605 . 622) (636 . 651) (653 . 655) (659 . 660) (662 . 664) (668 . 684) (686 . 705) (707 . 708) (710 . 711) (714 . 733) 736 (739 . 749) (751 . 752) (757 . 761) (764 . 765) 771 773 (776 . 920) (922 . 929) (931 . 937) (940 . 941) (943 . 961) (963 . 974) 979 (984 . 996) (998 . 1044) (1047 . 1054) (1056 . 1065) (1076 . 1078) (1082 . 1085) (109
 1 . 1093) (1095 . 1104) (1106 . 1120) (1122 . 1139) (1142 . 1144) (1148 . 1149) ...) (forward 164 411) (score (778 . 1000) (63 . 1000))) "news.gwene.org")))))
  gnus-topic-insert-topic-line("comics" t t 2 ((1 ("nntp+news.gwene.org:gwene.com.xkcd" 3 ((1 . 1664)) ((unexist) (seen (1 . 417) (423 . 445) (449 . 453) (455 . 464) 468 (507 . 511) (513 . 521) (525 . 536) 538 (540 . 544) (546 . 554) (558 . 580) (584 . 589) (605 . 622) (636 . 651) (653 . 655) (659 . 660) (662 . 664) (668 . 684) (686 . 705) (707 . 708) (710 . 711) (714 . 733) 736 (739 . 749) (751 . 752) (757 . 761) (764 . 765) 771 773 (776 . 920) (922 . 929) (931 . 937) (940 . 941) (943 . 961) (963 . 974) 979 (984 . 996) (998 . 1044) (1047 . 1054) (1056 . 1065) (1076 . 1078) (1082 . 1085) (1091 . 1093) (1095 . 1104) (1106 . 1120) (1122 . 1139) (1142 . 1144) (1148 . 1149) ...) (forward 164 411) (score (778 . 1000) (63 . 1000))) "news.gwene.org"))) 1)
  gnus-topic-prepare-topic((("comics" visible nil nil)) 2 5 nil nil 1 nil)

The confusing thing here is that the eval lexical environment is
correct. I'm not sure what's happening in the stack. I can reproduce it
with a shorter example:

(defun gnus-user-format-function-topic-line (dummy)
  (message "total %s" total-number-of-articles))

(let ((gnus-topic-line-format "%i[ %u&topic-line; ] %v\n"))
     (gnus-update-format-specifications nil 'topic))

(let ((gnus-tmp-header nil))
     (eval gnus-topic-line-format-spec
           '((indentation . "    ") (visible . "") (name . "comics") (level . 2) (number-of-groups . 1) (total-number-of-articles . 1))))

I hope that helps track it down.

Thank you
Ted




  reply	other threads:[~2021-02-08 19:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-29 23:11 Gnus using lexical-binding Stefan Monnier
2021-01-30  6:34 ` Lars Ingebrigtsen
2021-01-30  8:35 ` Eli Zaretskii
2021-01-30 13:43   ` Stefan Kangas
2021-01-30 13:52     ` Eli Zaretskii
2021-01-30 14:08       ` Eli Zaretskii
2021-01-30 15:24     ` Stefan Monnier
2021-01-30 15:07 ` Basil L. Contovounesios
2021-01-30 17:40   ` Stefan Monnier
2021-02-08 19:10     ` Ted Zlatanov [this message]
2021-02-09  0:10       ` Stefan Monnier
2021-02-10 10:24         ` Ted Zlatanov
2021-02-10 13:53           ` Stefan Monnier
2021-02-10 19:05           ` Lars Ingebrigtsen
2021-01-30 16:10 ` Andy Moreton
2021-01-30 17:35   ` Stefan Monnier
2021-01-30 18:00     ` Andy Moreton
2021-01-30 18:53       ` Stefan Monnier
2021-01-30 23:23         ` Andy Moreton
2021-01-31  0:06           ` Stefan Monnier
2021-01-31  0:46             ` Andy Moreton
2021-01-31 13:34             ` Basil L. Contovounesios
2021-02-02 18:17             ` Eric Abrahamsen
2021-02-02 19:40               ` Stefan Monnier
2021-02-02 20:31                 ` Eric Abrahamsen
2021-01-31  9:13 ` David Engster
2021-01-31 22:43   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=blcubcjm.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).