emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 69943ae: * lisp/gnus/gnus-topic.el: Fix a backward incompatibilit


From: Stefan Monnier
Subject: master 69943ae: * lisp/gnus/gnus-topic.el: Fix a backward incompatibility
Date: Mon, 8 Feb 2021 19:08:19 -0500 (EST)

branch: master
commit 69943ae70ce0aec075bd26ad0100c174b34bad7f
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/gnus/gnus-topic.el: Fix a backward incompatibility
    
    (gnus-topic-insert-topic-line): Make the vars used in
    `gnus-topic-line-format-spec` dynamically scoped since it seems
    that they're sometimes accessed from functions called by
    `gnus-topic-line-format-spec` :-(
    
    * lisp/gnus/gnus-util.el (gnus--\,@): Move macro to here...
    * lisp/gnus/gnus-art.el (gnus--\,@): .. from here.
    
    * lisp/gnus/gnus.el (gnus-method-to-server): Apply DeMorgan.
---
 lisp/gnus/gnus-art.el   |  4 ----
 lisp/gnus/gnus-topic.el | 16 ++++++++--------
 lisp/gnus/gnus-util.el  |  5 +++++
 lisp/gnus/gnus.el       |  6 +++---
 4 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 7ded9e4..c9afa3a 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -4325,10 +4325,6 @@ If variable `gnus-use-long-file-name' is non-nil, it is
   (if (gnus-buffer-live-p gnus-original-article-buffer)
       (canlock-verify gnus-original-article-buffer)))
 
-(defmacro gnus--\,@ (exp)
-  (declare (debug t))
-  `(progn ,@(eval exp t)))
-
 (gnus--\,@
  (mapcar (lambda (func)
            `(defun ,(intern (format "gnus-%s" func))
diff --git a/lisp/gnus/gnus-topic.el b/lisp/gnus/gnus-topic.el
index e7d1cf8..3253b78 100644
--- a/lisp/gnus/gnus-topic.el
+++ b/lisp/gnus/gnus-topic.el
@@ -627,7 +627,14 @@ articles in the topic and its subtopics."
 
 (defun gnus-topic-insert-topic-line (name visiblep shownp level entries
                                          &optional unread)
+  (gnus--\,@
+   (let ((vars '(indentation visible name level number-of-groups
+                 total-number-of-articles entries)))
+     `((with-suppressed-warnings ((lexical ,@vars))
+         ,@(mapcar (lambda (s) `(defvar ,s)) vars)))))
   (let* ((visible (if visiblep "" "..."))
+        (level level)
+        (name name)
         (indentation (make-string (* gnus-topic-indent-level level) ? ))
         (total-number-of-articles unread)
         (number-of-groups (length entries))
@@ -640,14 +647,7 @@ articles in the topic and its subtopics."
        (add-text-properties
         (point)
         (prog1 (1+ (point))
-          (eval gnus-topic-line-format-spec
-                 `((indentation . ,indentation)
-                   (visible . ,visible)
-                   (name . ,name)
-                   (level . ,level)
-                   (number-of-groups . ,number-of-groups)
-                   (total-number-of-articles . ,total-number-of-articles)
-                   (entries . ,entries))))
+          (eval gnus-topic-line-format-spec t))
         (list 'gnus-topic name
               'gnus-topic-level level
               'gnus-topic-unread unread
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 3c7c948..f80243c 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1068,6 +1068,11 @@ ARG is passed to the first function."
 
 ;;; Various
 
+(defmacro gnus--\,@ (exp)
+  "Splice EXP's value (a list of Lisp forms) into the code."
+  (declare (debug t))
+  `(progn ,@(eval exp t)))
+
 (defvar gnus-group-buffer)             ; Compiler directive
 (defun gnus-alive-p ()
   "Say whether Gnus is running or not."
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 98664ac..7b94c64 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -3212,9 +3212,9 @@ that that variable is buffer-local to the summary 
buffers."
                     (format "%s" (car method))
                   (format "%s:%s" (car method) (cadr method))))
           (name-method (cons name method)))
-      (when (and (not no-enter-cache)
-                (not (member name-method gnus-server-method-cache))
-                (not (assoc (car name-method) gnus-server-method-cache)))
+      (unless (or no-enter-cache
+                 (member name-method gnus-server-method-cache)
+                 (assoc (car name-method) gnus-server-method-cache))
        (push name-method gnus-server-method-cache))
       name)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]