]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/nnmail.el
Display non-ASCII group names better in prompts
[gnu-emacs] / lisp / gnus / nnmail.el
index d1a0455a1b04eb0504354abfc0eec4c17a922c53..3d4178d1022478d50979bd254d4e1db197f09c25 100644 (file)
@@ -1,6 +1,6 @@
 ;;; nnmail.el --- mail support functions for the Gnus mail backends
 
 ;;; nnmail.el --- mail support functions for the Gnus mail backends
 
-;; Copyright (C) 1995-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1995-2016 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: news, mail
@@ -36,8 +36,7 @@
 
 (autoload 'gnus-add-buffer "gnus")
 (autoload 'gnus-kill-buffer "gnus")
 
 (autoload 'gnus-add-buffer "gnus")
 (autoload 'gnus-kill-buffer "gnus")
-(eval-when-compile
-  (autoload 'mail-send-and-exit "sendmail" nil t))
+(autoload 'mail-send-and-exit "sendmail" nil t)
 
 (defgroup nnmail nil
   "Reading mail with Gnus."
 
 (defgroup nnmail nil
   "Reading mail with Gnus."
@@ -84,7 +83,7 @@ If you'd like, for instance, one mail group for mail from the
 else, you could do something like this:
 
  (setq nnmail-split-methods
 else, you could do something like this:
 
  (setq nnmail-split-methods
-       '((\"mail.4ad\" \"From:.*4ad\")
+       \\='((\"mail.4ad\" \"From:.*4ad\")
         (\"mail.junk\" \"From:.*Lars\\\\|Subject:.*buy\")
         (\"mail.misc\" \"\")))
 
         (\"mail.junk\" \"From:.*Lars\\\\|Subject:.*buy\")
         (\"mail.misc\" \"\")))
 
@@ -181,7 +180,7 @@ E.g.:
       (lambda (newsgroup)
        (cond ((string-match \"private\" newsgroup) 31)
              ((string-match \"junk\" newsgroup) 1)
       (lambda (newsgroup)
        (cond ((string-match \"private\" newsgroup) 31)
              ((string-match \"junk\" newsgroup) 1)
-             ((string-match \"important\" newsgroup) 'never)
+             ((string-match \"important\" newsgroup) \\='never)
              (t 7))))"
   :group 'nnmail-expire
   :type '(choice (const :tag "nnmail-expiry-wait" nil)
              (t 7))))"
   :group 'nnmail-expire
   :type '(choice (const :tag "nnmail-expiry-wait" nil)
@@ -218,7 +217,7 @@ will try to match against both the From and the To header.
 Example:
 
 \(setq nnmail-fancy-expiry-targets
 Example:
 
 \(setq nnmail-fancy-expiry-targets
-      '((to-from \"boss\" \"nnfolder:Work\")
+      \\='((to-from \"boss\" \"nnfolder:Work\")
        (\"Subject\" \"IMPORTANT\" \"nnfolder:IMPORTANT.%Y.%b\")
        (\"from\" \".*\" \"nnfolder:Archive-%Y\")))
 
        (\"Subject\" \"IMPORTANT\" \"nnfolder:IMPORTANT.%Y.%b\")
        (\"from\" \".*\" \"nnfolder:Archive-%Y\")))
 
@@ -289,7 +288,7 @@ running (\"xwatch\", etc.)
 
 E.g.:
 
 
 E.g.:
 
-\(add-hook 'nnmail-read-incoming-hook
+\(add-hook \\='nnmail-read-incoming-hook
          (lambda ()
            (call-process \"/local/bin/mailsend\" nil nil nil
                          \"read\"
          (lambda ()
            (call-process \"/local/bin/mailsend\" nil nil nil
                          \"read\"
@@ -302,11 +301,11 @@ read.
 
 If you use `display-time', you could use something like this:
 
 
 If you use `display-time', you could use something like this:
 
-\(add-hook 'nnmail-read-incoming-hook
+\(add-hook \\='nnmail-read-incoming-hook
          (lambda ()
            ;; Update the displayed time, since that will clear out
            ;; the flag that says you have mail.
          (lambda ()
            ;; Update the displayed time, since that will clear out
            ;; the flag that says you have mail.
-           (when (eq (process-status \"display-time\") 'run)
+           (when (eq (process-status \"display-time\") \\='run)
              (display-time-filter display-time-process \"\"))))"
   :group 'nnmail-prepare
   :type 'hook)
              (display-time-filter display-time-process \"\"))))"
   :group 'nnmail-prepare
   :type 'hook)
@@ -466,7 +465,7 @@ GROUP: Mail will be stored in GROUP (a string).
 junk: Mail will be deleted.  Use with care!  Do not submerge in water!
   Example:
   (setq nnmail-split-fancy
 junk: Mail will be deleted.  Use with care!  Do not submerge in water!
   Example:
   (setq nnmail-split-fancy
-       '(| (\"Subject\" \"MAKE MONEY FAST\" junk)
+       \\='(| (\"Subject\" \"MAKE MONEY FAST\" junk)
            ...other.rules.omitted...))
 
 FIELD must match a complete field name.  VALUE must match a complete
            ...other.rules.omitted...))
 
 FIELD must match a complete field name.  VALUE must match a complete
@@ -481,12 +480,12 @@ GROUP can contain \\& and \\N which will substitute from matching
 
 Example:
 
 
 Example:
 
-\(setq nnmail-split-methods 'nnmail-split-fancy
+\(setq nnmail-split-methods \\='nnmail-split-fancy
       nnmail-split-fancy
       ;; Messages from the mailer daemon are not crossposted to any of
       ;; the ordinary groups.  Warnings are put in a separate group
       ;; from real errors.
       nnmail-split-fancy
       ;; Messages from the mailer daemon are not crossposted to any of
       ;; the ordinary groups.  Warnings are put in a separate group
       ;; from real errors.
-      '(| (\"from\" mail (| (\"subject\" \"warn.*\" \"mail.warning\")
+      \\='(| (\"from\" mail (| (\"subject\" \"warn.*\" \"mail.warning\")
                          \"mail.misc\"))
          ;; Non-error messages are crossposted to all relevant
          ;; groups, but we don't crosspost between the group for the
                          \"mail.misc\"))
          ;; Non-error messages are crossposted to all relevant
          ;; groups, but we don't crosspost between the group for the
@@ -1793,6 +1792,12 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
   "Read new incoming mail."
   (nnmail-get-new-mail-1 method exit-func temp group nil spool-func))
 
   "Read new incoming mail."
   (nnmail-get-new-mail-1 method exit-func temp group nil spool-func))
 
+(defun nnmail-get-new-mail-per-group ()
+  "Tell us whether the mail-sources specify that `nnmail-get-new-mail' should
+be called once per group or once for all groups."
+  (or (assq 'group mail-sources)
+      (assq 'directory mail-sources)))
+
 (defun nnmail-get-new-mail-1 (method exit-func temp
                              group in-group spool-func)
   (let* ((sources mail-sources)
 (defun nnmail-get-new-mail-1 (method exit-func temp
                              group in-group spool-func)
   (let* ((sources mail-sources)
@@ -1805,7 +1810,8 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details."
               sources)
       (while (setq source (pop sources))
        ;; Use group's parameter
               sources)
       (while (setq source (pop sources))
        ;; Use group's parameter
-       (when (eq (car source) 'group)
+       (when (and (eq (car source) 'group)
+                  group)
          (let ((mail-sources
                 (list
                  (gnus-group-find-parameter
          (let ((mail-sources
                 (list
                  (gnus-group-find-parameter
@@ -1921,7 +1927,7 @@ If TIME is nil, then return the cutoff time for oldness instead."
     (when (functionp target)
       (setq target (funcall target group)))
     (unless (eq target 'delete)
     (when (functionp target)
       (setq target (funcall target group)))
     (unless (eq target 'delete)
-      (when (or (gnus-request-group target)
+      (when (or (gnus-request-group target nil nil (gnus-get-info target))
                (gnus-request-create-group target))
        (let ((group-art (gnus-request-accept-article target nil nil t)))
          (when (and (consp group-art)
                (gnus-request-create-group target))
        (let ((group-art (gnus-request-accept-article target nil nil t)))
          (when (and (consp group-art)