Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101699. ------------------------------------------------------------ revno: 101699 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-10-01 06:56:38 +0000 message: gnus-util.el (gnus-completing-read-function): Exclude gnus-icompleting-read and gnus-ido-completing-read from candidates for XEmacs. Silence the byte compiler. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-01 05:50:11 +0000 +++ lisp/gnus/ChangeLog 2010-10-01 06:56:38 +0000 @@ -1,5 +1,12 @@ 2010-10-01 Katsumi Yamaoka + * gnus-util.el (gnus-completing-read-function): Exclude + gnus-icompleting-read and gnus-ido-completing-read from candidates for + XEmacs since iswitchb.el is very old and ido.el is unavailable in + XEmacs. + (iswitchb-mode, iswitchb-temp-buflist, iswitchb-read-buffer): Silence + the byte compiler. + * gravatar.el: Don't load image.el that XEmacs doesn't provide. (gravatar-create-image): New function that's an alias to gnus-xmas-create-image, gnus-create-image, or create-image. === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus-util.el 2010-10-01 06:56:38 +0000 @@ -48,13 +48,16 @@ #'gnus-std-completing-read "Function to do a completing read." :group 'gnus-meta - :type '(radio (function-item + :type `(radio (function-item :doc "Use Emacs' standard `completing-read' function." gnus-std-completing-read) - (function-item :doc "Use iswitchb's completing-read function." - gnus-icompleting-read) - (function-item :doc "Use ido's completing-read function." - gnus-ido-completing-read) + ,@(unless (featurep 'xemacs) + '((function-item + :doc "Use iswitchb's completing-read function." + gnus-icompleting-read) + (function-item + :doc "Use ido's completing-read function." + gnus-ido-completing-read))) (function))) (defcustom gnus-completion-styles @@ -1595,6 +1598,11 @@ (completing-read prompt collection nil require-match initial-input history def)) +(defvar iswitchb-mode) +(defvar iswitchb-temp-buflist) +(declare-function iswitchb-read-buffer "iswitchb" + (prompt &optional default require-match start matches-set)) + (defun gnus-icompleting-read (prompt collection &optional require-match initial-input history def) (require 'iswitchb) ------------------------------------------------------------ revno: 101698 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-10-01 05:50:11 +0000 message: gravatar.el (gravatar-create-image): New function. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-10-01 00:25:50 +0000 +++ lisp/gnus/ChangeLog 2010-10-01 05:50:11 +0000 @@ -1,3 +1,10 @@ +2010-10-01 Katsumi Yamaoka + + * gravatar.el: Don't load image.el that XEmacs doesn't provide. + (gravatar-create-image): New function that's an alias to + gnus-xmas-create-image, gnus-create-image, or create-image. + (gravatar-data->image): Use it. + 2010-09-30 Teodor Zlatanov * gnus-registry.el (gnus-registry-install-nnregistry): New function to === modified file 'lisp/gnus/gravatar.el' --- lisp/gnus/gravatar.el 2010-09-24 22:33:34 +0000 +++ lisp/gnus/gravatar.el 2010-10-01 05:50:11 +0000 @@ -24,7 +24,6 @@ ;;; Code: -(require 'image) (require 'url) (require 'url-cache) @@ -84,12 +83,22 @@ (when (search-forward "\n\n" nil t) (buffer-substring (point) (point-max))))) +(eval-and-compile + (cond ((featurep 'xemacs) + (require 'gnus-xmas) + (defalias 'gravatar-create-image 'gnus-xmas-create-image)) + ((featurep 'gnus-ems) + (defalias 'gravatar-create-image 'gnus-create-image)) + (t + (require 'image) + (defalias 'gravatar-create-image 'create-image)))) + (defun gravatar-data->image () "Get data of current buffer and return an image. If no image available, return 'error." (let ((data (gravatar-get-data))) (if data - (create-image data nil t) + (gravatar-create-image data nil t) 'error))) ;;;###autoload ------------------------------------------------------------ revno: 101697 committer: Glenn Morris branch nick: trunk timestamp: Thu 2010-09-30 20:57:26 -0700 message: Tweak temporary-file-directory on darwin systems. * lisp/files.el (temporary-file-directory): On darwin, also try DARWIN_USER_TEMP_DIR (see discussion in bug#7135). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-01 01:28:45 +0000 +++ lisp/ChangeLog 2010-10-01 03:57:26 +0000 @@ -1,3 +1,8 @@ +2010-10-01 Glenn Morris + + * files.el (temporary-file-directory): On darwin, also try + DARWIN_USER_TEMP_DIR (see discussion in bug#7135). + 2010-10-01 Juanma Barranquero * server.el (server-start): Revert part of revno 101688. === modified file 'lisp/files.el' --- lisp/files.el 2010-09-25 20:16:35 +0000 +++ lisp/files.el 2010-10-01 03:57:26 +0000 @@ -190,12 +190,27 @@ (defcustom temporary-file-directory (file-name-as-directory + ;; FIXME ? Should there be Ftemporary_file_directory to do the + ;; following more robustly (cf set_local_socket in emacsclient.c). + ;; It could be used elsewhere, eg Fcall_process_region, server-socket-dir. + ;; See bug#7135. (cond ((memq system-type '(ms-dos windows-nt)) (or (getenv "TEMP") (getenv "TMPDIR") (getenv "TMP") "c:/temp")) + ((eq system-type 'darwin) + (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") + (let ((tmp (ignore-errors (shell-command-to-string ; bug#7135 + "getconf DARWIN_USER_TEMP_DIR")))) + (and (stringp tmp) + (setq tmp (replace-regexp-in-string "\n\\'" "" tmp)) + ;; This handles "getconf: Unrecognized variable..." + (file-directory-p tmp) + tmp)) + "/tmp")) (t (or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp")))) "The directory for writing temporary files." :group 'files + ;; Darwin section added 24.1, does not seem worth :version bump. :initialize 'custom-initialize-delay :type 'directory) ------------------------------------------------------------ revno: 101696 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2010-10-01 03:28:45 +0200 message: lisp/server.el (server-start): For compatibility, revert part of revno 101688. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-01 00:34:42 +0000 +++ lisp/ChangeLog 2010-10-01 01:28:45 +0000 @@ -1,3 +1,8 @@ +2010-10-01 Juanma Barranquero + + * server.el (server-start): Revert part of revno 101688. + Let's not break compatibility gratuitously, shall we? + 2010-09-30 Lars Magne Ingebrigtsen * net/tls.el (tls-starttls-switches): New variable. === modified file 'lisp/server.el' --- lisp/server.el 2010-09-30 02:53:26 +0000 +++ lisp/server.el 2010-10-01 01:28:45 +0000 @@ -586,6 +586,7 @@ (setq buffer-file-coding-system 'no-conversion) (insert (format-network-address (process-contact server-process :local)) + " " (number-to-string (emacs-pid)) ; Kept for compatibility "\n" auth-key))))))))) ;;;###autoload ------------------------------------------------------------ revno: 101695 committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-10-01 00:34:42 +0000 message: Fix previous merge from Gnus trunk. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-10-01 00:25:50 +0000 +++ doc/misc/ChangeLog 2010-10-01 00:34:42 +0000 @@ -41,7 +41,7 @@ 2010-09-26 Julien Danjou - * gnus.texi (Oort Gnus): Remove mention of ssl.el + * gnus.texi (Oort Gnus): Remove mention of ssl.el. 2010-09-26 Lars Magne Ingebrigtsen @@ -71,7 +71,7 @@ 2010-09-25 Julien Danjou - * gnus.texi (Customizing Articles): Remove gnus-treat-translate + * gnus.texi (Customizing Articles): Remove gnus-treat-translate. 2010-09-24 Glenn Morris === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-10-01 00:25:50 +0000 +++ lisp/ChangeLog 2010-10-01 00:34:42 +0000 @@ -1,10 +1,10 @@ 2010-09-30 Lars Magne Ingebrigtsen - * tls.el (tls-starttls-switches): New variable. + * net/tls.el (tls-starttls-switches): New variable. (tls-find-starttls-argument): Use it. (open-tls-stream): Ditto. -1 * netrc.el (netrc-credentials): Return the value of the "default" + * net/netrc.el (netrc-credentials): Return the value of the "default" entry. (netrc-machine): Ditto. ------------------------------------------------------------ revno: 101694 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Fri 2010-10-01 00:25:50 +0000 message: nnimap.el (nnimap-request-accept-article): Get the Message-ID without the \r. nnimap.el (nnimap-find-article-by-message-id): Use EXAMINE instead of SELECT to get the message-id. gnus-art.el, gnus.el, nnimap.el: Fix up make-obsolete-variable declarations throughout. gnus.texi (Mail Source Specifiers): Remove webmail.el mentions. mail-source.el: Removed webmail support. nntp.el (nntp-server-list-active-group): Document. gnus.texi (NNTP): Document nntp-server-list-active-group. gnus.texi (Customizing the IMAP Connection): Remove extra quote. nnimap.el (nnimap-find-article-by-message-id): Really return the article number. nnimap.el: Add nnimap-split-fancy. netrc.el (netrc-credentials, netrc-machine): Return the value of the "default" entry. nnimap.el: Use tls.el exclusively, and not starttls.el at all. nnimap.el (nnimap-wait-for-connection): Accept the moronic openssl s_client -starttls output, too. nnrss.el (nnrss-use-local): Add documentation. message.el (message-ignored-supersedes-headers): Strip Injection-* headers before superseding. nnimap.el (nnimap-open-connection): Reinstate the auto-upgrade from unencrypted to STARTTLS, if possible. nnir.el: Use the server names without suffixes. gnus-sum.el (gnus-summary-show-thread): Skip past invisible text when expanding threads. gnus-registry.el: Don't follow nnmairix references. Install the nnregistry refer method. gnus.texi (Spam Package Configuration Examples, SpamOracle): Remove nnimap-split-rule from examples. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-09-29 08:36:38 +0000 +++ doc/misc/ChangeLog 2010-10-01 00:25:50 +0000 @@ -1,3 +1,20 @@ +2010-09-30 Teodor Zlatanov + + * gnus.texi (Spam Package Configuration Examples, SpamOracle): Remove + nnimap-split-rule from examples. + +2010-09-30 Lars Magne Ingebrigtsen + + * gnus.texi (Mail Source Specifiers): Remove webmail.el mentions. + (NNTP): Document nntp-server-list-active-group. Suggested by Barry + Fishman. + (Client-Side IMAP Splitting): Add nnimap-split-fancy. + +2010-09-30 Julien Danjou + + * gnus.texi (Gravatars): Fix documentation about + gnu-gravatar-properties. + 2010-09-29 Daiki Ueno * epa.texi (Bug Reports): New section. @@ -6,6 +23,16 @@ * Makefile.in (top_srcdir): Remove unused variable. +2010-09-29 Lars Magne Ingebrigtsen + + * gnus.texi (Using IMAP): Remove the @acronyms from the headings. + (Client-Side IMAP Splitting): Document 'default. + +2010-09-27 Lars Magne Ingebrigtsen + + * gnus.texi (Customizing the IMAP Connection): Document + nnimap-fetch-partial-articles. + 2010-09-26 Lars Magne Ingebrigtsen * gnus-news.texi: Mention nnimap-inbox. === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-09-30 08:39:23 +0000 +++ doc/misc/gnus.texi 2010-10-01 00:25:50 +0000 @@ -14394,6 +14394,12 @@ Note that not all servers support the recommended ID. This works for INN versions 2.3.0 and later, for instance. +@item nntp-server-list-active-group +If @code{nil}, then always use @samp{GROUP} instead of @samp{LIST +ACTIVE}. This is usually slower, but on misconfigured servers that +don't update their active files often, this can help. + + @end table @menu @@ -14836,7 +14842,7 @@ (nnimap-inbox "INBOX") (nnimap-split-methods default) (nnimap-expunge t) - (nnimap-stream 'ssl) + (nnimap-stream ssl) (nnir-search-engine imap) (nnimap-expunge-inbox t)) @end example @@ -14906,6 +14912,9 @@ Mail}), except the symbol @code{default}, which means that it should use the value of the @code{nnmail-split-methods} variable. +@item nnimap-split-fancy +Uses the same syntax as @code{nnmail-split-fancy}. + @end table @@ -15559,45 +15568,6 @@ :fetchflag "\\Seen") @end lisp -@item webmail -Get mail from a webmail server, such as @uref{http://www.hotmail.com/}, -@uref{http://webmail.netscape.com/}, @uref{http://www.netaddress.com/}, -@uref{http://mail.yahoo.com/}. - -NOTE: Webmail largely depends on cookies. A "one-line-cookie" patch is -required for url "4.0pre.46". - -WARNING: Mails may be lost. NO WARRANTY. - -Keywords: - -@table @code -@item :subtype -The type of the webmail server. The default is @code{hotmail}. The -alternatives are @code{netscape}, @code{netaddress}, @code{my-deja}. - -@item :user -The user name to give to the webmail server. The default is the login -name. - -@item :password -The password to give to the webmail server. If not specified, the user is -prompted. - -@item :dontexpunge -If non-@code{nil}, only fetch unread articles and don't move them to -trash folder after finishing the fetch. - -@end table - -An example webmail source: - -@lisp -(webmail :subtype 'hotmail - :user "user-name" - :password "secret") -@end lisp - @item group Get the actual mail source from the @code{mail-source} group parameter, @xref{Group Parameters}. @@ -24196,8 +24166,8 @@ spam-move-spam-nonspam-groups-only nil spam-mark-only-unseen-as-spam t spam-mark-ham-unread-before-move-from-spam-group t - nnimap-split-rule 'nnimap-split-fancy ;; @r{understand what this does before you copy it to your own setup!} + ;; @r{for nnimap you'll probably want to set nnimap-split-methods, see the manual} nnimap-split-fancy '(| ;; @r{trace references to parents and put in their group} (: gnus-registry-split-fancy-with-parent) @@ -24919,8 +24889,8 @@ @example (setq spam-use-spamoracle t spam-split-group "Junk" + ;; @r{for nnimap you'll probably want to set nnimap-split-methods, see the manual} nnimap-split-inbox '("INBOX") - nnimap-split-rule 'nnimap-split-fancy nnimap-split-fancy '(| (: spam-split) "INBOX")) @end example @@ -26239,7 +26209,7 @@ Masanobu @sc{Umeda}---the writer of the original @sc{gnus}. @item -Shenghuo Zhu---uudecode.el, mm-uu.el, rfc1843.el, webmail.el, +Shenghuo Zhu---uudecode.el, mm-uu.el, rfc1843.el, nnwarchive and many, many other things connected with @acronym{MIME} and other types of en/decoding, as well as general bug fixing, new functionality and stuff. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-30 12:44:25 +0000 +++ lisp/ChangeLog 2010-10-01 00:25:50 +0000 @@ -1,3 +1,13 @@ +2010-09-30 Lars Magne Ingebrigtsen + + * tls.el (tls-starttls-switches): New variable. + (tls-find-starttls-argument): Use it. + (open-tls-stream): Ditto. + +1 * netrc.el (netrc-credentials): Return the value of the "default" + entry. + (netrc-machine): Ditto. + 2010-09-30 Eli Zaretskii * vc/vc-hooks.el (vc-default-mode-line-string): Doc fix. === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-30 10:25:45 +0000 +++ lisp/gnus/ChangeLog 2010-10-01 00:25:50 +0000 @@ -1,3 +1,59 @@ +2010-09-30 Teodor Zlatanov + + * gnus-registry.el (gnus-registry-install-nnregistry): New function to + install the nnregistry refer method. + (gnus-registry-install-hooks): Use it. + (gnus-registry-unfollowed-groups): Add nnmairix to the default + unfollowed groups. + +2010-09-30 Jose A. Ortega Ruiz (tiny change) + + * gnus-sum.el (gnus-summary-show-thread): Skip past invisible text when + expanding threads. + +2010-09-30 Lars Magne Ingebrigtsen + + * nnir.el: Use the server names without suffixes (bug #7009). + + * nnimap.el (nnimap-open-connection): Reinstate the auto-upgrade from + unencrypted to STARTTLS, if possible. + +2010-09-30 Teemu Likonen (tiny change) + + * message.el (message-ignored-supersedes-headers): Strip Injection-* + headers before superseding. + +2010-09-30 Lars Magne Ingebrigtsen + + * nnrss.el (nnrss-use-local): Add documentation. + + * nnimap.el (nnimap-extend-tls-programs): New function. + (nnimap-open-connection): Use tls.el exclusively, and not starttls.el. + (nnimap-wait-for-connection): Accept the greeting from the stupid + output from openssl s_client -starttls, too. + + * nnimap.el (nnimap-find-article-by-message-id): Really return the + article number. + (nnimap-split-fancy): New variable. + (nnimap-split-incoming-mail): Use it. + + * nntp.el (nntp-server-list-active-group): Document. + + * nnimap.el (nnimap-find-article-by-message-id): Use EXAMINE instead of + SELECT to get the message-id. + + * mail-source.el (mail-sources): Removed webmail support. + (defvar): Ditto. + (mail-source-fetcher-alist): Ditto. + (mail-source-fetch-webmail): Removed. + + * webmail.el: Removed -- doesn't seem relevant any more. + + * gnus.el: Fix up make-obsolete-variable declarations throughout. + + * nnimap.el (nnimap-request-accept-article): Get the Message-ID without + the \r. + 2010-09-30 Julien Danjou * gnus-agent.el (gnus-agent-add-group): Fix call to @@ -44,11 +100,13 @@ (nnimap-request-accept-article): Add \r\n to the lines to make this work with Cyrus. - * nnregistry.el: Added. - * nndraft.el (nndraft-request-expire-articles): Use the group name instead if "nndraft". Fix found by Nils Ackermann. +2010-09-29 Ludovic Courtes + + * nnregistry.el: Added. + 2010-09-29 Stefan Monnier * nnmail.el (group, group-art-list, group-art): === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus-art.el 2010-10-01 00:25:50 +0000 @@ -725,7 +725,7 @@ :group 'gnus-article-various) (make-obsolete-variable 'gnus-article-hide-pgp-hook nil - "Gnus 5.10 (Emacs-22.1)") + "Gnus 5.10 (Emacs 22.1)") (defface gnus-button '((t (:weight bold))) @@ -1412,7 +1412,7 @@ :type gnus-article-treat-custom) (make-obsolete-variable 'gnus-treat-display-xface - 'gnus-treat-display-x-face "22.1") + 'gnus-treat-display-x-face "Emacs 22.1") (defcustom gnus-treat-display-x-face (and (not noninteractive) === modified file 'lisp/gnus/gnus-registry.el' --- lisp/gnus/gnus-registry.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus-registry.el 2010-10-01 00:25:50 +0000 @@ -122,12 +122,14 @@ :type 'symbol) (defcustom gnus-registry-unfollowed-groups - '("delayed$" "drafts$" "queue$" "INBOX$") + '("delayed$" "drafts$" "queue$" "INBOX$" "^nnmairix:") "List of groups that gnus-registry-split-fancy-with-parent won't return. The group names are matched, they don't have to be fully qualified. This parameter tells the Registry 'never split a message into a group that matches one of these, regardless of -references.'" +references.' + +nnmairix groups are specifically excluded because they are ephemeral." :group 'gnus-registry :type '(repeat regexp)) @@ -1127,6 +1129,7 @@ (setq gnus-registry-install t) ; in case it was 'ask or nil (gnus-registry-install-hooks) (gnus-registry-install-shortcuts) + (gnus-registry-install-nnregistry) (gnus-registry-read)) ;;;###autoload @@ -1143,6 +1146,19 @@ (add-hook 'gnus-summary-prepare-hook 'gnus-registry-register-message-ids)) +;;;###autoload +(defun gnus-registry-install-nnregistry () + "Install the nnregistry refer method in `gnus-refer-article-method'." + (interactive) + (when (featurep 'nnregistry) + (setq gnus-refer-article-method + (delete-dups + (append + (if (listp gnus-refer-article-method) + gnus-refer-article-method + (list gnus-refer-article-method)) + (list 'nnregistry)))))) + (defun gnus-registry-unload-hook () "Uninstall the registry hooks." (interactive) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus-sum.el 2010-10-01 00:25:50 +0000 @@ -11327,15 +11327,19 @@ (gnus-remove-overlays (point-min) (point-max) 'invisible 'gnus-sum) (gnus-summary-position-point)) +(defsubst gnus-summary--inv (p) + (and (eq (get-char-property p 'invisible) 'gnus-sum) p)) + (defun gnus-summary-show-thread () "Show thread subtrees. Returns nil if no thread was there to be shown." (interactive) (let* ((orig (point)) (end (point-at-eol)) + (end (or (gnus-summary--inv end) (gnus-summary--inv (1- end)))) ;; Leave point at bol (beg (progn (beginning-of-line) (if (bobp) (point) (1- (point))))) - (eoi (when (eq (get-char-property end 'invisible) 'gnus-sum) + (eoi (when end (if (fboundp 'next-single-char-property-change) (or (next-single-char-property-change end 'invisible) (point-max)) === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus.el 2010-10-01 00:25:50 +0000 @@ -1427,7 +1427,7 @@ :group 'gnus-message :type '(choice (const :tag "default" nil) string)) -(make-obsolete-variable 'gnus-local-domain nil "24.1") +(make-obsolete-variable 'gnus-local-domain nil "Emacs 24.1") (defvar gnus-local-organization nil "String with a description of what organization (if any) the user belongs to. === modified file 'lisp/gnus/mail-source.el' --- lisp/gnus/mail-source.el 2010-09-28 12:35:18 +0000 +++ lisp/gnus/mail-source.el 2010-10-01 00:25:50 +0000 @@ -219,34 +219,6 @@ (boolean :tag "Dontexpunge")) (group :inline t (const :format "" :value :plugged) - (boolean :tag "Plugged")))) - (cons :tag "Webmail server" - (const :format "" webmail) - (checklist :tag "Options" :greedy t - (group :inline t - (const :format "" :value :subtype) - ;; Should be generated from - ;; `webmail-type-definition', but we - ;; can't require webmail without W3. - (choice :tag "Subtype" - :value hotmail - (const hotmail) - (const yahoo) - (const netaddress) - (const netscape) - (const my-deja))) - (group :inline t - (const :format "" :value :user) - (string :tag "User")) - (group :inline t - (const :format "" :value :password) - (string :tag "Password")) - (group :inline t - (const :format "" - :value :dontexpunge) - (boolean :tag "Dontexpunge")) - (group :inline t - (const :format "" :value :plugged) (boolean :tag "Plugged")))))))) (defcustom mail-source-ignore-errors nil @@ -387,13 +359,7 @@ (:prescript) (:prescript-delay) (:postscript) - (:dontexpunge)) - (webmail - (:subtype hotmail) - (:user (or (user-login-name) (getenv "LOGNAME") (getenv "USER"))) - (:password) - (:dontexpunge) - (:authentication password))) + (:dontexpunge))) "Mapping from keywords to default values. All keywords that can be used must be listed here.")) @@ -402,8 +368,7 @@ (directory mail-source-fetch-directory) (pop mail-source-fetch-pop) (maildir mail-source-fetch-maildir) - (imap mail-source-fetch-imap) - (webmail mail-source-fetch-webmail)) + (imap mail-source-fetch-imap)) "A mapping from source type to fetcher function.") (defvar mail-source-password-cache nil) @@ -1138,30 +1103,6 @@ ?s server ?P port ?u user)) found))) -(autoload 'webmail-fetch "webmail") - -(defun mail-source-fetch-webmail (source callback) - "Fetch for webmail source." - (mail-source-bind (webmail source) - (let ((mail-source-string (format "webmail:%s:%s" subtype user)) - (webmail-newmail-only dontexpunge) - (webmail-move-to-trash-can (not dontexpunge))) - (when (eq authentication 'password) - (setq password - (or password - (cdr (assoc (format "webmail:%s:%s" subtype user) - mail-source-password-cache)) - (read-passwd - (format "Password for %s at %s: " user subtype)))) - (when (and password - (not (assoc (format "webmail:%s:%s" subtype user) - mail-source-password-cache))) - (push (cons (format "webmail:%s:%s" subtype user) password) - mail-source-password-cache))) - (webmail-fetch mail-source-crash-box subtype user password) - (mail-source-callback callback (symbol-name subtype)) - (mail-source-delete-crash-box)))) - (provide 'mail-source) ;;; mail-source.el ends here === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2010-09-28 12:35:18 +0000 +++ lisp/gnus/message.el 2010-10-01 00:25:50 +0000 @@ -283,7 +283,7 @@ :link '(custom-manual "(message)Mail Headers") :type 'regexp) -(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-ID:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:\\|^Approved:" +(defcustom message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|^X-Trace:\\|^X-ID:\\|^X-Complaints-To:\\|Return-Path:\\|^Supersedes:\\|^NNTP-Posting-Date:\\|^X-Trace:\\|^X-Complaints-To:\\|^Cancel-Lock:\\|^Cancel-Key:\\|^X-Hashcash:\\|^X-Payment:\\|^Approved:\\|^Injection-Date:\\|^Injection-Info:" "*Header lines matching this regexp will be deleted before posting. It's best to delete old Path and Date headers before posting to avoid any confusion." === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/nnimap.el 2010-10-01 00:25:50 +0000 @@ -38,6 +38,7 @@ (require 'nnoo) (require 'netrc) (require 'utf7) +(require 'tls) (require 'parse-time) (autoload 'auth-source-forget-user-or-password "auth-source") @@ -70,8 +71,11 @@ "How mail is split. Uses the same syntax as nnmail-split-methods") +(defvoo nnimap-split-fancy nil + "Uses the same syntax as nnmail-split-fancy.") + (make-obsolete-variable 'nnimap-split-rule "see `nnimap-split-methods'" - "Gnus 5.13") + "Emacs 24.1") (defvoo nnimap-authenticator nil "How nnimap authenticate itself to the server. @@ -306,9 +310,11 @@ (setq port (or nnimap-server-port "imap"))) '("imap")) ((eq nnimap-stream 'starttls) - (starttls-open-stream - "*nnimap*" (current-buffer) nnimap-address - (setq port (or nnimap-server-port "imap"))) + (let ((tls-program (nnimap-extend-tls-programs))) + (open-tls-stream + "*nnimap*" (current-buffer) nnimap-address + (setq port (or nnimap-server-port "imap")) + 'starttls)) '("imap")) ((eq nnimap-stream 'ssl) (open-tls-stream @@ -342,11 +348,23 @@ #'upcase (nnimap-find-parameter "CAPABILITY" (cdr (nnimap-command "CAPABILITY"))))) - (when (eq nnimap-stream 'starttls) - (nnimap-command "STARTTLS") - (starttls-negotiate (nnimap-process nnimap-object))) (when nnimap-server-port (push (format "%s" nnimap-server-port) ports)) + ;; If this is a STARTTLS-capable server, then sever the + ;; connection and start a STARTTLS connection instead. + (when (and (eq nnimap-stream 'network) + (member "STARTTLS" (nnimap-capabilities nnimap-object))) + (let ((nnimap-stream 'starttls)) + (let ((tls-process + (nnimap-open-connection buffer))) + ;; If the STARTTLS connection was successful, we + ;; kill our first non-encrypted connection. If it + ;; wasn't successful, we just use our unencrypted + ;; connection. + (when (memq (process-status tls-process) '(open run)) + (delete-process (nnimap-process nnimap-object)) + (kill-buffer (current-buffer)) + (return tls-process))))) (unless (equal connection-result "PREAUTH") (if (not (setq credentials (if (eq nnimap-authenticator 'anonymous) @@ -378,7 +396,16 @@ (when nnimap-object (when (member "QRESYNC" (nnimap-capabilities nnimap-object)) (nnimap-command "ENABLE QRESYNC")) - t))))))) + (nnimap-process nnimap-object)))))))) + +(defun nnimap-extend-tls-programs () + (let ((programs tls-program) + result) + (unless (consp programs) + (setq programs (list programs))) + (dolist (program programs) + (push (concat program " " "%s") result)) + (nreverse result))) (defun nnimap-find-parameter (parameter elems) (let (result) @@ -729,16 +756,20 @@ (defun nnimap-find-article-by-message-id (group message-id) - (when (nnimap-possibly-change-group group nil) - (with-current-buffer (nnimap-buffer) - (let ((result - (nnimap-command "UID SEARCH HEADER Message-Id %S" message-id)) - article) - (when (car result) - ;; Select the last instance of the message in the group. - (and (setq article - (car (last (assoc "SEARCH" (cdr result))))) - (string-to-number article))))))) + (with-current-buffer (nnimap-buffer) + (erase-buffer) + (setf (nnimap-group nnimap-object) nil) + (nnimap-send-command "EXAMINE %S" (utf7-encode group t)) + (let ((sequence + (nnimap-send-command "UID SEARCH HEADER Message-Id %S" message-id)) + article result) + (setq result (nnimap-wait-for-response sequence)) + (when (and result + (car (setq result (nnimap-parse-response)))) + ;; Select the last instance of the message in the group. + (and (setq article + (car (last (assoc "SEARCH" (cdr result))))) + (string-to-number article)))))) (defun nnimap-delete-article (articles) (with-current-buffer (nnimap-buffer) @@ -796,10 +827,10 @@ (deffoo nnimap-request-accept-article (group &optional server last) (when (nnimap-possibly-change-group nil server) (nnmail-check-syntax) - (nnimap-add-cr) - (let ((message (buffer-string)) - (message-id (message-field-value "message-id")) - sequence) + (let ((message-id (message-field-value "message-id")) + sequence message) + (nnimap-add-cr) + (setq message (buffer-string)) (with-current-buffer (nnimap-buffer) (setq sequence (nnimap-send-command "APPEND %S {%d}" (utf7-encode group t) @@ -1183,11 +1214,11 @@ (goto-char (point-min)) (while (and (memq (process-status process) '(open run)) - (not (re-search-forward "^\\* .*\n" nil t))) + (not (re-search-forward "^[*.] .*\n" nil t))) (nnheader-accept-process-output process) (goto-char (point-min))) (forward-line -1) - (and (looking-at "\\* \\([A-Z0-9]+\\)") + (and (looking-at "[*.] \\([A-Z0-9]+\\)") (match-string 1)))) (defun nnimap-wait-for-response (sequence &optional messagep) @@ -1299,6 +1330,8 @@ (nnmail-split-methods (if (eq nnimap-split-methods 'default) nnmail-split-methods nnimap-split-methods)) + (nnmail-split-fancy (or nnimap-split-fancy + nnmail-split-fancy)) (nnmail-inhibit-default-split-group t) (groups (nnimap-get-groups)) new-articles) === modified file 'lisp/gnus/nnir.el' --- lisp/gnus/nnir.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/nnir.el 2010-10-01 00:25:50 +0000 @@ -881,7 +881,9 @@ (when (file-readable-p (concat prefix dirnam article)) ;; remove trailing slash and, for nnmaildir, cur/new/tmp (setq dirnam - (substring dirnam 0 (if (string= server "nnmaildir:") -5 -1))) + (substring dirnam 0 + (if (string= (gnus-group-server server) "nnmaildir") + -5 -1))) ;; Set group to dirnam without any leading dots or slashes, ;; and with all subsequent slashes replaced by dots @@ -890,7 +892,7 @@ "[/\\]" "." t))) (vector (nnir-group-full-name group server) - (if (string= server "nnmaildir:") + (if (string= (gnus-group-server server) "nnmaildir") (nnmaildir-base-name-to-article-number (substring article 0 (string-match ":" article)) group nil) @@ -1200,7 +1202,7 @@ ;; is sufficient. Note that we can't only use the value of ;; nnml-use-compressed-files because old articles might have been ;; saved with a different value. - (article-pattern (if (string= server "nnmaildir:") + (article-pattern (if (string= (gnus-group-server server) "nnmaildir") ":[0-9]+" "^[0-9]+\\(\\.[a-z0-9]+\\)?$")) score artno dirnam filenam) @@ -1450,7 +1452,7 @@ (when group (error "The Namazu backend cannot search specific groups")) (save-excursion - (let ((article-pattern (if (string= server "nnmaildir:") + (let ((article-pattern (if (string= (gnus-group-server server) "nnmaildir") ":[0-9]+" "^[0-9]+$")) artlist === modified file 'lisp/gnus/nnrss.el' --- lisp/gnus/nnrss.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/nnrss.el 2010-10-01 00:25:50 +0000 @@ -77,7 +77,8 @@ (defvar nnrss-group-alist '() "List of RSS addresses.") -(defvar nnrss-use-local nil) +(defvar nnrss-use-local nil + "If non-nil nnrss will read the feeds from local files in nnrss-directory.") (defvar nnrss-description-field 'X-Gnus-Description "Field name used for DESCRIPTION. === modified file 'lisp/gnus/nntp.el' --- lisp/gnus/nntp.el 2010-09-23 23:14:02 +0000 +++ lisp/gnus/nntp.el 2010-10-01 00:25:50 +0000 @@ -267,6 +267,11 @@ "*Hook run just before posting an article. It is supposed to be used to insert Cancel-Lock headers.") +(defvoo nntp-server-list-active-group 'try + "If nil, then always use GROUP instead of LIST ACTIVE. +This is usually slower, but on misconfigured servers that don't +update their active files often, this can help.") + ;;; Internal variables. (defvar nntp-record-commands nil @@ -296,7 +301,6 @@ (defvoo nntp-inhibit-output nil) (defvoo nntp-server-xover 'try) -(defvoo nntp-server-list-active-group 'try) (defvar nntp-async-timer nil) (defvar nntp-async-process-list nil) === removed file 'lisp/gnus/webmail.el' --- lisp/gnus/webmail.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/webmail.el 1970-01-01 00:00:00 +0000 @@ -1,836 +0,0 @@ -;;; webmail.el --- interface of web mail - -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. - -;; Author: Shenghuo Zhu -;; Keywords: hotmail netaddress - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;; Note: Now mail.yahoo.com provides POP3 service, the webmail -;; fetching is not going to be supported. - -;; Note: You need to have `url' and `w3' installed for this backend to -;; work. `w3' must be 4.0pre46+one-line-cookie patch or standalone -;; `url'. - -;; Todo: To support more web mail servers. - -;; Known bugs: -;; 1. Net@ddress may corrupt `X-Face'. - -;; Warning: -;; Webmail is an experimental function, which means NO WARRANTY. - -;;; Code: - -(eval-when-compile (require 'cl)) - -(require 'nnoo) -(require 'message) -(require 'gnus-util) -(require 'gnus) -(require 'nnmail) -(require 'mm-util) -(require 'mm-url) -(require 'mml) -(eval-when-compile - (ignore-errors - (require 'url) - (require 'url-cookie))) -;; Report failure to find w3 at load time if appropriate. -(eval '(progn - (require 'url) - (require 'url-cookie))) - -;;; - -(defvar webmail-type-definition - '((hotmail - ;; Hotmail hate other HTTP user agents and use one line cookie - (paranoid agent cookie post) - (address . "www.hotmail.com") - (open-url "http://www.hotmail.com/") - (open-snarf . webmail-hotmail-open) - ;; W3 hate redirect POST - (login-url - "http://%s/cgi-bin/dologin?login=%s&passwd=%s&enter=Sign+in&sec=no&curmbox=ACTIVE&_lang=&js=yes&id=2&tw=-10000&beta=" - webmail-aux user password) - ;;(login-snarf . webmail-hotmail-login) - ;;(list-url "%s" webmail-aux) - (list-snarf . webmail-hotmail-list) - (article-snarf . webmail-hotmail-article) - (trash-url - "%s&login=%s&f=33792&curmbox=ACTIVE&_lang=&foo=inbox&js=&page=&%s=on&_HMaction=MoveTo&tobox=trAsH&nullbox=" - webmail-aux user id)) - (yahoo - (paranoid agent cookie post) - (address . "mail.yahoo.com") - (open-url "http://mail.yahoo.com/") - (open-snarf . webmail-yahoo-open) - (login-url;; yahoo will not accept GET - content - ("%s" webmail-aux) - ".tries=&.src=ym&.last=&promo=&.intl=&.bypass=&.partner=&.chkP=Y&.done=&login=%s&passwd=%s" - user password) - (login-snarf . webmail-yahoo-login) - (list-url "%s&rb=Inbox&YN=1" webmail-aux) - (list-snarf . webmail-yahoo-list) - (article-snarf . webmail-yahoo-article) - (trash-url - "%s/ym/ShowFolder?YY=52107&inc=50&order=down&sort=date&pos=0&box=Inbox&DEL=Delete&destBox=&Mid=%s&destBox2=" - webmail-aux id)) - (netaddress - (paranoid cookie post) - (address . "www.netaddress.com") - (open-url "http://www.netaddress.com/") - (open-snarf . webmail-netaddress-open) - (login-url - content - ("%s" webmail-aux) - "LoginState=2&SuccessfulLogin=%%2Ftpl&NewServerName=www.netaddress.com&JavaScript=JavaScript1.2&DomainID=4&Domain=usa.net&NA31site=classic.netaddress.com&NA31port=80&UserID=%s&passwd=%s" - user password) - (login-snarf . webmail-netaddress-login) - (list-url - "http://www.netaddress.com/tpl/Mail/%s/List?FolderID=-4&SortUseCase=True" - webmail-session) - (list-snarf . webmail-netaddress-list) - (article-url "http://www.netaddress.com/") - (article-snarf . webmail-netaddress-article) - (trash-url - "http://www.netaddress.com/tpl/Message/%s/Move?FolderID=-4&Q=%s&N=&Sort=Date&F=-1" - webmail-session id)))) - -(defvar webmail-variables - '(address article-snarf article-url list-snarf list-url - login-url login-snarf open-url open-snarf site articles - post-process paranoid trash-url)) - -(defconst webmail-version "webmail 1.0") - -(defvar webmail-newmail-only nil - "Only fetch new mails.") - -(defvar webmail-move-to-trash-can t - "Move mail to trash can after fetch it.") - -;;; Internal variables - -(defvar webmail-address nil) -(defvar webmail-paranoid nil) -(defvar webmail-aux nil) -(defvar webmail-session nil) -(defvar webmail-article-snarf nil) -(defvar webmail-article-url nil) -(defvar webmail-list-snarf nil) -(defvar webmail-list-url nil) -(defvar webmail-login-url nil) -(defvar webmail-login-snarf nil) -(defvar webmail-open-snarf nil) -(defvar webmail-open-url nil) -(defvar webmail-trash-url nil) -(defvar webmail-articles nil) -(defvar webmail-post-process nil) - -(defvar webmail-buffer nil) -(defvar webmail-buffer-list nil) - -(defvar webmail-type nil) - -(defvar webmail-error-function nil) - -(defvar webmail-debug-file "~/.emacs-webmail-debug") - -;;; Interface functions - -(defun webmail-debug (str) - (with-temp-buffer - (insert "\n---------------- A bug at " str " ------------------\n") - (dolist (sym '(webmail-type user)) - (if (boundp sym) - (gnus-pp `(setq ,sym ',(eval sym))))) - (insert "---------------- webmail buffer ------------------\n\n") - (insert-buffer-substring webmail-buffer) - (insert "\n---------------- end of buffer ------------------\n\n") - (append-to-file (point-min) (point-max) webmail-debug-file))) - -(defun webmail-error (str) - (if webmail-error-function - (funcall webmail-error-function str)) - (message "%s HTML has changed or your w3 package is too old.(%s)" - webmail-type str) - (error "%s HTML has changed or your w3 package is too old.(%s)" - webmail-type str)) - -(defun webmail-setdefault (type) - (let ((type-def (cdr (assq type webmail-type-definition))) - (vars webmail-variables) - pair) - (setq webmail-type type) - (dolist (var vars) - (if (setq pair (assq var type-def)) - (set (intern (concat "webmail-" (symbol-name var))) (cdr pair)) - (set (intern (concat "webmail-" (symbol-name var))) nil))))) - -(defun webmail-eval (expr) - (cond - ((consp expr) - (cons (webmail-eval (car expr)) (webmail-eval (cdr expr)))) - ((symbolp expr) - (eval expr)) - (t - expr))) - -(defun webmail-url (xurl) - (mm-with-unibyte-current-buffer - (cond - ((eq (car xurl) 'content) - (pop xurl) - (mm-url-fetch-simple (if (stringp (car xurl)) - (car xurl) - (apply 'format (webmail-eval (car xurl)))) - (apply 'format (webmail-eval (cdr xurl))))) - ((eq (car xurl) 'post) - (pop xurl) - (mm-url-fetch-form (car xurl) (webmail-eval (cdr xurl)))) - (t - (mm-url-insert (apply 'format (webmail-eval xurl))))))) - -(defun webmail-init () - "Initialize buffers and such." - (if (gnus-buffer-live-p webmail-buffer) - (set-buffer webmail-buffer) - (setq webmail-buffer - (nnheader-set-temp-buffer " *webmail*")) - (mm-disable-multibyte))) - -(defvar url-package-name) -(defvar url-package-version) -(defvar url-cookie-multiple-line) -(defvar url-confirmation-func) - -;; Hack W3 POST redirect. See `url-parse-mime-headers'. -;; -;; Netscape uses "GET" as redirect method when orignal method is POST -;; and status is 302, .i.e no security risks by default without -;; confirmation. -;; -;; Some web servers (at least Apache used by yahoo) return status 302 -;; instead of 303, though they mean 303. - -(defun webmail-url-confirmation-func (prompt) - (cond - ((equal prompt (concat "Honor redirection with non-GET method " - "(possible security risks)? ")) - nil) - ((equal prompt "Continue (with method of GET)? ") - t) - (t (error prompt)))) - -(defun webmail-refresh-redirect () - "Redirect refresh url in META." - (goto-char (point-min)) - (while (re-search-forward - "]*URL=\\([^\"]+\\)\"" - nil t) - (let ((url (match-string 1))) - (erase-buffer) - (mm-with-unibyte-current-buffer - (mm-url-insert url))) - (goto-char (point-min)))) - -(defun webmail-fetch (file subtype user password) - (save-excursion - (webmail-setdefault subtype) - (let ((url-package-name (if (memq 'agent webmail-paranoid) - "Mozilla" - url-package-name)) - (url-package-version (if (memq 'agent webmail-paranoid) - "4.0" - url-package-version)) - (url-cookie-multiple-line (if (memq 'cookie webmail-paranoid) - nil - url-cookie-multiple-line)) - (url-confirmation-func (if (memq 'post webmail-paranoid) - 'webmail-url-confirmation-func - url-confirmation-func)) - (url-http-silence-on-insecure-redirection t) - url-cookie-storage url-cookie-secure-storage - url-cookie-confirmation - item id (n 0)) - (webmail-init) - (setq webmail-articles nil) - (when webmail-open-url - (erase-buffer) - (webmail-url webmail-open-url)) - (if webmail-open-snarf (funcall webmail-open-snarf)) - (when webmail-login-url - (erase-buffer) - (webmail-url webmail-login-url)) - (if webmail-login-snarf - (funcall webmail-login-snarf)) - (when webmail-list-url - (erase-buffer) - (webmail-url webmail-list-url)) - (if webmail-list-snarf - (funcall webmail-list-snarf)) - (while (setq item (pop webmail-articles)) - (message "Fetching mail #%d..." (setq n (1+ n))) - (erase-buffer) - (mm-with-unibyte-current-buffer - (mm-url-insert (cdr item))) - (setq id (car item)) - (if webmail-article-snarf - (funcall webmail-article-snarf file id)) - (when (and webmail-trash-url webmail-move-to-trash-can) - (message "Move mail #%d to trash can..." n) - (condition-case err - (progn - (webmail-url webmail-trash-url) - (let (buf) - (while (setq buf (pop webmail-buffer-list)) - (kill-buffer buf)))) - (error - (let (buf) - (while (setq buf (pop webmail-buffer-list)) - (kill-buffer buf))) - (error err)))))) - (if webmail-post-process - (funcall webmail-post-process)))) - -(defun webmail-encode-8bit () - (goto-char (point-min)) - (skip-chars-forward "^\200-\377") - (while (not (eobp)) - (insert (format "&%d;" (mm-char-int (char-after)))) - (delete-char 1) - (skip-chars-forward "^\200-\377"))) - -;;; hotmail - -(defun webmail-hotmail-open () - (goto-char (point-min)) - (if (re-search-forward - "action=\"https?://\\([^/]+\\)/cgi-bin/dologin" nil t) - (setq webmail-aux (match-string 1)) - (webmail-error "open@1"))) - -(defun webmail-hotmail-login () - (let (site) - (goto-char (point-min)) - (if (re-search-forward - "https?://\\([^/]+hotmail\\.msn\\.com\\)/cgi-bin/" nil t) - (setq site (match-string 1)) - (webmail-error "login@1")) - (goto-char (point-min)) - (if (re-search-forward - "\\(/cgi-bin/HoTMaiL\\?[^\"]*a=b[^\"]*\\)" nil t) - (setq webmail-aux (concat "http://" site (match-string 1))) - (webmail-error "login@2")))) - -(defun webmail-hotmail-list () - (goto-char (point-min)) - (skip-chars-forward " \t\n\r") - (let (site url newp (total "0")) - (if (eobp) - (setq total "0") - (if (re-search-forward "\\([0-9]+\\) *(\\([0-9]+\\) new)" nil t) - (message "Found %s (%s new)" (setq total (match-string 1)) - (match-string 2)) - (if (re-search-forward "\\([0-9]+\\) new" nil t) - (message "Found %s new" (setq total (match-string 1))) - (webmail-error "list@0")))) - (unless (equal total "0") - (goto-char (point-min)) - (if (re-search-forward - "https?://\\([^/]+hotmail\\.msn\\.com\\)/cgi-bin/" nil t) - (setq site (match-string 1)) - (webmail-error "list@1")) - (goto-char (point-min)) - (if (re-search-forward "disk=\\([^&]*\\)&" nil t) - (setq webmail-aux - (concat "http://" site "/cgi-bin/HoTMaiL?disk=" - (match-string 1))) - (webmail-error "list@2")) - (goto-char (point-max)) - (while (re-search-backward - "newmail\\.gif\\|href=\"\\(/cgi-bin/getmsg\\?[^\"]+\\)\"" - nil t) - (if (setq url (match-string 1)) - (progn - (if (or newp (not webmail-newmail-only)) - (let (id) - (if (string-match "msg=\\([^&]+\\)" url) - (setq id (match-string 1 url))) - (push (cons id (concat "http://" site url "&raw=0")) - webmail-articles))) - (setq newp nil)) - (setq newp t)))))) - -;; Thank victor@idaccr.org (Victor S. Miller) for raw=0 - -(defun webmail-hotmail-article (file id) - (goto-char (point-min)) - (skip-chars-forward " \t\n\r") - (unless (eobp) - (if (not (search-forward "
" nil t))
-	(webmail-error "article@3"))
-    (skip-chars-forward "\n\r\t ")
-    (delete-region (point-min) (point))
-    (if (not (search-forward "
" nil t)) - (webmail-error "article@3.1")) - (delete-region (match-beginning 0) (point-max)) - (mm-url-remove-markup) - (mm-url-decode-entities-nbsp) - (goto-char (point-min)) - (while (re-search-forward "\r\n?" nil t) - (replace-match "\n")) - (goto-char (point-min)) - (insert "\n\n") - (if (not (looking-at "\n*From ")) - (insert "From nobody " (current-time-string) "\n") - (forward-line)) - (insert "X-Gnus-Webmail: " (symbol-value 'user) - "@" (symbol-name webmail-type) "\n") - (mm-append-to-file (point-min) (point-max) file))) - -(defun webmail-hotmail-article-old (file id) - (let (p attachment count mime hotmail-direct) - (save-restriction - (webmail-encode-8bit) - (goto-char (point-min)) - (if (not (search-forward "
" nil t)) - (if (not (search-forward "Reply All" nil t)) - (webmail-error "article@1") - (setq hotmail-direct t)) - (goto-char (match-beginning 0))) - (narrow-to-region (point-min) (point)) - (if (not (search-backward "" nil t) - (delete-region p (match-end 0))) - (mm-url-remove-markup) - (mm-url-decode-entities-nbsp) - (goto-char (point-min)) - (delete-blank-lines) - (goto-char (point-min)) - (when (search-forward "\n\n" nil t) - (backward-char) - (delete-region (point) (point-max))) - (goto-char (point-max)) - (widen) - (insert "\n") - (setq p (point)) - (while (re-search-forward - "\\|
\\|\\(http://[^/]+/cgi-bin/getmsg/\\([^\?]+\\)\?[^\"]*\\)\"" - nil t) - (if (setq attachment (match-string 1)) - (let ((filename (match-string 2)) - bufname);; Attachment - (delete-region p (match-end 0)) - (save-excursion - (set-buffer (generate-new-buffer " *webmail-att*")) - (mm-url-insert attachment) - (push (current-buffer) webmail-buffer-list) - (setq bufname (buffer-name))) - (setq mime t) - (insert "<#part type=" - (or (and filename - (string-match "\\.[^\\.]+$" filename) - (mailcap-extension-to-mime - (match-string 0 filename))) - "application/octet-stream")) - (insert " buffer=\"" bufname "\"") - (insert " filename=\"" filename "\"") - (insert " disposition=\"inline\"") - (insert "><#/part>\n") - (setq p (point))) - (delete-region p (match-end 0)) - (if hotmail-direct - (if (not (search-forward "" nil t)) - (webmail-error "article@1.2") - (delete-region (match-beginning 0) (match-end 0))) - (setq count 1) - (while (and (> count 0) - (re-search-forward "
\\|\\(
\\)" nil t)) - (if (match-string 1) - (setq count (1+ count)) - (if (= (setq count (1- count)) 0) - (delete-region (match-beginning 0) - (match-end 0)))))) - (narrow-to-region p (point)) - (goto-char (point-min)) - (cond - ((looking-at "
")
-	    (goto-char (match-end 0))
-	    (if (looking-at "$") (forward-char))
-	    (delete-region (point-min) (point))
-	    (mm-url-remove-markup)
-	    (mm-url-decode-entities-nbsp)
-	    nil)
-	   (t
-	    (setq mime t)
-	    (insert "<#part type=\"text/html\" disposition=inline>")
-	    (goto-char (point-max))
-	    (insert "<#/part>")))
-	  (goto-char (point-max))
-	  (setq p (point))
-	  (widen)))
-      (delete-region p (point-max))
-      (goto-char (point-min))
-      ;; Some blank line to separate mails.
-      (insert "\n\nFrom nobody " (current-time-string) "\n")
-      (insert "X-Gnus-Webmail: " (symbol-value 'user)
-	      "@" (symbol-name webmail-type) "\n")
-      (if id
-	  (insert (format "X-Message-ID: <%s@hotmail.com>\n" id)))
-      (unless (looking-at "$")
-	(if (search-forward "\n\n" nil t)
-	    (forward-line -1)
-	  (webmail-error "article@2")))
-      (narrow-to-region (point) (point-max))
-      (if mime
-	  (insert "MIME-Version: 1.0\n"
-		  (prog1
-		      (mml-generate-mime)
-		    (delete-region (point-min) (point-max)))))
-      (goto-char (point-min))
-      (widen)
-      (let (case-fold-search)
-	(while (re-search-forward "^From " nil t)
-	  (beginning-of-line)
-	  (insert ">"))))
-    (mm-append-to-file (point-min) (point-max) file)))
-
-;;; yahoo
-
-(defun webmail-yahoo-open ()
-  (goto-char (point-min))
-  (if (re-search-forward "action=\"\\([^\"]+\\)\"" nil t)
-      (setq webmail-aux (match-string 1))
-    (webmail-error "open@1")))
-
-(defun webmail-yahoo-login ()
-  (goto-char (point-min))
-  (if (re-search-forward "http://[^/]+[0-9]\\.mail\\.yahoo\\.com/" nil t)
-      (setq webmail-aux (match-string 0))
-    (webmail-error "login@1"))
-  (if (re-search-forward "YY=[0-9]+" nil t)
-      (setq webmail-aux (concat webmail-aux "ym/ShowFolder?"
-				(match-string 0)))
-    (webmail-error "login@2")))
-
-(defun webmail-yahoo-list ()
-  (let (url (newp t) (tofetch 0))
-    (goto-char (point-min))
-    (when (re-search-forward
-	   "showing [0-9]+-\\([0-9]+\\) of \\([0-9]+\\)" nil t)
-      ;;(setq listed (match-string 1))
-      (message "Found %s mail(s)" (match-string 2)))
-    (if (string-match "http://[^/]+" webmail-aux)
-	(setq webmail-aux (match-string 0 webmail-aux))
-      (webmail-error "list@1"))
-    (goto-char (point-min))
-    (while (re-search-forward
-	    "bgcolor=\"#eeeeee\"\\|href=\"\\(/ym/ShowLetter\\?MsgId=\\([^&]+\\)&[^\"]*\\)\""
-	    nil t)
-      (if (setq url (match-string 1))
-	  (progn
-	    (when (or newp (not webmail-newmail-only))
-	      (push (cons (match-string 2) (concat webmail-aux url "&toc=1"))
-		    webmail-articles)
-	      (setq tofetch (1+ tofetch)))
-	    (setq newp t))
-	(setq newp nil)))
-    (setq webmail-articles (nreverse webmail-articles))
-    (message "Fetching %d mail(s)" tofetch)))
-
-(defun webmail-yahoo-article (file id)
-  (let (p attachment)
-    (save-restriction
-      (goto-char (point-min))
-      (if (not (search-forward "value=\"Done\"" nil t))
-	  (webmail-error "article@1"))
-      (if (not (search-forward "" nil t))
-	  (webmail-error "article@3"))
-      (narrow-to-region (point-min) (match-end 0))
-      (while (search-forward "" nil t)
-	(delete-region p (match-end 0)))
-      (mm-url-remove-markup)
-      (mm-url-decode-entities-nbsp)
-      (goto-char (point-min))
-      (delete-blank-lines)
-      (goto-char (point-max))
-      (widen)
-      (insert "\n")
-      (setq p (point))
-      (while (re-search-forward "[^\"]*/ShowLetter/[^\?]+\?[^\"]*" nil t)
-	(setq attachment (match-string 0))
-	(let (bufname ct ctl cd description)
-	  (if (not (search-forward "" nil t))
-	      (webmail-error "article@5"))
-	  (narrow-to-region p (match-end 0))
-	  (mm-url-remove-markup)
-	  (mm-url-decode-entities-nbsp)
-	  (goto-char (point-min))
-	  (delete-blank-lines)
-	  (setq ct (mail-fetch-field "content-type")
-		ctl (and ct (mail-header-parse-content-type ct))
-		;;cte (mail-fetch-field "content-transfer-encoding")
-		cd (mail-fetch-field "content-disposition")
-		description (mail-fetch-field "content-description")
-		id (mail-fetch-field "content-id"))
-	  (delete-region (point-min) (point-max))
-	  (widen)
-	  (save-excursion
-	    (set-buffer (generate-new-buffer " *webmail-att*"))
-	    (mm-url-insert (concat webmail-aux attachment))
-	    (push (current-buffer) webmail-buffer-list)
-	    (setq bufname (buffer-name)))
-	  (insert "<#part")
-	  (if (and ctl (not (equal (car ctl) "text/")))
-	      (insert " type=\"" (car ctl) "\""))
-	  (insert " buffer=\"" bufname "\"")
-	  (if cd
-	      (insert " disposition=\"" cd "\""))
-	  (if description
-	      (insert " description=\"" description "\""))
-	  (insert "><#/part>\n")
-	  (setq p (point))))
-      (delete-region p (point-max))
-      (goto-char (point-min))
-      ;; Some blank line to separate mails.
-      (insert "\n\nFrom nobody " (current-time-string) "\n")
-      (insert "X-Gnus-Webmail: " (symbol-value 'user)
-	      "@" (symbol-name webmail-type) "\n")
-      (if id
-	  (insert (format "X-Message-ID: <%s@yahoo.com>\n" id)))
-      (unless (looking-at "$")
-	(if (search-forward "\n\n" nil t)
-	    (forward-line -1)
-	  (webmail-error "article@2")))
-      (narrow-to-region (point) (point-max))
-      (insert "MIME-Version: 1.0\n"
-	      (prog1
-		  (mml-generate-mime)
-		(delete-region (point-min) (point-max))))
-      (goto-char (point-min))
-      (widen)
-      (let (case-fold-search)
-	(while (re-search-forward "^From " nil t)
-	  (beginning-of-line)
-	  (insert ">"))))
-    (mm-append-to-file (point-min) (point-max) file)))
-
-;;; netaddress
-
-(defun webmail-netaddress-open ()
-  (goto-char (point-min))
-  (if (re-search-forward "action=\"\\([^\"]+\\)\"" nil t)
-      (setq webmail-aux (concat (car webmail-open-url) (match-string 1)))
-    (webmail-error "open@1")))
-
-(defun webmail-netaddress-login ()
-  (webmail-refresh-redirect)
-  (goto-char (point-min))
-  (if (re-search-forward  "tpl/[^/]+/\\([^/]+\\)" nil t)
-      (setq webmail-session (match-string 1))
-    (webmail-error "login@1")))
-
-(defun webmail-netaddress-list ()
-  (webmail-refresh-redirect)
-  (let (item id)
-    (goto-char (point-min))
-    (when (re-search-forward
-	   "(\\([0-9]+\\) unread, \\([0-9]+\\) total)" nil t)
-      (message "Found %s mail(s), %s unread"
-	       (match-string 2) (match-string 1)))
-    (goto-char (point-min))
-    (while (re-search-forward
-	    "MR\\[i\\]\\.R='\\([^']*\\)'\\|MR\\[i\\]\\.Q='\\([^']+\\)'" nil t)
-      (if (setq id (match-string 2))
-	  (setq item
-		(cons id
-		      (format "%s/tpl/Message/%s/Read?Q=%s&FolderID=-4&SortUseCase=True&Sort=Date&Headers=True"
-			      (car webmail-article-url)
-			      webmail-session id)))
-	(if (or (not webmail-newmail-only)
-		(equal (match-string 1) "True"))
-	    (push item webmail-articles))))
-    (setq webmail-articles (nreverse webmail-articles))))
-
-(defun webmail-netaddress-single-part ()
-  (goto-char (point-min))
-  (cond
-   ((looking-at "[\t\040\r\n]*]+>[\t\040\r\n]*")
-    ;; text/plain
-    (replace-match "")
-    (while (re-search-forward "[\t\040\r\n]+" nil t)
-      (replace-match " "))
-    (goto-char (point-min))
-    (while (re-search-forward "
" nil t) - (replace-match "\n")) - (mm-url-remove-markup) - (mm-url-decode-entities-nbsp) - nil) - (t - (insert "<#part type=\"text/html\" disposition=inline>") - (goto-char (point-max)) - (insert "<#/part>") - t))) - -(defun webmail-netaddress-article (file id) - (webmail-refresh-redirect) - (let (p p1 attachment count mime type) - (save-restriction - (webmail-encode-8bit) - (goto-char (point-min)) - (if (not (search-forward "Trash" nil t)) - (webmail-error "article@1")) - (if (not (search-forward "
" nil t)) - (webmail-error "article@2")) - (delete-region (point-min) (match-beginning 0)) - (if (not (search-forward "
" nil t)) - (webmail-error "article@3")) - (narrow-to-region (point-min) (match-end 0)) - (goto-char (point-min)) - (while (re-search-forward "[\040\t\r\n]+" nil t) - (replace-match " ")) - (goto-char (point-min)) - (while (search-forward "" nil t) - (replace-match "\n")) - (mm-url-remove-markup) - (mm-url-decode-entities-nbsp) - (goto-char (point-min)) - (delete-blank-lines) - (goto-char (point-min)) - (while (re-search-forward "^\040+\\|\040+$" nil t) - (replace-match "")) - (goto-char (point-min)) - (while (re-search-forward "\040+" nil t) - (replace-match " ")) - (goto-char (point-max)) - (widen) - (insert "\n\n") - (setq p (point)) - (unless (search-forward "" nil t) - (webmail-error "article@4")) - (forward-line 14) - (delete-region p (point)) - (goto-char (point-max)) - (unless (re-search-backward - "[\040\t]*
[\040\t\r\n]*
[\040\t\r\n]*" - nil t 2) - (setq mime t) - (unless (search-forward "" nil t) - (webmail-error "article@6")) - (setq p1 (point)) - (if (search-backward "" nil t) - (webmail-error "article@8")) - (delete-region p (point)) - (let (bufname);; Attachment - (save-excursion - (set-buffer (generate-new-buffer " *webmail-att*")) - (mm-url-insert (concat (car webmail-open-url) attachment)) - (push (current-buffer) webmail-buffer-list) - (setq bufname (buffer-name))) - (insert "<#part type=" type) - (insert " buffer=\"" bufname "\"") - (insert " disposition=\"inline\"") - (insert "><#/part>\n") - (setq p (point)))) - (delete-region p p1) - (narrow-to-region - p - (if (search-forward - "" - nil t) - (match-beginning 0) - (point-max))) - (webmail-netaddress-single-part) - (goto-char (point-max)) - (setq p (point)) - (widen))) - (unless mime - (narrow-to-region p (point-max)) - (setq mime (webmail-netaddress-single-part)) - (widen)) - (goto-char (point-min)) - ;; Some blank line to separate mails. - (insert "\n\nFrom nobody " (current-time-string) "\n") - (insert "X-Gnus-Webmail: " (symbol-value 'user) - "@" (symbol-name webmail-type) "\n") - (if id - (insert (format "X-Message-ID: <%s@%s>\n" id webmail-address))) - (unless (looking-at "$") - (if (search-forward "\n\n" nil t) - (forward-line -1) - (webmail-error "article@2"))) - (when mime - (narrow-to-region (point-min) (point)) - (goto-char (point-min)) - (while (not (eobp)) - (if (looking-at "MIME-Version\\|Content-Type") - (delete-region (point) - (progn - (forward-line 1) - (if (re-search-forward "^[^ \t]" nil t) - (goto-char (match-beginning 0)) - (point-max)))) - (forward-line 1))) - (goto-char (point-max)) - (widen) - (narrow-to-region (point) (point-max)) - (insert "MIME-Version: 1.0\n" - (prog1 - (mml-generate-mime) - (delete-region (point-min) (point-max)))) - (goto-char (point-min)) - (widen)) - (let (case-fold-search) - (while (re-search-forward "^From " nil t) - (beginning-of-line) - (insert ">")))) - (mm-append-to-file (point-min) (point-max) file))) - -(provide 'webmail) - -;;; webmail.el ends here === modified file 'lisp/net/netrc.el' --- lisp/net/netrc.el 2010-09-26 13:25:35 +0000 +++ lisp/net/netrc.el 2010-10-01 00:25:50 +0000 @@ -131,19 +131,23 @@ ;; No machine name matches, so we look for default entries. (while rest (when (assoc "default" (car rest)) - (push (car rest) result)) + (let ((elem (car rest))) + (setq elem (delete (assoc "default" elem) elem)) + (push elem result))) (pop rest))) (when result (setq result (nreverse result)) - (while (and result - (not (netrc-port-equal - (or port defaultport "nntp") - ;; when port is not given in the netrc file, - ;; it should mean "any port" - (or (netrc-get (car result) "port") - defaultport port)))) - (pop result)) - (car result)))) + (if (not port) + (car result) + (while (and result + (not (netrc-port-equal + (or port defaultport "nntp") + ;; when port is not given in the netrc file, + ;; it should mean "any port" + (or (netrc-get (car result) "port") + defaultport port)))) + (pop result)) + (car result))))) (defun netrc-machine-user-or-password (mode authinfo-file-or-list machines ports defaults) "Get the user name or password according to MODE from AUTHINFO-FILE-OR-LIST. @@ -238,9 +242,11 @@ listed in the PORTS list." (let ((list (netrc-parse)) found) - (while (and ports - (not found)) - (setq found (netrc-machine list machine (pop ports)))) + (if (not ports) + (setq found (netrc-machine list machine)) + (while (and ports + (not found)) + (setq found (netrc-machine list machine (pop ports))))) (when found (list (cdr (assoc "login" found)) (cdr (assoc "password" found)))))) === modified file 'lisp/net/tls.el' --- lisp/net/tls.el 2010-09-26 14:35:50 +0000 +++ lisp/net/tls.el 2010-10-01 00:25:50 +0000 @@ -75,9 +75,14 @@ :type 'regexp :group 'tls) -(defcustom tls-program '("gnutls-cli -p %p %h" - "gnutls-cli -p %p %h --protocols ssl3" - "openssl s_client -connect %h:%p -no_ssl2 -ign_eof") +(defvar tls-starttls-switches + '(("gnutls-cli" "-s") + ("openssl" "-starttls imap")) + "Alist of programs and the switches necessary to get starttls behaviour.") + +(defcustom tls-program '("gnutls-cli %s -p %p %h" + "gnutls-cli %s -p %p %h --protocols ssl3" + "openssl s_client %s -connect %h:%p -no_ssl2 -ign_eof") "List of strings containing commands to start TLS stream to a host. Each entry in the list is tried until a connection is successful. %h is replaced with server hostname, %p with port to connect to. @@ -199,7 +204,7 @@ (push (cons (match-string 1) (match-string 2)) vals)) (nreverse vals)))))) -(defun open-tls-stream (name buffer host port) +(defun open-tls-stream (name buffer host port &optional starttlsp) "Open a TLS connection for a port to a host. Returns a subprocess-object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. @@ -229,6 +234,9 @@ (format-spec cmd (format-spec-make + ?s (if starttlsp + (tls-find-starttls-argument cmd) + "") ?h host ?p (if (integerp port) (int-to-string port) @@ -300,6 +308,11 @@ (kill-buffer buffer)) done)) +(defun tls-find-starttls-argument (command) + (let ((command (car (split-string command)))) + (or (cadr (assoc command tls-starttls-switches)) + ""))) + (provide 'tls) ;;; tls.el ends here ------------------------------------------------------------ revno: 101693 committer: Dan Nicolaescu branch nick: trunk timestamp: Thu 2010-09-30 16:26:40 -0700 message: * src/xml.c (parse_string): Use const. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-30 14:28:22 +0000 +++ src/ChangeLog 2010-09-30 23:26:40 +0000 @@ -1,3 +1,7 @@ +2010-09-30 Dan Nicolaescu + + * xml.c (parse_string): Use const. + 2010-09-30 Lars Magne Ingebrigtsen * eval.c (Fbacktrace): Don't overwrite print-level on exit. Also === modified file 'src/xml.c' --- src/xml.c 2010-09-22 03:10:16 +0000 +++ src/xml.c 2010-09-30 23:26:40 +0000 @@ -80,7 +80,7 @@ xmlNode *node; Lisp_Object result = Qnil; int ibeg, iend; - char *burl = ""; + const char *burl = ""; LIBXML_TEST_VERSION; ------------------------------------------------------------ revno: 101692 committer: Lars Magne Ingebrigtsen branch nick: trunk timestamp: Thu 2010-09-30 16:28:22 +0200 message: (Fbacktrace): Don't overwrite print-level on exit. Also only override Vprint_level if it isn't already bound, and increase the level to 8 to produce more useful backtraces for bug reports. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-09-30 01:20:51 +0000 +++ src/ChangeLog 2010-09-30 14:28:22 +0000 @@ -1,3 +1,9 @@ +2010-09-30 Lars Magne Ingebrigtsen + + * eval.c (Fbacktrace): Don't overwrite print-level on exit. Also + only override Vprint_level if it isn't already bound, and increase + the level to 8 to produce more useful backtraces for bug reports. + 2010-09-30 Dan Nicolaescu * Makefile.in: ecrt0.c does not exist anymore, do not mention it. === modified file 'src/eval.c' --- src/eval.c 2010-09-24 19:30:13 +0000 +++ src/eval.c 2010-09-30 14:28:22 +0000 @@ -3441,8 +3441,10 @@ Lisp_Object tail; Lisp_Object tem; struct gcpro gcpro1; + Lisp_Object old_print_level = Vprint_level; - XSETFASTINT (Vprint_level, 3); + if (NILP (Vprint_level)) + XSETFASTINT (Vprint_level, 8); tail = Qnil; GCPRO1 (tail); @@ -3483,7 +3485,7 @@ backlist = backlist->next; } - Vprint_level = Qnil; + Vprint_level = old_print_level; UNGCPRO; return Qnil; } ------------------------------------------------------------ revno: 101691 committer: Eli Zaretskii branch nick: trunk timestamp: Thu 2010-09-30 14:44:25 +0200 message: Fix documentation of VC status indicator in mode line. lisp/vc/vc-hooks.el (vc-default-mode-line-string): Doc fix. doc/emacs/maintaining.texi (VC Mode Line): Mention all the possible VC status indicator characters. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2010-09-29 04:25:59 +0000 +++ doc/emacs/ChangeLog 2010-09-30 12:44:25 +0000 @@ -1,3 +1,8 @@ +2010-09-30 Eli Zaretskii + + * maintaining.texi (VC Mode Line): Mention all the possible VC status + indicator characters. + 2010-09-29 Glenn Morris * Makefile.in (top_srcdir): Remove unused variable. === modified file 'doc/emacs/maintaining.texi' --- doc/emacs/maintaining.texi 2010-06-23 02:46:43 +0000 +++ doc/emacs/maintaining.texi 2010-09-30 12:44:25 +0000 @@ -362,10 +362,16 @@ @node VC Mode Line @subsection Version Control and the Mode Line +@cindex VC, mode line indicator When you visit a file that is under version control, Emacs indicates -this on the mode line. For example, @samp{RCS-1.3} says that RCS is -used for that file, and the current version is 1.3. +this on the mode line. For example, @samp{RCS-1.3} says that the RCS +back end is used for that file, and the current version of the file is +1.3. + + The first part of the VC mode-line indicator is the name of the back +end: @samp{RCS}, @samp{CVS}, @samp{Bzr}, etc. The back-end name is +followed by a single character and the version of the file. The character between the back-end name and the revision ID indicates the version control status of the file. @samp{-} means that @@ -373,6 +379,12 @@ locking is not in use). @samp{:} indicates that the file is locked, or that it is modified. If the file is locked by some other user (for instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}. +@samp{@@} means that the file was locally added, but not yet committed +to the master repository. @samp{!} indicates that the file contains +conflicts as result of a recent merge operation (@pxref{Merging}), or +that the file was removed from the version control. Finally, @samp{?} +means that the file is under version control, but is missing from the +working tree. On a graphical display, you can move the mouse over this mode line indicator to pop up a ``tool-tip'', which displays a more verbose === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-09-30 02:53:26 +0000 +++ lisp/ChangeLog 2010-09-30 12:44:25 +0000 @@ -1,3 +1,7 @@ +2010-09-30 Eli Zaretskii + + * vc/vc-hooks.el (vc-default-mode-line-string): Doc fix. + 2010-09-30 Juanma Barranquero * server.el (server-start): Don't write pid to the authentication file. === modified file 'lisp/vc/vc-hooks.el' --- lisp/vc/vc-hooks.el 2010-08-29 16:17:13 +0000 +++ lisp/vc/vc-hooks.el 2010-09-30 12:44:25 +0000 @@ -815,6 +815,9 @@ \"BACKEND-REV\" if the file is up-to-date \"BACKEND:REV\" if the file is edited (or locked by the calling user) \"BACKEND:LOCKER:REV\" if the file is locked by somebody else + \"BACKEND@REV\" if the file was locally added + \"BACKEND!REV\" if the file contains conflicts or was removed + \"BACKEND?REV\" if the file is under VC, but is missing This function assumes that the file is registered." (let* ((backend-name (symbol-name backend)) ------------------------------------------------------------ revno: 101690 author: Julien Danjou committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2010-09-30 10:25:45 +0000 message: gnus-agent.el (gnus-agent-add-group): Fix call to gnus-completing-read. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2010-09-29 13:38:27 +0000 +++ lisp/gnus/ChangeLog 2010-09-30 10:25:45 +0000 @@ -1,3 +1,54 @@ +2010-09-30 Julien Danjou + + * gnus-agent.el (gnus-agent-add-group): Fix call to + gnus-completing-read. + +2010-09-29 Lars Magne Ingebrigtsen + + * nndoc.el (nndoc-retrieve-groups): New function. + + * nnimap.el (nnimap-split-incoming-mail): If nnimap-split-methods is + `default', use nnmail-split-methods. + (nnimap-request-article): Downcase the NILs so that they are nil. + + * gnus-sum.el (gnus-valid-move-group-p): Make sure that `group' is a + symbol. + + * nnimap.el (nnimap-open-connection): Revert the auto-network->starttls + code, since if the user has requested network, that's what they ought + to get. + (nnimap-request-set-mark): Erase the buffer before issuing commands. + (nnimap-split-rule): Mark as obsolete. + + * pop3.el (pop3-send-streaming-command, pop3-stream-length): New + variable. + + * nnimap.el (nnimap-insert-partial-structure): Get the type from the + correct slot, too. + +2010-09-29 Julien Danjou + + * gnus.el (gnus-local-domain): Declare variable obsolete. + + * gnus-util.el (gnus-icompleting-read): Require iswitchb. Fix history + computing. + (gnus-ido-completing-read): Require ido. + +2010-09-29 Lars Magne Ingebrigtsen + + * gnus-registry.el: Don't prompt on load, which makes it impossible to + build Gnus. + + * nnimap.el (nnimap-insert-partial-structure): Be way more permissive + when interpreting the structures. + (nnimap-request-accept-article): Add \r\n to the lines to make this + work with Cyrus. + + * nnregistry.el: Added. + + * nndraft.el (nndraft-request-expire-articles): Use the group name + instead if "nndraft". Fix found by Nils Ackermann. + 2010-09-29 Stefan Monnier * nnmail.el (group, group-art-list, group-art): @@ -13,6 +64,24 @@ * nnrss.el (nnrss-read-server-data, nnrss-read-group-data): Use `load' rather than `insert-file-contents' and `eval-region'. +2010-09-29 Julien Danjou + + * gnus-gravatar.el (gnus-gravatar-properties): Add this properties in + replacement of `gnus-gravatar-relief' to mimic + `gnus-faces-properties-alist'. + Add :version property. + +2010-09-28 Florian Ragwitz + + * gnus-util.el (gnus-use-ido): Removed. + (gnus-std-completing-read): Add wrapper around completing-read. + (gnus-icompleting-read): Add wrapper around ibuffer-read-buffer. + (gnus-ido-completing-read): Add wrapper around ido-completing-read. + (gnus-completing-read-function): Add to chose from the above completion + functions or to provide a custom one. + (gnus-completing-read): Use the completing-read function configured + with gnus-completing-read-function. + 2010-09-28 Katsumi Yamaoka * mail-source.el (mail-source-report-new-mail) @@ -32,6 +101,82 @@ * gnus-gravatar.el (gnus-gravatar-insert): Search backward for real-name, and then for mail address rather than doing : or , search. +2010-09-27 Julien Danjou + + * gnus-srvr.el (gnus-server-add-server): Use gnus-completing-read. + (gnus-server-goto-server): Use gnus-completing-read. + + * mm-view.el (mm-view-pkcs7-decrypt): Use gnus-completing-read. + + * mm-util.el (defalias): Use gnus-completing-read. + (mm-codepage-setup): Use gnus-completing-read. + + * smime.el (smime-sign-buffer): Use gnus-completing-read. + (smime-decrypt-buffer): Use gnus-completing-read. + + * mml-smime.el (mml-smime-openssl-sign-query): Use gnus-completing-read. + + * mml.el (mml-minibuffer-read-type): Use gnus-completing-read. + (mml-minibuffer-read-disposition): Use gnus-completing-read. + (mml-insert-multipart): Use gnus-completing-read. + + * gnus-msg.el (gnus-summary-yank-message): Use gnus-completing-read. + + * gnus-int.el (gnus-start-news-server): Use gnus-completing-read. + + * mm-decode.el (mm-interactively-view-part): Use gnus-completing-read. + + * gnus-dired.el (gnus-dired-attach): Use gnus-completing-read. + + * gnus.el (gnus-read-method): Use gnus-completing-read. + + * gnus-bookmark.el (gnus-bookmark-jump): Use gnus-completing-read. + + * gnus-art.el (gnus-mime-view-part-as-type): Use gnus-completing-read. + (gnus-mime-action-on-part): Use gnus-completing-read. + (gnus-article-encrypt-body): Use gnus-completing-read. + + * gnus-topic.el (gnus-topic-jump-to-topic): Use gnus-completing-read. + (gnus-topic-move-matching): Use gnus-completing-read. + (gnus-topic-copy-matching): Use gnus-completing-read. + (gnus-topic-sort-topics): Use gnus-completing-read. + (gnus-topic-move): Use gnus-completing-read. + + * gnus-agent.el (gnus-agent-read-group): Remove prompt computing. + (gnus-agent-add-group): Use gnus-completing-read. + + * nnmairix.el (nnmairix-create-server-and-default-group): Use + gnus-completing-read. + (nnmairix-update-groups): Use gnus-completing-read. + (nnmairix-get-server): Use gnus-completing-read. + (nnmairix-backend-to-server): Use gnus-completing-read. + (nnmairix-goto-original-article): Use gnus-completing-read. + (nnmairix-get-group-from-file-path): Use gnus-completing-read. + + * nnrss.el (nnrss-find-rss-via-syndic8): Use gnus-completing-read. + + * gnus-group.el (gnus-group-completing-read): Use gnus-completing-read. + (gnus-group-make-useful-group): Use gnus-completing-read. + (gnus-group-make-web-group): Use gnus-completing-read. + (gnus-group-add-to-virtual): Use gnus-completing-read. + (gnus-group-browse-foreign-server): Use gnus-completing-read. + + * gnus-sum.el (gnus-summary-goto-article): Use gnus-completing-read. + (gnus-summary-limit-to-extra): Use gnus-completing-read. + (gnus-summary-execute-command): Use gnus-completing-read. + (gnus-summary-respool-article): Use gnus-completing-read. + (gnus-read-move-group-name): Use gnus-completing-read. + + * gnus-score.el (gnus-summary-increase-score): Use gnus-completing-read. + (gnus-summary-score-effect): Use gnus-completing-read. + + * gnus-registry.el (gnus-registry-read-mark): Use gnus-completing-read. + + * gnus-util.el (gnus-completing-read): Use gnus-use-ido to apply the + right completing-read function. + (gnus-use-ido): New variable + (gnus-completing-read-with-default): Remove. + 2010-09-28 Katsumi Yamaoka * nnimap.el (auth-source-forget-user-or-password) === modified file 'lisp/gnus/gnus-agent.el' --- lisp/gnus/gnus-agent.el 2010-09-30 08:39:23 +0000 +++ lisp/gnus/gnus-agent.el 2010-09-30 10:25:45 +0000 @@ -817,7 +817,7 @@ "Add to category" (mapcar (lambda (cat) (symbol-name (car cat))) gnus-category-alist) - nil t)) + t)) current-prefix-arg)) (let ((cat (assq category gnus-category-alist)) c groups) ------------------------------------------------------------ revno: 101689 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Thu 2010-09-30 08:39:23 +0000 message: Merge changes made in Gnus trunk. nndraft.el (nndraft-request-expire-articles): Use the group name instead if "nndraft". gnus.texi (Using IMAP): Remove the @acronyms from the headings. nnregistry.el: Added. nnimap.el (nnimap-insert-partial-structure): Be way more permissive when interpreting the structures. GNUS-NEWS: Minor error in GNUS-NEWS - password-cache.el. nnimap.el (nnimap-request-accept-article): Add \r\n to the lines to make this work with Cyrus. gnus-registry.el: Don't prompt on load, which makes it impossible to build Gnus. gnus-gravatar.el: Add gnus-gravatar-properties. gnus-agent.el, gnus-art.el, gnus-bookmark.el, gnus-dired.el, gnus-group.el,\ gnus-int.el, gnus-msg.el, gnus-registry.el, gnus-score.el, gnus-srvr.el,\ gnus-sum.el, gnus-topic.el, gnus-util.el, gnus.el, mm-decode.el, mm-util.el,\ mm-view.el, mml-smime.el, mml.el, nnmairix.el, nnrss.el, smime.el:\ Introduce gnus-completing-read. gnus-util.el: Make completing-read function configurable. gnus-util.el: Add requires and fix history for iswitchb. webmail.el: Remove netscape/my-deja, since they no longer exist. gnus.el (gnus-local-domain): Declare variable obsolete. nnimap.el (nnimap-insert-partial-structure): Get the type from the correct slot, too. pop3.el (pop3-send-streaming-command, pop3-stream-length): New variable. nnimap.el (nnimap-open-connection): Revert the auto-network->starttls code. nnimap.el (nnimap-request-set-mark): Erase the buffer before issuing commands. nnimap.el (nnimap-split-rule): Mark as obsolete. gnus-sum.el (gnus-valid-move-group-p): Make sure that `group' is a symbol. nnimap.el (nnimap-split-incoming-mail): Allow `default' as nnimap-split-methods value. nnimap.el (nnimap-request-article): Downcase the NILs so that they are nil. nndoc.el (nndoc-retrieve-groups): New function. gnus.texi: Fix Gravatar documentation. diff: === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2010-09-26 23:01:31 +0000 +++ doc/misc/gnus.texi 2010-09-30 08:39:23 +0000 @@ -629,7 +629,7 @@ * Server Buffer:: Making and editing virtual servers. * Getting News:: Reading USENET news with Gnus. -* Using @acronym{IMAP}:: Reading mail from @acronym{IMAP}. +* Using IMAP:: Reading mail from @acronym{IMAP}. * Getting Mail:: Reading your personal mail with Gnus. * Browsing the Web:: Getting messages from a plethora of Web sources. * Other Sources:: Reading directories, files. @@ -10797,7 +10797,7 @@ @item A C @vindex gnus-fetch-partial-articles @findex gnus-summary-show-complete-article -If @code{gnus-fetch-partial-articles} is non-@code{nil}, Gnus will +If @code{-fetch-partial-articles} is non-@code{nil}, Gnus will fetch partial articles, if the backend it fetches them from supports it. Currently only @code{nnimap} does. If you're looking at a partial article, and want to see the complete article instead, then @@ -13700,7 +13700,7 @@ @menu * Server Buffer:: Making and editing virtual servers. * Getting News:: Reading USENET news with Gnus. -* Using @acronym{IMAP}:: Reading mail from @acronym{IMAP}. +* Using IMAP:: Reading mail from @acronym{IMAP}. * Getting Mail:: Reading your personal mail with Gnus. * Browsing the Web:: Getting messages from a plethora of Web sources. * Other Sources:: Reading directories, files. @@ -14787,8 +14787,8 @@ @end table -@node Using @acronym{IMAP} -@section Using @acronym{IMAP} +@node Using IMAP +@section Using IMAP @cindex imap The most popular mail backend is probably @code{nnimap}, which @@ -14798,14 +14798,14 @@ from different locations, or with different user agents. @menu -* Connecting to an @acronym{IMAP} Server:: Getting started with @acronym{IMAP}. -* Customizing the @acronym{IMAP} Connection:: Variables for @acronym{IMAP} connection. -* Client-Side @acronym{IMAP} Splitting:: Put mail in the correct mail box. +* Connecting to an IMAP Server:: Getting started with @acronym{IMAP}. +* Customizing the IMAP Connection:: Variables for @acronym{IMAP} connection. +* Client-Side IMAP Splitting:: Put mail in the correct mail box. @end menu -@node Connecting to an @acronym{IMAP} Server -@subsection Connecting to an @acronym{IMAP} Server +@node Connecting to an IMAP Server +@subsection Connecting to an IMAP Server Connecting to an @acronym{IMAP} can be very easy. Type @kbd{B} in the group buffer, or (if your primary interest is reading email), say @@ -14826,15 +14826,15 @@ That should basically be it for most users. -@node Customizing the @acronym{IMAP} Connection -@subsection Customizing the @acronym{IMAP} Connection +@node Customizing the IMAP Connection +@subsection Customizing the IMAP Connection Here's an example method that's more complex: @example (nnimap "imap.gmail.com" (nnimap-inbox "INBOX") - (nnimap-split-methods ,nnmail-split-methods) + (nnimap-split-methods default) (nnimap-expunge t) (nnimap-stream 'ssl) (nnir-search-engine imap) @@ -14878,11 +14878,17 @@ Virtually all @code{IMAP} server support fast streaming of data. If you have problems connecting to the server, try setting this to @code{nil}. +@item nnimap-fetch-partial-articles +If non-@code{nil}, fetch partial articles from the server. If set to +a string, then it's interpreted as a regexp, and parts that have +matching types will be fetched. For instance, @samp{"text/"} will +fetch all textual parts, while leaving the rest on the server. + @end table -@node Client-Side @acronym{IMAP} Splitting -@subsection Client-Side @acronym{IMAP} Splitting +@node Client-Side IMAP Splitting +@subsection Client-Side IMAP Splitting Many people prefer to do the sorting/splitting of mail into their mail boxes on the @acronym{IMAP} server. That way they don't have to @@ -14897,7 +14903,8 @@ @item nnimap-split-methods Uses the same syntax as @code{nnmail-split-methods} (@pxref{Splitting -Mail}). +Mail}), except the symbol @code{default}, which means that it should +use the value of the @code{nnmail-split-methods} variable. @end table @@ -15460,7 +15467,7 @@ @acronym{IMAP} as intended, as a network mail reading protocol (ie with nnimap), for some reason or other, Gnus let you treat it similar to a @acronym{POP} server and fetches articles from a given -@acronym{IMAP} mailbox. @xref{Using @acronym{IMAP}}, for more information. +@acronym{IMAP} mailbox. @xref{Using IMAP}, for more information. Keywords: @@ -15929,7 +15936,7 @@ above. Also note that with the nnimap backend, message bodies will not be downloaded by default. You need to set @code{nnimap-split-download-body} to @code{t} to do that -(@pxref{Client-Side @acronym{IMAP} Splitting}). +(@pxref{Client-Side IMAP Splitting}). @item (! @var{func} @var{split}) If the split is a list, and the first element is @code{!}, then @@ -23263,12 +23270,9 @@ The size in pixels of gravatars. Gravatars are always square, so one number for the size is enough. -@item gnus-gravatar-relief -@vindex gnus-gravatar-relief -If non-nil, adds a shadow rectangle around the image. The value, -relief, specifies the width of the shadow lines, in pixels. If relief -is negative, shadows are drawn so that the image appears as a pressed -button; otherwise, it appears as an unpressed button. +@item gnus-gravatar-properties +@vindex gnus-gravatar-properties +List of image properties applied to Gravatar images. @end table @@ -23618,7 +23622,7 @@ Note that with the nnimap back end, message bodies will not be downloaded by default. You need to set @code{nnimap-split-download-body} to @code{t} to do that -(@pxref{Client-Side @acronym{IMAP} Splitting}). +(@pxref{Client-Side IMAP Splitting}). That is about it. As some spam is likely to get through anyway, you might want to have a nifty function to call when you happen to read @@ -23907,7 +23911,7 @@ retrieve the message bodies as well. We don't set this by default because it will slow @acronym{IMAP} down, and that is not an appropriate decision to make on behalf of the user. @xref{Client-Side -@acronym{IMAP} Splitting}. +IMAP Splitting}. You have to specify one or more spam back ends for @code{spam-split} to use, by setting the @code{spam-use-*} variables. @xref{Spam Back === modified file 'etc/GNUS-NEWS' --- etc/GNUS-NEWS 2010-01-13 08:35:10 +0000 +++ etc/GNUS-NEWS 2010-09-30 08:39:23 +0000 @@ -50,7 +50,7 @@ The primary change this brings is support for DIGEST-MD5 and NTLM, when the server supports it. -** Gnus includes a password cache mechanism in password.el. +** Gnus includes a password cache mechanism in password-cache.el. It is enabled by default (see `password-cache'), with a short timeout of 16 seconds (see `password-cache-expiry'). If PGG is used as the PGP === modified file 'lisp/gnus/gnus-agent.el' --- lisp/gnus/gnus-agent.el 2010-09-26 23:01:31 +0000 +++ lisp/gnus/gnus-agent.el 2010-09-30 08:39:23 +0000 @@ -459,10 +459,7 @@ (let ((def (or (gnus-group-group-name) gnus-newsgroup-name))) (when def (setq def (gnus-group-decoded-name def))) - (gnus-group-completing-read (if def - (concat "Group Name (" def "): ") - "Group Name: ") - nil nil t nil nil def))) + (gnus-group-completing-read nil nil t nil nil def))) ;;; Fetching setup functions. @@ -816,9 +813,9 @@ (interactive (list (intern - (completing-read - "Add to category: " - (mapcar (lambda (cat) (list (symbol-name (car cat)))) + (gnus-completing-read + "Add to category" + (mapcar (lambda (cat) (symbol-name (car cat))) gnus-category-alist) nil t)) current-prefix-arg)) === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2010-09-27 23:07:47 +0000 +++ lisp/gnus/gnus-art.el 2010-09-30 08:39:23 +0000 @@ -5131,11 +5131,10 @@ (unless mime-type (setq mime-type (let ((default (gnus-mime-view-part-as-type-internal))) - (completing-read - (format "View as MIME type (default %s): " - (car default)) - (mapcar #'list (mailcap-mime-types)) - pred nil nil nil + (gnus-completing-read + "View as MIME type" + (remove-if-not pred (mailcap-mime-types)) + nil nil nil (car default))))) (gnus-article-check-buffer) (let ((handle (get-text-property (point) 'gnus-data))) @@ -5404,7 +5403,7 @@ (defun gnus-mime-action-on-part (&optional action) "Do something with the MIME attachment at \(point\)." (interactive - (list (completing-read "Action: " gnus-mime-action-alist nil t))) + (list (gnus-completing-read "Action" (mapcar 'car gnus-mime-action-alist) t))) (gnus-article-check-buffer) (let ((action-pair (assoc action gnus-mime-action-alist))) (if action-pair @@ -8370,9 +8369,9 @@ (interactive (list (or gnus-article-encrypt-protocol - (completing-read "Encrypt protocol: " - gnus-article-encrypt-protocol-alist - nil t)) + (gnus-completing-read "Encrypt protocol" + (mapcar 'car gnus-article-encrypt-protocol-alist) + t)) current-prefix-arg)) ;; User might hit `K E' instead of `K e', so prompt once. (when (and gnus-article-encrypt-protocol === modified file 'lisp/gnus/gnus-bookmark.el' --- lisp/gnus/gnus-bookmark.el 2010-09-25 13:28:07 +0000 +++ lisp/gnus/gnus-bookmark.el 2010-09-30 08:39:23 +0000 @@ -289,8 +289,8 @@ (interactive) (gnus-bookmark-maybe-load-default-file) (let* ((bookmark (or bmk-name - (completing-read "Jump to bookmarked article: " - gnus-bookmark-alist))) + (gnus-completing-read "Jump to bookmarked article" + (mapcar 'car gnus-bookmark-alist)))) (bmk-record (cadr (assoc bookmark gnus-bookmark-alist))) (group (cdr (assoc 'group bmk-record))) (message-id (cdr (assoc 'message-id bmk-record)))) === modified file 'lisp/gnus/gnus-diary.el' --- lisp/gnus/gnus-diary.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/gnus-diary.el 2010-09-30 08:39:23 +0000 @@ -368,11 +368,11 @@ header ": "))) (setq value (if (listp (nth 1 head)) - (completing-read prompt (cons '("*" nil) (nth 1 head)) - nil t value - gnus-diary-header-value-history) + (gnus-completing-read prompt (cons '("*" nil) (nth 1 head)) + t value + 'gnus-diary-header-value-history) (read-string prompt value - gnus-diary-header-value-history)))) + 'gnus-diary-header-value-history)))) (setq ask nil) (setq invalid nil) (condition-case () === modified file 'lisp/gnus/gnus-dired.el' --- lisp/gnus/gnus-dired.el 2010-09-02 01:42:32 +0000 +++ lisp/gnus/gnus-dired.el 2010-09-30 08:39:23 +0000 @@ -152,12 +152,8 @@ (setq destination (if (= (length bufs) 1) (get-buffer (car bufs)) - (completing-read "Attach to which mail composition buffer: " - (mapcar - (lambda (b) - (cons b (get-buffer b))) - bufs) - nil t))) + (gnus-completing-read "Attach to which mail composition buffer" + bufs t))) ;; setup a new mail composition buffer (let ((mail-user-agent gnus-dired-mail-mode) ;; A workaround to prevent Gnus from displaying the Gnus === modified file 'lisp/gnus/gnus-gravatar.el' --- lisp/gnus/gnus-gravatar.el 2010-09-28 11:47:12 +0000 +++ lisp/gnus/gnus-gravatar.el 2010-09-30 08:39:23 +0000 @@ -33,14 +33,13 @@ (defcustom gnus-gravatar-size 32 "How big should gravatars be displayed." :type 'integer + :version "24.1" :group 'gnus-gravatar) -(defcustom gnus-gravatar-relief 1 - "If non-nil, adds a shadow rectangle around the image. The -value, relief, specifies the width of the shadow lines, in -pixels. If relief is negative, shadows are drawn so that the -image appears as a pressed button; otherwise, it appears as an -unpressed button." +(defcustom gnus-gravatar-properties '(:ascent center :relief 1) + "List of image properties applied to Gravatar images." + :type 'list + :version "24.1" :group 'gnus-gravatar) (defun gnus-gravatar-transform-address (header category) @@ -88,7 +87,7 @@ (point (point)) (gravatar (append gravatar - `(:ascent center :relief ,gnus-gravatar-relief)))) + gnus-gravatar-properties))) (gnus-put-image gravatar nil category) (put-text-property point (point) 'gnus-gravatar address) (gnus-add-wash-type category) === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/gnus-group.el 2010-09-30 08:39:23 +0000 @@ -2164,44 +2164,35 @@ group))) (goto-char start))))) -(defun gnus-group-completing-read (prompt &optional collection predicate - require-match initial-input hist def - &rest args) +(defun gnus-group-completing-read (&optional prompt collection + require-match initial-input hist def) "Read a group name with completion. Non-ASCII group names are allowed. The arguments are the same as `completing-read' except that COLLECTION and HIST default to `gnus-active-hashtb' and `gnus-group-history' respectively if they are omitted." - (let ((completion-styles (and (boundp 'completion-styles) - completion-styles)) - group) - (push 'substring completion-styles) - (mapatoms (lambda (symbol) - (setq group (symbol-name symbol)) - (set (intern (if (string-match "[^\000-\177]" group) - (gnus-group-decoded-name group) - group) - collection) - group)) - (prog1 - (or collection - (setq collection (or gnus-active-hashtb [0]))) - (setq collection (gnus-make-hashtable (length collection))))) - (setq group (apply 'completing-read prompt collection predicate - require-match initial-input - (or hist 'gnus-group-history) - def args)) - (or (prog1 - (symbol-value (intern-soft group collection)) - (setq collection nil)) - (mm-encode-coding-string group (gnus-group-name-charset nil group))))) + (let* ((choices (mapcar (lambda (symbol) + (let ((group (symbol-name symbol))) + (if (string-match "[^\000-\177]" group) + (gnus-group-decoded-name group) + group))) + (remove-if-not + 'symbolp + (or collection (or gnus-active-hashtb [0]))))) + (group + (gnus-completing-read (or prompt "Group") choices + require-match initial-input + (or hist 'gnus-group-history) + def))) + (or (symbol-value (intern-soft group collection)) + (mm-encode-coding-string group (gnus-group-name-charset nil group))))) ;;;###autoload (defun gnus-fetch-group (group &optional articles) "Start Gnus if necessary and enter GROUP. If ARTICLES, display those articles. Returns whether the fetching was successful or not." - (interactive (list (gnus-group-completing-read "Group name: " - nil nil nil + (interactive (list (gnus-group-completing-read nil + nil nil (gnus-group-name-at-point)))) (unless (gnus-alive-p) (gnus-no-server)) @@ -2261,7 +2252,7 @@ (interactive (list ;; (gnus-read-group "Group name: ") - (gnus-group-completing-read "Group: ") + (gnus-group-completing-read) (gnus-read-method "From method: "))) ;; Transform the select method into a unique server. (when (stringp method) @@ -2328,7 +2319,7 @@ ;; See for more information. (interactive (list - (gnus-group-completing-read "Gmane group: ") + (gnus-group-completing-read "Gmane group") (read-number "Start article number: ") (read-number "How many articles: "))) (unless range (setq range 500)) @@ -2362,7 +2353,7 @@ ;; prompt the user to decide: "View via `browse-url' or in Gnus? " ;; (`gnus-read-ephemeral-gmane-group-url') (interactive - (list (gnus-group-completing-read "Gmane URL: "))) + (list (gnus-group-completing-read "Gmane URL"))) (let (group start range) (cond ;; URLs providing `group', `start' and `range': @@ -2456,13 +2447,13 @@ `gnus-group-jump-to-group-prompt'." (interactive (list (gnus-group-completing-read - "Group: " nil nil (gnus-read-active-file-p) - (if current-prefix-arg - (cdr (assq current-prefix-arg gnus-group-jump-to-group-prompt)) - (or (and (stringp gnus-group-jump-to-group-prompt) - gnus-group-jump-to-group-prompt) - (let ((p (cdr (assq 0 gnus-group-jump-to-group-prompt)))) - (and (stringp p) p))))))) + nil nil (gnus-read-active-file-p) + (if current-prefix-arg + (cdr (assq current-prefix-arg gnus-group-jump-to-group-prompt)) + (or (and (stringp gnus-group-jump-to-group-prompt) + gnus-group-jump-to-group-prompt) + (let ((p (cdr (assq 0 gnus-group-jump-to-group-prompt)))) + (and (stringp p) p))))))) (when (equal group "") (error "Empty group name")) @@ -2653,7 +2644,7 @@ (defun gnus-group-make-group-simple (&optional group) "Add a new newsgroup. The user will be prompted for GROUP." - (interactive (list (gnus-group-completing-read "Group: "))) + (interactive (list (gnus-group-completing-read))) (gnus-group-make-group (gnus-group-real-name group) (gnus-group-server group) nil nil t)) @@ -2912,8 +2903,9 @@ (defun gnus-group-make-useful-group (group method) "Create one of the groups described in `gnus-useful-groups'." (interactive - (let ((entry (assoc (completing-read "Create group: " gnus-useful-groups - nil t) + (let ((entry (assoc (gnus-completing-read "Create group" + (mapcar 'car gnus-useful-groups) + t) gnus-useful-groups))) (list (cadr entry) ;; Don't use `caddr' here since macros within the `interactive' @@ -3005,11 +2997,11 @@ (symbol-name (caar nnweb-type-definition)))) (type (gnus-string-or - (completing-read - (format "Search engine type (default %s): " default-type) - (mapcar (lambda (elem) (list (symbol-name (car elem)))) + (gnus-completing-read + "Search engine type" + (mapcar (lambda (elem) (symbol-name (car elem))) nnweb-type-definition) - nil t nil 'gnus-group-web-type-history) + t nil 'gnus-group-web-type-history) default-type)) (search (read-string @@ -3100,8 +3092,8 @@ "Add the current group to a virtual group." (interactive (list current-prefix-arg - (completing-read "Add to virtual group: " gnus-newsrc-hashtb nil t - "nnvirtual:"))) + (gnus-group-completing-read "Add to virtual group" + nil t "nnvirtual:"))) (unless (eq (car (gnus-find-method-for-group vgroup)) 'nnvirtual) (error "%s is not an nnvirtual group" vgroup)) (gnus-close-group vgroup) @@ -3672,7 +3664,7 @@ Killed newsgroups are subscribed. If SILENT, don't try to update the group line." (interactive (list (gnus-group-completing-read - "Group: " nil nil (gnus-read-active-file-p)))) + nil (gnus-read-active-file-p)))) (let ((newsrc (gnus-group-entry group))) (cond ((string-match "^[ \t]*$" group) @@ -4013,7 +4005,7 @@ If given a prefix argument, prompt for a group." (interactive (list (or (when current-prefix-arg - (gnus-group-completing-read "Group: ")) + (gnus-group-completing-read)) (gnus-group-group-name) gnus-newsgroup-name))) (unless group @@ -4314,18 +4306,18 @@ If not, METHOD should be a list where the first element is the method and the second element is the address." (interactive - (list (let ((how (completing-read - "Which back end: " - (append gnus-valid-select-methods gnus-server-alist) - nil t (cons "nntp" 0) 'gnus-method-history))) + (list (let ((how (gnus-completing-read + "Which back end" + (mapcar 'car (append gnus-valid-select-methods gnus-server-alist)) + t (cons "nntp" 0) 'gnus-method-history))) ;; We either got a back end name or a virtual server name. ;; If the first, we also need an address. (if (assoc how gnus-valid-select-methods) (list (intern how) ;; Suggested by mapjph@bath.ac.uk. - (completing-read - "Address: " - (mapcar 'list gnus-secondary-servers))) + (gnus-completing-read + "Address" + gnus-secondary-servers)) ;; We got a server name. how)))) (gnus-browse-foreign-server method)) === modified file 'lisp/gnus/gnus-int.el' --- lisp/gnus/gnus-int.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/gnus-int.el 2010-09-30 08:39:23 +0000 @@ -94,11 +94,10 @@ (when confirm ;; Read server name with completion. (setq gnus-nntp-server - (completing-read "NNTP server: " - (mapcar 'list - (cons (list gnus-nntp-server) - gnus-secondary-servers)) - nil nil gnus-nntp-server))) + (gnus-completing-read "NNTP server" + (cons gnus-nntp-server + gnus-secondary-servers) + nil gnus-nntp-server))) (when (and gnus-nntp-server (stringp gnus-nntp-server) === modified file 'lisp/gnus/gnus-msg.el' --- lisp/gnus/gnus-msg.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/gnus-msg.el 2010-09-30 08:39:23 +0000 @@ -578,8 +578,8 @@ (if arg (if (= 1 (prefix-numeric-value arg)) (gnus-group-completing-read - "Use posting style of group: " - nil nil (gnus-read-active-file-p)) + "Use posting style of group" + nil (gnus-read-active-file-p)) (gnus-group-group-name)) "")) ;; #### see comment in gnus-setup-message -- drv @@ -607,8 +607,8 @@ (setq gnus-newsgroup-name (if arg (if (= 1 (prefix-numeric-value arg)) - (gnus-group-completing-read "Use group: " - nil nil + (gnus-group-completing-read "Use group" + nil (gnus-read-active-file-p)) (gnus-group-group-name)) "")) @@ -628,7 +628,7 @@ (let ((gnus-newsgroup-name (if arg (if (= 1 (prefix-numeric-value arg)) - (gnus-group-completing-read "Newsgroup: " nil nil + (gnus-group-completing-read "Newsgroup" nil (gnus-read-active-file-p)) (gnus-group-group-name)) "")) @@ -654,8 +654,8 @@ (setq gnus-newsgroup-name (if arg (if (= 1 (prefix-numeric-value arg)) - (gnus-group-completing-read "Use group: " - nil nil + (gnus-group-completing-read "Use group" + nil (gnus-read-active-file-p)) "") gnus-newsgroup-name)) @@ -684,8 +684,8 @@ (setq gnus-newsgroup-name (if arg (if (= 1 (prefix-numeric-value arg)) - (gnus-group-completing-read "Use group: " - nil nil + (gnus-group-completing-read "Use group" + nil (gnus-read-active-file-p)) "") gnus-newsgroup-name)) @@ -710,7 +710,7 @@ (let ((gnus-newsgroup-name (if arg (if (= 1 (prefix-numeric-value arg)) - (gnus-group-completing-read "Newsgroup: " nil nil + (gnus-group-completing-read "Newsgroup" nil (gnus-read-active-file-p)) "") gnus-newsgroup-name)) @@ -1028,8 +1028,8 @@ gnus-last-posting-server) ;; Just use the last value. gnus-last-posting-server - (completing-read - "Posting method: " method-alist nil t + (gnus-completing-read + "Posting method" (mapcar 'car method-alist) t (cons (or gnus-last-posting-server "") 0)))) method-alist)))) ;; Override normal method. @@ -1487,7 +1487,7 @@ (defun gnus-summary-yank-message (buffer n) "Yank the current article into a composed message." (interactive - (list (completing-read "Buffer: " (mapcar 'list (message-buffers)) nil t) + (list (gnus-completing-read "Buffer" (message-buffers) t) current-prefix-arg)) (gnus-summary-iterate n (let ((gnus-inhibit-treatment t)) === modified file 'lisp/gnus/gnus-registry.el' --- lisp/gnus/gnus-registry.el 2010-09-18 10:02:19 +0000 +++ lisp/gnus/gnus-registry.el 2010-09-30 08:39:23 +0000 @@ -857,12 +857,11 @@ (defun gnus-registry-read-mark () "Read a mark name from the user with completion." - (let ((mark (gnus-completing-read-with-default - (symbol-name gnus-registry-default-mark) - "Label" - (mapcar (lambda (x) ; completion list - (cons (symbol-name (car-safe x)) (car-safe x))) - gnus-registry-marks)))) + (let ((mark (gnus-completing-read + "Label" + (mapcar 'symbol-name (mapcar 'car gnus-registry-marks)) + nil nil nil + (symbol-name gnus-registry-default-mark)))) (when (stringp mark) (intern mark)))) @@ -1173,10 +1172,6 @@ ;;; we could call it here: (customize-variable 'gnus-registry-install) gnus-registry-install) -(when (or (eq gnus-registry-install t) - (gnus-registry-install-p)) - (gnus-registry-initialize)) - ;; TODO: a few things (provide 'gnus-registry) === modified file 'lisp/gnus/gnus-score.el' --- lisp/gnus/gnus-score.el 2010-09-20 00:36:54 +0000 +++ lisp/gnus/gnus-score.el 2010-09-30 08:39:23 +0000 @@ -680,14 +680,14 @@ (and gnus-extra-headers (equal (nth 1 entry) "extra") (intern ; need symbol - (gnus-completing-read-with-default - (symbol-name (car gnus-extra-headers)) ; default response - "Score extra header" ; prompt - (mapcar (lambda (x) ; completion list - (cons (symbol-name x) x)) - gnus-extra-headers) - nil ; no completion limit - t)))) ; require match + (let ((collection (mapcar 'symbol-name gnus-extra-headers))) + (gnus-completing-read + "Score extra header" ; prompt + collection ; completion list + t ; require match + nil ; no history + nil ; no initial-input + (car collection)))))) ; default value ;; extra is now nil or a symbol. ;; We have all the data, so we enter this score. @@ -913,10 +913,13 @@ TYPE is the score type. SCORE is the score to add. EXTRA is the possible non-standard header." - (interactive (list (completing-read "Header: " - gnus-header-index - (lambda (x) (fboundp (nth 2 x))) - t) + (interactive (list (gnus-completing-read "Header" + (mapcar + 'car + (remove-if-not + (lambda (x) (fboundp (nth 2 x))) + gnus-header-index)) + t) (read-string "Match: ") (if (y-or-n-p "Use regexp match? ") 'r 's) (string-to-number (read-string "Score: ")))) === modified file 'lisp/gnus/gnus-srvr.el' --- lisp/gnus/gnus-srvr.el 2010-09-26 04:03:19 +0000 +++ lisp/gnus/gnus-srvr.el 2010-09-30 08:39:23 +0000 @@ -571,8 +571,9 @@ (defun gnus-server-add-server (how where) (interactive - (list (intern (completing-read "Server method: " - gnus-valid-select-methods nil t)) + (list (intern (gnus-completing-read "Server method" + (mapcar 'car gnus-valid-select-methods) + t)) (read-string "Server name: "))) (when (assq where gnus-server-alist) (error "Server with that name already defined")) @@ -582,7 +583,7 @@ (defun gnus-server-goto-server (server) "Jump to a server line." (interactive - (list (completing-read "Goto server: " gnus-server-alist nil t))) + (list (gnus-completing-read "Goto server" (mapcar 'car gnus-server-alist) t))) (let ((to (text-property-any (point-min) (point-max) 'gnus-server (intern server)))) (when to === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2010-09-27 23:07:47 +0000 +++ lisp/gnus/gnus-sum.el 2010-09-30 08:39:23 +0000 @@ -7999,10 +7999,9 @@ is a number, it is the line the article is to be displayed on." (interactive (list - (completing-read - "Article number or Message-ID: " - (mapcar (lambda (number) (list (int-to-string number))) - gnus-newsgroup-limit)) + (gnus-completing-read + "Article number or Message-ID" + (mapcar 'int-to-string gnus-newsgroup-limit)) current-prefix-arg t)) (prog1 @@ -8256,16 +8255,13 @@ (interactive (let ((header (intern - (gnus-completing-read-with-default - (symbol-name (car gnus-extra-headers)) + (gnus-completing-read (if current-prefix-arg "Exclude extra header" "Limit extra header") - (mapcar (lambda (x) - (cons (symbol-name x) x)) - gnus-extra-headers) - nil - t)))) + (mapcar 'symbol-name gnus-extra-headers) + t nil nil + (symbol-name (car gnus-extra-headers)))))) (list header (read-string (format "%s header %s (regexp): " (if current-prefix-arg "Exclude" "Limit to") @@ -9234,14 +9230,14 @@ article. If BACKWARD (the prefix) is non-nil, search backward instead." (interactive (list (let ((completion-ignore-case t)) - (completing-read - "Header name: " - (mapcar (lambda (header) (list (format "%s" header))) + (gnus-completing-read + "Header name" + (mapcar 'symbol-name (append - '("Number" "Subject" "From" "Lines" "Date" - "Message-ID" "Xref" "References" "Body") + '(Number Subject From Lines Date + Message-ID Xref References Body) gnus-extra-headers)) - nil 'require-match)) + 'require-match)) (read-string "Regexp: ") (read-key-sequence "Command: ") current-prefix-arg)) @@ -9937,9 +9933,9 @@ (car (gnus-find-method-for-group gnus-newsgroup-name))))) (method - (gnus-completing-read-with-default - methname "Backend to use when respooling" - methods nil t nil 'gnus-mail-method-history)) + (gnus-completing-read + "Backend to use when respooling" + methods t nil 'gnus-mail-method-history methname)) ms) (cond ((zerop (length (setq ms (gnus-servers-using-backend @@ -9949,7 +9945,7 @@ (car ms)) (t (let ((ms-alist (mapcar (lambda (m) (cons (cadr m) m)) ms))) - (cdr (assoc (completing-read "Server name: " ms-alist nil t) + (cdr (assoc (gnus-completing-read "Server name" ms-alist t) ms-alist)))))))) (unless method (error "No method given for respooling")) @@ -11904,7 +11900,8 @@ (nreverse split-name))) (defun gnus-valid-move-group-p (group) - (and (boundp group) + (and (symbolp group) + (boundp group) (symbol-name group) (symbol-value group) (gnus-get-function (gnus-find-method-for-group @@ -11921,29 +11918,20 @@ (format "these %d articles" (length articles)) "this article"))) (to-newsgroup - (let (active group) - (when (or (null split-name) (= 1 (length split-name))) - (setq active (gnus-make-hashtable (length gnus-active-hashtb))) - (mapatoms (lambda (symbol) - (setq group (symbol-name symbol)) - (when (string-match "[^\000-\177]" group) - (setq group (gnus-group-decoded-name group))) - (set (intern group active) group)) - gnus-active-hashtb)) - (cond - ((null split-name) - (gnus-completing-read-with-default - default prom active 'gnus-valid-move-group-p nil prefix - 'gnus-group-history)) - ((= 1 (length split-name)) - (gnus-completing-read-with-default - (car split-name) prom active 'gnus-valid-move-group-p nil nil - 'gnus-group-history)) - (t - (gnus-completing-read-with-default - nil prom (mapcar 'list (nreverse split-name)) nil nil nil - 'gnus-group-history))))) - (to-method (gnus-server-to-method (gnus-group-method to-newsgroup))) + (cond + ((null split-name) + (gnus-group-completing-read + prom + (remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb) + nil prefix nil default)) + ((= 1 (length split-name)) + (gnus-group-completing-read + prom (remove-if-not 'gnus-valid-move-group-p gnus-active-hashtb) + nil prefix 'gnus-group-history (car split-name))) + (t + (gnus-completing-read + prom (nreverse split-name) nil nil 'gnus-group-history)))) + (to-method (gnus-server-to-method (gnus-group-method to-newsgroup))) encoded) (when to-newsgroup (if (or (string= to-newsgroup "") === modified file 'lisp/gnus/gnus-topic.el' --- lisp/gnus/gnus-topic.el 2010-09-18 10:02:19 +0000 +++ lisp/gnus/gnus-topic.el 2010-09-30 08:39:23 +0000 @@ -161,9 +161,7 @@ (defun gnus-topic-jump-to-topic (topic) "Go to TOPIC." (interactive - (list (completing-read "Go to topic: " - (mapcar 'list (gnus-topic-list)) - nil t))) + (list (gnus-completing-read "Go to topic" (gnus-topic-list) t))) (let ((buffer-read-only nil)) (dolist (topic (gnus-current-topics topic)) (unless (gnus-topic-goto-topic topic) @@ -1303,7 +1301,7 @@ If COPYP, copy the groups instead." (interactive (list current-prefix-arg - (gnus-completing-read "Move to topic" gnus-topic-alist nil t + (gnus-completing-read "Move to topic" (mapcar 'car gnus-topic-alist) t 'gnus-topic-history))) (let ((use-marked (and (not n) (not (gnus-region-active-p)) gnus-group-marked t)) @@ -1350,7 +1348,7 @@ "Copy the current group to a topic." (interactive (list current-prefix-arg - (completing-read "Copy to topic: " gnus-topic-alist nil t))) + (gnus-completing-read "Copy to topic" (mapcar 'car gnus-topic-alist) t))) (gnus-topic-move-group n topic t)) (defun gnus-topic-kill-group (&optional n discard) @@ -1443,7 +1441,8 @@ (gnus-topic-remove-topic t nil) (let ((topic (gnus-topic-find-topology - (completing-read "Show topic: " gnus-topic-alist nil t)))) + (gnus-completing-read "Show topic" + (mapcar 'car gnus-topic-alist) t)))) (setcar (cddr (cadr topic)) nil) (setcar (cdr (cadr topic)) 'visible) (gnus-group-list-groups))))) @@ -1491,7 +1490,8 @@ (let (topic) (nreverse (list - (setq topic (completing-read "Move to topic: " gnus-topic-alist nil t)) + (setq topic (gnus-completing-read "Move to topic" + (mapcar 'car gnus-topic-alist) t)) (read-string (format "Move to %s (regexp): " topic)))))) (gnus-group-mark-regexp regexp) (gnus-topic-move-group nil topic copyp)) @@ -1502,7 +1502,8 @@ (let (topic) (nreverse (list - (setq topic (completing-read "Copy to topic: " gnus-topic-alist nil t)) + (setq topic (gnus-completing-read "Copy to topic" + (mapcar 'car gnus-topic-alist) t)) (read-string (format "Copy to %s (regexp): " topic)))))) (gnus-topic-move-matching regexp topic t)) @@ -1723,8 +1724,9 @@ "Sort topics in TOPIC alphabetically by topic name. If REVERSE, reverse the sorting order." (interactive - (list (completing-read "Sort topics in : " gnus-topic-alist nil t - (gnus-current-topic)) + (list (gnus-completing-read "Sort topics in" + (mapcar 'car gnus-topic-alist) t + (gnus-current-topic)) current-prefix-arg)) (let ((topic-topology (or (and topic (cdr (gnus-topic-find-topology topic))) gnus-topic-topology))) @@ -1738,7 +1740,7 @@ (interactive (list (gnus-group-topic-name) - (completing-read "Move to topic: " gnus-topic-alist nil t))) + (gnus-completing-read "Move to topic" (mapcar 'car gnus-topic-alist) t))) (unless (and current to) (error "Can't find topic")) (let ((current-top (cdr (gnus-topic-find-topology current))) === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2010-09-26 23:01:31 +0000 +++ lisp/gnus/gnus-util.el 2010-09-30 08:39:23 +0000 @@ -44,6 +44,32 @@ (defmacro with-no-warnings (&rest body) `(progn ,@body)))) +(defcustom gnus-completing-read-function + #'gnus-std-completing-read + "Function to do a completing read." + :group 'gnus-meta + :type '(radio (function-item + :doc "Use Emacs' standard `completing-read' function." + gnus-std-completing-read) + (function-item :doc "Use iswitchb's completing-read function." + gnus-icompleting-read) + (function-item :doc "Use ido's completing-read function." + gnus-ido-completing-read) + (function))) + +(defcustom gnus-completion-styles + (if (and (boundp 'completion-styles-alist) + (boundp 'completion-styles)) + (append (when (and (assq 'substring completion-styles-alist) + (not (memq 'substring completion-styles))) + (list 'substring)) + completion-styles) + nil) + "Value of `completion-styles' to use when completing." + :version "24.1" + :group 'gnus-meta + :type 'list) + ;; Fixme: this should be a gnus variable, not nnmail-. (defvar nnmail-pathname-coding-system) (defvar nnmail-active-file-coding-system) @@ -344,16 +370,6 @@ (define-key keymap key (pop plist)) (pop plist))))) -(defun gnus-completing-read-with-default (default prompt &rest args) - ;; Like `completing-read', except that DEFAULT is the default argument. - (let* ((prompt (if default - (concat prompt " (default " default "): ") - (concat prompt ": "))) - (answer (apply 'completing-read prompt args))) - (if (or (null answer) (zerop (length answer))) - default - answer))) - ;; Two silly functions to ensure that all `y-or-n-p' questions clear ;; the echo area. ;; @@ -1574,21 +1590,50 @@ `(,(car spec) ,@(mapcar 'gnus-make-predicate-1 (cdr spec))) (error "Invalid predicate specifier: %s" spec))))) -(defun gnus-completing-read (prompt table &optional predicate require-match - history) - (when (and history - (not (boundp history))) - (set history nil)) - (completing-read - (if (symbol-value history) - (concat prompt " (" (car (symbol-value history)) "): ") - (concat prompt ": ")) - table - predicate - require-match - nil - history - (car (symbol-value history)))) +(defun gnus-std-completing-read (prompt collection &optional require-match + initial-input history def) + (completing-read prompt collection nil require-match + initial-input history def)) + +(defun gnus-icompleting-read (prompt collection &optional require-match + initial-input history def) + (require 'iswitchb) + (let ((iswitchb-make-buflist-hook + (lambda () + (setq iswitchb-temp-buflist + (let ((choices (append (list) + (when initial-input (list initial-input)) + (symbol-value history) collection)) + filtered-choices) + (while choices + (when (and (car choices) (not (member (car choices) filtered-choices))) + (setq filtered-choices (cons (car choices) filtered-choices))) + (setq choices (cdr choices))) + (nreverse filtered-choices)))))) + (unwind-protect + (progn + (when (not iswitchb-mode) + (add-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup)) + (iswitchb-read-buffer prompt def require-match)) + (when (not iswitchb-mode) + (remove-hook 'minibuffer-setup-hook 'iswitchb-minibuffer-setup))))) + +(defun gnus-ido-completing-read (prompt collection &optional require-match + initial-input history def) + (require 'ido) + (ido-completing-read prompt collection nil require-match + initial-input history def)) + +(defun gnus-completing-read (prompt collection &optional require-match + initial-input history def) + "Do a completing read with the configured `gnus-completing-read-function'." + (let ((completion-styles gnus-completion-styles)) + (funcall + gnus-completing-read-function + (concat prompt (when def + (concat " (default " def ")")) + ": ") + collection require-match initial-input history def))) (defun gnus-graphic-display-p () (if (featurep 'xemacs) === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2010-09-26 23:01:31 +0000 +++ lisp/gnus/gnus.el 2010-09-30 08:39:23 +0000 @@ -1427,6 +1427,7 @@ :group 'gnus-message :type '(choice (const :tag "default" nil) string)) +(make-obsolete-variable 'gnus-local-domain nil "24.1") (defvar gnus-local-organization nil "String with a description of what organization (if any) the user belongs to. @@ -4241,9 +4242,9 @@ gnus-predefined-server-alist gnus-server-alist)) (method - (completing-read - prompt servers - nil t nil 'gnus-method-history))) + (gnus-completing-read + prompt (mapcar 'car servers) + t nil 'gnus-method-history))) (cond ((equal method "") (setq method gnus-select-method)) === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2010-09-28 12:35:18 +0000 +++ lisp/gnus/mm-decode.el 2010-09-30 08:39:23 +0000 @@ -1323,11 +1323,11 @@ "Display HANDLE using METHOD." (let* ((type (mm-handle-media-type handle)) (methods - (mapcar (lambda (i) (list (cdr (assoc 'viewer i)))) + (mapcar (lambda (i) (cdr (assoc 'viewer i))) (mailcap-mime-info type 'all))) (method (let ((minibuffer-local-completion-map mm-viewer-completion-map)) - (completing-read "Viewer: " methods)))) + (gnus-completing-read "Viewer" methods)))) (when (string= method "") (error "No method given")) (if (string-match "^[^% \t]+$" method) === modified file 'lisp/gnus/mm-util.el' --- lisp/gnus/mm-util.el 2010-09-29 01:09:50 +0000 +++ lisp/gnus/mm-util.el 2010-09-30 08:39:23 +0000 @@ -68,11 +68,11 @@ . ,(lambda (prompt) "Return a charset." (intern - (completing-read + (gnus-completing-read prompt - (mapcar (lambda (e) (list (symbol-name (car e)))) + (mapcar (lambda (e) (symbol-name (car e))) mm-mime-mule-charset-alist) - nil t)))) + t)))) ;; `subst-char-in-string' is not available in XEmacs 21.4. (subst-char-in-string . ,(lambda (from to string &optional inplace) @@ -281,8 +281,8 @@ 'read-coding-system)) (t (lambda (prompt &optional default-coding-system) "Prompt the user for a coding system." - (completing-read - prompt (mapcar (lambda (s) (list (symbol-name (car s)))) + (gnus-completing-read + prompt (mapcar (lambda (s) (symbol-name (car s))) mm-mime-mule-charset-alist))))))) (defvar mm-coding-system-list nil) @@ -316,8 +316,8 @@ (cp-supported-codepages) ;; Removed in Emacs 23 (unicode), so signal an error: (error "`codepage-setup' not present in this Emacs version")))) - (list (completing-read "Setup DOS Codepage: (default 437) " candidates - nil t nil nil "437")))) + (list (gnus-completing-read "Setup DOS Codepage" candidates + t nil nil "437")))) (when alias (setq alias (if (stringp alias) (intern alias) === modified file 'lisp/gnus/mm-view.el' --- lisp/gnus/mm-view.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/mm-view.el 2010-09-30 08:39:23 +0000 @@ -31,6 +31,7 @@ (require 'mm-decode) (require 'smime) +(autoload 'gnus-completing-read "gnus-util") (autoload 'gnus-article-prepare-display "gnus-art") (autoload 'vcard-parse-string "vcard") (autoload 'vcard-format-string "vcard") @@ -676,11 +677,9 @@ (if (= (length smime-keys) 1) (cadar smime-keys) (smime-get-key-by-email - (completing-read - (concat "Decipher using key" - (if smime-keys (concat "(default " (caar smime-keys) "): ") - ": ")) - smime-keys nil nil nil nil (car-safe (car-safe smime-keys)))))) + (gnus-completing-read + "Decipher using key" + smime-keys nil nil nil (car-safe (car-safe smime-keys)))))) (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n")) === modified file 'lisp/gnus/mml-smime.el' --- lisp/gnus/mml-smime.el 2010-09-25 12:49:02 +0000 +++ lisp/gnus/mml-smime.el 2010-09-30 08:39:23 +0000 @@ -161,10 +161,10 @@ ""))))) (and from (smime-get-key-by-email from))) (smime-get-key-by-email - (completing-read "Sign this part with what signature? " - smime-keys nil nil - (and (listp (car-safe smime-keys)) - (caar smime-keys)))))))) + (gnus-completing-read "Sign this part with what signature" + smime-keys nil nil + (and (listp (car-safe smime-keys)) + (caar smime-keys)))))))) (defun mml-smime-get-file-cert () (ignore-errors @@ -213,15 +213,16 @@ (quit)) result)) -(autoload 'gnus-completing-read-with-default "gnus-util") +(autoload 'gnus-completing-read "gnus-util") (defun mml-smime-openssl-encrypt-query () ;; todo: try dns/ldap automatically first, before prompting user (let (certs done) (while (not done) - (ecase (read (gnus-completing-read-with-default - "ldap" "Fetch certificate from" - '(("dns") ("ldap") ("file")) nil t)) + (ecase (read (gnus-completing-read + "Fetch certificate from" + '(("dns") ("ldap") ("file")) t nil nil + "ldap")) (dns (setq certs (append certs (mml-smime-get-dns-cert)))) (ldap (setq certs (append certs === modified file 'lisp/gnus/mml.el' --- lisp/gnus/mml.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/mml.el 2010-09-30 08:39:23 +0000 @@ -40,6 +40,7 @@ (autoload 'message-make-message-id "message") (declare-function gnus-setup-posting-charset "gnus-msg" (group)) (autoload 'gnus-make-local-hook "gnus-util") +(autoload 'gnus-completing-read "gnus-util") (autoload 'message-fetch-field "message") (autoload 'message-mark-active-p "message") (autoload 'message-info "message") @@ -1188,9 +1189,10 @@ ;; looks like, and offer text/plain if it looks ;; like text/plain. "application/octet-stream")) - (string (completing-read - (format "Content type (default %s): " default) - (mapcar 'list (mailcap-mime-types))))) + (string (gnus-completing-read + "Content type" + (mailcap-mime-types) + nil nil nil default))) (if (not (equal string "")) string default))) @@ -1204,10 +1206,10 @@ (defun mml-minibuffer-read-disposition (type &optional default filename) (unless default (setq default (mml-content-disposition type filename))) - (let ((disposition (completing-read - (format "Disposition (default %s): " default) - '(("attachment") ("inline") ("")) - nil t nil nil default))) + (let ((disposition (gnus-completing-read + "Disposition" + '("attachment" "inline") + t nil nil default))) (if (not (equal disposition "")) disposition default))) @@ -1395,11 +1397,11 @@ (defun mml-insert-multipart (&optional type) (interactive (if (message-in-body-p) - (list (completing-read "Multipart type (default mixed): " - '(("mixed") ("alternative") - ("digest") ("parallel") - ("signed") ("encrypted")) - nil nil "mixed")) + (list (gnus-completing-read "Multipart type" + '("mixed" "alternative" + "digest" "parallel" + "signed" "encrypted") + nil "mixed")) (error "Use this command in the message body"))) (or type (setq type "mixed")) === modified file 'lisp/gnus/nndoc.el' --- lisp/gnus/nndoc.el 2010-09-26 23:01:31 +0000 +++ lisp/gnus/nndoc.el 2010-09-30 08:39:23 +0000 @@ -280,6 +280,11 @@ (t (nnheader-insert "211 %d %d %d %s\n" number 1 number group))))) +(deffoo nndoc-retrieve-groups (groups &optional server) + (dolist (group groups) + (nndoc-request-group group server)) + t) + (deffoo nndoc-request-type (group &optional article) (cond ((not article) 'unknown) (nndoc-post-type nndoc-post-type) === modified file 'lisp/gnus/nndraft.el' --- lisp/gnus/nndraft.el 2010-09-26 23:01:31 +0000 +++ lisp/gnus/nndraft.el 2010-09-30 08:39:23 +0000 @@ -224,7 +224,7 @@ (let* ((nnmh-allow-delete-final t) (nnmail-expiry-target (or (gnus-group-find-parameter - (gnus-group-prefixed-name "nndraft" (list 'nndraft server)) + (gnus-group-prefixed-name group (list 'nndraft server)) 'expiry-target t) nnmail-expiry-target)) (res (nnoo-parent-function 'nndraft === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2010-09-28 05:12:21 +0000 +++ lisp/gnus/nnimap.el 2010-09-30 08:39:23 +0000 @@ -70,6 +70,9 @@ "How mail is split. Uses the same syntax as nnmail-split-methods") +(make-obsolete-variable 'nnimap-split-rule "see `nnimap-split-methods'" + "Gnus 5.13") + (defvoo nnimap-authenticator nil "How nnimap authenticate itself to the server. Possible choices are nil (use default methods) or `anonymous'.") @@ -342,15 +345,6 @@ (when (eq nnimap-stream 'starttls) (nnimap-command "STARTTLS") (starttls-negotiate (nnimap-process nnimap-object))) - ;; If this is a STARTTLS-capable server, then sever the - ;; connection and start a STARTTLS connection instead. - (when (and (eq nnimap-stream 'network) - (member "STARTTLS" (nnimap-capabilities nnimap-object))) - (let ((nnimap-stream 'starttls)) - (delete-process (nnimap-process nnimap-object)) - (kill-buffer (current-buffer)) - (return - (nnimap-open-connection buffer)))) (when nnimap-server-port (push (format "%s" nnimap-server-port) ports)) (unless (equal connection-result "PREAUTH") @@ -428,7 +422,12 @@ (nnimap-command "UID FETCH %d (BODYSTRUCTURE)" article) (goto-char (point-min)) (when (re-search-forward "FETCH.*BODYSTRUCTURE" nil t) - (setq structure (ignore-errors (read (current-buffer))) + (setq structure (ignore-errors + (let ((start (point))) + (forward-sexp 1) + (downcase-region start (point)) + (goto-char (point)) + (read (current-buffer)))) parts (nnimap-find-wanted-parts structure)))) (when (if parts (nnimap-get-partial-article article parts structure) @@ -509,8 +508,15 @@ t)) (defun nnimap-insert-partial-structure (structure parts &optional subp) - (let ((type (car (last structure 4))) - (boundary (cadr (member "BOUNDARY" (car (last structure 3)))))) + (let (type boundary) + (let ((bstruc structure)) + (while (consp (car bstruc)) + (pop bstruc)) + (setq type (car bstruc)) + (setq bstruc (car (cdr bstruc))) + (when (and (stringp (car bstruc)) + (string= (downcase (car bstruc)) "boundary")) + (setq boundary (cadr bstruc)))) (when subp (insert (format "Content-type: multipart/%s; boundary=%S\n\n" (downcase type) boundary))) @@ -768,6 +774,7 @@ (when (nnimap-possibly-change-group group server) (let (sequence) (with-current-buffer (nnimap-buffer) + (erase-buffer) ;; Just send all the STORE commands without waiting for ;; response. If they're successful, they're successful. (dolist (action actions) @@ -789,6 +796,7 @@ (deffoo nnimap-request-accept-article (group &optional server last) (when (nnimap-possibly-change-group nil server) (nnmail-check-syntax) + (nnimap-add-cr) (let ((message (buffer-string)) (message-id (message-field-value "message-id")) sequence) @@ -1288,7 +1296,9 @@ (defun nnimap-split-incoming-mail () (with-current-buffer (nnimap-buffer) (let ((nnimap-incoming-split-list nil) - (nnmail-split-methods nnimap-split-methods) + (nnmail-split-methods (if (eq nnimap-split-methods 'default) + nnmail-split-methods + nnimap-split-methods)) (nnmail-inhibit-default-split-group t) (groups (nnimap-get-groups)) new-articles) @@ -1339,6 +1349,7 @@ (defun nnimap-mark-and-expunge-incoming (range) (when range (setq range (nnimap-article-ranges range)) + (erase-buffer) (let ((sequence (nnimap-send-command "UID STORE %s +FLAGS.SILENT (\\Deleted)" range))) === modified file 'lisp/gnus/nnir.el' --- lisp/gnus/nnir.el 2010-09-25 14:24:54 +0000 +++ lisp/gnus/nnir.el 2010-09-30 08:39:23 +0000 @@ -1588,7 +1588,7 @@ (let ((sym (car parmspec)) (prompt (cdr parmspec))) (if (listp prompt) - (let* ((result (apply 'completing-read prompt)) + (let* ((result (gnus-completing-read prompt nil)) (mapping (or (assoc result nnir-imap-search-arguments) (assoc nil nnir-imap-search-arguments)))) (cons sym (format (cdr mapping) result))) === modified file 'lisp/gnus/nnmairix.el' --- lisp/gnus/nnmairix.el 2010-09-27 23:07:47 +0000 +++ lisp/gnus/nnmairix.el 2010-09-30 08:39:23 +0000 @@ -848,8 +848,8 @@ All necessary information will be queried from the user." (interactive) (let* ((name (read-string "Name of the mairix server: ")) - (server (completing-read "Back end server (TAB for completion): " - (nnmairix-get-valid-servers) nil 1)) + (server (gnus-completing-read "Back end server" + (nnmairix-get-valid-servers) t)) (mairix (read-string "Command to call mairix: " "mairix")) (defaultgroup (read-string "Default search group: ")) (backend (symbol-name (car (gnus-server-to-method server)))) @@ -1165,7 +1165,7 @@ If SKIPDEFAULT is t, the default search group will not be updated. If UPDATEDB is t, database for SERVERNAME will be updated first." - (interactive (list (completing-read "Update groups on server: " + (interactive (list (gnus-completing-read "Update groups on server" (nnmairix-get-nnmairix-servers)))) (save-excursion (when (string-match ".*:\\(.*\\)" servername) @@ -1302,7 +1302,7 @@ (while (equal '("") (setq nnmairix-last-server - (list (completing-read "Server: " openedserver nil 1 + (list (gnus-completing-read "Server" openedserver t (or nnmairix-last-server "nnmairix:")))))) nnmairix-last-server) @@ -1492,10 +1492,10 @@ (when (not found) (setq mairixserver (gnus-server-to-method - (completing-read - (format "Cannot determine which nnmairix server indexes %s. Please specify: " + (gnus-completing-read + (format "Cannot determine which nnmairix server indexes %s. Please specify" (gnus-method-to-server server)) - (nnmairix-get-nnmairix-servers) nil nil "nnmairix:"))) + (nnmairix-get-nnmairix-servers) nil "nnmairix:"))) ;; Save result in parameter of default search group so that ;; we don't have to ask again (setq defaultgroup (gnus-group-prefixed-name @@ -1643,9 +1643,9 @@ (gnus-registry-add-group mid cur))))) (if (> (length allgroups) 1) (setq group - (completing-read - "Message exists in more than one group. Choose: " - allgroups nil t)) + (gnus-completing-read + "Message exists in more than one group. Choose" + allgroups t)) (setq group (car allgroups)))) (if group ;; show article in summary buffer @@ -1748,9 +1748,9 @@ (gnus-group-prefixed-name group (car cur)) allgroups)))) (if (> (length allgroups) 1) - (setq group (completing-read - "Group %s exists on more than one IMAP server. Choose: " - allgroups nil t)) + (setq group (gnus-completing-read + "Group %s exists on more than one IMAP server. Choose" + allgroups t)) (setq group (car allgroups)))) group)) === modified file 'lisp/gnus/nnrss.el' --- lisp/gnus/nnrss.el 2010-09-29 01:09:50 +0000 +++ lisp/gnus/nnrss.el 2010-09-30 08:39:23 +0000 @@ -1048,9 +1048,9 @@ (cdr (assoc "feedid" listinfo))))) feedinfo))) (cdr (assoc - (completing-read - "Multiple feeds found. Select one: " - selection nil t) urllist))))))))) + (gnus-completing-read + "Multiple feeds found. Select one" + selection t) urllist))))))))) (defun nnrss-rss-p (data) "Test if DATA is an RSS feed. === modified file 'lisp/gnus/pop3.el' --- lisp/gnus/pop3.el 2010-09-22 06:01:22 +0000 +++ lisp/gnus/pop3.el 2010-09-30 08:39:23 +0000 @@ -82,6 +82,15 @@ :version "22.1" ;; Oort Gnus :group 'pop3) +(defcustom pop3-stream-length 100 + "How many messages should be requested at one time. +The lower the number, the more latency-sensitive the fetching +will be. If your pop3 server doesn't support streaming at all, +set this to 1." + :type 'number + :version "24.1" + :group 'pop3) + (defcustom pop3-leave-mail-on-server nil "*Non-nil if the mail is to be left on the POP server after fetching. @@ -156,7 +165,7 @@ (while (>= count i) (process-send-string process (format "%s %d\r\n" command i)) ;; Only do 100 messages at a time to avoid pipe stalls. - (when (zerop (% i 100)) + (when (zerop (% i pop3-stream-length)) (pop3-wait-for-messages process i total-size)) (incf i))) (pop3-wait-for-messages process count total-size)) === modified file 'lisp/gnus/smime.el' --- lisp/gnus/smime.el 2010-09-18 10:02:19 +0000 +++ lisp/gnus/smime.el 2010-09-30 08:39:23 +0000 @@ -371,12 +371,9 @@ (if keyfile keyfile (smime-get-key-with-certs-by-email - (completing-read - (concat "Sign using key" - (if smime-keys - (concat " (default " (caar smime-keys) "): ") - ": ")) - smime-keys nil nil (car-safe (car-safe smime-keys)))))) + (gnus-completing-read + "Sign using key" + smime-keys nil (car-safe (car-safe smime-keys)))))) (error "Signing failed")))) (defun smime-encrypt-buffer (&optional certfiles buffer) @@ -502,11 +499,9 @@ (expand-file-name (or keyfile (smime-get-key-by-email - (completing-read - (concat "Decipher using key" - (if smime-keys (concat " (default " (caar smime-keys) "): ") - ": ")) - smime-keys nil nil (car-safe (car-safe smime-keys))))))))) + (gnus-completing-read + "Decipher using key" + smime-keys nil (car-safe (car-safe smime-keys))))))))) ;; Various operations @@ -660,6 +655,7 @@ (define-key smime-mode-map "f" 'smime-certificate-info)) (autoload 'gnus-run-mode-hooks "gnus-util") +(autoload 'gnus-completing-read "gnus-util") (defun smime-mode () "Major mode for browsing, viewing and fetching certificates. === modified file 'lisp/gnus/webmail.el' --- lisp/gnus/webmail.el 2010-09-02 00:55:51 +0000 +++ lisp/gnus/webmail.el 2010-09-30 08:39:23 +0000 @@ -4,7 +4,7 @@ ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Shenghuo Zhu -;; Keywords: hotmail netaddress my-deja netscape +;; Keywords: hotmail netaddress ;; This file is part of GNU Emacs. @@ -115,39 +115,7 @@ (article-snarf . webmail-netaddress-article) (trash-url "http://www.netaddress.com/tpl/Message/%s/Move?FolderID=-4&Q=%s&N=&Sort=Date&F=-1" - webmail-session id)) - (netscape - (paranoid cookie post agent) - (address . "webmail.netscape.com") - (open-url "http://ureg.netscape.com/iiop/UReg2/login/login?U2_LA=en&U2_BACK_FROM_CJ=true&U2_CS=iso-8859-1&U2_ENDURL=http://webmail.netscape.com/tpl/Subscribe/Step1&U2_NEW_ENDURL=http://webmail.netscape.com/tpl/Subscribe/Step1&U2_EXITURL=http://home.netscape.com/&U2_SOURCE=Webmail") - (open-snarf . webmail-netscape-open) - (login-url - content - ("http://ureg.netscape.com/iiop/UReg2/login/loginform") - "U2_USERNAME=%s&U2_PASSWORD=%s%s" - user password webmail-aux) - (login-snarf . webmail-netaddress-login) - (list-url - "http://webmail.netscape.com/tpl/Mail/%s/List?FolderID=-4&SortUseCase=True" - webmail-session) - (list-snarf . webmail-netaddress-list) - (article-url "http://webmail.netscape.com/") - (article-snarf . webmail-netscape-article) - (trash-url - "http://webmail.netscape.com/tpl/Message/%s/Move?FolderID=-4&Q=%s&N=&Sort=Date&F=-1" - webmail-session id)) - (my-deja - (paranoid cookie post) - (address . "www.my-deja.com") - ;;(open-snarf . webmail-my-deja-open) - (login-url - content - ("http://mydeja.google.com/cgi-bin/deja/maillogin.py") - "userid=%s&password=%s" - user password) - (list-snarf . webmail-my-deja-list) - (article-snarf . webmail-my-deja-article) - (trash-url webmail-aux id)))) + webmail-session id)))) (defvar webmail-variables '(address article-snarf article-url list-snarf list-url @@ -683,15 +651,6 @@ ;;; netaddress -(defun webmail-netscape-open () - (goto-char (point-min)) - (setq webmail-aux "") - (while (re-search-forward - "TYPE=hidden *NAME=\\([^ ]+\\) *VALUE=\"\\([^\"]+\\)" - nil t) - (setq webmail-aux (concat webmail-aux "&" (match-string 1) "=" - (match-string 2))))) - (defun webmail-netaddress-open () (goto-char (point-min)) (if (re-search-forward "action=\"\\([^\"]+\\)\"" nil t) @@ -872,280 +831,6 @@ (insert ">")))) (mm-append-to-file (point-min) (point-max) file))) -(defun webmail-netscape-article (file id) - (let (p p1 attachment count mime type) - (save-restriction - (webmail-encode-8bit) - (goto-char (point-min)) - (if (not (search-forward "Trash" nil t)) - (webmail-error "article@1")) - (if (not (search-forward "
" nil t)) - (webmail-error "article@2")) - (delete-region (point-min) (match-beginning 0)) - (if (not (search-forward "" nil t)) - (webmail-error "article@3")) - (narrow-to-region (point-min) (match-end 0)) - (goto-char (point-min)) - (while (re-search-forward "[\040\t\r\n]+" nil t) - (replace-match " ")) - (goto-char (point-min)) - (while (re-search-forward "]*>[^<]*" nil t) - (replace-match "")) - (goto-char (point-min)) - (while (search-forward "" nil t) - (replace-match "\n")) - (mm-url-remove-markup) - (mm-url-decode-entities-nbsp) - (goto-char (point-min)) - (delete-blank-lines) - (goto-char (point-min)) - (while (re-search-forward "^\040+\\|\040+$" nil t) - (replace-match "")) - (goto-char (point-min)) - (while (re-search-forward "\040+" nil t) - (replace-match " ")) - (goto-char (point-max)) - (widen) - (insert "\n\n") - (setq p (point)) - (unless (search-forward "" nil t) - (webmail-error "article@4")) - (forward-line 14) - (delete-region p (point)) - (goto-char (point-max)) - (unless (re-search-backward - "
" - nil t 2) - (setq mime t) - (unless (search-forward "
" nil t) - (webmail-error "article@6")) - (setq p1 (point)) - (if (search-backward "" nil t) - (webmail-error "article@8")) - (delete-region p (point)) - (let (bufname);; Attachment - (save-excursion - (set-buffer (generate-new-buffer " *webmail-att*")) - (mm-url-insert (concat (car webmail-open-url) attachment)) - (push (current-buffer) webmail-buffer-list) - (setq bufname (buffer-name))) - (insert "<#part type=" type) - (insert " buffer=\"" bufname "\"") - (insert " disposition=\"inline\"") - (insert "><#/part>\n") - (setq p (point)))) - (delete-region p p1) - (narrow-to-region - p - (if (search-forward - "" - nil t) - (match-beginning 0) - (point-max))) - (webmail-netaddress-single-part) - (goto-char (point-max)) - (setq p (point)) - (widen))) - (unless mime - (narrow-to-region p (point-max)) - (setq mime (webmail-netaddress-single-part)) - (widen)) - (goto-char (point-min)) - ;; Some blank line to separate mails. - (insert "\n\nFrom nobody " (current-time-string) "\n") - (insert "X-Gnus-Webmail: " (symbol-value 'user) - "@" (symbol-name webmail-type) "\n") - (if id - (insert (format "X-Message-ID: <%s@%s>\n" id webmail-address))) - (unless (looking-at "$") - (if (search-forward "\n\n" nil t) - (forward-line -1) - (webmail-error "article@2"))) - (when mime - (narrow-to-region (point-min) (point)) - (goto-char (point-min)) - (while (not (eobp)) - (if (looking-at "MIME-Version\\|Content-Type") - (delete-region (point) - (progn - (forward-line 1) - (if (re-search-forward "^[^ \t]" nil t) - (goto-char (match-beginning 0)) - (point-max)))) - (forward-line 1))) - (goto-char (point-max)) - (widen) - (narrow-to-region (point) (point-max)) - (insert "MIME-Version: 1.0\n" - (prog1 - (mml-generate-mime) - (delete-region (point-min) (point-max)))) - (goto-char (point-min)) - (widen)) - (let (case-fold-search) - (while (re-search-forward "^From " nil t) - (beginning-of-line) - (insert ">")))) - (mm-append-to-file (point-min) (point-max) file))) - -;;; my-deja - -(defun webmail-my-deja-open () - (webmail-refresh-redirect) - (goto-char (point-min)) - (if (re-search-forward "action=\"\\([^\"]+maillogin\\.py[^\"]*\\)\"" - nil t) - (setq webmail-aux (match-string 1)) - (webmail-error "open@1"))) - -(defun webmail-my-deja-list () - (let (item id newp base) - (goto-char (point-min)) - (when (re-search-forward "href=\"\\(\\([^\"]*\\)/mailnf\\.[^\"]*\\)\"" - nil t) - (let ((url (match-string 1))) - (setq base (match-string 2)) - (erase-buffer) - (mm-url-insert url))) - (goto-char (point-min)) - (when (re-search-forward - "(\\([0-9]+\\) Message.?-[^>]*\\([0-9]+\\) New" - nil t) - (message "Found %s mail(s), %s unread" - (match-string 1) (match-string 2))) - (goto-char (point-min)) - (while (re-search-forward - "newmail\\.gif\\|href=\"[^\"]*\\(mailnf\\.[^\"]+act=view[^\"]+mid=\\([^\"&]+\\)[^\"]+\\)\"" - nil t) - (if (setq id (match-string 2)) - (when (and (or newp (not webmail-newmail-only)) - (not (assoc id webmail-articles))) - (push (cons id (setq webmail-aux - (concat base "/" (match-string 1)))) - webmail-articles) - (setq newp nil)) - (setq newp t))) - (setq webmail-articles (nreverse webmail-articles)))) - -(defun webmail-my-deja-article-part (base) - (let (p) - (cond - ((looking-at "[\t\040\r\n]*