aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2009-01-09 03:01:50 +0000
committerMiles Bader2009-01-09 03:01:50 +0000
commite3e955fed38da9263f3904f15233ccfd0dbbbe43 (patch)
tree6a34615ae6e5699c8b7dfba64dfae3486ded203f
parent2188975fbff1202d011db2f82d728fc5fb5f9346 (diff)
downloademacs-e3e955fed38da9263f3904f15233ccfd0dbbbe43.tar.gz
emacs-e3e955fed38da9263f3904f15233ccfd0dbbbe43.zip
Merge from gnus--devo--0
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1513
-rw-r--r--doc/misc/ChangeLog15
-rw-r--r--doc/misc/gnus.texi27
-rw-r--r--lisp/ChangeLog44
-rw-r--r--lisp/calendar/time-date.el7
-rw-r--r--lisp/gnus/ChangeLog107
-rw-r--r--lisp/gnus/ChangeLog.239
-rw-r--r--lisp/gnus/gnus-msg.el5
-rw-r--r--lisp/gnus/gnus-start.el2
-rw-r--r--lisp/gnus/gnus-sum.el17
-rw-r--r--lisp/gnus/legacy-gnus-agent.el2
-rw-r--r--lisp/gnus/message.el40
-rw-r--r--lisp/gnus/mm-url.el11
-rw-r--r--lisp/gnus/mm-util.el90
-rw-r--r--lisp/gnus/mml1991.el2
-rw-r--r--lisp/gnus/nnheader.el9
-rw-r--r--lisp/gnus/nnimap.el21
-rw-r--r--lisp/gnus/pop3.el49
-rw-r--r--lisp/gnus/sieve-manage.el5
-rw-r--r--lisp/gnus/spam-report.el44
-rw-r--r--lisp/net/dns.el41
-rw-r--r--lisp/net/imap.el178
21 files changed, 563 insertions, 192 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 6e99fd5789c..3218a788be7 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,18 @@
12009-01-09 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus.texi (Group Parameters): Add note for local variables.
4
52009-01-09 Reiner Steib <Reiner.Steib@gmx.de>
6
7 * gnus.texi (Converting Kill Files): Fix URL. Include
8 gnus-kill-to-score.el in contrib directory.
9
102009-01-09 Reiner Steib <Reiner.Steib@gmx.de>
11
12 * gnus.texi (Startup Variables): Fix gnus-before-startup-hook.
13 Reported by Leo <sdl.web@gmail.com>. (Bug#1660)
14 (Paging the Article): Add index entry.
15
12009-01-03 Stephen Leake <stephen_leake@member.fsf.org> 162009-01-03 Stephen Leake <stephen_leake@member.fsf.org>
2 17
3 * ada-mode.texi (Examples): Delete redundant text. 18 * ada-mode.texi (Examples): Delete redundant text.
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 6db07ee85c9..6227831cf15 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -9,8 +9,8 @@
9@documentencoding ISO-8859-1 9@documentencoding ISO-8859-1
10 10
11@copying 11@copying
12Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 12Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
132002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 132003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
14 14
15@quotation 15@quotation
16Permission is granted to copy, distribute and/or modify this document 16Permission is granted to copy, distribute and/or modify this document
@@ -1623,7 +1623,7 @@ times you start Gnus.
1623 1623
1624@item gnus-before-startup-hook 1624@item gnus-before-startup-hook
1625@vindex gnus-before-startup-hook 1625@vindex gnus-before-startup-hook
1626A hook run after starting up Gnus successfully. 1626A hook called as the first thing when Gnus is started.
1627 1627
1628@item gnus-startup-hook 1628@item gnus-startup-hook
1629@vindex gnus-startup-hook 1629@vindex gnus-startup-hook
@@ -3156,7 +3156,12 @@ that group. @code{gnus-show-threads} will be made into a local variable
3156in the summary buffer you enter, and the form @code{nil} will be 3156in the summary buffer you enter, and the form @code{nil} will be
3157@code{eval}ed there. 3157@code{eval}ed there.
3158 3158
3159Note that this feature sets the variable locally to the summary buffer. 3159Note that this feature sets the variable locally to the summary buffer
3160if and only if @var{variable} has been bound as a variable. Otherwise,
3161only evaluating the form will take place. So, you may want to bind the
3162variable in advance using @code{defvar} or other if the result of the
3163form needs to be set to it.
3164
3160But some variables are evaluated in the article buffer, or in the 3165But some variables are evaluated in the article buffer, or in the
3161message buffer (of a reply or followup or otherwise newly created 3166message buffer (of a reply or followup or otherwise newly created
3162message). As a workaround, it might help to add the variable in 3167message). As a workaround, it might help to add the variable in
@@ -3184,9 +3189,9 @@ into the group parameters for the group.
3184 3189
3185This can also be used as a group-specific hook function. If you want to 3190This can also be used as a group-specific hook function. If you want to
3186hear a beep when you enter a group, you could put something like 3191hear a beep when you enter a group, you could put something like
3187@code{(dummy-variable (ding))} in the parameters of that group. 3192@code{(dummy-variable (ding))} in the parameters of that group. If
3188@code{dummy-variable} will be set to the (meaningless) result of the 3193@code{dummy-variable} has been bound (see above), it will be set to the
3189@code{(ding)} form. 3194(meaningless) result of the @code{(ding)} form.
3190 3195
3191Alternatively, since the VARIABLE becomes local to the group, this 3196Alternatively, since the VARIABLE becomes local to the group, this
3192pattern can be used to temporarily change a hook. For example, if the 3197pattern can be used to temporarily change a hook. For example, if the
@@ -6233,6 +6238,7 @@ given a prefix, fetch the current article, but don't run any of the
6233article treatment functions. This will give you a ``raw'' article, just 6238article treatment functions. This will give you a ``raw'' article, just
6234the way it came from the server. 6239the way it came from the server.
6235 6240
6241@cindex charset, view article with different charset
6236If given a numerical prefix, you can do semi-manual charset stuff. 6242If given a numerical prefix, you can do semi-manual charset stuff.
6237@kbd{C-u 0 g cn-gb-2312 RET} will decode the message as if it were 6243@kbd{C-u 0 g cn-gb-2312 RET} will decode the message as if it were
6238encoded in the @code{cn-gb-2312} charset. If you have 6244encoded in the @code{cn-gb-2312} charset. If you have
@@ -22464,9 +22470,10 @@ score files. If they are ``regular'', you can use
22464the @file{gnus-kill-to-score.el} package; if not, you'll have to do it 22470the @file{gnus-kill-to-score.el} package; if not, you'll have to do it
22465by hand. 22471by hand.
22466 22472
22467The kill to score conversion package isn't included in Gnus by default. 22473The kill to score conversion package isn't included in Emacs by default.
22468You can fetch it from 22474You can fetch it from the contrib directory of the Gnus distribution or
22469@uref{http://www.stud.ifi.uio.no/~larsi/ding-various/gnus-kill-to-score.el}. 22475from
22476@uref{http://heim.ifi.uio.no/~larsi/ding-various/gnus-kill-to-score.el}.
22470 22477
22471If your old kill files are very complex---if they contain more 22478If your old kill files are very complex---if they contain more
22472non-@code{gnus-kill} forms than not, you'll have to convert them by 22479non-@code{gnus-kill} forms than not, you'll have to convert them by
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7ed2af86b1e..24c7c6f7216 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,47 @@
12009-01-09 Dave Love <fx@gnu.org>
2
3 * calendar/time-date.el: Require cl for `declare'.
4
52009-01-09 Reiner Steib <Reiner.Steib@gmx.de>
6
7 * calendar/time-date.el (format-seconds): Explain `assoc-string'.
8 Suggested by Dave Love.
9
102009-01-09 Dave Love <fx@gnu.org>
11
12 * net/imap.el (imap-string-to-integer): Fix typo.
13 (imap-fetch-safe): New function.
14 (imap-message-copyuid-1, imap-message-appenduid-1): Use it.
15
16 * net/imap.el (imap-process-connection-type, imap-debug, imap-open):
17 (imap-parse-greeting): Fix doc strings.
18 (imap-tls-open, imap-search, imap-message-appenduid-1): Add FIXMEs.
19 (imap-parse-flag-list): Make messages unique.
20 (imap-parse-body): Fix comments. Add comment on Exchange 2007.
21
22 * net/imap.el (imap-message-appenduid-1): Fix typo in imap-fetch-safe
23 call.
24
25 * net/imap.el: Fix author email. Doc fixes.
26 (imap-parse-body): Work around assertion failure in bogus Exchange 2007
27 reply.
28
292009-01-09 Reiner Steib <Reiner.Steib@gmx.de>
30
31 * net/dns.el (dns-set-servers): Check "Address". Fix typo.
32
332009-01-09 Reiner Steib <Reiner.Steib@gmx.de>
34
35 * net/dns.el (dns-set-servers): Renamed from dns-parse-resolv-conf.
36 Call nslookup if resolv.conf isn't available.
37 (dns-query): Rename from query-dns.
38 (dns-query-cached): Rename from query-dns-cached.
39
402009-01-09 Reiner Steib <Reiner.Steib@gmx.de>
41
42 * net/imap.el (imap-enable-exchange-bug-workaround): Explain
43 auto-detection in the doc string.
44
12009-01-09 Juanma Barranquero <lekktu@gmail.com> 452009-01-09 Juanma Barranquero <lekktu@gmail.com>
2 46
3 * textmodes/ispell.el (ispell-check-minver, ispell-last-program-name) 47 * textmodes/ispell.el (ispell-check-minver, ispell-last-program-name)
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index d33b99f9135..3478f9646ea 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -39,6 +39,9 @@
39 39
40;;; Code: 40;;; Code:
41 41
42;; Only necessary for `declare' when compiling Gnus with Emacs 21.
43(eval-when-compile (require 'cl))
44
42(defmacro with-decoded-time-value (varlist &rest body) 45(defmacro with-decoded-time-value (varlist &rest body)
43 "Decode a time value and bind it according to VARLIST, then eval BODY. 46 "Decode a time value and bind it according to VARLIST, then eval BODY.
44 47
@@ -290,6 +293,10 @@ This function does not work for SECONDS greater than `most-positive-fixnum'."
290 (setq start (match-end 0) 293 (setq start (match-end 0)
291 spec (match-string 1 string)) 294 spec (match-string 1 string))
292 (unless (string-equal spec "%") 295 (unless (string-equal spec "%")
296 ;; `assoc-string' is not available in Emacs 21. So when compiling
297 ;; Gnus (`time-date.el' is part of Gnus) with Emacs 21, we get a
298 ;; warning here. But `format-seconds' is not used anywhere in Gnus so
299 ;; it's not a real problem. --rsteib
293 (or (setq match (assoc-string spec units t)) 300 (or (setq match (assoc-string spec units t))
294 (error "Bad format specifier: `%s'" spec)) 301 (error "Bad format specifier: `%s'" spec))
295 (if (assoc-string spec usedunits t) 302 (if (assoc-string spec usedunits t)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 9e964d4203f..f3404816ad6 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,8 +1,39 @@
12009-01-08 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * message.el (message-fix-before-sending): Amend comment.
4
52009-01-07 David Engster <dengste@eml.cc>
6
7 * gnus-msg.el (gnus-inews-do-gcc): Fix last patch to deal with
8 simplified server definitions by converting it via
9 gnus-server-to-method.
10
112009-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
12
13 * gnus-sum.el (gnus-summary-set-local-parameters): Always evaluate
14 parameter's operands.
15
162009-01-06 David Engster <dengste@eml.cc>
17
18 * gnus-msg.el (gnus-inews-do-gcc): Reduce to short group name when on
19 primary select method (for gnus-group-mark-article-as-read).
20
12009-01-06 Tassilo Horn <tassilo@member.fsf.org> 212009-01-06 Tassilo Horn <tassilo@member.fsf.org>
2 22
3 * gnus-art.el (gnus-treat-display-face): Fix docstring link to point to 23 * gnus-art.el (gnus-treat-display-face): Fix docstring link to point to
4 `(gnus)Face', not `(gnus)X-Face'. 24 `(gnus)Face', not `(gnus)X-Face'.
5 25
262009-01-05 Katsumi Yamaoka <yamaoka@jpl.org>
27
28 * mm-util.el (mm-ucs-to-char): New function.
29
30 * mm-url.el (mm-url-decode-entities): Use it.
31
322009-01-03 Reiner Steib <Reiner.Steib@gmx.de>
33
34 * message.el (message-fix-before-sending): Add `eight-bit' to
35 illegible-text check.
36
62009-01-03 Michael Olson <mwolson@gnu.org> 372009-01-03 Michael Olson <mwolson@gnu.org>
7 38
8 * nnimap.el (nnimap-retrieve-headers-progress): Handle edge case where 39 * nnimap.el (nnimap-retrieve-headers-progress): Handle edge case where
@@ -11,6 +42,68 @@
11 to the folder. 42 to the folder.
12 (nnimap-request-article-part): Do not insert `data' if it is nil. 43 (nnimap-request-article-part): Do not insert `data' if it is nil.
13 44
452009-01-01 Dave Love <fx@gnu.org>
46
47 * nnimap.el (nnimap-find-minmax-uid): Use imap-fetch-safe.
48
49 * nnimap.el: Fix author email.
50 (nnimap-split-rule): Add FIXME comment.
51 (nnimap-debug): Fix doc string.
52
532008-12-25 Katsumi Yamaoka <yamaoka@jpl.org>
54
55 * gnus-sum.el (gnus-summary-set-article-display-arrow): Make
56 overlay-arrow-position and overlay-arrow-string buffer-local; no need
57 to check if those variables exist (first appeared in Emacs 18.50).
58
592008-12-24 Katsumi Yamaoka <yamaoka@jpl.org>
60
61 * mm-util.el (mm-line-number-at-pos): New function.
62
63 * spam-report.el (spam-report-process-queue): Use it.
64
652008-12-24 David Engster <dengste@eml.cc>
66
67 * gnus-sum.el (gnus-summary-set-local-parameters): Don't bind
68 parameters that haven't existed as variables as buffer-local variables.
69
702008-12-23 Dave Love <fx@gnu.org>
71
72 * legacy-gnus-agent.el (gnus-agent-unlist-expire-days): Don't use
73 cadar.
74
75 * sieve-manage.el (sieve-manage-starttls-p): Renamed from
76 imap-starttls-p.
77 (sieve-manage-starttls-open): Renamed from imap-starttls-open.
78
792008-12-22 Reiner Steib <Reiner.Steib@gmx.de>
80
81 * spam-report.el (spam-report-gmane-max-requests): New constant.
82 (spam-report-gmane-wait): New variable.
83 (spam-report-gmane-ham, spam-report-gmane-spam)
84 (spam-report-url-ping-plain, spam-report-process-queue): Wait only if
85 spam-report-gmane-wait is non-nil should be sufficient to avoid DOS-ing
86 the server.
87
88 * nnheader.el (nnheader-read-timeout, nnheader-accept-process-output):
89 Add explanations.
90
91 * pop3.el (pop3-accept-process-output, pop3-read-timeout): Use
92 nnheader-accept-process-output and nnheader-read-timeout if available.
93 (pop3-movemail): Use it.
94
95 * message.el (message-check-news-body-syntax): Fix signature check if
96 there's an attachment.
97
982008-12-21 Katsumi Yamaoka <yamaoka@jpl.org>
99
100 * mm-util.el: Add comments to the mm- emulating functions.
101
1022008-12-21 Reiner Steib <Reiner.Steib@gmx.de>
103
104 * gnus-start.el (gnus-before-startup-hook): Fix doc string. Reported
105 by Stephen Berman <stephen.berman@gmx.net>.
106
142008-12-18 Katsumi Yamaoka <yamaoka@jpl.org> 1072008-12-18 Katsumi Yamaoka <yamaoka@jpl.org>
15 108
16 * mm-util.el (mm-substring-no-properties): New function. 109 * mm-util.el (mm-substring-no-properties): New function.
@@ -23,6 +116,11 @@
232008-12-18 Reiner Steib <Reiner.Steib@gmx.de> 1162008-12-18 Reiner Steib <Reiner.Steib@gmx.de>
24 117
25 * mml.el (mml-attach-file): Strip text properties from file name. 118 * mml.el (mml-attach-file): Strip text properties from file name.
119 (Bug#1574)
120
1212008-12-16 Glenn Morris <rgm@gnu.org>
122
123 * mm-util.el (mm-charset-override-alist): Declare for compiler.
26 124
272008-12-16 Glenn Morris <rgm@gnu.org> 1252008-12-16 Glenn Morris <rgm@gnu.org>
28 126
@@ -13136,11 +13234,10 @@
13136 13234
131372004-01-04 Mario Lang <lang@zid.tugraz.at> 132352004-01-04 Mario Lang <lang@zid.tugraz.at>
13138 13236
13139 * dns.el: Add support for AAAA records (see RFC 3596) 13237 * dns.el (dns-query-types): Fix typo.
13140 13238 (dns-query-types): New function
13141 * Fix typo PRT -> PTR 13239 (dns-read-type): Add support for AAAA records, see RFC 3596. Parse MX,
13142 13240 PTR and SOA replies, see RFC 1035.
13143 * Parse MX, PTR and SOA replies (see RFC 1035)
13144 13241
131452004-01-04 Lars Magne Ingebrigtsen <larsi@gnus.org> 132422004-01-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
13146 13243
diff --git a/lisp/gnus/ChangeLog.2 b/lisp/gnus/ChangeLog.2
index 2c25799892f..140cbd7c698 100644
--- a/lisp/gnus/ChangeLog.2
+++ b/lisp/gnus/ChangeLog.2
@@ -8763,8 +8763,7 @@
8763 * sieve-manage.el (sieve-manage-cram-md5-auth): Just send the SASL 8763 * sieve-manage.el (sieve-manage-cram-md5-auth): Just send the SASL
8764 name (makes it work with recent Cyrus timsieved). 8764 name (makes it work with recent Cyrus timsieved).
8765 8765
87662002-05-20 Jason Baker <jbaker@cs.utah.edu> 87662002-05-20 Jason Baker <jbaker@cs.utah.edu> (tiny change)
8767 Trivial patch.
8768 8767
8769 * gnus-art.el (gnus-request-article-this-buffer): Try 8768 * gnus-art.el (gnus-request-article-this-buffer): Try
8770 reconnecting if you don't get the message. 8769 reconnecting if you don't get the message.
@@ -9189,8 +9188,7 @@
9189 9188
9190 * nnmaildir.el: Fixed some buggy invocations of nnmaildir--pgname. 9189 * nnmaildir.el: Fixed some buggy invocations of nnmaildir--pgname.
9191 9190
91922002-03-31 Andrew Cohen <cohen@andy.bu.edu> 91912002-03-31 Andrew Cohen <cohen@andy.bu.edu> (tiny change)
9193 Trivial patch.
9194 9192
9195 * dns.el: open-network-stream under XEmacs does udp. 9193 * dns.el: open-network-stream under XEmacs does udp.
9196 9194
@@ -10451,8 +10449,7 @@
10451 10449
10452 * nnweb.el (nnweb-type-definition): Clean up. 10450 * nnweb.el (nnweb-type-definition): Clean up.
10453 10451
104542002-01-21 Alastair Burt <burt@dfki.de> 104522002-01-21 Alastair Burt <burt@dfki.de> (tiny change)
10455 Trivial patch.
10456 10453
10457 * gnus-art.el (gnus-mm-display-part): Make sure that the summary 10454 * gnus-art.el (gnus-mm-display-part): Make sure that the summary
10458 buffer exists before jumping to it. 10455 buffer exists before jumping to it.
@@ -11088,8 +11085,7 @@
11088 11085
11089 * gnus.el (gnus-logo-color-alist): Added more colors from Luis. 11086 * gnus.el (gnus-logo-color-alist): Added more colors from Luis.
11090 11087
110912002-01-05 Keiichi Suzuki <keiichi@nanap.org> 110882002-01-05 Keiichi Suzuki <keiichi@nanap.org> (tiny change)
11092 Trivial patch.
11093 11089
11094 * nntp.el (nntp-possibly-change-group): Erase contents of nntp 11090 * nntp.el (nntp-possibly-change-group): Erase contents of nntp
11095 buffer to get rid of junk line. 11091 buffer to get rid of junk line.
@@ -13307,8 +13303,7 @@
13307 * gnus-spec.el (gnus-correct-pad-form): Re-revert. 13303 * gnus-spec.el (gnus-correct-pad-form): Re-revert.
13308 (gnus-parse-simple-format): Re-revert. 13304 (gnus-parse-simple-format): Re-revert.
13309 13305
133102001-09-16 Katsuhiro Hermit Endo <hermit@koka-in.org> 133062001-09-16 Katsuhiro Hermit Endo <hermit@koka-in.org> (tiny change)
13311 Trivial patch.
13312 13307
13313 * gnus-spec.el (gnus-parse-complex-format): Don't fold search 13308 * gnus-spec.el (gnus-parse-complex-format): Don't fold search
13314 case. (Thanks to Daiki Ueno <ueno@unixuser.org>.) 13309 case. (Thanks to Daiki Ueno <ueno@unixuser.org>.)
@@ -14156,8 +14151,7 @@
14156 * message.el (message-indent-citation): Quote only lines starting 14151 * message.el (message-indent-citation): Quote only lines starting
14157 with ">" using `message-yank-cited-prefix'. 14152 with ">" using `message-yank-cited-prefix'.
14158 14153
141592001-08-05 Nuutti Kotivuori <nuutti.kotivuori@smarttrust.com> 141542001-08-05 Nuutti Kotivuori <nuutti.kotivuori@smarttrust.com> (tiny change)
14160 Trivial patch.
14161 14155
14162 * gnus-cache.el (gnus-cache-possibly-enter-article): Use 14156 * gnus-cache.el (gnus-cache-possibly-enter-article): Use
14163 gnus-cache-fully-p. 14157 gnus-cache-fully-p.
@@ -14926,8 +14920,7 @@
14926 * nntp.el (nntp-send-command-nodelete): Ditto. 14920 * nntp.el (nntp-send-command-nodelete): Ditto.
14927 * nntp.el (nntp-send-command-and-decode): Ditto. 14921 * nntp.el (nntp-send-command-and-decode): Ditto.
14928 14922
149292001-06-30 YAGI Tatsuya <yagi@is.titech.ac.jp> 149232001-06-30 YAGI Tatsuya <yagi@is.titech.ac.jp> (tiny change)
14930 Trivial patch.
14931 14924
14932 * gnus-start.el (gnus-check-first-time-used): Use `if' instead of 14925 * gnus-start.el (gnus-check-first-time-used): Use `if' instead of
14933 `when'. 14926 `when'.
@@ -15646,8 +15639,7 @@
15646 15639
15647 * message.el (message-generate-headers-first): Update doc. 15640 * message.el (message-generate-headers-first): Update doc.
15648 15641
156492001-03-10 Matthias Wiehl <mwiehl@gmx.de> 156422001-03-10 Matthias Wiehl <mwiehl@gmx.de> (tiny change)
15650 Trivial patch.
15651 15643
15652 * gnus.el (gnus-summary-line-format): Typo. 15644 * gnus.el (gnus-summary-line-format): Typo.
15653 15645
@@ -16021,8 +16013,7 @@
16021 * message.el (message-cancel-news): Allow to shoot foot. 16013 * message.el (message-cancel-news): Allow to shoot foot.
16022 (message-supersede): Ditto. 16014 (message-supersede): Ditto.
16023 16015
160242001-02-08 Tommi Vainikainen <thv@iki.fi> 160162001-02-08 Tommi Vainikainen <thv@iki.fi> (tiny change)
16025 Trivial patch.
16026 16017
16027 * gnus-sum.el (gnus-simplify-subject-re): Use 16018 * gnus-sum.el (gnus-simplify-subject-re): Use
16028 message-subject-re-regexp. 16019 message-subject-re-regexp.
@@ -16487,8 +16478,7 @@
16487 16478
16488 * time-date.el (time-to-number-of-days): New function. 16479 * time-date.el (time-to-number-of-days): New function.
16489 16480
164902001-01-04 11:06:14 Gregory Chernov <greg@visiontech-dml.com> 164812001-01-04 11:06:14 Gregory Chernov <greg@visiontech-dml.com> (tiny change)
16491 Trivial patch.
16492 16482
16493 * nnslashdot.el (nnslashdot-request-list): Always get the right 16483 * nnslashdot.el (nnslashdot-request-list): Always get the right
16494 sid. 16484 sid.
@@ -16645,8 +16635,7 @@
16645 (gnus-uu-mark-by-regexp): Use it. 16635 (gnus-uu-mark-by-regexp): Use it.
16646 (gnus-new-processable): New function. 16636 (gnus-new-processable): New function.
16647 16637
166482000-12-28 19:21:57 Inge Frick <inge@nada.kth.se> 166382000-12-28 19:21:57 Inge Frick <inge@nada.kth.se> (tiny change)
16649 Trivial patch.
16650 16639
16651 * gnus-sum.el (gnus-no-mark): New variable. 16640 * gnus-sum.el (gnus-no-mark): New variable.
16652 16641
@@ -16665,8 +16654,7 @@
16665 * qp.el (quoted-printable-encode-region): Don't check multibyte in 16654 * qp.el (quoted-printable-encode-region): Don't check multibyte in
16666 XEmacs. 16655 XEmacs.
16667 16656
166682000-12-25 Lloyd Zusman <ljz@asfast.com> 166572000-12-25 Lloyd Zusman <ljz@asfast.com> (tiny change)
16669 Trivial patch.
16670 16658
16671 * mml.el (mml-read-tag): Save tag location. 16659 * mml.el (mml-read-tag): Save tag location.
16672 16660
@@ -18370,8 +18358,7 @@
18370 (nnultimate-table-regexp): New variable. 18358 (nnultimate-table-regexp): New variable.
18371 (nnultimate-forum-table-p): Use it. 18359 (nnultimate-forum-table-p): Use it.
18372 18360
183732000-10-30 Ed L Cashin <ecashin@coe.uga.edu> 183612000-10-30 Ed L Cashin <ecashin@coe.uga.edu> (tiny change)
18374 Trivial patch.
18375 18362
18376 * gnus-sum.el (gnus-summary-expire-articles): Save point. 18363 * gnus-sum.el (gnus-summary-expire-articles): Save point.
18377 18364
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index a3698a13527..62f23cb169d 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1677,6 +1677,11 @@ this is a reply."
1677 group method t t)))) 1677 group method t t))))
1678 (gnus-message 1 "Couldn't store article in group %s: %s" 1678 (gnus-message 1 "Couldn't store article in group %s: %s"
1679 group (gnus-status-message method))) 1679 group (gnus-status-message method)))
1680 (when (stringp method)
1681 (setq method (gnus-server-to-method method)))
1682 (when (and (listp method)
1683 (gnus-native-method-p method))
1684 (setq group (gnus-group-short-name group)))
1680 (when (and group-art 1685 (when (and group-art
1681 ;; FIXME: Should gcc-mark-as-read work when 1686 ;; FIXME: Should gcc-mark-as-read work when
1682 ;; Gnus is not running? 1687 ;; Gnus is not running?
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index bc6b7e0c508..33e7d3894b5 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -392,7 +392,7 @@ This hook is called after Gnus is connected to the NNTP server."
392 :type 'hook) 392 :type 'hook)
393 393
394(defcustom gnus-before-startup-hook nil 394(defcustom gnus-before-startup-hook nil
395 "A hook called at before startup. 395 "A hook called before startup.
396This hook is called as the first thing when Gnus is started." 396This hook is called as the first thing when Gnus is started."
397 :group 'gnus-start 397 :group 'gnus-start
398 :type 'hook) 398 :type 'hook)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index a04f4aa5bb4..ed636e03229 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3455,9 +3455,9 @@ display only a single character."
3455 3455
3456(defun gnus-summary-set-article-display-arrow (pos) 3456(defun gnus-summary-set-article-display-arrow (pos)
3457 "Update the overlay arrow to point to line at position POS." 3457 "Update the overlay arrow to point to line at position POS."
3458 (when (and gnus-summary-display-arrow 3458 (when gnus-summary-display-arrow
3459 (boundp 'overlay-arrow-position) 3459 (make-local-variable 'overlay-arrow-position)
3460 (boundp 'overlay-arrow-string)) 3460 (make-local-variable 'overlay-arrow-string)
3461 (save-excursion 3461 (save-excursion
3462 (goto-char pos) 3462 (goto-char pos)
3463 (beginning-of-line) 3463 (beginning-of-line)
@@ -3832,10 +3832,15 @@ This function is intended to be used in
3832 (consp (cdr elem)) ; The cdr has to be a list. 3832 (consp (cdr elem)) ; The cdr has to be a list.
3833 (symbolp (car elem)) ; Has to be a symbol in there. 3833 (symbolp (car elem)) ; Has to be a symbol in there.
3834 (not (memq (car elem) vars)) 3834 (not (memq (car elem) vars))
3835 (ignore-errors ; So we set it. 3835 (ignore-errors
3836 (push (car elem) vars) 3836 (push (car elem) vars)
3837 (make-local-variable (car elem)) 3837 ;; Variables like `gnus-show-threads' that are globally
3838 (set (car elem) (eval (nth 1 elem)))))))) 3838 ;; bound, if used as group parameters, need to get to be
3839 ;; buffer-local, whereas just parameters like `gcc-self',
3840 ;; `timestamp', etc. should not be bound as variables.
3841 (if (boundp (car elem))
3842 (set (make-local-variable (car elem)) (eval (nth 1 elem)))
3843 (eval (nth 1 elem))))))))
3839 3844
3840(defun gnus-summary-read-group (group &optional show-all no-article 3845(defun gnus-summary-read-group (group &optional show-all no-article
3841 kill-buffer no-display backward 3846 kill-buffer no-display backward
diff --git a/lisp/gnus/legacy-gnus-agent.el b/lisp/gnus/legacy-gnus-agent.el
index 28dfa25ee1f..3680bc5e410 100644
--- a/lisp/gnus/legacy-gnus-agent.el
+++ b/lisp/gnus/legacy-gnus-agent.el
@@ -186,7 +186,7 @@ converted to the compressed format."
186 (when (eq 0 (string-match 186 (when (eq 0 (string-match
187 (caar days) 187 (caar days)
188 group)) 188 group))
189 (throw 'found (cadar days))) 189 (throw 'found (cadr (car days))))
190 (setq days (cdr days))) 190 (setq days (cdr days)))
191 nil))) 191 nil)))
192 (when day 192 (when day
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 93f7b703832..ee711628080 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2395,6 +2395,8 @@ Return the number of headers removed."
2395 (point-max))) 2395 (point-max)))
2396 (goto-char (point-min))) 2396 (goto-char (point-min)))
2397 2397
2398;; FIXME: clarify diffference: message-narrow-to-head,
2399;; message-narrow-to-headers-or-head, message-narrow-to-headers
2398(defun message-narrow-to-head () 2400(defun message-narrow-to-head ()
2399 "Narrow the buffer to the head of the message. 2401 "Narrow the buffer to the head of the message.
2400Point is left at the beginning of the narrowed-to region." 2402Point is left at the beginning of the narrowed-to region."
@@ -4140,6 +4142,8 @@ conformance."
4140 (and (mm-multibyte-p) 4142 (and (mm-multibyte-p)
4141 (memq (char-charset char) 4143 (memq (char-charset char)
4142 '(eight-bit-control eight-bit-graphic 4144 '(eight-bit-control eight-bit-graphic
4145 ;; Emacs 23, Bug#1770:
4146 eight-bit
4143 control-1)) 4147 control-1))
4144 (not (get-text-property 4148 (not (get-text-property
4145 (point) 'untranslated-utf-8)))) 4149 (point) 'untranslated-utf-8))))
@@ -4166,10 +4170,13 @@ conformance."
4166 (or (< (mm-char-int char) 128) 4170 (or (< (mm-char-int char) 128)
4167 (and (mm-multibyte-p) 4171 (and (mm-multibyte-p)
4168 ;; FIXME: Wrong for Emacs 23 (unicode) and for 4172 ;; FIXME: Wrong for Emacs 23 (unicode) and for
4169 ;; things like undecable utf-8. Should at least 4173 ;; things like undecodable utf-8 (in Emacs 21?).
4170 ;; use find-coding-systems-region. 4174 ;; Should at least use find-coding-systems-region.
4175 ;; -- fx
4171 (memq (char-charset char) 4176 (memq (char-charset char)
4172 '(eight-bit-control eight-bit-graphic 4177 '(eight-bit-control eight-bit-graphic
4178 ;; Emacs 23, Bug#1770:
4179 eight-bit
4173 control-1)) 4180 control-1))
4174 (not (get-text-property 4181 (not (get-text-property
4175 (point) 'untranslated-utf-8))))) 4182 (point) 'untranslated-utf-8)))))
@@ -5119,17 +5126,24 @@ Otherwise, generate and save a value for `canlock-password' first."
5119 nil))) 5126 nil)))
5120 ;; Check the length of the signature. 5127 ;; Check the length of the signature.
5121 (message-check 'signature 5128 (message-check 'signature
5122 (goto-char (point-max)) 5129 (let (sig-start sig-end)
5123 (if (not (re-search-backward message-signature-separator nil t)) 5130 (goto-char (point-max))
5124 t 5131 (if (not (re-search-backward message-signature-separator nil t))
5125 (if (>= (count-lines (1+ (point-at-eol)) (point-max)) 5) 5132 t
5126 (if (message-gnksa-enable-p 'signature) 5133 (setq sig-start (1+ (point-at-eol)))
5127 (y-or-n-p 5134 (setq sig-end
5128 (format "Signature is excessively long (%d lines). Really post? " 5135 (if (re-search-forward
5129 (count-lines (1+ (point-at-eol)) (point-max)))) 5136 "<#/?\\(multipart\\|part\\|external\\|mml\\)" nil t)
5130 (message "Denied posting -- Excessive signature.") 5137 (- (point-at-bol) 1)
5131 nil) 5138 (point-max)))
5132 t))) 5139 (if (>= (count-lines sig-start sig-end) 5)
5140 (if (message-gnksa-enable-p 'signature)
5141 (y-or-n-p
5142 (format "Signature is excessively long (%d lines). Really post? "
5143 (count-lines sig-start sig-end)))
5144 (message "Denied posting -- Excessive signature.")
5145 nil)
5146 t))))
5133 ;; Ensure that text follows last quoted portion. 5147 ;; Ensure that text follows last quoted portion.
5134 (message-check 'quoting-style 5148 (message-check 'quoting-style
5135 (goto-char (point-max)) 5149 (goto-char (point-max))
diff --git a/lisp/gnus/mm-url.el b/lisp/gnus/mm-url.el
index b41c40f8f50..46ca1741fb7 100644
--- a/lisp/gnus/mm-url.el
+++ b/lisp/gnus/mm-url.el
@@ -1,6 +1,7 @@
1;;; mm-url.el --- a wrapper of url functions/commands for Gnus 1;;; mm-url.el --- a wrapper of url functions/commands for Gnus
2 2
3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 3;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
4;; Free Software Foundation, Inc.
4 5
5;; Author: Shenghuo Zhu <zsh@cs.rochester.edu> 6;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
6 7
@@ -366,10 +367,10 @@ If FOLLOW-REFRESH is non-nil, redirect refresh url in META."
366 (goto-char (point-min)) 367 (goto-char (point-min))
367 (while (re-search-forward "&\\(#[0-9]+\\|[a-z]+[0-9]*\\);" nil t) 368 (while (re-search-forward "&\\(#[0-9]+\\|[a-z]+[0-9]*\\);" nil t)
368 (let ((elem (if (eq (aref (match-string 1) 0) ?\#) 369 (let ((elem (if (eq (aref (match-string 1) 0) ?\#)
369 (let ((c 370 (let ((c (mm-ucs-to-char
370 (string-to-number (substring 371 (string-to-number
371 (match-string 1) 1)))) 372 (substring (match-string 1) 1)))))
372 (if (mm-char-or-char-int-p c) c 32)) 373 (if (mm-char-or-char-int-p c) c ?#))
373 (or (cdr (assq (intern (match-string 1)) 374 (or (cdr (assq (intern (match-string 1))
374 mm-url-html-entities)) 375 mm-url-html-entities))
375 ?#)))) 376 ?#))))
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 4a480832809..3d8538d4a61 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -40,6 +40,10 @@
40 40
41(defvar mm-mime-mule-charset-alist ) 41(defvar mm-mime-mule-charset-alist )
42 42
43;; Emulate functions that are not available in every (X)Emacs version.
44;; The name of a function is prefixed with mm-, like `mm-char-int' for
45;; `char-int' that is a native XEmacs function, not available in Emacs.
46;; Gnus programs all should use mm- functions, not the original ones.
43(eval-and-compile 47(eval-and-compile
44 (mapc 48 (mapc
45 (lambda (elem) 49 (lambda (elem)
@@ -47,11 +51,19 @@
47 (if (fboundp (car elem)) 51 (if (fboundp (car elem))
48 (defalias nfunc (car elem)) 52 (defalias nfunc (car elem))
49 (defalias nfunc (cdr elem))))) 53 (defalias nfunc (cdr elem)))))
50 `((coding-system-list . ignore) 54 `(;; `coding-system-list' is not available in XEmacs 21.4 built
55 ;; without the `file-coding' feature.
56 (coding-system-list . ignore)
57 ;; `char-int' is an XEmacs function, not available in Emacs.
51 (char-int . identity) 58 (char-int . identity)
59 ;; `coding-system-equal' is an Emacs function, not available in XEmacs.
52 (coding-system-equal . equal) 60 (coding-system-equal . equal)
61 ;; `annotationp' is an XEmacs function, not available in Emacs.
53 (annotationp . ignore) 62 (annotationp . ignore)
63 ;; `set-buffer-file-coding-system' is not available in XEmacs 21.4
64 ;; built without the `file-coding' feature.
54 (set-buffer-file-coding-system . ignore) 65 (set-buffer-file-coding-system . ignore)
66 ;; `read-charset' is an Emacs function, not available in XEmacs.
55 (read-charset 67 (read-charset
56 . ,(lambda (prompt) 68 . ,(lambda (prompt)
57 "Return a charset." 69 "Return a charset."
@@ -61,6 +73,7 @@
61 (mapcar (lambda (e) (list (symbol-name (car e)))) 73 (mapcar (lambda (e) (list (symbol-name (car e))))
62 mm-mime-mule-charset-alist) 74 mm-mime-mule-charset-alist)
63 nil t)))) 75 nil t))))
76 ;; `subst-char-in-string' is not available in XEmacs 21.4.
64 (subst-char-in-string 77 (subst-char-in-string
65 . ,(lambda (from to string &optional inplace) 78 . ,(lambda (from to string &optional inplace)
66 ;; stolen (and renamed) from nnheader.el 79 ;; stolen (and renamed) from nnheader.el
@@ -75,11 +88,14 @@
75 (aset string idx to)) 88 (aset string idx to))
76 (setq idx (1+ idx))) 89 (setq idx (1+ idx)))
77 string))) 90 string)))
91 ;; `replace-in-string' is an XEmacs function, not available in Emacs.
78 (replace-in-string 92 (replace-in-string
79 . ,(lambda (string regexp rep &optional literal) 93 . ,(lambda (string regexp rep &optional literal)
80 "See `replace-regexp-in-string', only the order of args differs." 94 "See `replace-regexp-in-string', only the order of args differs."
81 (replace-regexp-in-string regexp rep string nil literal))) 95 (replace-regexp-in-string regexp rep string nil literal)))
96 ;; `string-as-unibyte' is an Emacs function, not available in XEmacs.
82 (string-as-unibyte . identity) 97 (string-as-unibyte . identity)
98 ;; `string-make-unibyte' is an Emacs function, not available in XEmacs.
83 (string-make-unibyte . identity) 99 (string-make-unibyte . identity)
84 ;; string-as-multibyte often doesn't really do what you think it does. 100 ;; string-as-multibyte often doesn't really do what you think it does.
85 ;; Example: 101 ;; Example:
@@ -99,11 +115,18 @@
99 ;; (string-as-multibyte s) ~= (decode-coding-string s 'emacs-mule) 115 ;; (string-as-multibyte s) ~= (decode-coding-string s 'emacs-mule)
100 ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary) 116 ;; (string-to-multibyte s) ~= (decode-coding-string s 'binary)
101 ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system) 117 ;; (string-make-multibyte s) ~= (decode-coding-string s locale-coding-system)
118 ;; `string-as-multibyte' is an Emacs function, not available in XEmacs.
102 (string-as-multibyte . identity) 119 (string-as-multibyte . identity)
120 ;; `multibyte-string-p' is an Emacs function, not available in XEmacs.
103 (multibyte-string-p . ignore) 121 (multibyte-string-p . ignore)
122 ;; `insert-byte' is available only in Emacs 23.1 or greater.
104 (insert-byte . insert-char) 123 (insert-byte . insert-char)
124 ;; `multibyte-char-to-unibyte' is an Emacs function, not available
125 ;; in XEmacs.
105 (multibyte-char-to-unibyte . identity) 126 (multibyte-char-to-unibyte . identity)
127 ;; `set-buffer-multibyte' is an Emacs function, not available in XEmacs.
106 (set-buffer-multibyte . ignore) 128 (set-buffer-multibyte . ignore)
129 ;; `special-display-p' is an Emacs function, not available in XEmacs.
107 (special-display-p 130 (special-display-p
108 . ,(lambda (buffer-name) 131 . ,(lambda (buffer-name)
109 "Returns non-nil if a buffer named BUFFER-NAME gets a special frame." 132 "Returns non-nil if a buffer named BUFFER-NAME gets a special frame."
@@ -119,6 +142,7 @@
119 (stringp (car elem)) 142 (stringp (car elem))
120 (string-match (car elem) buffer-name) 143 (string-match (car elem) buffer-name)
121 (throw 'return (cdr elem))))))))) 144 (throw 'return (cdr elem)))))))))
145 ;; `substring-no-properties' is available only in Emacs 22.1 or greater.
122 (substring-no-properties 146 (substring-no-properties
123 . ,(lambda (string &optional from to) 147 . ,(lambda (string &optional from to)
124 "Return a substring of STRING, without text properties. 148 "Return a substring of STRING, without text properties.
@@ -130,12 +154,30 @@ If FROM or TO is negative, it counts from the end.
130With one argument, just copy STRING without its properties." 154With one argument, just copy STRING without its properties."
131 (setq string (substring string (or from 0) to)) 155 (setq string (substring string (or from 0) to))
132 (set-text-properties 0 (length string) nil string) 156 (set-text-properties 0 (length string) nil string)
133 string))))) 157 string))
134 158 ;; `line-number-at-pos' is available only in Emacs 22.1 or greater
159 ;; and XEmacs 21.5.
160 (line-number-at-pos
161 . ,(lambda (&optional pos)
162 "Return (narrowed) buffer line number at position POS.
163If POS is nil, use current buffer location.
164Counting starts at (point-min), so the value refers
165to the contents of the accessible portion of the buffer."
166 (let ((opoint (or pos (point))) start)
167 (save-excursion
168 (goto-char (point-min))
169 (setq start (point))
170 (goto-char opoint)
171 (forward-line 0)
172 (1+ (count-lines start (point))))))))))
173
174;; `decode-coding-string', `encode-coding-string', `decode-coding-region'
175;; and `encode-coding-region' are available in Emacs and XEmacs built with
176;; the `file-coding' feature, but the XEmacs versions treat nil, that is
177;; given as the `coding-system' argument, as the `binary' coding system.
135(eval-and-compile 178(eval-and-compile
136 (if (featurep 'xemacs) 179 (if (featurep 'xemacs)
137 (if (featurep 'file-coding) 180 (if (featurep 'file-coding)
138 ;; Don't modify string if CODING-SYSTEM is nil.
139 (progn 181 (progn
140 (defun mm-decode-coding-string (str coding-system) 182 (defun mm-decode-coding-string (str coding-system)
141 (if coding-system 183 (if coding-system
@@ -160,6 +202,7 @@ With one argument, just copy STRING without its properties."
160 (defalias 'mm-decode-coding-region 'decode-coding-region) 202 (defalias 'mm-decode-coding-region 'decode-coding-region)
161 (defalias 'mm-encode-coding-region 'encode-coding-region))) 203 (defalias 'mm-encode-coding-region 'encode-coding-region)))
162 204
205;; `string-to-multibyte' is available only in Emacs 22.1 or greater.
163(defalias 'mm-string-to-multibyte 206(defalias 'mm-string-to-multibyte
164 (cond 207 (cond
165 ((featurep 'xemacs) 208 ((featurep 'xemacs)
@@ -173,6 +216,7 @@ With one argument, just copy STRING without its properties."
173 (lambda (ch) (mm-string-as-multibyte (char-to-string ch))) 216 (lambda (ch) (mm-string-as-multibyte (char-to-string ch)))
174 string ""))))) 217 string "")))))
175 218
219;; `char-or-char-int-p' is an XEmacs function, not available in Emacs.
176(eval-and-compile 220(eval-and-compile
177 (defalias 'mm-char-or-char-int-p 221 (defalias 'mm-char-or-char-int-p
178 (cond 222 (cond
@@ -180,6 +224,44 @@ With one argument, just copy STRING without its properties."
180 ((fboundp 'char-valid-p) 'char-valid-p) 224 ((fboundp 'char-valid-p) 'char-valid-p)
181 (t 'identity)))) 225 (t 'identity))))
182 226
227;; `ucs-to-char' is a function that Mule-UCS provides.
228(if (featurep 'xemacs)
229 (cond ((and (fboundp 'unicode-to-char) ;; XEmacs 21.5.
230 (subrp (symbol-function 'unicode-to-char)))
231 (if (featurep 'mule)
232 (defalias 'mm-ucs-to-char 'unicode-to-char)
233 (defun mm-ucs-to-char (codepoint)
234 "Convert Unicode codepoint to character."
235 (or (unicode-to-char codepoint) ?#))))
236 ((featurep 'mule)
237 (defun mm-ucs-to-char (codepoint)
238 "Convert Unicode codepoint to character."
239 (if (fboundp 'ucs-to-char) ;; Mule-UCS is loaded.
240 (progn
241 (defalias 'mm-ucs-to-char
242 (lambda (codepoint)
243 "Convert Unicode codepoint to character."
244 (condition-case nil
245 (or (ucs-to-char codepoint) ?#)
246 (error ?#))))
247 (mm-ucs-to-char codepoint))
248 (condition-case nil
249 (or (int-to-char codepoint) ?#)
250 (error ?#)))))
251 (t
252 (defun mm-ucs-to-char (codepoint)
253 "Convert Unicode codepoint to character."
254 (condition-case nil
255 (or (int-to-char codepoint) ?#)
256 (error ?#)))))
257 (if (let ((char (make-char 'japanese-jisx0208 36 34)))
258 (eq char (decode-char 'ucs char)))
259 ;; Emacs 23.
260 (defalias 'mm-ucs-to-char 'identity)
261 (defun mm-ucs-to-char (codepoint)
262 "Convert Unicode codepoint to character."
263 (or (decode-char 'ucs codepoint) ?#))))
264
183;; Fixme: This seems always to be used to read a MIME charset, so it 265;; Fixme: This seems always to be used to read a MIME charset, so it
184;; should be re-named and fixed (in Emacs) to offer completion only on 266;; should be re-named and fixed (in Emacs) to offer completion only on
185;; proper charset names (base coding systems which have a 267;; proper charset names (base coding systems which have a
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 60d6e3cb4fd..4536f4183d9 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
4;; 2007, 2008, 2009 Free Software Foundation, Inc. 4;; 2007, 2008, 2009 Free Software Foundation, Inc.
5 5
6;; Author: Sascha Ldecke <sascha@meta-x.de>, 6;; Author: Sascha Lüdecke <sascha@meta-x.de>,
7;; Simon Josefsson <simon@josefsson.org> (Mailcrypt interface, Gnus glue) 7;; Simon Josefsson <simon@josefsson.org> (Mailcrypt interface, Gnus glue)
8;; Keywords PGP 8;; Keywords PGP
9 9
diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el
index a40624cba29..572f80bea9d 100644
--- a/lisp/gnus/nnheader.el
+++ b/lisp/gnus/nnheader.el
@@ -86,7 +86,14 @@ Integer values will in effect be rounded up to the nearest multiple of
86 ;; what's possible. Perhaps better, maybe the Windows/DOS primitive 86 ;; what's possible. Perhaps better, maybe the Windows/DOS primitive
87 ;; could round up non-zero timeouts to a minimum of 1.0? 87 ;; could round up non-zero timeouts to a minimum of 1.0?
88 1.0 88 1.0
89 ;; 2008-05-19 change by Larsi:
90 ;; Change the default timeout from 0.1 seconds to 0.01 seconds. This will
91 ;; make nntp and pop3 article retrieval faster in some cases, but might
92 ;; make CPU usage larger. If this has any bad side effects, we might
93 ;; revert this change.
89 0.01) 94 0.01)
95 ;; When changing this variable, consider changing `pop3-read-timeout' as
96 ;; well.
90 "How long nntp should wait between checking for the end of output. 97 "How long nntp should wait between checking for the end of output.
91Shorter values mean quicker response, but are more CPU intensive.") 98Shorter values mean quicker response, but are more CPU intensive.")
92 99
@@ -1057,6 +1064,8 @@ See `find-file-noselect' for the arguments."
1057(defalias 'nnheader-cancel-timer 'cancel-timer) 1064(defalias 'nnheader-cancel-timer 'cancel-timer)
1058(defalias 'nnheader-cancel-function-timers 'cancel-function-timers) 1065(defalias 'nnheader-cancel-function-timers 'cancel-function-timers)
1059 1066
1067;; When changing this function, consider changing `pop3-accept-process-output'
1068;; as well.
1060(defun nnheader-accept-process-output (process) 1069(defun nnheader-accept-process-output (process)
1061 (accept-process-output 1070 (accept-process-output
1062 process 1071 process
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index de5a67eab7d..87edde6a77b 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
4;; 2007, 2008, 2009 Free Software Foundation, Inc. 4;; 2007, 2008, 2009 Free Software Foundation, Inc.
5 5
6;; Author: Simon Josefsson <jas@pdc.kth.se> 6;; Author: Simon Josefsson <simon@josefsson.org>
7;; Jim Radford <radford@robby.caltech.edu> 7;; Jim Radford <radford@robby.caltech.edu>
8;; Keywords: mail 8;; Keywords: mail
9 9
@@ -163,6 +163,8 @@ the inbox string is also a regexp. The actual splitting rules are as
163before, either a function, or a list with group/regexp or 163before, either a function, or a list with group/regexp or
164group/function elements." 164group/function elements."
165 :group 'nnimap 165 :group 'nnimap
166 ;; FIXME: Doesn't allow `("my2server" ("INBOX" nnimap-split-fancy))'
167 ;; per example above. -- fx
166 :type '(choice :tag "Rule type" 168 :type '(choice :tag "Rule type"
167 (repeat :menu-tag "Single-server" 169 (repeat :menu-tag "Single-server"
168 :tag "Single-server list" 170 :tag "Single-server list"
@@ -460,11 +462,17 @@ An example plist would be '(\"name\" \"Gnus\" \"version\" gnus-version-number
460 (plist :key-type string :value-type string))) 462 (plist :key-type string :value-type string)))
461 463
462(defcustom nnimap-debug nil 464(defcustom nnimap-debug nil
463 "If non-nil, random debug spews are placed in *nnimap-debug* buffer. 465 "If non-nil, trace nnimap- functions into `nnimap-debug-buffer'.
466Uses `trace-function-background', so you can turn it off with,
467say, `untrace-all'.
468
464Note that username, passwords and other privacy sensitive 469Note that username, passwords and other privacy sensitive
465information (such as e-mail) may be stored in the *nnimap-debug* 470information (such as e-mail) may be stored in the buffer.
466buffer. It is not written to disk, however. Do not enable this 471It is not written to disk, however. Do not enable this
467variable unless you are comfortable with that." 472variable unless you are comfortable with that.
473
474This variable only takes effect when loading the `nnimap' library.
475See also `nnimap-log'."
468 :group 'nnimap 476 :group 'nnimap
469 :type 'boolean) 477 :type 'boolean)
470 478
@@ -555,8 +563,7 @@ If EXAMINE is non-nil the group is selected read-only."
555 (imap-mailbox-select group examine)) 563 (imap-mailbox-select group examine))
556 (let (minuid maxuid) 564 (let (minuid maxuid)
557 (when (> (imap-mailbox-get 'exists) 0) 565 (when (> (imap-mailbox-get 'exists) 0)
558 (imap-fetch (if imap-enable-exchange-bug-workaround "1,*:*" "1,*") 566 (imap-fetch-safe '("1,*" . "1,*:*") "UID" nil 'nouidfetch)
559 "UID" nil 'nouidfetch)
560 (imap-message-map (lambda (uid Uid) 567 (imap-message-map (lambda (uid Uid)
561 (setq minuid (if minuid (min minuid uid) uid) 568 (setq minuid (if minuid (min minuid uid) uid)
562 maxuid (if maxuid (max maxuid uid) uid))) 569 maxuid (if maxuid (max maxuid uid) uid)))
diff --git a/lisp/gnus/pop3.el b/lisp/gnus/pop3.el
index a99cff74433..2ca09d88277 100644
--- a/lisp/gnus/pop3.el
+++ b/lisp/gnus/pop3.el
@@ -105,33 +105,28 @@ Used for APOP authentication.")
105(defvar pop3-read-point nil) 105(defvar pop3-read-point nil)
106(defvar pop3-debug nil) 106(defvar pop3-debug nil)
107 107
108;; Borrowed from nnheader-accept-process-output in nnheader.el. 108;; Borrowed from nnheader-accept-process-output in nnheader.el. See the
109(defvar pop3-read-timeout 109;; comments there for explanations about the values.
110 (if (string-match "windows-nt\\|os/2\\|emx\\|cygwin" 110
111 (symbol-name system-type)) 111(eval-and-compile
112 ;; http://thread.gmane.org/v9655t3pjo.fsf@marauder.physik.uni-ulm.de 112 (if (and (fboundp 'nnheader-accept-process-output)
113 ;; 113 (boundp 'nnheader-read-timeout))
114 ;; IIRC, values lower than 1.0 didn't/don't work on Windows/DOS. 114 (defalias 'pop3-accept-process-output 'nnheader-accept-process-output)
115 ;; 115 ;; Borrowed from `nnheader.el':
116 ;; There should probably be a runtime test to determine the timing 116 (defvar pop3-read-timeout
117 ;; resolution, or a primitive to report it. I don't know off-hand 117 (if (string-match "windows-nt\\|os/2\\|emx\\|cygwin"
118 ;; what's possible. Perhaps better, maybe the Windows/DOS primitive 118 (symbol-name system-type))
119 ;; could round up non-zero timeouts to a minimum of 1.0? 119 1.0
120 1.0 120 0.01)
121 0.1) 121 "How long pop3 should wait between checking for the end of output.
122 "How long pop3 should wait between checking for the end of output.
123Shorter values mean quicker response, but are more CPU intensive.") 122Shorter values mean quicker response, but are more CPU intensive.")
124 123 (defun pop3-accept-process-output (process)
125;; Borrowed from nnheader-accept-process-output in nnheader.el. 124 (accept-process-output
126(defun pop3-accept-process-output (process) 125 process
127 (accept-process-output 126 (truncate pop3-read-timeout)
128 process 127 (truncate (* (- pop3-read-timeout
129 (truncate pop3-read-timeout) 128 (truncate pop3-read-timeout))
130 (truncate (* (- pop3-read-timeout 129 1000))))))
131 (truncate pop3-read-timeout))
132 1000))))
133
134(autoload 'nnheader-accept-process-output "nnheader")
135 130
136(defun pop3-movemail (&optional crashbox) 131(defun pop3-movemail (&optional crashbox)
137 "Transfer contents of a maildrop to the specified CRASHBOX." 132 "Transfer contents of a maildrop to the specified CRASHBOX."
@@ -171,7 +166,7 @@ Shorter values mean quicker response, but are more CPU intensive.")
171 (unless pop3-leave-mail-on-server 166 (unless pop3-leave-mail-on-server
172 (pop3-dele process n)) 167 (pop3-dele process n))
173 (setq n (+ 1 n)) 168 (setq n (+ 1 n))
174 (nnheader-accept-process-output process)) 169 (pop3-accept-process-output process))
175 (when (and pop3-leave-mail-on-server 170 (when (and pop3-leave-mail-on-server
176 (> n 1)) 171 (> n 1))
177 (message "pop3.el doesn't support UIDL. Setting `pop3-leave-mail-on-server' 172 (message "pop3.el doesn't support UIDL. Setting `pop3-leave-mail-on-server'
diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el
index 793c4f9a914..c40c6fc2cd9 100644
--- a/lisp/gnus/sieve-manage.el
+++ b/lisp/gnus/sieve-manage.el
@@ -304,15 +304,14 @@ Returns t if login was successful, nil otherwise."
304 (when (memq (process-status process) '(open run)) 304 (when (memq (process-status process) '(open run))
305 process)))) 305 process))))
306 306
307(defun imap-starttls-p (buffer) 307(defun sieve-manage-starttls-p (buffer)
308 ;; (and (imap-capability 'STARTTLS buffer)
309 (condition-case () 308 (condition-case ()
310 (progn 309 (progn
311 (require 'starttls) 310 (require 'starttls)
312 (call-process "starttls")) 311 (call-process "starttls"))
313 (error nil))) 312 (error nil)))
314 313
315(defun imap-starttls-open (name buffer server port) 314(defun sieve-manage-starttls-open (name buffer server port)
316 (let* ((port (or port sieve-manage-default-port)) 315 (let* ((port (or port sieve-manage-default-port))
317 (coding-system-for-read sieve-manage-coding-system-for-read) 316 (coding-system-for-read sieve-manage-coding-system-for-read)
318 (coding-system-for-write sieve-manage-coding-system-for-write) 317 (coding-system-for-write sieve-manage-coding-system-for-write)
diff --git a/lisp/gnus/spam-report.el b/lisp/gnus/spam-report.el
index 94c7622b200..816f973ccb1 100644
--- a/lisp/gnus/spam-report.el
+++ b/lisp/gnus/spam-report.el
@@ -117,17 +117,33 @@ Reports is as ham when HAM is set."
117 "Report an article as ham by resending via email." 117 "Report an article as ham by resending via email."
118 (spam-report-resend articles t)) 118 (spam-report-resend articles t))
119 119
120(defconst spam-report-gmane-max-requests 4
121 "Number of reports to send before waiting for a response.")
122
123(defvar spam-report-gmane-wait nil
124 "When non-nil, wait until we get a server response.
125This makes sure we don't DOS the host, if many reports are
126submitted at once. Internal variable.")
127
120(defun spam-report-gmane-ham (&rest articles) 128(defun spam-report-gmane-ham (&rest articles)
121 "Report ARTICLES as ham (unregister) through Gmane." 129 "Report ARTICLES as ham (unregister) through Gmane."
122 (interactive (gnus-summary-work-articles current-prefix-arg)) 130 (interactive (gnus-summary-work-articles current-prefix-arg))
123 (dolist (article articles) 131 (let ((count 0))
124 (spam-report-gmane-internal t article))) 132 (dolist (article articles)
133 (setq count (1+ count))
134 (let ((spam-report-gmane-wait
135 (zerop (% count spam-report-gmane-max-requests))))
136 (spam-report-gmane-internal t article)))))
125 137
126(defun spam-report-gmane-spam (&rest articles) 138(defun spam-report-gmane-spam (&rest articles)
127 "Report ARTICLES as spam through Gmane." 139 "Report ARTICLES as spam through Gmane."
128 (interactive (gnus-summary-work-articles current-prefix-arg)) 140 (interactive (gnus-summary-work-articles current-prefix-arg))
129 (dolist (article articles) 141 (let ((count 0))
130 (spam-report-gmane-internal nil article))) 142 (dolist (article articles)
143 (setq count (1+ count))
144 (let ((spam-report-gmane-wait
145 (zerop (% count spam-report-gmane-max-requests))))
146 (spam-report-gmane-internal nil article)))))
131 147
132;; `spam-report-gmane' was an interactive entry point, so we should provide an 148;; `spam-report-gmane' was an interactive entry point, so we should provide an
133;; alias. 149;; alias.
@@ -245,10 +261,14 @@ This is initialized based on `user-mail-address'."
245 tcp-connection 261 tcp-connection
246 (format "GET %s HTTP/1.1\nUser-Agent: %s\nHost: %s\n\n" 262 (format "GET %s HTTP/1.1\nUser-Agent: %s\nHost: %s\n\n"
247 report spam-report-user-agent host)) 263 report spam-report-user-agent host))
248 ;; Wait until we get something so we don't DOS the host. 264 ;; Wait until we get something so we don't DOS the host, if
249 (while (and (memq (process-status tcp-connection) '(open run)) 265 ;; `spam-report-gmane-wait' is let-bound to t.
250 (zerop (buffer-size))) 266 (when spam-report-gmane-wait
251 (accept-process-output tcp-connection))))) 267 (gnus-message 7 "Waiting for response from %s..." host)
268 (while (and (memq (process-status tcp-connection) '(open run))
269 (zerop (buffer-size)))
270 (accept-process-output tcp-connection))
271 (gnus-message 7 "Waiting for response from %s... done" host)))))
252 272
253;;;###autoload 273;;;###autoload
254(defun spam-report-process-queue (&optional file keep) 274(defun spam-report-process-queue (&optional file keep)
@@ -278,7 +298,13 @@ symbol `ask', query before flushing the queue file."
278 (while (and (not (eobp)) 298 (while (and (not (eobp))
279 (re-search-forward 299 (re-search-forward
280 "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t)) 300 "http://\\([^/]+\\)\\(/.*\\) *$" (point-at-eol) t))
281 (funcall spam-report-url-ping-function (match-string 1) (match-string 2)) 301 (let ((spam-report-gmane-wait
302 (zerop (% (mm-line-number-at-pos)
303 spam-report-gmane-max-requests))))
304 (gnus-message 6 "Reporting %s%s..."
305 (match-string 1) (match-string 2))
306 (funcall spam-report-url-ping-function
307 (match-string 1) (match-string 2)))
282 (forward-line 1)) 308 (forward-line 1))
283 (if (or (eq keep nil) 309 (if (or (eq keep nil)
284 (and (eq keep 'ask) 310 (and (eq keep 'ask)
diff --git a/lisp/net/dns.el b/lisp/net/dns.el
index e4dc9aa08ab..e0aba3c32ea 100644
--- a/lisp/net/dns.el
+++ b/lisp/net/dns.el
@@ -29,8 +29,8 @@
29 "How many seconds to wait when doing DNS queries.") 29 "How many seconds to wait when doing DNS queries.")
30 30
31(defvar dns-servers nil 31(defvar dns-servers nil
32 "Which DNS servers to query. 32 "List of DNS servers to query.
33If nil, /etc/resolv.conf will be consulted.") 33If nil, /etc/resolv.conf and nslookup will be consulted.")
34 34
35;;; Internal code: 35;;; Internal code:
36 36
@@ -298,14 +298,24 @@ If TCP-P, the first two bytes of the package with be the length field."
298 (t string))) 298 (t string)))
299 (goto-char point)))) 299 (goto-char point))))
300 300
301(defun dns-parse-resolv-conf () 301(defun dns-set-servers ()
302 (when (file-exists-p "/etc/resolv.conf") 302 "Set `dns-servers' to a list of DNS servers or nil if none are found.
303 (with-temp-buffer 303Parses \"/etc/resolv.conf\" or calls \"nslookup\"."
304 (insert-file-contents "/etc/resolv.conf") 304 (or (when (file-exists-p "/etc/resolv.conf")
305 (goto-char (point-min)) 305 (setq dns-servers nil)
306 (while (re-search-forward "^nameserver[\t ]+\\([^ \t\n]+\\)" nil t) 306 (with-temp-buffer
307 (push (match-string 1) dns-servers)) 307 (insert-file-contents "/etc/resolv.conf")
308 (setq dns-servers (nreverse dns-servers))))) 308 (goto-char (point-min))
309 (while (re-search-forward "^nameserver[\t ]+\\([^ \t\n]+\\)" nil t)
310 (push (match-string 1) dns-servers))
311 (setq dns-servers (nreverse dns-servers))))
312 (when (executable-find "nslookup")
313 (with-temp-buffer
314 (call-process "nslookup" nil t nil "localhost")
315 (goto-char (point-min))
316 (re-search-forward
317 "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t)
318 (setq dns-servers (list (match-string 1)))))))
309 319
310(defun dns-read-txt (string) 320(defun dns-read-txt (string)
311 (if (> (length string) 1) 321 (if (> (length string) 1)
@@ -351,23 +361,26 @@ If TCP-P, the first two bytes of the package with be the length field."
351 361
352(defvar dns-cache (make-vector 4096 0)) 362(defvar dns-cache (make-vector 4096 0))
353 363
354(defun query-dns-cached (name &optional type fullp reversep) 364(defun dns-query-cached (name &optional type fullp reversep)
355 (let* ((key (format "%s:%s:%s:%s" name type fullp reversep)) 365 (let* ((key (format "%s:%s:%s:%s" name type fullp reversep))
356 (sym (intern-soft key dns-cache))) 366 (sym (intern-soft key dns-cache)))
357 (if (and sym 367 (if (and sym
358 (boundp sym)) 368 (boundp sym))
359 (symbol-value sym) 369 (symbol-value sym)
360 (let ((result (query-dns name type fullp reversep))) 370 (let ((result (dns-query name type fullp reversep)))
361 (set (intern key dns-cache) result) 371 (set (intern key dns-cache) result)
362 result)))) 372 result))))
363 373
364(defun query-dns (name &optional type fullp reversep) 374;; The old names `query-dns' and `query-dns-cached' weren't used in Emacs 23
375;; yet, so no alias are provided. --rsteib
376
377(defun dns-query (name &optional type fullp reversep)
365 "Query a DNS server for NAME of TYPE. 378 "Query a DNS server for NAME of TYPE.
366If FULLP, return the entire record returned. 379If FULLP, return the entire record returned.
367If REVERSEP, look up an IP address." 380If REVERSEP, look up an IP address."
368 (setq type (or type 'A)) 381 (setq type (or type 'A))
369 (unless dns-servers 382 (unless dns-servers
370 (dns-parse-resolv-conf)) 383 (dns-set-servers))
371 384
372 (when reversep 385 (when reversep
373 (setq name (concat 386 (setq name (concat
diff --git a/lisp/net/imap.el b/lisp/net/imap.el
index dc295d5b367..6f2b2d11f97 100644
--- a/lisp/net/imap.el
+++ b/lisp/net/imap.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 3;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 4;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 5
6;; Author: Simon Josefsson <jas@pdc.kth.se> 6;; Author: Simon Josefsson <simon@josefsson.org>
7;; Keywords: mail 7;; Keywords: mail
8 8
9;; This file is part of GNU Emacs. 9;; This file is part of GNU Emacs.
@@ -23,7 +23,7 @@
23 23
24;;; Commentary: 24;;; Commentary:
25 25
26;; imap.el is a elisp library providing an interface for talking to 26;; imap.el is an elisp library providing an interface for talking to
27;; IMAP servers. 27;; IMAP servers.
28;; 28;;
29;; imap.el is roughly divided in two parts, one that parses IMAP 29;; imap.el is roughly divided in two parts, one that parses IMAP
@@ -72,25 +72,25 @@
72;; explanatory for someone that know IMAP. All functions have 72;; explanatory for someone that know IMAP. All functions have
73;; additional documentation on how to invoke them. 73;; additional documentation on how to invoke them.
74;; 74;;
75;; imap.el support RFC1730/2060/RFC3501 (IMAP4/IMAP4rev1), implemented 75;; imap.el supports RFC1730/2060/RFC3501 (IMAP4/IMAP4rev1). The implemented
76;; IMAP extensions are RFC2195 (CRAM-MD5), RFC2086 (ACL), RFC2342 76;; IMAP extensions are RFC2195 (CRAM-MD5), RFC2086 (ACL), RFC2342
77;; (NAMESPACE), RFC2359 (UIDPLUS), the IMAP-part of RFC2595 (STARTTLS, 77;; (NAMESPACE), RFC2359 (UIDPLUS), the IMAP-part of RFC2595 (STARTTLS,
78;; LOGINDISABLED) (with use of external library starttls.el and 78;; LOGINDISABLED) (with use of external library starttls.el and
79;; program starttls), and the GSSAPI / kerberos V4 sections of RFC1731 79;; program starttls), and the GSSAPI / Kerberos V4 sections of RFC1731
80;; (with use of external program `imtest'), RFC2971 (ID). It also 80;; (with use of external program `imtest'), and RFC2971 (ID). It also
81;; takes advantage of the UNSELECT extension in Cyrus IMAPD. 81;; takes advantage of the UNSELECT extension in Cyrus IMAPD.
82;; 82;;
83;; Without the work of John McClary Prevost and Jim Radford this library 83;; Without the work of John McClary Prevost and Jim Radford this library
84;; would not have seen the light of day. Many thanks. 84;; would not have seen the light of day. Many thanks.
85;; 85;;
86;; This is a transcript of short interactive session for demonstration 86;; This is a transcript of a short interactive session for demonstration
87;; purposes. 87;; purposes.
88;; 88;;
89;; (imap-open "my.mail.server") 89;; (imap-open "my.mail.server")
90;; => " *imap* my.mail.server:0" 90;; => " *imap* my.mail.server:0"
91;; 91;;
92;; The rest are invoked with current buffer as the buffer returned by 92;; The rest are invoked with current buffer as the buffer returned by
93;; `imap-open'. It is possible to do all without this, but it would 93;; `imap-open'. It is possible to do it all without this, but it would
94;; look ugly here since `buffer' is always the last argument for all 94;; look ugly here since `buffer' is always the last argument for all
95;; imap.el API functions. 95;; imap.el API functions.
96;; 96;;
@@ -121,6 +121,7 @@
121;; Todo: 121;; Todo:
122;; 122;;
123;; o Parse UIDs as strings? We need to overcome the 28 bit limit somehow. 123;; o Parse UIDs as strings? We need to overcome the 28 bit limit somehow.
124;; Use IEEE floats (which are effectively exact)? -- fx
124;; o Don't use `read' at all (important places already fixed) 125;; o Don't use `read' at all (important places already fixed)
125;; o Accept list of articles instead of message set string in most 126;; o Accept list of articles instead of message set string in most
126;; imap-message-* functions. 127;; imap-message-* functions.
@@ -131,7 +132,7 @@
131;; - 19991218 added starttls/digest-md5 patch, 132;; - 19991218 added starttls/digest-md5 patch,
132;; by Daiki Ueno <ueno@ueda.info.waseda.ac.jp> 133;; by Daiki Ueno <ueno@ueda.info.waseda.ac.jp>
133;; NB! you need SLIM for starttls.el and digest-md5.el 134;; NB! you need SLIM for starttls.el and digest-md5.el
134;; - 19991023 commited to pgnus 135;; - 19991023 committed to pgnus
135;; 136;;
136 137
137;;; Code: 138;;; Code:
@@ -204,19 +205,19 @@ until a successful connection is made."
204Within a string, %s is replaced with the server address, %p with port 205Within a string, %s is replaced with the server address, %p with port
205number on server, %g with `imap-shell-host', and %l with 206number on server, %g with `imap-shell-host', and %l with
206`imap-default-user'. The program should read IMAP commands from stdin 207`imap-default-user'. The program should read IMAP commands from stdin
207and write IMAP response to stdout. Each entry in the list is tried 208and write IMAP response to stdout. Each entry in the list is tried
208until a successful connection is made." 209until a successful connection is made."
209 :group 'imap 210 :group 'imap
210 :type '(repeat string)) 211 :type '(repeat string))
211 212
212(defcustom imap-process-connection-type nil 213(defcustom imap-process-connection-type nil
213 "*Value for `process-connection-type' to use for Kerberos4, GSSAPI and SSL. 214 "*Value for `process-connection-type' to use for Kerberos4, GSSAPI and SSL.
214The `process-connection-type' variable control type of device 215The `process-connection-type' variable controls the type of device
215used to communicate with subprocesses. Values are nil to use a 216used to communicate with subprocesses. Values are nil to use a
216pipe, or t or `pty' to use a pty. The value has no effect if the 217pipe, or t or `pty' to use a pty. The value has no effect if the
217system has no ptys or if all ptys are busy: then a pipe is used 218system has no ptys or if all ptys are busy: then a pipe is used
218in any case. The value takes effect when a IMAP server is 219in any case. The value takes effect when an IMAP server is
219opened, changing it after that has no effect." 220opened; changing it after that has no effect."
220 :version "22.1" 221 :version "22.1"
221 :group 'imap 222 :group 'imap
222 :type 'boolean) 223 :type 'boolean)
@@ -230,20 +231,28 @@ encoded mailboxes which doesn't translate into ISO-8859-1."
230 :type 'boolean) 231 :type 'boolean)
231 232
232(defcustom imap-log nil 233(defcustom imap-log nil
233 "If non-nil, a imap session trace is placed in *imap-log* buffer. 234 "If non-nil, an imap session trace is placed in `imap-log-buffer'.
234Note that username, passwords and other privacy sensitive 235Note that username, passwords and other privacy sensitive
235information (such as e-mail) may be stored in the *imap-log* 236information (such as e-mail) may be stored in the buffer.
236buffer. It is not written to disk, however. Do not enable this 237It is not written to disk, however. Do not enable this
237variable unless you are comfortable with that." 238variable unless you are comfortable with that.
239
240See also `imap-debug'."
238 :group 'imap 241 :group 'imap
239 :type 'boolean) 242 :type 'boolean)
240 243
241(defcustom imap-debug nil 244(defcustom imap-debug nil
242 "If non-nil, random debug spews are placed in *imap-debug* buffer. 245 "If non-nil, trace imap- functions into `imap-debug-buffer'.
246Uses `trace-function-background', so you can turn it off with,
247say, `untrace-all'.
248
243Note that username, passwords and other privacy sensitive 249Note that username, passwords and other privacy sensitive
244information (such as e-mail) may be stored in the *imap-debug* 250information (such as e-mail) may be stored in the buffer.
245buffer. It is not written to disk, however. Do not enable this 251It is not written to disk, however. Do not enable this
246variable unless you are comfortable with that." 252variable unless you are comfortable with that.
253
254This variable only takes effect when loading the `imap' library.
255See also `imap-log'."
247 :group 'imap 256 :group 'imap
248 :type 'boolean) 257 :type 'boolean)
249 258
@@ -268,7 +277,7 @@ Shorter values mean quicker response, but is more CPU intensive."
268 :group 'imap) 277 :group 'imap)
269 278
270(defcustom imap-store-password nil 279(defcustom imap-store-password nil
271 "If non-nil, store session password without promting." 280 "If non-nil, store session password without prompting."
272 :group 'imap 281 :group 'imap
273 :type 'boolean) 282 :type 'boolean)
274 283
@@ -393,7 +402,7 @@ and `examine'.")
393 "Obarray with mailbox data.") 402 "Obarray with mailbox data.")
394 403
395(defvar imap-mailbox-prime 997 404(defvar imap-mailbox-prime 997
396 "Length of imap-mailbox-data.") 405 "Length of `imap-mailbox-data'.")
397 406
398(defvar imap-current-message nil 407(defvar imap-current-message nil
399 "Current message number.") 408 "Current message number.")
@@ -402,7 +411,7 @@ and `examine'.")
402 "Obarray with message data.") 411 "Obarray with message data.")
403 412
404(defvar imap-message-prime 997 413(defvar imap-message-prime 997
405 "Length of imap-message-data.") 414 "Length of `imap-message-data'.")
406 415
407(defvar imap-capability nil 416(defvar imap-capability nil
408 "Capability for server.") 417 "Capability for server.")
@@ -440,17 +449,23 @@ second the status (OK, NO, BAD etc) of the command.")
440 449
441(defvar imap-enable-exchange-bug-workaround nil 450(defvar imap-enable-exchange-bug-workaround nil
442 "Send FETCH UID commands as *:* instead of *. 451 "Send FETCH UID commands as *:* instead of *.
443Enabling this appears to be required for some servers (e.g., 452
444Microsoft Exchange) which otherwise would trigger a response 'BAD 453When non-nil, use an alternative UIDS form. Enabling appears to
445The specified message set is invalid.'.") 454be required for some servers (e.g., Microsoft Exchange 2007)
455which otherwise would trigger a response 'BAD The specified
456message set is invalid.'. We don't unconditionally use this
457form, since this is said to be significantly inefficient.
458
459This variable is set to t automatically per server if the
460canonical form fails.")
446 461
447 462
448;; Utility functions: 463;; Utility functions:
449 464
450(defun imap-remassoc (key alist) 465(defun imap-remassoc (key alist)
451 "Delete by side effect any elements of LIST whose car is `equal' to KEY. 466 "Delete by side effect any elements of ALIST whose car is `equal' to KEY.
452The modified LIST is returned. If the first member 467The modified ALIST is returned. If the first member
453of LIST has a car that is `equal' to KEY, there is no way to remove it 468of ALIST has a car that is `equal' to KEY, there is no way to remove it
454by side effect; therefore, write `(setq foo (remassoc key foo))' to be 469by side effect; therefore, write `(setq foo (remassoc key foo))' to be
455sure of changing the value of `foo'." 470sure of changing the value of `foo'."
456 (when alist 471 (when alist
@@ -650,7 +665,7 @@ sure of changing the value of `foo'."
650 nil) 665 nil)
651 666
652(defun imap-ssl-open (name buffer server port) 667(defun imap-ssl-open (name buffer server port)
653 "Open a SSL connection to server." 668 "Open an SSL connection to SERVER."
654 (let ((cmds (if (listp imap-ssl-program) imap-ssl-program 669 (let ((cmds (if (listp imap-ssl-program) imap-ssl-program
655 (list imap-ssl-program))) 670 (list imap-ssl-program)))
656 cmd done) 671 cmd done)
@@ -711,6 +726,13 @@ sure of changing the value of `foo'."
711 (process (open-tls-stream name buffer server port))) 726 (process (open-tls-stream name buffer server port)))
712 (when process 727 (when process
713 (while (and (memq (process-status process) '(open run)) 728 (while (and (memq (process-status process) '(open run))
729 ;; FIXME: Per the "blue moon" comment, the process/buffer
730 ;; handling here, and elsewhere in functions which open
731 ;; streams, looks confused. Obviously we can change buffers
732 ;; if a different process handler kicks in from
733 ;; `accept-process-output' or `sit-for' below, and TRT seems
734 ;; to be to `save-buffer' around those calls. (I wonder why
735 ;; `sit-for' is used with a non-zero wait.) -- fx
714 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug 736 (set-buffer buffer) ;; XXX "blue moon" nntp.el bug
715 (goto-char (point-max)) 737 (goto-char (point-max))
716 (forward-line -1) 738 (forward-line -1)
@@ -1081,7 +1103,7 @@ Returns t if login was successful, nil otherwise."
1081 imap-process)))) 1103 imap-process))))
1082 1104
1083(defun imap-open (server &optional port stream auth buffer) 1105(defun imap-open (server &optional port stream auth buffer)
1084 "Open a IMAP connection to host SERVER at PORT returning a buffer. 1106 "Open an IMAP connection to host SERVER at PORT returning a buffer.
1085If PORT is unspecified, a default value is used (143 except 1107If PORT is unspecified, a default value is used (143 except
1086for SSL which use 993). 1108for SSL which use 993).
1087STREAM indicates the stream to use, see `imap-streams' for available 1109STREAM indicates the stream to use, see `imap-streams' for available
@@ -1402,7 +1424,7 @@ If EXAMINE is non-nil, do a read-only select."
1402 1424
1403(defun imap-mailbox-expunge (&optional asynch buffer) 1425(defun imap-mailbox-expunge (&optional asynch buffer)
1404 "Expunge articles in current folder in BUFFER. 1426 "Expunge articles in current folder in BUFFER.
1405If ASYNCH, do not wait for succesful completion of the command. 1427If ASYNCH, do not wait for successful completion of the command.
1406If BUFFER is nil the current buffer is assumed." 1428If BUFFER is nil the current buffer is assumed."
1407 (with-current-buffer (or buffer (current-buffer)) 1429 (with-current-buffer (or buffer (current-buffer))
1408 (when (and imap-current-mailbox (not (eq imap-state 'examine))) 1430 (when (and imap-current-mailbox (not (eq imap-state 'examine)))
@@ -1412,7 +1434,7 @@ If BUFFER is nil the current buffer is assumed."
1412 1434
1413(defun imap-mailbox-close (&optional asynch buffer) 1435(defun imap-mailbox-close (&optional asynch buffer)
1414 "Expunge articles and close current folder in BUFFER. 1436 "Expunge articles and close current folder in BUFFER.
1415If ASYNCH, do not wait for succesful completion of the command. 1437If ASYNCH, do not wait for successful completion of the command.
1416If BUFFER is nil the current buffer is assumed." 1438If BUFFER is nil the current buffer is assumed."
1417 (with-current-buffer (or buffer (current-buffer)) 1439 (with-current-buffer (or buffer (current-buffer))
1418 (when imap-current-mailbox 1440 (when imap-current-mailbox
@@ -1510,7 +1532,7 @@ passed to list command."
1510 (nreverse out))))) 1532 (nreverse out)))))
1511 1533
1512(defun imap-mailbox-subscribe (mailbox &optional buffer) 1534(defun imap-mailbox-subscribe (mailbox &optional buffer)
1513 "Send the SUBSCRIBE command on the mailbox to server in BUFFER. 1535 "Send the SUBSCRIBE command on the MAILBOX to server in BUFFER.
1514Returns non-nil if successful." 1536Returns non-nil if successful."
1515 (with-current-buffer (or buffer (current-buffer)) 1537 (with-current-buffer (or buffer (current-buffer))
1516 (imap-ok-p (imap-send-command-wait (concat "SUBSCRIBE \"" 1538 (imap-ok-p (imap-send-command-wait (concat "SUBSCRIBE \""
@@ -1518,7 +1540,7 @@ Returns non-nil if successful."
1518 "\""))))) 1540 "\"")))))
1519 1541
1520(defun imap-mailbox-unsubscribe (mailbox &optional buffer) 1542(defun imap-mailbox-unsubscribe (mailbox &optional buffer)
1521 "Send the SUBSCRIBE command on the mailbox to server in BUFFER. 1543 "Send the SUBSCRIBE command on the MAILBOX to server in BUFFER.
1522Returns non-nil if successful." 1544Returns non-nil if successful."
1523 (with-current-buffer (or buffer (current-buffer)) 1545 (with-current-buffer (or buffer (current-buffer))
1524 (imap-ok-p (imap-send-command-wait (concat "UNSUBSCRIBE " 1546 (imap-ok-p (imap-send-command-wait (concat "UNSUBSCRIBE "
@@ -1528,8 +1550,8 @@ Returns non-nil if successful."
1528(defun imap-mailbox-status (mailbox items &optional buffer) 1550(defun imap-mailbox-status (mailbox items &optional buffer)
1529 "Get status items ITEM in MAILBOX from server in BUFFER. 1551 "Get status items ITEM in MAILBOX from server in BUFFER.
1530ITEMS can be a symbol or a list of symbols, valid symbols are one of 1552ITEMS can be a symbol or a list of symbols, valid symbols are one of
1531the STATUS data items -- ie 'messages, 'recent, 'uidnext, 'uidvalidity 1553the STATUS data items -- i.e. `messages', `recent', `uidnext', `uidvalidity',
1532or 'unseen. If ITEMS is a list of symbols, a list of values is 1554or `unseen'. If ITEMS is a list of symbols, a list of values is
1533returned, if ITEMS is a symbol only its value is returned." 1555returned, if ITEMS is a symbol only its value is returned."
1534 (with-current-buffer (or buffer (current-buffer)) 1556 (with-current-buffer (or buffer (current-buffer))
1535 (when (imap-ok-p 1557 (when (imap-ok-p
@@ -1550,7 +1572,7 @@ returned, if ITEMS is a symbol only its value is returned."
1550(defun imap-mailbox-status-asynch (mailbox items &optional buffer) 1572(defun imap-mailbox-status-asynch (mailbox items &optional buffer)
1551 "Send status item request ITEM on MAILBOX to server in BUFFER. 1573 "Send status item request ITEM on MAILBOX to server in BUFFER.
1552ITEMS can be a symbol or a list of symbols, valid symbols are one of 1574ITEMS can be a symbol or a list of symbols, valid symbols are one of
1553the STATUS data items -- ie 'messages, 'recent, 'uidnext, 'uidvalidity 1575the STATUS data items -- i.e. 'messages, 'recent, 'uidnext, 'uidvalidity
1554or 'unseen. The IMAP command tag is returned." 1576or 'unseen. The IMAP command tag is returned."
1555 (with-current-buffer (or buffer (current-buffer)) 1577 (with-current-buffer (or buffer (current-buffer))
1556 (imap-send-command (list "STATUS \"" 1578 (imap-send-command (list "STATUS \""
@@ -1563,7 +1585,7 @@ or 'unseen. The IMAP command tag is returned."
1563 (list items)))))))) 1585 (list items))))))))
1564 1586
1565(defun imap-mailbox-acl-get (&optional mailbox buffer) 1587(defun imap-mailbox-acl-get (&optional mailbox buffer)
1566 "Get ACL on mailbox from server in BUFFER." 1588 "Get ACL on MAILBOX from server in BUFFER."
1567 (let ((mailbox (imap-utf7-encode mailbox))) 1589 (let ((mailbox (imap-utf7-encode mailbox)))
1568 (with-current-buffer (or buffer (current-buffer)) 1590 (with-current-buffer (or buffer (current-buffer))
1569 (when (imap-ok-p 1591 (when (imap-ok-p
@@ -1585,7 +1607,7 @@ or 'unseen. The IMAP command tag is returned."
1585 rights)))))) 1607 rights))))))
1586 1608
1587(defun imap-mailbox-acl-delete (identifier &optional mailbox buffer) 1609(defun imap-mailbox-acl-delete (identifier &optional mailbox buffer)
1588 "Removes any <identifier,rights> pair for IDENTIFIER in MAILBOX from server in BUFFER." 1610 "Remove any <identifier,rights> pair for IDENTIFIER in MAILBOX from server in BUFFER."
1589 (let ((mailbox (imap-utf7-encode mailbox))) 1611 (let ((mailbox (imap-utf7-encode mailbox)))
1590 (with-current-buffer (or buffer (current-buffer)) 1612 (with-current-buffer (or buffer (current-buffer))
1591 (imap-ok-p 1613 (imap-ok-p
@@ -1720,6 +1742,7 @@ is non-nil return these properties."
1720 `(with-current-buffer (or ,buffer (current-buffer)) 1742 `(with-current-buffer (or ,buffer (current-buffer))
1721 (imap-message-get ,uid 'BODY))) 1743 (imap-message-get ,uid 'BODY)))
1722 1744
1745;; FIXME: Should this try to use CHARSET? -- fx
1723(defun imap-search (predicate &optional buffer) 1746(defun imap-search (predicate &optional buffer)
1724 (with-current-buffer (or buffer (current-buffer)) 1747 (with-current-buffer (or buffer (current-buffer))
1725 (imap-mailbox-put 'search 'dummy) 1748 (imap-mailbox-put 'search 'dummy)
@@ -1766,9 +1789,38 @@ is non-nil return these properties."
1766 (let ((number (string-to-number string base))) 1789 (let ((number (string-to-number string base)))
1767 (if (> number most-positive-fixnum) 1790 (if (> number most-positive-fixnum)
1768 (error 1791 (error
1769 (format "String %s cannot be converted to a lisp integer" number)) 1792 (format "String %s cannot be converted to a Lisp integer" number))
1770 number))) 1793 number)))
1771 1794
1795(defun imap-fetch-safe (uids props &optional receive nouidfetch buffer)
1796 "Like `imap-fetch', but DTRT with Exchange 2007 bug.
1797However, UIDS here is a cons, where the car is the canonical form
1798of the UIDS specification, and the cdr is the one which works with
1799Exchange 2007 or, potentially, other buggy servers.
1800See `imap-enable-exchange-bug-workaround'."
1801 ;; We don't unconditionally use the alternative (valid) form, since
1802 ;; this is said to be significantly inefficient. The first time we
1803 ;; get here for a given, we'll try the canonical form. If we get
1804 ;; the known error from the buggy server, set the flag
1805 ;; buffer-locally (to account for connections to multiple servers),
1806 ;; then re-try with the alternative UIDS spec.
1807 (condition-case data
1808 (imap-fetch (if imap-enable-exchange-bug-workaround
1809 (cdr uids)
1810 (car uids))
1811 props receive nouidfetch buffer)
1812 (error
1813 (if (and (not imap-enable-exchange-bug-workaround)
1814 (string-match
1815 "The specified message set is invalid"
1816 (cadr data)))
1817 (with-current-buffer (or buffer (current-buffer))
1818 (set (make-local-variable
1819 'imap-enable-exchange-bug-workaround)
1820 t)
1821 (imap-fetch (cdr uids) props receive nouidfetch))
1822 (signal (car data) (cdr data))))))
1823
1772(defun imap-message-copyuid-1 (mailbox) 1824(defun imap-message-copyuid-1 (mailbox)
1773 (if (imap-capability 'UIDPLUS) 1825 (if (imap-capability 'UIDPLUS)
1774 (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox)) 1826 (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox))
@@ -1778,8 +1830,7 @@ is non-nil return these properties."
1778 (imap-message-data (make-vector 2 0))) 1830 (imap-message-data (make-vector 2 0)))
1779 (when (imap-mailbox-examine-1 mailbox) 1831 (when (imap-mailbox-examine-1 mailbox)
1780 (prog1 1832 (prog1
1781 (and (imap-fetch 1833 (and (imap-fetch-safe '("*" . "*:*") "UID")
1782 (if imap-enable-exchange-bug-workaround "*:*" "*") "UID")
1783 (list (imap-mailbox-get-1 'uidvalidity mailbox) 1834 (list (imap-mailbox-get-1 'uidvalidity mailbox)
1784 (apply 'max (imap-message-map 1835 (apply 'max (imap-message-map
1785 (lambda (uid prop) uid) 'UID)))) 1836 (lambda (uid prop) uid) 'UID))))
@@ -1793,11 +1844,11 @@ is non-nil return these properties."
1793 1844
1794(defun imap-message-copy (articles mailbox 1845(defun imap-message-copy (articles mailbox
1795 &optional dont-create no-copyuid buffer) 1846 &optional dont-create no-copyuid buffer)
1796 "Copy ARTICLES (a string message set) to MAILBOX on server in 1847 "Copy ARTICLES to MAILBOX on server in BUFFER.
1797BUFFER, creating mailbox if it doesn't exist. If dont-create is 1848ARTICLES is a string message set. Create mailbox if it doesn't exist,
1798non-nil, it will not create a mailbox. On success, return a list with 1849unless DONT-CREATE is non-nil. On success, return a list with
1799the UIDVALIDITY of the mailbox the article(s) was copied to as the 1850the UIDVALIDITY of the mailbox the article(s) was copied to as the
1800first element, rest of list contain the saved articles' UIDs." 1851first element. The rest of list contains the saved articles' UIDs."
1801 (when articles 1852 (when articles
1802 (with-current-buffer (or buffer (current-buffer)) 1853 (with-current-buffer (or buffer (current-buffer))
1803 (let ((mailbox (imap-utf7-encode mailbox))) 1854 (let ((mailbox (imap-utf7-encode mailbox)))
@@ -1815,6 +1866,8 @@ first element, rest of list contain the saved articles' UIDs."
1815 (or no-copyuid 1866 (or no-copyuid
1816 (imap-message-copyuid-1 mailbox))))))) 1867 (imap-message-copyuid-1 mailbox)))))))
1817 1868
1869;; FIXME: Amalgamate with imap-message-copyuid-1, using an extra arg, since it
1870;; shares most of the code? -- fx
1818(defun imap-message-appenduid-1 (mailbox) 1871(defun imap-message-appenduid-1 (mailbox)
1819 (if (imap-capability 'UIDPLUS) 1872 (if (imap-capability 'UIDPLUS)
1820 (imap-mailbox-get-1 'appenduid mailbox) 1873 (imap-mailbox-get-1 'appenduid mailbox)
@@ -1823,8 +1876,7 @@ first element, rest of list contain the saved articles' UIDs."
1823 (imap-message-data (make-vector 2 0))) 1876 (imap-message-data (make-vector 2 0)))
1824 (when (imap-mailbox-examine-1 mailbox) 1877 (when (imap-mailbox-examine-1 mailbox)
1825 (prog1 1878 (prog1
1826 (and (imap-fetch 1879 (and (imap-fetch-safe '("*" . "*:*") "UID")
1827 (if imap-enable-exchange-bug-workaround "*:*" "*") "UID")
1828 (list (imap-mailbox-get-1 'uidvalidity mailbox) 1880 (list (imap-mailbox-get-1 'uidvalidity mailbox)
1829 (apply 'max (imap-message-map 1881 (apply 'max (imap-message-map
1830 (lambda (uid prop) uid) 'UID)))) 1882 (lambda (uid prop) uid) 'UID))))
@@ -2201,7 +2253,7 @@ Return nil if no complete line has arrived."
2201;; resp-cond-bye = "BYE" SP resp-text 2253;; resp-cond-bye = "BYE" SP resp-text
2202 2254
2203(defun imap-parse-greeting () 2255(defun imap-parse-greeting ()
2204 "Parse a IMAP greeting." 2256 "Parse an IMAP greeting."
2205 (cond ((looking-at "\\* OK ") 2257 (cond ((looking-at "\\* OK ")
2206 (setq imap-state 'nonauth)) 2258 (setq imap-state 'nonauth))
2207 ((looking-at "\\* PREAUTH ") 2259 ((looking-at "\\* PREAUTH ")
@@ -2623,7 +2675,7 @@ Return nil if no complete line has arrived."
2623 2675
2624(defun imap-parse-flag-list () 2676(defun imap-parse-flag-list ()
2625 (let (flag-list start) 2677 (let (flag-list start)
2626 (assert (eq (char-after) ?\() nil "In imap-parse-flag-list") 2678 (assert (eq (char-after) ?\() nil "In imap-parse-flag-list 1")
2627 (while (and (not (eq (char-after) ?\))) 2679 (while (and (not (eq (char-after) ?\)))
2628 (setq start (progn 2680 (setq start (progn
2629 (imap-forward) 2681 (imap-forward)
@@ -2632,7 +2684,7 @@ Return nil if no complete line has arrived."
2632 (point))) 2684 (point)))
2633 (> (skip-chars-forward "^ )" (point-at-eol)) 0)) 2685 (> (skip-chars-forward "^ )" (point-at-eol)) 0))
2634 (push (buffer-substring start (point)) flag-list)) 2686 (push (buffer-substring start (point)) flag-list))
2635 (assert (eq (char-after) ?\)) nil "In imap-parse-flag-list") 2687 (assert (eq (char-after) ?\)) nil "In imap-parse-flag-list 2")
2636 (imap-forward) 2688 (imap-forward)
2637 (nreverse flag-list))) 2689 (nreverse flag-list)))
2638 2690
@@ -2828,7 +2880,7 @@ Return nil if no complete line has arrived."
2828 (let (subbody) 2880 (let (subbody)
2829 (while (and (eq (char-after) ?\() 2881 (while (and (eq (char-after) ?\()
2830 (setq subbody (imap-parse-body))) 2882 (setq subbody (imap-parse-body)))
2831 ;; buggy stalker communigate pro 3.0 insert a SPC between 2883 ;; buggy stalker communigate pro 3.0 inserts a SPC between
2832 ;; parts in multiparts 2884 ;; parts in multiparts
2833 (when (and (eq (char-after) ?\ ) 2885 (when (and (eq (char-after) ?\ )
2834 (eq (char-after (1+ (point))) ?\()) 2886 (eq (char-after (1+ (point))) ?\())
@@ -2861,22 +2913,28 @@ Return nil if no complete line has arrived."
2861 (imap-forward) 2913 (imap-forward)
2862 (push (imap-parse-nstring) body) ;; body-fld-desc 2914 (push (imap-parse-nstring) body) ;; body-fld-desc
2863 (imap-forward) 2915 (imap-forward)
2864 ;; next `or' for Sun SIMS bug, it regard body-fld-enc as a 2916 ;; Next `or' for Sun SIMS bug. It regards body-fld-enc as a
2865 ;; nstring and return nil instead of defaulting back to 7BIT 2917 ;; nstring and returns nil instead of defaulting back to 7BIT
2866 ;; as the standard says. 2918 ;; as the standard says.
2919 ;; Exchange (2007, at least) does this as well.
2867 (push (or (imap-parse-nstring) "7BIT") body) ;; body-fld-enc 2920 (push (or (imap-parse-nstring) "7BIT") body) ;; body-fld-enc
2868 (imap-forward) 2921 (imap-forward)
2869 (push (imap-parse-number) body) ;; body-fld-octets 2922 ;; Exchange 2007 can return -1, contrary to the spec...
2923 (if (eq (char-after) ?-)
2924 (progn
2925 (skip-chars-forward "-0-9")
2926 (push nil body))
2927 (push (imap-parse-number) body)) ;; body-fld-octets
2870 2928
2871 ;; ok, we're done parsing the required parts, what comes now is one 2929 ;; Ok, we're done parsing the required parts, what comes now is one of
2872 ;; of three things: 2930 ;; three things:
2873 ;; 2931 ;;
2874 ;; envelope (then we're parsing body-type-msg) 2932 ;; envelope (then we're parsing body-type-msg)
2875 ;; body-fld-lines (then we're parsing body-type-text) 2933 ;; body-fld-lines (then we're parsing body-type-text)
2876 ;; body-ext-1part (then we're parsing body-type-basic) 2934 ;; body-ext-1part (then we're parsing body-type-basic)
2877 ;; 2935 ;;
2878 ;; the problem is that the two first are in turn optionally followed 2936 ;; The problem is that the two first are in turn optionally followed
2879;; by the third. So we parse the first two here (if there are any)... 2937 ;; by the third. So we parse the first two here (if there are any)...
2880 2938
2881 (when (eq (char-after) ?\ ) 2939 (when (eq (char-after) ?\ )
2882 (imap-forward) 2940 (imap-forward)