aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-02-12 16:23:25 +1100
committerLars Ingebrigtsen2016-02-12 16:23:25 +1100
commit303390bda34f98b400798d5383cf0d722e35ba19 (patch)
tree2d373b61346238262cdcd867f74113a72f609792
parentec9bd245eb4ebc84195f4c466bcb088068ad9de0 (diff)
downloademacs-303390bda34f98b400798d5383cf0d722e35ba19.tar.gz
emacs-303390bda34f98b400798d5383cf0d722e35ba19.zip
Avoid defvarring prefix-less variables
* lisp/gnus/gnus-group.el (gnus-group-update-eval-form): We don't need to `defvar' the short variables to allow `eval' to use them.
-rw-r--r--lisp/gnus/gnus-group.el25
1 files changed, 2 insertions, 23 deletions
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 18dd2814554..18e899b7bce 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -1612,8 +1612,6 @@ 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.
1614Some value are bound so the form can use them." 1614Some 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)) 1617 (unread (if (numberp (car entry)) (car entry) 0))
@@ -1633,25 +1631,6 @@ Some value are bound so the form can use them."
1633 (score (or (gnus-info-score info) 0)) 1631 (score (or (gnus-info-score info) 0))
1634 (ticked (gnus-range-length (cdr (assq 'tick marked)))) 1632 (ticked (gnus-range-length (cdr (assq 'tick marked))))
1635 (group-age (gnus-group-timestamp-delta group))) 1633 (group-age (gnus-group-timestamp-delta group)))
1636 ;; FIXME: http://thread.gmane.org/gmane.emacs.gnus.general/65451/focus=65465
1637 ;; ======================================================================
1638 ;; From: Richard Stallman
1639 ;; Subject: Re: Rewriting gnus-group-highlight-line (was: [...])
1640 ;; Cc: ding@gnus.org
1641 ;; Date: Sat, 27 Oct 2007 19:41:20 -0400
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 1634 (while (and list
1656 (not (eval (caar list)))) 1635 (not (eval (caar list))))
1657 (setq list (cdr list))) 1636 (setq list (cdr list)))
@@ -1662,8 +1641,8 @@ Some value are bound so the form can use them."
1662GROUP is current group, and the line to highlight starts at BEG 1641GROUP is current group, and the line to highlight starts at BEG
1663and ends at END." 1642and ends at END."
1664 (let ((face (cdar (gnus-group-update-eval-form 1643 (let ((face (cdar (gnus-group-update-eval-form
1665 group 1644 group
1666 gnus-group-highlight)))) 1645 gnus-group-highlight))))
1667 (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face)) 1646 (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face))
1668 (let ((inhibit-read-only t)) 1647 (let ((inhibit-read-only t))
1669 (gnus-put-text-property-excluding-characters-with-faces 1648 (gnus-put-text-property-excluding-characters-with-faces