2001-02-13 20:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
authorShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 14 Feb 2001 01:28:12 +0000 (01:28 +0000)
committerShengHuo ZHU <zsh@cs.rochester.edu>
Wed, 14 Feb 2001 01:28:12 +0000 (01:28 +0000)
* gnus.el (to-address): Define parameter.
(to-list): Ditto.
* gnus-art.el (article-hide-boring-headers): Use them.
* gnus-msg.el (gnus-post-news): Ditto.

2001-02-13 19:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>

* gnus-draft.el (gnus-draft-reminder): New.

* gnus-art.el (gnus-sender-save-name): New.

2001-02-13 18:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>

* mm-util.el (mm-mime-charset): Error message.

lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-cus.el
lisp/gnus-draft.el
lisp/gnus-msg.el
lisp/gnus.el
lisp/mm-util.el

index 997dd66..5295106 100644 (file)
@@ -1,3 +1,20 @@
+2001-02-13 20:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus.el (to-address): Define parameter.
+       (to-list): Ditto.
+       * gnus-art.el (article-hide-boring-headers): Use them.
+       * gnus-msg.el (gnus-post-news): Ditto.
+
+2001-02-13 19:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-draft.el (gnus-draft-reminder): New.
+
+       * gnus-art.el (gnus-sender-save-name): New.
+
+2001-02-13 18:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * mm-util.el (mm-mime-charset): Error message.
+
 2001-02-13 11:00:00  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * message.el (message-check-news-body-syntax): Don't check mml lines.
