]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge changes made in Gnus trunk.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sat, 11 Sep 2010 00:36:27 +0000 (00:36 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Sat, 11 Sep 2010 00:36:27 +0000 (00:36 +0000)
gnus-sum.el: Avoid calling a hook function per summary line;
Call `gnus-summary-highlight-line' directly from all places that used to call it indirectly.

netrc.el (netrc-credentials): New conveniency function.

gnus-start.el (gnus-read-active-file-1): If gnus-agent isn't set, then do request scans from the backends.

lisp/ChangeLog
lisp/gnus/ChangeLog
lisp/gnus/gnus-start.el
lisp/gnus/gnus-sum.el
lisp/net/netrc.el

index 9728bea741489df5986a03e7fe05d28c37152592..b2a63275c44fae29608519c8ba50f3d59e78932d 100644 (file)
@@ -1,3 +1,7 @@
+2010-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * net/netrc.el (netrc-credentials): New conveniency function.
+
 2010-09-10  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * textmodes/texinfo.el (texinfo-syntax-propertize-function): New fun
index afc84de020a5e51cea6e6898ecf1699de681e2bb..7dca77308285c255b3ecd30082435f2d79769419 100644 (file)
@@ -1,3 +1,14 @@
+2010-09-10  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * gnus-start.el (gnus-read-active-file-1): If gnus-agent isn't set,
+       then do request scans from the backends.
+
+       * gnus-sum.el (gnus-summary-update-hook): Change default to nil, to
+       avoid running a hook per line, since this takes a lot of time,
+       profiling shows.
+       (gnus-summary-prepare-threads): Call `gnus-summary-highlight-line'
+       directly if gnus-visual-p is true.
+
 2010-09-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-start.el (gnus-read-active-for-groups): Check only subscribed
index b2b47afe2d7869fa6398d22cb4dbef6d28286f25..1c06a774203e7bba1b12ad3bf9a32288220e2504 100644 (file)
@@ -2048,8 +2048,9 @@ If SCAN, request a scan of that group as well."
     (gnus-message 5 mesg)
     (when (gnus-check-server method)
       ;; Request that the backend scan its incoming messages.
-      (when (and gnus-agent
-                (gnus-online method)
+      (when (and (or (and gnus-agent
+                         (gnus-online method))
+                    (not gnus-agent))
                 (gnus-check-backend-function 'request-scan (car method)))
        (if infos
            (dolist (info infos)
index a99426ad83fdd323923820536437d1812ef10407..df20456b278f4aa3d312b727ed0384c1d95d04d2 100644 (file)
@@ -985,8 +985,7 @@ This hook is not called from the non-updating exit commands like `Q'."
   :group 'gnus-various
   :type 'hook)
 
-(defcustom gnus-summary-update-hook
-  (list 'gnus-summary-highlight-line)
+(defcustom gnus-summary-update-hook nil
   "*A hook called when a summary line is changed.
 The hook will not be called if `gnus-visual' is nil.
 
@@ -3753,6 +3752,7 @@ buffer that was in action when the last article was fetched."
       (error (gnus-message 5 "Error updating the summary line")))
     (when (gnus-visual-p 'summary-highlight 'highlight)
       (forward-line -1)
+      (gnus-summary-highlight-line)
       (gnus-run-hooks 'gnus-summary-update-hook)
       (forward-line 1))))
 
@@ -3785,6 +3785,7 @@ buffer that was in action when the last article was fetched."
         'score))
       ;; Do visual highlighting.
       (when (gnus-visual-p 'summary-highlight 'highlight)
+       (gnus-summary-highlight-line)
        (gnus-run-hooks 'gnus-summary-update-hook)))))
 
 (defvar gnus-tmp-new-adopts nil)
@@ -5363,7 +5364,9 @@ or a straight list of headers."
                'gnus-number number)
              (when gnus-visual-p
                (forward-line -1)
-               (gnus-run-hooks 'gnus-summary-update-hook)
+               (gnus-summary-highlight-line)
+               (when gnus-summary-update-hook
+                 (gnus-run-hooks 'gnus-summary-update-hook))
                (forward-line 1))
 
              (setq gnus-tmp-prev-subject simp-subject)))
@@ -10734,6 +10737,7 @@ If NO-EXPIRE, auto-expiry will be inhibited."
         (t gnus-no-mark))
    'replied)
   (when (gnus-visual-p 'summary-highlight 'highlight)
+    (gnus-summary-highlight-line)
     (gnus-run-hooks 'gnus-summary-update-hook))
   t)
 
index 2306927f080c1d8811874de37add6cc02e735693..408eca9bac70ed59f8edf9aea91791634c995f16 100644 (file)
  "Netrc configuration."
  :group 'comm)
 
+(defcustom netrc-file "~/.authinfo"
+  "File where user credentials are stored."
+  :type 'file
+  :group 'netrc)
+
 (defvar netrc-services-file "/etc/services"
   "The name of the services file.")
 
-(defun netrc-parse (file)
+(defun netrc-parse (&optional file)
   (interactive "fFile to Parse: ")
   "Parse FILE and return a list of all entries in the file."
+  (unless file
+    (setq file netrc-file))
   (if (listp file)
       file
     (when (file-exists-p file)
@@ -221,6 +228,19 @@ MODE can be \"login\" or \"password\", suitable for passing to
                          (eq type (car (cddr service)))))))
     (cadr service)))
 
+(defun netrc-credentials (machine &rest ports)
+  "Return a user name/password pair.
+Port specifications will be prioritised in the order they are
+listed in the PORTS list."
+  (let ((list (netrc-parse))
+       found)
+    (while (and ports
+               (not found))
+      (setq found (netrc-machine list machine (pop ports))))
+    (when found
+      (list (cdr (assoc "login" found))
+           (cdr (assoc "password" found))))))
+
 (provide 'netrc)
 
 ;;; netrc.el ends here