diff options
| author | Lars Ingebrigtsen | 2016-02-13 16:20:34 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-13 16:20:34 +1100 |
| commit | 8a18bb111a0253ed0d4a92a1e16d859aad27c33e (patch) | |
| tree | f3136622644046a71f937739c12aa12c0d61adff | |
| parent | b806a0556b3c3cef8254492de2ccb7d2d9d1618d (diff) | |
| download | emacs-8a18bb111a0253ed0d4a92a1e16d859aad27c33e.tar.gz emacs-8a18bb111a0253ed0d4a92a1e16d859aad27c33e.zip | |
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'.
| -rw-r--r-- | 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 3b37f3c27ca..2a39b88f303 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." | |||
| 1612 | (defun gnus-group-update-eval-form (group list) | 1612 | (defun gnus-group-update-eval-form (group list) |
| 1613 | "Eval `car' of each element of LIST, and return the first that return t. | 1613 | "Eval `car' of each element of LIST, and return the first that return t. |
| 1614 | Some value are bound so the form can use them." | 1614 | Some value are bound so the form can use them." |
| 1615 | (defvar group-age) (defvar ticked) (defvar score) (defvar level) | ||
| 1616 | (defvar mailp) (defvar total) (defvar unread) | ||
| 1617 | (when list | 1615 | (when list |
| 1618 | (let* ((entry (gnus-group-entry group)) | 1616 | (let* ((entry (gnus-group-entry group)) |
| 1619 | (unread (if (numberp (car entry)) (car entry) 0)) | ||
| 1620 | (active (gnus-active group)) | 1617 | (active (gnus-active group)) |
| 1621 | (total (if active (1+ (- (cdr active) (car active))) 0)) | ||
| 1622 | (info (nth 2 entry)) | 1618 | (info (nth 2 entry)) |
| 1623 | (method (inline (gnus-server-get-method group (gnus-info-method info)))) | 1619 | (method (inline (gnus-server-get-method |
| 1620 | group (gnus-info-method info)))) | ||
| 1624 | (marked (gnus-info-marks info)) | 1621 | (marked (gnus-info-marks info)) |
| 1625 | (mailp (apply 'append | 1622 | (env |
| 1626 | (mapcar | 1623 | (list |
| 1627 | (lambda (x) | 1624 | (cons 'unread (if (numberp (car entry)) (car entry) 0)) |
| 1628 | (memq x (assoc (symbol-name | 1625 | (cons 'total (if active (1+ (- (cdr active) (car active))) 0)) |
| 1629 | (car (or method gnus-select-method))) | 1626 | (cons 'mailp (apply |
| 1630 | gnus-valid-select-methods))) | 1627 | 'append |
| 1631 | '(mail post-mail)))) | 1628 | (mapcar |
| 1632 | (level (or (gnus-info-level info) gnus-level-killed)) | 1629 | (lambda (x) |
| 1633 | (score (or (gnus-info-score info) 0)) | 1630 | (memq x (assoc |
| 1634 | (ticked (gnus-range-length (cdr (assq 'tick marked)))) | 1631 | (symbol-name |
| 1635 | (group-age (gnus-group-timestamp-delta group))) | 1632 | (car (or method gnus-select-method))) |
| 1636 | ;; FIXME: http://thread.gmane.org/gmane.emacs.gnus.general/65451/focus=65465 | 1633 | gnus-valid-select-methods))) |
| 1637 | ;; ====================================================================== | 1634 | '(mail post-mail)))) |
| 1638 | ;; From: Richard Stallman | 1635 | (cons 'level (or (gnus-info-level info) gnus-level-killed)) |
| 1639 | ;; Subject: Re: Rewriting gnus-group-highlight-line (was: [...]) | 1636 | (cons 'score (or (gnus-info-score info) 0)) |
| 1640 | ;; Cc: ding@gnus.org | 1637 | (cons 'ticked (gnus-range-length (cdr (assq 'tick marked)))) |
| 1641 | ;; Date: Sat, 27 Oct 2007 19:41:20 -0400 | 1638 | (cons 'group-age (gnus-group-timestamp-delta group))))) |
| 1642 | ;; Message-ID: <E1IlvHM-0006TS-7t@fencepost.gnu.org> | ||
| 1643 | ;; | ||
| 1644 | ;; [...] | ||
| 1645 | ;; The kludge is that the alist elements contain expressions that refer | ||
| 1646 | ;; to local variables with short names. Perhaps write your own tiny | ||
| 1647 | ;; evaluator that handles just `and', `or', and numeric comparisons | ||
| 1648 | ;; and just a few specific variables. | ||
| 1649 | ;; ====================================================================== | ||
| 1650 | ;; | ||
| 1651 | ;; Similar for other evaluated variables. Grep for risky-local-variable | ||
| 1652 | ;; to find them! -- rsteib | ||
| 1653 | ;; | ||
| 1654 | ;; Eval the cars of the lists until we find a match. | ||
| 1655 | (while (and list | 1639 | (while (and list |
| 1656 | (not (eval (caar list)))) | 1640 | (not (eval (caar list) env))) |
| 1657 | (setq list (cdr list))) | 1641 | (setq list (cdr list))) |
| 1658 | list))) | 1642 | list))) |
| 1659 | 1643 | ||