* 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 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.
((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
(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)
;;; 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"
: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)))))
(- 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.
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))
: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
(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