[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 8a18bb1: Fix gnus-group.el compilation warnings abo
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 8a18bb1: Fix gnus-group.el compilation warnings about unprefixed variables |
Date: |
Sat, 13 Feb 2016 05:20:46 +0000 |
branch: master
commit 8a18bb111a0253ed0d4a92a1e16d859aad27c33e
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Fix gnus-group.el compilation warnings about unprefixed variables
* lisp/gnus/gnus-group.el (gnus-group-update-eval-form): Avoid
compilation warnings by passing in the dynamic variables as
explicit lexical parameters to `eval'.
---
lisp/gnus/gnus-group.el | 56 ++++++++++++++++------------------------------
1 files changed, 20 insertions(+), 36 deletions(-)
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 3b37f3c..2a39b88 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1612,48 +1612,32 @@ if it is a string, only list groups matching REGEXP."
(defun gnus-group-update-eval-form (group list)
"Eval `car' of each element of LIST, and return the first that return t.
Some value are bound so the form can use them."
- (defvar group-age) (defvar ticked) (defvar score) (defvar level)
- (defvar mailp) (defvar total) (defvar unread)
(when list
(let* ((entry (gnus-group-entry group))
- (unread (if (numberp (car entry)) (car entry) 0))
(active (gnus-active group))
- (total (if active (1+ (- (cdr active) (car active))) 0))
(info (nth 2 entry))
- (method (inline (gnus-server-get-method group (gnus-info-method
info))))
+ (method (inline (gnus-server-get-method
+ group (gnus-info-method info))))
(marked (gnus-info-marks info))
- (mailp (apply 'append
- (mapcar
- (lambda (x)
- (memq x (assoc (symbol-name
- (car (or method
gnus-select-method)))
- gnus-valid-select-methods)))
- '(mail post-mail))))
- (level (or (gnus-info-level info) gnus-level-killed))
- (score (or (gnus-info-score info) 0))
- (ticked (gnus-range-length (cdr (assq 'tick marked))))
- (group-age (gnus-group-timestamp-delta group)))
- ;; FIXME:
http://thread.gmane.org/gmane.emacs.gnus.general/65451/focus=65465
- ;; ======================================================================
- ;; From: Richard Stallman
- ;; Subject: Re: Rewriting gnus-group-highlight-line (was: [...])
- ;; Cc: address@hidden
- ;; Date: Sat, 27 Oct 2007 19:41:20 -0400
- ;; Message-ID: <address@hidden>
- ;;
- ;; [...]
- ;; The kludge is that the alist elements contain expressions that refer
- ;; to local variables with short names. Perhaps write your own tiny
- ;; evaluator that handles just `and', `or', and numeric comparisons
- ;; and just a few specific variables.
- ;; ======================================================================
- ;;
- ;; Similar for other evaluated variables. Grep for risky-local-variable
- ;; to find them! -- rsteib
- ;;
- ;; Eval the cars of the lists until we find a match.
+ (env
+ (list
+ (cons 'unread (if (numberp (car entry)) (car entry) 0))
+ (cons 'total (if active (1+ (- (cdr active) (car active))) 0))
+ (cons 'mailp (apply
+ 'append
+ (mapcar
+ (lambda (x)
+ (memq x (assoc
+ (symbol-name
+ (car (or method gnus-select-method)))
+ gnus-valid-select-methods)))
+ '(mail post-mail))))
+ (cons 'level (or (gnus-info-level info) gnus-level-killed))
+ (cons 'score (or (gnus-info-score info) 0))
+ (cons 'ticked (gnus-range-length (cdr (assq 'tick marked))))
+ (cons 'group-age (gnus-group-timestamp-delta group)))))
(while (and list
- (not (eval (caar list))))
+ (not (eval (caar list) env)))
(setq list (cdr list)))
list)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 8a18bb1: Fix gnus-group.el compilation warnings about unprefixed variables,
Lars Ingebrigtsen <=