index 8c55a7a..e54e700 100644 (file)
@@ -1331,9 +1331,9 @@ always hide."
             ((eq elem 'to-address)
              (let ((to (message-fetch-field "to"))
                    (to-address
-                    (gnus-group-find-parameter
+                    (gnus-parameter-to-address
                      (if (boundp 'gnus-newsgroup-name)
-                         gnus-newsgroup-name "") 'to-address)))
+                         gnus-newsgroup-name ""))))
                (when (and to to-address
                           (ignore-errors
                             (gnus-string-equal
@@ -2761,6 +2761,15 @@ If variable `gnus-use-long-file-name' is non-nil, it is
         (expand-file-name "news" (gnus-newsgroup-directory-form newsgroup)))
        gnus-article-save-directory)))
 
+(defun gnus-sender-save-name (newsgroup headers &optional last-file)
+  "Generate file name from sender."
+  (let ((from (mail-header-from headers)))
+    (expand-file-name
+     (if (and from (string-match "\\([^ <]+\\)@" from))
+        (match-string 1 from)
+       "nobody")
+     gnus-article-save-directory)))
+
 (defun article-verify-x-pgp-sig ()
   "Verify X-PGP-Sig."
   (interactive)
index aff531b..d4268af 100644 (file)
@@ -74,36 +74,7 @@ if that value is non-nil."
 ;;; Group Customization:
 
 (defconst gnus-group-parameters
-  '((to-address (gnus-email-address :tag "To Address") "\
-This will be used when doing followups and posts.
-
-This is primarily useful in mail groups that represent closed
-mailing lists--mailing lists where it's expected that everybody that
-writes to the mailing list is subscribed to it.  Since using this
-parameter ensures that the mail only goes to the mailing list itself,
-it means that members won't receive two copies of your followups.
-
-Using `to-address' will actually work whether the group is foreign or
-not.  Let's say there's a group on the server that is called
-`fa.4ad-l'.  This is a real newsgroup, but the server has gotten the
-articles from a mail-to-news gateway.  Posting directly to this group
-is therefore impossible--you have to send mail to the mailing list
-address instead.
-
-The gnus-group-split mail splitting mechanism will behave as if this
-address was listed in gnus-group-split Addresses (see below).")
-
-    (to-list (gnus-email-address :tag "To List") "\
-This address will be used when doing a `a' in the group.
-
-It is totally ignored when doing a followup--except that if it is
-present in a news group, you'll get mail group semantics when doing
-`f'.
-
-The gnus-group-split mail splitting mechanism will behave as if this
-address was listed in gnus-group-split Addresses (see below).")
-
-    (extra-aliases (choice
+  '((extra-aliases (choice
                    :tag "Extra Aliases"
                    (list
                     :tag "List"
@@ -306,8 +277,8 @@ DOC is a documentation string for the parameter.")
                                :doc ,(nth 2 entry)
                                (const :format "" ,(nth 0 entry))
                                ,(nth 1 entry)))
-                      (append gnus-group-parameters 
-                              (reverse gnus-group-parameters-more)
+                      (append (reverse gnus-group-parameters-more)
+                              gnus-group-parameters 
                               (if group
                                   gnus-extra-group-parameters
                                 gnus-extra-topic-parameters)))))
index 020e340..5951877 100644 (file)
                         (- total (length articles)) total)))
            (gnus-draft-send article)))))))
 
+;;;###autoload
+(defun gnus-draft-reminder ()
+  "Reminder user if there are unsent drafts."
+  (interactive)
+  (if (gnus-alive-p)
+      (let (active)
+       (catch 'continue
+         (dolist (group '("nndraft:drafts" "nndraft:queue"))
+           (setq active (gnus-activate-group group))
+           (if (and active (>= (cdr active) (car active)))
+               (if (y-or-n-p "There are unsent drafts. Continue?")
+                   (throw 'continue t)
+                 (error "Stop!"))))))))
+
 ;;; Utility functions
 
 ;;;!!!If this is byte-compiled, it fails miserably.
index d5fa1a2..fc3bc6e 100644 (file)
@@ -540,9 +540,9 @@ header line with the old Message-ID."
             to-address to-group mailing-list to-list
             newsgroup-p)
        (when group
-         (setq to-address (gnus-group-find-parameter group 'to-address)
+         (setq to-address (gnus-parameter-to-address group)
                to-group (gnus-group-find-parameter group 'to-group)
-               to-list (gnus-group-find-parameter group 'to-list)
+               to-list (gnus-parameter-to-list group)
                newsgroup-p (gnus-group-find-parameter group 'newsgroup)
                mailing-list (when gnus-mailing-list-groups
                               (string-match gnus-mailing-list-groups group))
index bc9a72d..ae77353 100644 (file)
@@ -1434,6 +1434,49 @@ to be desirable; see the manual for further details."
   :type '(choice (const nil)
                 integer))
 
+(gnus-define-group-parameter
+ to-address
+ :function-document
+ "Return GROUP's to-address."
+ :variable-document
+  "*Alist of group regexps and correspondent to-addresses."
+  :parameter-type '(gnus-email-address :tag "To Address")
+  :parameter-document "\
+This will be used when doing followups and posts.
+
+This is primarily useful in mail groups that represent closed
+mailing lists--mailing lists where it's expected that everybody that
+writes to the mailing list is subscribed to it.  Since using this
+parameter ensures that the mail only goes to the mailing list itself,
+it means that members won't receive two copies of your followups.
+
+Using `to-address' will actually work whether the group is foreign or
+not.  Let's say there's a group on the server that is called
+`fa.4ad-l'.  This is a real newsgroup, but the server has gotten the
+articles from a mail-to-news gateway.  Posting directly to this group
+is therefore impossible--you have to send mail to the mailing list
+address instead.
+
+The gnus-group-split mail splitting mechanism will behave as if this
+address was listed in gnus-group-split Addresses (see below).")
+
+(gnus-define-group-parameter
+ to-list
+ :function-document
+ "Return GROUP's to-list."
+ :variable-document
+ "*Alist of group regexps and correspondent to-lists."
+ :parameter-type '(gnus-email-address :tag "To List")
+ :parameter-document "\
+This address will be used when doing a `a' in the group.
+
+It is totally ignored when doing a followup--except that if it is
+present in a news group, you'll get mail group semantics when doing
+`f'.
+
+The gnus-group-split mail splitting mechanism will behave as if this
+address was listed in gnus-group-split Addresses (see below).")
+
 (gnus-define-group-parameter
  auto-expire
  :type bool
index aefb1bb..fb5556e 100644 (file)
@@ -313,7 +313,7 @@ If the charset is `composition', return the actual one."
 (defun mm-mime-charset (charset)
   "Return the MIME charset corresponding to the MULE CHARSET."
   (if (eq charset 'unknown)
-      (error "8-bit characters are found in the message, please specify charset."))
+      (error "The message contains non-printable characters, please use attachment."))
   (if (and (fboundp 'coding-system-get) (fboundp 'get-charset-property))
       ;; This exists in Emacs 20.
       (or