From 4997c10ff13e32fb66d004a28f2e0f52170be6f3 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 9 Jun 2003 03:01:03 +0000 Subject: [PATCH] Synch to Gnus 200306082217. --- lisp/ChangeLog | 41 ++++++++++++++++++++++ lisp/gnus-group.el | 36 +++++++++---------- lisp/gnus-registry.el | 5 ++- lisp/gnus-srvr.el | 55 +++++++++++++++++++----------- lisp/message.el | 91 ++++++++++++++++++++++++++++++++++--------------- lisp/nnmail.el | 5 +-- texi/ChangeLog | 6 ++++ texi/gnus.texi | 16 ++++----- 8 files changed, 177 insertions(+), 78 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fb99781..c21cf43 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,44 @@ +2003-06-08 Jesper Harder + + * message.el (message-beginning-of-line): Docstring improvement. + Suggested by Michael R. Wolf + +2003-06-07 Lars Magne Ingebrigtsen + + * gnus-sum.el (gnus-summary-make-menu-bar): Removed ["Add buttons" + gnus-summary-display-buttonized t] + +2003-06-07 Kai Gro,A_(Bjohann + + * nnmail.el (nnmail-split-fancy-match-partial-words): Doc string + fix. Reported by Johan Bockg,Ae(Brd . + +2003-06-07 Jesper Harder + + * message.el (message-beginning-of-line): Docstring improvement. + +2003-06-06 Jesper Harder + + * gnus-srvr.el (gnus-browse-foreign-server): Parse garbage NNTP + groups correctly. + +2003-06-06 Kai Gro,A_(Bjohann + From Benjamin Rutt . + + * message.el (message-fetch-field): Augment documentation to state + the narrowed-to-headers restriction. + (message-change-subject, message-reduce-to-to-cc) + (message-generate-unsubscribed-mail-followup-to) + (message-insert-importance-high, message-insert-importance-low) + (message-insert-or-toggle-importance) + (message-insert-disposition-notification-to): Narrow to headers + before calling message-fetch-field or message-remove-header. + +2003-06-06 Teodor Zlatanov + + * gnus-registry.el (gnus-registry-trim): fix for when + gnus-registry-max-entries is nil + 2003-06-05 Lars Magne Ingebrigtsen * qp.el (quoted-printable-decode-region): Don't error out on diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index a3ca7cf..ca1bbac 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -3276,26 +3276,22 @@ Uses the process/prefix convention." "Toggle subscription of the current group. If given numerical prefix, toggle the N next groups." (interactive "P") - (let ((groups (gnus-group-process-prefix n)) - group) - (while groups - (setq group (car groups) - groups (cdr groups)) - (gnus-group-remove-mark group) - (gnus-group-unsubscribe-group - group - (cond - ((eq do-sub 'unsubscribe) - gnus-level-default-unsubscribed) - ((eq do-sub 'subscribe) - gnus-level-default-subscribed) - ((<= (gnus-group-group-level) gnus-level-subscribed) - gnus-level-default-unsubscribed) - (t - gnus-level-default-subscribed)) - t) - (gnus-group-update-group-line)) - (gnus-group-next-group 1))) + (dolist (group (gnus-group-process-prefix n)) + (gnus-group-remove-mark group) + (gnus-group-unsubscribe-group + group + (cond + ((eq do-sub 'unsubscribe) + gnus-level-default-unsubscribed) + ((eq do-sub 'subscribe) + gnus-level-default-subscribed) + ((<= (gnus-group-group-level) gnus-level-subscribed) + gnus-level-default-unsubscribed) + (t + gnus-level-default-subscribed)) + t) + (gnus-group-update-group-line)) + (gnus-group-next-group 1)) (defun gnus-group-unsubscribe-group (group &optional level silent) "Toggle subscription to GROUP. diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el index 54756a1..b2a66c2 100644 --- a/lisp/gnus-registry.el +++ b/lisp/gnus-registry.el @@ -179,7 +179,9 @@ The group names are matched, they don't have to be fully qualified." (defun gnus-registry-trim (alist) "Trim alist to size, using gnus-registry-max-entries." - (unless (null gnus-registry-max-entries) + (if (null gnus-registry-max-entries) + alist ; just return the alist + ;; else, when given max-entries, trim the alist (let ((timehash (make-hash-table :size 4096 :test 'equal))) @@ -188,6 +190,7 @@ The group names are matched, they don't have to be fully qualified." (puthash key (gnus-registry-fetch-extra key 'mtime) timehash)) gnus-registry-hashtb) + ;; we use the return value of this setq, which is the trimmed alist (setq alist (nthcdr (- (length alist) gnus-registry-max-entries) diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index c759d19..f50e39a 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -713,31 +713,46 @@ The following commands are available: 1 "Couldn't request list: %s" (gnus-status-message method)) nil) (t - (save-excursion - (set-buffer nntp-server-buffer) + (with-current-buffer nntp-server-buffer (let ((cur (current-buffer))) (goto-char (point-min)) (unless (string= gnus-ignored-newsgroups "") (delete-matching-lines gnus-ignored-newsgroups)) - (while (not (eobp)) - (ignore-errors - (push (cons - (if (eq (char-after) ?\") - (read cur) - (let ((p (point)) (name "")) - (skip-chars-forward "^ \t\\\\") - (setq name (buffer-substring p (point))) - (while (eq (char-after) ?\\) - (setq p (1+ (point))) - (forward-char 2) + ;; We treat NNTP as a special case to avoid problems with + ;; garbage group names like `"foo' that appear in some badly + ;; managed active files. -jh. + (if (eq (car method) 'nntp) + (while (not (eobp)) + (ignore-errors + (push (cons + (buffer-substring + (point) + (progn + (skip-chars-forward "^ \t") + (point))) + (let ((last (read cur))) + (cons (read cur) last))) + groups)) + (forward-line)) + (while (not (eobp)) + (ignore-errors + (push (cons + (if (eq (char-after) ?\") + (read cur) + (let ((p (point)) (name "")) (skip-chars-forward "^ \t\\\\") - (setq name (concat name (buffer-substring - p (point))))) - name)) - (let ((last (read cur))) - (cons (read cur) last))) - groups)) - (forward-line)))) + (setq name (buffer-substring p (point))) + (while (eq (char-after) ?\\) + (setq p (1+ (point))) + (forward-char 2) + (skip-chars-forward "^ \t\\\\") + (setq name (concat name (buffer-substring + p (point))))) + name)) + (let ((last (read cur))) + (cons (read cur) last))) + groups)) + (forward-line))))) (setq groups (sort groups (lambda (l1 l2) (string< (car l1) (car l2))))) diff --git a/lisp/message.el b/lisp/message.el index 431da3f..ff8da24 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1775,8 +1775,8 @@ is used by default." (defun message-fetch-field (header &optional not-all) "The same as `mail-fetch-field', only remove all newlines. -Note that the buffer should be narrowed to the headers; see -function `message-narrow-to-headers-or-head'." +The buffer is expected to be narrowed to just the header of the message; +see `message-narrow-to-headers-or-head'." (let* ((inhibit-point-motion-hooks t) (case-fold-search t) (value (mail-fetch-field header nil (not not-all)))) @@ -1902,7 +1902,10 @@ Leading \"Re: \" is not stripped by this function. Use the function (zerop (string-width new-subject)) (string-match "^[ \t]*$" new-subject)))) (save-excursion - (let ((old-subject (message-fetch-field "Subject"))) + (let ((old-subject + (save-restriction + (message-narrow-to-headers) + (message-fetch-field "Subject")))) (cond ((not old-subject) (error "No current subject")) ((not (string-match @@ -2088,19 +2091,26 @@ With prefix-argument just set Follow-Up, don't cross-post." (defun message-reduce-to-to-cc () "Replace contents of To: header with contents of Cc: or Bcc: header." (interactive) - (let ((cc-content (message-fetch-field "cc")) + (let ((cc-content + (save-restriction (message-narrow-to-headers) + (message-fetch-field "cc"))) (bcc nil)) (if (and (not cc-content) - (setq cc-content (message-fetch-field "bcc"))) + (setq cc-content + (save-restriction + (message-narrow-to-headers) + (message-fetch-field "bcc")))) (setq bcc t)) (cond (cc-content (save-excursion (message-goto-to) (message-delete-line) (insert (concat "To: " cc-content "\n")) - (message-remove-header (if bcc - "bcc" - "cc"))))))) + (save-restriction + (message-narrow-to-headers) + (message-remove-header (if bcc + "bcc" + "cc")))))))) ;;; End of functions adopted from `message-utils.el'. @@ -2781,11 +2791,14 @@ If the optional argument INCLUDE-CC is non-nil, the addresses in the Cc: header are also put into the MFT." (interactive "P") - (message-remove-header "Mail-Followup-To") - (let* ((cc (and include-cc (message-fetch-field "Cc"))) - (tos (if cc - (concat (message-fetch-field "To") "," cc) - (message-fetch-field "To")))) + (let* (cc tos) + (save-restriction + (message-narrow-to-headers) + (message-remove-header "Mail-Followup-To") + (setq cc (and include-cc (message-fetch-field "Cc"))) + (setq tos (if cc + (concat (message-fetch-field "To") "," cc) + (message-fetch-field "To")))) (message-goto-mail-followup-to) (insert (concat tos ", " user-mail-address)))) @@ -3050,7 +3063,9 @@ Prefix arg means justify as well." "Insert header to mark message as important." (interactive) (save-excursion - (message-remove-header "Importance") + (save-restriction + (message-narrow-to-headers) + (message-remove-header "Importance")) (message-goto-eoh) (insert "Importance: high\n"))) @@ -3058,7 +3073,9 @@ Prefix arg means justify as well." "Insert header to mark message as unimportant." (interactive) (save-excursion - (message-remove-header "Importance") + (save-restriction + (message-narrow-to-headers) + (message-remove-header "Importance")) (message-goto-eoh) (insert "Importance: low\n"))) @@ -3071,14 +3088,16 @@ and `low'." (let ((valid '("high" "normal" "low")) (new "high") cur) - (when (setq cur (message-fetch-field "Importance")) - (message-remove-header "Importance") - (setq new (cond ((string= cur "high") - "low") - ((string= cur "low") - "normal") - (t - "high")))) + (save-restriction + (message-narrow-to-headers) + (when (setq cur (message-fetch-field "Importance")) + (message-remove-header "Importance") + (setq new (cond ((string= cur "high") + "low") + ((string= cur "low") + "normal") + (t + "high"))))) (message-goto-eoh) (insert (format "Importance: %s\n" new))))) @@ -3087,10 +3106,16 @@ and `low'." Note that this should not be used in newsgroups." (interactive) (save-excursion - (message-remove-header "Disposition-Notification-To") + (save-restriction + (message-narrow-to-headers) + (message-remove-header "Disposition-Notification-To")) (message-goto-eoh) (insert (format "Disposition-Notification-To: %s\n" - (or (message-fetch-field "From") (message-make-from)))))) + (or (save-excursion + (save-restriction + (message-narrow-to-headers) + (message-fetch-field "From"))) + (message-make-from)))))) (defun message-elide-region (b e) "Elide the text in the region. @@ -5694,12 +5719,24 @@ than 988 characters long, and if they are not, trim them until they are." (sit-for 0))) (defcustom message-beginning-of-line t - "Whether C-a goes to beginning of header values." + "Whether \\\\[message-beginning-of-line]\ + goes to beginning of header values." :group 'message-buffers :type 'boolean) (defun message-beginning-of-line (&optional n) - "Move point to beginning of header value or to beginning of line." + "Move point to beginning of header value or to beginning of line. +The prefix argument N is passed directly to `beginning-of-line'. + +This command is identical to `beginning-of-line' if point is +outside the message header or if the option `message-beginning-of-line' +is nil. + +If point is in the message header and on a (non-continued) header +line, move point to the beginning of the header value. If point +is already there, move point to beginning of line. Therefore, +repeated calls will toggle point between beginning of field and +beginning of line." (interactive "p") (let ((zrs 'zmacs-region-stays)) (when (and (interactive-p) (boundp zrs)) diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 2312d2c..843892e 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -505,8 +505,9 @@ parameter. It should return nil, `warn' or `delete'." (defcustom nnmail-split-fancy-match-partial-words nil "Whether to match partial words when fancy splitting. Normally, regexes given in `nnmail-split-fancy' are implicitly surrounded -by \"\\<...\\>\". If this is true, they are not implicitly surrounded by -anything." +by \"\\=\\<...\\>\". If this variable is true, they are not implicitly\ + surrounded +by anything." :group 'nnmail :type 'boolean) diff --git a/texi/ChangeLog b/texi/ChangeLog index 8adec4b..6a92352 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,9 @@ +2003-06-07 Jesper Harder + + * gnus.texi (Article Buttons, Splitting in IMAP) + (Category Syntax, Picons): Preemptive strike by + alt.possesive.its.has.no.apostrophe. + 2003-06-03 Jesper Harder * gnus.texi (Fancy Mail Splitting): Explain some entries in diff --git a/texi/gnus.texi b/texi/gnus.texi index 7f14c45..295a979 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -8763,17 +8763,17 @@ message ID or a mail address. If it is one of the symbols @code{mid} or @code{mail}, Gnus will always assume that the string is a message ID or a mail address, respectively. If this variable is set to the symbol @code{ask}, always query the user what do do. If it is a function, this -function will be called with the string as it's only argument. The +function will be called with the string as its only argument. The function must return @code{mid}, @code{mail}, @code{invalid} or @code{ask}. The default value is the function @code{gnus-button-mid-or-mail-heuristic}. @item gnus-button-mid-or-mail-heuristic @findex gnus-button-mid-or-mail-heuristic -Function that guesses whether it's argument is a message ID or a mail -address. Returns @code{mid} it's a message IDs, @code{mail} if it's a -mail address, @code{ask} if unsure and @code{invalid} if the string is -invalid. +Function that guesses whether its argument is a message ID or a mail +address. Returns @code{mid} if it's a message IDs, @code{mail} if +it's a mail address, @code{ask} if unsure and @code{invalid} if the +string is invalid. @item gnus-button-mid-or-mail-heuristic-alist @vindex gnus-button-mid-or-mail-heuristic-alist @@ -16065,7 +16065,7 @@ Splitting is something Gnus users has loved and used for years, and now the rest of the world is catching up. Yeah, dream on, not many @acronym{IMAP} server has server side splitting and those that have splitting seem to use some non-standard protocol. This means that @acronym{IMAP} -support for Gnus has to do it's own splitting. +support for Gnus has to do its own splitting. And it does. @@ -17597,7 +17597,7 @@ just don't give a damn. The above predicates apply to @emph{all} the groups which belong to the category. However, if you wish to have a specific predicate for an individual group within a category, or you're just too lazy to set up a -new category, you can enter a group's individual predicate in it's group +new category, you can enter a group's individual predicate in its group parameters like so: @lisp @@ -21597,7 +21597,7 @@ taken advantage of that. @end iftex So@dots{} You want to slow down your news reader even more! This is a -good way to do so. Its also a great way to impress people staring +good way to do so. It's also a great way to impress people staring over your shoulder as you read news. What are Picons? To quote directly from the Picons Web site: -- 1.7.10.4