*** gnus-auto-select-first can now be a function to be
called to position point.
+*** The user can now decide which extra headers should be included in
+summary buffers and NOV files.
+
+
+Sat Oct 24 20:31:55 1998 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no>
+
+ * gnus.el: Pterodactyl Gnus v0.38 is released.
+
+1998-10-24 07:54:58 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus-art.el (article-mime-decode-quoted-printable-buffer):
+ Removed.
+ (article-de-quoted-unreadable): Narrow to default.
+
+ * qp.el (quoted-printable-encode-region): Encode before QP-ing.
+
+ * gnus-art.el (article-decode-charset): Decode even when broken
+ MIME.
+
+ * gnus-sum.el (gnus-summary-from-or-to-or-newsgroups): Return
+ name.
+
+ * gnus-msg.el (gnus-copy-article-buffer): Delete headers.
+
+ * gnus-cache.el (gnus-cache-possibly-enter-article): Use
+ nnheader.
+
+ * nnmail.el (nnmail-extra-headers): New variable.
+
+ * nnheader.el (nnheader-insert-nov): Insert extra.
+
+ * gnus.el (gnus-summary-line-format): Doc fix.
+
+ * gnus-sum.el (gnus-get-newsgroup-headers): Parse extra.
+ (gnus-nov-parse-line): Ditto.
+ (gnus-nov-parse-extra): New macro.
+ (gnus-header): New function.
+ (gnus-update-summary-mark-positions): Change.
+ (gnus-ignored-from-addresses): New variable.
+ (gnus-summary-insert-from-or-to): New function.
+
+ * gnus.el (gnus-extra-headers): New variable.
+
+ * nnheader.el (make-mail-header): Expand.
+ (mail-header-extra): New macro.
+ (mail-header-set-extra): Ditto.
+ (make-full-mail-header): Expand.
+
Sat Oct 24 07:41:42 1998 Lars Magne Ingebrigtsen <larsi@menja.ifi.uio.no>
* gnus.el: Pterodactyl Gnus v0.37 is released.
(widen)
(forward-line 1)
(narrow-to-region (point) (point-max))
- (when (or (not ct)
+ (when (or (not ctl)
(equal (car ctl) "text/plain"))
(mm-decode-body
charset (and cte (intern (downcase
(and type (string-match "quoted-printable" (downcase type))))
(goto-char (point-min))
(search-forward "\n\n" nil 'move)
- (quoted-printable-decode-region (point) (point-max))
- (when mm-default-coding-system
- (mm-decode-body mm-default-coding-system))))))
-
-(defun article-mime-decode-quoted-printable-buffer ()
- "Decode Quoted-Printable in the current buffer."
- (quoted-printable-decode-region (point-min) (point-max)))
+ (save-restriction
+ (narrow-to-region (point) (point-max))
+ (quoted-printable-decode-region (point-min) (point-max))
+ (when mm-default-coding-system
+ (mm-decode-body mm-default-coding-system)))))))
(defun article-hide-pgp (&optional arg)
"Toggle hiding of any PGP headers and signatures in the current article.
(beginning-of-line))
(forward-line 1))
(beginning-of-line)
- ;; [number subject from date id references chars lines xref]
- (insert (format "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t\n"
- (mail-header-number headers)
- (mail-header-subject headers)
- (mail-header-from headers)
- (mail-header-date headers)
- (mail-header-id headers)
- (or (mail-header-references headers) "")
- (or (mail-header-chars headers) "")
- (or (mail-header-lines headers) "")
- (or (mail-header-xref headers) "")))
+ (nnheader-insert-nov headers)
;; Update the active info.
(set-buffer gnus-summary-buffer)
(gnus-cache-update-active group number)
;; Delete the headers from the displayed articles.
(set-buffer gnus-article-copy)
(delete-region (goto-char (point-min))
- (or (search-forward "\n\n" nil t) (point)))
+ (or (search-forward "\n\n" nil t) (point-max)))
;; Insert the original article headers.
(insert-buffer-substring gnus-original-article-buffer beg end)
(article-decode-encoded-words)))
(defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string
"Variable that says which function should be used to decode a string with encoded words.")
+(defcustom gnus-extra-headers nil
+ "*Extra headers to parse."
+ :group 'gnus-summary
+ :type '(repeat symbol))
+
+(defcustom gnus-ignored-from-addresses nil
+ "*Regexp of From headers that may be suppressed in favor of To headers."
+ :group 'gnus-summary
+ :type 'regexp)
+
;;; Internal variables
(defvar gnus-article-mime-handles nil)
(?l (bbb-grouplens-score gnus-tmp-header) ?s)
(?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d)
(?U gnus-tmp-unread ?c)
+ (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header) ?s)
(?t (gnus-summary-number-of-articles-in-thread
(and (boundp 'thread) (car thread)) gnus-tmp-level)
?d)
(let ((gnus-summary-line-format-spec spec)
(gnus-newsgroup-downloadable '((0 . t))))
(gnus-summary-insert-line
- [0 "" "" "" "" "" 0 0 ""] 0 nil 128 t nil "" nil 1)
+ [0 "" "" "" "" "" 0 0 "" nil] 0 nil 128 t nil "" nil 1)
(goto-char (point-min))
(setq pos (list (cons 'unread (and (search-forward "\200" nil t)
(- (point) 2)))))
(point) (progn (eval gnus-summary-dummy-line-format-spec) (point))
(list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
+(defun gnus-summary-from-or-to-or-newsgroups (header)
+ (let ((to (cdr (assq 'To (mail-header-extra header))))
+ (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header)))))
+ (cond
+ ((and to
+ gnus-ignored-from-addresses
+ (string-match gnus-ignored-from-addresses
+ (mail-header-from header)))
+ (or (car (funcall gnus-extract-address-components
+ (funcall gnus-decode-encoded-word-function to)))
+ (funcall gnus-decode-encoded-word-function to)))
+ ((and newsgroups
+ gnus-ignored-from-addresses
+ (string-match gnus-ignored-from-addresses
+ (mail-header-from header)))
+ newsgroups)
+ (t
+ (or (car (funcall gnus-extract-address-components
+ (mail-header-from header)))
+ (mail-header-from header))))))
+
(defun gnus-summary-insert-line (gnus-tmp-header
gnus-tmp-level gnus-tmp-current
gnus-tmp-unread gnus-tmp-replied
(setq heads nil)))))
gnus-newsgroup-dependencies)))
-;; The following macros and functions were written by Felix Lee
-;; <flee@cse.psu.edu>.
-
(defmacro gnus-nov-read-integer ()
'(prog1
(if (eq (char-after) ?\t)
(defmacro gnus-nov-field ()
'(buffer-substring (point) (if (gnus-nov-skip-field) (1- (point)) eol)))
+(defmacro gnus-nov-parse-extra ()
+ '(let (out string)
+ (while (not (memq (char-after) '(?\n nil)))
+ (setq string (gnus-nov-field))
+ (when (string-match "^\\([^ :]\\): " string)
+ (push (cons (intern (match-string 1))
+ (substring string (match-end 0)))
+ out)))
+ out))
+
;; This function has to be called with point after the article number
;; on the beginning of the line.
(defsubst gnus-nov-parse-line (number dependencies &optional force-new)
(gnus-nov-read-integer) ; chars
(gnus-nov-read-integer) ; lines
(unless (eq (char-after) ?\n)
- (gnus-nov-field))))) ; misc
+ (gnus-nov-field)) ; misc
+ (gnus-nov-parse-extra)))) ; extra
(widen))
(defvar gnus-tmp-root-expunged nil)
(defvar gnus-tmp-dummy-line nil)
+(defvar gnus-tmp-header)
+(defun gnus-extra-header (type &optional header)
+ "Return the extra header of TYPE."
+ (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header))))
+ ""))
+
(defun gnus-summary-prepare-threads (threads)
"Prepare summary buffer from THREADS and indentation LEVEL.
THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])'
(progn
(goto-char p)
(and (search-forward "\nxref: " nil t)
- (nnheader-header-value)))))
+ (nnheader-header-value)))
+ ;; Extra.
+ (when gnus-extra-headers
+ (let ((extra gnus-extra-headers)
+ out)
+ (while extra
+ (goto-char p)
+ (when (search-forward
+ (concat "\n" (symbol-name (car extra)) ": ") nil t)
+ (push (cons (car extra) (nnheader-header-value))
+ out))
+ (pop extra))
+ out))))
(when (equal id ref)
(setq ref nil))
:link '(custom-manual "(gnus)Exiting Gnus")
:group 'gnus)
-(defconst gnus-version-number "0.37"
+(defconst gnus-version-number "0.38"
"Version number for this version of Gnus.")
(defconst gnus-version (format "Pterodactyl Gnus v%s" gnus-version-number)
%a Extracted name of the poster (string)
%A Extracted address of the poster (string)
%F Contents of the From: header (string)
+%f Contents of the From: or To: headers (string)
%x Contents of the Xref: header (string)
%D Date of the article (string)
%d Date of the article (string) in DD-MMM format
(put 'mm-with-unibyte-buffer 'lisp-indent-function 0)
(put 'mm-with-unibyte-buffer 'edebug-form-spec '(body))
-
(provide 'mm-util)
;;; mm-util.el ends here
"Set article xref of HEADER to xref."
`(aset ,header 8 ,xref))
+(defmacro mail-header-extra (header)
+ "Return the extra headers in HEADER."
+ `(aref ,header 9))
+
+(defmacro mail-header-set-extra (header extra)
+ "Set the extra headers in HEADER to EXTRA."
+ `(aset ,header 9 ',extra))
+
(defun make-mail-header (&optional init)
"Create a new mail header structure initialized with INIT."
- (make-vector 9 init))
+ (make-vector 10 init))
(defun make-full-mail-header (&optional number subject from date id
- references chars lines xref)
+ references chars lines xref
+ extra)
"Create a new mail header structure initialized with the parameters given."
- (vector number subject from date id references chars lines xref))
+ (vector number subject from date id references chars lines xref extra))
;; fake message-ids: generation and detection
(progn
(goto-char p)
(and (search-forward "\nxref: " nil t)
- (nnheader-header-value)))))
+ (nnheader-header-value)))
+
+ ;; Extra.
+ (when gnus-extra-headers
+ (let ((extra nnmail-extra-headers)
+ out)
+ (while extra
+ (goto-char p)
+ (when (search-forward
+ (concat "\n" (symbol-name (car extra)) ": ") nil t)
+ (push (cons (car extra) (nnheader-header-value))
+ out))
+ (pop extra))
+ out))))
(when naked
(goto-char (point-min))
(delete-char 1)))))
(if (numberp num) num 0)))
(or (eobp) (forward-char 1))))
-;; (defvar nnheader-none-counter 0)
-
(defun nnheader-parse-nov ()
(let ((eol (gnus-point-at-eol)))
(vector
(insert "\t")
(princ (or (mail-header-lines header) 0) (current-buffer))
(insert "\t")
- (when (mail-header-xref header)
+ (when (or (mail-header-xref header)
+ (mail-header-extra header))
(insert "Xref: " (mail-header-xref header) "\t"))
+ (when (mail-header-extra header)
+ (let ((extra (mail-header-extra header)))
+ (while extra
+ (insert (symbol-name (caar extra))
+ ": " (cdar extra) "\t"))))
(insert "\n"))
(defun nnheader-insert-article-line (article)
(const warn)
(const delete)))
+(defcustom nnmail-extra-headers nil
+ "*Extra headers to parse."
+ :group 'nnmail
+ :type '(repeat symbol))
+
;;; Internal variables.
(defvar nnmail-split-history nil
(save-excursion
(save-restriction
(narrow-to-region from to)
+ (mm-encode-body)
(goto-char (point-min))
(while (and (skip-chars-forward
(or class "^\000-\007\013\015-\037\200-\377="))
(not (eobp)))
(insert
(prog1
- (upcase (format "=%x" (char-after (point))))
+ (upcase (format "=%x" (char-after)))
(delete-char 1))))
(when fold
;; Fold long lines.
(defun quoted-printable-encode-string (string)
"QP-encode STRING and return the results."
- (with-temp-buffer
+ (mm-with-unibyte-buffer
(insert string)
(quoted-printable-encode-region (point-min) (point-max))
(buffer-string)))
+1998-10-24 08:37:12 Lars Magne Ingebrigtsen <larsi@gnus.org>
+
+ * gnus.texi (Summary Buffer Lines): Addition.
+ (To): New.
+ (To): Addition.
+
1998-10-15 18:15:34 Simon Josefsson <jas@pdc.kth.se>
* gnus.texi (Group Info): Must be list of ranges.
\input texinfo @c -*-texinfo-*-
@setfilename gnus
-@settitle Pterodactyl Gnus 0.37 Manual
+@settitle Pterodactyl Gnus 0.38 Manual
@synindex fn cp
@synindex vr cp
@synindex pg cp
@tex
@titlepage
-@title Pterodactyl Gnus 0.37 Manual
+@title Pterodactyl Gnus 0.38 Manual
@author by Lars Magne Ingebrigtsen
@page
spool or your mbox file. All at the same time, if you want to push your
luck.
-This manual corresponds to Pterodactyl Gnus 0.37.
+This manual corresponds to Pterodactyl Gnus 0.38.
@end ifinfo
@menu
* Summary Buffer Lines:: You can specify how summary lines should look.
+* To From Newsgroups:: How to not display your own name.
* Summary Buffer Mode Line:: You can say how the mode line should look.
* Summary Highlighting:: Making the summary buffer all pretty and nice.
@end menu
Full @code{From} header.
@item n
The name (from the @code{From} header).
+@item f
+The name, code @code{To} header or the @code{Newsgroups} header
+(@pxref{To From Newsgroups}).
@item a
The name (from the @code{From} header). This differs from the @code{n}
spec in that it uses the function designated by the
This restriction may disappear in later versions of Gnus.
+@node To From Newsgroups
+@subsection To From Newsgroups
+@cindex To
+@cindex Newsgroups
+
+In some groups (particularly in archive groups), the @code{From} header
+isn't very interesting, since all the articles there are written by
+you. To display the information in the @code{To} or @code{Newsgroups}
+headers instead, you need to decide three things: What information to
+gather; where to display it; and when to display it.
+
+@enumerate
+@item
+@vindex gnus-extra-headers
+The reading of extra header information is controlled by the
+@code{gnus-extra-headers}. This is a list of header symbols. For
+instance:
+
+@lisp
+(setq gnus-extra-headers
+ '(To Newsgroups X-Newsreader))
+@end lisp
+
+This will result in Gnus trying to obtain these three headers, and
+storing it in header structures for later easy retrieval.
+
+@item
+@findex gnus-extra-header
+The value of these extra headers can be accessed via the
+@code{gnus-extra-header} function. Here's a format line spec that will
+access the @code{X-Newsreader} header:
+
+@example
+"%~(form (gnus-extra-header 'X-Newsreader))@@"
+@end example
+
+@item
+@vindex gnus-ignored-from-addresses
+The @code{gnus-ignored-from-addresses} variable says when the @samp{%f}
+summary line spec returns the @code{To}, @code{Newsreader} or
+@code{From} header. If this regexp matches the contents of the
+@code{From} header, the value of the @code{To} or @code{Newsreader}
+headers are used instead.
+
+@end enumerate
+
+@vindex nnmail-extra-headers
+A related variable is @code{nnmail-extra-headers}, which controls when
+to include extra headers when generating active files.
+
+In summary, you'd typically do something like the following:
+
+@lisp
+(setq gnus-extra-headers
+ '(To Newsgroups))
+(setq nnmail-extra-headers gnus-extra-headers)
+(setq gnus-summary-line-format
+ "%U%R%z%I%(%[%4L: %-20,20f%]%) %s\n")
+(setq gnus-ignored-from-addresses
+ "Your Name Here")
+@end lisp
+
+
@node Summary Buffer Mode Line
@subsection Summary Buffer Mode Line
\input texinfo @c -*-texinfo-*-
@setfilename message
-@settitle Pterodactyl Message 0.37 Manual
+@settitle Pterodactyl Message 0.38 Manual
@synindex fn cp
@synindex vr cp
@synindex pg cp
@tex
@titlepage
-@title Pterodactyl Message 0.37 Manual
+@title Pterodactyl Message 0.38 Manual
@author by Lars Magne Ingebrigtsen
@page
* Key Index:: List of Message mode keys.
@end menu
-This manual corresponds to Pterodactyl Message 0.37. Message is
+This manual corresponds to Pterodactyl Message 0.38. Message is
distributed with the Gnus distribution bearing the same version number
as this manual.