[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gnus using lexical-binding
From: |
Ted Zlatanov |
Subject: |
Re: Gnus using lexical-binding |
Date: |
Mon, 08 Feb 2021 19:10:53 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
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) (1091
. 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