From 15ce422f787ae21ac521392cd246ed9267b85733 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 25 Oct 2005 23:24:39 +0000 Subject: [PATCH] Synch to No Gnus 200510251928. --- lisp/ChangeLog | 21 ++++++++ lisp/encrypt.el | 8 +-- lisp/gnus-fun.el | 44 +++++++++++---- lisp/gnus-score.el | 21 +++++--- lisp/mm-uu.el | 81 +++++++++++++++++++++------- texi/ChangeLog | 5 ++ texi/gnus-coding.texi | 141 +++++++++++++++++++++++++++++++++++++++++++++---- 7 files changed, 272 insertions(+), 49 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index dcd219d..5a6771a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,24 @@ +2005-10-25 Reiner Steib + + * gnus-score.el (gnus-default-adaptive-score-alist): Set defaults + depending on gnus-score-decay-constant. + + * encrypt.el (encrypt-insert-file-contents) + (encrypt-write-file-contents): Don't use `gnus-message'. + + * mm-uu.el (mm-uu-verbatim-marks-extract): Add four start and end + arguments. + (mm-uu-type-alist): Add message-marks and insert-marks. Pass + arguments to mm-uu-verbatim-marks-extract. + (mm-uu-hide-markers): New variable. + (mm-uu-extract): Use face similar to `gnus-cite-3'. + + * gnus-fun.el (gnus-convert-image-to-x-face-command) + (gnus-convert-image-to-face-command): Use "convert" by default to + allow other input image formats. + (gnus-x-face-from-file, gnus-face-from-file): Adjust doc strings + accordingly. + 2005-10-23 Simon Josefsson * imap.el (imap-gssapi-program): Align command line parameters diff --git a/lisp/encrypt.el b/lisp/encrypt.el index 8bf13c2..9e1bd05 100644 --- a/lisp/encrypt.el +++ b/lisp/encrypt.el @@ -131,8 +131,8 @@ Format example: (if outdata (progn - (gnus-message 9 "%s was decrypted with %s (cipher %s)" - file (symbol-name method) cipher) + (message "%s was decrypted with %s (cipher %s)" + file (symbol-name method) cipher) (delete-region (point-min) (point-max)) (goto-char (point-min)) (insert outdata)) @@ -177,8 +177,8 @@ Format example: (if outdata (progn - (gnus-message 9 "%s was encrypted with %s (cipher %s)" - file (symbol-name method) cipher) + (message "%s was encrypted with %s (cipher %s)" + file (symbol-name method) cipher) (delete-region (point-min) (point-max)) (goto-char (point-min)) (insert outdata) diff --git a/lisp/gnus-fun.el b/lisp/gnus-fun.el index 52eba30..8073c57 100644 --- a/lisp/gnus-fun.el +++ b/lisp/gnus-fun.el @@ -45,21 +45,37 @@ :group 'gnus-fun :type 'string) -(defcustom gnus-convert-image-to-x-face-command "giftopnm %s | ppmnorm | pnmscale -width 48 -height 48 | ppmtopgm | pgmtopbm | pbmtoxbm | compface" +(defcustom gnus-convert-image-to-x-face-command + "convert -scale 48x48! %s xbm:- | xbm2xface.pl" "Command for converting an image to an X-Face. +The command must take a image filename (use \"%s\") as input. +The output must be the Face header data on stdout in PNG format. + By default it takes a GIF filename and output the X-Face header data on stdout." :version "22.1" :group 'gnus-fun - :type 'string) - -(defcustom gnus-convert-image-to-face-command "djpeg %s | ppmnorm | pnmscale -width 48 -height 48 | ppmquant %d | pnmtopng" + :type '(choice (const :tag "giftopnm, netpbm (GIF input only)" + "giftopnm %s | ppmnorm | pnmscale -width 48 -height 48 | ppmtopgm | pgmtopbm | pbmtoxbm | compface") + (const :tag "convert" + "convert -scale 48x48! %s xbm:- | xbm2xface.pl") + (string))) + +(defcustom gnus-convert-image-to-face-command + "convert -scale 48x48! %s -colors %d png:-" "Command for converting an image to a Face. -By default it takes a JPEG filename and output the Face header data -on stdout." + +The command must take an image filename (first format +argument\"%s\") and the number of colors (second format argument: +\"%d\") as input. The output must be the Face header data on +stdout in PNG format." :version "22.1" :group 'gnus-fun - :type 'string) + :type '(choice (const :tag "djpeg, netpbm (JPG input only)" + "djpeg %s | ppmnorm | pnmscale -width 48 -height 48 | ppmquant %d | pnmtopng") + (const :tag "convert" + "convert -scale 48x48! %s -colors %d png:-") + (string))) (defcustom gnus-face-properties-alist (if (featurep 'xemacs) '((xface . (:face gnus-x-face))) @@ -125,8 +141,11 @@ Output to the current buffer, replace text, and don't mingle error." ;;;###autoload (defun gnus-x-face-from-file (file) - "Insert an X-Face header based on an image file." - (interactive "fImage file name (by default GIF): ") + "Insert an X-Face header based on an image file. + +Depending on `gnus-convert-image-to-x-face-command' it may accept +different input formats." + (interactive "fImage file name: ") (when (file-exists-p file) (gnus-shell-command-to-string (format gnus-convert-image-to-x-face-command @@ -134,8 +153,11 @@ Output to the current buffer, replace text, and don't mingle error." ;;;###autoload (defun gnus-face-from-file (file) - "Return a Face header based on an image file." - (interactive "fImage file name (by default JPEG): ") + "Return a Face header based on an image file. + +Depending on `gnus-convert-image-to-face-command' it may accept +different input formats." + (interactive "fImage file name: ") (when (file-exists-p file) (let ((done nil) (attempt "") diff --git a/lisp/gnus-score.el b/lisp/gnus-score.el index 47bb7c0..ae1a689 100644 --- a/lisp/gnus-score.el +++ b/lisp/gnus-score.el @@ -225,13 +225,22 @@ This variable allows the same syntax as `gnus-home-score-file'." (function :value fun))) (defcustom gnus-default-adaptive-score-alist - '((gnus-kill-file-mark) + `((gnus-kill-file-mark) (gnus-unread-mark) - (gnus-read-mark (from 3) (subject 30)) - (gnus-catchup-mark (subject -10)) - (gnus-killed-mark (from -1) (subject -20)) - (gnus-del-mark (from -2) (subject -15))) - "*Alist of marks and scores." + (gnus-read-mark + (from , (+ 2 gnus-score-decay-constant)) + (subject , (+ 27 gnus-score-decay-constant))) + (gnus-catchup-mark + (subject , (+ -7 (* -1 gnus-score-decay-constant)))) + (gnus-killed-mark + (from , (- -1 gnus-score-decay-constant)) + (subject , (+ -17 (* -1 gnus-score-decay-constant)))) + (gnus-del-mark + (from , (- -1 gnus-score-decay-constant)) + (subject , (+ -12 (* -1 gnus-score-decay-constant))))) + "Alist of marks and scores. +If you use score decays, you might want to set values higher than +`gnus-score-decay-constant'." :group 'gnus-score-adapt :type '(repeat (cons (symbol :tag "Mark") (repeat (list (choice :tag "Header" diff --git a/lisp/mm-uu.el b/lisp/mm-uu.el index 3194846..e0bcaf2 100644 --- a/lisp/mm-uu.el +++ b/lisp/mm-uu.el @@ -97,7 +97,7 @@ This can be either \"inline\" or \"attachment\".") :group 'gnus-article-mime) (defvar mm-uu-type-alist - '((postscript + `((postscript "^%!PS-" "^%%EOF$" mm-uu-postscript-extract @@ -164,12 +164,24 @@ This can be either \"inline\" or \"attachment\".") mm-uu-diff-extract nil mm-uu-diff-test) + (message-marks + ,(concat "^" (regexp-quote message-mark-insert-begin)) + ,(concat "^" (regexp-quote message-mark-insert-end)) + (lambda () (mm-uu-verbatim-marks-extract 0 -1 1 -2)) + nil) + ;; Omitting [a-z8<] leads to false positives (bogus signature separators + ;; and mailing list banners). + (insert-marks + "^ *\\(-\\|_\\)\\{30,\\}.*[a-z8<].*\\(-\\|_\\)\\{30,\\} *$" + "^ *\\(-\\|_\\)\\{30,\\}.*[a-z8<].*\\(-\\|_\\)\\{30,\\} *$" + (lambda () (mm-uu-verbatim-marks-extract 0 0 1 -1)) + nil) (verbatim-marks ;; slrn-style verbatim marks, see ;; http://www.slrn.org/manual/slrn-manual-6.html#ss6.81 "^#v\\+" "^#v\\-$" - mm-uu-verbatim-marks-extract + (lambda () (mm-uu-verbatim-marks-extract 0 0 1 -1)) nil) (LaTeX "^\\\\documentclass" @@ -217,15 +229,33 @@ To disable dissecting shar codes, for instance, add (defsubst mm-uu-function-2 (entry) (nth 5 entry)) -(defface mm-uu-extract - '((((class color) - (background dark)) - (:background "gray5")) - (((class color) - (background light)) - (:background "gray95")) - (t - ())) +;; In Emacs 22, we could use `min-colors' in the face definition. But Emacs +;; 21 and XEmacs don't support it. +(defcustom mm-uu-hide-markers + (< 16 (or (and (fboundp 'defined-colors) + (length (defined-colors))) + (and (fboundp (device-color-cells)) + (length (device-color-cells))) + 0)) + "If non-nil, hide verbatim markers. +The value should be nil on displays where the face +`mm-uu-extract' isn't distinguishable to the face `default'." + :type '(choice (const :tag "Hide" t) + (const :tag "Don't hide" nil)) + :version "23.0" ;; No Gnus + :group 'gnus-article-mime) + +(defface mm-uu-extract '(;; Colors from `gnus-cite-3' plus background: + (((class color) + (background dark)) + (:foreground "light yellow" + :background "dark green")) + (((class color) + (background light)) + (:foreground "dark green" + :background "light yellow")) + (t + ())) "Face for extracted buffers." ;; See `mm-uu-verbatim-marks-extract'. :version "23.0" ;; No Gnus @@ -306,13 +336,28 @@ apply the face `mm-uu-extract'." (mm-make-handle (mm-uu-copy-to-buffer start-point end-point) '("application/postscript"))) -(defun mm-uu-verbatim-marks-extract () - (mm-make-handle - (mm-uu-copy-to-buffer - (progn (goto-char start-point) (forward-line) (point)) - (progn (goto-char end-point) (forward-line -1) (point)) - t) - '("text/x-verbatim" (charset . gnus-decoded)))) +(defun mm-uu-verbatim-marks-extract (start-offset end-offset + &optional + start-hide + end-hide) + (let ((start (or (and mm-uu-hide-markers + start-hide) + start-offset + 1)) + (end (or (and mm-uu-hide-markers + end-hide) + end-offset + -1))) + (mm-make-handle + (mm-uu-copy-to-buffer + (progn (goto-char start-point) + (forward-line start) + (point)) + (progn (goto-char end-point) + (forward-line end) + (point)) + t) + '("text/x-verbatim" (charset . gnus-decoded))))) (defun mm-uu-latex-extract () (mm-make-handle diff --git a/texi/ChangeLog b/texi/ChangeLog index 170a503..83ed853 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2005-10-25 Reiner Steib + + * gnus-coding.texi (Dependencies): Add some text. + (Dependencies): Update encrypt.el. + 2005-10-17 Katsumi Yamaoka * gnus.texi (Document Groups): Remove duplicate item. diff --git a/texi/gnus-coding.texi b/texi/gnus-coding.texi index 124a3ba..9871f90 100644 --- a/texi/gnus-coding.texi +++ b/texi/gnus-coding.texi @@ -7,7 +7,7 @@ @syncodeindex pg cp @copying -Copyright (c) 2004 Free Software Foundation, Inc. +Copyright (c) 2004, 2005 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -33,7 +33,7 @@ license to the document, as described in section 6 of the license. @titlepage @title Gnus Coding Style and Maintainance Guide -@c @author by Reiner Steib +@author by Reiner Steib @insertcopying @end titlepage @@ -44,21 +44,140 @@ license to the document, as described in section 6 of the license. @node Top -@section Gnus Coding Style -@subsection Dependencies +@chapter Gnus Coding Style +@section Dependencies + +The Gnus distribution contains a lot of libraries that have been written +for Gnus and used intensively for Gnus. But many of those libraries are +useful on their own. E.g. other Emacs Lisp packages might use the +@acronym{MIME} library @xref{Top, ,Top, emacs-mime, The Emacs MIME +Manual}. + +@subsection General purpose libraries + +@table @file + +@item netrc.el +@file{.netrc} parsing functionality. +@c As of 2005-10-21... +There are no Gnus dependencies in this file. + +@item format-spec.el +Functions for formatting arbitrary formatting strings. +@c As of 2005-10-21... +There are no Gnus dependencies in this file. + +@end table + +@subsection Encryption and security + +@table @file +@item encrypt.el +File encryption routines +@c As of 2005-10-25... +There are no Gnus dependencies in this file. + +@item password.el +Read passwords from user, possibly using a password cache. +@c As of 2005-10-21... +There are no Gnus dependencies in this file. + +@item tls.el +TLS/SSL support via wrapper around GnuTLS +@c As of 2005-10-21... +There are no Gnus dependencies in this file. + +@item pgg*.el +Glue for the various PGP implementations. +@c As of 2005-10-21... +There are no Gnus dependencies in these files. + +@end table + +@subsection Networking + +@table @file +@item dig.el +Domain Name System dig interface. +@c As of 2005-10-21... +There are no serious Gnus dependencies in this file. Uses +@code{gnus-run-mode-hooks} (a wrapper function). + +@item dns*.el +Domain Name Service lookups. +@c As of 2005-10-21... +There are no Gnus dependencies in these files. +@end table + +@subsection Mail and News related RFCs + +@table @file +@item pop3.el +Post Office Protocol (RFC 1460) interface. +@c As of 2005-10-21... +There are no Gnus dependencies in this file. + +@item imap.el +@acronym{IMAP} library. +@c As of 2005-10-21... +There are no Gnus dependencies in this file. + +@item ietf-drums.el +Functions for parsing RFC822bis headers. +@c As of 2005-10-21... +There are no Gnus dependencies in this file. + +@item rfc1843.el +HZ (rfc1843) decoding. HZ is a data format for exchanging files of +arbitrarily mixed Chinese and @acronym{ASCII} characters. +@c As of 2005-10-21... +@code{rfc1843-gnus-setup} seem to be useful only for Gnus. Maybe this +function should be relocated to remove dependencies on Gnus. Other +minor dependencies: @code{gnus-newsgroup-name} could be eliminated by +using an optional argument to @code{rfc1843-decode-article-body}. + +@item rfc2045.el +Functions for decoding rfc2045 headers + +@item rfc2047.el +Functions for encoding and decoding rfc2047 messages + +@item rfc2104.el +RFC2104 Hashed Message Authentication Codes + +@item rfc2231.el +Functions for decoding rfc2231 headers +@end table + +@subsection message + +All message composition from Gnus (both mail and news) takes place in +Message mode buffers. Message mode is intended to be a replacement for +Emacs mail mode. There should be no Gnus dependencies in +@file{message.el}. + +@subsection Gnus backends + +The files @file{nn*.el} provide functionality for accessing NNTP +(@file{nntp.el}), IMAP (@file{nnimap.el}) and several other Mail back +ends (probably @file{nnml.el}, @file{nnfolder.el} and +@file{nnmaildir.el} are the ones most widely used mail back ends). + @c message / gnus @c @c nn* @c @c mm* -@c +@c @c rfc* @c +@c pgg* @c tla netrc pop3 dig dns ... @c format-spec.el -@subsection Compatibility + +@section Compatibility @c Compatibility with XEmacs and older Emacs versions in v5-10 and in the @c trunk. @@ -67,9 +186,9 @@ license to the document, as described in section 6 of the license. @c x @c @end table -@section Gnus Maintainance Guide +@chapter Gnus Maintainance Guide -@subsection Stable and development versions +@section Stable and development versions The CVS trunk is developed quite actively. @@ -79,7 +198,7 @@ The CVS trunk is developed quite actively. @c e.g. 5.10.1 -@subsection Syncing +@section Syncing @c Some MIDs related to this follow. Use http://thread.gmane.org/MID @c (and click on the subject) to get the thread on Gmane. @@ -151,7 +270,9 @@ can be easily resolved automatically (sometimes I notice silly things in such multiple commits, like whitespace differences, and unify those ;-). -@subsection Miscellanea +@section Miscellanea + +@heading @file{GNUS-NEWS} Starting from No Gnus, the @file{GNUS-NEWS} is created from @file{texi/gnus-news.texi}. Don't edit @file{GNUS-NEWS}. Edit -- 1.7.10.4