From 3741231d043e26592ad7731a1dbeaf6296e73988 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 30 Apr 2002 05:00:22 +0000 Subject: [PATCH] Synch with Oort Gnus. --- ChangeLog | 14 ++++ aclocal.m4 | 25 +++++- configure | 46 +++++++---- configure.in | 1 + lisp/ChangeLog | 79 +++++++++++++++++++ lisp/dns.el | 95 ++++++++++++----------- lisp/gnus-art.el | 2 +- lisp/gnus-msg.el | 8 +- lisp/gnus.el | 8 +- lisp/imap.el | 14 ++++ lisp/mm-decode.el | 17 ++-- lisp/mm-url.el | 14 +++- lisp/nnheader.el | 12 +++ lisp/nnimap.el | 86 +++++++++++++++++---- lisp/nnkiboze.el | 210 +++++++++++++++++++++++++------------------------- lisp/nnmail.el | 6 +- texi/ChangeLog | 12 +++ texi/Makefile.in | 2 +- texi/emacs-mime.texi | 14 ++-- texi/gnus-ja.texi | 34 +++++--- texi/gnus.texi | 30 +++++--- 21 files changed, 494 insertions(+), 235 deletions(-) diff --git a/ChangeLog b/ChangeLog index a0c7c66..129c065 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2002-04-30 Katsumi Yamaoka + + * lisp/nnheader.el (nnheader-with-unibyte): New macro. + (mm-with-unibyte): Alias to `nnheader-with-unibyte'. + +2002-04-26 Steve Youngs + + * aclocal.m4 (AC_PATH_INFODIR): New. Defaults to '$prefix/info' + for Emacs and 'site-packages/info' for XEmacs. + (AC_PATH_ETCDIR): Drop 'gnus' off the end of the default directory + for XEmacs. + + * configure.in: Use 'AC_PATH_INFO_DIR'. + 2002-04-23 Daiki Ueno * lisp/gnus-bbdb.el (gnus-bbdb/update-record): Disregard the diff --git a/aclocal.m4 b/aclocal.m4 index c3a9953..fd52950 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -125,9 +125,9 @@ AC_DEFUN(AC_PATH_ETCDIR, [ AC_ARG_WITH(etcdir,[ --with-etcdir=DIR Where to install etc files], etcdir=${withval}) AC_MSG_CHECKING([where etc files should go]) if test -z "$etcdir"; then - dnl Set default value + dnl Set default value. if test "$EMACS_FLAVOR" = "xemacs"; then - etcdir="\$(lispdir)/../etc/gnus" + etcdir="\$(lispdir)/../../etc" else etcdir="\$(lispdir)/../etc" fi @@ -136,6 +136,27 @@ AC_DEFUN(AC_PATH_ETCDIR, [ AC_SUBST(etcdir) ]) +dnl +dnl This is a bit on the "evil hack" side of things. It is so we can +dnl have a different default infodir for XEmacs. A user can still specify +dnl someplace else with '--infodir=DIR'. +dnl +AC_DEFUN(AC_PATH_INFO_DIR, [ + AC_MSG_CHECKING([where the TeXinfo docs should go]) + dnl Set default value. This must be an absolute path. + if test "$infodir" = "\${prefix}/info"; then + if test "$EMACS_FLAVOR" = "xemacs"; then + info_dir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/info" + else + info_dir="\$(prefix)/info" + fi + else + info_dir=$infodir + fi + AC_MSG_RESULT($info_dir) + AC_SUBST(info_dir) +]) + dnl dnl Check whether a function exists in a library dnl All '_' characters in the first argument are converted to '-' diff --git a/configure b/configure index 1c99a8d..92de619 100755 --- a/configure +++ b/configure @@ -1003,7 +1003,7 @@ fi echo "configure:1004: checking where etc files should go" >&5 if test -z "$etcdir"; then if test "$EMACS_FLAVOR" = "xemacs"; then - etcdir="\$(lispdir)/../etc/gnus" + etcdir="\$(lispdir)/../../etc" else etcdir="\$(lispdir)/../etc" fi @@ -1012,8 +1012,23 @@ echo "configure:1004: checking where etc files should go" >&5 + echo $ac_n "checking where the TeXinfo docs should go""... $ac_c" 1>&6 +echo "configure:1017: checking where the TeXinfo docs should go" >&5 + if test "$infodir" = "\${prefix}/info"; then + if test "$EMACS_FLAVOR" = "xemacs"; then + info_dir="\$(prefix)/${thedir}/${EMACS_FLAVOR}/site-packages/info" + else + info_dir="\$(prefix)/info" + fi + else + info_dir=$infodir + fi + echo "$ac_t""$info_dir" 1>&6 + + + echo $ac_n "checking for acceptable URL version""... $ac_c" 1>&6 -echo "configure:1017: checking for acceptable URL version" >&5 +echo "configure:1032: checking for acceptable URL version" >&5 unset EMACS_cv_ACCEPTABLE_URL; unset EMACS_cv_SYS_url_dir; @@ -1026,14 +1041,14 @@ else if test -z ""noecho""; then echo $ac_n "checking for url-retrieve in url""... $ac_c" 1>&6 -echo "configure:1030: checking for url-retrieve in url" >&5 +echo "configure:1045: checking for url-retrieve in url" >&5 fi library=`echo url | tr _ -` elisp="(progn (fmakunbound (quote url-retrieve)) (condition-case nil (progn (require (quote $library)) (fboundp (quote url-retrieve))) (error (prog1 nil (message \"$library not found\")))))" if test -z ""noecho""; then echo $ac_n "checking for url""... $ac_c" 1>&6 -echo "configure:1037: checking for url" >&5 +echo "configure:1052: checking for url" >&5 fi if eval "test \"\${EMACS_cv_SYS_url+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1077,7 +1092,7 @@ if test "${EMACS_cv_ACCEPTABLE_URL}" = yes; then elisp="(file-name-directory (locate-library \"url\"))" if test -z ""noecho""; then echo $ac_n "checking for url_dir""... $ac_c" 1>&6 -echo "configure:1081: checking for url_dir" >&5 +echo "configure:1096: checking for url_dir" >&5 fi if eval "test \"\${EMACS_cv_SYS_url_dir+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1119,7 +1134,7 @@ fi echo $ac_n "checking for acceptable W3 version""... $ac_c" 1>&6 -echo "configure:1123: checking for acceptable W3 version" >&5 +echo "configure:1138: checking for acceptable W3 version" >&5 unset EMACS_cv_ACCEPTABLE_W3; unset EMACS_cv_SYS_w3_dir; @@ -1132,14 +1147,14 @@ else if test -z ""noecho""; then echo $ac_n "checking for w3-form-encode-xwfu in w3_forms""... $ac_c" 1>&6 -echo "configure:1136: checking for w3-form-encode-xwfu in w3_forms" >&5 +echo "configure:1151: checking for w3-form-encode-xwfu in w3_forms" >&5 fi library=`echo w3_forms | tr _ -` elisp="(progn (fmakunbound (quote w3-form-encode-xwfu)) (condition-case nil (progn (require (quote $library)) (fboundp (quote w3-form-encode-xwfu))) (error (prog1 nil (message \"$library not found\")))))" if test -z ""noecho""; then echo $ac_n "checking for w3_forms""... $ac_c" 1>&6 -echo "configure:1143: checking for w3_forms" >&5 +echo "configure:1158: checking for w3_forms" >&5 fi if eval "test \"\${EMACS_cv_SYS_w3_forms+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1183,7 +1198,7 @@ if test "${EMACS_cv_ACCEPTABLE_W3}" = yes; then elisp="(file-name-directory (locate-library \"w3-forms\"))" if test -z ""noecho""; then echo $ac_n "checking for w3_dir""... $ac_c" 1>&6 -echo "configure:1187: checking for w3_dir" >&5 +echo "configure:1202: checking for w3_dir" >&5 fi if eval "test \"\${EMACS_cv_SYS_w3_dir+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1230,7 +1245,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1234: checking for $ac_word" >&5 +echo "configure:1249: checking for $ac_word" >&5 if eval "test \"\${ac_cv_path_LATEX+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1267,7 +1282,7 @@ done test -n "$LATEX" || LATEX="no" echo $ac_n "checking for available fonts""... $ac_c" 1>&6 -echo "configure:1271: checking for available fonts" >&5 +echo "configure:1286: checking for available fonts" >&5 # Check whether --with-fonts or --without-fonts was given. if test "${with_fonts+set}" = set; then withval="$with_fonts" @@ -1355,7 +1370,7 @@ fi if test ${EMACS_FLAVOR} = xemacs; then echo $ac_n "checking where the XEmacs package is""... $ac_c" 1>&6 -echo "configure:1359: checking where the XEmacs package is" >&5 +echo "configure:1374: checking where the XEmacs package is" >&5 # Check whether --with-packagedir or --without-packagedir was given. if test "${with_packagedir+set}" = set; then withval="$with_packagedir" @@ -1378,7 +1393,7 @@ elisp="(let (package-dir)\ (or package-dir \"\"))" if test -z ""noecho""; then echo $ac_n "checking for PACKAGEDIR""... $ac_c" 1>&6 -echo "configure:1382: checking for PACKAGEDIR" >&5 +echo "configure:1397: checking for PACKAGEDIR" >&5 fi if eval "test \"\${EMACS_cv_SYS_PACKAGEDIR+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1417,7 +1432,7 @@ elisp="(let (package-dir)\ (or package-dir \"\"))" if test -z ""noecho""; then echo $ac_n "checking for PACKAGEDIR""... $ac_c" 1>&6 -echo "configure:1421: checking for PACKAGEDIR" >&5 +echo "configure:1436: checking for PACKAGEDIR" >&5 fi if eval "test \"\${EMACS_cv_SYS_PACKAGEDIR+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1454,7 +1469,7 @@ if test "${with_addpath+set}" = set; then withval="$with_addpath" if test "$withval" != yes -a -n "$withval"; then echo $ac_n "checking where to find the additional elisp libraries""... $ac_c" 1>&6 -echo "configure:1458: checking where to find the additional elisp libraries" >&5 +echo "configure:1473: checking where to find the additional elisp libraries" >&5 ADDITIONAL_LOAD_PATH=$withval echo "$ac_t""$ADDITIONAL_LOAD_PATH" 1>&6 fi @@ -1619,6 +1634,7 @@ s%@EMACS@%$EMACS%g s%@XEMACS@%$XEMACS%g s%@lispdir@%$lispdir%g s%@etcdir@%$etcdir%g +s%@info_dir@%$info_dir%g s%@HAVE_url@%$HAVE_url%g s%@URL@%$URL%g s%@HAVE_w3_forms@%$HAVE_w3_forms%g diff --git a/configure.in b/configure.in index a2afd77..18dfdb1 100644 --- a/configure.in +++ b/configure.in @@ -6,6 +6,7 @@ AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, no) AC_CHECK_EMACS AC_PATH_LISPDIR AC_PATH_ETCDIR +AC_PATH_INFO_DIR AC_CHECK_URL AC_CHECK_W3 GNUS_CHECK_FONTS diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0432dfe..282531f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,82 @@ +2002-04-29 Simon Josefsson + + * nnmail.el (nnmail-cache-insert): Accept optional group + parameter. + + * nnimap.el (nnimap-retrieve-groups): Don't send STATUS when + n-r-g-a is disabled. + +2002-04-29 Simon Josefsson + + * nnimap.el (nnimap-split-fancy): Fix doc. + (nnimap-split-fancy): Fix doc. + + * nnimap.el (nnimap-retrieve-groups-asynchronous): New variable. + (nnimap-mailbox-info): New internal variable. + (nnimap-retrieve-groups): Implement faster new mail check. + + * nnimap.el (nnimap-split-articles): Support + nnmail-cache-accepted-message-ids. + (nnimap-request-accept-article): Ditto. + + * imap.el (imap-mailbox-status-asynch): New command. + +2002-04-29 Nevin Kapur + + * gnus.el (gnus-find-subscribed-addresses): Return nil when there + are no subscribed mail groups. + - Strip quoted names when comparing addresses + +2002-04-28 Jesper Harder + + * mm-decode.el (mm-text-html-renderer): Change customize type to + const. + + * gnus-msg.el (gnus-discouraged-post-methods): Fix typo. + (gnus-debug-exclude-variables): do. + +2002-04-27 ShengHuo ZHU + + * gnus-msg.el (gnus-article-mail): Use gnus-msg-mail instead. + Trivial change from Karl Pfl,Ad(Bsterer . + +2002-04-27 Katsumi Yamaoka + + * dns.el (dns-make-network-process): New macro. + (query-dns): Use it. + +2002-04-27 ShengHuo ZHU + + * gnus-msg.el (gnus-summary-reply): Remove unbound variable + article-buffer. + + * mm-url.el (mm-url-package-name): New variable. + (mm-url-package-version): New variable. + (mm-url-insert-file-contents): Bind url-package-name and + url-package-version here. + * nnrss.el (nnrss-insert-w3): Move the bindings. + + * nnrss.el (nnrss-insert-w3): Bind url-package-name and + url-package-version. Trivial change from Andrew J Cosgriff + + + * mm-decode.el (mm-save-part): Fill in file name when GUI saving + attachments. Trivial change from Peter 'Luna' Runestig + . + +2002-04-19 Jesper Harder + + * nnkiboze.el (nnkiboze-request-scan): Call + nnkiboze-possibly-change-group. + (nnkiboze-generate-group): Use mm-with-unibyte to avoid encoding + problems. + (nnkiboze-generate-group): Set newsrc to the *highest* article + number kibozed, not the lowest. + +2002-04-15 Jesper Harder + + * gnus-art.el (article-unsplit-urls): Allow trailing SPC. + 2002-04-24 Kai Gro,A_(Bjohann From Dan Christensen . diff --git a/lisp/dns.el b/lisp/dns.el index c35300e..475909a 100644 --- a/lisp/dns.el +++ b/lisp/dns.el @@ -280,6 +280,24 @@ If TCP-P, the first two bytes of the package with be the length field." ;;; Interface functions. +(defmacro dns-make-network-process (server) + (if (featurep 'xemacs) + `(let ((coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (open-network-stream "dns" (current-buffer) ,server "domain" 'udp)) + `(let ((server ,server) + (coding-system-for-read 'binary) + (coding-system-for-write 'binary)) + (if (fboundp 'make-network-process) + (make-network-process + :name "dns" + :coding 'binary + :buffer (current-buffer) + :host server + :service "domain" + :type 'datagram) + (open-network-stream "dns" (current-buffer) server "domain"))))) + (defun query-dns (name &optional type fullp) "Query a DNS server for NAME of TYPE. If FULLP, return the entire record returned." @@ -289,53 +307,36 @@ If FULLP, return the entire record returned." (unless dns-servers (error "No DNS server configuration found"))) (mm-with-unibyte-buffer - (let ((coding-system-for-read 'binary) - (coding-system-for-write 'binary) - (tcp-p (and (not (fboundp 'open-network-stream)) - (not (featurep 'xemacs))))) - (let ((process - (cond - ((featurep 'xemacs) - (open-network-stream - "dns" (current-buffer) (car dns-servers) "domain" 'udp)) - (tcp-p - (open-network-stream - "dns" (current-buffer) (car dns-servers) "domain")) - (t - (make-network-process - :name "dns" - :coding 'binary - :buffer (current-buffer) - :host (car dns-servers) - :service "domain" - :type 'datagram)))) - (step 100) - (times (* dns-timeout 1000)) - (id (random 65000))) - (process-send-string - process - (dns-write `((id ,id) - (opcode query) - (queries ((,name (type ,type)))) - (recursion-desired-p t)) - tcp-p)) - (while (and (zerop (buffer-size)) - (> times 0)) - (accept-process-output process 0 step) - (decf times step)) - (ignore-errors - (delete-process process)) - (when tcp-p - (goto-char (point-min)) - (delete-region (point) (+ (point) 2))) - (unless (zerop (buffer-size)) - (let ((result (dns-read (buffer-string)))) - (if fullp - result - (let ((answer (car (dns-get 'answers result)))) - (when (eq type (dns-get 'type answer)) - (dns-get 'data answer)))))))))) - + (let ((process (dns-make-network-process (car dns-servers))) + (tcp-p (and (not (fboundp 'make-network-process)) + (not (featurep 'xemacs)))) + (step 100) + (times (* dns-timeout 1000)) + (id (random 65000))) + (process-send-string + process + (dns-write `((id ,id) + (opcode query) + (queries ((,name (type ,type)))) + (recursion-desired-p t)) + tcp-p)) + (while (and (zerop (buffer-size)) + (> times 0)) + (accept-process-output process 0 step) + (decf times step)) + (ignore-errors + (delete-process process)) + (when tcp-p + (goto-char (point-min)) + (delete-region (point) (+ (point) 2))) + (unless (zerop (buffer-size)) + (let ((result (dns-read (buffer-string)))) + (if fullp + result + (let ((answer (car (dns-get 'answers result)))) + (when (eq type (dns-get 'type answer)) + (dns-get 'data answer))))))))) + (provide 'dns) ;;; dns.el ends here diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index f11b514..a6295d9 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -2296,7 +2296,7 @@ If READ-CHARSET, ask for a coding system." (let ((buffer-read-only nil)) (goto-char (point-min)) (while (re-search-forward - "^\\(\\(https?\\|ftp\\)://\\S-+\\)\n\\(\\S-+\\)" nil t) + "^\\(\\(https?\\|ftp\\)://\\S-+\\) *\n\\(\\S-+\\)" nil t) (replace-match "\\1\\3" t))))) (defun article-wash-html (&optional read-charset) diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index a8851a1..60752ad 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -216,7 +216,7 @@ use this option with care." "Variables that should not be reported in `gnus-bug'." :version "21.1" :group 'gnus-message - :type '(repeat (symbol :tab "Variable"))) + :type '(repeat (symbol :tag "Variable"))) (defcustom gnus-discouraged-post-methods '(nndraft nnml nnimap nnmaildir nnmh nnfolder nndir) @@ -224,7 +224,7 @@ use this option with care." This variable is used only when `gnus-post-method' is `current'." :version "21.3" :group 'gnus-group-foreign - :type '(repeat (symbol :tab "Back end"))) + :type '(repeat (symbol :tag "Back end"))) (defcustom gnus-message-replysign nil @@ -1125,7 +1125,7 @@ If VERY-WIDE, make a very wide reply." ;; (when (or gnus-message-replysign gnus-message-replyencrypt) ;; (let (signed encrypted) ;; (save-excursion -;; (set-buffer (or gnus-article-buffer article-buffer)) +;; (set-buffer gnus-article-buffer) ;; (setq signed (memq 'signed gnus-article-wash-types)) ;; (setq encrypted (memq 'encrypted gnus-article-wash-types))) ;; (cond ((and gnus-message-replysign signed) @@ -1479,7 +1479,7 @@ If YANK is non-nil, include the original article." (save-excursion (re-search-backward "[ \t\n]" nil t) (1+ (point))) (save-excursion (re-search-forward "[ \t\n]" nil t) (1- (point)))))) (when address - (message-reply address) + (gnus-msg-mail address) (when yank (gnus-inews-yank-articles (list (cdr gnus-article-current))))))) diff --git a/lisp/gnus.el b/lisp/gnus.el index 2833e5a..8d323f7 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -2521,11 +2521,13 @@ with a `subscribed' parameter." (dolist (entry (cdr gnus-newsrc-alist)) (setq group (car entry)) (when (gnus-group-find-parameter group 'subscribed) - (setq address (or (gnus-group-fast-parameter group 'to-address) - (gnus-group-fast-parameter group 'to-list))) + (setq address (mail-strip-quoted-names + (or (gnus-group-fast-parameter group 'to-address) + (gnus-group-fast-parameter group 'to-list)))) (when address (push address addresses)))) - (list (mapconcat 'regexp-quote addresses "\\|")))) + (when addresses + (list (mapconcat 'regexp-quote addresses "\\|"))))) (defmacro gnus-string-or (&rest strings) "Return the first element of STRINGS that is a non-blank string. diff --git a/lisp/imap.el b/lisp/imap.el index 68ada30..c1485d8 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -1309,6 +1309,20 @@ returned, if ITEMS is a symbol only it's value is returned." items) (imap-mailbox-get items mailbox))))) +(defun imap-mailbox-status-asynch (mailbox items &optional buffer) + "Send status item request ITEM on MAILBOX to server in BUFFER. +ITEMS can be a symbol or a list of symbols, valid symbols are one of +the STATUS data items -- ie 'messages, 'recent, 'uidnext, 'uidvalidity +or 'unseen. The IMAP command tag is returned." + (with-current-buffer (or buffer (current-buffer)) + (imap-send-command (list "STATUS \"" + (imap-utf7-encode mailbox) + "\" " + (format "%s" + (if (listp items) + items + (list items))))))) + (defun imap-mailbox-acl-get (&optional mailbox buffer) "Get ACL on mailbox from server in BUFFER." (let ((mailbox (imap-utf7-encode mailbox))) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 0377cfa..32ee6e6 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -111,12 +111,12 @@ The defined renderer types are: `lynx' : using lynx; `html2text' : using html2text; `nil' : using external viewer." - :type '(choice (symbol w3) - (symbol w3m) - (symbol links) - (symbol lynx) - (symbol html2text) - (symbol nil) + :type '(choice (const w3) + (const w3m) + (const links) + (const lynx) + (const html2text) + (const nil) (function)) :version "21.3" :group 'mime-display) @@ -1019,9 +1019,8 @@ like underscores." (file-name-nondirectory filename)))) (setq file (read-file-name "Save MIME part to: " - (expand-file-name - (or filename name "") - (or mm-default-directory default-directory)))) + (or mm-default-directory default-directory) + nil nil (or filename name ""))) (setq mm-default-directory (file-name-directory file)) (and (or (not (file-exists-p file)) (yes-or-no-p (format "File %s already exists; overwrite? " diff --git a/lisp/mm-url.el b/lisp/mm-url.el index 23ddee0..243e8c2 100644 --- a/lisp/mm-url.el +++ b/lisp/mm-url.el @@ -32,6 +32,7 @@ (eval-when-compile (require 'cl)) (require 'mm-util) +(require 'gnus) (eval-and-compile (autoload 'exec-installed-p "path-util")) @@ -78,6 +79,13 @@ ;;; Internal variables +(defvar mm-url-package-name + (gnus-replace-in-string + (gnus-replace-in-string gnus-version " v.*$" "") + " " "-")) + +(defvar mm-url-package-version gnus-version-number) + ;; Stolen from w3. (defvar mm-url-html-entities '( @@ -266,7 +274,11 @@ This is taken from RFC 2396.") (insert-file-contents (substring url (1- (match-end 0)))) (mm-url-insert-file-contents-external url)) (mm-url-load-url) - (let ((name buffer-file-name)) + (let ((name buffer-file-name) + (url-package-name (or mm-url-package-name + url-package-name)) + (url-package-version (or mm-url-package-version + url-package-version))) (prog1 (url-insert-file-contents url) (save-excursion diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 8fdfc2a..b6ca95c 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -213,6 +213,18 @@ Equivalent to `progn' in XEmacs" (defalias 'mm-with-unibyte-current-buffer 'nnheader-with-unibyte-current-buffer) + ;; Should keep track of `mm-with-unibyte' in mm-util.el. + (defmacro nnheader-with-unibyte (&rest forms) + "Eval the FORMS with the default value of `enable-multibyte-characters' +nil, ." + `(let (default-enable-multibyte-characters) + ,@forms)) + (put 'nnheader-with-unibyte 'lisp-indent-function 0) + (put 'nnheader-with-unibyte 'edebug-form-spec '(body)) + (put 'mm-with-unibyte 'lisp-indent-function 0) + (put 'mm-with-unibyte 'edebug-form-spec '(body)) + (defalias 'mm-with-unibyte 'nnheader-with-unibyte) + ;; Should keep track of `mm-guess-mime-charset' in mm-util.el. (defun nnheader-guess-mime-charset () "Guess the default MIME charset from the language environment." diff --git a/lisp/nnimap.el b/lisp/nnimap.el index a556bc5..9a2e046 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -192,7 +192,7 @@ RFC2060 section 6.4.4." :type 'string) (defcustom nnimap-split-fancy nil - "Like `nnmail-split-fancy', which see." + "Like the variable `nnmail-split-fancy', which see." :group 'nnimap :type 'sexp) @@ -214,6 +214,18 @@ the same mailbox will be faster though." :type 'boolean :group 'nnimap) +(defcustom nnimap-retrieve-groups-asynchronous t + "Send asynchronous STATUS commands for each mailbox before checking mail. +If you have mailboxes that rarely receives mail, this speeds up new +mail checking. It works by first sending STATUS commands for each +mailbox, and then only checking groups which has a modified UIDNEXT +more carefully for new mail. + +In summary, the default is O((1-p)*k+p*n) and changing it to nil makes +it O(n). If p is small, then the default is probably faster." + :type 'boolean + :group 'nnimap) + (defvoo nnimap-need-unselect-to-notice-new-mail nil "Unselect mailboxes before looking for new mail in them. Some servers seem to need this under some circumstances.") @@ -367,6 +379,7 @@ restrict visible folders.") ;; Internal variables: +(defvoo nnimap-mailbox-info (gnus-make-hashtable 997)) (defvar nnimap-debug nil "Name of buffer to record debugging info. For example: (setq nnimap-debug \"*nnimap-debug*\")") @@ -934,18 +947,50 @@ function is generally only called when Gnus is shutting down." (with-current-buffer nntp-server-buffer (erase-buffer) (nnimap-before-find-minmax-bugworkaround) - (dolist (group groups) - (gnus-message 7 "nnimap: Checking mailbox %s" group) - (or (member "\\NoSelect" - (imap-mailbox-get 'list-flags group nnimap-server-buffer)) - (let ((info (nnimap-find-minmax-uid group 'examine))) - (when (> (or (imap-mailbox-get 'recent group - nnimap-server-buffer) 0) - 0) - (push (list (cons group 0)) nnmail-split-history)) - (insert (format "\"%s\" %d %d y\n" group - (or (nth 2 info) 0) - (max 1 (or (nth 1 info) 1)))))))) + (let (asyncgroups slowgroups) + (if (null nnimap-retrieve-groups-asynchronous) + (setq slowgroups groups) + (dolist (group groups) + (gnus-message 7 "nnimap: Checking mailbox %s" group) + (add-to-list (if (gnus-gethash-safe group nnimap-mailbox-info) + 'asyncgroups + 'slowgroups) + (list group (imap-mailbox-status-asynch + group 'uidnext nnimap-server-buffer)))) + (dolist (asyncgroup asyncgroups) + (let ((group (nth 0 asyncgroup)) + (tag (nth 1 asyncgroup)) + new old) + (when (imap-ok-p (imap-wait-for-tag tag nnimap-server-buffer)) + (if (< (car (gnus-gethash group nnimap-mailbox-info)) + (imap-mailbox-get 'uidnext group nnimap-server-buffer)) + (push (list group) slowgroups) + (insert (cdr (gnus-gethash group nnimap-mailbox-info)))))))) + (dolist (group slowgroups) + (if nnimap-retrieve-groups-asynchronous + (setq group (car group))) + (gnus-message 7 "nnimap: Rechecking mailbox %s" group) + (imap-mailbox-put 'uidnext nil group nnimap-server-buffer) + (or (member "\\NoSelect" (imap-mailbox-get 'list-flags group + nnimap-server-buffer)) + (let* ((info (nnimap-find-minmax-uid group 'examine)) + (str (format "\"%s\" %d %d y\n" group + (or (nth 2 info) 0) + (max 1 (or (nth 1 info) 1))))) + (when (> (or (imap-mailbox-get 'recent group + nnimap-server-buffer) 0) + 0) + (push (list (cons group 0)) nnmail-split-history)) + (insert str) + (when nnimap-retrieve-groups-asynchronous + (gnus-sethash + group + (cons (or (imap-mailbox-get + 'uidnext group nnimap-server-buffer) + (imap-mailbox-status + group 'uidnext nnimap-server-buffer)) + str) + nnimap-mailbox-info))))))) (gnus-message 5 "nnimap: Checking mailboxes...done") 'active)) @@ -1065,7 +1110,7 @@ function is generally only called when Gnus is shutting down." nil) (defun nnimap-split-fancy () - "Like nnmail-split-fancy, but uses nnimap-split-fancy." + "Like the function `nnmail-split-fancy', but uses `nnimap-split-fancy'." (let ((nnmail-split-fancy nnimap-split-fancy)) (nnmail-split-fancy))) @@ -1144,6 +1189,10 @@ function is generally only called when Gnus is shutting down." (message "IMAP split moved %s:%s:%d to %s" server inbox article to-group) (setq removeorig t) + (when nnmail-cache-accepted-message-ids + (with-current-buffer nntp-server-buffer + (nnmail-cache-insert (nnmail-fetch-field + "message-id") to-group))) ;; Add the group-art list to the history list. (push (list (cons to-group 0)) nnmail-split-history)) (t @@ -1157,6 +1206,8 @@ function is generally only called when Gnus is shutting down." ;; todo: UID EXPUNGE (if available) to remove splitted articles (imap-mailbox-expunge) (imap-mailbox-close))) + (when nnmail-cache-accepted-message-ids + (nnmail-cache-close)) t)))) (deffoo nnimap-request-scan (&optional group server) @@ -1217,7 +1268,6 @@ function is generally only called when Gnus is shutting down." (gnus-message 5 "nnimap: Marking article %d for deletion..." imap-current-message)) - (defun nnimap-expiry-target (arts group server) (unless (eq nnmail-expiry-target 'delete) (with-temp-buffer @@ -1311,7 +1361,11 @@ function is generally only called when Gnus is shutting down." (kill-region (point) (progn (forward-line) (point)))) ;; turn into rfc822 format (\r\n eol's) (while (search-forward "\n" nil t) - (replace-match "\r\n"))) + (replace-match "\r\n")) + (when nnmail-cache-accepted-message-ids + (nnmail-cache-insert (nnmail-fetch-field "message-id")))) + (when (and last nnmail-cache-accepted-message-ids) + (nnmail-cache-close)) ;; this 'or' is for Cyrus server bug (or (null (imap-current-mailbox nnimap-server-buffer)) (imap-mailbox-unselect nnimap-server-buffer)) diff --git a/lisp/nnkiboze.el b/lisp/nnkiboze.el index 710163f..eb524c7 100644 --- a/lisp/nnkiboze.el +++ b/lisp/nnkiboze.el @@ -115,6 +115,7 @@ (gnus-request-article num group buffer))))) (deffoo nnkiboze-request-scan (&optional group server) + (nnkiboze-possibly-change-group group) (nnkiboze-generate-group (concat "nnkiboze:" group))) (deffoo nnkiboze-request-group (group &optional server dont-check) @@ -251,110 +252,111 @@ Finds out what articles are to be part of the nnkiboze groups." (unless info (error "No such group: %s" group)) ;; Load the kiboze newsrc file for this group. - (when (file-exists-p newsrc-file) - (load newsrc-file)) - (let ((coding-system-for-write nnkiboze-file-coding-system) - (output-coding-system nnkiboze-file-coding-system)) - (gnus-make-directory (file-name-directory nov-file)) - (with-temp-file nov-file - (when (file-exists-p nov-file) - (nnheader-insert-file-contents nov-file)) - (setq nov-buffer (current-buffer)) - ;; Go through the active hashtb and add new all groups that match the - ;; kiboze regexp. - (mapatoms - (lambda (group) - (and (string-match nnkiboze-regexp - (setq gname (symbol-name group))) ; Match - (not (assoc gname nnkiboze-newsrc)) ; It isn't registered - (numberp (car (symbol-value group))) ; It is active - (or (> nnkiboze-level 7) - (and (setq glevel - (nth 1 (nth 2 (gnus-gethash - gname gnus-newsrc-hashtb)))) - (>= nnkiboze-level glevel))) - (not (string-match "^nnkiboze:" gname)) ; Exclude kibozes - (push (cons gname (1- (car (symbol-value group)))) - nnkiboze-newsrc))) - gnus-active-hashtb) - ;; `newsrc' is set to the list of groups that possibly are - ;; component groups to this kiboze group. This list has elements - ;; on the form `(GROUP . NUMBER)', where NUMBER is the highest - ;; number that has been kibozed in GROUP in this kiboze group. - (setq newsrc nnkiboze-newsrc) - (while newsrc - (if (not (setq active (gnus-gethash - (caar newsrc) gnus-active-hashtb))) - ;; This group isn't active after all, so we remove it from - ;; the list of component groups. - (setq nnkiboze-newsrc (delq (car newsrc) nnkiboze-newsrc)) - (setq lowest (cdar newsrc)) - ;; Ok, we have a valid component group, so we jump to it. - (switch-to-buffer gnus-group-buffer) - (gnus-group-jump-to-group (caar newsrc)) - (gnus-message 3 "nnkiboze: Checking %s..." (caar newsrc)) - (setq ginfo (gnus-get-info (gnus-group-group-name)) - orig-info (gnus-copy-sequence ginfo) - num-unread (car (gnus-gethash (caar newsrc) - gnus-newsrc-hashtb))) - (unwind-protect - (progn - ;; We set all list of article marks to nil. Since we operate - ;; on copies of the real lists, we can destroy anything we - ;; want here. - (when (nth 3 ginfo) - (setcar (nthcdr 3 ginfo) nil)) - ;; We set the list of read articles to be what we expect for - ;; this kiboze group -- either nil or `(1 . LOWEST)'. - (when ginfo - (setcar (nthcdr 2 ginfo) - (and (not (= lowest 1)) (cons 1 lowest)))) - (when (and (or (not ginfo) - (> (length (gnus-list-of-unread-articles - (car ginfo))) - 0)) - (progn - (ignore-errors - (gnus-group-select-group nil)) - (eq major-mode 'gnus-summary-mode))) - ;; We are now in the group where we want to be. - (setq method (gnus-find-method-for-group - gnus-newsgroup-name)) - (when (eq method gnus-select-method) - (setq method nil)) - ;; We go through the list of scored articles. - (while gnus-newsgroup-scored - (when (> (caar gnus-newsgroup-scored) lowest) - ;; If it has a good score, then we enter this article - ;; into the kiboze group. - (nnkiboze-enter-nov - nov-buffer - (gnus-summary-article-header - (caar gnus-newsgroup-scored)) - gnus-newsgroup-name)) - (setq gnus-newsgroup-scored (cdr gnus-newsgroup-scored))) - ;; That's it. We exit this group. - (when (eq major-mode 'gnus-summary-mode) - (kill-buffer (current-buffer))))) - ;; Restore the proper info. - (when ginfo - (setcdr ginfo (cdr orig-info))) - (setcar (gnus-gethash (caar newsrc) gnus-newsrc-hashtb) - num-unread))) - (setcdr (car newsrc) (car active)) - (gnus-message 3 "nnkiboze: Checking %s...done" (caar newsrc)) - (setq newsrc (cdr newsrc))))) - ;; We save the kiboze newsrc for this group. - (gnus-make-directory (file-name-directory newsrc-file)) - (with-temp-file newsrc-file - (insert "(setq nnkiboze-newsrc '") - (gnus-prin1 nnkiboze-newsrc) - (insert ")\n"))) - (unless inhibit-list-groups - (save-excursion - (set-buffer gnus-group-buffer) - (gnus-group-list-groups))) - t) + (mm-with-unibyte + (when (file-exists-p newsrc-file) + (load newsrc-file)) + (let ((coding-system-for-write nnkiboze-file-coding-system) + (output-coding-system nnkiboze-file-coding-system)) + (gnus-make-directory (file-name-directory nov-file)) + (with-temp-file nov-file + (when (file-exists-p nov-file) + (nnheader-insert-file-contents nov-file)) + (setq nov-buffer (current-buffer)) + ;; Go through the active hashtb and add new all groups that match the + ;; kiboze regexp. + (mapatoms + (lambda (group) + (and (string-match nnkiboze-regexp + (setq gname (symbol-name group))) ; Match + (not (assoc gname nnkiboze-newsrc)) ; It isn't registered + (numberp (car (symbol-value group))) ; It is active + (or (> nnkiboze-level 7) + (and (setq glevel + (nth 1 (nth 2 (gnus-gethash + gname gnus-newsrc-hashtb)))) + (>= nnkiboze-level glevel))) + (not (string-match "^nnkiboze:" gname)) ; Exclude kibozes + (push (cons gname (1- (car (symbol-value group)))) + nnkiboze-newsrc))) + gnus-active-hashtb) + ;; `newsrc' is set to the list of groups that possibly are + ;; component groups to this kiboze group. This list has elements + ;; on the form `(GROUP . NUMBER)', where NUMBER is the highest + ;; number that has been kibozed in GROUP in this kiboze group. + (setq newsrc nnkiboze-newsrc) + (while newsrc + (if (not (setq active (gnus-gethash + (caar newsrc) gnus-active-hashtb))) + ;; This group isn't active after all, so we remove it from + ;; the list of component groups. + (setq nnkiboze-newsrc (delq (car newsrc) nnkiboze-newsrc)) + (setq lowest (cdar newsrc)) + ;; Ok, we have a valid component group, so we jump to it. + (switch-to-buffer gnus-group-buffer) + (gnus-group-jump-to-group (caar newsrc)) + (gnus-message 3 "nnkiboze: Checking %s..." (caar newsrc)) + (setq ginfo (gnus-get-info (gnus-group-group-name)) + orig-info (gnus-copy-sequence ginfo) + num-unread (car (gnus-gethash (caar newsrc) + gnus-newsrc-hashtb))) + (unwind-protect + (progn + ;; We set all list of article marks to nil. Since we operate + ;; on copies of the real lists, we can destroy anything we + ;; want here. + (when (nth 3 ginfo) + (setcar (nthcdr 3 ginfo) nil)) + ;; We set the list of read articles to be what we expect for + ;; this kiboze group -- either nil or `(1 . LOWEST)'. + (when ginfo + (setcar (nthcdr 2 ginfo) + (and (not (= lowest 1)) (cons 1 lowest)))) + (when (and (or (not ginfo) + (> (length (gnus-list-of-unread-articles + (car ginfo))) + 0)) + (progn + (ignore-errors + (gnus-group-select-group nil)) + (eq major-mode 'gnus-summary-mode))) + ;; We are now in the group where we want to be. + (setq method (gnus-find-method-for-group + gnus-newsgroup-name)) + (when (eq method gnus-select-method) + (setq method nil)) + ;; We go through the list of scored articles. + (while gnus-newsgroup-scored + (when (> (caar gnus-newsgroup-scored) lowest) + ;; If it has a good score, then we enter this article + ;; into the kiboze group. + (nnkiboze-enter-nov + nov-buffer + (gnus-summary-article-header + (caar gnus-newsgroup-scored)) + gnus-newsgroup-name)) + (setq gnus-newsgroup-scored (cdr gnus-newsgroup-scored))) + ;; That's it. We exit this group. + (when (eq major-mode 'gnus-summary-mode) + (kill-buffer (current-buffer))))) + ;; Restore the proper info. + (when ginfo + (setcdr ginfo (cdr orig-info))) + (setcar (gnus-gethash (caar newsrc) gnus-newsrc-hashtb) + num-unread))) + (setcdr (car newsrc) (cdr active)) + (gnus-message 3 "nnkiboze: Checking %s...done" (caar newsrc)) + (setq newsrc (cdr newsrc))))) + ;; We save the kiboze newsrc for this group. + (gnus-make-directory (file-name-directory newsrc-file)) + (with-temp-file newsrc-file + (insert "(setq nnkiboze-newsrc '") + (gnus-prin1 nnkiboze-newsrc) + (insert ")\n"))) + (unless inhibit-list-groups + (save-excursion + (set-buffer gnus-group-buffer) + (gnus-group-list-groups))) + t)) (defun nnkiboze-enter-nov (buffer header group) (save-excursion diff --git a/lisp/nnmail.el b/lisp/nnmail.el index dd1d67f..a98a187 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1457,7 +1457,7 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (defvar group) (defvar group-art-list) (defvar group-art) -(defun nnmail-cache-insert (id) +(defun nnmail-cache-insert (id &optional grp) (when nnmail-treat-duplicates ;; Store some information about the group this message is written ;; to. This function might have been called from various places. @@ -1468,7 +1468,9 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." ;; the car of a pair is a group name. Should we check that the ;; length of the list is equal to 1? -- kai (let ((g nil)) - (cond ((and (boundp 'group) group) + (cond (grp + (setq g grp)) + ((and (boundp 'group) group) (setq g group)) ((and (boundp 'group-art-list) group-art-list (listp group-art-list)) diff --git a/texi/ChangeLog b/texi/ChangeLog index 7b13965..90f16a5 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,15 @@ +2002-04-26 Steve Youngs + + * Makefile.in (infodir): Set to '@info_dir@' so we can separate + defaults for XEmacs and Emacs. + +2002-04-27 Jesper Harder + + * emacs-mime.texi (Customization): Update info on HTML renderers. + + * gnus.texi (Article Washing): Update information on HTML washing. + Fix typos. + 2002-04-09 Paul Jarc * .cvsignore: added message-[0-9]* diff --git a/texi/Makefile.in b/texi/Makefile.in index 7eff6dc..6d06e4e 100644 --- a/texi/Makefile.in +++ b/texi/Makefile.in @@ -1,4 +1,4 @@ -infodir = @infodir@ +infodir = @info_dir@ prefix = @prefix@ srcdir = @srcdir@ subdir = texi diff --git a/texi/emacs-mime.texi b/texi/emacs-mime.texi index 6f66bb4..1283422 100644 --- a/texi/emacs-mime.texi +++ b/texi/emacs-mime.texi @@ -1066,14 +1066,12 @@ includes @samp{text/.*}, then including @samp{text/html} in this variable will cause @samp{text/html} parts to be treated as attachments. @item mm-inline-text-html-renderer -@findex mm-inline-text-html-render-with-w3 -@findex mm-inline-text-html-render-with-w3m -This function will be used to convert the @sc{html} to the text. There are -two pre-defined functions: @code{mm-inline-text-html-render-with-w3}, -which uses Emacs/w3; and @code{mm-inline-text-html-render-with-w3m}, -which uses emacs-w3m (see @uref{http://emacs-w3m.namazu.org/} for more -information about emacs-w3m). The function will be called with a -@sc{mime} handle as the argument. +This selects the function used to render @sc{html}. The predefined +renderers are selected by the symbols @code{w3}, +@code{w3m}@footnote{See @uref{http://emacs-w3m.namazu.org/} for more +information about emacs-w3m}, @code{links}, @code{lynx} or +@code{html2text}. You can also specify a function, which will be +called with a @sc{mime} handle as the argument. @item mm-inline-text-html-with-images Some @sc{html} mails might have the trick of spammers using diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 1b42125..a829ebb 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -8013,7 +8013,7 @@ CRLF $B$NAH(B ($B$9$J$o$A!"9T$N:G8e$N(B @samp{^M}) $B$r(B LF $B$KJQ49$7$^ @c @findex gnus-article-de-base64-unreadable @c Treat base64 (@code{gnus-article-de-base64-unreadable}). @c Base64 is one common @sc{mime} encoding employed when sending non-ASCII -@c (i. e., 8-bit) articles. Note that the this is usually done +@c (i. e., 8-bit) articles. Note that this is usually done @c automatically by Gnus if the message in question has a @c @code{Content-Transfer-Encoding} header that says that this encoding has @c been done. @@ -8044,19 +8044,29 @@ URL $B$K4^$^$l$k2~9T$r:o=|$7$^$9!#$$$/$D$+$N%a%$%i!<$O!"9T$rC;$/$9$k$?$a$K(B $B@\F,<-$,M?$($i$l$k$H!"2?$NJ8;z=89g(B (charset) $B$H$7$F07$&$+$r?R$M$i$l$^$9!#(B @vindex gnus-article-wash-function -$B%G%#%U%)%k%H$G$O(B @sc{html} $B$NJQ49$K(B w3 $B$r;H$$$^$9$,!"$3$l$OJQ(B -$B?t(B @code{gnus-article-wash-function} $B$G@)8f$5$l$^$9!#;H$&$3$H$,$G$-$k!"(B -$B$"$i$+$8$aMQ0U$5$l$?4X?t$O0J2<$NDL$j$G$9!#(B +$B%G%#%U%)%k%H$G$O(B @sc{html} $B$NJQ49$K(B @code{mm-inline-text-html-renderer} +(@pxref{Customization, , , emacs-mime}) $B$G@_Dj$5$l$?4X?t$r;H$$$^$9$,!"$3(B +$B$l$OJQ?t(B @code{gnus-article-wash-function} $B$G@)8f$5$l$^$9!#;H$&$3$H$,$G(B +$B$-$k!"$"$i$+$8$aMQ0U$5$l$?4X?t$O0J2<$NDL$j$G$9!#(B @table @code -@item gnus-article-wash-html-with-w3 -@findex gnus-article-wash-html-with-w3 -w3 $B$r;H$$$^$9(B ($B$3$l$,%G%#%U%)%k%H$G$9(B)$B!#(B - -@item gnus-article-wash-html-with-w3m -@findex gnus-article-wash-html-with-w3m -emacs-w3m $B$r;H$$$^$9(B ($B$b$C$H>\$7$$$3$H(B -$B$O(B @uref{http://emacs-w3m.namazu.org/} $B$r;2>H$7$F2<$5$$(B)$B!#(B +@item w3 +Emacs/w3 $B$r;H$$$^$9!#(B + +@item w3m +emacs-w3m $B$r;H$$$^$9(B ($B>\$7$/$O(B @uref{http://emacs-w3m.namazu.org/} $B$r;2(B +$B>H$7$F2<$5$$(B)$B!#(B + +@item links +Links $B$r;H$$$^(B +$B$9(B (@uref{http://artax.karlin.mff.cuni.cz/~mikulas/links/} $B$r;2>H(B)$B!#(B + +@item lynx +Lynx $B$r;H$$$^$9(B (@uref{http://lynx.browser.org/} $B$r;2>H(B)$B!#(B + +@item html2text +html2text ($B%7%s%W%k$J(B @sc{html} $B%3%s%P!<%?!