From d2e2b790234a9d20132b20c173302a24f0525b1f Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Fri, 7 Nov 2003 18:40:16 +0000 Subject: [PATCH] * nnmail.el (nnmail-cache-insert): make sure that the nnmail-spool-hook is called with a valid newsgroup name (though it may be wrong) * gnus.el (gnus-group-real-prefix): return nil if group is not a string, instead of triggering an error --- lisp/ChangeLog | 9 +++++++++ lisp/gnus.el | 8 +++++--- lisp/nnmail.el | 6 ++++-- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 776f89e35..9d7c5defd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2003-11-07 Teodor Zlatanov + + * nnmail.el (nnmail-cache-insert): make sure that the + nnmail-spool-hook is called with a valid newsgroup name (though + it may be wrong) + + * gnus.el (gnus-group-real-prefix): return nil if group is not a + string, instead of triggering an error + 2003-11-06 Teodor Zlatanov * gnus.el (gnus-group-guess-full-name-from-command-method): new function diff --git a/lisp/gnus.el b/lisp/gnus.el index 03c0653dc..f452b3d13 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -3274,9 +3274,11 @@ server is native)." (defun gnus-group-real-prefix (group) "Return the prefix of the current group name." - (if (string-match "^[^:]+:" group) - (substring group 0 (match-end 0)) - "")) + (if (stringp group) + (if (string-match "^[^:]+:" group) + (substring group 0 (match-end 0)) + "") + nil)) (defun gnus-group-short-name (group) "Return the short group name." diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 7b06ec4df..f474d2496 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1497,8 +1497,10 @@ See the documentation for the variable `nnmail-split-fancy' for details." (defvar group-art) (defun nnmail-cache-insert (id grp &optional subject) (when (stringp id) - (run-hook-with-args 'nnmail-spool-hook - id grp subject) + ;; this will handle cases like `B r' where the group is nil + (let ((grp (or grp gnus-newsgroup-name "UNKNOWN"))) + (run-hook-with-args 'nnmail-spool-hook + id grp subject)) (when nnmail-treat-duplicates ;; Store some information about the group this message is written ;; to. This is passed in as the grp argument -- all locations this -- 2.34.1