Mercurial > emacs
comparison lisp/gnus/gnus-sum.el @ 56927:55fd4f77387a after-merge-gnus-5_10
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Merge from emacs--gnus--5.10, gnus--rel--5.10
Patches applied:
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0
tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1
Import from CVS branch gnus-5_10-branch
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2
Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19
Remove autoconf-generated files from archive
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sat, 04 Sep 2004 13:13:48 +0000 |
parents | 695cf19ef79e |
children | d7605794bc2b |
comparison
equal
deleted
inserted
replaced
56926:f8e248e9a717 | 56927:55fd4f77387a |
---|---|
1 ;;; gnus-sum.el --- summary mode commands for Gnus | 1 ;;; gnus-sum.el --- summary mode commands for Gnus |
2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 | 2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 |
3 ;; Free Software Foundation, Inc. | 3 ;; Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> | 5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
6 ;; Keywords: news | 6 ;; Keywords: news |
7 | 7 |
24 | 24 |
25 ;;; Commentary: | 25 ;;; Commentary: |
26 | 26 |
27 ;;; Code: | 27 ;;; Code: |
28 | 28 |
29 (eval-when-compile (require 'cl)) | 29 (eval-when-compile |
30 (require 'cl) | |
31 (defvar tool-bar-map)) | |
30 | 32 |
31 (require 'gnus) | 33 (require 'gnus) |
32 (require 'gnus-group) | 34 (require 'gnus-group) |
33 (require 'gnus-spec) | 35 (require 'gnus-spec) |
34 (require 'gnus-range) | 36 (require 'gnus-range) |
35 (require 'gnus-int) | 37 (require 'gnus-int) |
36 (require 'gnus-undo) | 38 (require 'gnus-undo) |
37 (require 'gnus-util) | 39 (require 'gnus-util) |
38 (require 'mm-decode) | 40 (require 'mm-decode) |
39 ;; Recursive :-(. | |
40 ;; (require 'gnus-art) | |
41 (require 'nnoo) | 41 (require 'nnoo) |
42 | |
42 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t) | 43 (autoload 'gnus-summary-limit-include-cached "gnus-cache" nil t) |
43 (autoload 'gnus-cache-write-active "gnus-cache") | 44 (autoload 'gnus-cache-write-active "gnus-cache") |
45 (autoload 'gnus-mailing-list-insinuate "gnus-ml" nil t) | |
46 (autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" nil t) | |
44 (autoload 'mm-uu-dissect "mm-uu") | 47 (autoload 'mm-uu-dissect "mm-uu") |
48 (autoload 'gnus-article-outlook-deuglify-article "deuglify" | |
49 "Deuglify broken Outlook (Express) articles and redisplay." | |
50 t) | |
51 (autoload 'gnus-article-outlook-unwrap-lines "deuglify" nil t) | |
52 (autoload 'gnus-article-outlook-repair-attribution "deuglify" nil t) | |
53 (autoload 'gnus-article-outlook-rearrange-citation "deuglify" nil t) | |
45 | 54 |
46 (defcustom gnus-kill-summary-on-exit t | 55 (defcustom gnus-kill-summary-on-exit t |
47 "*If non-nil, kill the summary buffer when you exit from it. | 56 "*If non-nil, kill the summary buffer when you exit from it. |
48 If nil, the summary will become a \"*Dead Summary*\" buffer, and | 57 If nil, the summary will become a \"*Dead Summary*\" buffer, and |
49 it will be killed sometime later." | 58 it will be killed sometime later." |
103 (const none) | 112 (const none) |
104 (const dummy) | 113 (const dummy) |
105 (const adopt) | 114 (const adopt) |
106 (const empty))) | 115 (const empty))) |
107 | 116 |
117 (defcustom gnus-summary-make-false-root-always nil | |
118 "Always make a false dummy root." | |
119 :group 'gnus-thread | |
120 :type 'boolean) | |
121 | |
108 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$" | 122 (defcustom gnus-summary-gather-exclude-subject "^ *$\\|^(none)$" |
109 "*A regexp to match subjects to be excluded from loose thread gathering. | 123 "*A regexp to match subjects to be excluded from loose thread gathering. |
110 As loose thread gathering is done on subjects only, that means that | 124 As loose thread gathering is done on subjects only, that means that |
111 there can be many false gatherings performed. By rooting out certain | 125 there can be many false gatherings performed. By rooting out certain |
112 common subjects, gathering might become saner." | 126 common subjects, gathering might become saner." |
130 | 144 |
131 (defcustom gnus-simplify-subject-functions nil | 145 (defcustom gnus-simplify-subject-functions nil |
132 "List of functions taking a string argument that simplify subjects. | 146 "List of functions taking a string argument that simplify subjects. |
133 The functions are applied recursively. | 147 The functions are applied recursively. |
134 | 148 |
135 Useful functions to put in this list include: `gnus-simplify-subject-re', | 149 Useful functions to put in this list include: |
136 `gnus-simplify-subject-fuzzy' and `gnus-simplify-whitespace'." | 150 `gnus-simplify-subject-re', `gnus-simplify-subject-fuzzy', |
151 `gnus-simplify-whitespace', and `gnus-simplify-all-whitespace'." | |
137 :group 'gnus-thread | 152 :group 'gnus-thread |
138 :type '(repeat function)) | 153 :type '(repeat function)) |
139 | 154 |
140 (defcustom gnus-simplify-ignored-prefixes nil | 155 (defcustom gnus-simplify-ignored-prefixes nil |
141 "*Regexp, matches for which are removed from subject lines when simplifying fuzzily." | 156 "*Remove matches for this regexp from subject lines when simplifying fuzzily." |
142 :group 'gnus-thread | 157 :group 'gnus-thread |
143 :type '(choice (const :tag "off" nil) | 158 :type '(choice (const :tag "off" nil) |
144 regexp)) | 159 regexp)) |
145 | 160 |
146 (defcustom gnus-build-sparse-threads nil | 161 (defcustom gnus-build-sparse-threads nil |
195 If this variable is nil, scoring will be disabled." | 210 If this variable is nil, scoring will be disabled." |
196 :group 'gnus-score-default | 211 :group 'gnus-score-default |
197 :type '(choice (const :tag "disable") | 212 :type '(choice (const :tag "disable") |
198 integer)) | 213 integer)) |
199 | 214 |
215 (defcustom gnus-summary-default-high-score 0 | |
216 "*Default threshold for a high scored article. | |
217 An article will be highlighted as high scored if its score is greater | |
218 than this score." | |
219 :group 'gnus-score-default | |
220 :type 'integer) | |
221 | |
222 (defcustom gnus-summary-default-low-score 0 | |
223 "*Default threshold for a low scored article. | |
224 An article will be highlighted as low scored if its score is smaller | |
225 than this score." | |
226 :group 'gnus-score-default | |
227 :type 'integer) | |
228 | |
200 (defcustom gnus-summary-zcore-fuzz 0 | 229 (defcustom gnus-summary-zcore-fuzz 0 |
201 "*Fuzziness factor for the zcore in the summary buffer. | 230 "*Fuzziness factor for the zcore in the summary buffer. |
202 Articles with scores closer than this to `gnus-summary-default-score' | 231 Articles with scores closer than this to `gnus-summary-default-score' |
203 will not be marked." | 232 will not be marked." |
204 :group 'gnus-summary-format | 233 :group 'gnus-summary-format |
217 :group 'gnus-thread | 246 :group 'gnus-thread |
218 :type 'boolean) | 247 :type 'boolean) |
219 | 248 |
220 (defcustom gnus-thread-hide-subtree nil | 249 (defcustom gnus-thread-hide-subtree nil |
221 "*If non-nil, hide all threads initially. | 250 "*If non-nil, hide all threads initially. |
251 This can be a predicate specifier which says which threads to hide. | |
222 If threads are hidden, you have to run the command | 252 If threads are hidden, you have to run the command |
223 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook' | 253 `gnus-summary-show-thread' by hand or use `gnus-select-article-hook' |
224 to expose hidden threads." | 254 to expose hidden threads." |
225 :group 'gnus-thread | 255 :group 'gnus-thread |
226 :type 'boolean) | 256 :type '(radio (sexp :format "Non-nil\n" |
257 :match (lambda (widget value) | |
258 (not (or (consp value) (functionp value)))) | |
259 :value t) | |
260 (const nil) | |
261 (sexp :tag "Predicate specifier" :size 0))) | |
227 | 262 |
228 (defcustom gnus-thread-hide-killed t | 263 (defcustom gnus-thread-hide-killed t |
229 "*If non-nil, hide killed threads automatically." | 264 "*If non-nil, hide killed threads automatically." |
230 :group 'gnus-thread | 265 :group 'gnus-thread |
231 :type 'boolean) | 266 :type 'boolean) |
260 "*If non-nil, extend newsgroup forward and backward when requested." | 295 "*If non-nil, extend newsgroup forward and backward when requested." |
261 :group 'gnus-summary-choose | 296 :group 'gnus-summary-choose |
262 :type 'boolean) | 297 :type 'boolean) |
263 | 298 |
264 (defcustom gnus-auto-select-first t | 299 (defcustom gnus-auto-select-first t |
265 "*If nil, don't select the first unread article when entering a group. | 300 "*If non-nil, select the article under point. |
266 If this variable is `best', select the highest-scored unread article | 301 Which article this is is controlled by the `gnus-auto-select-subject' |
267 in the group. If t, select the first unread article. | 302 variable. |
268 | 303 |
269 This variable can also be a function to place point on a likely | 304 If you want to prevent automatic selection of articles in some |
270 subject line. Useful values include `gnus-summary-first-unread-subject', | 305 newsgroups, set the variable to nil in `gnus-select-group-hook'." |
271 `gnus-summary-first-unread-article' and | |
272 `gnus-summary-best-unread-article'. | |
273 | |
274 If you want to prevent automatic selection of the first unread article | |
275 in some newsgroups, set the variable to nil in | |
276 `gnus-select-group-hook'." | |
277 :group 'gnus-group-select | 306 :group 'gnus-group-select |
278 :type '(choice (const :tag "none" nil) | 307 :type '(choice (const :tag "none" nil) |
279 (const best) | 308 (sexp :menu-tag "first" t))) |
280 (sexp :menu-tag "first" t) | 309 |
281 (function-item gnus-summary-first-unread-subject) | 310 (defcustom gnus-auto-select-subject 'unread |
282 (function-item gnus-summary-first-unread-article) | 311 "*Says what subject to place under point when entering a group. |
283 (function-item gnus-summary-best-unread-article))) | 312 |
313 This variable can either be the symbols `first' (place point on the | |
314 first subject), `unread' (place point on the subject line of the first | |
315 unread article), `best' (place point on the subject line of the | |
316 higest-scored article), `unseen' (place point on the subject line of | |
317 the first unseen article), 'unseen-or-unread' (place point on the subject | |
318 line of the first unseen article or, if all article have been seen, on the | |
319 subject line of the first unread article), or a function to be called to | |
320 place point on some subject line." | |
321 :group 'gnus-group-select | |
322 :type '(choice (const best) | |
323 (const unread) | |
324 (const first) | |
325 (const unseen) | |
326 (const unseen-or-unread))) | |
284 | 327 |
285 (defcustom gnus-auto-select-next t | 328 (defcustom gnus-auto-select-next t |
286 "*If non-nil, offer to go to the next group from the end of the previous. | 329 "*If non-nil, offer to go to the next group from the end of the previous. |
287 If the value is t and the next newsgroup is empty, Gnus will exit | 330 If the value is t and the next newsgroup is empty, Gnus will exit |
288 summary mode and go back to group mode. If the value is neither nil | 331 summary mode and go back to group mode. If the value is neither nil |
289 nor t, Gnus will select the following unread newsgroup. In | 332 nor t, Gnus will select the following unread newsgroup. In |
290 particular, if the value is the symbol `quietly', the next unread | 333 particular, if the value is the symbol `quietly', the next unread |
291 newsgroup will be selected without any confirmation, and if it is | 334 newsgroup will be selected without any confirmation, and if it is |
292 `almost-quietly', the next group will be selected without any | 335 `almost-quietly', the next group will be selected without any |
293 confirmation if you are located on the last article in the group. | 336 confirmation if you are located on the last article in the group. |
294 Finally, if this variable is `slightly-quietly', the `Z n' command | 337 Finally, if this variable is `slightly-quietly', the `\\<gnus-summary-mode-map>\\[gnus-summary-catchup-and-goto-next-group]' command |
295 will go to the next group without confirmation." | 338 will go to the next group without confirmation." |
296 :group 'gnus-summary-maneuvering | 339 :group 'gnus-summary-maneuvering |
297 :type '(choice (const :tag "off" nil) | 340 :type '(choice (const :tag "off" nil) |
298 (const quietly) | 341 (const quietly) |
299 (const almost-quietly) | 342 (const almost-quietly) |
304 "*If non-nil, select the next article with the same subject. | 347 "*If non-nil, select the next article with the same subject. |
305 If there are no more articles with the same subject, go to | 348 If there are no more articles with the same subject, go to |
306 the first unread article." | 349 the first unread article." |
307 :group 'gnus-summary-maneuvering | 350 :group 'gnus-summary-maneuvering |
308 :type 'boolean) | 351 :type 'boolean) |
352 | |
353 (defcustom gnus-auto-goto-ignores 'unfetched | |
354 "*Says how to handle unfetched articles when maneuvering. | |
355 | |
356 This variable can either be the symbols nil (maneuver to any | |
357 article), `undownloaded' (maneuvering while unplugged ignores articles | |
358 that have not been fetched), `always-undownloaded' (maneuvering always | |
359 ignores articles that have not been fetched), `unfetched' (maneuvering | |
360 ignores articles whose headers have not been fetched). | |
361 | |
362 NOTE: The list of unfetched articles will always be nil when plugged | |
363 and, when unplugged, a subset of the undownloaded article list." | |
364 :group 'gnus-summary-maneuvering | |
365 :type '(choice (const :tag "None" nil) | |
366 (const :tag "Undownloaded when unplugged" undownloaded) | |
367 (const :tag "Undownloaded" always-undownloaded) | |
368 (const :tag "Unfetched" unfetched))) | |
309 | 369 |
310 (defcustom gnus-summary-check-current nil | 370 (defcustom gnus-summary-check-current nil |
311 "*If non-nil, consider the current article when moving. | 371 "*If non-nil, consider the current article when moving. |
312 The \"unread\" movement commands will stay on the same line if the | 372 The \"unread\" movement commands will stay on the same line if the |
313 current article is unread." | 373 current article is unread." |
322 :type '(choice (const :tag "none" nil) | 382 :type '(choice (const :tag "none" nil) |
323 (const vertical) | 383 (const vertical) |
324 (integer :tag "height") | 384 (integer :tag "height") |
325 (sexp :menu-tag "both" t))) | 385 (sexp :menu-tag "both" t))) |
326 | 386 |
387 (defvar gnus-auto-center-group t | |
388 "*If non-nil, always center the group buffer.") | |
389 | |
327 (defcustom gnus-show-all-headers nil | 390 (defcustom gnus-show-all-headers nil |
328 "*If non-nil, don't hide any headers." | 391 "*If non-nil, don't hide any headers." |
329 :group 'gnus-article-hiding | 392 :group 'gnus-article-hiding |
330 :group 'gnus-article-headers | 393 :group 'gnus-article-headers |
331 :type 'boolean) | 394 :type 'boolean) |
348 :group 'gnus-article-various | 411 :group 'gnus-article-various |
349 :type 'boolean) | 412 :type 'boolean) |
350 | 413 |
351 (defcustom gnus-move-split-methods nil | 414 (defcustom gnus-move-split-methods nil |
352 "*Variable used to suggest where articles are to be moved to. | 415 "*Variable used to suggest where articles are to be moved to. |
353 It uses the same syntax as the `gnus-split-methods' variable." | 416 It uses the same syntax as the `gnus-split-methods' variable. |
417 However, whereas `gnus-split-methods' specifies file names as targets, | |
418 this variable specifies group names." | |
354 :group 'gnus-summary-mail | 419 :group 'gnus-summary-mail |
355 :type '(repeat (choice (list :value (fun) function) | 420 :type '(repeat (choice (list :value (fun) function) |
356 (cons :value ("" "") regexp (repeat string)) | 421 (cons :value ("" "") regexp (repeat string)) |
357 (sexp :value nil)))) | 422 (sexp :value nil)))) |
358 | 423 |
359 (defcustom gnus-unread-mark ? ;Whitespace | 424 (defcustom gnus-unread-mark ? ;Whitespace |
360 "*Mark used for unread articles." | 425 "*Mark used for unread articles." |
361 :group 'gnus-summary-marks | 426 :group 'gnus-summary-marks |
362 :type 'character) | 427 :type 'character) |
363 | 428 |
364 (defcustom gnus-ticked-mark ?! | 429 (defcustom gnus-ticked-mark ?! |
389 (defcustom gnus-killed-mark ?K | 454 (defcustom gnus-killed-mark ?K |
390 "*Mark used for killed articles." | 455 "*Mark used for killed articles." |
391 :group 'gnus-summary-marks | 456 :group 'gnus-summary-marks |
392 :type 'character) | 457 :type 'character) |
393 | 458 |
459 (defcustom gnus-spam-mark ?$ | |
460 "*Mark used for spam articles." | |
461 :group 'gnus-summary-marks | |
462 :type 'character) | |
463 | |
394 (defcustom gnus-souped-mark ?F | 464 (defcustom gnus-souped-mark ?F |
395 "*Mark used for killed articles." | 465 "*Mark used for souped articles." |
396 :group 'gnus-summary-marks | 466 :group 'gnus-summary-marks |
397 :type 'character) | 467 :type 'character) |
398 | 468 |
399 (defcustom gnus-kill-file-mark ?X | 469 (defcustom gnus-kill-file-mark ?X |
400 "*Mark used for articles killed by kill files." | 470 "*Mark used for articles killed by kill files." |
414 (defcustom gnus-replied-mark ?A | 484 (defcustom gnus-replied-mark ?A |
415 "*Mark used for articles that have been replied to." | 485 "*Mark used for articles that have been replied to." |
416 :group 'gnus-summary-marks | 486 :group 'gnus-summary-marks |
417 :type 'character) | 487 :type 'character) |
418 | 488 |
489 (defcustom gnus-forwarded-mark ?F | |
490 "*Mark used for articles that have been forwarded." | |
491 :group 'gnus-summary-marks | |
492 :type 'character) | |
493 | |
494 (defcustom gnus-recent-mark ?N | |
495 "*Mark used for articles that are recent." | |
496 :group 'gnus-summary-marks | |
497 :type 'character) | |
498 | |
419 (defcustom gnus-cached-mark ?* | 499 (defcustom gnus-cached-mark ?* |
420 "*Mark used for articles that are in the cache." | 500 "*Mark used for articles that are in the cache." |
421 :group 'gnus-summary-marks | 501 :group 'gnus-summary-marks |
422 :type 'character) | 502 :type 'character) |
423 | 503 |
424 (defcustom gnus-saved-mark ?S | 504 (defcustom gnus-saved-mark ?S |
425 "*Mark used for articles that have been saved to." | 505 "*Mark used for articles that have been saved." |
506 :group 'gnus-summary-marks | |
507 :type 'character) | |
508 | |
509 (defcustom gnus-unseen-mark ?. | |
510 "*Mark used for articles that haven't been seen." | |
511 :group 'gnus-summary-marks | |
512 :type 'character) | |
513 | |
514 (defcustom gnus-no-mark ? ;Whitespace | |
515 "*Mark used for articles that have no other secondary mark." | |
426 :group 'gnus-summary-marks | 516 :group 'gnus-summary-marks |
427 :type 'character) | 517 :type 'character) |
428 | 518 |
429 (defcustom gnus-ancient-mark ?O | 519 (defcustom gnus-ancient-mark ?O |
430 "*Mark used for ancient articles." | 520 "*Mark used for ancient articles." |
444 (defcustom gnus-duplicate-mark ?M | 534 (defcustom gnus-duplicate-mark ?M |
445 "*Mark used for duplicate articles." | 535 "*Mark used for duplicate articles." |
446 :group 'gnus-summary-marks | 536 :group 'gnus-summary-marks |
447 :type 'character) | 537 :type 'character) |
448 | 538 |
449 (defcustom gnus-undownloaded-mark ?@ | 539 (defcustom gnus-undownloaded-mark ?- |
450 "*Mark used for articles that weren't downloaded." | 540 "*Mark used for articles that weren't downloaded." |
541 :group 'gnus-summary-marks | |
542 :type 'character) | |
543 | |
544 (defcustom gnus-downloaded-mark ?+ | |
545 "*Mark used for articles that were downloaded." | |
451 :group 'gnus-summary-marks | 546 :group 'gnus-summary-marks |
452 :type 'character) | 547 :type 'character) |
453 | 548 |
454 (defcustom gnus-downloadable-mark ?% | 549 (defcustom gnus-downloadable-mark ?% |
455 "*Mark used for articles that are to be downloaded." | 550 "*Mark used for articles that are to be downloaded." |
469 (defcustom gnus-score-below-mark ?- | 564 (defcustom gnus-score-below-mark ?- |
470 "*Score mark used for articles with low scores." | 565 "*Score mark used for articles with low scores." |
471 :group 'gnus-summary-marks | 566 :group 'gnus-summary-marks |
472 :type 'character) | 567 :type 'character) |
473 | 568 |
474 (defcustom gnus-empty-thread-mark ? ;Whitespace | 569 (defcustom gnus-empty-thread-mark ? ;Whitespace |
475 "*There is no thread under the article." | 570 "*There is no thread under the article." |
476 :group 'gnus-summary-marks | 571 :group 'gnus-summary-marks |
477 :type 'character) | 572 :type 'character) |
478 | 573 |
479 (defcustom gnus-not-empty-thread-mark ?= | 574 (defcustom gnus-not-empty-thread-mark ?= |
521 "*If non-nil, insert pseudo-articles when decoding articles." | 616 "*If non-nil, insert pseudo-articles when decoding articles." |
522 :group 'gnus-extract-view | 617 :group 'gnus-extract-view |
523 :type 'boolean) | 618 :type 'boolean) |
524 | 619 |
525 (defcustom gnus-summary-dummy-line-format | 620 (defcustom gnus-summary-dummy-line-format |
526 " %(: :%) %S\n" | 621 " %(: :%) %S\n" |
527 "*The format specification for the dummy roots in the summary buffer. | 622 "*The format specification for the dummy roots in the summary buffer. |
528 It works along the same lines as a normal formatting string, | 623 It works along the same lines as a normal formatting string, |
529 with some simple extensions. | 624 with some simple extensions. |
530 | 625 |
531 %S The subject" | 626 %S The subject |
627 | |
628 General format specifiers can also be used. | |
629 See `(gnus)Formatting Variables'." | |
630 :link '(custom-manual "(gnus)Formatting Variables") | |
532 :group 'gnus-threading | 631 :group 'gnus-threading |
533 :type 'string) | 632 :type 'string) |
534 | 633 |
535 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z" | 634 (defcustom gnus-summary-mode-line-format "Gnus: %g [%A] %Z" |
536 "*The format specification for the summary mode line. | 635 "*The format specification for the summary mode line. |
572 :group 'gnus-score-default | 671 :group 'gnus-score-default |
573 :type 'integer) | 672 :type 'integer) |
574 | 673 |
575 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number) | 674 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number) |
576 "*List of functions used for sorting articles in the summary buffer. | 675 "*List of functions used for sorting articles in the summary buffer. |
577 This variable is only used when not using a threaded display." | 676 |
677 Each function takes two articles and returns non-nil if the first | |
678 article should be sorted before the other. If you use more than one | |
679 function, the primary sort function should be the last. You should | |
680 probably always include `gnus-article-sort-by-number' in the list of | |
681 sorting functions -- preferably first. Also note that sorting by date | |
682 is often much slower than sorting by number, and the sorting order is | |
683 very similar. (Sorting by date means sorting by the time the message | |
684 was sent, sorting by number means sorting by arrival time.) | |
685 | |
686 Ready-made functions include `gnus-article-sort-by-number', | |
687 `gnus-article-sort-by-author', `gnus-article-sort-by-subject', | |
688 `gnus-article-sort-by-date', `gnus-article-sort-by-random' | |
689 and `gnus-article-sort-by-score'. | |
690 | |
691 When threading is turned on, the variable `gnus-thread-sort-functions' | |
692 controls how articles are sorted." | |
578 :group 'gnus-summary-sort | 693 :group 'gnus-summary-sort |
579 :type '(repeat (choice (function-item gnus-article-sort-by-number) | 694 :type '(repeat (choice (function-item gnus-article-sort-by-number) |
580 (function-item gnus-article-sort-by-author) | 695 (function-item gnus-article-sort-by-author) |
581 (function-item gnus-article-sort-by-subject) | 696 (function-item gnus-article-sort-by-subject) |
582 (function-item gnus-article-sort-by-date) | 697 (function-item gnus-article-sort-by-date) |
583 (function-item gnus-article-sort-by-score) | 698 (function-item gnus-article-sort-by-score) |
699 (function-item gnus-article-sort-by-random) | |
584 (function :tag "other")))) | 700 (function :tag "other")))) |
585 | 701 |
586 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number) | 702 (defcustom gnus-thread-sort-functions '(gnus-thread-sort-by-number) |
587 "*List of functions used for sorting threads in the summary buffer. | 703 "*List of functions used for sorting threads in the summary buffer. |
588 By default, threads are sorted by article number. | 704 By default, threads are sorted by article number. |
589 | 705 |
590 Each function takes two threads and return non-nil if the first thread | 706 Each function takes two threads and returns non-nil if the first |
591 should be sorted before the other. If you use more than one function, | 707 thread should be sorted before the other. If you use more than one |
592 the primary sort function should be the last. You should probably | 708 function, the primary sort function should be the last. You should |
593 always include `gnus-thread-sort-by-number' in the list of sorting | 709 probably always include `gnus-thread-sort-by-number' in the list of |
594 functions -- preferably first. | 710 sorting functions -- preferably first. Also note that sorting by date |
711 is often much slower than sorting by number, and the sorting order is | |
712 very similar. (Sorting by date means sorting by the time the message | |
713 was sent, sorting by number means sorting by arrival time.) | |
595 | 714 |
596 Ready-made functions include `gnus-thread-sort-by-number', | 715 Ready-made functions include `gnus-thread-sort-by-number', |
597 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject', | 716 `gnus-thread-sort-by-author', `gnus-thread-sort-by-subject', |
598 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score' and | 717 `gnus-thread-sort-by-date', `gnus-thread-sort-by-score', |
599 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function')." | 718 `gnus-thread-sort-by-most-recent-number', |
719 `gnus-thread-sort-by-most-recent-date', | |
720 `gnus-thread-sort-by-random', and | |
721 `gnus-thread-sort-by-total-score' (see `gnus-thread-score-function'). | |
722 | |
723 When threading is turned off, the variable | |
724 `gnus-article-sort-functions' controls how articles are sorted." | |
600 :group 'gnus-summary-sort | 725 :group 'gnus-summary-sort |
601 :type '(repeat (choice (function-item gnus-thread-sort-by-number) | 726 :type '(repeat (choice (function-item gnus-thread-sort-by-number) |
602 (function-item gnus-thread-sort-by-author) | 727 (function-item gnus-thread-sort-by-author) |
603 (function-item gnus-thread-sort-by-subject) | 728 (function-item gnus-thread-sort-by-subject) |
604 (function-item gnus-thread-sort-by-date) | 729 (function-item gnus-thread-sort-by-date) |
605 (function-item gnus-thread-sort-by-score) | 730 (function-item gnus-thread-sort-by-score) |
606 (function-item gnus-thread-sort-by-total-score) | 731 (function-item gnus-thread-sort-by-total-score) |
732 (function-item gnus-thread-sort-by-random) | |
607 (function :tag "other")))) | 733 (function :tag "other")))) |
608 | 734 |
609 (defcustom gnus-thread-score-function '+ | 735 (defcustom gnus-thread-score-function '+ |
610 "*Function used for calculating the total score of a thread. | 736 "*Function used for calculating the total score of a thread. |
611 | 737 |
635 integer)) | 761 integer)) |
636 | 762 |
637 (defcustom gnus-summary-mode-hook nil | 763 (defcustom gnus-summary-mode-hook nil |
638 "*A hook for Gnus summary mode. | 764 "*A hook for Gnus summary mode. |
639 This hook is run before any variables are set in the summary buffer." | 765 This hook is run before any variables are set in the summary buffer." |
640 :options '(turn-on-gnus-mailing-list-mode) | 766 :options '(turn-on-gnus-mailing-list-mode gnus-pick-mode) |
641 :group 'gnus-summary-various | 767 :group 'gnus-summary-various |
642 :type 'hook) | 768 :type 'hook) |
769 | |
770 ;; Extracted from gnus-xmas-redefine in order to preserve user settings | |
771 (when (featurep 'xemacs) | |
772 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-summary-menu-add) | |
773 (add-hook 'gnus-summary-mode-hook 'gnus-xmas-setup-summary-toolbar) | |
774 (add-hook 'gnus-summary-mode-hook | |
775 'gnus-xmas-switch-horizontal-scrollbar-off)) | |
643 | 776 |
644 (defcustom gnus-summary-menu-hook nil | 777 (defcustom gnus-summary-menu-hook nil |
645 "*Hook run after the creation of the summary mode menu." | 778 "*Hook run after the creation of the summary mode menu." |
646 :group 'gnus-summary-visual | 779 :group 'gnus-summary-visual |
647 :type 'hook) | 780 :type 'hook) |
675 | 808 |
676 If you'd like to simplify subjects like the | 809 If you'd like to simplify subjects like the |
677 `gnus-summary-next-same-subject' command does, you can use the | 810 `gnus-summary-next-same-subject' command does, you can use the |
678 following hook: | 811 following hook: |
679 | 812 |
680 (setq gnus-select-group-hook | 813 (add-hook gnus-select-group-hook |
681 (list | 814 (lambda () |
682 (lambda () | 815 (mapcar (lambda (header) |
683 (mapcar (lambda (header) | 816 (mail-header-set-subject |
684 (mail-header-set-subject | 817 header |
685 header | 818 (gnus-simplify-subject |
686 (gnus-simplify-subject | 819 (mail-header-subject header) 're-only))) |
687 (mail-header-subject header) 're-only))) | 820 gnus-newsgroup-headers)))" |
688 gnus-newsgroup-headers))))" | |
689 :group 'gnus-group-select | 821 :group 'gnus-group-select |
690 :type 'hook) | 822 :type 'hook) |
691 | 823 |
692 (defcustom gnus-select-article-hook nil | 824 (defcustom gnus-select-article-hook nil |
693 "*A hook called when an article is selected." | 825 "*A hook called when an article is selected." |
694 :group 'gnus-summary-choose | 826 :group 'gnus-summary-choose |
827 :options '(gnus-agent-fetch-selected-article) | |
695 :type 'hook) | 828 :type 'hook) |
696 | 829 |
697 (defcustom gnus-visual-mark-article-hook | 830 (defcustom gnus-visual-mark-article-hook |
698 (list 'gnus-highlight-selected-summary) | 831 (list 'gnus-highlight-selected-summary) |
699 "*Hook run after selecting an article in the summary buffer. | 832 "*Hook run after selecting an article in the summary buffer. |
739 (defcustom gnus-ps-print-hook nil | 872 (defcustom gnus-ps-print-hook nil |
740 "*A hook run before ps-printing something from Gnus." | 873 "*A hook run before ps-printing something from Gnus." |
741 :group 'gnus-summary | 874 :group 'gnus-summary |
742 :type 'hook) | 875 :type 'hook) |
743 | 876 |
877 (defcustom gnus-summary-article-move-hook nil | |
878 "*A hook called after an article is moved, copied, respooled, or crossposted." | |
879 :group 'gnus-summary | |
880 :type 'hook) | |
881 | |
882 (defcustom gnus-summary-article-delete-hook nil | |
883 "*A hook called after an article is deleted." | |
884 :group 'gnus-summary | |
885 :type 'hook) | |
886 | |
887 (defcustom gnus-summary-article-expire-hook nil | |
888 "*A hook called after an article is expired." | |
889 :group 'gnus-summary | |
890 :type 'hook) | |
891 | |
892 (defcustom gnus-summary-display-arrow | |
893 (and (fboundp 'display-graphic-p) | |
894 (display-graphic-p)) | |
895 "*If non-nil, display an arrow highlighting the current article." | |
896 :version "21.1" | |
897 :group 'gnus-summary | |
898 :type 'boolean) | |
899 | |
744 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face | 900 (defcustom gnus-summary-selected-face 'gnus-summary-selected-face |
745 "Face used for highlighting the current article in the summary buffer." | 901 "Face used for highlighting the current article in the summary buffer." |
746 :group 'gnus-summary-visual | 902 :group 'gnus-summary-visual |
747 :type 'face) | 903 :type 'face) |
748 | 904 |
905 (defvar gnus-tmp-downloaded nil) | |
906 | |
749 (defcustom gnus-summary-highlight | 907 (defcustom gnus-summary-highlight |
750 '(((= mark gnus-canceled-mark) | 908 '(((eq mark gnus-canceled-mark) |
751 . gnus-summary-cancelled-face) | 909 . gnus-summary-cancelled-face) |
752 ((and (> score default) | 910 ((and uncached (> score default-high)) |
753 (or (= mark gnus-dormant-mark) | 911 . gnus-summary-high-undownloaded-face) |
754 (= mark gnus-ticked-mark))) | 912 ((and uncached (< score default-low)) |
913 . gnus-summary-low-undownloaded-face) | |
914 (uncached | |
915 . gnus-summary-normal-undownloaded-face) | |
916 ((and (> score default-high) | |
917 (or (eq mark gnus-dormant-mark) | |
918 (eq mark gnus-ticked-mark))) | |
755 . gnus-summary-high-ticked-face) | 919 . gnus-summary-high-ticked-face) |
756 ((and (< score default) | 920 ((and (< score default-low) |
757 (or (= mark gnus-dormant-mark) | 921 (or (eq mark gnus-dormant-mark) |
758 (= mark gnus-ticked-mark))) | 922 (eq mark gnus-ticked-mark))) |
759 . gnus-summary-low-ticked-face) | 923 . gnus-summary-low-ticked-face) |
760 ((or (= mark gnus-dormant-mark) | 924 ((or (eq mark gnus-dormant-mark) |
761 (= mark gnus-ticked-mark)) | 925 (eq mark gnus-ticked-mark)) |
762 . gnus-summary-normal-ticked-face) | 926 . gnus-summary-normal-ticked-face) |
763 ((and (> score default) (= mark gnus-ancient-mark)) | 927 ((and (> score default-high) (eq mark gnus-ancient-mark)) |
764 . gnus-summary-high-ancient-face) | 928 . gnus-summary-high-ancient-face) |
765 ((and (< score default) (= mark gnus-ancient-mark)) | 929 ((and (< score default-low) (eq mark gnus-ancient-mark)) |
766 . gnus-summary-low-ancient-face) | 930 . gnus-summary-low-ancient-face) |
767 ((= mark gnus-ancient-mark) | 931 ((eq mark gnus-ancient-mark) |
768 . gnus-summary-normal-ancient-face) | 932 . gnus-summary-normal-ancient-face) |
769 ((and (> score default) (= mark gnus-unread-mark)) | 933 ((and (> score default-high) (eq mark gnus-unread-mark)) |
770 . gnus-summary-high-unread-face) | 934 . gnus-summary-high-unread-face) |
771 ((and (< score default) (= mark gnus-unread-mark)) | 935 ((and (< score default-low) (eq mark gnus-unread-mark)) |
772 . gnus-summary-low-unread-face) | 936 . gnus-summary-low-unread-face) |
773 ((= mark gnus-unread-mark) | 937 ((eq mark gnus-unread-mark) |
774 . gnus-summary-normal-unread-face) | 938 . gnus-summary-normal-unread-face) |
775 ((and (> score default) (memq mark (list gnus-downloadable-mark | 939 ((> score default-high) |
776 gnus-undownloaded-mark))) | |
777 . gnus-summary-high-unread-face) | |
778 ((and (< score default) (memq mark (list gnus-downloadable-mark | |
779 gnus-undownloaded-mark))) | |
780 . gnus-summary-low-unread-face) | |
781 ((memq mark (list gnus-downloadable-mark gnus-undownloaded-mark)) | |
782 . gnus-summary-normal-unread-face) | |
783 ((> score default) | |
784 . gnus-summary-high-read-face) | 940 . gnus-summary-high-read-face) |
785 ((< score default) | 941 ((< score default-low) |
786 . gnus-summary-low-read-face) | 942 . gnus-summary-low-read-face) |
787 (t | 943 (t |
788 . gnus-summary-normal-read-face)) | 944 . gnus-summary-normal-read-face)) |
789 "*Controls the highlighting of summary buffer lines. | 945 "*Controls the highlighting of summary buffer lines. |
790 | 946 |
791 A list of (FORM . FACE) pairs. When deciding how a particular summary | 947 A list of (FORM . FACE) pairs. When deciding how a a particular |
792 line should be displayed, each form is evaluated. The content of the | 948 summary line should be displayed, each form is evaluated. The content |
793 face field after the first true form is used. You can change how those | 949 of the face field after the first true form is used. You can change |
794 summary lines are displayed, by editing the face field. | 950 how those summary lines are displayed, by editing the face field. |
795 | 951 |
796 You can use the following variables in the FORM field. | 952 You can use the following variables in the FORM field. |
797 | 953 |
798 score: The articles score | 954 score: The article's score |
799 default: The default article score. | 955 default: The default article score. |
800 below: The score below which articles are automatically marked as read. | 956 default-high: The default score for high scored articles. |
801 mark: The articles mark." | 957 default-low: The default score for low scored articles. |
958 below: The score below which articles are automatically marked as read. | |
959 mark: The article's mark. | |
960 uncached: Non-nil if the article is uncached." | |
802 :group 'gnus-summary-visual | 961 :group 'gnus-summary-visual |
803 :type '(repeat (cons (sexp :tag "Form" nil) | 962 :type '(repeat (cons (sexp :tag "Form" nil) |
804 face))) | 963 face))) |
805 | 964 |
806 (defcustom gnus-alter-header-function nil | 965 (defcustom gnus-alter-header-function nil |
812 :group 'gnus-summary) | 971 :group 'gnus-summary) |
813 | 972 |
814 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string | 973 (defvar gnus-decode-encoded-word-function 'mail-decode-encoded-word-string |
815 "Variable that says which function should be used to decode a string with encoded words.") | 974 "Variable that says which function should be used to decode a string with encoded words.") |
816 | 975 |
817 (defcustom gnus-extra-headers nil | 976 (defcustom gnus-extra-headers '(To Newsgroups) |
818 "*Extra headers to parse." | 977 "*Extra headers to parse." |
819 :version "21.1" | 978 :version "21.1" |
820 :group 'gnus-summary | 979 :group 'gnus-summary |
821 :type '(repeat symbol)) | 980 :type '(repeat symbol)) |
822 | 981 |
824 (and user-mail-address (regexp-quote user-mail-address)) | 983 (and user-mail-address (regexp-quote user-mail-address)) |
825 "*Regexp of From headers that may be suppressed in favor of To headers." | 984 "*Regexp of From headers that may be suppressed in favor of To headers." |
826 :version "21.1" | 985 :version "21.1" |
827 :group 'gnus-summary | 986 :group 'gnus-summary |
828 :type 'regexp) | 987 :type 'regexp) |
829 | |
830 (defcustom gnus-group-charset-alist | |
831 '(("^hk\\>\\|^tw\\>\\|\\<big5\\>" cn-big5) | |
832 ("^cn\\>\\|\\<chinese\\>" cn-gb-2312) | |
833 ("^fj\\>\\|^japan\\>" iso-2022-jp-2) | |
834 ("^tnn\\>\\|^pin\\>\\|^sci.lang.japan" iso-2022-7bit) | |
835 ("^relcom\\>" koi8-r) | |
836 ("^fido7\\>" koi8-r) | |
837 ("^\\(cz\\|hun\\|pl\\|sk\\|hr\\)\\>" iso-8859-2) | |
838 ("^israel\\>" iso-8859-1) | |
839 ("^han\\>" euc-kr) | |
840 ("^alt.chinese.text.big5\\>" chinese-big5) | |
841 ("^soc.culture.vietnamese\\>" vietnamese-viqr) | |
842 ("^\\(comp\\|rec\\|alt\\|sci\\|soc\\|news\\|gnu\\|bofh\\)\\>" iso-8859-1) | |
843 (".*" iso-8859-1)) | |
844 "Alist of regexps (to match group names) and default charsets to be used when reading." | |
845 :type '(repeat (list (regexp :tag "Group") | |
846 (symbol :tag "Charset"))) | |
847 :group 'gnus-charset) | |
848 | 988 |
849 (defcustom gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown) | 989 (defcustom gnus-newsgroup-ignored-charsets '(unknown-8bit x-unknown) |
850 "List of charsets that should be ignored. | 990 "List of charsets that should be ignored. |
851 When these charsets are used in the \"charset\" parameter, the | 991 When these charsets are used in the \"charset\" parameter, the |
852 default charset will be used instead." | 992 default charset will be used instead." |
853 :version "21.1" | 993 :version "21.1" |
854 :type '(repeat symbol) | 994 :type '(repeat symbol) |
855 :group 'gnus-charset) | 995 :group 'gnus-charset) |
856 | 996 |
857 (defcustom gnus-group-ignored-charsets-alist | 997 (gnus-define-group-parameter |
858 '(("alt\\.chinese\\.text" iso-8859-1)) | 998 ignored-charsets |
859 "Alist of regexps (to match group names) and charsets that should be ignored. | 999 :type list |
1000 :function-document | |
1001 "Return the ignored charsets of GROUP." | |
1002 :variable gnus-group-ignored-charsets-alist | |
1003 :variable-default | |
1004 '(("alt\\.chinese\\.text" iso-8859-1)) | |
1005 :variable-document | |
1006 "Alist of regexps (to match group names) and charsets that should be ignored. | |
860 When these charsets are used in the \"charset\" parameter, the | 1007 When these charsets are used in the \"charset\" parameter, the |
861 default charset will be used instead." | 1008 default charset will be used instead." |
862 :type '(repeat (cons (regexp :tag "Group") | 1009 :variable-group gnus-charset |
863 (repeat symbol))) | 1010 :variable-type '(repeat (cons (regexp :tag "Group") |
864 :group 'gnus-charset) | 1011 (repeat symbol))) |
1012 :parameter-type '(choice :tag "Ignored charsets" | |
1013 :value nil | |
1014 (repeat (symbol))) | |
1015 :parameter-document "\ | |
1016 List of charsets that should be ignored. | |
1017 | |
1018 When these charsets are used in the \"charset\" parameter, the | |
1019 default charset will be used instead.") | |
865 | 1020 |
866 (defcustom gnus-group-highlight-words-alist nil | 1021 (defcustom gnus-group-highlight-words-alist nil |
867 "Alist of group regexps and highlight regexps. | 1022 "Alist of group regexps and highlight regexps. |
868 This variable uses the same syntax as `gnus-emphasis-alist'." | 1023 This variable uses the same syntax as `gnus-emphasis-alist'." |
869 :version "21.1" | 1024 :version "21.1" |
902 :group 'gnus-score-default | 1057 :group 'gnus-score-default |
903 :type '(choice (const nil) | 1058 :type '(choice (const nil) |
904 integer)) | 1059 integer)) |
905 | 1060 |
906 (defcustom gnus-summary-save-parts-default-mime "image/.*" | 1061 (defcustom gnus-summary-save-parts-default-mime "image/.*" |
907 "*A regexp to match MIME parts when saving multiple parts of a message | 1062 "*A regexp to match MIME parts when saving multiple parts of a |
908 with gnus-summary-save-parts (X m). This regexp will be used by default | 1063 message with `gnus-summary-save-parts' (\\<gnus-summary-mode-map>\\[gnus-summary-save-parts]). |
909 when prompting the user for which type of files to save." | 1064 This regexp will be used by default when prompting the user for which |
1065 type of files to save." | |
910 :group 'gnus-summary | 1066 :group 'gnus-summary |
911 :type 'regexp) | 1067 :type 'regexp) |
912 | 1068 |
1069 (defcustom gnus-read-all-available-headers nil | |
1070 "Whether Gnus should parse all headers made available to it. | |
1071 This is mostly relevant for slow back ends where the user may | |
1072 wish to widen the summary buffer to include all headers | |
1073 that were fetched. Say, for nnultimate groups." | |
1074 :group 'gnus-summary | |
1075 :type '(choice boolean regexp)) | |
1076 | |
1077 (defcustom gnus-summary-muttprint-program "muttprint" | |
1078 "Command (and optional arguments) used to run Muttprint." | |
1079 :version "21.3" | |
1080 :group 'gnus-summary | |
1081 :type 'string) | |
1082 | |
1083 (defcustom gnus-article-loose-mime nil | |
1084 "If non-nil, don't require MIME-Version header. | |
1085 Some brain-damaged MUA/MTA, e.g. Lotus Domino 5.0.6 clients, does not | |
1086 supply the MIME-Version header or deliberately strip it From the mail. | |
1087 Set it to non-nil, Gnus will treat some articles as MIME even if | |
1088 the MIME-Version header is missed." | |
1089 :version "21.3" | |
1090 :type 'boolean | |
1091 :group 'gnus-article-mime) | |
1092 | |
1093 (defcustom gnus-article-emulate-mime t | |
1094 "If non-nil, use MIME emulation for uuencode and the like. | |
1095 This means that Gnus will search message bodies for text that look | |
1096 like uuencoded bits, yEncoded bits, and so on, and present that using | |
1097 the normal Gnus MIME machinery." | |
1098 :type 'boolean | |
1099 :group 'gnus-article-mime) | |
913 | 1100 |
914 ;;; Internal variables | 1101 ;;; Internal variables |
915 | 1102 |
1103 (defvar gnus-summary-display-cache nil) | |
916 (defvar gnus-article-mime-handles nil) | 1104 (defvar gnus-article-mime-handles nil) |
917 (defvar gnus-article-decoded-p nil) | 1105 (defvar gnus-article-decoded-p nil) |
1106 (defvar gnus-article-charset nil) | |
1107 (defvar gnus-article-ignored-charsets nil) | |
918 (defvar gnus-scores-exclude-files nil) | 1108 (defvar gnus-scores-exclude-files nil) |
919 (defvar gnus-page-broken nil) | 1109 (defvar gnus-page-broken nil) |
920 (defvar gnus-inhibit-mime-unbuttonizing nil) | |
921 | 1110 |
922 (defvar gnus-original-article nil) | 1111 (defvar gnus-original-article nil) |
923 (defvar gnus-article-internal-prepare-hook nil) | 1112 (defvar gnus-article-internal-prepare-hook nil) |
924 (defvar gnus-newsgroup-process-stack nil) | 1113 (defvar gnus-newsgroup-process-stack nil) |
925 | 1114 |
927 (defvar gnus-thread-indent-array-level gnus-thread-indent-level) | 1116 (defvar gnus-thread-indent-array-level gnus-thread-indent-level) |
928 (defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number | 1117 (defvar gnus-sort-gathered-threads-function 'gnus-thread-sort-by-number |
929 "Function called to sort the articles within a thread after it has been gathered together.") | 1118 "Function called to sort the articles within a thread after it has been gathered together.") |
930 | 1119 |
931 (defvar gnus-summary-save-parts-type-history nil) | 1120 (defvar gnus-summary-save-parts-type-history nil) |
932 (defvar gnus-summary-save-parts-last-directory nil) | 1121 (defvar gnus-summary-save-parts-last-directory mm-default-directory) |
933 | 1122 |
934 ;; Avoid highlighting in kill files. | 1123 ;; Avoid highlighting in kill files. |
935 (defvar gnus-summary-inhibit-highlight nil) | 1124 (defvar gnus-summary-inhibit-highlight nil) |
936 (defvar gnus-newsgroup-selected-overlay nil) | 1125 (defvar gnus-newsgroup-selected-overlay nil) |
937 (defvar gnus-inhibit-limiting nil) | 1126 (defvar gnus-inhibit-limiting nil) |
938 (defvar gnus-newsgroup-adaptive-score-file nil) | 1127 (defvar gnus-newsgroup-adaptive-score-file nil) |
939 (defvar gnus-current-score-file nil) | 1128 (defvar gnus-current-score-file nil) |
940 (defvar gnus-current-move-group nil) | 1129 (defvar gnus-current-move-group nil) |
941 (defvar gnus-current-copy-group nil) | 1130 (defvar gnus-current-copy-group nil) |
942 (defvar gnus-current-crosspost-group nil) | 1131 (defvar gnus-current-crosspost-group nil) |
1132 (defvar gnus-newsgroup-display nil) | |
943 | 1133 |
944 (defvar gnus-newsgroup-dependencies nil) | 1134 (defvar gnus-newsgroup-dependencies nil) |
945 (defvar gnus-newsgroup-adaptive nil) | 1135 (defvar gnus-newsgroup-adaptive nil) |
946 (defvar gnus-summary-display-article-function nil) | 1136 (defvar gnus-summary-display-article-function nil) |
947 (defvar gnus-summary-highlight-line-function nil | 1137 (defvar gnus-summary-highlight-line-function nil |
962 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s) | 1152 (?d (gnus-dd-mmm (mail-header-date gnus-tmp-header)) ?s) |
963 (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s) | 1153 (?o (gnus-date-iso8601 (mail-header-date gnus-tmp-header)) ?s) |
964 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s) | 1154 (?M ,(macroexpand '(mail-header-id gnus-tmp-header)) ?s) |
965 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s) | 1155 (?r ,(macroexpand '(mail-header-references gnus-tmp-header)) ?s) |
966 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d) | 1156 (?c (or (mail-header-chars gnus-tmp-header) 0) ?d) |
967 (?L gnus-tmp-lines ?d) | 1157 (?k (gnus-summary-line-message-size gnus-tmp-header) ?s) |
1158 (?L gnus-tmp-lines ?s) | |
1159 (?O gnus-tmp-downloaded ?c) | |
968 (?I gnus-tmp-indentation ?s) | 1160 (?I gnus-tmp-indentation ?s) |
969 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) | 1161 (?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s) |
970 (?R gnus-tmp-replied ?c) | 1162 (?R gnus-tmp-replied ?c) |
971 (?\[ gnus-tmp-opening-bracket ?c) | 1163 (?\[ gnus-tmp-opening-bracket ?c) |
972 (?\] gnus-tmp-closing-bracket ?c) | 1164 (?\] gnus-tmp-closing-bracket ?c) |
975 (?i gnus-tmp-score ?d) | 1167 (?i gnus-tmp-score ?d) |
976 (?z gnus-tmp-score-char ?c) | 1168 (?z gnus-tmp-score-char ?c) |
977 (?l (bbb-grouplens-score gnus-tmp-header) ?s) | 1169 (?l (bbb-grouplens-score gnus-tmp-header) ?s) |
978 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d) | 1170 (?V (gnus-thread-total-score (and (boundp 'thread) (car thread))) ?d) |
979 (?U gnus-tmp-unread ?c) | 1171 (?U gnus-tmp-unread ?c) |
980 (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header) ?s) | 1172 (?f (gnus-summary-from-or-to-or-newsgroups gnus-tmp-header gnus-tmp-from) |
1173 ?s) | |
981 (?t (gnus-summary-number-of-articles-in-thread | 1174 (?t (gnus-summary-number-of-articles-in-thread |
982 (and (boundp 'thread) (car thread)) gnus-tmp-level) | 1175 (and (boundp 'thread) (car thread)) gnus-tmp-level) |
983 ?d) | 1176 ?d) |
984 (?e (gnus-summary-number-of-articles-in-thread | 1177 (?e (gnus-summary-number-of-articles-in-thread |
985 (and (boundp 'thread) (car thread)) gnus-tmp-level t) | 1178 (and (boundp 'thread) (car thread)) gnus-tmp-level t) |
986 ?c) | 1179 ?c) |
987 (?u gnus-tmp-user-defined ?s) | 1180 (?u gnus-tmp-user-defined ?s) |
988 (?P (gnus-pick-line-number) ?d)) | 1181 (?P (gnus-pick-line-number) ?d) |
1182 (?B gnus-tmp-thread-tree-header-string ?s) | |
1183 (user-date (gnus-user-date | |
1184 ,(macroexpand '(mail-header-date gnus-tmp-header))) ?s)) | |
989 "An alist of format specifications that can appear in summary lines. | 1185 "An alist of format specifications that can appear in summary lines. |
990 These are paired with what variables they correspond with, along with | 1186 These are paired with what variables they correspond with, along with |
991 the type of the variable (string, integer, character, etc).") | 1187 the type of the variable (string, integer, character, etc).") |
992 | 1188 |
993 (defvar gnus-summary-dummy-line-format-alist | 1189 (defvar gnus-summary-dummy-line-format-alist |
1006 (?S gnus-tmp-subject ?s) | 1202 (?S gnus-tmp-subject ?s) |
1007 (?e gnus-tmp-unselected ?d) | 1203 (?e gnus-tmp-unselected ?d) |
1008 (?u gnus-tmp-user-defined ?s) | 1204 (?u gnus-tmp-user-defined ?s) |
1009 (?d (length gnus-newsgroup-dormant) ?d) | 1205 (?d (length gnus-newsgroup-dormant) ?d) |
1010 (?t (length gnus-newsgroup-marked) ?d) | 1206 (?t (length gnus-newsgroup-marked) ?d) |
1207 (?h (length gnus-newsgroup-spam-marked) ?d) | |
1011 (?r (length gnus-newsgroup-reads) ?d) | 1208 (?r (length gnus-newsgroup-reads) ?d) |
1012 (?z (gnus-summary-article-score gnus-tmp-article-number) ?d) | 1209 (?z (gnus-summary-article-score gnus-tmp-article-number) ?d) |
1013 (?E gnus-newsgroup-expunged-tally ?d) | 1210 (?E gnus-newsgroup-expunged-tally ?d) |
1014 (?s (gnus-current-score-file-nondirectory) ?s))) | 1211 (?s (gnus-current-score-file-nondirectory) ?s))) |
1015 | 1212 |
1017 "Default regexp for article search command.") | 1214 "Default regexp for article search command.") |
1018 | 1215 |
1019 (defvar gnus-last-shell-command nil | 1216 (defvar gnus-last-shell-command nil |
1020 "Default shell command on article.") | 1217 "Default shell command on article.") |
1021 | 1218 |
1219 (defvar gnus-newsgroup-agentized nil | |
1220 "Locally bound in each summary buffer to indicate whether the server has been agentized.") | |
1022 (defvar gnus-newsgroup-begin nil) | 1221 (defvar gnus-newsgroup-begin nil) |
1023 (defvar gnus-newsgroup-end nil) | 1222 (defvar gnus-newsgroup-end nil) |
1024 (defvar gnus-newsgroup-last-rmail nil) | 1223 (defvar gnus-newsgroup-last-rmail nil) |
1025 (defvar gnus-newsgroup-last-mail nil) | 1224 (defvar gnus-newsgroup-last-mail nil) |
1026 (defvar gnus-newsgroup-last-folder nil) | 1225 (defvar gnus-newsgroup-last-folder nil) |
1030 | 1229 |
1031 (defvar gnus-newsgroup-data nil) | 1230 (defvar gnus-newsgroup-data nil) |
1032 (defvar gnus-newsgroup-data-reverse nil) | 1231 (defvar gnus-newsgroup-data-reverse nil) |
1033 (defvar gnus-newsgroup-limit nil) | 1232 (defvar gnus-newsgroup-limit nil) |
1034 (defvar gnus-newsgroup-limits nil) | 1233 (defvar gnus-newsgroup-limits nil) |
1234 (defvar gnus-summary-use-undownloaded-faces nil) | |
1035 | 1235 |
1036 (defvar gnus-newsgroup-unreads nil | 1236 (defvar gnus-newsgroup-unreads nil |
1037 "List of unread articles in the current newsgroup.") | 1237 "Sorted list of unread articles in the current newsgroup.") |
1038 | 1238 |
1039 (defvar gnus-newsgroup-unselected nil | 1239 (defvar gnus-newsgroup-unselected nil |
1040 "List of unselected unread articles in the current newsgroup.") | 1240 "Sorted list of unselected unread articles in the current newsgroup.") |
1041 | 1241 |
1042 (defvar gnus-newsgroup-reads nil | 1242 (defvar gnus-newsgroup-reads nil |
1043 "Alist of read articles and article marks in the current newsgroup.") | 1243 "Alist of read articles and article marks in the current newsgroup.") |
1044 | 1244 |
1045 (defvar gnus-newsgroup-expunged-tally nil) | 1245 (defvar gnus-newsgroup-expunged-tally nil) |
1046 | 1246 |
1047 (defvar gnus-newsgroup-marked nil | 1247 (defvar gnus-newsgroup-marked nil |
1048 "List of ticked articles in the current newsgroup (a subset of unread art).") | 1248 "Sorted list of ticked articles in the current newsgroup (a subset of unread art).") |
1249 | |
1250 (defvar gnus-newsgroup-spam-marked nil | |
1251 "List of ranges of articles that have been marked as spam.") | |
1049 | 1252 |
1050 (defvar gnus-newsgroup-killed nil | 1253 (defvar gnus-newsgroup-killed nil |
1051 "List of ranges of articles that have been through the scoring process.") | 1254 "List of ranges of articles that have been through the scoring process.") |
1052 | 1255 |
1053 (defvar gnus-newsgroup-cached nil | 1256 (defvar gnus-newsgroup-cached nil |
1054 "List of articles that come from the article cache.") | 1257 "Sorted list of articles that come from the article cache.") |
1055 | 1258 |
1056 (defvar gnus-newsgroup-saved nil | 1259 (defvar gnus-newsgroup-saved nil |
1057 "List of articles that have been saved.") | 1260 "List of articles that have been saved.") |
1058 | 1261 |
1059 (defvar gnus-newsgroup-kill-headers nil) | 1262 (defvar gnus-newsgroup-kill-headers nil) |
1060 | 1263 |
1061 (defvar gnus-newsgroup-replied nil | 1264 (defvar gnus-newsgroup-replied nil |
1062 "List of articles that have been replied to in the current newsgroup.") | 1265 "List of articles that have been replied to in the current newsgroup.") |
1063 | 1266 |
1267 (defvar gnus-newsgroup-forwarded nil | |
1268 "List of articles that have been forwarded in the current newsgroup.") | |
1269 | |
1270 (defvar gnus-newsgroup-recent nil | |
1271 "List of articles that have are recent in the current newsgroup.") | |
1272 | |
1064 (defvar gnus-newsgroup-expirable nil | 1273 (defvar gnus-newsgroup-expirable nil |
1065 "List of articles in the current newsgroup that can be expired.") | 1274 "Sorted list of articles in the current newsgroup that can be expired.") |
1066 | 1275 |
1067 (defvar gnus-newsgroup-processable nil | 1276 (defvar gnus-newsgroup-processable nil |
1068 "List of articles in the current newsgroup that can be processed.") | 1277 "List of articles in the current newsgroup that can be processed.") |
1069 | 1278 |
1070 (defvar gnus-newsgroup-downloadable nil | 1279 (defvar gnus-newsgroup-downloadable nil |
1071 "List of articles in the current newsgroup that can be processed.") | 1280 "Sorted list of articles in the current newsgroup that can be processed.") |
1281 | |
1282 (defvar gnus-newsgroup-unfetched nil | |
1283 "Sorted list of articles in the current newsgroup whose headers have | |
1284 not been fetched into the agent. | |
1285 | |
1286 This list will always be a subset of gnus-newsgroup-undownloaded.") | |
1072 | 1287 |
1073 (defvar gnus-newsgroup-undownloaded nil | 1288 (defvar gnus-newsgroup-undownloaded nil |
1074 "List of articles in the current newsgroup that haven't been downloaded..") | 1289 "List of articles in the current newsgroup that haven't been downloaded.") |
1075 | 1290 |
1076 (defvar gnus-newsgroup-unsendable nil | 1291 (defvar gnus-newsgroup-unsendable nil |
1077 "List of articles in the current newsgroup that won't be sent.") | 1292 "List of articles in the current newsgroup that won't be sent.") |
1078 | 1293 |
1079 (defvar gnus-newsgroup-bookmarks nil | 1294 (defvar gnus-newsgroup-bookmarks nil |
1080 "List of articles in the current newsgroup that have bookmarks.") | 1295 "List of articles in the current newsgroup that have bookmarks.") |
1081 | 1296 |
1082 (defvar gnus-newsgroup-dormant nil | 1297 (defvar gnus-newsgroup-dormant nil |
1083 "List of dormant articles in the current newsgroup.") | 1298 "Sorted list of dormant articles in the current newsgroup.") |
1299 | |
1300 (defvar gnus-newsgroup-unseen nil | |
1301 "List of unseen articles in the current newsgroup.") | |
1302 | |
1303 (defvar gnus-newsgroup-seen nil | |
1304 "Range of seen articles in the current newsgroup.") | |
1305 | |
1306 (defvar gnus-newsgroup-articles nil | |
1307 "List of articles in the current newsgroup.") | |
1084 | 1308 |
1085 (defvar gnus-newsgroup-scored nil | 1309 (defvar gnus-newsgroup-scored nil |
1086 "List of scored articles in the current newsgroup.") | 1310 "List of scored articles in the current newsgroup.") |
1087 | 1311 |
1088 (defvar gnus-newsgroup-headers nil | 1312 (defvar gnus-newsgroup-headers nil |
1106 (defvar gnus-newsgroup-history nil) | 1330 (defvar gnus-newsgroup-history nil) |
1107 (defvar gnus-newsgroup-charset nil) | 1331 (defvar gnus-newsgroup-charset nil) |
1108 (defvar gnus-newsgroup-ephemeral-charset nil) | 1332 (defvar gnus-newsgroup-ephemeral-charset nil) |
1109 (defvar gnus-newsgroup-ephemeral-ignored-charsets nil) | 1333 (defvar gnus-newsgroup-ephemeral-ignored-charsets nil) |
1110 | 1334 |
1111 (defconst gnus-summary-local-variables | 1335 (defvar gnus-article-before-search nil) |
1336 | |
1337 (defvar gnus-summary-local-variables | |
1112 '(gnus-newsgroup-name | 1338 '(gnus-newsgroup-name |
1113 gnus-newsgroup-begin gnus-newsgroup-end | 1339 gnus-newsgroup-begin gnus-newsgroup-end |
1114 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail | 1340 gnus-newsgroup-last-rmail gnus-newsgroup-last-mail |
1115 gnus-newsgroup-last-folder gnus-newsgroup-last-file | 1341 gnus-newsgroup-last-folder gnus-newsgroup-last-file |
1116 gnus-newsgroup-auto-expire gnus-newsgroup-unreads | 1342 gnus-newsgroup-auto-expire gnus-newsgroup-unreads |
1117 gnus-newsgroup-unselected gnus-newsgroup-marked | 1343 gnus-newsgroup-unselected gnus-newsgroup-marked |
1344 gnus-newsgroup-spam-marked | |
1118 gnus-newsgroup-reads gnus-newsgroup-saved | 1345 gnus-newsgroup-reads gnus-newsgroup-saved |
1119 gnus-newsgroup-replied gnus-newsgroup-expirable | 1346 gnus-newsgroup-replied gnus-newsgroup-forwarded |
1347 gnus-newsgroup-recent | |
1348 gnus-newsgroup-expirable | |
1120 gnus-newsgroup-processable gnus-newsgroup-killed | 1349 gnus-newsgroup-processable gnus-newsgroup-killed |
1121 gnus-newsgroup-downloadable gnus-newsgroup-undownloaded | 1350 gnus-newsgroup-downloadable gnus-newsgroup-undownloaded |
1122 gnus-newsgroup-unsendable | 1351 gnus-newsgroup-unfetched |
1352 gnus-newsgroup-unsendable gnus-newsgroup-unseen | |
1353 gnus-newsgroup-seen gnus-newsgroup-articles | |
1123 gnus-newsgroup-bookmarks gnus-newsgroup-dormant | 1354 gnus-newsgroup-bookmarks gnus-newsgroup-dormant |
1124 gnus-newsgroup-headers gnus-newsgroup-threads | 1355 gnus-newsgroup-headers gnus-newsgroup-threads |
1125 gnus-newsgroup-prepared gnus-summary-highlight-line-function | 1356 gnus-newsgroup-prepared gnus-summary-highlight-line-function |
1126 gnus-current-article gnus-current-headers gnus-have-all-headers | 1357 gnus-current-article gnus-current-headers gnus-have-all-headers |
1127 gnus-last-article gnus-article-internal-prepare-hook | 1358 gnus-last-article gnus-article-internal-prepare-hook |
1139 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1) | 1370 gnus-newsgroup-adaptive-score-file (gnus-reffed-article-number . -1) |
1140 (gnus-newsgroup-expunged-tally . 0) | 1371 (gnus-newsgroup-expunged-tally . 0) |
1141 gnus-cache-removable-articles gnus-newsgroup-cached | 1372 gnus-cache-removable-articles gnus-newsgroup-cached |
1142 gnus-newsgroup-data gnus-newsgroup-data-reverse | 1373 gnus-newsgroup-data gnus-newsgroup-data-reverse |
1143 gnus-newsgroup-limit gnus-newsgroup-limits | 1374 gnus-newsgroup-limit gnus-newsgroup-limits |
1144 gnus-newsgroup-charset) | 1375 gnus-newsgroup-charset gnus-newsgroup-display |
1376 gnus-summary-use-undownloaded-faces) | |
1145 "Variables that are buffer-local to the summary buffers.") | 1377 "Variables that are buffer-local to the summary buffers.") |
1146 | 1378 |
1379 (defvar gnus-newsgroup-variables nil | |
1380 "A list of variables that have separate values in different newsgroups. | |
1381 A list of newsgroup (summary buffer) local variables, or cons of | |
1382 variables and their default expressions to be evalled (when the default | |
1383 values are not nil), that should be made global while the summary buffer | |
1384 is active. | |
1385 | |
1386 Note: The default expressions will be evaluated (using function `eval') | |
1387 before assignment to the local variable rather than just assigned to it. | |
1388 If the default expression is the symbol `global', that symbol will not | |
1389 be evaluated but the global value of the local variable will be used | |
1390 instead. | |
1391 | |
1392 These variables can be used to set variables in the group parameters | |
1393 while still allowing them to affect operations done in other buffers. | |
1394 For example: | |
1395 | |
1396 \(setq gnus-newsgroup-variables | |
1397 '(message-use-followup-to | |
1398 (gnus-visible-headers . | |
1399 \"^From:\\\\|^Newsgroups:\\\\|^Subject:\\\\|^Date:\\\\|^To:\"))) | |
1400 ") | |
1401 | |
1147 ;; Byte-compiler warning. | 1402 ;; Byte-compiler warning. |
1148 (eval-when-compile (defvar gnus-article-mode-map)) | 1403 (eval-when-compile |
1404 ;; Bind features so that require will believe that gnus-sum has | |
1405 ;; already been loaded (avoids infinite recursion) | |
1406 (let ((features (cons 'gnus-sum features))) | |
1407 ;; Several of the declarations in gnus-sum are needed to load the | |
1408 ;; following files. Right now, these definitions have been | |
1409 ;; compiled but not defined (evaluated). We could either do a | |
1410 ;; eval-and-compile about all of the declarations or evaluate the | |
1411 ;; source file. | |
1412 (if (boundp 'gnus-newsgroup-variables) | |
1413 nil | |
1414 (load "gnus-sum.el" t t t)) | |
1415 (require 'gnus) | |
1416 (require 'gnus-agent) | |
1417 (require 'gnus-art))) | |
1149 | 1418 |
1150 ;; MIME stuff. | 1419 ;; MIME stuff. |
1151 | 1420 |
1152 (defvar gnus-decode-encoded-word-methods | 1421 (defvar gnus-decode-encoded-word-methods |
1153 '(mail-decode-encoded-word-string) | 1422 '(mail-decode-encoded-word-string) |
1154 "List of methods used to decode encoded words. | 1423 "List of methods used to decode encoded words. |
1155 | 1424 |
1156 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item is | 1425 This variable is a list of FUNCTION or (REGEXP . FUNCTION). If item |
1157 FUNCTION, FUNCTION will be apply to all newsgroups. If item is a | 1426 is FUNCTION, FUNCTION will be apply to all newsgroups. If item is a |
1158 (REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups | 1427 \(REGEXP . FUNCTION), FUNCTION will be only apply to thes newsgroups |
1159 whose names match REGEXP. | 1428 whose names match REGEXP. |
1160 | 1429 |
1161 For example: | 1430 For example: |
1162 ((\"chinese\" . gnus-decode-encoded-word-string-by-guess) | 1431 \((\"chinese\" . gnus-decode-encoded-word-string-by-guess) |
1163 mail-decode-encoded-word-string | 1432 mail-decode-encoded-word-string |
1164 (\"chinese\" . rfc1843-decode-string))") | 1433 (\"chinese\" . rfc1843-decode-string))") |
1165 | 1434 |
1166 (defvar gnus-decode-encoded-word-methods-cache nil) | 1435 (defvar gnus-decode-encoded-word-methods-cache nil) |
1167 | 1436 |
1176 (nconc gnus-decode-encoded-word-methods-cache (list x)) | 1445 (nconc gnus-decode-encoded-word-methods-cache (list x)) |
1177 (if (and gnus-newsgroup-name | 1446 (if (and gnus-newsgroup-name |
1178 (string-match (car x) gnus-newsgroup-name)) | 1447 (string-match (car x) gnus-newsgroup-name)) |
1179 (nconc gnus-decode-encoded-word-methods-cache | 1448 (nconc gnus-decode-encoded-word-methods-cache |
1180 (list (cdr x)))))) | 1449 (list (cdr x)))))) |
1181 gnus-decode-encoded-word-methods)) | 1450 gnus-decode-encoded-word-methods)) |
1182 (let ((xlist gnus-decode-encoded-word-methods-cache)) | 1451 (let ((xlist gnus-decode-encoded-word-methods-cache)) |
1183 (pop xlist) | 1452 (pop xlist) |
1184 (while xlist | 1453 (while xlist |
1185 (setq string (funcall (pop xlist) string)))) | 1454 (setq string (funcall (pop xlist) string)))) |
1186 string) | 1455 string) |
1187 | 1456 |
1188 ;; Subject simplification. | 1457 ;; Subject simplification. |
1189 | 1458 |
1190 (defun gnus-simplify-whitespace (str) | 1459 (defun gnus-simplify-whitespace (str) |
1191 "Remove excessive whitespace from STR." | 1460 "Remove excessive whitespace from STR." |
1192 (let ((mystr str)) | 1461 ;; Multiple spaces. |
1193 ;; Multiple spaces. | 1462 (while (string-match "[ \t][ \t]+" str) |
1194 (while (string-match "[ \t][ \t]+" mystr) | 1463 (setq str (concat (substring str 0 (match-beginning 0)) |
1195 (setq mystr (concat (substring mystr 0 (match-beginning 0)) | 1464 " " |
1196 " " | 1465 (substring str (match-end 0))))) |
1197 (substring mystr (match-end 0))))) | 1466 ;; Leading spaces. |
1198 ;; Leading spaces. | 1467 (when (string-match "^[ \t]+" str) |
1199 (when (string-match "^[ \t]+" mystr) | 1468 (setq str (substring str (match-end 0)))) |
1200 (setq mystr (substring mystr (match-end 0)))) | 1469 ;; Trailing spaces. |
1201 ;; Trailing spaces. | 1470 (when (string-match "[ \t]+$" str) |
1202 (when (string-match "[ \t]+$" mystr) | 1471 (setq str (substring str 0 (match-beginning 0)))) |
1203 (setq mystr (substring mystr 0 (match-beginning 0)))) | 1472 str) |
1204 mystr)) | 1473 |
1474 (defun gnus-simplify-all-whitespace (str) | |
1475 "Remove all whitespace from STR." | |
1476 (while (string-match "[ \t\n]+" str) | |
1477 (setq str (replace-match "" nil nil str))) | |
1478 str) | |
1205 | 1479 |
1206 (defsubst gnus-simplify-subject-re (subject) | 1480 (defsubst gnus-simplify-subject-re (subject) |
1207 "Remove \"Re:\" from subject lines." | 1481 "Remove \"Re:\" from subject lines." |
1208 (if (string-match "^[Rr][Ee]: *" subject) | 1482 (if (string-match message-subject-re-regexp subject) |
1209 (substring subject (match-end 0)) | 1483 (substring subject (match-end 0)) |
1210 subject)) | 1484 subject)) |
1211 | 1485 |
1212 (defun gnus-simplify-subject (subject &optional re-only) | 1486 (defun gnus-simplify-subject (subject &optional re-only) |
1213 "Remove `Re:' and words in parentheses. | 1487 "Remove `Re:' and words in parentheses. |
1277 (insert subject) | 1551 (insert subject) |
1278 (inline (gnus-simplify-buffer-fuzzy)) | 1552 (inline (gnus-simplify-buffer-fuzzy)) |
1279 (buffer-string)))) | 1553 (buffer-string)))) |
1280 | 1554 |
1281 (defsubst gnus-simplify-subject-fully (subject) | 1555 (defsubst gnus-simplify-subject-fully (subject) |
1282 "Simplify a subject string according to gnus-summary-gather-subject-limit." | 1556 "Simplify a subject string according to `gnus-summary-gather-subject-limit'." |
1283 (cond | 1557 (cond |
1284 (gnus-simplify-subject-functions | 1558 (gnus-simplify-subject-functions |
1285 (gnus-map-function gnus-simplify-subject-functions subject)) | 1559 (gnus-map-function gnus-simplify-subject-functions subject)) |
1286 ((null gnus-summary-gather-subject-limit) | 1560 ((null gnus-summary-gather-subject-limit) |
1287 (gnus-simplify-subject-re subject)) | 1561 (gnus-simplify-subject-re subject)) |
1293 (t | 1567 (t |
1294 subject))) | 1568 subject))) |
1295 | 1569 |
1296 (defsubst gnus-subject-equal (s1 s2 &optional simple-first) | 1570 (defsubst gnus-subject-equal (s1 s2 &optional simple-first) |
1297 "Check whether two subjects are equal. | 1571 "Check whether two subjects are equal. |
1298 If optional argument simple-first is t, first argument is already | 1572 If optional argument SIMPLE-FIRST is t, first argument is already |
1299 simplified." | 1573 simplified." |
1300 (cond | 1574 (cond |
1301 ((null simple-first) | 1575 ((null simple-first) |
1302 (equal (gnus-simplify-subject-fully s1) | 1576 (equal (gnus-simplify-subject-fully s1) |
1303 (gnus-simplify-subject-fully s2))) | 1577 (gnus-simplify-subject-fully s2))) |
1318 | 1592 |
1319 (put 'gnus-summary-mode 'mode-class 'special) | 1593 (put 'gnus-summary-mode 'mode-class 'special) |
1320 | 1594 |
1321 (defvar gnus-article-commands-menu) | 1595 (defvar gnus-article-commands-menu) |
1322 | 1596 |
1323 (when t | 1597 ;; Non-orthogonal keys |
1324 ;; Non-orthogonal keys | 1598 |
1325 | 1599 (gnus-define-keys gnus-summary-mode-map |
1326 (gnus-define-keys gnus-summary-mode-map | 1600 " " gnus-summary-next-page |
1327 " " gnus-summary-next-page | 1601 "\177" gnus-summary-prev-page |
1328 "\177" gnus-summary-prev-page | 1602 [delete] gnus-summary-prev-page |
1329 [delete] gnus-summary-prev-page | 1603 [backspace] gnus-summary-prev-page |
1330 [backspace] gnus-summary-prev-page | 1604 "\r" gnus-summary-scroll-up |
1331 "\r" gnus-summary-scroll-up | 1605 "\M-\r" gnus-summary-scroll-down |
1332 "\M-\r" gnus-summary-scroll-down | 1606 "n" gnus-summary-next-unread-article |
1333 "n" gnus-summary-next-unread-article | 1607 "p" gnus-summary-prev-unread-article |
1334 "p" gnus-summary-prev-unread-article | 1608 "N" gnus-summary-next-article |
1335 "N" gnus-summary-next-article | 1609 "P" gnus-summary-prev-article |
1336 "P" gnus-summary-prev-article | 1610 "\M-\C-n" gnus-summary-next-same-subject |
1337 "\M-\C-n" gnus-summary-next-same-subject | 1611 "\M-\C-p" gnus-summary-prev-same-subject |
1338 "\M-\C-p" gnus-summary-prev-same-subject | 1612 "\M-n" gnus-summary-next-unread-subject |
1339 "\M-n" gnus-summary-next-unread-subject | 1613 "\M-p" gnus-summary-prev-unread-subject |
1340 "\M-p" gnus-summary-prev-unread-subject | 1614 "." gnus-summary-first-unread-article |
1341 "." gnus-summary-first-unread-article | 1615 "," gnus-summary-best-unread-article |
1342 "," gnus-summary-best-unread-article | 1616 "\M-s" gnus-summary-search-article-forward |
1343 "\M-s" gnus-summary-search-article-forward | 1617 "\M-r" gnus-summary-search-article-backward |
1344 "\M-r" gnus-summary-search-article-backward | 1618 "<" gnus-summary-beginning-of-article |
1345 "<" gnus-summary-beginning-of-article | 1619 ">" gnus-summary-end-of-article |
1346 ">" gnus-summary-end-of-article | 1620 "j" gnus-summary-goto-article |
1347 "j" gnus-summary-goto-article | 1621 "^" gnus-summary-refer-parent-article |
1348 "^" gnus-summary-refer-parent-article | 1622 "\M-^" gnus-summary-refer-article |
1349 "\M-^" gnus-summary-refer-article | 1623 "u" gnus-summary-tick-article-forward |
1350 "u" gnus-summary-tick-article-forward | 1624 "!" gnus-summary-tick-article-forward |
1351 "!" gnus-summary-tick-article-forward | 1625 "U" gnus-summary-tick-article-backward |
1352 "U" gnus-summary-tick-article-backward | 1626 "d" gnus-summary-mark-as-read-forward |
1353 "d" gnus-summary-mark-as-read-forward | 1627 "D" gnus-summary-mark-as-read-backward |
1354 "D" gnus-summary-mark-as-read-backward | 1628 "E" gnus-summary-mark-as-expirable |
1355 "E" gnus-summary-mark-as-expirable | 1629 "\M-u" gnus-summary-clear-mark-forward |
1356 "\M-u" gnus-summary-clear-mark-forward | 1630 "\M-U" gnus-summary-clear-mark-backward |
1357 "\M-U" gnus-summary-clear-mark-backward | 1631 "k" gnus-summary-kill-same-subject-and-select |
1358 "k" gnus-summary-kill-same-subject-and-select | 1632 "\C-k" gnus-summary-kill-same-subject |
1359 "\C-k" gnus-summary-kill-same-subject | 1633 "\M-\C-k" gnus-summary-kill-thread |
1360 "\M-\C-k" gnus-summary-kill-thread | 1634 "\M-\C-l" gnus-summary-lower-thread |
1361 "\M-\C-l" gnus-summary-lower-thread | 1635 "e" gnus-summary-edit-article |
1362 "e" gnus-summary-edit-article | 1636 "#" gnus-summary-mark-as-processable |
1363 "#" gnus-summary-mark-as-processable | 1637 "\M-#" gnus-summary-unmark-as-processable |
1364 "\M-#" gnus-summary-unmark-as-processable | 1638 "\M-\C-t" gnus-summary-toggle-threads |
1365 "\M-\C-t" gnus-summary-toggle-threads | 1639 "\M-\C-s" gnus-summary-show-thread |
1366 "\M-\C-s" gnus-summary-show-thread | 1640 "\M-\C-h" gnus-summary-hide-thread |
1367 "\M-\C-h" gnus-summary-hide-thread | 1641 "\M-\C-f" gnus-summary-next-thread |
1368 "\M-\C-f" gnus-summary-next-thread | 1642 "\M-\C-b" gnus-summary-prev-thread |
1369 "\M-\C-b" gnus-summary-prev-thread | 1643 [(meta down)] gnus-summary-next-thread |
1370 [(meta down)] gnus-summary-next-thread | 1644 [(meta up)] gnus-summary-prev-thread |
1371 [(meta up)] gnus-summary-prev-thread | 1645 "\M-\C-u" gnus-summary-up-thread |
1372 "\M-\C-u" gnus-summary-up-thread | 1646 "\M-\C-d" gnus-summary-down-thread |
1373 "\M-\C-d" gnus-summary-down-thread | 1647 "&" gnus-summary-execute-command |
1374 "&" gnus-summary-execute-command | 1648 "c" gnus-summary-catchup-and-exit |
1375 "c" gnus-summary-catchup-and-exit | 1649 "\C-w" gnus-summary-mark-region-as-read |
1376 "\C-w" gnus-summary-mark-region-as-read | 1650 "\C-t" gnus-summary-toggle-truncation |
1377 "\C-t" gnus-summary-toggle-truncation | 1651 "?" gnus-summary-mark-as-dormant |
1378 "?" gnus-summary-mark-as-dormant | 1652 "\C-c\M-\C-s" gnus-summary-limit-include-expunged |
1379 "\C-c\M-\C-s" gnus-summary-limit-include-expunged | 1653 "\C-c\C-s\C-n" gnus-summary-sort-by-number |
1380 "\C-c\C-s\C-n" gnus-summary-sort-by-number | 1654 "\C-c\C-s\C-l" gnus-summary-sort-by-lines |
1381 "\C-c\C-s\C-l" gnus-summary-sort-by-lines | 1655 "\C-c\C-s\C-c" gnus-summary-sort-by-chars |
1382 "\C-c\C-s\C-c" gnus-summary-sort-by-chars | 1656 "\C-c\C-s\C-a" gnus-summary-sort-by-author |
1383 "\C-c\C-s\C-a" gnus-summary-sort-by-author | 1657 "\C-c\C-s\C-s" gnus-summary-sort-by-subject |
1384 "\C-c\C-s\C-s" gnus-summary-sort-by-subject | 1658 "\C-c\C-s\C-d" gnus-summary-sort-by-date |
1385 "\C-c\C-s\C-d" gnus-summary-sort-by-date | 1659 "\C-c\C-s\C-i" gnus-summary-sort-by-score |
1386 "\C-c\C-s\C-i" gnus-summary-sort-by-score | 1660 "\C-c\C-s\C-o" gnus-summary-sort-by-original |
1387 "=" gnus-summary-expand-window | 1661 "\C-c\C-s\C-r" gnus-summary-sort-by-random |
1388 "\C-x\C-s" gnus-summary-reselect-current-group | 1662 "=" gnus-summary-expand-window |
1389 "\M-g" gnus-summary-rescan-group | 1663 "\C-x\C-s" gnus-summary-reselect-current-group |
1390 "w" gnus-summary-stop-page-breaking | 1664 "\M-g" gnus-summary-rescan-group |
1391 "\C-c\C-r" gnus-summary-caesar-message | 1665 "w" gnus-summary-stop-page-breaking |
1392 "f" gnus-summary-followup | 1666 "\C-c\C-r" gnus-summary-caesar-message |
1393 "F" gnus-summary-followup-with-original | 1667 "f" gnus-summary-followup |
1394 "C" gnus-summary-cancel-article | 1668 "F" gnus-summary-followup-with-original |
1395 "r" gnus-summary-reply | 1669 "C" gnus-summary-cancel-article |
1396 "R" gnus-summary-reply-with-original | 1670 "r" gnus-summary-reply |
1397 "\C-c\C-f" gnus-summary-mail-forward | 1671 "R" gnus-summary-reply-with-original |
1398 "o" gnus-summary-save-article | 1672 "\C-c\C-f" gnus-summary-mail-forward |
1399 "\C-o" gnus-summary-save-article-mail | 1673 "o" gnus-summary-save-article |
1400 "|" gnus-summary-pipe-output | 1674 "\C-o" gnus-summary-save-article-mail |
1401 "\M-k" gnus-summary-edit-local-kill | 1675 "|" gnus-summary-pipe-output |
1402 "\M-K" gnus-summary-edit-global-kill | 1676 "\M-k" gnus-summary-edit-local-kill |
1403 ;; "V" gnus-version | 1677 "\M-K" gnus-summary-edit-global-kill |
1404 "\C-c\C-d" gnus-summary-describe-group | 1678 ;; "V" gnus-version |
1405 "q" gnus-summary-exit | 1679 "\C-c\C-d" gnus-summary-describe-group |
1406 "Q" gnus-summary-exit-no-update | 1680 "q" gnus-summary-exit |
1407 "\C-c\C-i" gnus-info-find-node | 1681 "Q" gnus-summary-exit-no-update |
1408 gnus-mouse-2 gnus-mouse-pick-article | 1682 "\C-c\C-i" gnus-info-find-node |
1409 "m" gnus-summary-mail-other-window | 1683 gnus-mouse-2 gnus-mouse-pick-article |
1410 "a" gnus-summary-post-news | 1684 "m" gnus-summary-mail-other-window |
1411 "x" gnus-summary-limit-to-unread | 1685 "a" gnus-summary-post-news |
1412 "s" gnus-summary-isearch-article | 1686 "i" gnus-summary-news-other-window |
1413 "t" gnus-summary-toggle-header | 1687 "x" gnus-summary-limit-to-unread |
1414 "g" gnus-summary-show-article | 1688 "s" gnus-summary-isearch-article |
1415 "l" gnus-summary-goto-last-article | 1689 "t" gnus-summary-toggle-header |
1416 "\C-c\C-v\C-v" gnus-uu-decode-uu-view | 1690 "g" gnus-summary-show-article |
1417 "\C-d" gnus-summary-enter-digest-group | 1691 "l" gnus-summary-goto-last-article |
1418 "\M-\C-d" gnus-summary-read-document | 1692 "\C-c\C-v\C-v" gnus-uu-decode-uu-view |
1419 "\M-\C-e" gnus-summary-edit-parameters | 1693 "\C-d" gnus-summary-enter-digest-group |
1420 "\M-\C-a" gnus-summary-customize-parameters | 1694 "\M-\C-d" gnus-summary-read-document |
1421 "\C-c\C-b" gnus-bug | 1695 "\M-\C-e" gnus-summary-edit-parameters |
1422 "*" gnus-cache-enter-article | 1696 "\M-\C-a" gnus-summary-customize-parameters |
1423 "\M-*" gnus-cache-remove-article | 1697 "\C-c\C-b" gnus-bug |
1424 "\M-&" gnus-summary-universal-argument | 1698 "*" gnus-cache-enter-article |
1425 "\C-l" gnus-recenter | 1699 "\M-*" gnus-cache-remove-article |
1426 "I" gnus-summary-increase-score | 1700 "\M-&" gnus-summary-universal-argument |
1427 "L" gnus-summary-lower-score | 1701 "\C-l" gnus-recenter |
1428 "\M-i" gnus-symbolic-argument | 1702 "I" gnus-summary-increase-score |
1429 "h" gnus-summary-select-article-buffer | 1703 "L" gnus-summary-lower-score |
1430 | 1704 "\M-i" gnus-symbolic-argument |
1431 "b" gnus-article-view-part | 1705 "h" gnus-summary-select-article-buffer |
1432 "\M-t" gnus-summary-toggle-display-buttonized | 1706 |
1433 | 1707 "b" gnus-article-view-part |
1434 "V" gnus-summary-score-map | 1708 "\M-t" gnus-summary-toggle-display-buttonized |
1435 "X" gnus-uu-extract-map | 1709 |
1436 "S" gnus-summary-send-map) | 1710 "V" gnus-summary-score-map |
1437 | 1711 "X" gnus-uu-extract-map |
1438 ;; Sort of orthogonal keymap | 1712 "S" gnus-summary-send-map) |
1439 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map) | 1713 |
1440 "t" gnus-summary-tick-article-forward | 1714 ;; Sort of orthogonal keymap |
1441 "!" gnus-summary-tick-article-forward | 1715 (gnus-define-keys (gnus-summary-mark-map "M" gnus-summary-mode-map) |
1442 "d" gnus-summary-mark-as-read-forward | 1716 "t" gnus-summary-tick-article-forward |
1443 "r" gnus-summary-mark-as-read-forward | 1717 "!" gnus-summary-tick-article-forward |
1444 "c" gnus-summary-clear-mark-forward | 1718 "d" gnus-summary-mark-as-read-forward |
1445 " " gnus-summary-clear-mark-forward | 1719 "r" gnus-summary-mark-as-read-forward |
1446 "e" gnus-summary-mark-as-expirable | 1720 "c" gnus-summary-clear-mark-forward |
1447 "x" gnus-summary-mark-as-expirable | 1721 " " gnus-summary-clear-mark-forward |
1448 "?" gnus-summary-mark-as-dormant | 1722 "e" gnus-summary-mark-as-expirable |
1449 "b" gnus-summary-set-bookmark | 1723 "x" gnus-summary-mark-as-expirable |
1450 "B" gnus-summary-remove-bookmark | 1724 "?" gnus-summary-mark-as-dormant |
1451 "#" gnus-summary-mark-as-processable | 1725 "b" gnus-summary-set-bookmark |
1452 "\M-#" gnus-summary-unmark-as-processable | 1726 "B" gnus-summary-remove-bookmark |
1453 "S" gnus-summary-limit-include-expunged | 1727 "#" gnus-summary-mark-as-processable |
1454 "C" gnus-summary-catchup | 1728 "\M-#" gnus-summary-unmark-as-processable |
1455 "H" gnus-summary-catchup-to-here | 1729 "S" gnus-summary-limit-include-expunged |
1456 "\C-c" gnus-summary-catchup-all | 1730 "C" gnus-summary-catchup |
1457 "k" gnus-summary-kill-same-subject-and-select | 1731 "H" gnus-summary-catchup-to-here |
1458 "K" gnus-summary-kill-same-subject | 1732 "h" gnus-summary-catchup-from-here |
1459 "P" gnus-uu-mark-map) | 1733 "\C-c" gnus-summary-catchup-all |
1460 | 1734 "k" gnus-summary-kill-same-subject-and-select |
1461 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map) | 1735 "K" gnus-summary-kill-same-subject |
1462 "c" gnus-summary-clear-above | 1736 "P" gnus-uu-mark-map) |
1463 "u" gnus-summary-tick-above | 1737 |
1464 "m" gnus-summary-mark-above | 1738 (gnus-define-keys (gnus-summary-mscore-map "V" gnus-summary-mark-map) |
1465 "k" gnus-summary-kill-below) | 1739 "c" gnus-summary-clear-above |
1466 | 1740 "u" gnus-summary-tick-above |
1467 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map) | 1741 "m" gnus-summary-mark-above |
1468 "/" gnus-summary-limit-to-subject | 1742 "k" gnus-summary-kill-below) |
1469 "n" gnus-summary-limit-to-articles | 1743 |
1470 "w" gnus-summary-pop-limit | 1744 (gnus-define-keys (gnus-summary-limit-map "/" gnus-summary-mode-map) |
1471 "s" gnus-summary-limit-to-subject | 1745 "/" gnus-summary-limit-to-subject |
1472 "a" gnus-summary-limit-to-author | 1746 "n" gnus-summary-limit-to-articles |
1473 "u" gnus-summary-limit-to-unread | 1747 "w" gnus-summary-pop-limit |
1474 "m" gnus-summary-limit-to-marks | 1748 "s" gnus-summary-limit-to-subject |
1475 "M" gnus-summary-limit-exclude-marks | 1749 "a" gnus-summary-limit-to-author |
1476 "v" gnus-summary-limit-to-score | 1750 "u" gnus-summary-limit-to-unread |
1477 "*" gnus-summary-limit-include-cached | 1751 "m" gnus-summary-limit-to-marks |
1478 "D" gnus-summary-limit-include-dormant | 1752 "M" gnus-summary-limit-exclude-marks |
1479 "T" gnus-summary-limit-include-thread | 1753 "v" gnus-summary-limit-to-score |
1480 "d" gnus-summary-limit-exclude-dormant | 1754 "*" gnus-summary-limit-include-cached |
1481 "t" gnus-summary-limit-to-age | 1755 "D" gnus-summary-limit-include-dormant |
1482 "x" gnus-summary-limit-to-extra | 1756 "T" gnus-summary-limit-include-thread |
1483 "E" gnus-summary-limit-include-expunged | 1757 "d" gnus-summary-limit-exclude-dormant |
1484 "c" gnus-summary-limit-exclude-childless-dormant | 1758 "t" gnus-summary-limit-to-age |
1485 "C" gnus-summary-limit-mark-excluded-as-read) | 1759 "." gnus-summary-limit-to-unseen |
1486 | 1760 "x" gnus-summary-limit-to-extra |
1487 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map) | 1761 "p" gnus-summary-limit-to-display-predicate |
1488 "n" gnus-summary-next-unread-article | 1762 "E" gnus-summary-limit-include-expunged |
1489 "p" gnus-summary-prev-unread-article | 1763 "c" gnus-summary-limit-exclude-childless-dormant |
1490 "N" gnus-summary-next-article | 1764 "C" gnus-summary-limit-mark-excluded-as-read |
1491 "P" gnus-summary-prev-article | 1765 "o" gnus-summary-insert-old-articles |
1492 "\C-n" gnus-summary-next-same-subject | 1766 "N" gnus-summary-insert-new-articles) |
1493 "\C-p" gnus-summary-prev-same-subject | 1767 |
1494 "\M-n" gnus-summary-next-unread-subject | 1768 (gnus-define-keys (gnus-summary-goto-map "G" gnus-summary-mode-map) |
1495 "\M-p" gnus-summary-prev-unread-subject | 1769 "n" gnus-summary-next-unread-article |
1496 "f" gnus-summary-first-unread-article | 1770 "p" gnus-summary-prev-unread-article |
1497 "b" gnus-summary-best-unread-article | 1771 "N" gnus-summary-next-article |
1498 "j" gnus-summary-goto-article | 1772 "P" gnus-summary-prev-article |
1499 "g" gnus-summary-goto-subject | 1773 "\C-n" gnus-summary-next-same-subject |
1500 "l" gnus-summary-goto-last-article | 1774 "\C-p" gnus-summary-prev-same-subject |
1501 "o" gnus-summary-pop-article) | 1775 "\M-n" gnus-summary-next-unread-subject |
1502 | 1776 "\M-p" gnus-summary-prev-unread-subject |
1503 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map) | 1777 "f" gnus-summary-first-unread-article |
1504 "k" gnus-summary-kill-thread | 1778 "b" gnus-summary-best-unread-article |
1505 "l" gnus-summary-lower-thread | 1779 "j" gnus-summary-goto-article |
1506 "i" gnus-summary-raise-thread | 1780 "g" gnus-summary-goto-subject |
1507 "T" gnus-summary-toggle-threads | 1781 "l" gnus-summary-goto-last-article |
1508 "t" gnus-summary-rethread-current | 1782 "o" gnus-summary-pop-article) |
1509 "^" gnus-summary-reparent-thread | 1783 |
1510 "s" gnus-summary-show-thread | 1784 (gnus-define-keys (gnus-summary-thread-map "T" gnus-summary-mode-map) |
1511 "S" gnus-summary-show-all-threads | 1785 "k" gnus-summary-kill-thread |
1512 "h" gnus-summary-hide-thread | 1786 "l" gnus-summary-lower-thread |
1513 "H" gnus-summary-hide-all-threads | 1787 "i" gnus-summary-raise-thread |
1514 "n" gnus-summary-next-thread | 1788 "T" gnus-summary-toggle-threads |
1515 "p" gnus-summary-prev-thread | 1789 "t" gnus-summary-rethread-current |
1516 "u" gnus-summary-up-thread | 1790 "^" gnus-summary-reparent-thread |
1517 "o" gnus-summary-top-thread | 1791 "s" gnus-summary-show-thread |
1518 "d" gnus-summary-down-thread | 1792 "S" gnus-summary-show-all-threads |
1519 "#" gnus-uu-mark-thread | 1793 "h" gnus-summary-hide-thread |
1520 "\M-#" gnus-uu-unmark-thread) | 1794 "H" gnus-summary-hide-all-threads |
1521 | 1795 "n" gnus-summary-next-thread |
1522 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map) | 1796 "p" gnus-summary-prev-thread |
1523 "g" gnus-summary-prepare | 1797 "u" gnus-summary-up-thread |
1524 "c" gnus-summary-insert-cached-articles) | 1798 "o" gnus-summary-top-thread |
1525 | 1799 "d" gnus-summary-down-thread |
1526 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map) | 1800 "#" gnus-uu-mark-thread |
1527 "c" gnus-summary-catchup-and-exit | 1801 "\M-#" gnus-uu-unmark-thread) |
1528 "C" gnus-summary-catchup-all-and-exit | 1802 |
1529 "E" gnus-summary-exit-no-update | 1803 (gnus-define-keys (gnus-summary-buffer-map "Y" gnus-summary-mode-map) |
1530 "Q" gnus-summary-exit | 1804 "g" gnus-summary-prepare |
1531 "Z" gnus-summary-exit | 1805 "c" gnus-summary-insert-cached-articles |
1532 "n" gnus-summary-catchup-and-goto-next-group | 1806 "d" gnus-summary-insert-dormant-articles) |
1533 "R" gnus-summary-reselect-current-group | 1807 |
1534 "G" gnus-summary-rescan-group | 1808 (gnus-define-keys (gnus-summary-exit-map "Z" gnus-summary-mode-map) |
1535 "N" gnus-summary-next-group | 1809 "c" gnus-summary-catchup-and-exit |
1536 "s" gnus-summary-save-newsrc | 1810 "C" gnus-summary-catchup-all-and-exit |
1537 "P" gnus-summary-prev-group) | 1811 "E" gnus-summary-exit-no-update |
1538 | 1812 "Q" gnus-summary-exit |
1539 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map) | 1813 "Z" gnus-summary-exit |
1540 " " gnus-summary-next-page | 1814 "n" gnus-summary-catchup-and-goto-next-group |
1541 "n" gnus-summary-next-page | 1815 "R" gnus-summary-reselect-current-group |
1542 "\177" gnus-summary-prev-page | 1816 "G" gnus-summary-rescan-group |
1543 [delete] gnus-summary-prev-page | 1817 "N" gnus-summary-next-group |
1544 "p" gnus-summary-prev-page | 1818 "s" gnus-summary-save-newsrc |
1545 "\r" gnus-summary-scroll-up | 1819 "P" gnus-summary-prev-group) |
1546 "\M-\r" gnus-summary-scroll-down | 1820 |
1547 "<" gnus-summary-beginning-of-article | 1821 (gnus-define-keys (gnus-summary-article-map "A" gnus-summary-mode-map) |
1548 ">" gnus-summary-end-of-article | 1822 " " gnus-summary-next-page |
1549 "b" gnus-summary-beginning-of-article | 1823 "n" gnus-summary-next-page |
1550 "e" gnus-summary-end-of-article | 1824 "\177" gnus-summary-prev-page |
1551 "^" gnus-summary-refer-parent-article | 1825 [delete] gnus-summary-prev-page |
1552 "r" gnus-summary-refer-parent-article | 1826 "p" gnus-summary-prev-page |
1553 "D" gnus-summary-enter-digest-group | 1827 "\r" gnus-summary-scroll-up |
1554 "R" gnus-summary-refer-references | 1828 "\M-\r" gnus-summary-scroll-down |
1555 "T" gnus-summary-refer-thread | 1829 "<" gnus-summary-beginning-of-article |
1556 "g" gnus-summary-show-article | 1830 ">" gnus-summary-end-of-article |
1557 "s" gnus-summary-isearch-article | 1831 "b" gnus-summary-beginning-of-article |
1558 "P" gnus-summary-print-article | 1832 "e" gnus-summary-end-of-article |
1559 "t" gnus-article-babel) | 1833 "^" gnus-summary-refer-parent-article |
1560 | 1834 "r" gnus-summary-refer-parent-article |
1561 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map) | 1835 "D" gnus-summary-enter-digest-group |
1562 "b" gnus-article-add-buttons | 1836 "R" gnus-summary-refer-references |
1563 "B" gnus-article-add-buttons-to-head | 1837 "T" gnus-summary-refer-thread |
1564 "o" gnus-article-treat-overstrike | 1838 "g" gnus-summary-show-article |
1565 "e" gnus-article-emphasize | 1839 "s" gnus-summary-isearch-article |
1566 "w" gnus-article-fill-cited-article | 1840 "P" gnus-summary-print-article |
1567 "Q" gnus-article-fill-long-lines | 1841 "M" gnus-mailing-list-insinuate |
1568 "C" gnus-article-capitalize-sentences | 1842 "t" gnus-article-babel) |
1569 "c" gnus-article-remove-cr | 1843 |
1570 "q" gnus-article-de-quoted-unreadable | 1844 (gnus-define-keys (gnus-summary-wash-map "W" gnus-summary-mode-map) |
1571 "6" gnus-article-de-base64-unreadable | 1845 "b" gnus-article-add-buttons |
1572 "Z" gnus-article-decode-HZ | 1846 "B" gnus-article-add-buttons-to-head |
1573 "h" gnus-article-wash-html | 1847 "o" gnus-article-treat-overstrike |
1574 "f" gnus-article-display-x-face | 1848 "e" gnus-article-emphasize |
1575 "l" gnus-summary-stop-page-breaking | 1849 "w" gnus-article-fill-cited-article |
1576 "r" gnus-summary-caesar-message | 1850 "Q" gnus-article-fill-long-lines |
1577 "t" gnus-summary-toggle-header | 1851 "C" gnus-article-capitalize-sentences |
1578 "v" gnus-summary-verbose-headers | 1852 "c" gnus-article-remove-cr |
1579 "H" gnus-article-strip-headers-in-body | 1853 "q" gnus-article-de-quoted-unreadable |
1580 "d" gnus-article-treat-dumbquotes) | 1854 "6" gnus-article-de-base64-unreadable |
1581 | 1855 "Z" gnus-article-decode-HZ |
1582 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map) | 1856 "h" gnus-article-wash-html |
1583 "a" gnus-article-hide | 1857 "u" gnus-article-unsplit-urls |
1584 "h" gnus-article-hide-headers | 1858 "s" gnus-summary-force-verify-and-decrypt |
1585 "b" gnus-article-hide-boring-headers | 1859 "f" gnus-article-display-x-face |
1586 "s" gnus-article-hide-signature | 1860 "l" gnus-summary-stop-page-breaking |
1587 "c" gnus-article-hide-citation | 1861 "r" gnus-summary-caesar-message |
1588 "C" gnus-article-hide-citation-in-followups | 1862 "m" gnus-summary-morse-message |
1589 "l" gnus-article-hide-list-identifiers | 1863 "t" gnus-summary-toggle-header |
1590 "p" gnus-article-hide-pgp | 1864 "g" gnus-treat-smiley |
1591 "B" gnus-article-strip-banner | 1865 "v" gnus-summary-verbose-headers |
1592 "P" gnus-article-hide-pem | 1866 "a" gnus-article-strip-headers-in-body ;; mnemonic: wash archive |
1593 "\C-c" gnus-article-hide-citation-maybe) | 1867 "p" gnus-article-verify-x-pgp-sig |
1594 | 1868 "d" gnus-article-treat-dumbquotes) |
1595 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map) | 1869 |
1596 "a" gnus-article-highlight | 1870 (gnus-define-keys (gnus-summary-wash-deuglify-map "Y" gnus-summary-wash-map) |
1597 "h" gnus-article-highlight-headers | 1871 ;; mnemonic: deuglif*Y* |
1598 "c" gnus-article-highlight-citation | 1872 "u" gnus-article-outlook-unwrap-lines |
1599 "s" gnus-article-highlight-signature) | 1873 "a" gnus-article-outlook-repair-attribution |
1600 | 1874 "c" gnus-article-outlook-rearrange-citation |
1601 (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map) | 1875 "f" gnus-article-outlook-deuglify-article) ;; mnemonic: full deuglify |
1602 "w" gnus-article-decode-mime-words | 1876 |
1603 "c" gnus-article-decode-charset | 1877 (gnus-define-keys (gnus-summary-wash-hide-map "W" gnus-summary-wash-map) |
1604 "v" gnus-mime-view-all-parts | 1878 "a" gnus-article-hide |
1605 "b" gnus-article-view-part) | 1879 "h" gnus-article-hide-headers |
1606 | 1880 "b" gnus-article-hide-boring-headers |
1607 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) | 1881 "s" gnus-article-hide-signature |
1608 "z" gnus-article-date-ut | 1882 "c" gnus-article-hide-citation |
1609 "u" gnus-article-date-ut | 1883 "C" gnus-article-hide-citation-in-followups |
1610 "l" gnus-article-date-local | 1884 "l" gnus-article-hide-list-identifiers |
1611 "e" gnus-article-date-lapsed | 1885 "B" gnus-article-strip-banner |
1612 "o" gnus-article-date-original | 1886 "P" gnus-article-hide-pem |
1613 "i" gnus-article-date-iso8601 | 1887 "\C-c" gnus-article-hide-citation-maybe) |
1614 "s" gnus-article-date-user) | 1888 |
1615 | 1889 (gnus-define-keys (gnus-summary-wash-highlight-map "H" gnus-summary-wash-map) |
1616 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map) | 1890 "a" gnus-article-highlight |
1617 "t" gnus-article-remove-trailing-blank-lines | 1891 "h" gnus-article-highlight-headers |
1618 "l" gnus-article-strip-leading-blank-lines | 1892 "c" gnus-article-highlight-citation |
1619 "m" gnus-article-strip-multiple-blank-lines | 1893 "s" gnus-article-highlight-signature) |
1620 "a" gnus-article-strip-blank-lines | 1894 |
1621 "A" gnus-article-strip-all-blank-lines | 1895 (gnus-define-keys (gnus-summary-wash-header-map "G" gnus-summary-wash-map) |
1622 "s" gnus-article-strip-leading-space | 1896 "f" gnus-article-treat-fold-headers |
1623 "e" gnus-article-strip-trailing-space) | 1897 "u" gnus-article-treat-unfold-headers |
1624 | 1898 "n" gnus-article-treat-fold-newsgroups) |
1625 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) | 1899 |
1626 "v" gnus-version | 1900 (gnus-define-keys (gnus-summary-wash-display-map "D" gnus-summary-wash-map) |
1627 "f" gnus-summary-fetch-faq | 1901 "x" gnus-article-display-x-face |
1628 "d" gnus-summary-describe-group | 1902 "d" gnus-article-display-face |
1629 "h" gnus-summary-describe-briefly | 1903 "s" gnus-treat-smiley |
1630 "i" gnus-info-find-node) | 1904 "D" gnus-article-remove-images |
1631 | 1905 "f" gnus-treat-from-picon |
1632 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map) | 1906 "m" gnus-treat-mail-picon |
1633 "e" gnus-summary-expire-articles | 1907 "n" gnus-treat-newsgroups-picon) |
1634 "\M-\C-e" gnus-summary-expire-articles-now | 1908 |
1635 "\177" gnus-summary-delete-article | 1909 (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map) |
1636 [delete] gnus-summary-delete-article | 1910 "w" gnus-article-decode-mime-words |
1637 [backspace] gnus-summary-delete-article | 1911 "c" gnus-article-decode-charset |
1638 "m" gnus-summary-move-article | 1912 "v" gnus-mime-view-all-parts |
1639 "r" gnus-summary-respool-article | 1913 "b" gnus-article-view-part) |
1640 "w" gnus-summary-edit-article | 1914 |
1641 "c" gnus-summary-copy-article | 1915 (gnus-define-keys (gnus-summary-wash-time-map "T" gnus-summary-wash-map) |
1642 "B" gnus-summary-crosspost-article | 1916 "z" gnus-article-date-ut |
1643 "q" gnus-summary-respool-query | 1917 "u" gnus-article-date-ut |
1644 "t" gnus-summary-respool-trace | 1918 "l" gnus-article-date-local |
1645 "i" gnus-summary-import-article | 1919 "p" gnus-article-date-english |
1646 "p" gnus-summary-article-posted-p) | 1920 "e" gnus-article-date-lapsed |
1647 | 1921 "o" gnus-article-date-original |
1648 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map) | 1922 "i" gnus-article-date-iso8601 |
1649 "o" gnus-summary-save-article | 1923 "s" gnus-article-date-user) |
1650 "m" gnus-summary-save-article-mail | 1924 |
1651 "F" gnus-summary-write-article-file | 1925 (gnus-define-keys (gnus-summary-wash-empty-map "E" gnus-summary-wash-map) |
1652 "r" gnus-summary-save-article-rmail | 1926 "t" gnus-article-remove-trailing-blank-lines |
1653 "f" gnus-summary-save-article-file | 1927 "l" gnus-article-strip-leading-blank-lines |
1654 "b" gnus-summary-save-article-body-file | 1928 "m" gnus-article-strip-multiple-blank-lines |
1655 "h" gnus-summary-save-article-folder | 1929 "a" gnus-article-strip-blank-lines |
1656 "v" gnus-summary-save-article-vm | 1930 "A" gnus-article-strip-all-blank-lines |
1657 "p" gnus-summary-pipe-output | 1931 "s" gnus-article-strip-leading-space |
1658 "s" gnus-soup-add-article) | 1932 "e" gnus-article-strip-trailing-space |
1659 | 1933 "w" gnus-article-remove-leading-whitespace) |
1660 (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map) | 1934 |
1661 "b" gnus-summary-display-buttonized | 1935 (gnus-define-keys (gnus-summary-help-map "H" gnus-summary-mode-map) |
1662 "m" gnus-summary-repair-multipart | 1936 "v" gnus-version |
1663 "v" gnus-article-view-part | 1937 "f" gnus-summary-fetch-faq |
1664 "o" gnus-article-save-part | 1938 "d" gnus-summary-describe-group |
1665 "c" gnus-article-copy-part | 1939 "h" gnus-summary-describe-briefly |
1666 "e" gnus-article-externalize-part | 1940 "i" gnus-info-find-node |
1667 "i" gnus-article-inline-part | 1941 "c" gnus-group-fetch-charter |
1668 "|" gnus-article-pipe-part)) | 1942 "C" gnus-group-fetch-control) |
1943 | |
1944 (gnus-define-keys (gnus-summary-backend-map "B" gnus-summary-mode-map) | |
1945 "e" gnus-summary-expire-articles | |
1946 "\M-\C-e" gnus-summary-expire-articles-now | |
1947 "\177" gnus-summary-delete-article | |
1948 [delete] gnus-summary-delete-article | |
1949 [backspace] gnus-summary-delete-article | |
1950 "m" gnus-summary-move-article | |
1951 "r" gnus-summary-respool-article | |
1952 "w" gnus-summary-edit-article | |
1953 "c" gnus-summary-copy-article | |
1954 "B" gnus-summary-crosspost-article | |
1955 "q" gnus-summary-respool-query | |
1956 "t" gnus-summary-respool-trace | |
1957 "i" gnus-summary-import-article | |
1958 "I" gnus-summary-create-article | |
1959 "p" gnus-summary-article-posted-p) | |
1960 | |
1961 (gnus-define-keys (gnus-summary-save-map "O" gnus-summary-mode-map) | |
1962 "o" gnus-summary-save-article | |
1963 "m" gnus-summary-save-article-mail | |
1964 "F" gnus-summary-write-article-file | |
1965 "r" gnus-summary-save-article-rmail | |
1966 "f" gnus-summary-save-article-file | |
1967 "b" gnus-summary-save-article-body-file | |
1968 "h" gnus-summary-save-article-folder | |
1969 "v" gnus-summary-save-article-vm | |
1970 "p" gnus-summary-pipe-output | |
1971 "P" gnus-summary-muttprint | |
1972 "s" gnus-soup-add-article) | |
1973 | |
1974 (gnus-define-keys (gnus-summary-mime-map "K" gnus-summary-mode-map) | |
1975 "b" gnus-summary-display-buttonized | |
1976 "m" gnus-summary-repair-multipart | |
1977 "v" gnus-article-view-part | |
1978 "o" gnus-article-save-part | |
1979 "c" gnus-article-copy-part | |
1980 "C" gnus-article-view-part-as-charset | |
1981 "e" gnus-article-view-part-externally | |
1982 "E" gnus-article-encrypt-body | |
1983 "i" gnus-article-inline-part | |
1984 "|" gnus-article-pipe-part) | |
1985 | |
1986 (gnus-define-keys (gnus-uu-mark-map "P" gnus-summary-mark-map) | |
1987 "p" gnus-summary-mark-as-processable | |
1988 "u" gnus-summary-unmark-as-processable | |
1989 "U" gnus-summary-unmark-all-processable | |
1990 "v" gnus-uu-mark-over | |
1991 "s" gnus-uu-mark-series | |
1992 "r" gnus-uu-mark-region | |
1993 "g" gnus-uu-unmark-region | |
1994 "R" gnus-uu-mark-by-regexp | |
1995 "G" gnus-uu-unmark-by-regexp | |
1996 "t" gnus-uu-mark-thread | |
1997 "T" gnus-uu-unmark-thread | |
1998 "a" gnus-uu-mark-all | |
1999 "b" gnus-uu-mark-buffer | |
2000 "S" gnus-uu-mark-sparse | |
2001 "k" gnus-summary-kill-process-mark | |
2002 "y" gnus-summary-yank-process-mark | |
2003 "w" gnus-summary-save-process-mark | |
2004 "i" gnus-uu-invert-processable) | |
2005 | |
2006 (gnus-define-keys (gnus-uu-extract-map "X" gnus-summary-mode-map) | |
2007 ;;"x" gnus-uu-extract-any | |
2008 "m" gnus-summary-save-parts | |
2009 "u" gnus-uu-decode-uu | |
2010 "U" gnus-uu-decode-uu-and-save | |
2011 "s" gnus-uu-decode-unshar | |
2012 "S" gnus-uu-decode-unshar-and-save | |
2013 "o" gnus-uu-decode-save | |
2014 "O" gnus-uu-decode-save | |
2015 "b" gnus-uu-decode-binhex | |
2016 "B" gnus-uu-decode-binhex | |
2017 "p" gnus-uu-decode-postscript | |
2018 "P" gnus-uu-decode-postscript-and-save) | |
2019 | |
2020 (gnus-define-keys | |
2021 (gnus-uu-extract-view-map "v" gnus-uu-extract-map) | |
2022 "u" gnus-uu-decode-uu-view | |
2023 "U" gnus-uu-decode-uu-and-save-view | |
2024 "s" gnus-uu-decode-unshar-view | |
2025 "S" gnus-uu-decode-unshar-and-save-view | |
2026 "o" gnus-uu-decode-save-view | |
2027 "O" gnus-uu-decode-save-view | |
2028 "b" gnus-uu-decode-binhex-view | |
2029 "B" gnus-uu-decode-binhex-view | |
2030 "p" gnus-uu-decode-postscript-view | |
2031 "P" gnus-uu-decode-postscript-and-save-view) | |
2032 | |
2033 (defvar gnus-article-post-menu nil) | |
2034 | |
2035 (defconst gnus-summary-menu-maxlen 20) | |
2036 | |
2037 (defun gnus-summary-menu-split (menu) | |
2038 ;; If we have lots of elements, divide them into groups of 20 | |
2039 ;; and make a pane (or submenu) for each one. | |
2040 (if (> (length menu) (/ (* gnus-summary-menu-maxlen 3) 2)) | |
2041 (let ((menu menu) sublists next | |
2042 (i 1)) | |
2043 (while menu | |
2044 ;; Pull off the next gnus-summary-menu-maxlen elements | |
2045 ;; and make them the next element of sublist. | |
2046 (setq next (nthcdr gnus-summary-menu-maxlen menu)) | |
2047 (if next | |
2048 (setcdr (nthcdr (1- gnus-summary-menu-maxlen) menu) | |
2049 nil)) | |
2050 (setq sublists (cons (cons (format "%s ... %s" (aref (car menu) 0) | |
2051 (aref (car (last menu)) 0)) menu) | |
2052 sublists)) | |
2053 (setq i (1+ i)) | |
2054 (setq menu next)) | |
2055 (nreverse sublists)) | |
2056 ;; Few elements--put them all in one pane. | |
2057 menu)) | |
1669 | 2058 |
1670 (defun gnus-summary-make-menu-bar () | 2059 (defun gnus-summary-make-menu-bar () |
1671 (gnus-turn-off-edit-menu 'summary) | 2060 (gnus-turn-off-edit-menu 'summary) |
1672 | 2061 |
1673 (unless (boundp 'gnus-summary-misc-menu) | 2062 (unless (boundp 'gnus-summary-misc-menu) |
1674 | 2063 |
1675 (easy-menu-define | 2064 (easy-menu-define |
1676 gnus-summary-kill-menu gnus-summary-mode-map "" | 2065 gnus-summary-kill-menu gnus-summary-mode-map "" |
1677 (cons | 2066 (cons |
1678 "Score" | 2067 "Score" |
1679 (nconc | 2068 (nconc |
1680 (list | 2069 (list |
1681 ["Enter score..." gnus-summary-score-entry t] | 2070 ["Customize" gnus-score-customize t]) |
1682 ["Customize" gnus-score-customize t]) | 2071 (gnus-make-score-map 'increase) |
1683 (gnus-make-score-map 'increase) | 2072 (gnus-make-score-map 'lower) |
1684 (gnus-make-score-map 'lower) | 2073 '(("Mark" |
1685 '(("Mark" | 2074 ["Kill below" gnus-summary-kill-below t] |
1686 ["Kill below" gnus-summary-kill-below t] | 2075 ["Mark above" gnus-summary-mark-above t] |
1687 ["Mark above" gnus-summary-mark-above t] | 2076 ["Tick above" gnus-summary-tick-above t] |
1688 ["Tick above" gnus-summary-tick-above t] | 2077 ["Clear above" gnus-summary-clear-above t]) |
1689 ["Clear above" gnus-summary-clear-above t]) | 2078 ["Current score" gnus-summary-current-score t] |
1690 ["Current score" gnus-summary-current-score t] | 2079 ["Set score" gnus-summary-set-score t] |
1691 ["Set score" gnus-summary-set-score t] | 2080 ["Switch current score file..." gnus-score-change-score-file t] |
1692 ["Switch current score file..." gnus-score-change-score-file t] | 2081 ["Set mark below..." gnus-score-set-mark-below t] |
1693 ["Set mark below..." gnus-score-set-mark-below t] | 2082 ["Set expunge below..." gnus-score-set-expunge-below t] |
1694 ["Set expunge below..." gnus-score-set-expunge-below t] | 2083 ["Edit current score file" gnus-score-edit-current-scores t] |
1695 ["Edit current score file" gnus-score-edit-current-scores t] | 2084 ["Edit score file" gnus-score-edit-file t] |
1696 ["Edit score file" gnus-score-edit-file t] | 2085 ["Trace score" gnus-score-find-trace t] |
1697 ["Trace score" gnus-score-find-trace t] | 2086 ["Find words" gnus-score-find-favourite-words t] |
1698 ["Find words" gnus-score-find-favourite-words t] | 2087 ["Rescore buffer" gnus-summary-rescore t] |
1699 ["Rescore buffer" gnus-summary-rescore t] | 2088 ["Increase score..." gnus-summary-increase-score t] |
1700 ["Increase score..." gnus-summary-increase-score t] | 2089 ["Lower score..." gnus-summary-lower-score t])))) |
1701 ["Lower score..." gnus-summary-lower-score t])))) | 2090 |
1702 | 2091 ;; Define both the Article menu in the summary buffer and the |
1703 ;; Define both the Article menu in the summary buffer and the equivalent | 2092 ;; equivalent Commands menu in the article buffer here for |
1704 ;; Commands menu in the article buffer here for consistency. | 2093 ;; consistency. |
1705 (let ((innards | 2094 (let ((innards |
1706 '(("Hide" | 2095 `(("Hide" |
1707 ["All" gnus-article-hide t] | 2096 ["All" gnus-article-hide t] |
1708 ["Headers" gnus-article-hide-headers t] | 2097 ["Headers" gnus-article-hide-headers t] |
1709 ["Signature" gnus-article-hide-signature t] | 2098 ["Signature" gnus-article-hide-signature t] |
1710 ["Citation" gnus-article-hide-citation t] | 2099 ["Citation" gnus-article-hide-citation t] |
1711 ["List identifiers" gnus-article-hide-list-identifiers t] | 2100 ["List identifiers" gnus-article-hide-list-identifiers t] |
1712 ["PGP" gnus-article-hide-pgp t] | |
1713 ["Banner" gnus-article-strip-banner t] | 2101 ["Banner" gnus-article-strip-banner t] |
1714 ["Boring headers" gnus-article-hide-boring-headers t]) | 2102 ["Boring headers" gnus-article-hide-boring-headers t]) |
1715 ("Highlight" | 2103 ("Highlight" |
1716 ["All" gnus-article-highlight t] | 2104 ["All" gnus-article-highlight t] |
1717 ["Headers" gnus-article-highlight-headers t] | 2105 ["Headers" gnus-article-highlight-headers t] |
1718 ["Signature" gnus-article-highlight-signature t] | 2106 ["Signature" gnus-article-highlight-signature t] |
1719 ["Citation" gnus-article-highlight-citation t]) | 2107 ["Citation" gnus-article-highlight-citation t]) |
1720 ("MIME" | 2108 ("MIME" |
1721 ["Words" gnus-article-decode-mime-words t] | 2109 ["Words" gnus-article-decode-mime-words t] |
1722 ["Charset" gnus-article-decode-charset t] | 2110 ["Charset" gnus-article-decode-charset t] |
1723 ["QP" gnus-article-de-quoted-unreadable t] | 2111 ["QP" gnus-article-de-quoted-unreadable t] |
1724 ["Base64" gnus-article-de-base64-unreadable t] | 2112 ["Base64" gnus-article-de-base64-unreadable t] |
1725 ["View all" gnus-mime-view-all-parts t]) | 2113 ["View MIME buttons" gnus-summary-display-buttonized t] |
1726 ("Date" | 2114 ["View all" gnus-mime-view-all-parts t] |
1727 ["Local" gnus-article-date-local t] | 2115 ["Verify and Decrypt" gnus-summary-force-verify-and-decrypt t] |
1728 ["ISO8601" gnus-article-date-iso8601 t] | 2116 ["Encrypt body" gnus-article-encrypt-body |
1729 ["UT" gnus-article-date-ut t] | 2117 :active (not (gnus-group-read-only-p)) |
1730 ["Original" gnus-article-date-original t] | 2118 ,@(if (featurep 'xemacs) nil |
1731 ["Lapsed" gnus-article-date-lapsed t] | 2119 '(:help "Encrypt the message body on disk"))] |
1732 ["User-defined" gnus-article-date-user t]) | 2120 ["Extract all parts..." gnus-summary-save-parts t] |
1733 ("Washing" | 2121 ("Multipart" |
1734 ("Remove Blanks" | 2122 ["Repair multipart" gnus-summary-repair-multipart t] |
1735 ["Leading" gnus-article-strip-leading-blank-lines t] | 2123 ["Pipe part..." gnus-article-pipe-part t] |
1736 ["Multiple" gnus-article-strip-multiple-blank-lines t] | 2124 ["Inline part" gnus-article-inline-part t] |
1737 ["Trailing" gnus-article-remove-trailing-blank-lines t] | 2125 ["Encrypt body" gnus-article-encrypt-body |
1738 ["All of the above" gnus-article-strip-blank-lines t] | 2126 :active (not (gnus-group-read-only-p)) |
1739 ["All" gnus-article-strip-all-blank-lines t] | 2127 ,@(if (featurep 'xemacs) nil |
1740 ["Leading space" gnus-article-strip-leading-space t] | 2128 '(:help "Encrypt the message body on disk"))] |
1741 ["Trailing space" gnus-article-strip-trailing-space t]) | 2129 ["View part externally" gnus-article-view-part-externally t] |
1742 ["Overstrike" gnus-article-treat-overstrike t] | 2130 ["View part with charset..." gnus-article-view-part-as-charset t] |
1743 ["Dumb quotes" gnus-article-treat-dumbquotes t] | 2131 ["Copy part" gnus-article-copy-part t] |
1744 ["Emphasis" gnus-article-emphasize t] | 2132 ["Save part..." gnus-article-save-part t] |
1745 ["Word wrap" gnus-article-fill-cited-article t] | 2133 ["View part" gnus-article-view-part t])) |
2134 ("Date" | |
2135 ["Local" gnus-article-date-local t] | |
2136 ["ISO8601" gnus-article-date-iso8601 t] | |
2137 ["UT" gnus-article-date-ut t] | |
2138 ["Original" gnus-article-date-original t] | |
2139 ["Lapsed" gnus-article-date-lapsed t] | |
2140 ["User-defined" gnus-article-date-user t]) | |
2141 ("Display" | |
2142 ["Remove images" gnus-article-remove-images t] | |
2143 ["Toggle smiley" gnus-treat-smiley t] | |
2144 ["Show X-Face" gnus-article-display-x-face t] | |
2145 ["Show picons in From" gnus-treat-from-picon t] | |
2146 ["Show picons in mail headers" gnus-treat-mail-picon t] | |
2147 ["Show picons in news headers" gnus-treat-newsgroups-picon t] | |
2148 ("View as different encoding" | |
2149 ,@(gnus-summary-menu-split | |
2150 (mapcar | |
2151 (lambda (cs) | |
2152 ;; Since easymenu under Emacs doesn't allow | |
2153 ;; lambda forms for menu commands, we should | |
2154 ;; provide intern'ed function symbols. | |
2155 (let ((command (intern (format "\ | |
2156 gnus-summary-show-article-from-menu-as-charset-%s" cs)))) | |
2157 (fset command | |
2158 `(lambda () | |
2159 (interactive) | |
2160 (let ((gnus-summary-show-article-charset-alist | |
2161 '((1 . ,cs)))) | |
2162 (gnus-summary-show-article 1)))) | |
2163 `[,(symbol-name cs) ,command t])) | |
2164 (sort (if (fboundp 'coding-system-list) | |
2165 (coding-system-list) | |
2166 (mapcar 'car mm-mime-mule-charset-alist)) | |
2167 'string<))))) | |
2168 ("Washing" | |
2169 ("Remove Blanks" | |
2170 ["Leading" gnus-article-strip-leading-blank-lines t] | |
2171 ["Multiple" gnus-article-strip-multiple-blank-lines t] | |
2172 ["Trailing" gnus-article-remove-trailing-blank-lines t] | |
2173 ["All of the above" gnus-article-strip-blank-lines t] | |
2174 ["All" gnus-article-strip-all-blank-lines t] | |
2175 ["Leading space" gnus-article-strip-leading-space t] | |
2176 ["Trailing space" gnus-article-strip-trailing-space t] | |
2177 ["Leading space in headers" | |
2178 gnus-article-remove-leading-whitespace t]) | |
2179 ["Overstrike" gnus-article-treat-overstrike t] | |
2180 ["Dumb quotes" gnus-article-treat-dumbquotes t] | |
2181 ["Emphasis" gnus-article-emphasize t] | |
2182 ["Word wrap" gnus-article-fill-cited-article t] | |
1746 ["Fill long lines" gnus-article-fill-long-lines t] | 2183 ["Fill long lines" gnus-article-fill-long-lines t] |
1747 ["Capitalize sentences" gnus-article-capitalize-sentences t] | 2184 ["Capitalize sentences" gnus-article-capitalize-sentences t] |
1748 ["CR" gnus-article-remove-cr t] | 2185 ["Remove CR" gnus-article-remove-cr t] |
1749 ["Show X-Face" gnus-article-display-x-face t] | 2186 ["Quoted-Printable" gnus-article-de-quoted-unreadable t] |
1750 ["Quoted-Printable" gnus-article-de-quoted-unreadable t] | 2187 ["Base64" gnus-article-de-base64-unreadable t] |
1751 ["Base64" gnus-article-de-base64-unreadable t] | 2188 ["Rot 13" gnus-summary-caesar-message |
1752 ["Rot 13" gnus-summary-caesar-message | 2189 ,@(if (featurep 'xemacs) '(t) |
1753 :help "\"Caesar rotate\" article by 13"] | 2190 '(:help "\"Caesar rotate\" article by 13"))] |
1754 ["Unix pipe" gnus-summary-pipe-message t] | 2191 ["Morse decode" gnus-summary-morse-message t] |
1755 ["Add buttons" gnus-article-add-buttons t] | 2192 ["Unix pipe..." gnus-summary-pipe-message t] |
1756 ["Add buttons to head" gnus-article-add-buttons-to-head t] | 2193 ["Add buttons" gnus-article-add-buttons t] |
1757 ["Stop page breaking" gnus-summary-stop-page-breaking t] | 2194 ["Add buttons to head" gnus-article-add-buttons-to-head t] |
1758 ["Verbose header" gnus-summary-verbose-headers t] | 2195 ["Stop page breaking" gnus-summary-stop-page-breaking t] |
1759 ["Toggle header" gnus-summary-toggle-header t] | 2196 ["Verbose header" gnus-summary-verbose-headers t] |
2197 ["Toggle header" gnus-summary-toggle-header t] | |
2198 ["Unfold headers" gnus-article-treat-unfold-headers t] | |
2199 ["Fold newsgroups" gnus-article-treat-fold-newsgroups t] | |
1760 ["Html" gnus-article-wash-html t] | 2200 ["Html" gnus-article-wash-html t] |
1761 ["HZ" gnus-article-decode-HZ t]) | 2201 ["Unsplit URLs" gnus-article-unsplit-urls t] |
1762 ("Output" | 2202 ["Verify X-PGP-Sig" gnus-article-verify-x-pgp-sig t] |
1763 ["Save in default format" gnus-summary-save-article | 2203 ["Decode HZ" gnus-article-decode-HZ t] |
1764 :help "Save article using default method"] | 2204 ("(Outlook) Deuglify" |
1765 ["Save in file" gnus-summary-save-article-file | 2205 ["Unwrap lines" gnus-article-outlook-unwrap-lines t] |
1766 :help "Save article in file"] | 2206 ["Repair attribution" gnus-article-outlook-repair-attribution t] |
1767 ["Save in Unix mail format" gnus-summary-save-article-mail t] | 2207 ["Rearrange citation" gnus-article-outlook-rearrange-citation t] |
1768 ["Save in MH folder" gnus-summary-save-article-folder t] | 2208 ["Full (Outlook) deuglify" |
1769 ["Save in VM folder" gnus-summary-save-article-vm t] | 2209 gnus-article-outlook-deuglify-article t]) |
1770 ["Save in RMAIL mbox" gnus-summary-save-article-rmail t] | 2210 ) |
1771 ["Save body in file" gnus-summary-save-article-body-file t] | 2211 ("Output" |
1772 ["Pipe through a filter" gnus-summary-pipe-output t] | 2212 ["Save in default format..." gnus-summary-save-article |
1773 ["Add to SOUP packet" gnus-soup-add-article t] | 2213 ,@(if (featurep 'xemacs) '(t) |
1774 ["Print" gnus-summary-print-article t]) | 2214 '(:help "Save article using default method"))] |
1775 ("Backend" | 2215 ["Save in file..." gnus-summary-save-article-file |
1776 ["Respool article..." gnus-summary-respool-article t] | 2216 ,@(if (featurep 'xemacs) '(t) |
1777 ["Move article..." gnus-summary-move-article | 2217 '(:help "Save article in file"))] |
1778 (gnus-check-backend-function | 2218 ["Save in Unix mail format..." gnus-summary-save-article-mail t] |
1779 'request-move-article gnus-newsgroup-name)] | 2219 ["Save in MH folder..." gnus-summary-save-article-folder t] |
1780 ["Copy article..." gnus-summary-copy-article t] | 2220 ["Save in VM folder..." gnus-summary-save-article-vm t] |
1781 ["Crosspost article..." gnus-summary-crosspost-article | 2221 ["Save in RMAIL mbox..." gnus-summary-save-article-rmail t] |
1782 (gnus-check-backend-function | 2222 ["Save body in file..." gnus-summary-save-article-body-file t] |
1783 'request-replace-article gnus-newsgroup-name)] | 2223 ["Pipe through a filter..." gnus-summary-pipe-output t] |
1784 ["Import file..." gnus-summary-import-article t] | 2224 ["Add to SOUP packet" gnus-soup-add-article t] |
1785 ["Check if posted" gnus-summary-article-posted-p t] | 2225 ["Print with Muttprint..." gnus-summary-muttprint t] |
1786 ["Edit article" gnus-summary-edit-article | 2226 ["Print" gnus-summary-print-article t]) |
1787 (not (gnus-group-read-only-p))] | 2227 ("Backend" |
1788 ["Delete article" gnus-summary-delete-article | 2228 ["Respool article..." gnus-summary-respool-article t] |
1789 (gnus-check-backend-function | 2229 ["Move article..." gnus-summary-move-article |
1790 'request-expire-articles gnus-newsgroup-name)] | 2230 (gnus-check-backend-function |
1791 ["Query respool" gnus-summary-respool-query t] | 2231 'request-move-article gnus-newsgroup-name)] |
2232 ["Copy article..." gnus-summary-copy-article t] | |
2233 ["Crosspost article..." gnus-summary-crosspost-article | |
2234 (gnus-check-backend-function | |
2235 'request-replace-article gnus-newsgroup-name)] | |
2236 ["Import file..." gnus-summary-import-article | |
2237 (gnus-check-backend-function | |
2238 'request-accept-article gnus-newsgroup-name)] | |
2239 ["Create article..." gnus-summary-create-article | |
2240 (gnus-check-backend-function | |
2241 'request-accept-article gnus-newsgroup-name)] | |
2242 ["Check if posted" gnus-summary-article-posted-p t] | |
2243 ["Edit article" gnus-summary-edit-article | |
2244 (not (gnus-group-read-only-p))] | |
2245 ["Delete article" gnus-summary-delete-article | |
2246 (gnus-check-backend-function | |
2247 'request-expire-articles gnus-newsgroup-name)] | |
2248 ["Query respool" gnus-summary-respool-query t] | |
1792 ["Trace respool" gnus-summary-respool-trace t] | 2249 ["Trace respool" gnus-summary-respool-trace t] |
1793 ["Delete expirable articles" gnus-summary-expire-articles-now | 2250 ["Delete expirable articles" gnus-summary-expire-articles-now |
1794 (gnus-check-backend-function | 2251 (gnus-check-backend-function |
1795 'request-expire-articles gnus-newsgroup-name)]) | 2252 'request-expire-articles gnus-newsgroup-name)]) |
1796 ("Extract" | 2253 ("Extract" |
1797 ["Uudecode" gnus-uu-decode-uu | 2254 ["Uudecode" gnus-uu-decode-uu |
1798 :help "Decode uuencoded article(s)"] | 2255 ,@(if (featurep 'xemacs) '(t) |
1799 ["Uudecode and save" gnus-uu-decode-uu-and-save t] | 2256 '(:help "Decode uuencoded article(s)"))] |
1800 ["Unshar" gnus-uu-decode-unshar t] | 2257 ["Uudecode and save" gnus-uu-decode-uu-and-save t] |
1801 ["Unshar and save" gnus-uu-decode-unshar-and-save t] | 2258 ["Unshar" gnus-uu-decode-unshar t] |
1802 ["Save" gnus-uu-decode-save t] | 2259 ["Unshar and save" gnus-uu-decode-unshar-and-save t] |
1803 ["Binhex" gnus-uu-decode-binhex t] | 2260 ["Save" gnus-uu-decode-save t] |
1804 ["Postscript" gnus-uu-decode-postscript t]) | 2261 ["Binhex" gnus-uu-decode-binhex t] |
1805 ("Cache" | 2262 ["Postscript" gnus-uu-decode-postscript t] |
1806 ["Enter article" gnus-cache-enter-article t] | 2263 ["All MIME parts" gnus-summary-save-parts t]) |
1807 ["Remove article" gnus-cache-remove-article t]) | 2264 ("Cache" |
2265 ["Enter article" gnus-cache-enter-article t] | |
2266 ["Remove article" gnus-cache-remove-article t]) | |
1808 ["Translate" gnus-article-babel t] | 2267 ["Translate" gnus-article-babel t] |
1809 ["Select article buffer" gnus-summary-select-article-buffer t] | 2268 ["Select article buffer" gnus-summary-select-article-buffer t] |
1810 ["Enter digest buffer" gnus-summary-enter-digest-group t] | 2269 ["Enter digest buffer" gnus-summary-enter-digest-group t] |
1811 ["Isearch article..." gnus-summary-isearch-article t] | 2270 ["Isearch article..." gnus-summary-isearch-article t] |
1812 ["Beginning of the article" gnus-summary-beginning-of-article t] | 2271 ["Beginning of the article" gnus-summary-beginning-of-article t] |
1813 ["End of the article" gnus-summary-end-of-article t] | 2272 ["End of the article" gnus-summary-end-of-article t] |
1814 ["Fetch parent of article" gnus-summary-refer-parent-article t] | 2273 ["Fetch parent of article" gnus-summary-refer-parent-article t] |
1815 ["Fetch referenced articles" gnus-summary-refer-references t] | 2274 ["Fetch referenced articles" gnus-summary-refer-references t] |
1816 ["Fetch current thread" gnus-summary-refer-thread t] | 2275 ["Fetch current thread" gnus-summary-refer-thread t] |
1817 ["Fetch article with id..." gnus-summary-refer-article t] | 2276 ["Fetch article with id..." gnus-summary-refer-article t] |
1818 ["Redisplay" gnus-summary-show-article t]))) | 2277 ["Setup Mailing List Params" gnus-mailing-list-insinuate t] |
2278 ["Redisplay" gnus-summary-show-article t] | |
2279 ["Raw article" gnus-summary-show-raw-article :keys "C-u g"]))) | |
1819 (easy-menu-define | 2280 (easy-menu-define |
1820 gnus-summary-article-menu gnus-summary-mode-map "" | 2281 gnus-summary-article-menu gnus-summary-mode-map "" |
1821 (cons "Article" innards)) | 2282 (cons "Article" innards)) |
1822 | 2283 |
1823 (if (not (keymapp gnus-summary-article-menu)) | 2284 (if (not (keymapp gnus-summary-article-menu)) |
1824 (easy-menu-define | 2285 (easy-menu-define |
1825 gnus-article-commands-menu gnus-article-mode-map "" | 2286 gnus-article-commands-menu gnus-article-mode-map "" |
1826 (cons "Commands" innards)) | 2287 (cons "Commands" innards)) |
1829 (copy-keymap gnus-summary-article-menu)) | 2290 (copy-keymap gnus-summary-article-menu)) |
1830 (define-key gnus-article-mode-map [menu-bar commands] | 2291 (define-key gnus-article-mode-map [menu-bar commands] |
1831 (cons "Commands" gnus-article-commands-menu)))) | 2292 (cons "Commands" gnus-article-commands-menu)))) |
1832 | 2293 |
1833 (easy-menu-define | 2294 (easy-menu-define |
1834 gnus-summary-thread-menu gnus-summary-mode-map "" | 2295 gnus-summary-thread-menu gnus-summary-mode-map "" |
1835 '("Threads" | 2296 '("Threads" |
1836 ["Toggle threading" gnus-summary-toggle-threads t] | 2297 ["Find all messages in thread" gnus-summary-refer-thread t] |
1837 ["Hide threads" gnus-summary-hide-all-threads t] | 2298 ["Toggle threading" gnus-summary-toggle-threads t] |
1838 ["Show threads" gnus-summary-show-all-threads t] | 2299 ["Hide threads" gnus-summary-hide-all-threads t] |
1839 ["Hide thread" gnus-summary-hide-thread t] | 2300 ["Show threads" gnus-summary-show-all-threads t] |
1840 ["Show thread" gnus-summary-show-thread t] | 2301 ["Hide thread" gnus-summary-hide-thread t] |
1841 ["Go to next thread" gnus-summary-next-thread t] | 2302 ["Show thread" gnus-summary-show-thread t] |
1842 ["Go to previous thread" gnus-summary-prev-thread t] | 2303 ["Go to next thread" gnus-summary-next-thread t] |
1843 ["Go down thread" gnus-summary-down-thread t] | 2304 ["Go to previous thread" gnus-summary-prev-thread t] |
1844 ["Go up thread" gnus-summary-up-thread t] | 2305 ["Go down thread" gnus-summary-down-thread t] |
1845 ["Top of thread" gnus-summary-top-thread t] | 2306 ["Go up thread" gnus-summary-up-thread t] |
1846 ["Mark thread as read" gnus-summary-kill-thread t] | 2307 ["Top of thread" gnus-summary-top-thread t] |
1847 ["Lower thread score" gnus-summary-lower-thread t] | 2308 ["Mark thread as read" gnus-summary-kill-thread t] |
1848 ["Raise thread score" gnus-summary-raise-thread t] | 2309 ["Lower thread score" gnus-summary-lower-thread t] |
1849 ["Rethread current" gnus-summary-rethread-current t])) | 2310 ["Raise thread score" gnus-summary-raise-thread t] |
2311 ["Rethread current" gnus-summary-rethread-current t])) | |
1850 | 2312 |
1851 (easy-menu-define | 2313 (easy-menu-define |
1852 gnus-summary-post-menu gnus-summary-mode-map "" | 2314 gnus-summary-post-menu gnus-summary-mode-map "" |
1853 '("Post" | 2315 `("Post" |
1854 ["Post an article" gnus-summary-post-news | 2316 ["Send a message (mail or news)" gnus-summary-post-news |
1855 :help "Post an article"] | 2317 ,@(if (featurep 'xemacs) '(t) |
1856 ["Followup" gnus-summary-followup | 2318 '(:help "Post an article"))] |
1857 :help "Post followup to this article"] | 2319 ["Followup" gnus-summary-followup |
1858 ["Followup and yank" gnus-summary-followup-with-original | 2320 ,@(if (featurep 'xemacs) '(t) |
1859 :help "Post followup to this article, quoting its contents"] | 2321 '(:help "Post followup to this article"))] |
1860 ["Supersede article" gnus-summary-supersede-article t] | 2322 ["Followup and yank" gnus-summary-followup-with-original |
1861 ["Cancel article" gnus-summary-cancel-article | 2323 ,@(if (featurep 'xemacs) '(t) |
1862 :help "Cancel an article you posted"] | 2324 '(:help "Post followup to this article, quoting its contents"))] |
1863 ["Reply" gnus-summary-reply t] | 2325 ["Supersede article" gnus-summary-supersede-article t] |
1864 ["Reply and yank" gnus-summary-reply-with-original t] | 2326 ["Cancel article" gnus-summary-cancel-article |
1865 ["Wide reply" gnus-summary-wide-reply t] | 2327 ,@(if (featurep 'xemacs) '(t) |
1866 ["Wide reply and yank" gnus-summary-wide-reply-with-original | 2328 '(:help "Cancel an article you posted"))] |
1867 :help "Mail a reply, quoting this article"] | 2329 ["Reply" gnus-summary-reply t] |
1868 ["Mail forward" gnus-summary-mail-forward t] | 2330 ["Reply and yank" gnus-summary-reply-with-original t] |
1869 ["Post forward" gnus-summary-post-forward t] | 2331 ["Wide reply" gnus-summary-wide-reply t] |
1870 ["Digest and mail" gnus-uu-digest-mail-forward t] | 2332 ["Wide reply and yank" gnus-summary-wide-reply-with-original |
1871 ["Digest and post" gnus-uu-digest-post-forward t] | 2333 ,@(if (featurep 'xemacs) '(t) |
1872 ["Resend message" gnus-summary-resend-message t] | 2334 '(:help "Mail a reply, quoting this article"))] |
1873 ["Send bounced mail" gnus-summary-resend-bounced-mail t] | 2335 ["Very wide reply" gnus-summary-very-wide-reply t] |
1874 ["Send a mail" gnus-summary-mail-other-window t] | 2336 ["Very wide reply and yank" gnus-summary-very-wide-reply-with-original |
1875 ["Uuencode and post" gnus-uu-post-news | 2337 ,@(if (featurep 'xemacs) '(t) |
1876 :help "Post a uuencoded article"] | 2338 '(:help "Mail a very wide reply, quoting this article"))] |
1877 ["Followup via news" gnus-summary-followup-to-mail t] | 2339 ["Mail forward" gnus-summary-mail-forward t] |
1878 ["Followup via news and yank" | 2340 ["Post forward" gnus-summary-post-forward t] |
1879 gnus-summary-followup-to-mail-with-original t] | 2341 ["Digest and mail" gnus-uu-digest-mail-forward t] |
1880 ;;("Draft" | 2342 ["Digest and post" gnus-uu-digest-post-forward t] |
1881 ;;["Send" gnus-summary-send-draft t] | 2343 ["Resend message" gnus-summary-resend-message t] |
1882 ;;["Send bounced" gnus-resend-bounced-mail t]) | 2344 ["Resend message edit" gnus-summary-resend-message-edit t] |
1883 )) | 2345 ["Send bounced mail" gnus-summary-resend-bounced-mail t] |
2346 ["Send a mail" gnus-summary-mail-other-window t] | |
2347 ["Create a local message" gnus-summary-news-other-window t] | |
2348 ["Uuencode and post" gnus-uu-post-news | |
2349 ,@(if (featurep 'xemacs) '(t) | |
2350 '(:help "Post a uuencoded article"))] | |
2351 ["Followup via news" gnus-summary-followup-to-mail t] | |
2352 ["Followup via news and yank" | |
2353 gnus-summary-followup-to-mail-with-original t] | |
2354 ;;("Draft" | |
2355 ;;["Send" gnus-summary-send-draft t] | |
2356 ;;["Send bounced" gnus-resend-bounced-mail t]) | |
2357 )) | |
2358 | |
2359 (cond | |
2360 ((not (keymapp gnus-summary-post-menu)) | |
2361 (setq gnus-article-post-menu gnus-summary-post-menu)) | |
2362 ((not gnus-article-post-menu) | |
2363 ;; Don't share post menu. | |
2364 (setq gnus-article-post-menu | |
2365 (copy-keymap gnus-summary-post-menu)))) | |
2366 (define-key gnus-article-mode-map [menu-bar post] | |
2367 (cons "Post" gnus-article-post-menu)) | |
1884 | 2368 |
1885 (easy-menu-define | 2369 (easy-menu-define |
1886 gnus-summary-misc-menu gnus-summary-mode-map "" | 2370 gnus-summary-misc-menu gnus-summary-mode-map "" |
1887 '("Misc" | 2371 `("Gnus" |
1888 ("Mark Read" | 2372 ("Mark Read" |
1889 ["Mark as read" gnus-summary-mark-as-read-forward t] | 2373 ["Mark as read" gnus-summary-mark-as-read-forward t] |
1890 ["Mark same subject and select" | 2374 ["Mark same subject and select" |
1891 gnus-summary-kill-same-subject-and-select t] | 2375 gnus-summary-kill-same-subject-and-select t] |
1892 ["Mark same subject" gnus-summary-kill-same-subject t] | 2376 ["Mark same subject" gnus-summary-kill-same-subject t] |
1893 ["Catchup" gnus-summary-catchup | 2377 ["Catchup" gnus-summary-catchup |
1894 :help "Mark unread articles in this group as read"] | 2378 ,@(if (featurep 'xemacs) '(t) |
1895 ["Catchup all" gnus-summary-catchup-all t] | 2379 '(:help "Mark unread articles in this group as read"))] |
1896 ["Catchup to here" gnus-summary-catchup-to-here t] | 2380 ["Catchup all" gnus-summary-catchup-all t] |
1897 ["Catchup region" gnus-summary-mark-region-as-read t] | 2381 ["Catchup to here" gnus-summary-catchup-to-here t] |
1898 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t]) | 2382 ["Catchup from here" gnus-summary-catchup-from-here t] |
1899 ("Mark Various" | 2383 ["Catchup region" gnus-summary-mark-region-as-read |
1900 ["Tick" gnus-summary-tick-article-forward t] | 2384 (gnus-mark-active-p)] |
1901 ["Mark as dormant" gnus-summary-mark-as-dormant t] | 2385 ["Mark excluded" gnus-summary-limit-mark-excluded-as-read t]) |
1902 ["Remove marks" gnus-summary-clear-mark-forward t] | 2386 ("Mark Various" |
1903 ["Set expirable mark" gnus-summary-mark-as-expirable t] | 2387 ["Tick" gnus-summary-tick-article-forward t] |
1904 ["Set bookmark" gnus-summary-set-bookmark t] | 2388 ["Mark as dormant" gnus-summary-mark-as-dormant t] |
1905 ["Remove bookmark" gnus-summary-remove-bookmark t]) | 2389 ["Remove marks" gnus-summary-clear-mark-forward t] |
1906 ("Mark Limit" | 2390 ["Set expirable mark" gnus-summary-mark-as-expirable t] |
1907 ["Marks..." gnus-summary-limit-to-marks t] | 2391 ["Set bookmark" gnus-summary-set-bookmark t] |
1908 ["Subject..." gnus-summary-limit-to-subject t] | 2392 ["Remove bookmark" gnus-summary-remove-bookmark t]) |
1909 ["Author..." gnus-summary-limit-to-author t] | 2393 ("Limit to" |
1910 ["Age..." gnus-summary-limit-to-age t] | 2394 ["Marks..." gnus-summary-limit-to-marks t] |
1911 ["Extra..." gnus-summary-limit-to-extra t] | 2395 ["Subject..." gnus-summary-limit-to-subject t] |
1912 ["Score" gnus-summary-limit-to-score t] | 2396 ["Author..." gnus-summary-limit-to-author t] |
1913 ["Unread" gnus-summary-limit-to-unread t] | 2397 ["Age..." gnus-summary-limit-to-age t] |
1914 ["Non-dormant" gnus-summary-limit-exclude-dormant t] | 2398 ["Extra..." gnus-summary-limit-to-extra t] |
1915 ["Articles" gnus-summary-limit-to-articles t] | 2399 ["Score..." gnus-summary-limit-to-score t] |
1916 ["Pop limit" gnus-summary-pop-limit t] | 2400 ["Display Predicate" gnus-summary-limit-to-display-predicate t] |
1917 ["Show dormant" gnus-summary-limit-include-dormant t] | 2401 ["Unread" gnus-summary-limit-to-unread t] |
1918 ["Hide childless dormant" | 2402 ["Unseen" gnus-summary-limit-to-unseen t] |
1919 gnus-summary-limit-exclude-childless-dormant t] | 2403 ["Non-dormant" gnus-summary-limit-exclude-dormant t] |
1920 ;;["Hide thread" gnus-summary-limit-exclude-thread t] | 2404 ["Next articles" gnus-summary-limit-to-articles t] |
1921 ["Hide marked" gnus-summary-limit-exclude-marks t] | 2405 ["Pop limit" gnus-summary-pop-limit t] |
1922 ["Show expunged" gnus-summary-show-all-expunged t]) | 2406 ["Show dormant" gnus-summary-limit-include-dormant t] |
1923 ("Process Mark" | 2407 ["Hide childless dormant" |
1924 ["Set mark" gnus-summary-mark-as-processable t] | 2408 gnus-summary-limit-exclude-childless-dormant t] |
1925 ["Remove mark" gnus-summary-unmark-as-processable t] | 2409 ;;["Hide thread" gnus-summary-limit-exclude-thread t] |
1926 ["Remove all marks" gnus-summary-unmark-all-processable t] | 2410 ["Hide marked" gnus-summary-limit-exclude-marks t] |
1927 ["Mark above" gnus-uu-mark-over t] | 2411 ["Show expunged" gnus-summary-limit-include-expunged t]) |
1928 ["Mark series" gnus-uu-mark-series t] | 2412 ("Process Mark" |
1929 ["Mark region" gnus-uu-mark-region t] | 2413 ["Set mark" gnus-summary-mark-as-processable t] |
1930 ["Unmark region" gnus-uu-unmark-region t] | 2414 ["Remove mark" gnus-summary-unmark-as-processable t] |
1931 ["Mark by regexp..." gnus-uu-mark-by-regexp t] | 2415 ["Remove all marks" gnus-summary-unmark-all-processable t] |
1932 ["Unmark by regexp..." gnus-uu-unmark-by-regexp t] | 2416 ["Mark above" gnus-uu-mark-over t] |
1933 ["Mark all" gnus-uu-mark-all t] | 2417 ["Mark series" gnus-uu-mark-series t] |
1934 ["Mark buffer" gnus-uu-mark-buffer t] | 2418 ["Mark region" gnus-uu-mark-region (gnus-mark-active-p)] |
1935 ["Mark sparse" gnus-uu-mark-sparse t] | 2419 ["Unmark region" gnus-uu-unmark-region (gnus-mark-active-p)] |
1936 ["Mark thread" gnus-uu-mark-thread t] | 2420 ["Mark by regexp..." gnus-uu-mark-by-regexp t] |
1937 ["Unmark thread" gnus-uu-unmark-thread t] | 2421 ["Unmark by regexp..." gnus-uu-unmark-by-regexp t] |
1938 ("Process Mark Sets" | 2422 ["Mark all" gnus-uu-mark-all t] |
1939 ["Kill" gnus-summary-kill-process-mark t] | 2423 ["Mark buffer" gnus-uu-mark-buffer t] |
1940 ["Yank" gnus-summary-yank-process-mark | 2424 ["Mark sparse" gnus-uu-mark-sparse t] |
1941 gnus-newsgroup-process-stack] | 2425 ["Mark thread" gnus-uu-mark-thread t] |
1942 ["Save" gnus-summary-save-process-mark t])) | 2426 ["Unmark thread" gnus-uu-unmark-thread t] |
1943 ("Scroll article" | 2427 ("Process Mark Sets" |
1944 ["Page forward" gnus-summary-next-page | 2428 ["Kill" gnus-summary-kill-process-mark t] |
1945 :help "Show next page of article"] | 2429 ["Yank" gnus-summary-yank-process-mark |
1946 ["Page backward" gnus-summary-prev-page | 2430 gnus-newsgroup-process-stack] |
1947 :help "Show previous page of article"] | 2431 ["Save" gnus-summary-save-process-mark t] |
1948 ["Line forward" gnus-summary-scroll-up t]) | 2432 ["Run command on marked..." gnus-summary-universal-argument t])) |
1949 ("Move" | 2433 ("Scroll article" |
1950 ["Next unread article" gnus-summary-next-unread-article t] | 2434 ["Page forward" gnus-summary-next-page |
1951 ["Previous unread article" gnus-summary-prev-unread-article t] | 2435 ,@(if (featurep 'xemacs) '(t) |
1952 ["Next article" gnus-summary-next-article t] | 2436 '(:help "Show next page of article"))] |
1953 ["Previous article" gnus-summary-prev-article t] | 2437 ["Page backward" gnus-summary-prev-page |
1954 ["Next unread subject" gnus-summary-next-unread-subject t] | 2438 ,@(if (featurep 'xemacs) '(t) |
1955 ["Previous unread subject" gnus-summary-prev-unread-subject t] | 2439 '(:help "Show previous page of article"))] |
1956 ["Next article same subject" gnus-summary-next-same-subject t] | 2440 ["Line forward" gnus-summary-scroll-up t]) |
1957 ["Previous article same subject" gnus-summary-prev-same-subject t] | 2441 ("Move" |
1958 ["First unread article" gnus-summary-first-unread-article t] | 2442 ["Next unread article" gnus-summary-next-unread-article t] |
1959 ["Best unread article" gnus-summary-best-unread-article t] | 2443 ["Previous unread article" gnus-summary-prev-unread-article t] |
1960 ["Go to subject number..." gnus-summary-goto-subject t] | 2444 ["Next article" gnus-summary-next-article t] |
1961 ["Go to article number..." gnus-summary-goto-article t] | 2445 ["Previous article" gnus-summary-prev-article t] |
1962 ["Go to the last article" gnus-summary-goto-last-article t] | 2446 ["Next unread subject" gnus-summary-next-unread-subject t] |
1963 ["Pop article off history" gnus-summary-pop-article t]) | 2447 ["Previous unread subject" gnus-summary-prev-unread-subject t] |
1964 ("Sort" | 2448 ["Next article same subject" gnus-summary-next-same-subject t] |
1965 ["Sort by number" gnus-summary-sort-by-number t] | 2449 ["Previous article same subject" gnus-summary-prev-same-subject t] |
1966 ["Sort by author" gnus-summary-sort-by-author t] | 2450 ["First unread article" gnus-summary-first-unread-article t] |
1967 ["Sort by subject" gnus-summary-sort-by-subject t] | 2451 ["Best unread article" gnus-summary-best-unread-article t] |
1968 ["Sort by date" gnus-summary-sort-by-date t] | 2452 ["Go to subject number..." gnus-summary-goto-subject t] |
1969 ["Sort by score" gnus-summary-sort-by-score t] | 2453 ["Go to article number..." gnus-summary-goto-article t] |
1970 ["Sort by lines" gnus-summary-sort-by-lines t] | 2454 ["Go to the last article" gnus-summary-goto-last-article t] |
1971 ["Sort by characters" gnus-summary-sort-by-chars t]) | 2455 ["Pop article off history" gnus-summary-pop-article t]) |
1972 ("Help" | 2456 ("Sort" |
1973 ["Fetch group FAQ" gnus-summary-fetch-faq t] | 2457 ["Sort by number" gnus-summary-sort-by-number t] |
1974 ["Describe group" gnus-summary-describe-group t] | 2458 ["Sort by author" gnus-summary-sort-by-author t] |
1975 ["Read manual" gnus-info-find-node t]) | 2459 ["Sort by subject" gnus-summary-sort-by-subject t] |
1976 ("Modes" | 2460 ["Sort by date" gnus-summary-sort-by-date t] |
1977 ["Pick and read" gnus-pick-mode t] | 2461 ["Sort by score" gnus-summary-sort-by-score t] |
1978 ["Binary" gnus-binary-mode t]) | 2462 ["Sort by lines" gnus-summary-sort-by-lines t] |
1979 ("Regeneration" | 2463 ["Sort by characters" gnus-summary-sort-by-chars t] |
1980 ["Regenerate" gnus-summary-prepare t] | 2464 ["Randomize" gnus-summary-sort-by-random t] |
1981 ["Insert cached articles" gnus-summary-insert-cached-articles t] | 2465 ["Original sort" gnus-summary-sort-by-original t]) |
1982 ["Toggle threading" gnus-summary-toggle-threads t]) | 2466 ("Help" |
1983 ["Filter articles..." gnus-summary-execute-command t] | 2467 ["Fetch group FAQ" gnus-summary-fetch-faq t] |
1984 ["Run command on subjects..." gnus-summary-universal-argument t] | 2468 ["Describe group" gnus-summary-describe-group t] |
1985 ["Search articles forward..." gnus-summary-search-article-forward t] | 2469 ["Fetch charter" gnus-group-fetch-charter |
1986 ["Search articles backward..." gnus-summary-search-article-backward t] | 2470 ,@(if (featurep 'xemacs) nil |
1987 ["Toggle line truncation" gnus-summary-toggle-truncation t] | 2471 '(:help "Display the charter of the current group"))] |
1988 ["Expand window" gnus-summary-expand-window t] | 2472 ["Fetch control message" gnus-group-fetch-control |
1989 ["Expire expirable articles" gnus-summary-expire-articles | 2473 ,@(if (featurep 'xemacs) nil |
1990 (gnus-check-backend-function | 2474 '(:help "Display the archived control message for the current group"))] |
1991 'request-expire-articles gnus-newsgroup-name)] | 2475 ["Read manual" gnus-info-find-node t]) |
1992 ["Edit local kill file" gnus-summary-edit-local-kill t] | 2476 ("Modes" |
1993 ["Edit main kill file" gnus-summary-edit-global-kill t] | 2477 ["Pick and read" gnus-pick-mode t] |
1994 ["Edit group parameters" gnus-summary-edit-parameters t] | 2478 ["Binary" gnus-binary-mode t]) |
1995 ["Customize group parameters" gnus-summary-customize-parameters t] | 2479 ("Regeneration" |
1996 ["Send a bug report" gnus-bug t] | 2480 ["Regenerate" gnus-summary-prepare t] |
1997 ("Exit" | 2481 ["Insert cached articles" gnus-summary-insert-cached-articles t] |
1998 ["Catchup and exit" gnus-summary-catchup-and-exit | 2482 ["Insert dormant articles" gnus-summary-insert-dormant-articles t] |
1999 :help "Mark unread articles in this group as read, then exit"] | 2483 ["Toggle threading" gnus-summary-toggle-threads t]) |
2000 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] | 2484 ["See old articles" gnus-summary-insert-old-articles t] |
2001 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] | 2485 ["See new articles" gnus-summary-insert-new-articles t] |
2002 ["Exit group" gnus-summary-exit | 2486 ["Filter articles..." gnus-summary-execute-command t] |
2003 :help "Exit current group, return to group selection mode"] | 2487 ["Run command on articles..." gnus-summary-universal-argument t] |
2004 ["Exit group without updating" gnus-summary-exit-no-update t] | 2488 ["Search articles forward..." gnus-summary-search-article-forward t] |
2005 ["Exit and goto next group" gnus-summary-next-group t] | 2489 ["Search articles backward..." gnus-summary-search-article-backward t] |
2006 ["Exit and goto prev group" gnus-summary-prev-group t] | 2490 ["Toggle line truncation" gnus-summary-toggle-truncation t] |
2007 ["Reselect group" gnus-summary-reselect-current-group t] | 2491 ["Expand window" gnus-summary-expand-window t] |
2008 ["Rescan group" gnus-summary-rescan-group t] | 2492 ["Expire expirable articles" gnus-summary-expire-articles |
2009 ["Update dribble" gnus-summary-save-newsrc t]))) | 2493 (gnus-check-backend-function |
2494 'request-expire-articles gnus-newsgroup-name)] | |
2495 ["Edit local kill file" gnus-summary-edit-local-kill t] | |
2496 ["Edit main kill file" gnus-summary-edit-global-kill t] | |
2497 ["Edit group parameters" gnus-summary-edit-parameters t] | |
2498 ["Customize group parameters" gnus-summary-customize-parameters t] | |
2499 ["Send a bug report" gnus-bug t] | |
2500 ("Exit" | |
2501 ["Catchup and exit" gnus-summary-catchup-and-exit | |
2502 ,@(if (featurep 'xemacs) '(t) | |
2503 '(:help "Mark unread articles in this group as read, then exit"))] | |
2504 ["Catchup all and exit" gnus-summary-catchup-all-and-exit t] | |
2505 ["Catchup and goto next" gnus-summary-catchup-and-goto-next-group t] | |
2506 ["Exit group" gnus-summary-exit | |
2507 ,@(if (featurep 'xemacs) '(t) | |
2508 '(:help "Exit current group, return to group selection mode"))] | |
2509 ["Exit group without updating" gnus-summary-exit-no-update t] | |
2510 ["Exit and goto next group" gnus-summary-next-group t] | |
2511 ["Exit and goto prev group" gnus-summary-prev-group t] | |
2512 ["Reselect group" gnus-summary-reselect-current-group t] | |
2513 ["Rescan group" gnus-summary-rescan-group t] | |
2514 ["Update dribble" gnus-summary-save-newsrc t]))) | |
2010 | 2515 |
2011 (gnus-run-hooks 'gnus-summary-menu-hook))) | 2516 (gnus-run-hooks 'gnus-summary-menu-hook))) |
2012 | 2517 |
2013 (defvar gnus-summary-tool-bar-map nil) | 2518 (defvar gnus-summary-tool-bar-map nil) |
2014 | 2519 |
2015 ;; Emacs 21 tool bar. Should be no-op otherwise. | 2520 ;; Emacs 21 tool bar. Should be no-op otherwise. |
2016 ;; NB: A new function tool-bar-local-item-from-menu is added in Emacs | |
2017 ;; 21.2.50+. Considering many users use Emacs 21, use | |
2018 ;; tool-bar-add-item-from-menu here. | |
2019 (defun gnus-summary-make-tool-bar () | 2521 (defun gnus-summary-make-tool-bar () |
2020 (if (and | 2522 (if (and (fboundp 'tool-bar-add-item-from-menu) |
2021 (condition-case nil (require 'tool-bar) (error nil)) | 2523 (default-value 'tool-bar-mode) |
2022 (fboundp 'tool-bar-add-item-from-menu) | 2524 (not gnus-summary-tool-bar-map)) |
2023 (default-value 'tool-bar-mode) | |
2024 (not gnus-summary-tool-bar-map)) | |
2025 (setq gnus-summary-tool-bar-map | 2525 (setq gnus-summary-tool-bar-map |
2026 (let ((tool-bar-map (make-sparse-keymap))) | 2526 (let ((tool-bar-map (make-sparse-keymap)) |
2527 (load-path (mm-image-load-path))) | |
2027 (tool-bar-add-item-from-menu | 2528 (tool-bar-add-item-from-menu |
2028 'gnus-summary-prev-unread "prev-ur" gnus-summary-mode-map) | 2529 'gnus-summary-prev-unread "prev-ur" gnus-summary-mode-map) |
2029 (tool-bar-add-item-from-menu | 2530 (tool-bar-add-item-from-menu |
2030 'gnus-summary-next-unread "next-ur" gnus-summary-mode-map) | 2531 'gnus-summary-next-unread "next-ur" gnus-summary-mode-map) |
2031 (tool-bar-add-item-from-menu | 2532 (tool-bar-add-item-from-menu |
2154 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards | 2655 article, you can, for instance, type `\\[gnus-summary-next-page]'. To move forwards |
2155 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]', | 2656 and backwards while displaying articles, type `\\[gnus-summary-next-unread-article]' and `\\[gnus-summary-prev-unread-article]', |
2156 respectively. | 2657 respectively. |
2157 | 2658 |
2158 You can also post articles and send mail from this buffer. To | 2659 You can also post articles and send mail from this buffer. To |
2159 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author | 2660 follow up an article, type `\\[gnus-summary-followup]'. To mail a reply to the author |
2160 of an article, type `\\[gnus-summary-reply]'. | 2661 of an article, type `\\[gnus-summary-reply]'. |
2161 | 2662 |
2162 There are approx. one gazillion commands you can execute in this | 2663 There are approx. one gazillion commands you can execute in this |
2163 buffer; read the info pages for more information (`\\[gnus-info-find-node]'). | 2664 buffer; read the info pages for more information (`\\[gnus-info-find-node]'). |
2164 | 2665 |
2169 (kill-all-local-variables) | 2670 (kill-all-local-variables) |
2170 (when (gnus-visual-p 'summary-menu 'menu) | 2671 (when (gnus-visual-p 'summary-menu 'menu) |
2171 (gnus-summary-make-menu-bar) | 2672 (gnus-summary-make-menu-bar) |
2172 (gnus-summary-make-tool-bar)) | 2673 (gnus-summary-make-tool-bar)) |
2173 (gnus-summary-make-local-variables) | 2674 (gnus-summary-make-local-variables) |
2675 (let ((gnus-summary-local-variables gnus-newsgroup-variables)) | |
2676 (gnus-summary-make-local-variables)) | |
2174 (gnus-make-thread-indent-array) | 2677 (gnus-make-thread-indent-array) |
2175 (gnus-simplify-mode-line) | 2678 (gnus-simplify-mode-line) |
2176 (setq major-mode 'gnus-summary-mode) | 2679 (setq major-mode 'gnus-summary-mode) |
2177 (setq mode-name "Summary") | 2680 (setq mode-name "Summary") |
2178 (make-local-variable 'minor-mode-alist) | 2681 (make-local-variable 'minor-mode-alist) |
2188 (make-local-variable 'gnus-summary-line-format) | 2691 (make-local-variable 'gnus-summary-line-format) |
2189 (make-local-variable 'gnus-summary-line-format-spec) | 2692 (make-local-variable 'gnus-summary-line-format-spec) |
2190 (make-local-variable 'gnus-summary-dummy-line-format) | 2693 (make-local-variable 'gnus-summary-dummy-line-format) |
2191 (make-local-variable 'gnus-summary-dummy-line-format-spec) | 2694 (make-local-variable 'gnus-summary-dummy-line-format-spec) |
2192 (make-local-variable 'gnus-summary-mark-positions) | 2695 (make-local-variable 'gnus-summary-mark-positions) |
2193 (make-local-hook 'pre-command-hook) | 2696 (gnus-make-local-hook 'pre-command-hook) |
2194 (add-hook 'pre-command-hook 'gnus-set-global-variables nil t) | 2697 (add-hook 'pre-command-hook 'gnus-set-global-variables nil t) |
2195 (gnus-run-hooks 'gnus-summary-mode-hook) | 2698 (gnus-run-hooks 'gnus-summary-mode-hook) |
2699 (turn-on-gnus-mailing-list-mode) | |
2196 (mm-enable-multibyte) | 2700 (mm-enable-multibyte) |
2197 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) | 2701 (gnus-update-format-specifications nil 'summary 'summary-mode 'summary-dummy) |
2198 (gnus-update-summary-mark-positions)) | 2702 (gnus-update-summary-mark-positions)) |
2199 | 2703 |
2200 (defun gnus-summary-make-local-variables () | 2704 (defun gnus-summary-make-local-variables () |
2288 after-article)) | 2792 after-article)) |
2289 (let ((odata gnus-newsgroup-data)) | 2793 (let ((odata gnus-newsgroup-data)) |
2290 (setq gnus-newsgroup-data (nconc list gnus-newsgroup-data)) | 2794 (setq gnus-newsgroup-data (nconc list gnus-newsgroup-data)) |
2291 (when offset | 2795 (when offset |
2292 (gnus-data-update-list odata offset))) | 2796 (gnus-data-update-list odata offset))) |
2293 ;; Find the last element in the list to be spliced into the main | 2797 ;; Find the last element in the list to be spliced into the main |
2294 ;; list. | 2798 ;; list. |
2295 (while (cdr list) | 2799 (while (cdr list) |
2296 (setq list (cdr list))) | 2800 (setq list (cdr list))) |
2297 (if (not data) | 2801 (if (not data) |
2298 (progn | 2802 (progn |
2350 `(memq ,article gnus-newsgroup-ancient)) | 2854 `(memq ,article gnus-newsgroup-ancient)) |
2351 | 2855 |
2352 (defun gnus-article-parent-p (number) | 2856 (defun gnus-article-parent-p (number) |
2353 "Say whether this article is a parent or not." | 2857 "Say whether this article is a parent or not." |
2354 (let ((data (gnus-data-find-list number))) | 2858 (let ((data (gnus-data-find-list number))) |
2355 (and (cdr data) ; There has to be an article after... | 2859 (and (cdr data) ; There has to be an article after... |
2356 (< (gnus-data-level (car data)) ; And it has to have a higher level. | 2860 (< (gnus-data-level (car data)) ; And it has to have a higher level. |
2357 (gnus-data-level (nth 1 data)))))) | 2861 (gnus-data-level (nth 1 data)))))) |
2358 | 2862 |
2359 (defun gnus-article-children (number) | 2863 (defun gnus-article-children (number) |
2360 "Return a list of all children to NUMBER." | 2864 "Return a list of all children to NUMBER." |
2378 '(get-text-property (point) 'gnus-intangible)) | 2882 '(get-text-property (point) 'gnus-intangible)) |
2379 | 2883 |
2380 (defun gnus-article-read-p (article) | 2884 (defun gnus-article-read-p (article) |
2381 "Say whether ARTICLE is read or not." | 2885 "Say whether ARTICLE is read or not." |
2382 (not (or (memq article gnus-newsgroup-marked) | 2886 (not (or (memq article gnus-newsgroup-marked) |
2887 (memq article gnus-newsgroup-spam-marked) | |
2383 (memq article gnus-newsgroup-unreads) | 2888 (memq article gnus-newsgroup-unreads) |
2384 (memq article gnus-newsgroup-unselected) | 2889 (memq article gnus-newsgroup-unselected) |
2385 (memq article gnus-newsgroup-dormant)))) | 2890 (memq article gnus-newsgroup-dormant)))) |
2386 | 2891 |
2387 ;; Some summary mode macros. | 2892 ;; Some summary mode macros. |
2468 (defun gnus-read-mark-p (mark) | 2973 (defun gnus-read-mark-p (mark) |
2469 "Say whether MARK is one of the marks that mark as read. | 2974 "Say whether MARK is one of the marks that mark as read. |
2470 This is all marks except unread, ticked, dormant, and expirable." | 2975 This is all marks except unread, ticked, dormant, and expirable." |
2471 (not (or (= mark gnus-unread-mark) | 2976 (not (or (= mark gnus-unread-mark) |
2472 (= mark gnus-ticked-mark) | 2977 (= mark gnus-ticked-mark) |
2978 (= mark gnus-spam-mark) | |
2473 (= mark gnus-dormant-mark) | 2979 (= mark gnus-dormant-mark) |
2474 (= mark gnus-expirable-mark)))) | 2980 (= mark gnus-expirable-mark)))) |
2475 | 2981 |
2476 (defmacro gnus-article-mark (number) | 2982 (defmacro gnus-article-mark (number) |
2477 "Return the MARK of article NUMBER. | 2983 "Return the MARK of article NUMBER. |
2479 time; i.e., when generating the summary lines. After that, | 2985 time; i.e., when generating the summary lines. After that, |
2480 `gnus-summary-article-mark' should be used to examine the | 2986 `gnus-summary-article-mark' should be used to examine the |
2481 marks of articles." | 2987 marks of articles." |
2482 `(cond | 2988 `(cond |
2483 ((memq ,number gnus-newsgroup-unsendable) gnus-unsendable-mark) | 2989 ((memq ,number gnus-newsgroup-unsendable) gnus-unsendable-mark) |
2484 ((memq ,number gnus-newsgroup-undownloaded) gnus-undownloaded-mark) | |
2485 ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark) | 2990 ((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark) |
2486 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark) | 2991 ((memq ,number gnus-newsgroup-unreads) gnus-unread-mark) |
2487 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark) | 2992 ((memq ,number gnus-newsgroup-marked) gnus-ticked-mark) |
2993 ((memq ,number gnus-newsgroup-spam-marked) gnus-spam-mark) | |
2488 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark) | 2994 ((memq ,number gnus-newsgroup-dormant) gnus-dormant-mark) |
2489 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark) | 2995 ((memq ,number gnus-newsgroup-expirable) gnus-expirable-mark) |
2490 (t (or (cdr (assq ,number gnus-newsgroup-reads)) | 2996 (t (or (cdr (assq ,number gnus-newsgroup-reads)) |
2491 gnus-ancient-mark)))) | 2997 gnus-ancient-mark)))) |
2492 | 2998 |
2493 ;; Saving hidden threads. | 2999 ;; Saving hidden threads. |
2494 | |
2495 (put 'gnus-save-hidden-threads 'lisp-indent-function 0) | |
2496 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body)) | |
2497 | 3000 |
2498 (defmacro gnus-save-hidden-threads (&rest forms) | 3001 (defmacro gnus-save-hidden-threads (&rest forms) |
2499 "Save hidden threads, eval FORMS, and restore the hidden threads." | 3002 "Save hidden threads, eval FORMS, and restore the hidden threads." |
2500 (let ((config (make-symbol "config"))) | 3003 (let ((config (make-symbol "config"))) |
2501 `(let ((,config (gnus-hidden-threads-configuration))) | 3004 `(let ((,config (gnus-hidden-threads-configuration))) |
2502 (unwind-protect | 3005 (unwind-protect |
2503 (save-excursion | 3006 (save-excursion |
2504 ,@forms) | 3007 ,@forms) |
2505 (gnus-restore-hidden-threads-configuration ,config))))) | 3008 (gnus-restore-hidden-threads-configuration ,config))))) |
3009 (put 'gnus-save-hidden-threads 'lisp-indent-function 0) | |
3010 (put 'gnus-save-hidden-threads 'edebug-form-spec '(body)) | |
2506 | 3011 |
2507 (defun gnus-data-compute-positions () | 3012 (defun gnus-data-compute-positions () |
2508 "Compute the positions of all articles." | 3013 "Compute the positions of all articles." |
2509 (setq gnus-newsgroup-data-reverse nil) | 3014 (setq gnus-newsgroup-data-reverse nil) |
2510 (let ((data gnus-newsgroup-data)) | 3015 (let ((data gnus-newsgroup-data)) |
2556 (make-display-table))) | 3061 (make-display-table))) |
2557 (i 32)) | 3062 (i 32)) |
2558 ;; Nix out all the control chars... | 3063 ;; Nix out all the control chars... |
2559 (while (>= (setq i (1- i)) 0) | 3064 (while (>= (setq i (1- i)) 0) |
2560 (aset table i [??])) | 3065 (aset table i [??])) |
2561 ;; ... but not newline and cr, of course. (cr is necessary for the | 3066 ;; ... but not newline and cr, of course. (cr is necessary for the |
2562 ;; selective display). | 3067 ;; selective display). |
2563 (aset table ?\n nil) | 3068 (aset table ?\n nil) |
2564 (aset table ?\r nil) | 3069 (aset table ?\r nil) |
2565 ;; We keep TAB as well. | 3070 ;; We keep TAB as well. |
2566 (aset table ?\t nil) | 3071 (aset table ?\t nil) |
2570 ;; Only modify if the entry is nil. | 3075 ;; Only modify if the entry is nil. |
2571 (unless (aref table i) | 3076 (unless (aref table i) |
2572 (aset table i [??])))) | 3077 (aset table i [??])))) |
2573 (setq buffer-display-table table))) | 3078 (setq buffer-display-table table))) |
2574 | 3079 |
3080 (defun gnus-summary-set-article-display-arrow (pos) | |
3081 "Update the overlay arrow to point to line at position POS." | |
3082 (when (and gnus-summary-display-arrow | |
3083 (boundp 'overlay-arrow-position) | |
3084 (boundp 'overlay-arrow-string)) | |
3085 (save-excursion | |
3086 (goto-char pos) | |
3087 (beginning-of-line) | |
3088 (unless overlay-arrow-position | |
3089 (setq overlay-arrow-position (make-marker))) | |
3090 (setq overlay-arrow-string "=>" | |
3091 overlay-arrow-position (set-marker overlay-arrow-position | |
3092 (point) | |
3093 (current-buffer)))))) | |
3094 | |
2575 (defun gnus-summary-setup-buffer (group) | 3095 (defun gnus-summary-setup-buffer (group) |
2576 "Initialize summary buffer." | 3096 "Initialize summary buffer." |
2577 (let ((buffer (concat "*Summary " group "*"))) | 3097 (let ((buffer (gnus-summary-buffer-name group)) |
3098 (dead-name (concat "*Dead Summary " | |
3099 (gnus-group-decoded-name group) "*"))) | |
3100 ;; If a dead summary buffer exists, we kill it. | |
3101 (when (gnus-buffer-live-p dead-name) | |
3102 (gnus-kill-buffer dead-name)) | |
2578 (if (get-buffer buffer) | 3103 (if (get-buffer buffer) |
2579 (progn | 3104 (progn |
2580 (set-buffer buffer) | 3105 (set-buffer buffer) |
2581 (setq gnus-summary-buffer (current-buffer)) | 3106 (setq gnus-summary-buffer (current-buffer)) |
2582 (not gnus-newsgroup-prepared)) | 3107 (not gnus-newsgroup-prepared)) |
2588 (unless gnus-single-article-buffer | 3113 (unless gnus-single-article-buffer |
2589 (make-local-variable 'gnus-article-buffer) | 3114 (make-local-variable 'gnus-article-buffer) |
2590 (make-local-variable 'gnus-article-current) | 3115 (make-local-variable 'gnus-article-current) |
2591 (make-local-variable 'gnus-original-article-buffer)) | 3116 (make-local-variable 'gnus-original-article-buffer)) |
2592 (setq gnus-newsgroup-name group) | 3117 (setq gnus-newsgroup-name group) |
3118 ;; Set any local variables in the group parameters. | |
3119 (gnus-summary-set-local-parameters gnus-newsgroup-name) | |
2593 t))) | 3120 t))) |
2594 | 3121 |
2595 (defun gnus-set-global-variables () | 3122 (defun gnus-set-global-variables () |
2596 "Set the global equivalents of the buffer-local variables. | 3123 "Set the global equivalents of the buffer-local variables. |
2597 They are set to the latest values they had. These reflect the summary | 3124 They are set to the latest values they had. These reflect the summary |
2598 buffer that was in action when the last article was fetched." | 3125 buffer that was in action when the last article was fetched." |
2599 (when (eq major-mode 'gnus-summary-mode) | 3126 (when (eq major-mode 'gnus-summary-mode) |
2600 (setq gnus-summary-buffer (current-buffer)) | 3127 (setq gnus-summary-buffer (current-buffer)) |
2601 (let ((name gnus-newsgroup-name) | 3128 (let ((name gnus-newsgroup-name) |
2602 (marked gnus-newsgroup-marked) | 3129 (marked gnus-newsgroup-marked) |
3130 (spam gnus-newsgroup-spam-marked) | |
2603 (unread gnus-newsgroup-unreads) | 3131 (unread gnus-newsgroup-unreads) |
2604 (headers gnus-current-headers) | 3132 (headers gnus-current-headers) |
2605 (data gnus-newsgroup-data) | 3133 (data gnus-newsgroup-data) |
2606 (summary gnus-summary-buffer) | 3134 (summary gnus-summary-buffer) |
2607 (article-buffer gnus-article-buffer) | 3135 (article-buffer gnus-article-buffer) |
2608 (original gnus-original-article-buffer) | 3136 (original gnus-original-article-buffer) |
2609 (gac gnus-article-current) | 3137 (gac gnus-article-current) |
2610 (reffed gnus-reffed-article-number) | 3138 (reffed gnus-reffed-article-number) |
2611 (score-file gnus-current-score-file) | 3139 (score-file gnus-current-score-file) |
2612 (default-charset gnus-newsgroup-charset)) | 3140 (default-charset gnus-newsgroup-charset) |
3141 vlist) | |
3142 (let ((locals gnus-newsgroup-variables)) | |
3143 (while locals | |
3144 (if (consp (car locals)) | |
3145 (push (eval (caar locals)) vlist) | |
3146 (push (eval (car locals)) vlist)) | |
3147 (setq locals (cdr locals))) | |
3148 (setq vlist (nreverse vlist))) | |
2613 (save-excursion | 3149 (save-excursion |
2614 (set-buffer gnus-group-buffer) | 3150 (set-buffer gnus-group-buffer) |
2615 (setq gnus-newsgroup-name name | 3151 (setq gnus-newsgroup-name name |
2616 gnus-newsgroup-marked marked | 3152 gnus-newsgroup-marked marked |
3153 gnus-newsgroup-spam-marked spam | |
2617 gnus-newsgroup-unreads unread | 3154 gnus-newsgroup-unreads unread |
2618 gnus-current-headers headers | 3155 gnus-current-headers headers |
2619 gnus-newsgroup-data data | 3156 gnus-newsgroup-data data |
2620 gnus-article-current gac | 3157 gnus-article-current gac |
2621 gnus-summary-buffer summary | 3158 gnus-summary-buffer summary |
2622 gnus-article-buffer article-buffer | 3159 gnus-article-buffer article-buffer |
2623 gnus-original-article-buffer original | 3160 gnus-original-article-buffer original |
2624 gnus-reffed-article-number reffed | 3161 gnus-reffed-article-number reffed |
2625 gnus-current-score-file score-file | 3162 gnus-current-score-file score-file |
2626 gnus-newsgroup-charset default-charset) | 3163 gnus-newsgroup-charset default-charset) |
3164 (let ((locals gnus-newsgroup-variables)) | |
3165 (while locals | |
3166 (if (consp (car locals)) | |
3167 (set (caar locals) (pop vlist)) | |
3168 (set (car locals) (pop vlist))) | |
3169 (setq locals (cdr locals)))) | |
2627 ;; The article buffer also has local variables. | 3170 ;; The article buffer also has local variables. |
2628 (when (gnus-buffer-live-p gnus-article-buffer) | 3171 (when (gnus-buffer-live-p gnus-article-buffer) |
2629 (set-buffer gnus-article-buffer) | 3172 (set-buffer gnus-article-buffer) |
2630 (setq gnus-summary-buffer summary)))))) | 3173 (setq gnus-summary-buffer summary)))))) |
2631 | 3174 |
2663 (when (gnus-buffer-exists-p gnus-summary-buffer) | 3206 (when (gnus-buffer-exists-p gnus-summary-buffer) |
2664 (set-buffer gnus-summary-buffer)) | 3207 (set-buffer gnus-summary-buffer)) |
2665 (let ((gnus-replied-mark 129) | 3208 (let ((gnus-replied-mark 129) |
2666 (gnus-score-below-mark 130) | 3209 (gnus-score-below-mark 130) |
2667 (gnus-score-over-mark 130) | 3210 (gnus-score-over-mark 130) |
2668 (gnus-download-mark 131) | 3211 (gnus-undownloaded-mark 131) |
2669 (spec gnus-summary-line-format-spec) | 3212 (spec gnus-summary-line-format-spec) |
2670 gnus-visual pos) | 3213 gnus-visual pos) |
2671 (save-excursion | 3214 (save-excursion |
2672 (gnus-set-work-buffer) | 3215 (gnus-set-work-buffer) |
2673 (let ((gnus-summary-line-format-spec spec) | 3216 (let ((gnus-summary-line-format-spec spec) |
2674 (gnus-newsgroup-downloadable '((0 . t)))) | 3217 (gnus-newsgroup-downloadable '(0))) |
2675 (gnus-summary-insert-line | 3218 (gnus-summary-insert-line |
2676 [0 "" "" "" "" "" 0 0 "" nil] 0 nil 128 t nil "" nil 1) | 3219 [0 "" "" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil] |
3220 0 nil t 128 t nil "" nil 1) | |
2677 (goto-char (point-min)) | 3221 (goto-char (point-min)) |
2678 (setq pos (list (cons 'unread (and (search-forward "\200" nil t) | 3222 (setq pos (list (cons 'unread (and (search-forward "\200" nil t) |
2679 (- (point) (point-min) 1))))) | 3223 (- (point) (point-min) 1))))) |
2680 (goto-char (point-min)) | 3224 (goto-char (point-min)) |
2681 (push (cons 'replied (and (search-forward "\201" nil t) | 3225 (push (cons 'replied (and (search-forward "\201" nil t) |
2697 (beginning-of-line) | 3241 (beginning-of-line) |
2698 (gnus-add-text-properties | 3242 (gnus-add-text-properties |
2699 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point)) | 3243 (point) (progn (eval gnus-summary-dummy-line-format-spec) (point)) |
2700 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number))) | 3244 (list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number))) |
2701 | 3245 |
2702 (defun gnus-summary-from-or-to-or-newsgroups (header) | 3246 (defun gnus-summary-extract-address-component (from) |
2703 (let ((to (cdr (assq 'To (mail-header-extra header)))) | 3247 (or (car (funcall gnus-extract-address-components from)) |
2704 (newsgroups (cdr (assq 'Newsgroups (mail-header-extra header)))) | 3248 from)) |
2705 (mail-parse-charset gnus-newsgroup-charset) | 3249 |
3250 (defun gnus-summary-from-or-to-or-newsgroups (header gnus-tmp-from) | |
3251 (let ((mail-parse-charset gnus-newsgroup-charset) | |
3252 ; Is it really necessary to do this next part for each summary line? | |
3253 ; Luckily, doesn't seem to slow things down much. | |
2706 (mail-parse-ignored-charsets | 3254 (mail-parse-ignored-charsets |
2707 (save-excursion (set-buffer gnus-summary-buffer) | 3255 (save-excursion (set-buffer gnus-summary-buffer) |
2708 gnus-newsgroup-ignored-charsets))) | 3256 gnus-newsgroup-ignored-charsets))) |
2709 (cond | 3257 (or |
2710 ((and to | 3258 (and gnus-ignored-from-addresses |
2711 gnus-ignored-from-addresses | 3259 (string-match gnus-ignored-from-addresses gnus-tmp-from) |
2712 (string-match gnus-ignored-from-addresses | 3260 (let ((extra-headers (mail-header-extra header)) |
2713 (mail-header-from header))) | 3261 to |
2714 (concat "-> " | 3262 newsgroups) |
2715 (or (car (funcall gnus-extract-address-components | 3263 (cond |
2716 (funcall | 3264 ((setq to (cdr (assq 'To extra-headers))) |
2717 gnus-decode-encoded-word-function to))) | 3265 (concat "-> " |
2718 (funcall gnus-decode-encoded-word-function to)))) | 3266 (inline |
2719 ((and newsgroups | 3267 (gnus-summary-extract-address-component |
2720 gnus-ignored-from-addresses | 3268 (funcall gnus-decode-encoded-word-function to))))) |
2721 (string-match gnus-ignored-from-addresses | 3269 ((setq newsgroups (cdr (assq 'Newsgroups extra-headers))) |
2722 (mail-header-from header))) | 3270 (concat "=> " newsgroups))))) |
2723 (concat "=> " newsgroups)) | 3271 (inline (gnus-summary-extract-address-component gnus-tmp-from))))) |
2724 (t | |
2725 (or (car (funcall gnus-extract-address-components | |
2726 (mail-header-from header))) | |
2727 (mail-header-from header)))))) | |
2728 | 3272 |
2729 (defun gnus-summary-insert-line (gnus-tmp-header | 3273 (defun gnus-summary-insert-line (gnus-tmp-header |
2730 gnus-tmp-level gnus-tmp-current | 3274 gnus-tmp-level gnus-tmp-current |
2731 gnus-tmp-unread gnus-tmp-replied | 3275 undownloaded gnus-tmp-unread gnus-tmp-replied |
2732 gnus-tmp-expirable gnus-tmp-subject-or-nil | 3276 gnus-tmp-expirable gnus-tmp-subject-or-nil |
2733 &optional gnus-tmp-dummy gnus-tmp-score | 3277 &optional gnus-tmp-dummy gnus-tmp-score |
2734 gnus-tmp-process) | 3278 gnus-tmp-process) |
2735 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level)) | 3279 (let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level)) |
2736 (gnus-tmp-lines (mail-header-lines gnus-tmp-header)) | 3280 (gnus-tmp-lines (mail-header-lines gnus-tmp-header)) |
2737 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0)) | 3281 (gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0)) |
2738 (gnus-tmp-score-char | 3282 (gnus-tmp-score-char |
2739 (if (or (null gnus-summary-default-score) | 3283 (if (or (null gnus-summary-default-score) |
2740 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | 3284 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) |
2741 gnus-summary-zcore-fuzz)) | 3285 gnus-summary-zcore-fuzz)) |
2742 ? ;Whitespace | 3286 ? ;Whitespace |
2743 (if (< gnus-tmp-score gnus-summary-default-score) | 3287 (if (< gnus-tmp-score gnus-summary-default-score) |
2744 gnus-score-below-mark gnus-score-over-mark))) | 3288 gnus-score-below-mark gnus-score-over-mark))) |
3289 (gnus-tmp-number (mail-header-number gnus-tmp-header)) | |
2745 (gnus-tmp-replied | 3290 (gnus-tmp-replied |
2746 (cond (gnus-tmp-process gnus-process-mark) | 3291 (cond (gnus-tmp-process gnus-process-mark) |
2747 ((memq gnus-tmp-current gnus-newsgroup-cached) | 3292 ((memq gnus-tmp-current gnus-newsgroup-cached) |
2748 gnus-cached-mark) | 3293 gnus-cached-mark) |
2749 (gnus-tmp-replied gnus-replied-mark) | 3294 (gnus-tmp-replied gnus-replied-mark) |
3295 ((memq gnus-tmp-current gnus-newsgroup-forwarded) | |
3296 gnus-forwarded-mark) | |
2750 ((memq gnus-tmp-current gnus-newsgroup-saved) | 3297 ((memq gnus-tmp-current gnus-newsgroup-saved) |
2751 gnus-saved-mark) | 3298 gnus-saved-mark) |
2752 (t gnus-unread-mark))) | 3299 ((memq gnus-tmp-number gnus-newsgroup-recent) |
3300 gnus-recent-mark) | |
3301 ((memq gnus-tmp-number gnus-newsgroup-unseen) | |
3302 gnus-unseen-mark) | |
3303 (t gnus-no-mark))) | |
3304 (gnus-tmp-downloaded | |
3305 (cond (undownloaded | |
3306 gnus-undownloaded-mark) | |
3307 (gnus-newsgroup-agentized | |
3308 gnus-downloaded-mark) | |
3309 (t | |
3310 gnus-no-mark))) | |
2753 (gnus-tmp-from (mail-header-from gnus-tmp-header)) | 3311 (gnus-tmp-from (mail-header-from gnus-tmp-header)) |
2754 (gnus-tmp-name | 3312 (gnus-tmp-name |
2755 (cond | 3313 (cond |
2756 ((string-match "<[^>]+> *$" gnus-tmp-from) | 3314 ((string-match "<[^>]+> *$" gnus-tmp-from) |
2757 (let ((beg (match-beginning 0))) | 3315 (let ((beg (match-beginning 0))) |
2758 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | 3316 (or (and (string-match "^\".+\"" gnus-tmp-from) |
2759 (substring gnus-tmp-from (1+ (match-beginning 0)) | 3317 (substring gnus-tmp-from 1 (1- (match-end 0)))) |
2760 (1- (match-end 0)))) | |
2761 (substring gnus-tmp-from 0 beg)))) | 3318 (substring gnus-tmp-from 0 beg)))) |
2762 ((string-match "(.+)" gnus-tmp-from) | 3319 ((string-match "(.+)" gnus-tmp-from) |
2763 (substring gnus-tmp-from | 3320 (substring gnus-tmp-from |
2764 (1+ (match-beginning 0)) (1- (match-end 0)))) | 3321 (1+ (match-beginning 0)) (1- (match-end 0)))) |
2765 (t gnus-tmp-from))) | 3322 (t gnus-tmp-from))) |
2766 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) | 3323 (gnus-tmp-subject (mail-header-subject gnus-tmp-header)) |
2767 (gnus-tmp-number (mail-header-number gnus-tmp-header)) | |
2768 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) | 3324 (gnus-tmp-opening-bracket (if gnus-tmp-dummy ?\< ?\[)) |
2769 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) | 3325 (gnus-tmp-closing-bracket (if gnus-tmp-dummy ?\> ?\])) |
2770 (buffer-read-only nil)) | 3326 (buffer-read-only nil)) |
2771 (when (string= gnus-tmp-name "") | 3327 (when (string= gnus-tmp-name "") |
2772 (setq gnus-tmp-name gnus-tmp-from)) | 3328 (setq gnus-tmp-name gnus-tmp-from)) |
2773 (unless (numberp gnus-tmp-lines) | 3329 (unless (numberp gnus-tmp-lines) |
2774 (setq gnus-tmp-lines 0)) | 3330 (setq gnus-tmp-lines -1)) |
2775 (gnus-put-text-property | 3331 (if (= gnus-tmp-lines -1) |
3332 (setq gnus-tmp-lines "?") | |
3333 (setq gnus-tmp-lines (number-to-string gnus-tmp-lines))) | |
3334 (gnus-put-text-property | |
2776 (point) | 3335 (point) |
2777 (progn (eval gnus-summary-line-format-spec) (point)) | 3336 (progn (eval gnus-summary-line-format-spec) (point)) |
2778 'gnus-number gnus-tmp-number) | 3337 'gnus-number gnus-tmp-number) |
2779 (when (gnus-visual-p 'summary-highlight 'highlight) | 3338 (when (gnus-visual-p 'summary-highlight 'highlight) |
2780 (forward-line -1) | 3339 (forward-line -1) |
2781 (gnus-run-hooks 'gnus-summary-update-hook) | 3340 (gnus-run-hooks 'gnus-summary-update-hook) |
2782 (forward-line 1)))) | 3341 (forward-line 1)))) |
2783 | 3342 |
2802 (gnus-summary-mark-article-as-unread gnus-unread-mark))) | 3361 (gnus-summary-mark-article-as-unread gnus-unread-mark))) |
2803 (gnus-summary-update-mark | 3362 (gnus-summary-update-mark |
2804 (if (or (null gnus-summary-default-score) | 3363 (if (or (null gnus-summary-default-score) |
2805 (<= (abs (- score gnus-summary-default-score)) | 3364 (<= (abs (- score gnus-summary-default-score)) |
2806 gnus-summary-zcore-fuzz)) | 3365 gnus-summary-zcore-fuzz)) |
2807 ? ;Whitespace | 3366 ? ;Whitespace |
2808 (if (< score gnus-summary-default-score) | 3367 (if (< score gnus-summary-default-score) |
2809 gnus-score-below-mark gnus-score-over-mark)) | 3368 gnus-score-below-mark gnus-score-over-mark)) |
2810 'score)) | 3369 'score)) |
2811 ;; Do visual highlighting. | 3370 ;; Do visual highlighting. |
2812 (when (gnus-visual-p 'summary-highlight 'highlight) | 3371 (when (gnus-visual-p 'summary-highlight 'highlight) |
2817 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char) | 3376 (defun gnus-summary-number-of-articles-in-thread (thread &optional level char) |
2818 "Return the number of articles in THREAD. | 3377 "Return the number of articles in THREAD. |
2819 This may be 0 in some cases -- if none of the articles in | 3378 This may be 0 in some cases -- if none of the articles in |
2820 the thread are to be displayed." | 3379 the thread are to be displayed." |
2821 (let* ((number | 3380 (let* ((number |
2822 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>. | 3381 ;; Fix by Luc Van Eycken <Luc.VanEycken@esat.kuleuven.ac.be>. |
2823 (cond | 3382 (cond |
2824 ((not (listp thread)) | 3383 ((not (listp thread)) |
2825 1) | 3384 1) |
2826 ((and (consp thread) (cdr thread)) | 3385 ((and (consp thread) (cdr thread)) |
2827 (apply | 3386 (apply |
2840 (if char | 3399 (if char |
2841 (if (> number 1) gnus-not-empty-thread-mark | 3400 (if (> number 1) gnus-not-empty-thread-mark |
2842 gnus-empty-thread-mark) | 3401 gnus-empty-thread-mark) |
2843 number))) | 3402 number))) |
2844 | 3403 |
3404 (defsubst gnus-summary-line-message-size (head) | |
3405 "Return pretty-printed version of message size. | |
3406 This function is intended to be used in | |
3407 `gnus-summary-line-format-alist'." | |
3408 (let ((c (or (mail-header-chars head) -1))) | |
3409 (cond ((< c 0) "n/a") ; chars not available | |
3410 ((< c (* 1000 10)) (format "%1.1fk" (/ c 1024.0))) | |
3411 ((< c (* 1000 100)) (format "%dk" (/ c 1024.0))) | |
3412 ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024)))) | |
3413 (t (format "%dM" (/ c (* 1024.0 1024))))))) | |
3414 | |
3415 | |
2845 (defun gnus-summary-set-local-parameters (group) | 3416 (defun gnus-summary-set-local-parameters (group) |
2846 "Go through the local params of GROUP and set all variable specs in that list." | 3417 "Go through the local params of GROUP and set all variable specs in that list." |
2847 (let ((params (gnus-group-find-parameter group)) | 3418 (let ((params (gnus-group-find-parameter group)) |
3419 (vars '(quit-config)) ; Ignore quit-config. | |
2848 elem) | 3420 elem) |
2849 (while params | 3421 (while params |
2850 (setq elem (car params) | 3422 (setq elem (car params) |
2851 params (cdr params)) | 3423 params (cdr params)) |
2852 (and (consp elem) ; Has to be a cons. | 3424 (and (consp elem) ; Has to be a cons. |
2853 (consp (cdr elem)) ; The cdr has to be a list. | 3425 (consp (cdr elem)) ; The cdr has to be a list. |
2854 (symbolp (car elem)) ; Has to be a symbol in there. | 3426 (symbolp (car elem)) ; Has to be a symbol in there. |
2855 (not (memq (car elem) '(quit-config))) ; Ignore quit-config. | 3427 (not (memq (car elem) vars)) |
2856 (ignore-errors ; So we set it. | 3428 (ignore-errors ; So we set it. |
3429 (push (car elem) vars) | |
2857 (make-local-variable (car elem)) | 3430 (make-local-variable (car elem)) |
2858 (set (car elem) (eval (nth 1 elem)))))))) | 3431 (set (car elem) (eval (nth 1 elem)))))))) |
2859 | 3432 |
2860 (defun gnus-summary-read-group (group &optional show-all no-article | 3433 (defun gnus-summary-read-group (group &optional show-all no-article |
2861 kill-buffer no-display backward | 3434 kill-buffer no-display backward |
2888 | 3461 |
2889 (defun gnus-summary-read-group-1 (group show-all no-article | 3462 (defun gnus-summary-read-group-1 (group show-all no-article |
2890 kill-buffer no-display | 3463 kill-buffer no-display |
2891 &optional select-articles) | 3464 &optional select-articles) |
2892 ;; Killed foreign groups can't be entered. | 3465 ;; Killed foreign groups can't be entered. |
2893 (when (and (not (gnus-group-native-p group)) | 3466 ;; (when (and (not (gnus-group-native-p group)) |
2894 (not (gnus-gethash group gnus-newsrc-hashtb))) | 3467 ;; (not (gnus-gethash group gnus-newsrc-hashtb))) |
2895 (error "Dead non-native groups can't be entered")) | 3468 ;; (error "Dead non-native groups can't be entered")) |
2896 (gnus-message 5 "Retrieving newsgroup: %s..." group) | 3469 (gnus-message 5 "Retrieving newsgroup: %s..." |
3470 (gnus-group-decoded-name group)) | |
2897 (let* ((new-group (gnus-summary-setup-buffer group)) | 3471 (let* ((new-group (gnus-summary-setup-buffer group)) |
2898 (quit-config (gnus-group-quit-config group)) | 3472 (quit-config (gnus-group-quit-config group)) |
2899 (did-select (and new-group (gnus-select-newsgroup | 3473 (did-select (and new-group (gnus-select-newsgroup |
2900 group show-all select-articles)))) | 3474 group show-all select-articles)))) |
2901 (cond | 3475 (cond |
2921 (gnus-summary-update-info) | 3495 (gnus-summary-update-info) |
2922 (set-buffer gnus-group-buffer) | 3496 (set-buffer gnus-group-buffer) |
2923 (gnus-group-jump-to-group group) | 3497 (gnus-group-jump-to-group group) |
2924 (gnus-group-next-unread-group 1)) | 3498 (gnus-group-next-unread-group 1)) |
2925 (gnus-handle-ephemeral-exit quit-config))) | 3499 (gnus-handle-ephemeral-exit quit-config))) |
2926 (gnus-message 3 "Can't select group") | 3500 (let ((grpinfo (gnus-get-info group))) |
3501 (if (null (gnus-info-read grpinfo)) | |
3502 (gnus-message 3 "Group %s contains no messages" | |
3503 (gnus-group-decoded-name group)) | |
3504 (gnus-message 3 "Can't select group"))) | |
2927 nil) | 3505 nil) |
2928 ;; The user did a `C-g' while prompting for number of articles, | 3506 ;; The user did a `C-g' while prompting for number of articles, |
2929 ;; so we exit this group. | 3507 ;; so we exit this group. |
2930 ((eq did-select 'quit) | 3508 ((eq did-select 'quit) |
2931 (and (eq major-mode 'gnus-summary-mode) | 3509 (and (eq major-mode 'gnus-summary-mode) |
2949 (setq gnus-newsgroup-active | 3527 (setq gnus-newsgroup-active |
2950 (gnus-copy-sequence | 3528 (gnus-copy-sequence |
2951 (gnus-active gnus-newsgroup-name))) | 3529 (gnus-active gnus-newsgroup-name))) |
2952 ;; You can change the summary buffer in some way with this hook. | 3530 ;; You can change the summary buffer in some way with this hook. |
2953 (gnus-run-hooks 'gnus-select-group-hook) | 3531 (gnus-run-hooks 'gnus-select-group-hook) |
2954 ;; Set any local variables in the group parameters. | |
2955 (gnus-summary-set-local-parameters gnus-newsgroup-name) | |
2956 (gnus-update-format-specifications | 3532 (gnus-update-format-specifications |
2957 nil 'summary 'summary-mode 'summary-dummy) | 3533 nil 'summary 'summary-mode 'summary-dummy) |
2958 (gnus-update-summary-mark-positions) | 3534 (gnus-update-summary-mark-positions) |
2959 ;; Do score processing. | 3535 ;; Do score processing. |
2960 (when gnus-use-scoring | 3536 (when gnus-use-scoring |
3002 ;; Return nil from this function. | 3578 ;; Return nil from this function. |
3003 nil) | 3579 nil) |
3004 ;; Hide conversation thread subtrees. We cannot do this in | 3580 ;; Hide conversation thread subtrees. We cannot do this in |
3005 ;; gnus-summary-prepare-hook since kill processing may not | 3581 ;; gnus-summary-prepare-hook since kill processing may not |
3006 ;; work with hidden articles. | 3582 ;; work with hidden articles. |
3007 (and gnus-show-threads | 3583 (gnus-summary-maybe-hide-threads) |
3008 gnus-thread-hide-subtree | |
3009 (gnus-summary-hide-all-threads)) | |
3010 (when kill-buffer | 3584 (when kill-buffer |
3011 (gnus-kill-or-deaden-summary kill-buffer)) | 3585 (gnus-kill-or-deaden-summary kill-buffer)) |
3586 (gnus-summary-auto-select-subject) | |
3012 ;; Show first unread article if requested. | 3587 ;; Show first unread article if requested. |
3013 (if (and (not no-article) | 3588 (if (and (not no-article) |
3014 (not no-display) | 3589 (not no-display) |
3015 gnus-newsgroup-unreads | 3590 gnus-newsgroup-unreads |
3016 gnus-auto-select-first) | 3591 gnus-auto-select-first) |
3017 (progn | 3592 (progn |
3018 (gnus-configure-windows 'summary) | 3593 (gnus-configure-windows 'summary) |
3019 (cond | 3594 (let ((art (gnus-summary-article-number))) |
3020 ((eq gnus-auto-select-first 'best) | 3595 (unless (and (not gnus-plugged) |
3021 (gnus-summary-best-unread-article)) | 3596 (or (memq art gnus-newsgroup-undownloaded) |
3022 ((eq gnus-auto-select-first t) | 3597 (memq art gnus-newsgroup-downloadable))) |
3023 (gnus-summary-first-unread-article)) | 3598 (gnus-summary-goto-article art)))) |
3024 ((gnus-functionp gnus-auto-select-first) | 3599 ;; Don't select any articles. |
3025 (funcall gnus-auto-select-first)))) | |
3026 ;; Don't select any articles, just move point to the first | |
3027 ;; article in the group. | |
3028 (goto-char (point-min)) | |
3029 (gnus-summary-position-point) | 3600 (gnus-summary-position-point) |
3030 (gnus-configure-windows 'summary 'force) | 3601 (gnus-configure-windows 'summary 'force) |
3031 (gnus-set-mode-line 'summary)) | 3602 (gnus-set-mode-line 'summary)) |
3032 (when (get-buffer-window gnus-group-buffer t) | 3603 (when (and gnus-auto-center-group |
3604 (get-buffer-window gnus-group-buffer t)) | |
3033 ;; Gotta use windows, because recenter does weird stuff if | 3605 ;; Gotta use windows, because recenter does weird stuff if |
3034 ;; the current buffer ain't the displayed window. | 3606 ;; the current buffer ain't the displayed window. |
3035 (let ((owin (selected-window))) | 3607 (let ((owin (selected-window))) |
3036 (select-window (get-buffer-window gnus-group-buffer t)) | 3608 (select-window (get-buffer-window gnus-group-buffer t)) |
3037 (when (gnus-group-goto-group group) | 3609 (when (gnus-group-goto-group group) |
3038 (recenter)) | 3610 (recenter)) |
3039 (select-window owin))) | 3611 (select-window owin))) |
3040 ;; Mark this buffer as "prepared". | 3612 ;; Mark this buffer as "prepared". |
3041 (setq gnus-newsgroup-prepared t) | 3613 (setq gnus-newsgroup-prepared t) |
3042 (gnus-run-hooks 'gnus-summary-prepared-hook) | 3614 (gnus-run-hooks 'gnus-summary-prepared-hook) |
3615 (unless (gnus-ephemeral-group-p group) | |
3616 (gnus-group-update-group group)) | |
3043 t))))) | 3617 t))))) |
3618 | |
3619 (defun gnus-summary-auto-select-subject () | |
3620 "Select the subject line on initial group entry." | |
3621 (goto-char (point-min)) | |
3622 (cond | |
3623 ((eq gnus-auto-select-subject 'best) | |
3624 (gnus-summary-best-unread-subject)) | |
3625 ((eq gnus-auto-select-subject 'unread) | |
3626 (gnus-summary-first-unread-subject)) | |
3627 ((eq gnus-auto-select-subject 'unseen) | |
3628 (gnus-summary-first-unseen-subject)) | |
3629 ((eq gnus-auto-select-subject 'unseen-or-unread) | |
3630 (gnus-summary-first-unseen-or-unread-subject)) | |
3631 ((eq gnus-auto-select-subject 'first) | |
3632 ;; Do nothing. | |
3633 ) | |
3634 ((functionp gnus-auto-select-subject) | |
3635 (funcall gnus-auto-select-subject)))) | |
3044 | 3636 |
3045 (defun gnus-summary-prepare () | 3637 (defun gnus-summary-prepare () |
3046 "Generate the summary buffer." | 3638 "Generate the summary buffer." |
3047 (interactive) | 3639 (interactive) |
3048 (let ((buffer-read-only nil)) | 3640 (let ((buffer-read-only nil)) |
3064 ;; Call hooks for modifying summary buffer. | 3656 ;; Call hooks for modifying summary buffer. |
3065 (goto-char (point-min)) | 3657 (goto-char (point-min)) |
3066 (gnus-run-hooks 'gnus-summary-prepare-hook))) | 3658 (gnus-run-hooks 'gnus-summary-prepare-hook))) |
3067 | 3659 |
3068 (defsubst gnus-general-simplify-subject (subject) | 3660 (defsubst gnus-general-simplify-subject (subject) |
3069 "Simply subject by the same rules as gnus-gather-threads-by-subject." | 3661 "Simplify subject by the same rules as `gnus-gather-threads-by-subject'." |
3070 (setq subject | 3662 (setq subject |
3071 (cond | 3663 (cond |
3072 ;; Truncate the subject. | 3664 ;; Truncate the subject. |
3073 (gnus-simplify-subject-functions | 3665 (gnus-simplify-subject-functions |
3074 (gnus-map-function gnus-simplify-subject-functions subject)) | 3666 (gnus-map-function gnus-simplify-subject-functions subject)) |
3084 (t | 3676 (t |
3085 (gnus-simplify-subject-re subject)))) | 3677 (gnus-simplify-subject-re subject)))) |
3086 | 3678 |
3087 (if (and gnus-summary-gather-exclude-subject | 3679 (if (and gnus-summary-gather-exclude-subject |
3088 (string-match gnus-summary-gather-exclude-subject subject)) | 3680 (string-match gnus-summary-gather-exclude-subject subject)) |
3089 nil ; This article shouldn't be gathered | 3681 nil ; This article shouldn't be gathered |
3090 subject)) | 3682 subject)) |
3091 | 3683 |
3092 (defun gnus-summary-simplify-subject-query () | 3684 (defun gnus-summary-simplify-subject-query () |
3093 "Query where the respool algorithm would put this article." | 3685 "Query where the respool algorithm would put this article." |
3094 (interactive) | 3686 (interactive) |
3120 (nconc (cdar hthread) (list (car threads)))) | 3712 (nconc (cdar hthread) (list (car threads)))) |
3121 ;; Remove it from the list of threads. | 3713 ;; Remove it from the list of threads. |
3122 (setcdr prev (cdr threads)) | 3714 (setcdr prev (cdr threads)) |
3123 (setq threads prev)) | 3715 (setq threads prev)) |
3124 ;; Enter this thread into the hash table. | 3716 ;; Enter this thread into the hash table. |
3125 (gnus-sethash subject threads hashtb))) | 3717 (gnus-sethash subject |
3718 (if gnus-summary-make-false-root-always | |
3719 (progn | |
3720 ;; If you want a dummy root above all | |
3721 ;; threads... | |
3722 (setcar threads (list whole-subject | |
3723 (car threads))) | |
3724 threads) | |
3725 threads) | |
3726 hashtb))) | |
3126 (setq prev threads) | 3727 (setq prev threads) |
3127 (setq threads (cdr threads))) | 3728 (setq threads (cdr threads))) |
3128 result))) | 3729 result))) |
3129 | 3730 |
3130 (defun gnus-gather-threads-by-references (threads) | 3731 (defun gnus-gather-threads-by-references (threads) |
3135 (result threads) | 3736 (result threads) |
3136 ids references id gthread gid entered ref) | 3737 ids references id gthread gid entered ref) |
3137 (while threads | 3738 (while threads |
3138 (when (setq references (mail-header-references (caar threads))) | 3739 (when (setq references (mail-header-references (caar threads))) |
3139 (setq id (mail-header-id (caar threads)) | 3740 (setq id (mail-header-id (caar threads)) |
3140 ids (gnus-split-references references) | 3741 ids (inline (gnus-split-references references)) |
3141 entered nil) | 3742 entered nil) |
3142 (while (setq ref (pop ids)) | 3743 (while (setq ref (pop ids)) |
3143 (setq ids (delete ref ids)) | 3744 (setq ids (delete ref ids)) |
3144 (if (not (setq gid (gnus-gethash ref idhashtb))) | 3745 (if (not (setq gid (gnus-gethash ref idhashtb))) |
3145 (progn | 3746 (progn |
3219 (car (symbol-value refs)) thread)) | 3820 (car (symbol-value refs)) thread)) |
3220 (cdr (symbol-value refs))))))) | 3821 (cdr (symbol-value refs))))))) |
3221 (setq threads nil) | 3822 (setq threads nil) |
3222 (throw 'infloop t)) | 3823 (throw 'infloop t)) |
3223 (unless (car (symbol-value refs)) | 3824 (unless (car (symbol-value refs)) |
3224 ;; These threads do not refer back to any other articles, | 3825 ;; These threads do not refer back to any other |
3225 ;; so they're roots. | 3826 ;; articles, so they're roots. |
3226 (setq threads (append (cdr (symbol-value refs)) threads)))) | 3827 (setq threads (append (cdr (symbol-value refs)) threads)))) |
3227 gnus-newsgroup-dependencies))) | 3828 gnus-newsgroup-dependencies))) |
3228 threads)) | 3829 threads)) |
3229 | 3830 |
3230 ;; Build the thread tree. | 3831 ;; Build the thread tree. |
3234 If FORCE-NEW is not nil, enter HEADER into the DEPENDENCIES table even | 3835 If FORCE-NEW is not nil, enter HEADER into the DEPENDENCIES table even |
3235 if it was already present. | 3836 if it was already present. |
3236 | 3837 |
3237 If `gnus-summary-ignore-duplicates' is nil then duplicate Message-IDs | 3838 If `gnus-summary-ignore-duplicates' is nil then duplicate Message-IDs |
3238 will not be entered in the DEPENDENCIES table. Otherwise duplicate | 3839 will not be entered in the DEPENDENCIES table. Otherwise duplicate |
3239 Message-IDs will be renamed be renamed to a unique Message-ID before | 3840 Message-IDs will be renamed to a unique Message-ID before being |
3240 being entered. | 3841 entered. |
3241 | 3842 |
3242 Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." | 3843 Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise." |
3243 (let* ((id (mail-header-id header)) | 3844 (let* ((id (mail-header-id header)) |
3244 (id-dep (and id (intern id dependencies))) | 3845 (id-dep (and id (intern id dependencies))) |
3245 ref ref-dep ref-header) | 3846 parent-id ref ref-dep ref-header replaced) |
3246 ;; Enter this `header' in the `dependencies' table. | 3847 ;; Enter this `header' in the `dependencies' table. |
3247 (cond | 3848 (cond |
3248 ((not id-dep) | 3849 ((not id-dep) |
3249 (setq header nil)) | 3850 (setq header nil)) |
3250 ;; The first two cases do the normal part: enter a new `header' | 3851 ;; The first two cases do the normal part: enter a new `header' |
3257 ;; From here the `header' was already present in the | 3858 ;; From here the `header' was already present in the |
3258 ;; `dependencies' table. | 3859 ;; `dependencies' table. |
3259 (force-new | 3860 (force-new |
3260 ;; Overrides an existing entry; | 3861 ;; Overrides an existing entry; |
3261 ;; just set the header part of the entry. | 3862 ;; just set the header part of the entry. |
3262 (setcar (symbol-value id-dep) header)) | 3863 (setcar (symbol-value id-dep) header) |
3864 (setq replaced t)) | |
3263 | 3865 |
3264 ;; Renames the existing `header' to a unique Message-ID. | 3866 ;; Renames the existing `header' to a unique Message-ID. |
3265 ((not gnus-summary-ignore-duplicates) | 3867 ((not gnus-summary-ignore-duplicates) |
3266 ;; An article with this Message-ID has already been seen. | 3868 ;; An article with this Message-ID has already been seen. |
3267 ;; We rename the Message-ID. | 3869 ;; We rename the Message-ID. |
3280 (concat (or (mail-header-xref (car (symbol-value id-dep))) | 3882 (concat (or (mail-header-xref (car (symbol-value id-dep))) |
3281 "") | 3883 "") |
3282 (or (mail-header-xref header) ""))) | 3884 (or (mail-header-xref header) ""))) |
3283 (setq header nil))) | 3885 (setq header nil))) |
3284 | 3886 |
3285 (when header | 3887 (when (and header (not replaced)) |
3286 ;; First check if that we are not creating a References loop. | 3888 ;; First check that we are not creating a References loop. |
3287 (setq ref (gnus-parent-id (mail-header-references header))) | 3889 (setq parent-id (gnus-parent-id (mail-header-references header))) |
3890 (setq ref parent-id) | |
3288 (while (and ref | 3891 (while (and ref |
3289 (setq ref-dep (intern-soft ref dependencies)) | 3892 (setq ref-dep (intern-soft ref dependencies)) |
3290 (boundp ref-dep) | 3893 (boundp ref-dep) |
3291 (setq ref-header (car (symbol-value ref-dep)))) | 3894 (setq ref-header (car (symbol-value ref-dep)))) |
3292 (if (string= id ref) | 3895 (if (string= id ref) |
3293 ;; Yuk! This is a reference loop. Make the article be a | 3896 ;; Yuk! This is a reference loop. Make the article be a |
3294 ;; root article. | 3897 ;; root article. |
3295 (progn | 3898 (progn |
3296 (mail-header-set-references (car (symbol-value id-dep)) "none") | 3899 (mail-header-set-references (car (symbol-value id-dep)) "none") |
3297 (setq ref nil)) | 3900 (setq ref nil) |
3901 (setq parent-id nil)) | |
3298 (setq ref (gnus-parent-id (mail-header-references ref-header))))) | 3902 (setq ref (gnus-parent-id (mail-header-references ref-header))))) |
3299 (setq ref (gnus-parent-id (mail-header-references header))) | 3903 (setq ref-dep (intern (or parent-id "none") dependencies)) |
3300 (setq ref-dep (intern (or ref "none") dependencies)) | |
3301 (if (boundp ref-dep) | 3904 (if (boundp ref-dep) |
3302 (setcdr (symbol-value ref-dep) | 3905 (setcdr (symbol-value ref-dep) |
3303 (nconc (cdr (symbol-value ref-dep)) | 3906 (nconc (cdr (symbol-value ref-dep)) |
3304 (list (symbol-value id-dep)))) | 3907 (list (symbol-value id-dep)))) |
3305 (set ref-dep (list nil (symbol-value id-dep))))) | 3908 (set ref-dep (list nil (symbol-value id-dep))))) |
3306 header)) | 3909 header)) |
3910 | |
3911 (defun gnus-extract-message-id-from-in-reply-to (string) | |
3912 (if (string-match "<[^>]+>" string) | |
3913 (substring string (match-beginning 0) (match-end 0)) | |
3914 nil)) | |
3307 | 3915 |
3308 (defun gnus-build-sparse-threads () | 3916 (defun gnus-build-sparse-threads () |
3309 (let ((headers gnus-newsgroup-headers) | 3917 (let ((headers gnus-newsgroup-headers) |
3310 (mail-parse-charset gnus-newsgroup-charset) | 3918 (mail-parse-charset gnus-newsgroup-charset) |
3311 (gnus-summary-ignore-duplicates t) | 3919 (gnus-summary-ignore-duplicates t) |
3374 (while (and (setq id (gnus-build-get-header id)) | 3982 (while (and (setq id (gnus-build-get-header id)) |
3375 (not (car (gnus-id-to-thread id))))) | 3983 (not (car (gnus-id-to-thread id))))) |
3376 (setq heads nil))))) | 3984 (setq heads nil))))) |
3377 gnus-newsgroup-dependencies))) | 3985 gnus-newsgroup-dependencies))) |
3378 | 3986 |
3987 (defsubst gnus-remove-odd-characters (string) | |
3988 "Translate STRING into something that doesn't contain weird characters." | |
3989 (mm-subst-char-in-string | |
3990 ?\r ?\- | |
3991 (mm-subst-char-in-string | |
3992 ?\n ?\- string))) | |
3993 | |
3379 ;; This function has to be called with point after the article number | 3994 ;; This function has to be called with point after the article number |
3380 ;; on the beginning of the line. | 3995 ;; on the beginning of the line. |
3381 (defsubst gnus-nov-parse-line (number dependencies &optional force-new) | 3996 (defsubst gnus-nov-parse-line (number dependencies &optional force-new) |
3382 (let ((eol (gnus-point-at-eol)) | 3997 (let ((eol (gnus-point-at-eol)) |
3383 (buffer (current-buffer)) | 3998 (buffer (current-buffer)) |
3384 header) | 3999 header references in-reply-to) |
3385 | 4000 |
3386 ;; overview: [num subject from date id refs chars lines misc] | 4001 ;; overview: [num subject from date id refs chars lines misc] |
3387 (unwind-protect | 4002 (unwind-protect |
3388 (progn | 4003 (let (x) |
3389 (narrow-to-region (point) eol) | 4004 (narrow-to-region (point) eol) |
3390 (unless (eobp) | 4005 (unless (eobp) |
3391 (forward-char)) | 4006 (forward-char)) |
3392 | 4007 |
3393 (setq header | 4008 (setq header |
3394 (make-full-mail-header | 4009 (make-full-mail-header |
3395 number ; number | 4010 number ; number |
3396 (funcall gnus-decode-encoded-word-function | 4011 (condition-case () ; subject |
3397 (nnheader-nov-field)) ; subject | 4012 (gnus-remove-odd-characters |
3398 (funcall gnus-decode-encoded-word-function | 4013 (funcall gnus-decode-encoded-word-function |
3399 (nnheader-nov-field)) ; from | 4014 (setq x (nnheader-nov-field)))) |
4015 (error x)) | |
4016 (condition-case () ; from | |
4017 (gnus-remove-odd-characters | |
4018 (funcall gnus-decode-encoded-word-function | |
4019 (setq x (nnheader-nov-field)))) | |
4020 (error x)) | |
3400 (nnheader-nov-field) ; date | 4021 (nnheader-nov-field) ; date |
3401 (nnheader-nov-read-message-id) ; id | 4022 (nnheader-nov-read-message-id) ; id |
3402 (nnheader-nov-field) ; refs | 4023 (setq references (nnheader-nov-field)) ; refs |
3403 (nnheader-nov-read-integer) ; chars | 4024 (nnheader-nov-read-integer) ; chars |
3404 (nnheader-nov-read-integer) ; lines | 4025 (nnheader-nov-read-integer) ; lines |
3405 (unless (eobp) | 4026 (unless (eobp) |
3406 (if (looking-at "Xref: ") | 4027 (if (looking-at "Xref: ") |
3407 (goto-char (match-end 0))) | 4028 (goto-char (match-end 0))) |
3408 (nnheader-nov-field)) ; Xref | 4029 (nnheader-nov-field)) ; Xref |
3409 (nnheader-nov-parse-extra)))) ; extra | 4030 (nnheader-nov-parse-extra)))) ; extra |
3410 | 4031 |
3411 (widen)) | 4032 (widen)) |
4033 | |
4034 (when (and (string= references "") | |
4035 (setq in-reply-to (mail-header-extra header)) | |
4036 (setq in-reply-to (cdr (assq 'In-Reply-To in-reply-to)))) | |
4037 (mail-header-set-references | |
4038 header (gnus-extract-message-id-from-in-reply-to in-reply-to))) | |
3412 | 4039 |
3413 (when gnus-alter-header-function | 4040 (when gnus-alter-header-function |
3414 (funcall gnus-alter-header-function header)) | 4041 (funcall gnus-alter-header-function header)) |
3415 (gnus-dependencies-add-header header dependencies force-new))) | 4042 (gnus-dependencies-add-header header dependencies force-new))) |
3416 | 4043 |
3442 (let ((number (mail-header-number header))) | 4069 (let ((number (mail-header-number header))) |
3443 (push number gnus-newsgroup-limit) | 4070 (push number gnus-newsgroup-limit) |
3444 (push header gnus-newsgroup-headers) | 4071 (push header gnus-newsgroup-headers) |
3445 (if (memq number gnus-newsgroup-unselected) | 4072 (if (memq number gnus-newsgroup-unselected) |
3446 (progn | 4073 (progn |
3447 (push number gnus-newsgroup-unreads) | 4074 (setq gnus-newsgroup-unreads |
4075 (gnus-add-to-sorted-list gnus-newsgroup-unreads | |
4076 number)) | |
3448 (setq gnus-newsgroup-unselected | 4077 (setq gnus-newsgroup-unselected |
3449 (delq number gnus-newsgroup-unselected))) | 4078 (delq number gnus-newsgroup-unselected))) |
3450 (push number gnus-newsgroup-ancient))))))) | 4079 (push number gnus-newsgroup-ancient))))))) |
3451 | 4080 |
3452 (defun gnus-build-all-threads () | 4081 (defun gnus-build-all-threads () |
3468 (set-buffer gnus-summary-buffer) | 4097 (set-buffer gnus-summary-buffer) |
3469 (push header gnus-newsgroup-headers) | 4098 (push header gnus-newsgroup-headers) |
3470 (if (memq (setq article (mail-header-number header)) | 4099 (if (memq (setq article (mail-header-number header)) |
3471 gnus-newsgroup-unselected) | 4100 gnus-newsgroup-unselected) |
3472 (progn | 4101 (progn |
3473 (push article gnus-newsgroup-unreads) | 4102 (setq gnus-newsgroup-unreads |
4103 (gnus-add-to-sorted-list | |
4104 gnus-newsgroup-unreads article)) | |
3474 (setq gnus-newsgroup-unselected | 4105 (setq gnus-newsgroup-unselected |
3475 (delq article gnus-newsgroup-unselected))) | 4106 (delq article gnus-newsgroup-unselected))) |
3476 (push article gnus-newsgroup-ancient))) | 4107 (push article gnus-newsgroup-ancient))) |
3477 (forward-line 1))))))) | 4108 (forward-line 1))))))) |
3478 | 4109 |
3479 (defun gnus-summary-update-article-line (article header) | 4110 (defun gnus-summary-update-article-line (article header) |
3480 "Update the line for ARTICLE using HEADERS." | 4111 "Update the line for ARTICLE using HEADER." |
3481 (let* ((id (mail-header-id header)) | 4112 (let* ((id (mail-header-id header)) |
3482 (thread (gnus-id-to-thread id))) | 4113 (thread (gnus-id-to-thread id))) |
3483 (unless thread | 4114 (unless thread |
3484 (error "Article in no thread")) | 4115 (error "Article in no thread")) |
3485 ;; Update the thread. | 4116 ;; Update the thread. |
3486 (setcar thread header) | 4117 (setcar thread header) |
3487 (gnus-summary-goto-subject article) | 4118 (gnus-summary-goto-subject article) |
3488 (let* ((datal (gnus-data-find-list article)) | 4119 (let* ((datal (gnus-data-find-list article)) |
3489 (data (car datal)) | 4120 (data (car datal)) |
3490 (length (when (cdr datal) | |
3491 (- (gnus-data-pos data) | |
3492 (gnus-data-pos (cadr datal))))) | |
3493 (buffer-read-only nil) | 4121 (buffer-read-only nil) |
3494 (level (gnus-summary-thread-level))) | 4122 (level (gnus-summary-thread-level))) |
3495 (gnus-delete-line) | 4123 (gnus-delete-line) |
3496 (gnus-summary-insert-line | 4124 (let ((inserted (- (point) |
3497 header level nil (gnus-article-mark article) | 4125 (progn |
3498 (memq article gnus-newsgroup-replied) | 4126 (gnus-summary-insert-line |
3499 (memq article gnus-newsgroup-expirable) | 4127 header level nil |
3500 ;; Only insert the Subject string when it's different | 4128 (memq article gnus-newsgroup-undownloaded) |
3501 ;; from the previous Subject string. | 4129 (gnus-article-mark article) |
3502 (if (and | 4130 (memq article gnus-newsgroup-replied) |
3503 gnus-show-threads | 4131 (memq article gnus-newsgroup-expirable) |
3504 (gnus-subject-equal | 4132 ;; Only insert the Subject string when it's different |
3505 (condition-case () | 4133 ;; from the previous Subject string. |
3506 (mail-header-subject | 4134 (if (and |
3507 (gnus-data-header | 4135 gnus-show-threads |
3508 (cadr | 4136 (gnus-subject-equal |
3509 (gnus-data-find-list | 4137 (condition-case () |
3510 article | 4138 (mail-header-subject |
3511 (gnus-data-list t))))) | 4139 (gnus-data-header |
3512 ;; Error on the side of excessive subjects. | 4140 (cadr |
3513 (error "")) | 4141 (gnus-data-find-list |
3514 (mail-header-subject header))) | 4142 article |
3515 "" | 4143 (gnus-data-list t))))) |
3516 (mail-header-subject header)) | 4144 ;; Error on the side of excessive subjects. |
3517 nil (cdr (assq article gnus-newsgroup-scored)) | 4145 (error "")) |
3518 (memq article gnus-newsgroup-processable)) | 4146 (mail-header-subject header))) |
3519 (when length | 4147 "" |
3520 (gnus-data-update-list | 4148 (mail-header-subject header)) |
3521 (cdr datal) (- length (- (gnus-data-pos data) (point)))))))) | 4149 nil (cdr (assq article gnus-newsgroup-scored)) |
4150 (memq article gnus-newsgroup-processable)) | |
4151 (point))))) | |
4152 (when (cdr datal) | |
4153 (gnus-data-update-list | |
4154 (cdr datal) | |
4155 (- (gnus-data-pos data) (gnus-data-pos (cadr datal)) inserted))))))) | |
3522 | 4156 |
3523 (defun gnus-summary-update-article (article &optional iheader) | 4157 (defun gnus-summary-update-article (article &optional iheader) |
3524 "Update ARTICLE in the summary buffer." | 4158 "Update ARTICLE in the summary buffer." |
3525 (set-buffer gnus-summary-buffer) | 4159 (set-buffer gnus-summary-buffer) |
3526 (let* ((header (gnus-summary-article-header article)) | 4160 (let* ((header (gnus-summary-article-header article)) |
3754 (defun gnus-sort-threads (threads) | 4388 (defun gnus-sort-threads (threads) |
3755 "Sort THREADS." | 4389 "Sort THREADS." |
3756 (if (not gnus-thread-sort-functions) | 4390 (if (not gnus-thread-sort-functions) |
3757 threads | 4391 threads |
3758 (gnus-message 8 "Sorting threads...") | 4392 (gnus-message 8 "Sorting threads...") |
3759 (prog1 | 4393 (let ((max-lisp-eval-depth 5000)) |
3760 (gnus-sort-threads-1 | 4394 (prog1 (gnus-sort-threads-1 |
3761 threads | 4395 threads |
3762 (gnus-make-sort-function gnus-thread-sort-functions)) | 4396 (gnus-make-sort-function gnus-thread-sort-functions)) |
3763 (gnus-message 8 "Sorting threads...done")))) | 4397 (gnus-message 8 "Sorting threads...done"))))) |
3764 | 4398 |
3765 (defun gnus-sort-articles (articles) | 4399 (defun gnus-sort-articles (articles) |
3766 "Sort ARTICLES." | 4400 "Sort ARTICLES." |
3767 (when gnus-article-sort-functions | 4401 (when gnus-article-sort-functions |
3768 (gnus-message 7 "Sorting articles...") | 4402 (gnus-message 7 "Sorting articles...") |
3788 (mail-header-number h2))) | 4422 (mail-header-number h2))) |
3789 | 4423 |
3790 (defun gnus-thread-sort-by-number (h1 h2) | 4424 (defun gnus-thread-sort-by-number (h1 h2) |
3791 "Sort threads by root article number." | 4425 "Sort threads by root article number." |
3792 (gnus-article-sort-by-number | 4426 (gnus-article-sort-by-number |
4427 (gnus-thread-header h1) (gnus-thread-header h2))) | |
4428 | |
4429 (defsubst gnus-article-sort-by-random (h1 h2) | |
4430 "Sort articles by article number." | |
4431 (zerop (random 2))) | |
4432 | |
4433 (defun gnus-thread-sort-by-random (h1 h2) | |
4434 "Sort threads by root article number." | |
4435 (gnus-article-sort-by-random | |
3793 (gnus-thread-header h1) (gnus-thread-header h2))) | 4436 (gnus-thread-header h1) (gnus-thread-header h2))) |
3794 | 4437 |
3795 (defsubst gnus-article-sort-by-lines (h1 h2) | 4438 (defsubst gnus-article-sort-by-lines (h1 h2) |
3796 "Sort articles by article Lines header." | 4439 "Sort articles by article Lines header." |
3797 (< (mail-header-lines h1) | 4440 (< (mail-header-lines h1) |
3871 Unscored articles will be counted as having a score of zero." | 4514 Unscored articles will be counted as having a score of zero." |
3872 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2))) | 4515 (> (gnus-thread-total-score h1) (gnus-thread-total-score h2))) |
3873 | 4516 |
3874 (defun gnus-thread-total-score (thread) | 4517 (defun gnus-thread-total-score (thread) |
3875 ;; This function find the total score of THREAD. | 4518 ;; This function find the total score of THREAD. |
3876 (cond ((null thread) | 4519 (cond |
3877 0) | 4520 ((null thread) |
3878 ((consp thread) | 4521 0) |
3879 (if (stringp (car thread)) | 4522 ((consp thread) |
3880 (apply gnus-thread-score-function 0 | 4523 (if (stringp (car thread)) |
3881 (mapcar 'gnus-thread-total-score-1 (cdr thread))) | 4524 (apply gnus-thread-score-function 0 |
3882 (gnus-thread-total-score-1 thread))) | 4525 (mapcar 'gnus-thread-total-score-1 (cdr thread))) |
3883 (t | 4526 (gnus-thread-total-score-1 thread))) |
3884 (gnus-thread-total-score-1 (list thread))))) | 4527 (t |
4528 (gnus-thread-total-score-1 (list thread))))) | |
4529 | |
4530 (defun gnus-thread-sort-by-most-recent-number (h1 h2) | |
4531 "Sort threads such that the thread with the most recently arrived article comes first." | |
4532 (> (gnus-thread-highest-number h1) (gnus-thread-highest-number h2))) | |
4533 | |
4534 (defun gnus-thread-highest-number (thread) | |
4535 "Return the highest article number in THREAD." | |
4536 (apply 'max (mapcar (lambda (header) | |
4537 (mail-header-number header)) | |
4538 (message-flatten-list thread)))) | |
4539 | |
4540 (defun gnus-thread-sort-by-most-recent-date (h1 h2) | |
4541 "Sort threads such that the thread with the most recently dated article comes first." | |
4542 (> (gnus-thread-latest-date h1) (gnus-thread-latest-date h2))) | |
4543 | |
4544 (defun gnus-thread-latest-date (thread) | |
4545 "Return the highest article date in THREAD." | |
4546 (let ((previous-time 0)) | |
4547 (apply 'max | |
4548 (mapcar | |
4549 (lambda (header) | |
4550 (setq previous-time | |
4551 (condition-case () | |
4552 (time-to-seconds (mail-header-parse-date | |
4553 (mail-header-date header))) | |
4554 (error previous-time)))) | |
4555 (sort | |
4556 (message-flatten-list thread) | |
4557 (lambda (h1 h2) | |
4558 (< (mail-header-number h1) | |
4559 (mail-header-number h2)))))))) | |
3885 | 4560 |
3886 (defun gnus-thread-total-score-1 (root) | 4561 (defun gnus-thread-total-score-1 (root) |
3887 ;; This function find the total score of the thread below ROOT. | 4562 ;; This function find the total score of the thread below ROOT. |
3888 (setq root (car root)) | 4563 (setq root (car root)) |
3889 (apply gnus-thread-score-function | 4564 (apply gnus-thread-score-function |
3907 (defun gnus-extra-header (type &optional header) | 4582 (defun gnus-extra-header (type &optional header) |
3908 "Return the extra header of TYPE." | 4583 "Return the extra header of TYPE." |
3909 (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header)))) | 4584 (or (cdr (assq type (mail-header-extra (or header gnus-tmp-header)))) |
3910 "")) | 4585 "")) |
3911 | 4586 |
4587 (defvar gnus-tmp-thread-tree-header-string "") | |
4588 | |
4589 (defcustom gnus-sum-thread-tree-root "> " | |
4590 "With %B spec, used for the root of a thread. | |
4591 If nil, use subject instead." | |
4592 :type '(radio (const :format "%v " nil) (string :size 0)) | |
4593 :group 'gnus-thread) | |
4594 (defcustom gnus-sum-thread-tree-false-root "> " | |
4595 "With %B spec, used for a false root of a thread. | |
4596 If nil, use subject instead." | |
4597 :type '(radio (const :format "%v " nil) (string :size 0)) | |
4598 :group 'gnus-thread) | |
4599 (defcustom gnus-sum-thread-tree-single-indent "" | |
4600 "With %B spec, used for a thread with just one message. | |
4601 If nil, use subject instead." | |
4602 :type '(radio (const :format "%v " nil) (string :size 0)) | |
4603 :group 'gnus-thread) | |
4604 (defcustom gnus-sum-thread-tree-vertical "| " | |
4605 "With %B spec, used for drawing a vertical line." | |
4606 :type 'string | |
4607 :group 'gnus-thread) | |
4608 (defcustom gnus-sum-thread-tree-indent " " | |
4609 "With %B spec, used for indenting." | |
4610 :type 'string | |
4611 :group 'gnus-thread) | |
4612 (defcustom gnus-sum-thread-tree-leaf-with-other "+-> " | |
4613 "With %B spec, used for a leaf with brothers." | |
4614 :type 'string | |
4615 :group 'gnus-thread) | |
4616 (defcustom gnus-sum-thread-tree-single-leaf "\\-> " | |
4617 "With %B spec, used for a leaf without brothers." | |
4618 :type 'string | |
4619 :group 'gnus-thread) | |
4620 | |
3912 (defun gnus-summary-prepare-threads (threads) | 4621 (defun gnus-summary-prepare-threads (threads) |
3913 "Prepare summary buffer from THREADS and indentation LEVEL. | 4622 "Prepare summary buffer from THREADS and indentation LEVEL. |
3914 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])' | 4623 THREADS is either a list of `(PARENT [(CHILD1 [(GRANDCHILD ...]...) ...])' |
3915 or a straight list of headers." | 4624 or a straight list of headers." |
3916 (gnus-message 7 "Generating summary...") | 4625 (gnus-message 7 "Generating summary...") |
3919 (beginning-of-line) | 4628 (beginning-of-line) |
3920 | 4629 |
3921 (let ((gnus-tmp-level 0) | 4630 (let ((gnus-tmp-level 0) |
3922 (default-score (or gnus-summary-default-score 0)) | 4631 (default-score (or gnus-summary-default-score 0)) |
3923 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight)) | 4632 (gnus-visual-p (gnus-visual-p 'summary-highlight 'highlight)) |
4633 (building-line-count gnus-summary-display-while-building) | |
4634 (building-count (integerp gnus-summary-display-while-building)) | |
3924 thread number subject stack state gnus-tmp-gathered beg-match | 4635 thread number subject stack state gnus-tmp-gathered beg-match |
3925 new-roots gnus-tmp-new-adopts thread-end | 4636 new-roots gnus-tmp-new-adopts thread-end simp-subject |
3926 gnus-tmp-header gnus-tmp-unread | 4637 gnus-tmp-header gnus-tmp-unread gnus-tmp-downloaded |
3927 gnus-tmp-replied gnus-tmp-subject-or-nil | 4638 gnus-tmp-replied gnus-tmp-subject-or-nil |
3928 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score | 4639 gnus-tmp-dummy gnus-tmp-indentation gnus-tmp-lines gnus-tmp-score |
3929 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name | 4640 gnus-tmp-score-char gnus-tmp-from gnus-tmp-name |
3930 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket) | 4641 gnus-tmp-number gnus-tmp-opening-bracket gnus-tmp-closing-bracket |
3931 | 4642 tree-stack) |
3932 (setq gnus-tmp-prev-subject nil) | 4643 |
4644 (setq gnus-tmp-prev-subject nil | |
4645 gnus-tmp-thread-tree-header-string "") | |
3933 | 4646 |
3934 (if (vectorp (car threads)) | 4647 (if (vectorp (car threads)) |
3935 ;; If this is a straight (sic) list of headers, then a | 4648 ;; If this is a straight (sic) list of headers, then a |
3936 ;; threaded summary display isn't required, so we just create | 4649 ;; threaded summary display isn't required, so we just create |
3937 ;; an unthreaded one. | 4650 ;; an unthreaded one. |
3938 (gnus-summary-prepare-unthreaded threads) | 4651 (gnus-summary-prepare-unthreaded threads) |
3939 | 4652 |
3940 ;; Do the threaded display. | 4653 ;; Do the threaded display. |
3941 | 4654 |
4655 (if gnus-summary-display-while-building | |
4656 (switch-to-buffer (buffer-name))) | |
3942 (while (or threads stack gnus-tmp-new-adopts new-roots) | 4657 (while (or threads stack gnus-tmp-new-adopts new-roots) |
3943 | 4658 |
3944 (if (and (= gnus-tmp-level 0) | 4659 (if (and (= gnus-tmp-level 0) |
3945 (or (not stack) | 4660 (or (not stack) |
3946 (= (caar stack) 0)) | 4661 (= (caar stack) 0)) |
3963 gnus-tmp-header (caar thread)) | 4678 gnus-tmp-header (caar thread)) |
3964 ;; There were no current threads, so we pop something off | 4679 ;; There were no current threads, so we pop something off |
3965 ;; the stack. | 4680 ;; the stack. |
3966 (setq state (car stack) | 4681 (setq state (car stack) |
3967 gnus-tmp-level (car state) | 4682 gnus-tmp-level (car state) |
3968 thread (cdr state) | 4683 tree-stack (cadr state) |
4684 thread (caddr state) | |
3969 stack (cdr stack) | 4685 stack (cdr stack) |
3970 gnus-tmp-header (caar thread)))) | 4686 gnus-tmp-header (caar thread)))) |
3971 | 4687 |
3972 (setq gnus-tmp-false-parent nil) | 4688 (setq gnus-tmp-false-parent nil) |
3973 (setq gnus-tmp-root-expunged nil) | 4689 (setq gnus-tmp-root-expunged nil) |
4007 ;; We do not make a root for the gathered | 4723 ;; We do not make a root for the gathered |
4008 ;; sub-threads at all. | 4724 ;; sub-threads at all. |
4009 (setq gnus-tmp-level -1))) | 4725 (setq gnus-tmp-level -1))) |
4010 | 4726 |
4011 (setq number (mail-header-number gnus-tmp-header) | 4727 (setq number (mail-header-number gnus-tmp-header) |
4012 subject (mail-header-subject gnus-tmp-header)) | 4728 subject (mail-header-subject gnus-tmp-header) |
4729 simp-subject (gnus-simplify-subject-fully subject)) | |
4013 | 4730 |
4014 (cond | 4731 (cond |
4015 ;; If the thread has changed subject, we might want to make | 4732 ;; If the thread has changed subject, we might want to make |
4016 ;; this subthread into a root. | 4733 ;; this subthread into a root. |
4017 ((and (null gnus-thread-ignore-subject) | 4734 ((and (null gnus-thread-ignore-subject) |
4018 (not (zerop gnus-tmp-level)) | 4735 (not (zerop gnus-tmp-level)) |
4019 gnus-tmp-prev-subject | 4736 gnus-tmp-prev-subject |
4020 (not (inline | 4737 (not (string= gnus-tmp-prev-subject simp-subject))) |
4021 (gnus-subject-equal gnus-tmp-prev-subject subject)))) | |
4022 (setq new-roots (nconc new-roots (list (car thread))) | 4738 (setq new-roots (nconc new-roots (list (car thread))) |
4023 thread-end t | 4739 thread-end t |
4024 gnus-tmp-header nil)) | 4740 gnus-tmp-header nil)) |
4025 ;; If the article lies outside the current limit, | 4741 ;; If the article lies outside the current limit, |
4026 ;; then we do not display it. | 4742 ;; then we do not display it. |
4047 (not (gnus-summary-article-sparse-p number)) | 4763 (not (gnus-summary-article-sparse-p number)) |
4048 (not (gnus-summary-article-ancient-p number))) | 4764 (not (gnus-summary-article-ancient-p number))) |
4049 (setq gnus-newsgroup-unreads | 4765 (setq gnus-newsgroup-unreads |
4050 (delq number gnus-newsgroup-unreads)) | 4766 (delq number gnus-newsgroup-unreads)) |
4051 (if gnus-newsgroup-auto-expire | 4767 (if gnus-newsgroup-auto-expire |
4052 (push number gnus-newsgroup-expirable) | 4768 (setq gnus-newsgroup-expirable |
4769 (gnus-add-to-sorted-list | |
4770 gnus-newsgroup-expirable number)) | |
4053 (push (cons number gnus-low-score-mark) | 4771 (push (cons number gnus-low-score-mark) |
4054 gnus-newsgroup-reads)))) | 4772 gnus-newsgroup-reads)))) |
4055 | 4773 |
4056 (when gnus-tmp-header | 4774 (when gnus-tmp-header |
4057 ;; We may have an old dummy line to output before this | 4775 ;; We may have an old dummy line to output before this |
4075 (setq | 4793 (setq |
4076 gnus-tmp-subject-or-nil | 4794 gnus-tmp-subject-or-nil |
4077 (cond | 4795 (cond |
4078 ((and gnus-thread-ignore-subject | 4796 ((and gnus-thread-ignore-subject |
4079 gnus-tmp-prev-subject | 4797 gnus-tmp-prev-subject |
4080 (not (inline (gnus-subject-equal | 4798 (not (string= gnus-tmp-prev-subject simp-subject))) |
4081 gnus-tmp-prev-subject subject)))) | |
4082 subject) | 4799 subject) |
4083 ((zerop gnus-tmp-level) | 4800 ((zerop gnus-tmp-level) |
4084 (if (and (eq gnus-summary-make-false-root 'empty) | 4801 (if (and (eq gnus-summary-make-false-root 'empty) |
4085 (memq number gnus-tmp-gathered) | 4802 (memq number gnus-tmp-gathered) |
4086 gnus-tmp-prev-subject | 4803 gnus-tmp-prev-subject |
4087 (inline (gnus-subject-equal | 4804 (string= gnus-tmp-prev-subject simp-subject)) |
4088 gnus-tmp-prev-subject subject))) | |
4089 gnus-summary-same-subject | 4805 gnus-summary-same-subject |
4090 subject)) | 4806 subject)) |
4091 (t gnus-summary-same-subject))) | 4807 (t gnus-summary-same-subject))) |
4092 (if (and (eq gnus-summary-make-false-root 'adopt) | 4808 (if (and (eq gnus-summary-make-false-root 'adopt) |
4093 (= gnus-tmp-level 1) | 4809 (= gnus-tmp-level 1) |
4104 gnus-summary-default-score 0) | 4820 gnus-summary-default-score 0) |
4105 gnus-tmp-score-char | 4821 gnus-tmp-score-char |
4106 (if (or (null gnus-summary-default-score) | 4822 (if (or (null gnus-summary-default-score) |
4107 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) | 4823 (<= (abs (- gnus-tmp-score gnus-summary-default-score)) |
4108 gnus-summary-zcore-fuzz)) | 4824 gnus-summary-zcore-fuzz)) |
4109 ? ;Whitespace | 4825 ? ;Whitespace |
4110 (if (< gnus-tmp-score gnus-summary-default-score) | 4826 (if (< gnus-tmp-score gnus-summary-default-score) |
4111 gnus-score-below-mark gnus-score-over-mark)) | 4827 gnus-score-below-mark gnus-score-over-mark)) |
4112 gnus-tmp-replied | 4828 gnus-tmp-replied |
4113 (cond ((memq number gnus-newsgroup-processable) | 4829 (cond ((memq number gnus-newsgroup-processable) |
4114 gnus-process-mark) | 4830 gnus-process-mark) |
4115 ((memq number gnus-newsgroup-cached) | 4831 ((memq number gnus-newsgroup-cached) |
4116 gnus-cached-mark) | 4832 gnus-cached-mark) |
4117 ((memq number gnus-newsgroup-replied) | 4833 ((memq number gnus-newsgroup-replied) |
4118 gnus-replied-mark) | 4834 gnus-replied-mark) |
4835 ((memq number gnus-newsgroup-forwarded) | |
4836 gnus-forwarded-mark) | |
4119 ((memq number gnus-newsgroup-saved) | 4837 ((memq number gnus-newsgroup-saved) |
4120 gnus-saved-mark) | 4838 gnus-saved-mark) |
4121 (t gnus-unread-mark)) | 4839 ((memq number gnus-newsgroup-recent) |
4840 gnus-recent-mark) | |
4841 ((memq number gnus-newsgroup-unseen) | |
4842 gnus-unseen-mark) | |
4843 (t gnus-no-mark)) | |
4844 gnus-tmp-downloaded | |
4845 (cond ((memq number gnus-newsgroup-undownloaded) | |
4846 gnus-undownloaded-mark) | |
4847 (gnus-newsgroup-agentized | |
4848 gnus-downloaded-mark) | |
4849 (t | |
4850 gnus-no-mark)) | |
4122 gnus-tmp-from (mail-header-from gnus-tmp-header) | 4851 gnus-tmp-from (mail-header-from gnus-tmp-header) |
4123 gnus-tmp-name | 4852 gnus-tmp-name |
4124 (cond | 4853 (cond |
4125 ((string-match "<[^>]+> *$" gnus-tmp-from) | 4854 ((string-match "<[^>]+> *$" gnus-tmp-from) |
4126 (setq beg-match (match-beginning 0)) | 4855 (setq beg-match (match-beginning 0)) |
4127 (or (and (string-match "^\"[^\"]*\"" gnus-tmp-from) | 4856 (or (and (string-match "^\".+\"" gnus-tmp-from) |
4128 (substring gnus-tmp-from (1+ (match-beginning 0)) | 4857 (substring gnus-tmp-from 1 (1- (match-end 0)))) |
4129 (1- (match-end 0)))) | |
4130 (substring gnus-tmp-from 0 beg-match))) | 4858 (substring gnus-tmp-from 0 beg-match))) |
4131 ((string-match "(.+)" gnus-tmp-from) | 4859 ((string-match "(.+)" gnus-tmp-from) |
4132 (substring gnus-tmp-from | 4860 (substring gnus-tmp-from |
4133 (1+ (match-beginning 0)) (1- (match-end 0)))) | 4861 (1+ (match-beginning 0)) (1- (match-end 0)))) |
4134 (t gnus-tmp-from))) | 4862 (t gnus-tmp-from)) |
4863 | |
4864 ;; Do the %B string | |
4865 gnus-tmp-thread-tree-header-string | |
4866 (cond | |
4867 ((not gnus-show-threads) "") | |
4868 ((zerop gnus-tmp-level) | |
4869 (cond ((cdar thread) | |
4870 (or gnus-sum-thread-tree-root subject)) | |
4871 (gnus-tmp-new-adopts | |
4872 (or gnus-sum-thread-tree-false-root subject)) | |
4873 (t | |
4874 (or gnus-sum-thread-tree-single-indent subject)))) | |
4875 (t | |
4876 (concat (apply 'concat | |
4877 (mapcar (lambda (item) | |
4878 (if (= item 1) | |
4879 gnus-sum-thread-tree-vertical | |
4880 gnus-sum-thread-tree-indent)) | |
4881 (cdr (reverse tree-stack)))) | |
4882 (if (nth 1 thread) | |
4883 gnus-sum-thread-tree-leaf-with-other | |
4884 gnus-sum-thread-tree-single-leaf))))) | |
4135 (when (string= gnus-tmp-name "") | 4885 (when (string= gnus-tmp-name "") |
4136 (setq gnus-tmp-name gnus-tmp-from)) | 4886 (setq gnus-tmp-name gnus-tmp-from)) |
4137 (unless (numberp gnus-tmp-lines) | 4887 (unless (numberp gnus-tmp-lines) |
4138 (setq gnus-tmp-lines 0)) | 4888 (setq gnus-tmp-lines -1)) |
4139 (gnus-put-text-property | 4889 (if (= gnus-tmp-lines -1) |
4890 (setq gnus-tmp-lines "?") | |
4891 (setq gnus-tmp-lines (number-to-string gnus-tmp-lines))) | |
4892 (gnus-put-text-property | |
4140 (point) | 4893 (point) |
4141 (progn (eval gnus-summary-line-format-spec) (point)) | 4894 (progn (eval gnus-summary-line-format-spec) (point)) |
4142 'gnus-number number) | 4895 'gnus-number number) |
4143 (when gnus-visual-p | 4896 (when gnus-visual-p |
4144 (forward-line -1) | 4897 (forward-line -1) |
4145 (gnus-run-hooks 'gnus-summary-update-hook) | 4898 (gnus-run-hooks 'gnus-summary-update-hook) |
4146 (forward-line 1)) | 4899 (forward-line 1)) |
4147 | 4900 |
4148 (setq gnus-tmp-prev-subject subject))) | 4901 (setq gnus-tmp-prev-subject simp-subject))) |
4149 | 4902 |
4150 (when (nth 1 thread) | 4903 (when (nth 1 thread) |
4151 (push (cons (max 0 gnus-tmp-level) (nthcdr 1 thread)) stack)) | 4904 (push (list (max 0 gnus-tmp-level) |
4905 (copy-sequence tree-stack) | |
4906 (nthcdr 1 thread)) | |
4907 stack)) | |
4908 (push (if (nth 1 thread) 1 0) tree-stack) | |
4152 (incf gnus-tmp-level) | 4909 (incf gnus-tmp-level) |
4153 (setq threads (if thread-end nil (cdar thread))) | 4910 (setq threads (if thread-end nil (cdar thread))) |
4911 (if gnus-summary-display-while-building | |
4912 (if building-count | |
4913 (progn | |
4914 ;; use a set frequency | |
4915 (setq building-line-count (1- building-line-count)) | |
4916 (when (= building-line-count 0) | |
4917 (sit-for 0) | |
4918 (setq building-line-count | |
4919 gnus-summary-display-while-building))) | |
4920 ;; always | |
4921 (sit-for 0))) | |
4154 (unless threads | 4922 (unless threads |
4155 (setq gnus-tmp-level 0))))) | 4923 (setq gnus-tmp-level 0))))) |
4156 (gnus-message 7 "Generating summary...done")) | 4924 (gnus-message 7 "Generating summary...done")) |
4157 | 4925 |
4158 (defun gnus-summary-prepare-unthreaded (headers) | 4926 (defun gnus-summary-prepare-unthreaded (headers) |
4182 (setq mark (gnus-article-mark number)) | 4950 (setq mark (gnus-article-mark number)) |
4183 (push (gnus-data-make number mark (1+ (point)) header 0) | 4951 (push (gnus-data-make number mark (1+ (point)) header 0) |
4184 gnus-newsgroup-data) | 4952 gnus-newsgroup-data) |
4185 (gnus-summary-insert-line | 4953 (gnus-summary-insert-line |
4186 header 0 number | 4954 header 0 number |
4955 (memq number gnus-newsgroup-undownloaded) | |
4187 mark (memq number gnus-newsgroup-replied) | 4956 mark (memq number gnus-newsgroup-replied) |
4188 (memq number gnus-newsgroup-expirable) | 4957 (memq number gnus-newsgroup-expirable) |
4189 (mail-header-subject header) nil | 4958 (mail-header-subject header) nil |
4190 (cdr (assq number gnus-newsgroup-scored)) | 4959 (cdr (assq number gnus-newsgroup-scored)) |
4191 (memq number gnus-newsgroup-processable)))))) | 4960 (memq number gnus-newsgroup-processable)))))) |
4192 | 4961 |
4193 (defun gnus-summary-remove-list-identifiers () | 4962 (defun gnus-summary-remove-list-identifiers () |
4194 "Remove list identifiers in `gnus-list-identifiers' from articles in the current group." | 4963 "Remove list identifiers in `gnus-list-identifiers' from articles in the current group." |
4195 (let ((regexp (if (stringp gnus-list-identifiers) | 4964 (let ((regexp (if (consp gnus-list-identifiers) |
4196 gnus-list-identifiers | 4965 (mapconcat 'identity gnus-list-identifiers " *\\|") |
4197 (mapconcat 'identity gnus-list-identifiers " *\\|")))) | 4966 gnus-list-identifiers)) |
4198 (dolist (header gnus-newsgroup-headers) | 4967 changed subject) |
4199 (when (string-match (concat "\\(\\(\\(Re: +\\)?\\(" regexp | 4968 (when regexp |
4200 " *\\)\\)+\\(Re: +\\)?\\)") | 4969 (dolist (header gnus-newsgroup-headers) |
4201 (mail-header-subject header)) | 4970 (setq subject (mail-header-subject header) |
4202 (mail-header-set-subject | 4971 changed nil) |
4203 header (concat (substring (mail-header-subject header) | 4972 (while (string-match |
4204 0 (match-beginning 1)) | 4973 (concat "^\\(R[Ee]: +\\)*\\(" regexp " *\\)") |
4205 (or | 4974 subject) |
4206 (match-string 3 (mail-header-subject header)) | 4975 (setq subject |
4207 (match-string 5 (mail-header-subject header))) | 4976 (concat (substring subject 0 (match-beginning 2)) |
4208 (substring (mail-header-subject header) | 4977 (substring subject (match-end 0))) |
4209 (match-end 1)))))))) | 4978 changed t)) |
4979 (when (and changed | |
4980 (string-match | |
4981 "^\\(\\(R[Ee]: +\\)+\\)R[Ee]: +" subject)) | |
4982 (setq subject | |
4983 (concat (substring subject 0 (match-beginning 1)) | |
4984 (substring subject (match-end 1))))) | |
4985 (when changed | |
4986 (mail-header-set-subject header subject)))))) | |
4987 | |
4988 (defun gnus-fetch-headers (articles) | |
4989 "Fetch headers of ARTICLES." | |
4990 (let ((name (gnus-group-decoded-name gnus-newsgroup-name))) | |
4991 (gnus-message 5 "Fetching headers for %s..." name) | |
4992 (prog1 | |
4993 (if (eq 'nov | |
4994 (setq gnus-headers-retrieved-by | |
4995 (gnus-retrieve-headers | |
4996 articles gnus-newsgroup-name | |
4997 ;; We might want to fetch old headers, but | |
4998 ;; not if there is only 1 article. | |
4999 (and (or (and | |
5000 (not (eq gnus-fetch-old-headers 'some)) | |
5001 (not (numberp gnus-fetch-old-headers))) | |
5002 (> (length articles) 1)) | |
5003 gnus-fetch-old-headers)))) | |
5004 (gnus-get-newsgroup-headers-xover | |
5005 articles nil nil gnus-newsgroup-name t) | |
5006 (gnus-get-newsgroup-headers)) | |
5007 (gnus-message 5 "Fetching headers for %s...done" name)))) | |
4210 | 5008 |
4211 (defun gnus-select-newsgroup (group &optional read-all select-articles) | 5009 (defun gnus-select-newsgroup (group &optional read-all select-articles) |
4212 "Select newsgroup GROUP. | 5010 "Select newsgroup GROUP. |
4213 If READ-ALL is non-nil, all articles in the group are selected. | 5011 If READ-ALL is non-nil, all articles in the group are selected. |
4214 If SELECT-ARTICLES, only select those articles from GROUP." | 5012 If SELECT-ARTICLES, only select those articles from GROUP." |
4215 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) | 5013 (let* ((entry (gnus-gethash group gnus-newsrc-hashtb)) |
4216 ;;!!! Dirty hack; should be removed. | 5014 ;;!!! Dirty hack; should be removed. |
4217 (gnus-summary-ignore-duplicates | 5015 (gnus-summary-ignore-duplicates |
4218 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) | 5016 (if (eq (car (gnus-find-method-for-group group)) 'nnvirtual) |
4219 t | 5017 t |
4220 gnus-summary-ignore-duplicates)) | 5018 gnus-summary-ignore-duplicates)) |
4221 (info (nth 2 entry)) | 5019 (info (nth 2 entry)) |
4222 articles fetched-articles cached) | 5020 articles fetched-articles cached) |
4223 | 5021 |
4228 | 5026 |
4229 (or (and entry (not (eq (car entry) t))) ; Either it's active... | 5027 (or (and entry (not (eq (car entry) t))) ; Either it's active... |
4230 (gnus-activate-group group) ; Or we can activate it... | 5028 (gnus-activate-group group) ; Or we can activate it... |
4231 (progn ; Or we bug out. | 5029 (progn ; Or we bug out. |
4232 (when (equal major-mode 'gnus-summary-mode) | 5030 (when (equal major-mode 'gnus-summary-mode) |
4233 (kill-buffer (current-buffer))) | 5031 (gnus-kill-buffer (current-buffer))) |
4234 (error "Couldn't request group %s: %s" | 5032 (error "Couldn't activate group %s: %s" |
4235 group (gnus-status-message group)))) | 5033 group (gnus-status-message group)))) |
4236 | 5034 |
4237 (unless (gnus-request-group group t) | 5035 (unless (gnus-request-group group t) |
4238 (when (equal major-mode 'gnus-summary-mode) | 5036 (when (equal major-mode 'gnus-summary-mode) |
4239 (kill-buffer (current-buffer))) | 5037 (gnus-kill-buffer (current-buffer))) |
4240 (error "Couldn't request group %s: %s" | 5038 (error "Couldn't request group %s: %s" |
4241 group (gnus-status-message group))) | 5039 group (gnus-status-message group))) |
4242 | 5040 |
4243 (setq gnus-newsgroup-name group) | 5041 (when gnus-agent |
4244 (setq gnus-newsgroup-unselected nil) | 5042 ;; The agent may be storing articles that are no longer in the |
4245 (setq gnus-newsgroup-unreads (gnus-list-of-unread-articles group)) | 5043 ;; server's active range. If that is the case, the active range |
5044 ;; needs to be expanded such that the agent's articles can be | |
5045 ;; included in the summary. | |
5046 (let* ((gnus-command-method (gnus-find-method-for-group group)) | |
5047 (alist (gnus-agent-load-alist group)) | |
5048 (active (gnus-active group))) | |
5049 (if (and (car alist) | |
5050 (< (caar alist) (car active))) | |
5051 (gnus-set-active group (cons (caar alist) (cdr active))))) | |
5052 | |
5053 (setq gnus-summary-use-undownloaded-faces | |
5054 (gnus-agent-find-parameter | |
5055 group | |
5056 'agent-enable-undownloaded-faces))) | |
5057 | |
5058 (setq gnus-newsgroup-name group | |
5059 gnus-newsgroup-unselected nil | |
5060 gnus-newsgroup-unreads (gnus-list-of-unread-articles group)) | |
5061 | |
5062 (let ((display (gnus-group-find-parameter group 'display))) | |
5063 (setq gnus-newsgroup-display | |
5064 (cond | |
5065 ((not (zerop (or (car-safe read-all) 0))) | |
5066 ;; The user entered the group with C-u SPC/RET, let's show | |
5067 ;; all articles. | |
5068 'gnus-not-ignore) | |
5069 ((eq display 'all) | |
5070 'gnus-not-ignore) | |
5071 ((arrayp display) | |
5072 (gnus-summary-display-make-predicate (mapcar 'identity display))) | |
5073 ((numberp display) | |
5074 ;; The following is probably the "correct" solution, but | |
5075 ;; it makes Gnus fetch all headers and then limit the | |
5076 ;; articles (which is slow), so instead we hack the | |
5077 ;; select-articles parameter instead. -- Simon Josefsson | |
5078 ;; <jas@kth.se> | |
5079 ;; | |
5080 ;; (gnus-byte-compile | |
5081 ;; `(lambda () (> number ,(- (cdr (gnus-active group)) | |
5082 ;; display))))) | |
5083 (setq select-articles | |
5084 (gnus-uncompress-range | |
5085 (cons (let ((tmp (- (cdr (gnus-active group)) display))) | |
5086 (if (> tmp 0) | |
5087 tmp | |
5088 1)) | |
5089 (cdr (gnus-active group))))) | |
5090 nil) | |
5091 (t | |
5092 nil)))) | |
5093 | |
4246 (gnus-summary-setup-default-charset) | 5094 (gnus-summary-setup-default-charset) |
5095 | |
5096 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
5097 (when (gnus-virtual-group-p group) | |
5098 (setq cached gnus-newsgroup-cached)) | |
5099 | |
5100 (setq gnus-newsgroup-unreads | |
5101 (gnus-sorted-ndifference | |
5102 (gnus-sorted-ndifference gnus-newsgroup-unreads | |
5103 gnus-newsgroup-marked) | |
5104 gnus-newsgroup-dormant)) | |
5105 | |
5106 (setq gnus-newsgroup-processable nil) | |
5107 | |
5108 (gnus-update-read-articles group gnus-newsgroup-unreads) | |
4247 | 5109 |
4248 ;; Adjust and set lists of article marks. | 5110 ;; Adjust and set lists of article marks. |
4249 (when info | 5111 (when info |
4250 (gnus-adjust-marked-articles info)) | 5112 (gnus-adjust-marked-articles info)) |
4251 | |
4252 ;; Kludge to avoid having cached articles nixed out in virtual groups. | |
4253 (when (gnus-virtual-group-p group) | |
4254 (setq cached gnus-newsgroup-cached)) | |
4255 | |
4256 (setq gnus-newsgroup-unreads | |
4257 (gnus-set-difference | |
4258 (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked) | |
4259 gnus-newsgroup-dormant)) | |
4260 | |
4261 (setq gnus-newsgroup-processable nil) | |
4262 | |
4263 (gnus-update-read-articles group gnus-newsgroup-unreads) | |
4264 | |
4265 (if (setq articles select-articles) | 5113 (if (setq articles select-articles) |
4266 (setq gnus-newsgroup-unselected | 5114 (setq gnus-newsgroup-unselected |
4267 (gnus-sorted-intersection | 5115 (gnus-sorted-difference gnus-newsgroup-unreads articles)) |
4268 gnus-newsgroup-unreads | |
4269 (gnus-sorted-complement gnus-newsgroup-unreads articles))) | |
4270 (setq articles (gnus-articles-to-read group read-all))) | 5116 (setq articles (gnus-articles-to-read group read-all))) |
4271 | 5117 |
4272 (cond | 5118 (cond |
4273 ((null articles) | 5119 ((null articles) |
4274 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display") | 5120 ;;(gnus-message 3 "Couldn't select newsgroup -- no articles to display") |
4278 ;; Init the dependencies hash table. | 5124 ;; Init the dependencies hash table. |
4279 (setq gnus-newsgroup-dependencies | 5125 (setq gnus-newsgroup-dependencies |
4280 (gnus-make-hashtable (length articles))) | 5126 (gnus-make-hashtable (length articles))) |
4281 (gnus-set-global-variables) | 5127 (gnus-set-global-variables) |
4282 ;; Retrieve the headers and read them in. | 5128 ;; Retrieve the headers and read them in. |
4283 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) | 5129 |
4284 (setq gnus-newsgroup-headers | 5130 (setq gnus-newsgroup-headers (gnus-fetch-headers articles)) |
4285 (if (eq 'nov | |
4286 (setq gnus-headers-retrieved-by | |
4287 (gnus-retrieve-headers | |
4288 articles gnus-newsgroup-name | |
4289 ;; We might want to fetch old headers, but | |
4290 ;; not if there is only 1 article. | |
4291 (and (or (and | |
4292 (not (eq gnus-fetch-old-headers 'some)) | |
4293 (not (numberp gnus-fetch-old-headers))) | |
4294 (> (length articles) 1)) | |
4295 gnus-fetch-old-headers)))) | |
4296 (gnus-get-newsgroup-headers-xover | |
4297 articles nil nil gnus-newsgroup-name t) | |
4298 (gnus-get-newsgroup-headers))) | |
4299 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name) | |
4300 | 5131 |
4301 ;; Kludge to avoid having cached articles nixed out in virtual groups. | 5132 ;; Kludge to avoid having cached articles nixed out in virtual groups. |
4302 (when cached | 5133 (when cached |
4303 (setq gnus-newsgroup-cached cached)) | 5134 (setq gnus-newsgroup-cached cached)) |
4304 | 5135 |
4307 (gnus-dup-suppress-articles)) | 5138 (gnus-dup-suppress-articles)) |
4308 | 5139 |
4309 ;; Set the initial limit. | 5140 ;; Set the initial limit. |
4310 (setq gnus-newsgroup-limit (copy-sequence articles)) | 5141 (setq gnus-newsgroup-limit (copy-sequence articles)) |
4311 ;; Remove canceled articles from the list of unread articles. | 5142 ;; Remove canceled articles from the list of unread articles. |
5143 (setq fetched-articles | |
5144 (mapcar (lambda (headers) (mail-header-number headers)) | |
5145 gnus-newsgroup-headers)) | |
5146 (setq gnus-newsgroup-articles fetched-articles) | |
4312 (setq gnus-newsgroup-unreads | 5147 (setq gnus-newsgroup-unreads |
4313 (gnus-set-sorted-intersection | 5148 (gnus-sorted-nintersection |
4314 gnus-newsgroup-unreads | 5149 gnus-newsgroup-unreads fetched-articles)) |
4315 (setq fetched-articles | 5150 (gnus-compute-unseen-list) |
4316 (mapcar (lambda (headers) (mail-header-number headers)) | 5151 |
4317 gnus-newsgroup-headers)))) | |
4318 ;; Removed marked articles that do not exist. | 5152 ;; Removed marked articles that do not exist. |
4319 (gnus-update-missing-marks | 5153 (gnus-update-missing-marks |
4320 (gnus-sorted-complement fetched-articles articles)) | 5154 (gnus-sorted-difference articles fetched-articles)) |
4321 ;; We might want to build some more threads first. | 5155 ;; We might want to build some more threads first. |
4322 (when (and gnus-fetch-old-headers | 5156 (when (and gnus-fetch-old-headers |
4323 (eq gnus-headers-retrieved-by 'nov)) | 5157 (eq gnus-headers-retrieved-by 'nov)) |
4324 (if (eq gnus-fetch-old-headers 'invisible) | 5158 (if (eq gnus-fetch-old-headers 'invisible) |
4325 (gnus-build-all-threads) | 5159 (gnus-build-all-threads) |
4344 (mail-header-number | 5178 (mail-header-number |
4345 (gnus-last-element gnus-newsgroup-headers)))) | 5179 (gnus-last-element gnus-newsgroup-headers)))) |
4346 ;; GROUP is successfully selected. | 5180 ;; GROUP is successfully selected. |
4347 (or gnus-newsgroup-headers t))))) | 5181 (or gnus-newsgroup-headers t))))) |
4348 | 5182 |
5183 (defun gnus-compute-unseen-list () | |
5184 ;; The `seen' marks are treated specially. | |
5185 (if (not gnus-newsgroup-seen) | |
5186 (setq gnus-newsgroup-unseen gnus-newsgroup-articles) | |
5187 (setq gnus-newsgroup-unseen | |
5188 (gnus-inverse-list-range-intersection | |
5189 gnus-newsgroup-articles gnus-newsgroup-seen)))) | |
5190 | |
5191 (defun gnus-summary-display-make-predicate (display) | |
5192 (require 'gnus-agent) | |
5193 (when (= (length display) 1) | |
5194 (setq display (car display))) | |
5195 (unless gnus-summary-display-cache | |
5196 (dolist (elem (append '((unread . unread) | |
5197 (read . read) | |
5198 (unseen . unseen)) | |
5199 gnus-article-mark-lists)) | |
5200 (push (cons (cdr elem) | |
5201 (gnus-byte-compile | |
5202 `(lambda () (gnus-article-marked-p ',(cdr elem))))) | |
5203 gnus-summary-display-cache))) | |
5204 (let ((gnus-category-predicate-alist gnus-summary-display-cache) | |
5205 (gnus-category-predicate-cache gnus-summary-display-cache)) | |
5206 (gnus-get-predicate display))) | |
5207 | |
5208 ;; Uses the dynamically bound `number' variable. | |
5209 (eval-when-compile | |
5210 (defvar number)) | |
5211 (defun gnus-article-marked-p (type &optional article) | |
5212 (let ((article (or article number))) | |
5213 (cond | |
5214 ((eq type 'tick) | |
5215 (memq article gnus-newsgroup-marked)) | |
5216 ((eq type 'spam) | |
5217 (memq article gnus-newsgroup-spam-marked)) | |
5218 ((eq type 'unsend) | |
5219 (memq article gnus-newsgroup-unsendable)) | |
5220 ((eq type 'undownload) | |
5221 (memq article gnus-newsgroup-undownloaded)) | |
5222 ((eq type 'download) | |
5223 (memq article gnus-newsgroup-downloadable)) | |
5224 ((eq type 'unread) | |
5225 (memq article gnus-newsgroup-unreads)) | |
5226 ((eq type 'read) | |
5227 (memq article gnus-newsgroup-reads)) | |
5228 ((eq type 'dormant) | |
5229 (memq article gnus-newsgroup-dormant) ) | |
5230 ((eq type 'expire) | |
5231 (memq article gnus-newsgroup-expirable)) | |
5232 ((eq type 'reply) | |
5233 (memq article gnus-newsgroup-replied)) | |
5234 ((eq type 'killed) | |
5235 (memq article gnus-newsgroup-killed)) | |
5236 ((eq type 'bookmark) | |
5237 (assq article gnus-newsgroup-bookmarks)) | |
5238 ((eq type 'score) | |
5239 (assq article gnus-newsgroup-scored)) | |
5240 ((eq type 'save) | |
5241 (memq article gnus-newsgroup-saved)) | |
5242 ((eq type 'cache) | |
5243 (memq article gnus-newsgroup-cached)) | |
5244 ((eq type 'forward) | |
5245 (memq article gnus-newsgroup-forwarded)) | |
5246 ((eq type 'seen) | |
5247 (not (memq article gnus-newsgroup-unseen))) | |
5248 ((eq type 'recent) | |
5249 (memq article gnus-newsgroup-recent)) | |
5250 (t t)))) | |
5251 | |
4349 (defun gnus-articles-to-read (group &optional read-all) | 5252 (defun gnus-articles-to-read (group &optional read-all) |
4350 "Find out what articles the user wants to read." | 5253 "Find out what articles the user wants to read." |
4351 (let* ((articles | 5254 (let* ((display (gnus-group-find-parameter group 'display)) |
5255 (articles | |
4352 ;; Select all articles if `read-all' is non-nil, or if there | 5256 ;; Select all articles if `read-all' is non-nil, or if there |
4353 ;; are no unread articles. | 5257 ;; are no unread articles. |
4354 (if (or read-all | 5258 (if (or read-all |
4355 (and (zerop (length gnus-newsgroup-marked)) | 5259 (and (zerop (length gnus-newsgroup-marked)) |
4356 (zerop (length gnus-newsgroup-unreads))) | 5260 (zerop (length gnus-newsgroup-unreads))) |
4357 (eq (gnus-group-find-parameter group 'display) | 5261 ;; Fetch all if the predicate is non-nil. |
4358 'all)) | 5262 gnus-newsgroup-display) |
5263 ;; We want to select the headers for all the articles in | |
5264 ;; the group, so we select either all the active | |
5265 ;; articles in the group, or (if that's nil), the | |
5266 ;; articles in the cache. | |
4359 (or | 5267 (or |
4360 (gnus-uncompress-range (gnus-active group)) | 5268 (gnus-uncompress-range (gnus-active group)) |
4361 (gnus-cache-articles-in-group group)) | 5269 (gnus-cache-articles-in-group group)) |
4362 (sort (append gnus-newsgroup-dormant gnus-newsgroup-marked | 5270 ;; Select only the "normal" subset of articles. |
4363 (copy-sequence gnus-newsgroup-unreads)) | 5271 (gnus-sorted-nunion |
4364 '<))) | 5272 (gnus-sorted-union gnus-newsgroup-dormant gnus-newsgroup-marked) |
5273 gnus-newsgroup-unreads))) | |
4365 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) | 5274 (scored-list (gnus-killed-articles gnus-newsgroup-killed articles)) |
4366 (scored (length scored-list)) | 5275 (scored (length scored-list)) |
4367 (number (length articles)) | 5276 (number (length articles)) |
4368 (marked (+ (length gnus-newsgroup-marked) | 5277 (marked (+ (length gnus-newsgroup-marked) |
4369 (length gnus-newsgroup-dormant))) | 5278 (length gnus-newsgroup-dormant))) |
4370 (select | 5279 (select |
4371 (cond | 5280 (cond |
4372 ((numberp read-all) | 5281 ((numberp read-all) |
4373 read-all) | 5282 read-all) |
5283 ((numberp gnus-newsgroup-display) | |
5284 gnus-newsgroup-display) | |
4374 (t | 5285 (t |
4375 (condition-case () | 5286 (condition-case () |
4376 (cond | 5287 (cond |
4377 ((and (or (<= scored marked) (= scored number)) | 5288 ((and (or (<= scored marked) (= scored number)) |
4378 (numberp gnus-large-newsgroup) | 5289 (numberp gnus-large-newsgroup) |
4379 (> number gnus-large-newsgroup)) | 5290 (> number gnus-large-newsgroup)) |
4380 (let ((input | 5291 (let* ((cursor-in-echo-area nil) |
4381 (read-string | 5292 (initial (gnus-parameter-large-newsgroup-initial |
4382 (format | 5293 gnus-newsgroup-name)) |
4383 "How many articles from %s (default %d): " | 5294 (input |
4384 (gnus-limit-string gnus-newsgroup-name 35) | 5295 (read-string |
4385 number)))) | 5296 (format |
5297 "How many articles from %s (%s %d): " | |
5298 (gnus-limit-string | |
5299 (gnus-group-decoded-name gnus-newsgroup-name) | |
5300 35) | |
5301 (if initial "max" "default") | |
5302 number) | |
5303 (if initial | |
5304 (cons (number-to-string initial) | |
5305 0))))) | |
4386 (if (string-match "^[ \t]*$" input) number input))) | 5306 (if (string-match "^[ \t]*$" input) number input))) |
4387 ((and (> scored marked) (< scored number) | 5307 ((and (> scored marked) (< scored number) |
4388 (> (- scored number) 20)) | 5308 (> (- scored number) 20)) |
4389 (let ((input | 5309 (let ((input |
4390 (read-string | 5310 (read-string |
4391 (format "%s %s (%d scored, %d total): " | 5311 (format "%s %s (%d scored, %d total): " |
4392 "How many articles from" | 5312 "How many articles from" |
4393 group scored number)))) | 5313 (gnus-group-decoded-name group) |
5314 scored number)))) | |
4394 (if (string-match "^[ \t]*$" input) | 5315 (if (string-match "^[ \t]*$" input) |
4395 number input))) | 5316 number input))) |
4396 (t number)) | 5317 (t number)) |
4397 (quit | 5318 (quit |
4398 (message "Quit getting the articles to read") | 5319 (message "Quit getting the articles to read") |
4411 ;; Select the N oldest articles. | 5332 ;; Select the N oldest articles. |
4412 (setcdr (nthcdr (1- (abs select)) articles) nil) | 5333 (setcdr (nthcdr (1- (abs select)) articles) nil) |
4413 ;; Select the N most recent articles. | 5334 ;; Select the N most recent articles. |
4414 (setq articles (nthcdr (- number select) articles)))) | 5335 (setq articles (nthcdr (- number select) articles)))) |
4415 (setq gnus-newsgroup-unselected | 5336 (setq gnus-newsgroup-unselected |
4416 (gnus-sorted-intersection | 5337 (gnus-sorted-difference gnus-newsgroup-unreads articles)) |
4417 gnus-newsgroup-unreads | |
4418 (gnus-sorted-complement gnus-newsgroup-unreads articles))) | |
4419 (when gnus-alter-articles-to-read-function | 5338 (when gnus-alter-articles-to-read-function |
4420 (setq gnus-newsgroup-unreads | 5339 (setq articles |
4421 (sort | 5340 (sort |
4422 (funcall gnus-alter-articles-to-read-function | 5341 (funcall gnus-alter-articles-to-read-function |
4423 gnus-newsgroup-name gnus-newsgroup-unreads) | 5342 gnus-newsgroup-name articles) |
4424 '<))) | 5343 '<))) |
4425 articles))) | 5344 articles))) |
4426 | 5345 |
4427 (defun gnus-killed-articles (killed articles) | 5346 (defun gnus-killed-articles (killed articles) |
4428 (let (out) | 5347 (let (out) |
4441 (push (car marks) out) | 5360 (push (car marks) out) |
4442 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out)) | 5361 (push (cons (caar marks) (gnus-uncompress-range (cdar marks))) out)) |
4443 (setq marks (cdr marks))) | 5362 (setq marks (cdr marks))) |
4444 out)) | 5363 out)) |
4445 | 5364 |
5365 (defun gnus-article-mark-to-type (mark) | |
5366 "Return the type of MARK." | |
5367 (or (cadr (assq mark gnus-article-special-mark-lists)) | |
5368 'list)) | |
5369 | |
5370 (defun gnus-article-unpropagatable-p (mark) | |
5371 "Return whether MARK should be propagated to back end." | |
5372 (memq mark gnus-article-unpropagated-mark-lists)) | |
5373 | |
4446 (defun gnus-adjust-marked-articles (info) | 5374 (defun gnus-adjust-marked-articles (info) |
4447 "Set all article lists and remove all marks that are no longer valid." | 5375 "Set all article lists and remove all marks that are no longer valid." |
4448 (let* ((marked-lists (gnus-info-marks info)) | 5376 (let* ((marked-lists (gnus-info-marks info)) |
4449 (active (gnus-active (gnus-info-group info))) | 5377 (active (gnus-active (gnus-info-group info))) |
4450 (min (car active)) | 5378 (min (car active)) |
4451 (max (cdr active)) | 5379 (max (cdr active)) |
4452 (types gnus-article-mark-lists) | 5380 (types gnus-article-mark-lists) |
4453 (uncompressed '(score bookmark killed)) | 5381 marks var articles article mark mark-type) |
4454 marks var articles article mark) | 5382 |
4455 | 5383 (dolist (marks marked-lists) |
4456 (while marked-lists | 5384 (setq mark (car marks) |
4457 (setq marks (pop marked-lists)) | 5385 mark-type (gnus-article-mark-to-type mark) |
4458 (set (setq var (intern (format "gnus-newsgroup-%s" | 5386 var (intern (format "gnus-newsgroup-%s" (car (rassq mark types))))) |
4459 (car (rassq (setq mark (car marks)) | 5387 |
4460 types))))) | 5388 ;; We set the variable according to the type of the marks list, |
4461 (if (memq (car marks) uncompressed) (cdr marks) | 5389 ;; and then adjust the marks to a subset of the active articles. |
4462 (gnus-uncompress-range (cdr marks)))) | |
4463 | |
4464 (setq articles (symbol-value var)) | |
4465 | |
4466 ;; All articles have to be subsets of the active articles. | |
4467 (cond | 5390 (cond |
4468 ;; Adjust "simple" lists. | 5391 ;; Adjust "simple" lists. |
4469 ((memq mark '(tick dormant expire reply save)) | 5392 ((eq mark-type 'list) |
4470 (while articles | 5393 (set var (setq articles (gnus-uncompress-range (cdr marks)))) |
4471 (when (or (< (setq article (pop articles)) min) (> article max)) | 5394 (when (memq mark '(tick dormant expire reply save)) |
4472 (set var (delq article (symbol-value var)))))) | 5395 (while articles |
5396 (when (or (< (setq article (pop articles)) min) (> article max)) | |
5397 (set var (delq article (symbol-value var))))))) | |
4473 ;; Adjust assocs. | 5398 ;; Adjust assocs. |
4474 ((memq mark uncompressed) | 5399 ((eq mark-type 'tuple) |
5400 (set var (setq articles (cdr marks))) | |
4475 (when (not (listp (cdr (symbol-value var)))) | 5401 (when (not (listp (cdr (symbol-value var)))) |
4476 (set var (list (symbol-value var)))) | 5402 (set var (list (symbol-value var)))) |
4477 (when (not (listp (cdr articles))) | 5403 (when (not (listp (cdr articles))) |
4478 (setq articles (list articles))) | 5404 (setq articles (list articles))) |
4479 (while articles | 5405 (while articles |
4480 (when (or (not (consp (setq article (pop articles)))) | 5406 (when (or (not (consp (setq article (pop articles)))) |
4481 (< (car article) min) | 5407 (< (car article) min) |
4482 (> (car article) max)) | 5408 (> (car article) max)) |
4483 (set var (delq article (symbol-value var)))))))))) | 5409 (set var (delq article (symbol-value var)))))) |
5410 ;; Adjust ranges (sloppily). | |
5411 ((eq mark-type 'range) | |
5412 (cond | |
5413 ((eq mark 'seen) | |
5414 ;; Fix the record for `seen' if it looks like (seen NUM1 . NUM2). | |
5415 ;; It should be (seen (NUM1 . NUM2)). | |
5416 (when (numberp (cddr marks)) | |
5417 (setcdr marks (list (cdr marks)))) | |
5418 (setq articles (cdr marks)) | |
5419 (while (and articles | |
5420 (or (and (consp (car articles)) | |
5421 (> min (cdar articles))) | |
5422 (and (numberp (car articles)) | |
5423 (> min (car articles))))) | |
5424 (pop articles)) | |
5425 (set var articles)))))))) | |
4484 | 5426 |
4485 (defun gnus-update-missing-marks (missing) | 5427 (defun gnus-update-missing-marks (missing) |
4486 "Go through the list of MISSING articles and remove them from the mark lists." | 5428 "Go through the list of MISSING articles and remove them from the mark lists." |
4487 (when missing | 5429 (when missing |
4488 (let ((types gnus-article-mark-lists) | 5430 (let (var m) |
4489 var m) | |
4490 ;; Go through all types. | 5431 ;; Go through all types. |
4491 (while types | 5432 (dolist (elem gnus-article-mark-lists) |
4492 (setq var (intern (format "gnus-newsgroup-%s" (car (pop types))))) | 5433 (when (eq (gnus-article-mark-to-type (cdr elem)) 'list) |
4493 (when (symbol-value var) | 5434 (setq var (intern (format "gnus-newsgroup-%s" (car elem)))) |
4494 ;; This list has articles. So we delete all missing articles | 5435 (when (symbol-value var) |
4495 ;; from it. | 5436 ;; This list has articles. So we delete all missing |
4496 (setq m missing) | 5437 ;; articles from it. |
4497 (while m | 5438 (setq m missing) |
4498 (set var (delq (pop m) (symbol-value var))))))))) | 5439 (while m |
5440 (set var (delq (pop m) (symbol-value var)))))))))) | |
4499 | 5441 |
4500 (defun gnus-update-marks () | 5442 (defun gnus-update-marks () |
4501 "Enter the various lists of marked articles into the newsgroup info list." | 5443 "Enter the various lists of marked articles into the newsgroup info list." |
4502 (let ((types gnus-article-mark-lists) | 5444 (let ((types gnus-article-mark-lists) |
4503 (info (gnus-get-info gnus-newsgroup-name)) | 5445 (info (gnus-get-info gnus-newsgroup-name)) |
4504 (uncompressed '(score bookmark killed)) | |
4505 type list newmarked symbol delta-marks) | 5446 type list newmarked symbol delta-marks) |
4506 (when info | 5447 (when info |
4507 ;; Add all marks lists to the list of marks lists. | 5448 ;; Add all marks lists to the list of marks lists. |
4508 (while (setq type (pop types)) | 5449 (while (setq type (pop types)) |
4509 (setq list (symbol-value | 5450 (setq list (symbol-value |
4510 (setq symbol | 5451 (setq symbol |
4511 (intern (format "gnus-newsgroup-%s" | 5452 (intern (format "gnus-newsgroup-%s" (car type)))))) |
4512 (car type)))))) | |
4513 | 5453 |
4514 (when list | 5454 (when list |
4515 ;; Get rid of the entries of the articles that have the | 5455 ;; Get rid of the entries of the articles that have the |
4516 ;; default score. | 5456 ;; default score. |
4517 (when (and (eq (cdr type) 'score) | 5457 (when (and (eq (cdr type) 'score) |
4526 (setcdr prev (cdr arts)) | 5466 (setcdr prev (cdr arts)) |
4527 (setq prev arts)) | 5467 (setq prev arts)) |
4528 (setq arts (cdr arts))) | 5468 (setq arts (cdr arts))) |
4529 (setq list (cdr all))))) | 5469 (setq list (cdr all))))) |
4530 | 5470 |
4531 (unless (memq (cdr type) uncompressed) | 5471 (when (eq (cdr type) 'seen) |
5472 (setq list (gnus-range-add list gnus-newsgroup-unseen))) | |
5473 | |
5474 (when (eq (gnus-article-mark-to-type (cdr type)) 'list) | |
4532 (setq list (gnus-compress-sequence (set symbol (sort list '<)) t))) | 5475 (setq list (gnus-compress-sequence (set symbol (sort list '<)) t))) |
4533 | 5476 |
4534 (when (gnus-check-backend-function | 5477 (when (and (gnus-check-backend-function |
4535 'request-set-mark gnus-newsgroup-name) | 5478 'request-set-mark gnus-newsgroup-name) |
4536 ;; propagate flags to server, with the following exceptions: | 5479 (not (gnus-article-unpropagatable-p (cdr type)))) |
4537 ;; uncompressed:s are not proper flags (they are cons cells) | 5480 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info)))) |
4538 ;; cache is a internal gnus flag | 5481 (del (gnus-remove-from-range (gnus-copy-sequence old) list)) |
4539 ;; download are local to one gnus installation (well) | 5482 (add (gnus-remove-from-range |
4540 ;; unsend are for nndraft groups only | 5483 (gnus-copy-sequence list) old))) |
4541 ;; xxx: generality of this? this suits nnimap anyway | 5484 (when add |
4542 (unless (memq (cdr type) (append '(cache download unsend) | 5485 (push (list add 'add (list (cdr type))) delta-marks)) |
4543 uncompressed)) | 5486 (when del |
4544 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info)))) | 5487 (push (list del 'del (list (cdr type))) delta-marks)))) |
4545 (del (gnus-remove-from-range (gnus-copy-sequence old) list)) | |
4546 (add (gnus-remove-from-range | |
4547 (gnus-copy-sequence list) old))) | |
4548 (when add | |
4549 (push (list add 'add (list (cdr type))) delta-marks)) | |
4550 (when del | |
4551 (push (list del 'del (list (cdr type))) delta-marks))))) | |
4552 | 5488 |
4553 (when list | 5489 (when list |
4554 (push (cons (cdr type) list) newmarked))) | 5490 (push (cons (cdr type) list) newmarked))) |
4555 | 5491 |
4556 (when delta-marks | 5492 (when delta-marks |
4582 (let (mode-string) | 5518 (let (mode-string) |
4583 (save-excursion | 5519 (save-excursion |
4584 ;; We evaluate this in the summary buffer since these | 5520 ;; We evaluate this in the summary buffer since these |
4585 ;; variables are buffer-local to that buffer. | 5521 ;; variables are buffer-local to that buffer. |
4586 (set-buffer gnus-summary-buffer) | 5522 (set-buffer gnus-summary-buffer) |
4587 ;; We bind all these variables that are used in the `eval' form | 5523 ;; We bind all these variables that are used in the `eval' form |
4588 ;; below. | 5524 ;; below. |
4589 (let* ((mformat (symbol-value | 5525 (let* ((mformat (symbol-value |
4590 (intern | 5526 (intern |
4591 (format "gnus-%s-mode-line-format-spec" where)))) | 5527 (format "gnus-%s-mode-line-format-spec" where)))) |
4592 (gnus-tmp-group-name (gnus-group-name-decode | 5528 (gnus-tmp-group-name (gnus-group-decoded-name |
4593 gnus-newsgroup-name | 5529 gnus-newsgroup-name)) |
4594 (gnus-group-name-charset | |
4595 nil | |
4596 gnus-newsgroup-name))) | |
4597 (gnus-tmp-article-number (or gnus-current-article 0)) | 5530 (gnus-tmp-article-number (or gnus-current-article 0)) |
4598 (gnus-tmp-unread gnus-newsgroup-unreads) | 5531 (gnus-tmp-unread gnus-newsgroup-unreads) |
4599 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads)) | 5532 (gnus-tmp-unread-and-unticked (length gnus-newsgroup-unreads)) |
4600 (gnus-tmp-unselected (length gnus-newsgroup-unselected)) | 5533 (gnus-tmp-unselected (length gnus-newsgroup-unselected)) |
4601 (gnus-tmp-unread-and-unselected | 5534 (gnus-tmp-unread-and-unselected |
4612 (vectorp gnus-current-headers)) | 5545 (vectorp gnus-current-headers)) |
4613 (gnus-mode-string-quote | 5546 (gnus-mode-string-quote |
4614 (mail-header-subject gnus-current-headers)) | 5547 (mail-header-subject gnus-current-headers)) |
4615 "")) | 5548 "")) |
4616 bufname-length max-len | 5549 bufname-length max-len |
4617 gnus-tmp-header);; passed as argument to any user-format-funcs | 5550 gnus-tmp-header) ;; passed as argument to any user-format-funcs |
4618 (setq mode-string (eval mformat)) | 5551 (setq mode-string (eval mformat)) |
4619 (setq bufname-length (if (string-match "%b" mode-string) | 5552 (setq bufname-length (if (string-match "%b" mode-string) |
4620 (- (length | 5553 (- (length |
4621 (buffer-name | 5554 (buffer-name |
4622 (if (eq where 'summary) | 5555 (if (eq where 'summary) |
4753 (gnus-undo-register | 5686 (gnus-undo-register |
4754 `(progn | 5687 `(progn |
4755 (gnus-info-set-marks ',info ',(gnus-info-marks info) t) | 5688 (gnus-info-set-marks ',info ',(gnus-info-marks info) t) |
4756 (gnus-info-set-read ',info ',(gnus-info-read info)) | 5689 (gnus-info-set-read ',info ',(gnus-info-read info)) |
4757 (gnus-get-unread-articles-in-group ',info (gnus-active ,group)) | 5690 (gnus-get-unread-articles-in-group ',info (gnus-active ,group)) |
5691 (gnus-request-set-mark ,group (list (list ',range 'del '(read)))) | |
4758 (gnus-group-update-group ,group t)))) | 5692 (gnus-group-update-group ,group t)))) |
4759 ;; Add the read articles to the range. | 5693 ;; Add the read articles to the range. |
4760 (gnus-info-set-read info range) | 5694 (gnus-info-set-read info range) |
5695 (gnus-request-set-mark group (list (list range 'add '(read)))) | |
4761 ;; Then we have to re-compute how many unread | 5696 ;; Then we have to re-compute how many unread |
4762 ;; articles there are in this group. | 5697 ;; articles there are in this group. |
4763 (when active | 5698 (when active |
4764 (cond | 5699 (cond |
4765 ((not range) | 5700 ((not range) |
4775 (setq range (cdr range))) | 5710 (setq range (cdr range))) |
4776 (setq num (- (cdr active) num)))) | 5711 (setq num (- (cdr active) num)))) |
4777 ;; Update the number of unread articles. | 5712 ;; Update the number of unread articles. |
4778 (setcar entry num) | 5713 (setcar entry num) |
4779 ;; Update the group buffer. | 5714 ;; Update the group buffer. |
4780 (gnus-group-update-group group t))))) | 5715 (unless (gnus-ephemeral-group-p group) |
5716 (gnus-group-update-group group t)))))) | |
4781 | 5717 |
4782 (defvar gnus-newsgroup-none-id 0) | 5718 (defvar gnus-newsgroup-none-id 0) |
4783 | 5719 |
4784 (defun gnus-get-newsgroup-headers (&optional dependencies force-new) | 5720 (defun gnus-get-newsgroup-headers (&optional dependencies force-new) |
4785 (let ((cur nntp-server-buffer) | 5721 (let ((cur nntp-server-buffer) |
4797 (save-excursion | 5733 (save-excursion |
4798 (set-buffer nntp-server-buffer) | 5734 (set-buffer nntp-server-buffer) |
4799 ;; Translate all TAB characters into SPACE characters. | 5735 ;; Translate all TAB characters into SPACE characters. |
4800 (subst-char-in-region (point-min) (point-max) ?\t ? t) | 5736 (subst-char-in-region (point-min) (point-max) ?\t ? t) |
4801 (subst-char-in-region (point-min) (point-max) ?\r ? t) | 5737 (subst-char-in-region (point-min) (point-max) ?\r ? t) |
5738 (ietf-drums-unfold-fws) | |
4802 (gnus-run-hooks 'gnus-parse-headers-hook) | 5739 (gnus-run-hooks 'gnus-parse-headers-hook) |
4803 (let ((case-fold-search t) | 5740 (let ((case-fold-search t) |
4804 in-reply-to header p lines chars) | 5741 in-reply-to header p lines chars) |
4805 (goto-char (point-min)) | 5742 (goto-char (point-min)) |
4806 ;; Search to the beginning of the next header. Error messages | 5743 ;; Search to the beginning of the next header. Error messages |
4827 (- (point) 2)) | 5764 (- (point) 2)) |
4828 (point)))) | 5765 (point)))) |
4829 ;; Subject. | 5766 ;; Subject. |
4830 (progn | 5767 (progn |
4831 (goto-char p) | 5768 (goto-char p) |
4832 (if (search-forward "\nsubject: " nil t) | 5769 (if (search-forward "\nsubject:" nil t) |
4833 (funcall gnus-decode-encoded-word-function | 5770 (funcall gnus-decode-encoded-word-function |
4834 (nnheader-header-value)) | 5771 (nnheader-header-value)) |
4835 "(none)")) | 5772 "(none)")) |
4836 ;; From. | 5773 ;; From. |
4837 (progn | 5774 (progn |
4838 (goto-char p) | 5775 (goto-char p) |
4839 (if (or (search-forward "\nfrom: " nil t) | 5776 (if (search-forward "\nfrom:" nil t) |
4840 (search-forward "\nfrom:" nil t)) | |
4841 (funcall gnus-decode-encoded-word-function | 5777 (funcall gnus-decode-encoded-word-function |
4842 (nnheader-header-value)) | 5778 (nnheader-header-value)) |
4843 "(nobody)")) | 5779 "(nobody)")) |
4844 ;; Date. | 5780 ;; Date. |
4845 (progn | 5781 (progn |
4846 (goto-char p) | 5782 (goto-char p) |
4847 (if (search-forward "\ndate: " nil t) | 5783 (if (search-forward "\ndate:" nil t) |
4848 (nnheader-header-value) "")) | 5784 (nnheader-header-value) "")) |
4849 ;; Message-ID. | 5785 ;; Message-ID. |
4850 (progn | 5786 (progn |
4851 (goto-char p) | 5787 (goto-char p) |
4852 (setq id (if (re-search-forward | 5788 (setq id (if (re-search-forward |
4859 ;; to make subsequent routines simpler. | 5795 ;; to make subsequent routines simpler. |
4860 (nnheader-generate-fake-message-id)))) | 5796 (nnheader-generate-fake-message-id)))) |
4861 ;; References. | 5797 ;; References. |
4862 (progn | 5798 (progn |
4863 (goto-char p) | 5799 (goto-char p) |
4864 (if (search-forward "\nreferences: " nil t) | 5800 (if (search-forward "\nreferences:" nil t) |
4865 (progn | 5801 (progn |
4866 (setq end (point)) | 5802 (setq end (point)) |
4867 (prog1 | 5803 (prog1 |
4868 (nnheader-header-value) | 5804 (nnheader-header-value) |
4869 (setq ref | 5805 (setq ref |
4876 (search-backward "<" end t) | 5812 (search-backward "<" end t) |
4877 (point)))))) | 5813 (point)))))) |
4878 ;; Get the references from the in-reply-to header if there | 5814 ;; Get the references from the in-reply-to header if there |
4879 ;; were no references and the in-reply-to header looks | 5815 ;; were no references and the in-reply-to header looks |
4880 ;; promising. | 5816 ;; promising. |
4881 (if (and (search-forward "\nin-reply-to: " nil t) | 5817 (if (and (search-forward "\nin-reply-to:" nil t) |
4882 (setq in-reply-to (nnheader-header-value)) | 5818 (setq in-reply-to (nnheader-header-value)) |
4883 (string-match "<[^>]+>" in-reply-to)) | 5819 (string-match "<[^>]+>" in-reply-to)) |
4884 (let (ref2) | 5820 (let (ref2) |
4885 (setq ref (substring in-reply-to (match-beginning 0) | 5821 (setq ref (substring in-reply-to (match-beginning 0) |
4886 (match-end 0))) | 5822 (match-end 0))) |
4894 ;; Chars. | 5830 ;; Chars. |
4895 (progn | 5831 (progn |
4896 (goto-char p) | 5832 (goto-char p) |
4897 (if (search-forward "\nchars: " nil t) | 5833 (if (search-forward "\nchars: " nil t) |
4898 (if (numberp (setq chars (ignore-errors (read cur)))) | 5834 (if (numberp (setq chars (ignore-errors (read cur)))) |
4899 chars 0) | 5835 chars -1) |
4900 0)) | 5836 -1)) |
4901 ;; Lines. | 5837 ;; Lines. |
4902 (progn | 5838 (progn |
4903 (goto-char p) | 5839 (goto-char p) |
4904 (if (search-forward "\nlines: " nil t) | 5840 (if (search-forward "\nlines: " nil t) |
4905 (if (numberp (setq lines (ignore-errors (read cur)))) | 5841 (if (numberp (setq lines (ignore-errors (read cur)))) |
4906 lines 0) | 5842 lines -1) |
4907 0)) | 5843 -1)) |
4908 ;; Xref. | 5844 ;; Xref. |
4909 (progn | 5845 (progn |
4910 (goto-char p) | 5846 (goto-char p) |
4911 (and (search-forward "\nxref: " nil t) | 5847 (and (search-forward "\nxref:" nil t) |
4912 (nnheader-header-value))) | 5848 (nnheader-header-value))) |
4913 ;; Extra. | 5849 ;; Extra. |
4914 (when gnus-extra-headers | 5850 (when gnus-extra-headers |
4915 (let ((extra gnus-extra-headers) | 5851 (let ((extra gnus-extra-headers) |
4916 out) | 5852 out) |
4917 (while extra | 5853 (while extra |
4918 (goto-char p) | 5854 (goto-char p) |
4919 (when (search-forward | 5855 (when (search-forward |
4920 (concat "\n" (symbol-name (car extra)) ": ") nil t) | 5856 (concat "\n" (symbol-name (car extra)) ":") nil t) |
4921 (push (cons (car extra) (nnheader-header-value)) | 5857 (push (cons (car extra) (nnheader-header-value)) |
4922 out)) | 5858 out)) |
4923 (pop extra)) | 5859 (pop extra)) |
4924 out)))) | 5860 out)))) |
4925 (when (equal id ref) | 5861 (when (equal id ref) |
4950 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) | 5886 (setq gnus-article-internal-prepare-hook '(gnus-article-get-xrefs)) |
4951 (let ((mail-parse-charset gnus-newsgroup-charset) | 5887 (let ((mail-parse-charset gnus-newsgroup-charset) |
4952 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) | 5888 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets) |
4953 (cur nntp-server-buffer) | 5889 (cur nntp-server-buffer) |
4954 (dependencies (or dependencies gnus-newsgroup-dependencies)) | 5890 (dependencies (or dependencies gnus-newsgroup-dependencies)) |
5891 (allp (cond | |
5892 ((eq gnus-read-all-available-headers t) | |
5893 t) | |
5894 ((stringp gnus-read-all-available-headers) | |
5895 (string-match gnus-read-all-available-headers group)) | |
5896 (t | |
5897 nil))) | |
4955 number headers header) | 5898 number headers header) |
4956 (save-excursion | 5899 (save-excursion |
4957 (set-buffer nntp-server-buffer) | 5900 (set-buffer nntp-server-buffer) |
4958 (subst-char-in-region (point-min) (point-max) ?\r ? t) | 5901 (subst-char-in-region (point-min) (point-max) ?\r ? t) |
4959 ;; Allow the user to mangle the headers before parsing them. | 5902 ;; Allow the user to mangle the headers before parsing them. |
4960 (gnus-run-hooks 'gnus-parse-headers-hook) | 5903 (gnus-run-hooks 'gnus-parse-headers-hook) |
4961 (goto-char (point-min)) | 5904 (goto-char (point-min)) |
4962 (while (not (eobp)) | 5905 (gnus-parse-without-error |
4963 (condition-case () | 5906 (while (and (or sequence allp) |
4964 (while (and sequence (not (eobp))) | 5907 (not (eobp))) |
4965 (setq number (read cur)) | 5908 (setq number (read cur)) |
4966 (while (and sequence | 5909 (when (not allp) |
4967 (< (car sequence) number)) | 5910 (while (and sequence |
4968 (setq sequence (cdr sequence))) | 5911 (< (car sequence) number)) |
4969 (and sequence | 5912 (setq sequence (cdr sequence)))) |
4970 (eq number (car sequence)) | 5913 (when (and (or allp |
4971 (progn | 5914 (and sequence |
4972 (setq sequence (cdr sequence)) | 5915 (eq number (car sequence)))) |
4973 (setq header (inline | 5916 (progn |
4974 (gnus-nov-parse-line | 5917 (setq sequence (cdr sequence)) |
4975 number dependencies force-new)))) | 5918 (setq header (inline |
4976 (push header headers)) | 5919 (gnus-nov-parse-line |
4977 (forward-line 1)) | 5920 number dependencies force-new))))) |
4978 (error | 5921 (push header headers)) |
4979 (gnus-error 4 "Strange nov line (%d)" | 5922 (forward-line 1))) |
4980 (count-lines (point-min) (point))))) | |
4981 (forward-line 1)) | |
4982 ;; A common bug in inn is that if you have posted an article and | 5923 ;; A common bug in inn is that if you have posted an article and |
4983 ;; then retrieves the active file, it will answer correctly -- | 5924 ;; then retrieves the active file, it will answer correctly -- |
4984 ;; the new article is included. However, a NOV entry for the | 5925 ;; the new article is included. However, a NOV entry for the |
4985 ;; article may not have been generated yet, so this may fail. | 5926 ;; article may not have been generated yet, so this may fail. |
4986 ;; We work around this problem by retrieving the last few | 5927 ;; We work around this problem by retrieving the last few |
4990 ;; We (probably) got all the headers. | 5931 ;; We (probably) got all the headers. |
4991 (nreverse headers) | 5932 (nreverse headers) |
4992 (let ((gnus-nov-is-evil t)) | 5933 (let ((gnus-nov-is-evil t)) |
4993 (nconc | 5934 (nconc |
4994 (nreverse headers) | 5935 (nreverse headers) |
4995 (when (gnus-retrieve-headers sequence group) | 5936 (when (eq (gnus-retrieve-headers sequence group) 'headers) |
4996 (gnus-get-newsgroup-headers)))))))) | 5937 (gnus-get-newsgroup-headers)))))))) |
4997 | 5938 |
4998 (defun gnus-article-get-xrefs () | 5939 (defun gnus-article-get-xrefs () |
4999 "Fill in the Xref value in `gnus-current-headers', if necessary. | 5940 "Fill in the Xref value in `gnus-current-headers', if necessary. |
5000 This is meant to be called in `gnus-article-internal-prepare-hook'." | 5941 This is meant to be called in `gnus-article-internal-prepare-hook'." |
5012 (when (or (and (not (eobp)) | 5953 (when (or (and (not (eobp)) |
5013 (eq (downcase (char-after)) ?x) | 5954 (eq (downcase (char-after)) ?x) |
5014 (looking-at "Xref:")) | 5955 (looking-at "Xref:")) |
5015 (search-forward "\nXref:" nil t)) | 5956 (search-forward "\nXref:" nil t)) |
5016 (goto-char (1+ (match-end 0))) | 5957 (goto-char (1+ (match-end 0))) |
5017 (setq xref (buffer-substring (point) | 5958 (setq xref (buffer-substring (point) (gnus-point-at-eol))) |
5018 (progn (end-of-line) (point)))) | |
5019 (mail-header-set-xref headers xref))))))) | 5959 (mail-header-set-xref headers xref))))))) |
5020 | 5960 |
5021 (defun gnus-summary-insert-subject (id &optional old-header use-old-header) | 5961 (defun gnus-summary-insert-subject (id &optional old-header use-old-header) |
5022 "Find article ID and insert the summary line for that article. | 5962 "Find article ID and insert the summary line for that article. |
5023 OLD-HEADER can either be a header or a line number to insert | 5963 OLD-HEADER can either be a header or a line number to insert |
5045 number | 5985 number |
5046 (- (gnus-point-at-bol) | 5986 (- (gnus-point-at-bol) |
5047 (prog1 | 5987 (prog1 |
5048 (1+ (gnus-point-at-eol)) | 5988 (1+ (gnus-point-at-eol)) |
5049 (gnus-delete-line)))))) | 5989 (gnus-delete-line)))))) |
5990 ;; Remove list identifiers from subject. | |
5991 (when gnus-list-identifiers | |
5992 (let ((gnus-newsgroup-headers (list header))) | |
5993 (gnus-summary-remove-list-identifiers) | |
5994 (setq header (car gnus-newsgroup-headers)))) | |
5050 (when old-header | 5995 (when old-header |
5051 (mail-header-set-number header (mail-header-number old-header))) | 5996 (mail-header-set-number header (mail-header-number old-header))) |
5052 (setq gnus-newsgroup-sparse | 5997 (setq gnus-newsgroup-sparse |
5053 (delq (setq number (mail-header-number header)) | 5998 (delq (setq number (mail-header-number header)) |
5054 gnus-newsgroup-sparse)) | 5999 gnus-newsgroup-sparse)) |
5175 (save-excursion | 6120 (save-excursion |
5176 (set-buffer gnus-group-buffer) | 6121 (set-buffer gnus-group-buffer) |
5177 (save-excursion | 6122 (save-excursion |
5178 (gnus-group-best-unread-group exclude-group)))) | 6123 (gnus-group-best-unread-group exclude-group)))) |
5179 | 6124 |
5180 (defun gnus-summary-find-next (&optional unread article backward undownloaded) | 6125 (defun gnus-summary-find-next (&optional unread article backward) |
5181 (if backward (gnus-summary-find-prev) | 6126 (if backward |
6127 (gnus-summary-find-prev unread article) | |
5182 (let* ((dummy (gnus-summary-article-intangible-p)) | 6128 (let* ((dummy (gnus-summary-article-intangible-p)) |
5183 (article (or article (gnus-summary-article-number))) | 6129 (article (or article (gnus-summary-article-number))) |
5184 (arts (gnus-data-find-list article)) | 6130 (data (gnus-data-find-list article)) |
5185 result) | 6131 result) |
5186 (when (and (not dummy) | 6132 (when (and (not dummy) |
5187 (or (not gnus-summary-check-current) | 6133 (or (not gnus-summary-check-current) |
5188 (not unread) | 6134 (not unread) |
5189 (not (gnus-data-unread-p (car arts))))) | 6135 (not (gnus-data-unread-p (car data))))) |
5190 (setq arts (cdr arts))) | 6136 (setq data (cdr data))) |
5191 (when (setq result | 6137 (when (setq result |
5192 (if unread | 6138 (if unread |
5193 (progn | 6139 (progn |
5194 (while arts | 6140 (while data |
5195 (when (or (and undownloaded | 6141 (unless (memq (gnus-data-number (car data)) |
5196 (eq gnus-undownloaded-mark | 6142 (cond |
5197 (gnus-data-mark (car arts)))) | 6143 ((eq gnus-auto-goto-ignores |
5198 (gnus-data-unread-p (car arts))) | 6144 'always-undownloaded) |
5199 (setq result (car arts) | 6145 gnus-newsgroup-undownloaded) |
5200 arts nil)) | 6146 (gnus-plugged |
5201 (setq arts (cdr arts))) | 6147 nil) |
6148 ((eq gnus-auto-goto-ignores | |
6149 'unfetched) | |
6150 gnus-newsgroup-unfetched) | |
6151 ((eq gnus-auto-goto-ignores | |
6152 'undownloaded) | |
6153 gnus-newsgroup-undownloaded))) | |
6154 (when (gnus-data-unread-p (car data)) | |
6155 (setq result (car data) | |
6156 data nil))) | |
6157 (setq data (cdr data))) | |
5202 result) | 6158 result) |
5203 (car arts))) | 6159 (car data))) |
5204 (goto-char (gnus-data-pos result)) | 6160 (goto-char (gnus-data-pos result)) |
5205 (gnus-data-number result))))) | 6161 (gnus-data-number result))))) |
5206 | 6162 |
5207 (defun gnus-summary-find-prev (&optional unread article) | 6163 (defun gnus-summary-find-prev (&optional unread article) |
5208 (let* ((eobp (eobp)) | 6164 (let* ((eobp (eobp)) |
5209 (article (or article (gnus-summary-article-number))) | 6165 (article (or article (gnus-summary-article-number))) |
5210 (arts (gnus-data-find-list article (gnus-data-list 'rev))) | 6166 (data (gnus-data-find-list article (gnus-data-list 'rev))) |
5211 result) | 6167 result) |
5212 (when (and (not eobp) | 6168 (when (and (not eobp) |
5213 (or (not gnus-summary-check-current) | 6169 (or (not gnus-summary-check-current) |
5214 (not unread) | 6170 (not unread) |
5215 (not (gnus-data-unread-p (car arts))))) | 6171 (not (gnus-data-unread-p (car data))))) |
5216 (setq arts (cdr arts))) | 6172 (setq data (cdr data))) |
5217 (when (setq result | 6173 (when (setq result |
5218 (if unread | 6174 (if unread |
5219 (progn | 6175 (progn |
5220 (while arts | 6176 (while data |
5221 (when (gnus-data-unread-p (car arts)) | 6177 (unless (memq (gnus-data-number (car data)) |
5222 (setq result (car arts) | 6178 (cond |
5223 arts nil)) | 6179 ((eq gnus-auto-goto-ignores |
5224 (setq arts (cdr arts))) | 6180 'always-undownloaded) |
6181 gnus-newsgroup-undownloaded) | |
6182 (gnus-plugged | |
6183 nil) | |
6184 ((eq gnus-auto-goto-ignores | |
6185 'unfetched) | |
6186 gnus-newsgroup-unfetched) | |
6187 ((eq gnus-auto-goto-ignores | |
6188 'undownloaded) | |
6189 gnus-newsgroup-undownloaded))) | |
6190 (when (gnus-data-unread-p (car data)) | |
6191 (setq result (car data) | |
6192 data nil))) | |
6193 (setq data (cdr data))) | |
5225 result) | 6194 result) |
5226 (car arts))) | 6195 (car data))) |
5227 (goto-char (gnus-data-pos result)) | 6196 (goto-char (gnus-data-pos result)) |
5228 (gnus-data-number result)))) | 6197 (gnus-data-number result)))) |
5229 | 6198 |
5230 (defun gnus-summary-find-subject (subject &optional unread backward article) | 6199 (defun gnus-summary-find-subject (subject &optional unread backward article) |
5231 (let* ((simp-subject (gnus-simplify-subject-fully subject)) | 6200 (let* ((simp-subject (gnus-simplify-subject-fully subject)) |
5272 If `gnus-auto-center-summary' is nil, or the article buffer isn't | 6241 If `gnus-auto-center-summary' is nil, or the article buffer isn't |
5273 displayed, no centering will be performed." | 6242 displayed, no centering will be performed." |
5274 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). | 6243 ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). |
5275 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu. | 6244 ;; Recenter only when requested. Suggested by popovich@park.cs.columbia.edu. |
5276 (interactive) | 6245 (interactive) |
5277 (let* ((top (cond ((< (window-height) 4) 0) | 6246 ;; The user has to want it. |
5278 ((< (window-height) 7) 1) | 6247 (when gnus-auto-center-summary |
5279 (t (if (numberp gnus-auto-center-summary) | 6248 (let* ((top (cond ((< (window-height) 4) 0) |
5280 gnus-auto-center-summary | 6249 ((< (window-height) 7) 1) |
5281 2)))) | 6250 (t (if (numberp gnus-auto-center-summary) |
5282 (height (1- (window-height))) | 6251 gnus-auto-center-summary |
5283 (bottom (save-excursion (goto-char (point-max)) | 6252 2)))) |
5284 (forward-line (- height)) | 6253 (height (1- (window-height))) |
5285 (point))) | 6254 (bottom (save-excursion (goto-char (point-max)) |
5286 (window (get-buffer-window (current-buffer)))) | 6255 (forward-line (- height)) |
5287 ;; The user has to want it. | 6256 (point))) |
5288 (when gnus-auto-center-summary | 6257 (window (get-buffer-window (current-buffer)))) |
5289 (when (get-buffer-window gnus-article-buffer) | 6258 (when (get-buffer-window gnus-article-buffer) |
5290 ;; Only do recentering when the article buffer is displayed, | 6259 ;; Only do recentering when the article buffer is displayed, |
5291 ;; Set the window start to either `bottom', which is the biggest | 6260 ;; Set the window start to either `bottom', which is the biggest |
5292 ;; possible valid number, or the second line from the top, | 6261 ;; possible valid number, or the second line from the top, |
5293 ;; whichever is the least. | 6262 ;; whichever is the least. |
5375 "Return a list of unread, unticked and non-dormant articles." | 6344 "Return a list of unread, unticked and non-dormant articles." |
5376 (let* ((info (gnus-get-info group)) | 6345 (let* ((info (gnus-get-info group)) |
5377 (marked (gnus-info-marks info)) | 6346 (marked (gnus-info-marks info)) |
5378 (active (gnus-active group))) | 6347 (active (gnus-active group))) |
5379 (and info active | 6348 (and info active |
5380 (gnus-set-difference | 6349 (gnus-list-range-difference |
5381 (gnus-sorted-complement | 6350 (gnus-list-range-difference |
5382 (gnus-uncompress-range active) | 6351 (gnus-sorted-complement |
5383 (gnus-list-of-unread-articles group)) | 6352 (gnus-uncompress-range active) |
5384 (append | 6353 (gnus-list-of-unread-articles group)) |
5385 (gnus-uncompress-range (cdr (assq 'dormant marked))) | 6354 (cdr (assq 'dormant marked))) |
5386 (gnus-uncompress-range (cdr (assq 'tick marked)))))))) | 6355 (cdr (assq 'tick marked)))))) |
5387 | 6356 |
5388 ;; Various summary commands | 6357 ;; Various summary commands |
5389 | 6358 |
5390 (defun gnus-summary-select-article-buffer () | 6359 (defun gnus-summary-select-article-buffer () |
5391 "Reconfigure windows to show article buffer." | 6360 "Reconfigure windows to show article buffer." |
5417 (gnus-summary-remove-process-mark article))))) | 6386 (gnus-summary-remove-process-mark article))))) |
5418 (gnus-summary-position-point)) | 6387 (gnus-summary-position-point)) |
5419 | 6388 |
5420 (defun gnus-summary-toggle-truncation (&optional arg) | 6389 (defun gnus-summary-toggle-truncation (&optional arg) |
5421 "Toggle truncation of summary lines. | 6390 "Toggle truncation of summary lines. |
5422 With arg, turn line truncation on if arg is positive." | 6391 With ARG, turn line truncation on if ARG is positive." |
5423 (interactive "P") | 6392 (interactive "P") |
5424 (setq truncate-lines | 6393 (setq truncate-lines |
5425 (if (null arg) (not truncate-lines) | 6394 (if (null arg) (not truncate-lines) |
5426 (> (prefix-numeric-value arg) 0))) | 6395 (> (prefix-numeric-value arg) 0))) |
5427 (redraw-display)) | 6396 (redraw-display)) |
6397 | |
6398 (defun gnus-summary-find-for-reselect () | |
6399 "Return the number of an article to stay on across a reselect. | |
6400 The current article is considered, then following articles, then previous | |
6401 articles. An article is sought which is not cancelled and isn't a temporary | |
6402 insertion from another group. If there's no such then return a dummy 0." | |
6403 (let (found) | |
6404 (dolist (rev '(nil t)) | |
6405 (unless found ; don't demand the reverse list if we don't need it | |
6406 (let ((data (gnus-data-find-list | |
6407 (gnus-summary-article-number) (gnus-data-list rev)))) | |
6408 (while (and data (not found)) | |
6409 (if (and (< 0 (gnus-data-number (car data))) | |
6410 (not (eq gnus-canceled-mark (gnus-data-mark (car data))))) | |
6411 (setq found (gnus-data-number (car data)))) | |
6412 (setq data (cdr data)))))) | |
6413 (or found 0))) | |
5428 | 6414 |
5429 (defun gnus-summary-reselect-current-group (&optional all rescan) | 6415 (defun gnus-summary-reselect-current-group (&optional all rescan) |
5430 "Exit and then reselect the current newsgroup. | 6416 "Exit and then reselect the current newsgroup. |
5431 The prefix argument ALL means to select all articles." | 6417 The prefix argument ALL means to select all articles." |
5432 (interactive "P") | 6418 (interactive "P") |
5433 (when (gnus-ephemeral-group-p gnus-newsgroup-name) | 6419 (when (gnus-ephemeral-group-p gnus-newsgroup-name) |
5434 (error "Ephemeral groups can't be reselected")) | 6420 (error "Ephemeral groups can't be reselected")) |
5435 (let ((current-subject (gnus-summary-article-number)) | 6421 (let ((current-subject (gnus-summary-find-for-reselect)) |
5436 (group gnus-newsgroup-name)) | 6422 (group gnus-newsgroup-name)) |
5437 (setq gnus-newsgroup-begin nil) | 6423 (setq gnus-newsgroup-begin nil) |
5438 (gnus-summary-exit) | 6424 (gnus-summary-exit nil 'leave-hidden) |
5439 ;; We have to adjust the point of group mode buffer because | 6425 ;; We have to adjust the point of group mode buffer because |
5440 ;; point was moved to the next unread newsgroup by exiting. | 6426 ;; point was moved to the next unread newsgroup by exiting. |
5441 (gnus-summary-jump-to-group group) | 6427 (gnus-summary-jump-to-group group) |
5442 (when rescan | 6428 (when rescan |
5443 (save-excursion | 6429 (save-excursion |
5455 (let ((group gnus-newsgroup-name)) | 6441 (let ((group gnus-newsgroup-name)) |
5456 (when group | 6442 (when group |
5457 (when gnus-newsgroup-kill-headers | 6443 (when gnus-newsgroup-kill-headers |
5458 (setq gnus-newsgroup-killed | 6444 (setq gnus-newsgroup-killed |
5459 (gnus-compress-sequence | 6445 (gnus-compress-sequence |
5460 (nconc | 6446 (gnus-sorted-union |
5461 (gnus-set-sorted-intersection | 6447 (gnus-list-range-intersection |
5462 (gnus-uncompress-range gnus-newsgroup-killed) | 6448 gnus-newsgroup-unselected gnus-newsgroup-killed) |
5463 (setq gnus-newsgroup-unselected | 6449 gnus-newsgroup-unreads) |
5464 (sort gnus-newsgroup-unselected '<))) | |
5465 (setq gnus-newsgroup-unreads | |
5466 (sort gnus-newsgroup-unreads '<))) | |
5467 t))) | 6450 t))) |
5468 (unless (listp (cdr gnus-newsgroup-killed)) | 6451 (unless (listp (cdr gnus-newsgroup-killed)) |
5469 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed))) | 6452 (setq gnus-newsgroup-killed (list gnus-newsgroup-killed))) |
5470 (let ((headers gnus-newsgroup-headers)) | 6453 (let ((headers gnus-newsgroup-headers)) |
5471 ;; Set the new ranges of read articles. | 6454 ;; Set the new ranges of read articles. |
5472 (save-excursion | 6455 (save-excursion |
5473 (set-buffer gnus-group-buffer) | 6456 (set-buffer gnus-group-buffer) |
5474 (gnus-undo-force-boundary)) | 6457 (gnus-undo-force-boundary)) |
5475 (gnus-update-read-articles | 6458 (gnus-update-read-articles |
5476 group (append gnus-newsgroup-unreads gnus-newsgroup-unselected)) | 6459 group (gnus-sorted-union |
6460 gnus-newsgroup-unreads gnus-newsgroup-unselected)) | |
5477 ;; Set the current article marks. | 6461 ;; Set the current article marks. |
5478 (let ((gnus-newsgroup-scored | 6462 (let ((gnus-newsgroup-scored |
5479 (if (and (not gnus-save-score) | 6463 (if (and (not gnus-save-score) |
5480 (not non-destructive)) | 6464 (not non-destructive)) |
5481 nil | 6465 nil |
5498 (gnus-summary-update-info t) | 6482 (gnus-summary-update-info t) |
5499 (if force | 6483 (if force |
5500 (gnus-save-newsrc-file) | 6484 (gnus-save-newsrc-file) |
5501 (gnus-dribble-save))) | 6485 (gnus-dribble-save))) |
5502 | 6486 |
5503 (defun gnus-summary-exit (&optional temporary) | 6487 (defun gnus-summary-exit (&optional temporary leave-hidden) |
5504 "Exit reading current newsgroup, and then return to group selection mode. | 6488 "Exit reading current newsgroup, and then return to group selection mode. |
5505 `gnus-exit-group-hook' is called with no arguments if that value is non-nil." | 6489 `gnus-exit-group-hook' is called with no arguments if that value is non-nil." |
5506 (interactive) | 6490 (interactive) |
5507 (gnus-set-global-variables) | 6491 (gnus-set-global-variables) |
5508 (when (gnus-buffer-live-p gnus-article-buffer) | 6492 (when (gnus-buffer-live-p gnus-article-buffer) |
5514 (setq gnus-article-mime-handles nil))) | 6498 (setq gnus-article-mime-handles nil))) |
5515 (gnus-kill-save-kill-buffer) | 6499 (gnus-kill-save-kill-buffer) |
5516 (gnus-async-halt-prefetch) | 6500 (gnus-async-halt-prefetch) |
5517 (let* ((group gnus-newsgroup-name) | 6501 (let* ((group gnus-newsgroup-name) |
5518 (quit-config (gnus-group-quit-config gnus-newsgroup-name)) | 6502 (quit-config (gnus-group-quit-config gnus-newsgroup-name)) |
6503 (gnus-group-is-exiting-p t) | |
5519 (mode major-mode) | 6504 (mode major-mode) |
5520 (group-point nil) | 6505 (group-point nil) |
5521 (buf (current-buffer))) | 6506 (buf (current-buffer))) |
5522 (unless quit-config | 6507 (unless quit-config |
5523 ;; Do adaptive scoring, and possibly save score files. | 6508 ;; Do adaptive scoring, and possibly save score files. |
5524 (when gnus-newsgroup-adaptive | 6509 (when gnus-newsgroup-adaptive |
5525 (gnus-score-adaptive)) | 6510 (gnus-score-adaptive)) |
5565 (gnus-kill-buffer gnus-article-buffer) | 6550 (gnus-kill-buffer gnus-article-buffer) |
5566 (gnus-kill-buffer gnus-original-article-buffer) | 6551 (gnus-kill-buffer gnus-original-article-buffer) |
5567 (setq gnus-article-current nil)) | 6552 (setq gnus-article-current nil)) |
5568 (set-buffer buf) | 6553 (set-buffer buf) |
5569 (if (not gnus-kill-summary-on-exit) | 6554 (if (not gnus-kill-summary-on-exit) |
5570 (gnus-deaden-summary) | 6555 (progn |
6556 (gnus-deaden-summary) | |
6557 (setq mode nil)) | |
5571 ;; We set all buffer-local variables to nil. It is unclear why | 6558 ;; We set all buffer-local variables to nil. It is unclear why |
5572 ;; this is needed, but if we don't, buffer-local variables are | 6559 ;; this is needed, but if we don't, buffer-local variables are |
5573 ;; not garbage-collected, it seems. This would the lead to en | 6560 ;; not garbage-collected, it seems. This would the lead to en |
5574 ;; ever-growing Emacs. | 6561 ;; ever-growing Emacs. |
5575 (gnus-summary-clear-local-variables) | 6562 (gnus-summary-clear-local-variables) |
6563 (let ((gnus-summary-local-variables gnus-newsgroup-variables)) | |
6564 (gnus-summary-clear-local-variables)) | |
5576 (when (get-buffer gnus-article-buffer) | 6565 (when (get-buffer gnus-article-buffer) |
5577 (bury-buffer gnus-article-buffer)) | 6566 (bury-buffer gnus-article-buffer)) |
5578 ;; We clear the global counterparts of the buffer-local | 6567 ;; We clear the global counterparts of the buffer-local |
5579 ;; variables as well, just to be on the safe side. | 6568 ;; variables as well, just to be on the safe side. |
5580 (set-buffer gnus-group-buffer) | 6569 (set-buffer gnus-group-buffer) |
5581 (gnus-summary-clear-local-variables) | 6570 (gnus-summary-clear-local-variables) |
6571 (let ((gnus-summary-local-variables gnus-newsgroup-variables)) | |
6572 (gnus-summary-clear-local-variables)) | |
5582 ;; Return to group mode buffer. | 6573 ;; Return to group mode buffer. |
5583 (when (eq mode 'gnus-summary-mode) | 6574 (when (eq mode 'gnus-summary-mode) |
5584 (gnus-kill-buffer buf))) | 6575 (gnus-kill-buffer buf))) |
5585 (setq gnus-current-select-method gnus-select-method) | 6576 (setq gnus-current-select-method gnus-select-method) |
5586 (pop-to-buffer gnus-group-buffer) | 6577 (if leave-hidden |
6578 (set-buffer gnus-group-buffer) | |
6579 (pop-to-buffer gnus-group-buffer)) | |
5587 (if (not quit-config) | 6580 (if (not quit-config) |
5588 (progn | 6581 (progn |
5589 (goto-char group-point) | 6582 (goto-char group-point) |
5590 (gnus-configure-windows 'group 'force)) | 6583 (unless leave-hidden |
6584 (gnus-configure-windows 'group 'force))) | |
5591 (gnus-handle-ephemeral-exit quit-config)) | 6585 (gnus-handle-ephemeral-exit quit-config)) |
5592 ;; Clear the current group name. | 6586 ;; Clear the current group name. |
5593 (unless quit-config | 6587 (unless quit-config |
5594 (setq gnus-newsgroup-name nil))))) | 6588 (setq gnus-newsgroup-name nil))))) |
5595 | 6589 |
5596 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update) | 6590 (defalias 'gnus-summary-quit 'gnus-summary-exit-no-update) |
5597 (defun gnus-summary-exit-no-update (&optional no-questions) | 6591 (defun gnus-summary-exit-no-update (&optional no-questions) |
5598 "Quit reading current newsgroup without updating read article info." | 6592 "Quit reading current newsgroup without updating read article info." |
5599 (interactive) | 6593 (interactive) |
5600 (let* ((group gnus-newsgroup-name) | 6594 (let* ((group gnus-newsgroup-name) |
6595 (gnus-group-is-exiting-p t) | |
6596 (gnus-group-is-exiting-without-update-p t) | |
5601 (quit-config (gnus-group-quit-config group))) | 6597 (quit-config (gnus-group-quit-config group))) |
5602 (when (or no-questions | 6598 (when (or no-questions |
5603 gnus-expert-user | 6599 gnus-expert-user |
5604 (gnus-y-or-n-p "Discard changes to this group and exit? ")) | 6600 (gnus-y-or-n-p "Discard changes to this group and exit? ")) |
5605 (gnus-async-halt-prefetch) | 6601 (gnus-async-halt-prefetch) |
5606 (mapcar 'funcall | 6602 (run-hooks 'gnus-summary-prepare-exit-hook) |
5607 (delq 'gnus-summary-expire-articles | |
5608 (copy-sequence gnus-summary-prepare-exit-hook))) | |
5609 (when (gnus-buffer-live-p gnus-article-buffer) | 6603 (when (gnus-buffer-live-p gnus-article-buffer) |
5610 (save-excursion | 6604 (save-excursion |
5611 (set-buffer gnus-article-buffer) | 6605 (set-buffer gnus-article-buffer) |
5612 (mm-destroy-parts gnus-article-mime-handles) | 6606 (mm-destroy-parts gnus-article-mime-handles) |
5613 ;; Set it to nil for safety reason. | 6607 ;; Set it to nil for safety reason. |
5620 (setq gnus-article-current nil)) | 6614 (setq gnus-article-current nil)) |
5621 (if (not gnus-kill-summary-on-exit) | 6615 (if (not gnus-kill-summary-on-exit) |
5622 (gnus-deaden-summary) | 6616 (gnus-deaden-summary) |
5623 (gnus-close-group group) | 6617 (gnus-close-group group) |
5624 (gnus-summary-clear-local-variables) | 6618 (gnus-summary-clear-local-variables) |
6619 (let ((gnus-summary-local-variables gnus-newsgroup-variables)) | |
6620 (gnus-summary-clear-local-variables)) | |
5625 (set-buffer gnus-group-buffer) | 6621 (set-buffer gnus-group-buffer) |
5626 (gnus-summary-clear-local-variables) | 6622 (gnus-summary-clear-local-variables) |
5627 (when (get-buffer gnus-summary-buffer) | 6623 (let ((gnus-summary-local-variables gnus-newsgroup-variables)) |
5628 (kill-buffer gnus-summary-buffer))) | 6624 (gnus-summary-clear-local-variables)) |
6625 (gnus-kill-buffer gnus-summary-buffer)) | |
5629 (unless gnus-single-article-buffer | 6626 (unless gnus-single-article-buffer |
5630 (setq gnus-article-current nil)) | 6627 (setq gnus-article-current nil)) |
5631 (when gnus-use-trees | 6628 (when gnus-use-trees |
5632 (gnus-tree-close group)) | 6629 (gnus-tree-close group)) |
5633 (gnus-async-prefetch-remove-group group) | 6630 (gnus-async-prefetch-remove-group group) |
5635 (bury-buffer gnus-article-buffer)) | 6632 (bury-buffer gnus-article-buffer)) |
5636 ;; Return to the group buffer. | 6633 ;; Return to the group buffer. |
5637 (gnus-configure-windows 'group 'force) | 6634 (gnus-configure-windows 'group 'force) |
5638 ;; Clear the current group name. | 6635 ;; Clear the current group name. |
5639 (setq gnus-newsgroup-name nil) | 6636 (setq gnus-newsgroup-name nil) |
6637 (unless (gnus-ephemeral-group-p group) | |
6638 (gnus-group-update-group group)) | |
5640 (when (equal (gnus-group-group-name) group) | 6639 (when (equal (gnus-group-group-name) group) |
5641 (gnus-group-next-unread-group 1)) | 6640 (gnus-group-next-unread-group 1)) |
5642 (when quit-config | 6641 (when quit-config |
5643 (gnus-handle-ephemeral-exit quit-config))))) | 6642 (gnus-handle-ephemeral-exit quit-config))))) |
5644 | 6643 |
5645 (defun gnus-handle-ephemeral-exit (quit-config) | 6644 (defun gnus-handle-ephemeral-exit (quit-config) |
5646 "Handle movement when leaving an ephemeral group. | 6645 "Handle movement when leaving an ephemeral group. |
5647 The state which existed when entering the ephemeral is reset." | 6646 The state which existed when entering the ephemeral is reset." |
5648 (if (not (buffer-name (car quit-config))) | 6647 (if (not (buffer-name (car quit-config))) |
5649 (gnus-configure-windows 'group 'force) | 6648 (gnus-configure-windows 'group 'force) |
5650 (set-buffer (car quit-config)) | 6649 (set-buffer (car quit-config)) |
5651 (cond ((eq major-mode 'gnus-summary-mode) | 6650 (cond ((eq major-mode 'gnus-summary-mode) |
5652 (gnus-set-global-variables)) | 6651 (gnus-set-global-variables)) |
5653 ((eq major-mode 'gnus-article-mode) | 6652 ((eq major-mode 'gnus-article-mode) |
5654 (save-excursion | 6653 (save-excursion |
5655 ;; The `gnus-summary-buffer' variable may point | 6654 ;; The `gnus-summary-buffer' variable may point |
5656 ;; to the old summary buffer when using a single | 6655 ;; to the old summary buffer when using a single |
5657 ;; article buffer. | 6656 ;; article buffer. |
5658 (unless (gnus-buffer-live-p gnus-summary-buffer) | 6657 (unless (gnus-buffer-live-p gnus-summary-buffer) |
5659 (set-buffer gnus-group-buffer)) | 6658 (set-buffer gnus-group-buffer)) |
5660 (set-buffer gnus-summary-buffer) | 6659 (set-buffer gnus-summary-buffer) |
5661 (gnus-set-global-variables)))) | 6660 (gnus-set-global-variables)))) |
5662 (if (or (eq (cdr quit-config) 'article) | 6661 (if (or (eq (cdr quit-config) 'article) |
5663 (eq (cdr quit-config) 'pick)) | 6662 (eq (cdr quit-config) 'pick)) |
5664 (progn | 6663 (progn |
5665 ;; The current article may be from the ephemeral group | 6664 ;; The current article may be from the ephemeral group |
5666 ;; thus it is best that we reload this article | 6665 ;; thus it is best that we reload this article |
5667 (gnus-summary-show-article) | 6666 ;; |
5668 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode)) | 6667 ;; If we're exiting from a large digest, this can be |
5669 (gnus-configure-windows 'pick 'force) | 6668 ;; extremely slow. So, it's better not to reload it. -- jh. |
5670 (gnus-configure-windows (cdr quit-config) 'force))) | 6669 ;;(gnus-summary-show-article) |
6670 (if (and (boundp 'gnus-pick-mode) (symbol-value 'gnus-pick-mode)) | |
6671 (gnus-configure-windows 'pick 'force) | |
6672 (gnus-configure-windows (cdr quit-config) 'force))) | |
5671 (gnus-configure-windows (cdr quit-config) 'force)) | 6673 (gnus-configure-windows (cdr quit-config) 'force)) |
5672 (when (eq major-mode 'gnus-summary-mode) | 6674 (when (eq major-mode 'gnus-summary-mode) |
5673 (gnus-summary-next-subject 1 nil t) | 6675 (gnus-summary-next-subject 1 nil t) |
5674 (gnus-summary-recenter) | 6676 (gnus-summary-recenter) |
5675 (gnus-summary-position-point)))) | 6677 (gnus-summary-position-point)))) |
5681 (unless gnus-dead-summary-mode-map | 6683 (unless gnus-dead-summary-mode-map |
5682 (setq gnus-dead-summary-mode-map (make-keymap)) | 6684 (setq gnus-dead-summary-mode-map (make-keymap)) |
5683 (suppress-keymap gnus-dead-summary-mode-map) | 6685 (suppress-keymap gnus-dead-summary-mode-map) |
5684 (substitute-key-definition | 6686 (substitute-key-definition |
5685 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map) | 6687 'undefined 'gnus-summary-wake-up-the-dead gnus-dead-summary-mode-map) |
5686 (let ((keys '("\C-d" "\r" "\177" [delete]))) | 6688 (dolist (key '("\C-d" "\r" "\177" [delete])) |
5687 (while keys | 6689 (define-key gnus-dead-summary-mode-map |
5688 (define-key gnus-dead-summary-mode-map | 6690 key 'gnus-summary-wake-up-the-dead)) |
5689 (pop keys) 'gnus-summary-wake-up-the-dead)))) | 6691 (dolist (key '("q" "Q")) |
6692 (define-key gnus-dead-summary-mode-map key 'bury-buffer))) | |
5690 | 6693 |
5691 (defvar gnus-dead-summary-mode nil | 6694 (defvar gnus-dead-summary-mode nil |
5692 "Minor mode for Gnus summary buffers.") | 6695 "Minor mode for Gnus summary buffers.") |
5693 | 6696 |
5694 (defun gnus-dead-summary-mode (&optional arg) | 6697 (defun gnus-dead-summary-mode (&optional arg) |
5730 (not gnus-single-article-buffer)) | 6733 (not gnus-single-article-buffer)) |
5731 (save-excursion | 6734 (save-excursion |
5732 (set-buffer buffer) | 6735 (set-buffer buffer) |
5733 (gnus-kill-buffer gnus-article-buffer) | 6736 (gnus-kill-buffer gnus-article-buffer) |
5734 (gnus-kill-buffer gnus-original-article-buffer))) | 6737 (gnus-kill-buffer gnus-original-article-buffer))) |
5735 (cond (gnus-kill-summary-on-exit | 6738 (cond |
5736 (when (and gnus-use-trees | 6739 ;; Kill the buffer. |
5737 (gnus-buffer-exists-p buffer)) | 6740 (gnus-kill-summary-on-exit |
5738 (save-excursion | 6741 (when (and gnus-use-trees |
5739 (set-buffer buffer) | 6742 (gnus-buffer-exists-p buffer)) |
5740 (gnus-tree-close gnus-newsgroup-name))) | 6743 (save-excursion |
5741 (gnus-kill-buffer buffer)) | 6744 (set-buffer buffer) |
5742 ((gnus-buffer-exists-p buffer) | 6745 (gnus-tree-close gnus-newsgroup-name))) |
5743 (save-excursion | 6746 (gnus-kill-buffer buffer)) |
5744 (set-buffer buffer) | 6747 ;; Deaden the buffer. |
5745 (gnus-deaden-summary)))))) | 6748 ((gnus-buffer-exists-p buffer) |
6749 (save-excursion | |
6750 (set-buffer buffer) | |
6751 (gnus-deaden-summary)))))) | |
5746 | 6752 |
5747 (defun gnus-summary-wake-up-the-dead (&rest args) | 6753 (defun gnus-summary-wake-up-the-dead (&rest args) |
5748 "Wake up the dead summary buffer." | 6754 "Wake up the dead summary buffer." |
5749 (interactive) | 6755 (interactive) |
5750 (gnus-dead-summary-mode -1) | 6756 (gnus-dead-summary-mode -1) |
5787 ;; Walking around group mode buffer from summary mode. | 6793 ;; Walking around group mode buffer from summary mode. |
5788 | 6794 |
5789 (defun gnus-summary-next-group (&optional no-article target-group backward) | 6795 (defun gnus-summary-next-group (&optional no-article target-group backward) |
5790 "Exit current newsgroup and then select next unread newsgroup. | 6796 "Exit current newsgroup and then select next unread newsgroup. |
5791 If prefix argument NO-ARTICLE is non-nil, no article is selected | 6797 If prefix argument NO-ARTICLE is non-nil, no article is selected |
5792 initially. If NEXT-GROUP, go to this group. If BACKWARD, go to | 6798 initially. If TARGET-GROUP, go to this group. If BACKWARD, go to |
5793 previous group instead." | 6799 previous group instead." |
5794 (interactive "P") | 6800 (interactive "P") |
5795 ;; Stop pre-fetching. | 6801 ;; Stop pre-fetching. |
5796 (gnus-async-halt-prefetch) | 6802 (gnus-async-halt-prefetch) |
5797 (let ((current-group gnus-newsgroup-name) | 6803 (let ((current-group gnus-newsgroup-name) |
5824 ;; We try to enter the target group. | 6830 ;; We try to enter the target group. |
5825 (gnus-group-jump-to-group target-group) | 6831 (gnus-group-jump-to-group target-group) |
5826 (let ((unreads (gnus-group-group-unread))) | 6832 (let ((unreads (gnus-group-group-unread))) |
5827 (if (and (or (eq t unreads) | 6833 (if (and (or (eq t unreads) |
5828 (and unreads (not (zerop unreads)))) | 6834 (and unreads (not (zerop unreads)))) |
5829 (gnus-summary-read-group | 6835 (gnus-summary-read-group |
5830 target-group nil no-article | 6836 target-group nil no-article |
5831 (and (buffer-name current-buffer) current-buffer) | 6837 (and (buffer-name current-buffer) current-buffer) |
5832 nil backward)) | 6838 nil backward)) |
5833 (setq entered t) | 6839 (setq entered t) |
5834 (setq current-group target-group | 6840 (setq current-group target-group |
5835 target-group nil))))))) | 6841 target-group nil))))))) |
5836 | 6842 |
5837 (defun gnus-summary-prev-group (&optional no-article) | 6843 (defun gnus-summary-prev-group (&optional no-article) |
5840 (interactive "P") | 6846 (interactive "P") |
5841 (gnus-summary-next-group no-article nil t)) | 6847 (gnus-summary-next-group no-article nil t)) |
5842 | 6848 |
5843 ;; Walking around summary lines. | 6849 ;; Walking around summary lines. |
5844 | 6850 |
5845 (defun gnus-summary-first-subject (&optional unread undownloaded) | 6851 (defun gnus-summary-first-subject (&optional unread undownloaded unseen) |
5846 "Go to the first unread subject. | 6852 "Go to the first subject satisfying any non-nil constraint. |
5847 If UNREAD is non-nil, go to the first unread article. | 6853 If UNREAD is non-nil, the article should be unread. |
5848 Returns the article selected or nil if there are no unread articles." | 6854 If UNDOWNLOADED is non-nil, the article should be undownloaded. |
6855 If UNSEEN is non-nil, the article should be unseen. | |
6856 Returns the article selected or nil if there are no matching articles." | |
5849 (interactive "P") | 6857 (interactive "P") |
5850 (prog1 | 6858 (cond |
5851 (cond | 6859 ;; Empty summary. |
5852 ;; Empty summary. | 6860 ((null gnus-newsgroup-data) |
5853 ((null gnus-newsgroup-data) | 6861 (gnus-message 3 "No articles in the group") |
5854 (gnus-message 3 "No articles in the group") | 6862 nil) |
5855 nil) | 6863 ;; Pick the first article. |
5856 ;; Pick the first article. | 6864 ((not (or unread undownloaded unseen)) |
5857 ((not unread) | 6865 (goto-char (gnus-data-pos (car gnus-newsgroup-data))) |
5858 (goto-char (gnus-data-pos (car gnus-newsgroup-data))) | 6866 (gnus-data-number (car gnus-newsgroup-data))) |
5859 (gnus-data-number (car gnus-newsgroup-data))) | 6867 ;; Find the first unread article. |
5860 ;; No unread articles. | 6868 (t |
5861 ((null gnus-newsgroup-unreads) | 6869 (let ((data gnus-newsgroup-data)) |
5862 (gnus-message 3 "No more unread articles") | 6870 (while (and data |
5863 nil) | 6871 (let ((num (gnus-data-number (car data)))) |
5864 ;; Find the first unread article. | 6872 (or (memq num gnus-newsgroup-unfetched) |
5865 (t | 6873 (not (or (and unread |
5866 (let ((data gnus-newsgroup-data)) | 6874 (memq num gnus-newsgroup-unreads)) |
5867 (while (and data | 6875 (and undownloaded |
5868 (and (not (and undownloaded | 6876 (memq num gnus-newsgroup-undownloaded)) |
5869 (eq gnus-undownloaded-mark | 6877 (and unseen |
5870 (gnus-data-mark (car data))))) | 6878 (memq num gnus-newsgroup-unseen))))))) |
5871 (not (gnus-data-unread-p (car data))))) | 6879 (setq data (cdr data))) |
5872 (setq data (cdr data))) | 6880 (prog1 |
5873 (when data | 6881 (if data |
5874 (goto-char (gnus-data-pos (car data))) | 6882 (progn |
5875 (gnus-data-number (car data)))))) | 6883 (goto-char (gnus-data-pos (car data))) |
5876 (gnus-summary-position-point))) | 6884 (gnus-data-number (car data))) |
6885 (gnus-message 3 "No more%s articles" | |
6886 (let* ((r (when unread " unread")) | |
6887 (d (when undownloaded " undownloaded")) | |
6888 (s (when unseen " unseen")) | |
6889 (l (delq nil (list r d s)))) | |
6890 (cond ((= 3 (length l)) | |
6891 (concat r "," d ", or" s)) | |
6892 ((= 2 (length l)) | |
6893 (concat (car l) ", or" (cadr l))) | |
6894 ((= 1 (length l)) | |
6895 (car l)) | |
6896 (t | |
6897 "")))) | |
6898 nil | |
6899 ) | |
6900 (gnus-summary-position-point)))))) | |
5877 | 6901 |
5878 (defun gnus-summary-next-subject (n &optional unread dont-display) | 6902 (defun gnus-summary-next-subject (n &optional unread dont-display) |
5879 "Go to next N'th summary line. | 6903 "Go to next N'th summary line. |
5880 If N is negative, go to the previous N'th subject line. | 6904 If N is negative, go to the previous N'th subject line. |
5881 If UNREAD is non-nil, only unread articles are selected. | 6905 If UNREAD is non-nil, only unread articles are selected. |
5912 (defun gnus-summary-prev-unread-subject (n) | 6936 (defun gnus-summary-prev-unread-subject (n) |
5913 "Go to previous N'th unread summary line." | 6937 "Go to previous N'th unread summary line." |
5914 (interactive "p") | 6938 (interactive "p") |
5915 (gnus-summary-next-subject (- n) t)) | 6939 (gnus-summary-next-subject (- n) t)) |
5916 | 6940 |
6941 (defun gnus-summary-goto-subjects (articles) | |
6942 "Insert the subject header for ARTICLES in the current buffer." | |
6943 (save-excursion | |
6944 (dolist (article articles) | |
6945 (gnus-summary-goto-subject article t))) | |
6946 (gnus-summary-limit (append articles gnus-newsgroup-limit)) | |
6947 (gnus-summary-position-point)) | |
6948 | |
5917 (defun gnus-summary-goto-subject (article &optional force silent) | 6949 (defun gnus-summary-goto-subject (article &optional force silent) |
5918 "Go the subject line of ARTICLE. | 6950 "Go the subject line of ARTICLE. |
5919 If FORCE, also allow jumping to articles not currently shown." | 6951 If FORCE, also allow jumping to articles not currently shown." |
5920 (interactive "nArticle number: ") | 6952 (interactive "nArticle number: ") |
6953 (unless (numberp article) | |
6954 (error "Article %s is not a number" article)) | |
5921 (let ((b (point)) | 6955 (let ((b (point)) |
5922 (data (gnus-data-find article))) | 6956 (data (gnus-data-find article))) |
5923 ;; We read in the article if we have to. | 6957 ;; We read in the article if we have to. |
5924 (and (not data) | 6958 (and (not data) |
5925 force | 6959 force |
5932 (if (not data) | 6966 (if (not data) |
5933 (progn | 6967 (progn |
5934 (unless silent | 6968 (unless silent |
5935 (gnus-message 3 "Can't find article %d" article)) | 6969 (gnus-message 3 "Can't find article %d" article)) |
5936 nil) | 6970 nil) |
5937 (goto-char (gnus-data-pos data)) | 6971 (let ((pt (gnus-data-pos data))) |
6972 (goto-char pt) | |
6973 (gnus-summary-set-article-display-arrow pt)) | |
5938 (gnus-summary-position-point) | 6974 (gnus-summary-position-point) |
5939 article))) | 6975 article))) |
5940 | 6976 |
5941 ;; Walking around summary lines with displaying articles. | 6977 ;; Walking around summary lines with displaying articles. |
5942 | 6978 |
5952 "Display ARTICLE in article buffer." | 6988 "Display ARTICLE in article buffer." |
5953 (when (gnus-buffer-live-p gnus-article-buffer) | 6989 (when (gnus-buffer-live-p gnus-article-buffer) |
5954 (with-current-buffer gnus-article-buffer | 6990 (with-current-buffer gnus-article-buffer |
5955 (mm-enable-multibyte))) | 6991 (mm-enable-multibyte))) |
5956 (gnus-set-global-variables) | 6992 (gnus-set-global-variables) |
6993 (when (gnus-buffer-live-p gnus-article-buffer) | |
6994 (with-current-buffer gnus-article-buffer | |
6995 (setq gnus-article-charset gnus-newsgroup-charset) | |
6996 (setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets) | |
6997 (mm-enable-multibyte))) | |
5957 (if (null article) | 6998 (if (null article) |
5958 nil | 6999 nil |
5959 (prog1 | 7000 (prog1 |
5960 (if gnus-summary-display-article-function | 7001 (if gnus-summary-display-article-function |
5961 (funcall gnus-summary-display-article-function article all-header) | 7002 (funcall gnus-summary-display-article-function article all-header) |
6002 force) | 7043 force) |
6003 ;; The requested article is different from the current article. | 7044 ;; The requested article is different from the current article. |
6004 (progn | 7045 (progn |
6005 (gnus-summary-display-article article all-headers) | 7046 (gnus-summary-display-article article all-headers) |
6006 (when (gnus-buffer-live-p gnus-article-buffer) | 7047 (when (gnus-buffer-live-p gnus-article-buffer) |
6007 (with-current-buffer gnus-article-buffer | 7048 (with-current-buffer gnus-article-buffer |
6008 (if (not gnus-article-decoded-p) ;; a local variable | 7049 (if (not gnus-article-decoded-p) ;; a local variable |
6009 (mm-disable-multibyte)))) | 7050 (mm-disable-multibyte)))) |
6010 (when (or all-headers gnus-show-all-headers) | |
6011 (gnus-article-show-all-headers)) | |
6012 (gnus-article-set-window-start | 7051 (gnus-article-set-window-start |
6013 (cdr (assq article gnus-newsgroup-bookmarks))) | 7052 (cdr (assq article gnus-newsgroup-bookmarks))) |
6014 article) | 7053 article) |
6015 (when (or all-headers gnus-show-all-headers) | |
6016 (gnus-article-show-all-headers)) | |
6017 'old)))) | 7054 'old)))) |
7055 | |
7056 (defun gnus-summary-force-verify-and-decrypt () | |
7057 "Display buttons for signed/encrypted parts and verify/decrypt them." | |
7058 (interactive) | |
7059 (let ((mm-verify-option 'known) | |
7060 (mm-decrypt-option 'known) | |
7061 (gnus-article-emulate-mime t) | |
7062 (gnus-buttonized-mime-types (append (list "multipart/signed" | |
7063 "multipart/encrypted") | |
7064 gnus-buttonized-mime-types))) | |
7065 (gnus-summary-select-article nil 'force))) | |
6018 | 7066 |
6019 (defun gnus-summary-set-current-mark (&optional current-mark) | 7067 (defun gnus-summary-set-current-mark (&optional current-mark) |
6020 "Obsolete function." | 7068 "Obsolete function." |
6021 nil) | 7069 nil) |
6022 | 7070 |
6085 | 7133 |
6086 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start) | 7134 (defun gnus-summary-walk-group-buffer (from-group cmd unread backward start) |
6087 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1)) | 7135 (let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1)) |
6088 (?\C-p (gnus-group-prev-unread-group 1)))) | 7136 (?\C-p (gnus-group-prev-unread-group 1)))) |
6089 (cursor-in-echo-area t) | 7137 (cursor-in-echo-area t) |
6090 keve key group ended) | 7138 keve key group ended prompt) |
6091 (save-excursion | 7139 (save-excursion |
6092 (set-buffer gnus-group-buffer) | 7140 (set-buffer gnus-group-buffer) |
6093 (goto-char start) | 7141 (goto-char start) |
6094 (setq group | 7142 (setq group |
6095 (if (eq gnus-keep-same-level 'best) | 7143 (if (eq gnus-keep-same-level 'best) |
6096 (gnus-summary-best-group gnus-newsgroup-name) | 7144 (gnus-summary-best-group gnus-newsgroup-name) |
6097 (gnus-summary-search-group backward gnus-keep-same-level)))) | 7145 (gnus-summary-search-group backward gnus-keep-same-level)))) |
6098 (while (not ended) | 7146 (while (not ended) |
6099 (gnus-message | 7147 (setq prompt |
6100 5 "No more%s articles%s" (if unread " unread" "") | 7148 (format |
6101 (if (and group | 7149 "No more%s articles%s " (if unread " unread" "") |
6102 (not (gnus-ephemeral-group-p gnus-newsgroup-name))) | 7150 (if (and group |
6103 (format " (Type %s for %s [%s])" | 7151 (not (gnus-ephemeral-group-p gnus-newsgroup-name))) |
6104 (single-key-description cmd) group | 7152 (format " (Type %s for %s [%s])" |
6105 (car (gnus-gethash group gnus-newsrc-hashtb))) | 7153 (single-key-description cmd) group |
6106 (format " (Type %s to exit %s)" | 7154 (car (gnus-gethash group gnus-newsrc-hashtb))) |
6107 (single-key-description cmd) | 7155 (format " (Type %s to exit %s)" |
6108 gnus-newsgroup-name))) | 7156 (single-key-description cmd) |
7157 gnus-newsgroup-name)))) | |
6109 ;; Confirm auto selection. | 7158 ;; Confirm auto selection. |
6110 (setq key (car (setq keve (gnus-read-event-char)))) | 7159 (setq key (car (setq keve (gnus-read-event-char prompt))) |
6111 (setq ended t) | 7160 ended t) |
6112 (cond | 7161 (cond |
6113 ((assq key keystrokes) | 7162 ((assq key keystrokes) |
6114 (let ((obuf (current-buffer))) | 7163 (let ((obuf (current-buffer))) |
6115 (switch-to-buffer gnus-group-buffer) | 7164 (switch-to-buffer gnus-group-buffer) |
6116 (when group | 7165 (when group |
6149 (or (not (eq gnus-summary-goto-unread 'never)) | 7198 (or (not (eq gnus-summary-goto-unread 'never)) |
6150 (gnus-summary-first-article-p (gnus-summary-article-number))) | 7199 (gnus-summary-first-article-p (gnus-summary-article-number))) |
6151 (and gnus-auto-select-same | 7200 (and gnus-auto-select-same |
6152 (gnus-summary-article-subject)))) | 7201 (gnus-summary-article-subject)))) |
6153 | 7202 |
6154 (defun gnus-summary-next-page (&optional lines circular) | 7203 (defun gnus-summary-next-page (&optional lines circular stop) |
6155 "Show next page of the selected article. | 7204 "Show next page of the selected article. |
6156 If at the end of the current article, select the next article. | 7205 If at the end of the current article, select the next article. |
6157 LINES says how many lines should be scrolled up. | 7206 LINES says how many lines should be scrolled up. |
6158 | 7207 |
6159 If CIRCULAR is non-nil, go to the start of the article instead of | 7208 If CIRCULAR is non-nil, go to the start of the article instead of |
6160 selecting the next article when reaching the end of the current | 7209 selecting the next article when reaching the end of the current |
6161 article." | 7210 article. |
7211 | |
7212 If STOP is non-nil, just stop when reaching the end of the message. | |
7213 | |
7214 Also see the variable `gnus-article-skip-boring'." | |
6162 (interactive "P") | 7215 (interactive "P") |
6163 (setq gnus-summary-buffer (current-buffer)) | 7216 (setq gnus-summary-buffer (current-buffer)) |
6164 (gnus-set-global-variables) | 7217 (gnus-set-global-variables) |
6165 (let ((article (gnus-summary-article-number)) | 7218 (let ((article (gnus-summary-article-number)) |
6166 (article-window (get-buffer-window gnus-article-buffer t)) | 7219 (article-window (get-buffer-window gnus-article-buffer t)) |
6180 (not (equal (car gnus-article-current) gnus-newsgroup-name))) | 7233 (not (equal (car gnus-article-current) gnus-newsgroup-name))) |
6181 ;; Selected subject is different from current article's. | 7234 ;; Selected subject is different from current article's. |
6182 (gnus-summary-display-article article) | 7235 (gnus-summary-display-article article) |
6183 (when article-window | 7236 (when article-window |
6184 (gnus-eval-in-buffer-window gnus-article-buffer | 7237 (gnus-eval-in-buffer-window gnus-article-buffer |
6185 (setq endp (gnus-article-next-page lines))) | 7238 (setq endp (or (gnus-article-next-page lines) |
7239 (gnus-article-only-boring-p)))) | |
6186 (when endp | 7240 (when endp |
6187 (cond (circular | 7241 (cond (stop |
7242 (gnus-message 3 "End of message")) | |
7243 (circular | |
6188 (gnus-summary-beginning-of-article)) | 7244 (gnus-summary-beginning-of-article)) |
6189 (lines | 7245 (lines |
6190 (gnus-message 3 "End of message")) | 7246 (gnus-message 3 "End of message")) |
6191 ((null lines) | 7247 ((null lines) |
6192 (if (and (eq gnus-summary-goto-unread 'never) | 7248 (if (and (eq gnus-summary-goto-unread 'never) |
6294 (when (gnus-summary-first-subject t) | 7350 (when (gnus-summary-first-subject t) |
6295 (gnus-summary-show-thread) | 7351 (gnus-summary-show-thread) |
6296 (gnus-summary-first-subject t)) | 7352 (gnus-summary-first-subject t)) |
6297 (gnus-summary-position-point))) | 7353 (gnus-summary-position-point))) |
6298 | 7354 |
7355 (defun gnus-summary-first-unseen-subject () | |
7356 "Place the point on the subject line of the first unseen article. | |
7357 Return nil if there are no unseen articles." | |
7358 (interactive) | |
7359 (prog1 | |
7360 (when (gnus-summary-first-subject nil nil t) | |
7361 (gnus-summary-show-thread) | |
7362 (gnus-summary-first-subject nil nil t)) | |
7363 (gnus-summary-position-point))) | |
7364 | |
7365 (defun gnus-summary-first-unseen-or-unread-subject () | |
7366 "Place the point on the subject line of the first unseen article or, | |
7367 if all article have been seen, on the subject line of the first unread | |
7368 article." | |
7369 (interactive) | |
7370 (prog1 | |
7371 (unless (when (gnus-summary-first-subject nil nil t) | |
7372 (gnus-summary-show-thread) | |
7373 (gnus-summary-first-subject nil nil t)) | |
7374 (when (gnus-summary-first-subject t) | |
7375 (gnus-summary-show-thread) | |
7376 (gnus-summary-first-subject t))) | |
7377 (gnus-summary-position-point))) | |
7378 | |
6299 (defun gnus-summary-first-article () | 7379 (defun gnus-summary-first-article () |
6300 "Select the first article. | 7380 "Select the first article. |
6301 Return nil if there are no articles." | 7381 Return nil if there are no articles." |
6302 (interactive) | 7382 (interactive) |
6303 (prog1 | 7383 (prog1 |
6305 (gnus-summary-show-thread) | 7385 (gnus-summary-show-thread) |
6306 (gnus-summary-first-subject) | 7386 (gnus-summary-first-subject) |
6307 (gnus-summary-display-article (gnus-summary-article-number))) | 7387 (gnus-summary-display-article (gnus-summary-article-number))) |
6308 (gnus-summary-position-point))) | 7388 (gnus-summary-position-point))) |
6309 | 7389 |
6310 (defun gnus-summary-best-unread-article () | 7390 (defun gnus-summary-best-unread-article (&optional arg) |
6311 "Select the unread article with the highest score." | 7391 "Select the unread article with the highest score. |
7392 If given a prefix argument, select the next unread article that has a | |
7393 score higher than the default score." | |
7394 (interactive "P") | |
7395 (let ((article (if arg | |
7396 (gnus-summary-better-unread-subject) | |
7397 (gnus-summary-best-unread-subject)))) | |
7398 (if article | |
7399 (gnus-summary-goto-article article) | |
7400 (error "No unread articles")))) | |
7401 | |
7402 (defun gnus-summary-best-unread-subject () | |
7403 "Select the unread subject with the highest score." | |
6312 (interactive) | 7404 (interactive) |
6313 (let ((best -1000000) | 7405 (let ((best -1000000) |
6314 (data gnus-newsgroup-data) | 7406 (data gnus-newsgroup-data) |
6315 article score) | 7407 article score) |
6316 (while data | 7408 (while data |
6319 (gnus-summary-article-score (gnus-data-number (car data)))) | 7411 (gnus-summary-article-score (gnus-data-number (car data)))) |
6320 best) | 7412 best) |
6321 (setq best score | 7413 (setq best score |
6322 article (gnus-data-number (car data)))) | 7414 article (gnus-data-number (car data)))) |
6323 (setq data (cdr data))) | 7415 (setq data (cdr data))) |
6324 (prog1 | 7416 (when article |
6325 (if article | 7417 (gnus-summary-goto-subject article)) |
6326 (gnus-summary-goto-article article) | 7418 (gnus-summary-position-point) |
6327 (error "No unread articles")) | 7419 article)) |
6328 (gnus-summary-position-point)))) | 7420 |
7421 (defun gnus-summary-better-unread-subject () | |
7422 "Select the first unread subject that has a score over the default score." | |
7423 (interactive) | |
7424 (let ((data gnus-newsgroup-data) | |
7425 article score) | |
7426 (while (and (setq article (gnus-data-number (car data))) | |
7427 (or (gnus-data-read-p (car data)) | |
7428 (not (> (gnus-summary-article-score article) | |
7429 gnus-summary-default-score)))) | |
7430 (setq data (cdr data))) | |
7431 (when article | |
7432 (gnus-summary-goto-subject article)) | |
7433 (gnus-summary-position-point) | |
7434 article)) | |
6329 | 7435 |
6330 (defun gnus-summary-last-subject () | 7436 (defun gnus-summary-last-subject () |
6331 "Go to the last displayed subject line in the group." | 7437 "Go to the last displayed subject line in the group." |
6332 (let ((article (gnus-data-number (car (gnus-data-list t))))) | 7438 (let ((article (gnus-data-number (car (gnus-data-list t))))) |
6333 (when article | 7439 (when article |
6346 gnus-newsgroup-limit)) | 7452 gnus-newsgroup-limit)) |
6347 current-prefix-arg | 7453 current-prefix-arg |
6348 t)) | 7454 t)) |
6349 (prog1 | 7455 (prog1 |
6350 (if (and (stringp article) | 7456 (if (and (stringp article) |
6351 (string-match "@" article)) | 7457 (string-match "@\\|%40" article)) |
6352 (gnus-summary-refer-article article) | 7458 (gnus-summary-refer-article article) |
6353 (when (stringp article) | 7459 (when (stringp article) |
6354 (setq article (string-to-number article))) | 7460 (setq article (string-to-number article))) |
6355 (if (gnus-summary-goto-subject article force) | 7461 (if (gnus-summary-goto-subject article force) |
6356 (gnus-summary-display-article article all-headers) | 7462 (gnus-summary-display-article article all-headers) |
6441 (let ((younger current-prefix-arg) | 7547 (let ((younger current-prefix-arg) |
6442 (days-got nil) | 7548 (days-got nil) |
6443 days) | 7549 days) |
6444 (while (not days-got) | 7550 (while (not days-got) |
6445 (setq days (if younger | 7551 (setq days (if younger |
6446 (read-string "Limit to articles within (in days): ") | 7552 (read-string "Limit to articles younger than (in days, older when negative): ") |
6447 (read-string "Limit to articles old than (in days): "))) | 7553 (read-string |
7554 "Limit to articles older than (in days, younger when negative): "))) | |
6448 (when (> (length days) 0) | 7555 (when (> (length days) 0) |
6449 (setq days (read days))) | 7556 (setq days (read days))) |
6450 (if (numberp days) | 7557 (if (numberp days) |
6451 (setq days-got t) | 7558 (progn |
7559 (setq days-got t) | |
7560 (if (< days 0) | |
7561 (progn | |
7562 (setq younger (not younger)) | |
7563 (setq days (* days -1))))) | |
6452 (message "Please enter a number.") | 7564 (message "Please enter a number.") |
6453 (sleep-for 1))) | 7565 (sleep-for 1))) |
6454 (list days younger))) | 7566 (list days younger))) |
6455 (prog1 | 7567 (prog1 |
6456 (let ((data gnus-newsgroup-data) | 7568 (let ((data gnus-newsgroup-data) |
6474 (defun gnus-summary-limit-to-extra (header regexp &optional not-matching) | 7586 (defun gnus-summary-limit-to-extra (header regexp &optional not-matching) |
6475 "Limit the summary buffer to articles that match an 'extra' header." | 7587 "Limit the summary buffer to articles that match an 'extra' header." |
6476 (interactive | 7588 (interactive |
6477 (let ((header | 7589 (let ((header |
6478 (intern | 7590 (intern |
6479 (gnus-completing-read | 7591 (gnus-completing-read-with-default |
6480 (symbol-name (car gnus-extra-headers)) | 7592 (symbol-name (car gnus-extra-headers)) |
6481 (if current-prefix-arg | 7593 (if current-prefix-arg |
6482 "Exclude extra header:" | 7594 "Exclude extra header:" |
6483 "Limit extra header:") | 7595 "Limit extra header:") |
6484 (mapcar (lambda (x) | 7596 (mapcar (lambda (x) |
6499 (unless articles | 7611 (unless articles |
6500 (error "Found no matches for \"%s\"" regexp)) | 7612 (error "Found no matches for \"%s\"" regexp)) |
6501 (gnus-summary-limit articles)) | 7613 (gnus-summary-limit articles)) |
6502 (gnus-summary-position-point)))) | 7614 (gnus-summary-position-point)))) |
6503 | 7615 |
7616 (defun gnus-summary-limit-to-display-predicate () | |
7617 "Limit the summary buffer to the predicated in the `display' group parameter." | |
7618 (interactive) | |
7619 (unless gnus-newsgroup-display | |
7620 (error "There is no `display' group parameter")) | |
7621 (let (articles) | |
7622 (dolist (number gnus-newsgroup-articles) | |
7623 (when (funcall gnus-newsgroup-display) | |
7624 (push number articles))) | |
7625 (gnus-summary-limit articles)) | |
7626 (gnus-summary-position-point)) | |
7627 | |
6504 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) | 7628 (defalias 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) |
6505 (make-obsolete | 7629 (make-obsolete |
6506 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) | 7630 'gnus-summary-delete-marked-as-read 'gnus-summary-limit-to-unread) |
6507 | 7631 |
6508 (defun gnus-summary-limit-to-unread (&optional all) | 7632 (defun gnus-summary-limit-to-unread (&optional all) |
6513 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark)) | 7637 (gnus-summary-limit-to-marks (char-to-string gnus-unread-mark)) |
6514 (gnus-summary-limit-to-marks | 7638 (gnus-summary-limit-to-marks |
6515 ;; Concat all the marks that say that an article is read and have | 7639 ;; Concat all the marks that say that an article is read and have |
6516 ;; those removed. | 7640 ;; those removed. |
6517 (list gnus-del-mark gnus-read-mark gnus-ancient-mark | 7641 (list gnus-del-mark gnus-read-mark gnus-ancient-mark |
6518 gnus-killed-mark gnus-kill-file-mark | 7642 gnus-killed-mark gnus-spam-mark gnus-kill-file-mark |
6519 gnus-low-score-mark gnus-expirable-mark | 7643 gnus-low-score-mark gnus-expirable-mark |
6520 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark | 7644 gnus-canceled-mark gnus-catchup-mark gnus-sparse-mark |
6521 gnus-duplicate-mark gnus-souped-mark) | 7645 gnus-duplicate-mark gnus-souped-mark) |
6522 'reverse))) | 7646 'reverse))) |
6523 | 7647 |
6551 (push (gnus-data-number (car data)) articles)) | 7675 (push (gnus-data-number (car data)) articles)) |
6552 (setq data (cdr data))) | 7676 (setq data (cdr data))) |
6553 (gnus-summary-limit articles)) | 7677 (gnus-summary-limit articles)) |
6554 (gnus-summary-position-point))) | 7678 (gnus-summary-position-point))) |
6555 | 7679 |
6556 (defun gnus-summary-limit-to-score (&optional score) | 7680 (defun gnus-summary-limit-to-score (score) |
6557 "Limit to articles with score at or above SCORE." | 7681 "Limit to articles with score at or above SCORE." |
6558 (interactive "P") | 7682 (interactive "NLimit to articles with score of at least: ") |
6559 (setq score (if score | |
6560 (prefix-numeric-value score) | |
6561 (or gnus-summary-default-score 0))) | |
6562 (let ((data gnus-newsgroup-data) | 7683 (let ((data gnus-newsgroup-data) |
6563 articles) | 7684 articles) |
6564 (while data | 7685 (while data |
6565 (when (>= (gnus-summary-article-score (gnus-data-number (car data))) | 7686 (when (>= (gnus-summary-article-score (gnus-data-number (car data))) |
6566 score) | 7687 score) |
6568 (setq data (cdr data))) | 7689 (setq data (cdr data))) |
6569 (prog1 | 7690 (prog1 |
6570 (gnus-summary-limit articles) | 7691 (gnus-summary-limit articles) |
6571 (gnus-summary-position-point)))) | 7692 (gnus-summary-position-point)))) |
6572 | 7693 |
7694 (defun gnus-summary-limit-to-unseen () | |
7695 "Limit to unseen articles." | |
7696 (interactive) | |
7697 (prog1 | |
7698 (gnus-summary-limit gnus-newsgroup-unseen) | |
7699 (gnus-summary-position-point))) | |
7700 | |
6573 (defun gnus-summary-limit-include-thread (id) | 7701 (defun gnus-summary-limit-include-thread (id) |
6574 "Display all the hidden articles that in the current thread." | 7702 "Display all the hidden articles that is in the thread with ID in it. |
7703 When called interactively, ID is the Message-ID of the current | |
7704 article." | |
6575 (interactive (list (mail-header-id (gnus-summary-article-header)))) | 7705 (interactive (list (mail-header-id (gnus-summary-article-header)))) |
6576 (let ((articles (gnus-articles-in-thread | 7706 (let ((articles (gnus-articles-in-thread |
6577 (gnus-id-to-thread (gnus-root-id id))))) | 7707 (gnus-id-to-thread (gnus-root-id id))))) |
6578 (prog1 | 7708 (prog1 |
6579 (gnus-summary-limit (nconc articles gnus-newsgroup-limit)) | 7709 (gnus-summary-limit (nconc articles gnus-newsgroup-limit)) |
7710 (gnus-summary-limit-include-matching-articles | |
7711 "subject" | |
7712 (regexp-quote (gnus-simplify-subject-re | |
7713 (mail-header-subject (gnus-id-to-header id))))) | |
6580 (gnus-summary-position-point)))) | 7714 (gnus-summary-position-point)))) |
7715 | |
7716 (defun gnus-summary-limit-include-matching-articles (header regexp) | |
7717 "Display all the hidden articles that have HEADERs that match REGEXP." | |
7718 (interactive (list (read-string "Match on header: ") | |
7719 (read-string "Regexp: "))) | |
7720 (let ((articles (gnus-find-matching-articles header regexp))) | |
7721 (prog1 | |
7722 (gnus-summary-limit (nconc articles gnus-newsgroup-limit)) | |
7723 (gnus-summary-position-point)))) | |
7724 | |
7725 (defun gnus-summary-insert-dormant-articles () | |
7726 "Insert all the dormant articles for this group into the current buffer." | |
7727 (interactive) | |
7728 (let ((gnus-verbose (max 6 gnus-verbose))) | |
7729 (if (not gnus-newsgroup-dormant) | |
7730 (gnus-message 3 "No cached articles for this group") | |
7731 (gnus-summary-goto-subjects gnus-newsgroup-dormant)))) | |
6581 | 7732 |
6582 (defun gnus-summary-limit-include-dormant () | 7733 (defun gnus-summary-limit-include-dormant () |
6583 "Display all the hidden articles that are marked as dormant. | 7734 "Display all the hidden articles that are marked as dormant. |
6584 Note that this command only works on a subset of the articles currently | 7735 Note that this command only works on a subset of the articles currently |
6585 fetched for this group." | 7736 fetched for this group." |
6623 | 7774 |
6624 (defun gnus-summary-limit-mark-excluded-as-read (&optional all) | 7775 (defun gnus-summary-limit-mark-excluded-as-read (&optional all) |
6625 "Mark all unread excluded articles as read. | 7776 "Mark all unread excluded articles as read. |
6626 If ALL, mark even excluded ticked and dormants as read." | 7777 If ALL, mark even excluded ticked and dormants as read." |
6627 (interactive "P") | 7778 (interactive "P") |
6628 (let ((articles (gnus-sorted-complement | 7779 (setq gnus-newsgroup-limit (sort gnus-newsgroup-limit '<)) |
7780 (let ((articles (gnus-sorted-ndifference | |
6629 (sort | 7781 (sort |
6630 (mapcar (lambda (h) (mail-header-number h)) | 7782 (mapcar (lambda (h) (mail-header-number h)) |
6631 gnus-newsgroup-headers) | 7783 gnus-newsgroup-headers) |
6632 '<) | 7784 '<) |
6633 (sort gnus-newsgroup-limit '<))) | 7785 gnus-newsgroup-limit)) |
6634 article) | 7786 article) |
6635 (setq gnus-newsgroup-unreads | 7787 (setq gnus-newsgroup-unreads |
6636 (gnus-intersection gnus-newsgroup-unreads gnus-newsgroup-limit)) | 7788 (gnus-sorted-intersection gnus-newsgroup-unreads |
7789 gnus-newsgroup-limit)) | |
6637 (if all | 7790 (if all |
6638 (setq gnus-newsgroup-dormant nil | 7791 (setq gnus-newsgroup-dormant nil |
6639 gnus-newsgroup-marked nil | 7792 gnus-newsgroup-marked nil |
6640 gnus-newsgroup-reads | 7793 gnus-newsgroup-reads |
6641 (nconc | 7794 (nconc |
6661 found) | 7814 found) |
6662 ;; This will do all the work of generating the new summary buffer | 7815 ;; This will do all the work of generating the new summary buffer |
6663 ;; according to the new limit. | 7816 ;; according to the new limit. |
6664 (gnus-summary-prepare) | 7817 (gnus-summary-prepare) |
6665 ;; Hide any threads, possibly. | 7818 ;; Hide any threads, possibly. |
6666 (and gnus-show-threads | 7819 (gnus-summary-maybe-hide-threads) |
6667 gnus-thread-hide-subtree | |
6668 (gnus-summary-hide-all-threads)) | |
6669 ;; Try to return to the article you were at, or one in the | 7820 ;; Try to return to the article you were at, or one in the |
6670 ;; neighborhood. | 7821 ;; neighborhood. |
6671 (when data | 7822 (when data |
6672 ;; We try to find some article after the current one. | 7823 ;; We try to find some article after the current one. |
6673 (while data | 7824 (while data |
6723 th nil) | 7874 th nil) |
6724 (setq th (cdr th)))))))))) | 7875 (setq th (cdr th)))))))))) |
6725 thread) | 7876 thread) |
6726 | 7877 |
6727 (defun gnus-cut-threads (threads) | 7878 (defun gnus-cut-threads (threads) |
6728 "Cut off all uninteresting articles from the beginning of threads." | 7879 "Cut off all uninteresting articles from the beginning of THREADS." |
6729 (when (or (eq gnus-fetch-old-headers 'some) | 7880 (when (or (eq gnus-fetch-old-headers 'some) |
6730 (eq gnus-fetch-old-headers 'invisible) | 7881 (eq gnus-fetch-old-headers 'invisible) |
6731 (numberp gnus-fetch-old-headers) | 7882 (numberp gnus-fetch-old-headers) |
6732 (eq gnus-build-sparse-threads 'some) | 7883 (eq gnus-build-sparse-threads 'some) |
6733 (eq gnus-build-sparse-threads 'more)) | 7884 (eq gnus-build-sparse-threads 'more)) |
6743 This entails weeding out unwanted dormants, low-scored articles, | 7894 This entails weeding out unwanted dormants, low-scored articles, |
6744 fetch-old-headers verbiage, and so on." | 7895 fetch-old-headers verbiage, and so on." |
6745 ;; Most groups have nothing to remove. | 7896 ;; Most groups have nothing to remove. |
6746 (if (or gnus-inhibit-limiting | 7897 (if (or gnus-inhibit-limiting |
6747 (and (null gnus-newsgroup-dormant) | 7898 (and (null gnus-newsgroup-dormant) |
7899 (eq gnus-newsgroup-display 'gnus-not-ignore) | |
6748 (not (eq gnus-fetch-old-headers 'some)) | 7900 (not (eq gnus-fetch-old-headers 'some)) |
6749 (not (numberp gnus-fetch-old-headers)) | 7901 (not (numberp gnus-fetch-old-headers)) |
6750 (not (eq gnus-fetch-old-headers 'invisible)) | 7902 (not (eq gnus-fetch-old-headers 'invisible)) |
6751 (null gnus-summary-expunge-below) | 7903 (null gnus-summary-expunge-below) |
6752 (not (eq gnus-build-sparse-threads 'some)) | 7904 (not (eq gnus-build-sparse-threads 'some)) |
6782 ;; First we get the number of visible children to this thread. This | 7934 ;; First we get the number of visible children to this thread. This |
6783 ;; is done by recursing down the thread using this function, so this | 7935 ;; is done by recursing down the thread using this function, so this |
6784 ;; will really go down to a leaf article first, before slowly | 7936 ;; will really go down to a leaf article first, before slowly |
6785 ;; working its way up towards the root. | 7937 ;; working its way up towards the root. |
6786 (when thread | 7938 (when thread |
6787 (let ((children | 7939 (let* ((max-lisp-eval-depth 5000) |
7940 (children | |
6788 (if (cdr thread) | 7941 (if (cdr thread) |
6789 (apply '+ (mapcar 'gnus-summary-limit-children | 7942 (apply '+ (mapcar 'gnus-summary-limit-children |
6790 (cdr thread))) | 7943 (cdr thread))) |
6791 0)) | 7944 0)) |
6792 (number (mail-header-number (car thread))) | 7945 (number (mail-header-number (car thread))) |
6831 (if gnus-newsgroup-auto-expire | 7984 (if gnus-newsgroup-auto-expire |
6832 (push number gnus-newsgroup-expirable) | 7985 (push number gnus-newsgroup-expirable) |
6833 (push (cons number gnus-low-score-mark) | 7986 (push (cons number gnus-low-score-mark) |
6834 gnus-newsgroup-reads))) | 7987 gnus-newsgroup-reads))) |
6835 t) | 7988 t) |
7989 ;; Do the `display' group parameter. | |
7990 (and gnus-newsgroup-display | |
7991 (not (funcall gnus-newsgroup-display))) | |
6836 ;; Check NoCeM things. | 7992 ;; Check NoCeM things. |
6837 (if (and gnus-use-nocem | 7993 (if (and gnus-use-nocem |
6838 (gnus-nocem-unwanted-article-p | 7994 (gnus-nocem-unwanted-article-p |
6839 (mail-header-id (car thread)))) | 7995 (mail-header-id (car thread)))) |
6840 (progn | 7996 (progn |
6888 ;; server. | 8044 ;; server. |
6889 (save-excursion | 8045 (save-excursion |
6890 (set-buffer gnus-original-article-buffer) | 8046 (set-buffer gnus-original-article-buffer) |
6891 (nnheader-narrow-to-headers) | 8047 (nnheader-narrow-to-headers) |
6892 (unless (setq ref (message-fetch-field "references")) | 8048 (unless (setq ref (message-fetch-field "references")) |
6893 (setq ref (message-fetch-field "in-reply-to"))) | 8049 (when (setq ref (message-fetch-field "in-reply-to")) |
8050 (setq ref (gnus-extract-message-id-from-in-reply-to ref)))) | |
6894 (widen)) | 8051 (widen)) |
6895 (setq ref | 8052 (setq ref |
6896 ;; It's not the current article, so we take a bet on | 8053 ;; It's not the current article, so we take a bet on |
6897 ;; the value we got from the server. | 8054 ;; the value we got from the server. |
6898 (mail-header-references header))) | 8055 (mail-header-references header))) |
6934 of what's specified by the `gnus-refer-thread-limit' variable." | 8091 of what's specified by the `gnus-refer-thread-limit' variable." |
6935 (interactive "P") | 8092 (interactive "P") |
6936 (let ((id (mail-header-id (gnus-summary-article-header))) | 8093 (let ((id (mail-header-id (gnus-summary-article-header))) |
6937 (limit (if limit (prefix-numeric-value limit) | 8094 (limit (if limit (prefix-numeric-value limit) |
6938 gnus-refer-thread-limit))) | 8095 gnus-refer-thread-limit))) |
6939 ;; We want to fetch LIMIT *old* headers, but we also have to | |
6940 ;; re-fetch all the headers in the current buffer, because many of | |
6941 ;; them may be undisplayed. So we adjust LIMIT. | |
6942 (when (numberp limit) | |
6943 (incf limit (- gnus-newsgroup-end gnus-newsgroup-begin))) | |
6944 (unless (eq gnus-fetch-old-headers 'invisible) | 8096 (unless (eq gnus-fetch-old-headers 'invisible) |
6945 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) | 8097 (gnus-message 5 "Fetching headers for %s..." gnus-newsgroup-name) |
6946 ;; Retrieve the headers and read them in. | 8098 ;; Retrieve the headers and read them in. |
6947 (if (eq (gnus-retrieve-headers | 8099 (if (eq (if (numberp limit) |
6948 (list gnus-newsgroup-end) gnus-newsgroup-name limit) | 8100 (gnus-retrieve-headers |
8101 (list (min | |
8102 (+ (mail-header-number | |
8103 (gnus-summary-article-header)) | |
8104 limit) | |
8105 gnus-newsgroup-end)) | |
8106 gnus-newsgroup-name (* limit 2)) | |
8107 ;; gnus-refer-thread-limit is t, i.e. fetch _all_ | |
8108 ;; headers. | |
8109 (gnus-retrieve-headers (list gnus-newsgroup-end) | |
8110 gnus-newsgroup-name limit)) | |
6949 'nov) | 8111 'nov) |
6950 (gnus-build-all-threads) | 8112 (gnus-build-all-threads) |
6951 (error "Can't fetch thread from backends that don't support NOV")) | 8113 (error "Can't fetch thread from back ends that don't support NOV")) |
6952 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)) | 8114 (gnus-message 5 "Fetching headers for %s...done" gnus-newsgroup-name)) |
6953 (gnus-summary-limit-include-thread id))) | 8115 (gnus-summary-limit-include-thread id))) |
6954 | 8116 |
6955 (defun gnus-summary-refer-article (message-id) | 8117 (defun gnus-summary-refer-article (message-id) |
6956 "Fetch an article specified by MESSAGE-ID." | 8118 "Fetch an article specified by MESSAGE-ID." |
6957 (interactive "sMessage-ID: ") | 8119 (interactive "sMessage-ID: ") |
6958 (when (and (stringp message-id) | 8120 (when (and (stringp message-id) |
6959 (not (zerop (length message-id)))) | 8121 (not (zerop (length message-id)))) |
8122 (setq message-id (gnus-replace-in-string message-id " " "")) | |
6960 ;; Construct the correct Message-ID if necessary. | 8123 ;; Construct the correct Message-ID if necessary. |
6961 ;; Suggested by tale@pawl.rpi.edu. | 8124 ;; Suggested by tale@pawl.rpi.edu. |
6962 (unless (string-match "^<" message-id) | 8125 (unless (string-match "^<" message-id) |
6963 (setq message-id (concat "<" message-id))) | 8126 (setq message-id (concat "<" message-id))) |
6964 (unless (string-match ">$" message-id) | 8127 (unless (string-match ">$" message-id) |
6965 (setq message-id (concat message-id ">"))) | 8128 (setq message-id (concat message-id ">"))) |
8129 ;; People often post MIDs from URLs, so unhex it: | |
8130 (unless (string-match "@" message-id) | |
8131 (setq message-id (gnus-url-unhex-string message-id))) | |
6966 (let* ((header (gnus-id-to-header message-id)) | 8132 (let* ((header (gnus-id-to-header message-id)) |
6967 (sparse (and header | 8133 (sparse (and header |
6968 (gnus-summary-article-sparse-p | 8134 (gnus-summary-article-sparse-p |
6969 (mail-header-number header)) | 8135 (mail-header-number header)) |
6970 (memq (mail-header-number header) | 8136 (memq (mail-header-number header) |
6983 (gnus-summary-update-article (mail-header-number header))))) | 8149 (gnus-summary-update-article (mail-header-number header))))) |
6984 (t | 8150 (t |
6985 ;; We fetch the article. | 8151 ;; We fetch the article. |
6986 (catch 'found | 8152 (catch 'found |
6987 (dolist (gnus-override-method (gnus-refer-article-methods)) | 8153 (dolist (gnus-override-method (gnus-refer-article-methods)) |
6988 (gnus-check-server gnus-override-method) | 8154 (when (and (gnus-check-server gnus-override-method) |
6989 ;; Fetch the header, and display the article. | 8155 ;; Fetch the header, |
6990 (when (setq number (gnus-summary-insert-subject message-id)) | 8156 (setq number (gnus-summary-insert-subject message-id))) |
8157 ;; and display the article. | |
6991 (gnus-summary-select-article nil nil nil number) | 8158 (gnus-summary-select-article nil nil nil number) |
6992 (throw 'found t))) | 8159 (throw 'found t))) |
6993 (gnus-message 3 "Couldn't fetch article %s" message-id))))))) | 8160 (gnus-message 3 "Couldn't fetch article %s" message-id))))))) |
6994 | 8161 |
6995 (defun gnus-refer-article-methods () | 8162 (defun gnus-refer-article-methods () |
7029 "Enter an nndoc group based on the current article. | 8196 "Enter an nndoc group based on the current article. |
7030 If FORCE, force a digest interpretation. If not, try | 8197 If FORCE, force a digest interpretation. If not, try |
7031 to guess what the document format is." | 8198 to guess what the document format is." |
7032 (interactive "P") | 8199 (interactive "P") |
7033 (let ((conf gnus-current-window-configuration)) | 8200 (let ((conf gnus-current-window-configuration)) |
7034 (save-excursion | 8201 (save-window-excursion |
7035 (gnus-summary-select-article)) | 8202 (save-excursion |
8203 (let (gnus-article-prepare-hook | |
8204 gnus-display-mime-function | |
8205 gnus-break-pages) | |
8206 (gnus-summary-select-article)))) | |
7036 (setq gnus-current-window-configuration conf) | 8207 (setq gnus-current-window-configuration conf) |
7037 (let* ((name (format "%s-%d" | 8208 (let* ((name (format "%s-%d" |
7038 (gnus-group-prefixed-name | 8209 (gnus-group-prefixed-name |
7039 gnus-newsgroup-name (list 'nndoc "")) | 8210 gnus-newsgroup-name (list 'nndoc "")) |
7040 (save-excursion | 8211 (save-excursion |
7041 (set-buffer gnus-summary-buffer) | 8212 (set-buffer gnus-summary-buffer) |
7042 gnus-current-article))) | 8213 gnus-current-article))) |
7043 (ogroup gnus-newsgroup-name) | 8214 (ogroup gnus-newsgroup-name) |
7044 (params (append (gnus-info-params (gnus-get-info ogroup)) | 8215 (params (append (gnus-info-params (gnus-get-info ogroup)) |
7045 (list (cons 'to-group ogroup)) | 8216 (list (cons 'to-group ogroup)) |
8217 (list (cons 'parent-group ogroup)) | |
7046 (list (cons 'save-article-group ogroup)))) | 8218 (list (cons 'save-article-group ogroup)))) |
7047 (case-fold-search t) | 8219 (case-fold-search t) |
7048 (buf (current-buffer)) | 8220 (buf (current-buffer)) |
7049 dig to-address) | 8221 dig to-address) |
7050 (save-excursion | 8222 (save-excursion |
7051 (set-buffer gnus-original-article-buffer) | 8223 (set-buffer gnus-original-article-buffer) |
7052 ;; Have the digest group inherit the main mail address of | 8224 ;; Have the digest group inherit the main mail address of |
7053 ;; the parent article. | 8225 ;; the parent article. |
7054 (when (setq to-address (or (message-fetch-field "reply-to") | 8226 (when (setq to-address (or (gnus-fetch-field "reply-to") |
7055 (message-fetch-field "from"))) | 8227 (gnus-fetch-field "from"))) |
7056 (setq params (append | 8228 (setq params (append |
7057 (list (cons 'to-address | 8229 (list (cons 'to-address |
7058 (funcall gnus-decode-encoded-word-function | 8230 (funcall gnus-decode-encoded-word-function |
7059 to-address)))))) | 8231 to-address)))))) |
7060 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) | 8232 (setq dig (nnheader-set-temp-buffer " *gnus digest buffer*")) |
7066 (or (search-forward "\n\n" nil t) (point))) | 8238 (or (search-forward "\n\n" nil t) (point))) |
7067 (goto-char (point-min)) | 8239 (goto-char (point-min)) |
7068 (delete-matching-lines "^Path:\\|^From ") | 8240 (delete-matching-lines "^Path:\\|^From ") |
7069 (widen)) | 8241 (widen)) |
7070 (unwind-protect | 8242 (unwind-protect |
7071 (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) | 8243 (if (let ((gnus-newsgroup-ephemeral-charset gnus-newsgroup-charset) |
7072 (gnus-newsgroup-ephemeral-ignored-charsets | 8244 (gnus-newsgroup-ephemeral-ignored-charsets |
7073 gnus-newsgroup-ignored-charsets)) | 8245 gnus-newsgroup-ignored-charsets)) |
7074 (gnus-group-read-ephemeral-group | 8246 (gnus-group-read-ephemeral-group |
7075 name `(nndoc ,name (nndoc-address ,(get-buffer dig)) | 8247 name `(nndoc ,name (nndoc-address ,(get-buffer dig)) |
7076 (nndoc-article-type | 8248 (nndoc-article-type |
7077 ,(if force 'mbox 'guess))) t)) | 8249 ,(if force 'mbox 'guess))) |
8250 t nil nil nil | |
8251 `((adapt-file . ,(gnus-score-file-name gnus-newsgroup-name | |
8252 "ADAPT"))))) | |
7078 ;; Make all postings to this group go to the parent group. | 8253 ;; Make all postings to this group go to the parent group. |
7079 (nconc (gnus-info-params (gnus-get-info name)) | 8254 (nconc (gnus-info-params (gnus-get-info name)) |
7080 params) | 8255 params) |
7081 ;; Couldn't select this doc group. | 8256 ;; Couldn't select this doc group. |
7082 (switch-to-buffer buf) | 8257 (switch-to-buffer buf) |
7083 (gnus-set-global-variables) | 8258 (gnus-set-global-variables) |
7084 (gnus-configure-windows 'summary) | 8259 (gnus-configure-windows 'summary) |
7085 (gnus-message 3 "Article couldn't be entered?")) | 8260 (gnus-message 3 "Article couldn't be entered?")) |
7086 (kill-buffer dig))))) | 8261 (kill-buffer dig))))) |
7087 | 8262 |
7088 (defun gnus-summary-read-document (n) | 8263 (defun gnus-summary-read-document (n) |
7089 "Open a new group based on the current article(s). | 8264 "Open a new group based on the current article(s). |
7090 This will allow you to read digests and other similar | 8265 This will allow you to read digests and other similar |
7113 (gnus-group-read-ephemeral-group | 8288 (gnus-group-read-ephemeral-group |
7114 group `(nndoc ,group (nndoc-address ,(current-buffer)) | 8289 group `(nndoc ,group (nndoc-address ,(current-buffer)) |
7115 (nndoc-article-type guess)) | 8290 (nndoc-article-type guess)) |
7116 t nil t)) | 8291 t nil t)) |
7117 (progn | 8292 (progn |
7118 ;; Make all postings to this group go to the parent group. | 8293 ;; Make all postings to this group go to the parent group. |
7119 (nconc (gnus-info-params (gnus-get-info egroup)) | 8294 (nconc (gnus-info-params (gnus-get-info egroup)) |
7120 params) | 8295 params) |
7121 (push egroup groups)) | 8296 (push egroup groups)) |
7122 ;; Couldn't select this doc group. | 8297 ;; Couldn't select this doc group. |
7123 (gnus-error 3 "Article couldn't be entered")))))) | 8298 (gnus-error 3 "Article couldn't be entered")))))) |
7157 (concat ", default " gnus-last-search-regexp) | 8332 (concat ", default " gnus-last-search-regexp) |
7158 ""))) | 8333 ""))) |
7159 current-prefix-arg)) | 8334 current-prefix-arg)) |
7160 (if (string-equal regexp "") | 8335 (if (string-equal regexp "") |
7161 (setq regexp (or gnus-last-search-regexp "")) | 8336 (setq regexp (or gnus-last-search-regexp "")) |
7162 (setq gnus-last-search-regexp regexp)) | 8337 (setq gnus-last-search-regexp regexp) |
7163 (if (gnus-summary-search-article regexp backward) | 8338 (setq gnus-article-before-search gnus-current-article)) |
7164 (gnus-summary-show-thread) | 8339 ;; Intentionally set gnus-last-article. |
7165 (error "Search failed: \"%s\"" regexp))) | 8340 (setq gnus-last-article gnus-article-before-search) |
8341 (let ((gnus-last-article gnus-last-article)) | |
8342 (if (gnus-summary-search-article regexp backward) | |
8343 (gnus-summary-show-thread) | |
8344 (error "Search failed: \"%s\"" regexp)))) | |
7166 | 8345 |
7167 (defun gnus-summary-search-article-backward (regexp) | 8346 (defun gnus-summary-search-article-backward (regexp) |
7168 "Search for an article containing REGEXP backward." | 8347 "Search for an article containing REGEXP backward." |
7169 (interactive | 8348 (interactive |
7170 (list (read-string | 8349 (list (read-string |
7186 (gnus-article-prepare-hook nil) | 8365 (gnus-article-prepare-hook nil) |
7187 (gnus-mark-article-hook nil) ;Inhibit marking as read. | 8366 (gnus-mark-article-hook nil) ;Inhibit marking as read. |
7188 (gnus-use-article-prefetch nil) | 8367 (gnus-use-article-prefetch nil) |
7189 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. | 8368 (gnus-xmas-force-redisplay nil) ;Inhibit XEmacs redisplay. |
7190 (gnus-use-trees nil) ;Inhibit updating tree buffer. | 8369 (gnus-use-trees nil) ;Inhibit updating tree buffer. |
8370 (gnus-visual nil) | |
8371 (gnus-keep-backlog nil) | |
8372 (gnus-break-pages nil) | |
8373 (gnus-summary-display-arrow nil) | |
8374 (gnus-updated-mode-lines nil) | |
8375 (gnus-auto-center-summary nil) | |
7191 (sum (current-buffer)) | 8376 (sum (current-buffer)) |
7192 (gnus-display-mime-function nil) | 8377 (gnus-display-mime-function nil) |
7193 (found nil) | 8378 (found nil) |
7194 point) | 8379 point) |
7195 (gnus-save-hidden-threads | 8380 (gnus-save-hidden-threads |
7239 (gnus-summary-show-thread) | 8424 (gnus-summary-show-thread) |
7240 (gnus-summary-goto-subject gnus-current-article) | 8425 (gnus-summary-goto-subject gnus-current-article) |
7241 (gnus-summary-position-point) | 8426 (gnus-summary-position-point) |
7242 t))) | 8427 t))) |
7243 | 8428 |
8429 (defun gnus-find-matching-articles (header regexp) | |
8430 "Return a list of all articles that match REGEXP on HEADER. | |
8431 This search includes all articles in the current group that Gnus has | |
8432 fetched headers for, whether they are displayed or not." | |
8433 (let ((articles nil) | |
8434 (func `(lambda (h) (,(intern (concat "mail-header-" header)) h))) | |
8435 (case-fold-search t)) | |
8436 (dolist (header gnus-newsgroup-headers) | |
8437 (when (string-match regexp (funcall func header)) | |
8438 (push (mail-header-number header) articles))) | |
8439 (nreverse articles))) | |
8440 | |
7244 (defun gnus-summary-find-matching (header regexp &optional backward unread | 8441 (defun gnus-summary-find-matching (header regexp &optional backward unread |
7245 not-case-fold not-matching) | 8442 not-case-fold not-matching) |
7246 "Return a list of all articles that match REGEXP on HEADER. | 8443 "Return a list of all articles that match REGEXP on HEADER. |
7247 The search stars on the current article and goes forwards unless | 8444 The search stars on the current article and goes forwards unless |
7248 BACKWARD is non-nil. If BACKWARD is `all', do all articles. | 8445 BACKWARD is non-nil. If BACKWARD is `all', do all articles. |
7285 article. If BACKWARD (the prefix) is non-nil, search backward instead." | 8482 article. If BACKWARD (the prefix) is non-nil, search backward instead." |
7286 (interactive | 8483 (interactive |
7287 (list (let ((completion-ignore-case t)) | 8484 (list (let ((completion-ignore-case t)) |
7288 (completing-read | 8485 (completing-read |
7289 "Header name: " | 8486 "Header name: " |
7290 (mapcar (lambda (string) (list string)) | 8487 (mapcar (lambda (header) (list (format "%s" header))) |
7291 '("Number" "Subject" "From" "Lines" "Date" | 8488 (append |
7292 "Message-ID" "Xref" "References" "Body")) | 8489 '("Number" "Subject" "From" "Lines" "Date" |
8490 "Message-ID" "Xref" "References" "Body") | |
8491 gnus-extra-headers)) | |
7293 nil 'require-match)) | 8492 nil 'require-match)) |
7294 (read-string "Regexp: ") | 8493 (read-string "Regexp: ") |
7295 (read-key-sequence "Command: ") | 8494 (read-key-sequence "Command: ") |
7296 current-prefix-arg)) | 8495 current-prefix-arg)) |
7297 (when (equal header "Body") | 8496 (when (equal header "Body") |
7299 ;; Hidden thread subtrees must be searched as well. | 8498 ;; Hidden thread subtrees must be searched as well. |
7300 (gnus-summary-show-all-threads) | 8499 (gnus-summary-show-all-threads) |
7301 ;; We don't want to change current point nor window configuration. | 8500 ;; We don't want to change current point nor window configuration. |
7302 (save-excursion | 8501 (save-excursion |
7303 (save-window-excursion | 8502 (save-window-excursion |
7304 (gnus-message 6 "Executing %s..." (key-description command)) | 8503 (let (gnus-visual |
7305 ;; We'd like to execute COMMAND interactively so as to give arguments. | 8504 gnus-treat-strip-trailing-blank-lines |
7306 (gnus-execute header regexp | 8505 gnus-treat-strip-leading-blank-lines |
7307 `(call-interactively ',(key-binding command)) | 8506 gnus-treat-strip-multiple-blank-lines |
7308 backward) | 8507 gnus-treat-hide-boring-headers |
7309 (gnus-message 6 "Executing %s...done" (key-description command))))) | 8508 gnus-treat-fold-newsgroups |
8509 gnus-article-prepare-hook) | |
8510 (gnus-message 6 "Executing %s..." (key-description command)) | |
8511 ;; We'd like to execute COMMAND interactively so as to give arguments. | |
8512 (gnus-execute header regexp | |
8513 `(call-interactively ',(key-binding command)) | |
8514 backward) | |
8515 (gnus-message 6 "Executing %s...done" (key-description command)))))) | |
7310 | 8516 |
7311 (defun gnus-summary-beginning-of-article () | 8517 (defun gnus-summary-beginning-of-article () |
7312 "Scroll the article back to the beginning." | 8518 "Scroll the article back to the beginning." |
7313 (interactive) | 8519 (interactive) |
7314 (gnus-summary-select-article) | 8520 (gnus-summary-select-article) |
7315 (gnus-configure-windows 'article) | 8521 (gnus-configure-windows 'article) |
7316 (gnus-eval-in-buffer-window gnus-article-buffer | 8522 (gnus-eval-in-buffer-window gnus-article-buffer |
7317 (widen) | 8523 (widen) |
7318 (goto-char (point-min)) | 8524 (goto-char (point-min)) |
7319 (when gnus-page-broken | 8525 (when gnus-break-pages |
7320 (gnus-narrow-to-page)))) | 8526 (gnus-narrow-to-page)))) |
7321 | 8527 |
7322 (defun gnus-summary-end-of-article () | 8528 (defun gnus-summary-end-of-article () |
7323 "Scroll to the end of the article." | 8529 "Scroll to the end of the article." |
7324 (interactive) | 8530 (interactive) |
7326 (gnus-configure-windows 'article) | 8532 (gnus-configure-windows 'article) |
7327 (gnus-eval-in-buffer-window gnus-article-buffer | 8533 (gnus-eval-in-buffer-window gnus-article-buffer |
7328 (widen) | 8534 (widen) |
7329 (goto-char (point-max)) | 8535 (goto-char (point-max)) |
7330 (recenter -3) | 8536 (recenter -3) |
7331 (when gnus-page-broken | 8537 (when gnus-break-pages |
8538 (when (re-search-backward page-delimiter nil t) | |
8539 (narrow-to-region (match-end 0) (point-max))) | |
7332 (gnus-narrow-to-page)))) | 8540 (gnus-narrow-to-page)))) |
7333 | 8541 |
8542 (defun gnus-summary-print-truncate-and-quote (string &optional len) | |
8543 "Truncate to LEN and quote all \"(\"'s in STRING." | |
8544 (gnus-replace-in-string (if (and len (> (length string) len)) | |
8545 (substring string 0 len) | |
8546 string) | |
8547 "[()]" "\\\\\\&")) | |
8548 | |
7334 (defun gnus-summary-print-article (&optional filename n) | 8549 (defun gnus-summary-print-article (&optional filename n) |
7335 "Generate and print a PostScript image of the N next (mail) articles. | 8550 "Generate and print a PostScript image of the process-marked (mail) articles. |
7336 | 8551 |
7337 If N is negative, print the N previous articles. If N is nil and articles | 8552 If used interactively, print the current article if none are |
7338 have been marked with the process mark, print these instead. | 8553 process-marked. With prefix arg, prompt the user for the name of the |
8554 file to save in. | |
8555 | |
8556 When used from Lisp, accept two optional args FILENAME and N. N means | |
8557 to print the next N articles. If N is negative, print the N previous | |
8558 articles. If N is nil and articles have been marked with the process | |
8559 mark, print these instead. | |
7339 | 8560 |
7340 If the optional first argument FILENAME is nil, send the image to the | 8561 If the optional first argument FILENAME is nil, send the image to the |
7341 printer. If FILENAME is a string, save the PostScript image in a file with | 8562 printer. If FILENAME is a string, save the PostScript image in a file with |
7342 that name. If FILENAME is a number, prompt the user for the name of the file | 8563 that name. If FILENAME is a number, prompt the user for the name of the file |
7343 to save in." | 8564 to save in." |
7344 (interactive (list (ps-print-preprint current-prefix-arg))) | 8565 (interactive (list (ps-print-preprint current-prefix-arg))) |
7345 (dolist (article (gnus-summary-work-articles n)) | 8566 (dolist (article (gnus-summary-work-articles n)) |
7346 (gnus-summary-select-article nil nil 'pseudo article) | 8567 (gnus-summary-select-article nil nil 'pseudo article) |
7347 (gnus-eval-in-buffer-window gnus-article-buffer | 8568 (gnus-eval-in-buffer-window gnus-article-buffer |
7348 (let ((buffer (generate-new-buffer " *print*"))) | 8569 (gnus-print-buffer)) |
7349 (unwind-protect | |
7350 (progn | |
7351 (copy-to-buffer buffer (point-min) (point-max)) | |
7352 (set-buffer buffer) | |
7353 (gnus-article-delete-invisible-text) | |
7354 (let ((ps-left-header | |
7355 (list | |
7356 (concat "(" | |
7357 (mail-header-subject gnus-current-headers) ")") | |
7358 (concat "(" | |
7359 (mail-header-from gnus-current-headers) ")"))) | |
7360 (ps-right-header | |
7361 (list | |
7362 "/pagenumberstring load" | |
7363 (concat "(" | |
7364 (mail-header-date gnus-current-headers) ")")))) | |
7365 (gnus-run-hooks 'gnus-ps-print-hook) | |
7366 (save-excursion | |
7367 (ps-spool-buffer-with-faces)))) | |
7368 (kill-buffer buffer)))) | |
7369 (gnus-summary-remove-process-mark article)) | 8570 (gnus-summary-remove-process-mark article)) |
7370 (ps-despool filename)) | 8571 (ps-despool filename)) |
7371 | 8572 |
8573 (defun gnus-print-buffer () | |
8574 (let ((buffer (generate-new-buffer " *print*"))) | |
8575 (unwind-protect | |
8576 (progn | |
8577 (copy-to-buffer buffer (point-min) (point-max)) | |
8578 (set-buffer buffer) | |
8579 (gnus-remove-text-with-property 'gnus-decoration) | |
8580 (when (gnus-visual-p 'article-highlight 'highlight) | |
8581 ;; Copy-to-buffer doesn't copy overlay. So redo | |
8582 ;; highlight. | |
8583 (let ((gnus-article-buffer buffer)) | |
8584 (gnus-article-highlight-citation t) | |
8585 (gnus-article-highlight-signature) | |
8586 (gnus-article-emphasize) | |
8587 (gnus-article-delete-invisible-text))) | |
8588 (let ((ps-left-header | |
8589 (list | |
8590 (concat "(" | |
8591 (gnus-summary-print-truncate-and-quote | |
8592 (mail-header-subject gnus-current-headers) | |
8593 66) ")") | |
8594 (concat "(" | |
8595 (gnus-summary-print-truncate-and-quote | |
8596 (mail-header-from gnus-current-headers) | |
8597 45) ")"))) | |
8598 (ps-right-header | |
8599 (list | |
8600 "/pagenumberstring load" | |
8601 (concat "(" | |
8602 (mail-header-date gnus-current-headers) ")")))) | |
8603 (gnus-run-hooks 'gnus-ps-print-hook) | |
8604 (save-excursion | |
8605 (if window-system | |
8606 (ps-spool-buffer-with-faces) | |
8607 (ps-spool-buffer))))) | |
8608 (kill-buffer buffer)))) | |
8609 | |
7372 (defun gnus-summary-show-article (&optional arg) | 8610 (defun gnus-summary-show-article (&optional arg) |
7373 "Force re-fetching of the current article. | 8611 "Force redisplaying of the current article. |
7374 If ARG (the prefix) is a number, show the article with the charset | 8612 If ARG (the prefix) is a number, show the article with the charset |
7375 defined in `gnus-summary-show-article-charset-alist', or the charset | 8613 defined in `gnus-summary-show-article-charset-alist', or the charset |
7376 inputed. | 8614 input. |
7377 If ARG (the prefix) is non-nil and not a number, show the raw article | 8615 If ARG (the prefix) is non-nil and not a number, show the raw article |
7378 without any article massaging functions being run." | 8616 without any article massaging functions being run. Normally, the key |
8617 strokes are `C-u g'." | |
7379 (interactive "P") | 8618 (interactive "P") |
7380 (cond | 8619 (cond |
7381 ((numberp arg) | 8620 ((numberp arg) |
8621 (gnus-summary-show-article t) | |
7382 (let ((gnus-newsgroup-charset | 8622 (let ((gnus-newsgroup-charset |
7383 (or (cdr (assq arg gnus-summary-show-article-charset-alist)) | 8623 (or (cdr (assq arg gnus-summary-show-article-charset-alist)) |
7384 (read-coding-system "Charset: "))) | 8624 (mm-read-coding-system |
8625 "View as charset: " ;; actually it is coding system. | |
8626 (save-excursion | |
8627 (set-buffer gnus-article-buffer) | |
8628 (mm-detect-coding-region (point) (point-max)))))) | |
7385 (gnus-newsgroup-ignored-charsets 'gnus-all)) | 8629 (gnus-newsgroup-ignored-charsets 'gnus-all)) |
7386 (gnus-summary-select-article nil 'force))) | 8630 (gnus-summary-select-article nil 'force) |
8631 (let ((deps gnus-newsgroup-dependencies) | |
8632 head header lines) | |
8633 (save-excursion | |
8634 (set-buffer gnus-original-article-buffer) | |
8635 (save-restriction | |
8636 (message-narrow-to-head) | |
8637 (setq head (buffer-string)) | |
8638 (goto-char (point-min)) | |
8639 (unless (re-search-forward "^lines:[ \t]\\([0-9]+\\)" nil t) | |
8640 (goto-char (point-max)) | |
8641 (widen) | |
8642 (setq lines (1- (count-lines (point) (point-max)))))) | |
8643 (with-temp-buffer | |
8644 (insert (format "211 %d Article retrieved.\n" | |
8645 (cdr gnus-article-current))) | |
8646 (insert head) | |
8647 (if lines (insert (format "Lines: %d\n" lines))) | |
8648 (insert ".\n") | |
8649 (let ((nntp-server-buffer (current-buffer))) | |
8650 (setq header (car (gnus-get-newsgroup-headers deps t)))))) | |
8651 (gnus-data-set-header | |
8652 (gnus-data-find (cdr gnus-article-current)) | |
8653 header) | |
8654 (gnus-summary-update-article-line | |
8655 (cdr gnus-article-current) header) | |
8656 (when (gnus-summary-goto-subject (cdr gnus-article-current) nil t) | |
8657 (gnus-summary-update-secondary-mark (cdr gnus-article-current)))))) | |
7387 ((not arg) | 8658 ((not arg) |
7388 ;; Select the article the normal way. | 8659 ;; Select the article the normal way. |
7389 (gnus-summary-select-article nil 'force)) | 8660 (gnus-summary-select-article nil 'force)) |
7390 (t | 8661 (t |
7391 ;; We have to require this here to make sure that the following | 8662 ;; We have to require this here to make sure that the following |
7408 (setq gnus-article-mime-handles nil))) | 8679 (setq gnus-article-mime-handles nil))) |
7409 (gnus-summary-select-article nil 'force)))) | 8680 (gnus-summary-select-article nil 'force)))) |
7410 (gnus-summary-goto-subject gnus-current-article) | 8681 (gnus-summary-goto-subject gnus-current-article) |
7411 (gnus-summary-position-point)) | 8682 (gnus-summary-position-point)) |
7412 | 8683 |
8684 (defun gnus-summary-show-raw-article () | |
8685 "Show the raw article without any article massaging functions being run." | |
8686 (interactive) | |
8687 (gnus-summary-show-article t)) | |
8688 | |
7413 (defun gnus-summary-verbose-headers (&optional arg) | 8689 (defun gnus-summary-verbose-headers (&optional arg) |
7414 "Toggle permanent full header display. | 8690 "Toggle permanent full header display. |
7415 If ARG is a positive number, turn header display on. | 8691 If ARG is a positive number, turn header display on. |
7416 If ARG is a negative number, turn header display off." | 8692 If ARG is a negative number, turn header display off." |
7417 (interactive "P") | 8693 (interactive "P") |
7426 (defun gnus-summary-toggle-header (&optional arg) | 8702 (defun gnus-summary-toggle-header (&optional arg) |
7427 "Show the headers if they are hidden, or hide them if they are shown. | 8703 "Show the headers if they are hidden, or hide them if they are shown. |
7428 If ARG is a positive number, show the entire header. | 8704 If ARG is a positive number, show the entire header. |
7429 If ARG is a negative number, hide the unwanted header lines." | 8705 If ARG is a negative number, hide the unwanted header lines." |
7430 (interactive "P") | 8706 (interactive "P") |
7431 (save-excursion | 8707 (let ((window (and (gnus-buffer-live-p gnus-article-buffer) |
7432 (set-buffer gnus-article-buffer) | 8708 (get-buffer-window gnus-article-buffer t)))) |
7433 (save-restriction | 8709 (with-current-buffer gnus-article-buffer |
8710 (widen) | |
8711 (article-narrow-to-head) | |
7434 (let* ((buffer-read-only nil) | 8712 (let* ((buffer-read-only nil) |
7435 (inhibit-point-motion-hooks t) | 8713 (inhibit-point-motion-hooks t) |
7436 hidden s e) | 8714 (hidden (if (numberp arg) |
7437 (setq hidden | 8715 (>= arg 0) |
7438 (if (numberp arg) | 8716 (gnus-article-hidden-text-p 'headers))) |
7439 (>= arg 0) | 8717 s e) |
7440 (save-restriction | 8718 (delete-region (point-min) (point-max)) |
7441 (article-narrow-to-head) | |
7442 (gnus-article-hidden-text-p 'headers)))) | |
7443 (goto-char (point-min)) | |
7444 (when (search-forward "\n\n" nil t) | |
7445 (delete-region (point-min) (1- (point)))) | |
7446 (goto-char (point-min)) | |
7447 (with-current-buffer gnus-original-article-buffer | 8719 (with-current-buffer gnus-original-article-buffer |
7448 (goto-char (setq s (point-min))) | 8720 (goto-char (setq s (point-min))) |
7449 (setq e (1- (or (search-forward "\n\n" nil t) (point-max))))) | 8721 (setq e (if (search-forward "\n\n" nil t) |
8722 (1- (point)) | |
8723 (point-max)))) | |
7450 (insert-buffer-substring gnus-original-article-buffer s e) | 8724 (insert-buffer-substring gnus-original-article-buffer s e) |
7451 (save-restriction | 8725 (run-hooks 'gnus-article-decode-hook) |
7452 (narrow-to-region (point-min) (point)) | 8726 (if hidden |
7453 (article-decode-encoded-words) | 8727 (let ((gnus-treat-hide-headers nil) |
7454 (if hidden | 8728 (gnus-treat-hide-boring-headers nil)) |
7455 (let ((gnus-treat-hide-headers nil) | 8729 (gnus-delete-wash-type 'headers) |
7456 (gnus-treat-hide-boring-headers nil)) | 8730 (gnus-treat-article 'head)) |
7457 (setq gnus-article-wash-types | 8731 (gnus-treat-article 'head)) |
7458 (delq 'headers gnus-article-wash-types)) | 8732 (widen) |
7459 (gnus-treat-article 'head)) | 8733 (if window |
7460 (gnus-treat-article 'head))) | 8734 (set-window-start window (goto-char (point-min)))) |
8735 (if gnus-break-pages | |
8736 (gnus-narrow-to-page) | |
8737 (when (gnus-visual-p 'page-marker) | |
8738 (let ((buffer-read-only nil)) | |
8739 (gnus-remove-text-with-property 'gnus-prev) | |
8740 (gnus-remove-text-with-property 'gnus-next)))) | |
7461 (gnus-set-mode-line 'article))))) | 8741 (gnus-set-mode-line 'article))))) |
7462 | 8742 |
7463 (defun gnus-summary-show-all-headers () | 8743 (defun gnus-summary-show-all-headers () |
7464 "Make all header lines visible." | 8744 "Make all header lines visible." |
7465 (interactive) | 8745 (interactive) |
7466 (gnus-article-show-all-headers)) | 8746 (gnus-summary-toggle-header 1)) |
7467 | 8747 |
7468 (defun gnus-summary-caesar-message (&optional arg) | 8748 (defun gnus-summary-caesar-message (&optional arg) |
7469 "Caesar rotate the current article by 13. | 8749 "Caesar rotate the current article by 13. |
7470 The numerical prefix specifies how many places to rotate each letter | 8750 The numerical prefix specifies how many places to rotate each letter |
7471 forward." | 8751 forward." |
7478 (let ((start (window-start)) | 8758 (let ((start (window-start)) |
7479 buffer-read-only) | 8759 buffer-read-only) |
7480 (message-caesar-buffer-body arg) | 8760 (message-caesar-buffer-body arg) |
7481 (set-window-start (get-buffer-window (current-buffer)) start)))))) | 8761 (set-window-start (get-buffer-window (current-buffer)) start)))))) |
7482 | 8762 |
8763 (autoload 'unmorse-region "morse" | |
8764 "Convert morse coded text in region to ordinary ASCII text." | |
8765 t) | |
8766 | |
8767 (defun gnus-summary-morse-message (&optional arg) | |
8768 "Morse decode the current article." | |
8769 (interactive "P") | |
8770 (gnus-summary-select-article) | |
8771 (let ((mail-header-separator "")) | |
8772 (gnus-eval-in-buffer-window gnus-article-buffer | |
8773 (save-excursion | |
8774 (save-restriction | |
8775 (widen) | |
8776 (let ((pos (window-start)) | |
8777 buffer-read-only) | |
8778 (goto-char (point-min)) | |
8779 (when (message-goto-body) | |
8780 (gnus-narrow-to-body)) | |
8781 (goto-char (point-min)) | |
8782 (while (re-search-forward "·" (point-max) t) | |
8783 (replace-match ".")) | |
8784 (unmorse-region (point-min) (point-max)) | |
8785 (widen) | |
8786 (set-window-start (get-buffer-window (current-buffer)) pos))))))) | |
8787 | |
7483 (defun gnus-summary-stop-page-breaking () | 8788 (defun gnus-summary-stop-page-breaking () |
7484 "Stop page breaking in the current article." | 8789 "Stop page breaking in the current article." |
7485 (interactive) | 8790 (interactive) |
7486 (gnus-summary-select-article) | 8791 (gnus-summary-select-article) |
7487 (gnus-eval-in-buffer-window gnus-article-buffer | 8792 (gnus-eval-in-buffer-window gnus-article-buffer |
7501 move those articles instead. | 8806 move those articles instead. |
7502 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | 8807 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. |
7503 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | 8808 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but |
7504 re-spool using this method. | 8809 re-spool using this method. |
7505 | 8810 |
8811 When called interactively with TO-NEWSGROUP being nil, the value of | |
8812 the variable `gnus-move-split-methods' is used for finding a default | |
8813 for the target newsgroup. | |
8814 | |
7506 For this function to work, both the current newsgroup and the | 8815 For this function to work, both the current newsgroup and the |
7507 newsgroup that you want to move to have to support the `request-move' | 8816 newsgroup that you want to move to have to support the `request-move' |
7508 and `request-accept' functions. | 8817 and `request-accept' functions. |
7509 | 8818 |
7510 ACTION can be either `move' (the default), `crosspost' or `copy'." | 8819 ACTION can be either `move' (the default), `crosspost' or `copy'." |
7511 (interactive "P") | 8820 (interactive "P") |
7512 (unless action | 8821 (unless action |
7513 (setq action 'move)) | 8822 (setq action 'move)) |
7514 ;; Disable marking as read. | |
7515 (let (gnus-mark-article-hook) | |
7516 (save-window-excursion | |
7517 (gnus-summary-select-article))) | |
7518 ;; Check whether the source group supports the required functions. | 8823 ;; Check whether the source group supports the required functions. |
7519 (cond ((and (eq action 'move) | 8824 (cond ((and (eq action 'move) |
7520 (not (gnus-check-backend-function | 8825 (not (gnus-check-backend-function |
7521 'request-move-article gnus-newsgroup-name))) | 8826 'request-move-article gnus-newsgroup-name))) |
7522 (error "The current group does not support article moving")) | 8827 (error "The current group does not support article moving")) |
7524 (not (gnus-check-backend-function | 8829 (not (gnus-check-backend-function |
7525 'request-replace-article gnus-newsgroup-name))) | 8830 'request-replace-article gnus-newsgroup-name))) |
7526 (error "The current group does not support article editing"))) | 8831 (error "The current group does not support article editing"))) |
7527 (let ((articles (gnus-summary-work-articles n)) | 8832 (let ((articles (gnus-summary-work-articles n)) |
7528 (prefix (if (gnus-check-backend-function | 8833 (prefix (if (gnus-check-backend-function |
7529 'request-move-article gnus-newsgroup-name) | 8834 'request-move-article gnus-newsgroup-name) |
7530 (gnus-group-real-prefix gnus-newsgroup-name) | 8835 (gnus-group-real-prefix gnus-newsgroup-name) |
7531 "")) | 8836 "")) |
7532 (names '((move "Move" "Moving") | 8837 (names '((move "Move" "Moving") |
7533 (copy "Copy" "Copying") | 8838 (copy "Copy" "Copying") |
7534 (crosspost "Crosspost" "Crossposting"))) | 8839 (crosspost "Crosspost" "Crossposting"))) |
7538 (unless (assq action names) | 8843 (unless (assq action names) |
7539 (error "Unknown action %s" action)) | 8844 (error "Unknown action %s" action)) |
7540 ;; Read the newsgroup name. | 8845 ;; Read the newsgroup name. |
7541 (when (and (not to-newsgroup) | 8846 (when (and (not to-newsgroup) |
7542 (not select-method)) | 8847 (not select-method)) |
8848 (if (and gnus-move-split-methods | |
8849 (not | |
8850 (and (memq gnus-current-article articles) | |
8851 (gnus-buffer-live-p gnus-original-article-buffer)))) | |
8852 ;; When `gnus-move-split-methods' is non-nil, we have to | |
8853 ;; select an article to give `gnus-read-move-group-name' an | |
8854 ;; opportunity to suggest an appropriate default. However, | |
8855 ;; we needn't render or mark the article. | |
8856 (let ((gnus-display-mime-function nil) | |
8857 (gnus-article-prepare-hook nil) | |
8858 (gnus-mark-article-hook nil)) | |
8859 (gnus-summary-select-article nil nil nil (car articles)))) | |
7543 (setq to-newsgroup | 8860 (setq to-newsgroup |
7544 (gnus-read-move-group-name | 8861 (gnus-read-move-group-name |
7545 (cadr (assq action names)) | 8862 (cadr (assq action names)) |
7546 (symbol-value (intern (format "gnus-current-%s-group" action))) | 8863 (symbol-value (intern (format "gnus-current-%s-group" action))) |
7547 articles prefix)) | 8864 articles prefix)) |
7587 ((eq action 'crosspost) | 8904 ((eq action 'crosspost) |
7588 (let ((xref (message-tokenize-header | 8905 (let ((xref (message-tokenize-header |
7589 (mail-header-xref (gnus-summary-article-header article)) | 8906 (mail-header-xref (gnus-summary-article-header article)) |
7590 " "))) | 8907 " "))) |
7591 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name) | 8908 (setq new-xref (concat (gnus-group-real-name gnus-newsgroup-name) |
7592 ":" article)) | 8909 ":" (number-to-string article))) |
7593 (unless xref | 8910 (unless xref |
7594 (setq xref (list (system-name)))) | 8911 (setq xref (list (system-name)))) |
7595 (setq new-xref | 8912 (setq new-xref |
7596 (concat | 8913 (concat |
7597 (mapconcat 'identity | 8914 (mapconcat 'identity |
7604 (gnus-request-article-this-buffer article gnus-newsgroup-name) | 8921 (gnus-request-article-this-buffer article gnus-newsgroup-name) |
7605 (when (consp (setq art-group | 8922 (when (consp (setq art-group |
7606 (gnus-request-accept-article | 8923 (gnus-request-accept-article |
7607 to-newsgroup select-method (not articles)))) | 8924 to-newsgroup select-method (not articles)))) |
7608 (setq new-xref (concat new-xref " " (car art-group) | 8925 (setq new-xref (concat new-xref " " (car art-group) |
7609 ":" (cdr art-group))) | 8926 ":" |
8927 (number-to-string (cdr art-group)))) | |
7610 ;; Now we have the new Xrefs header, so we insert | 8928 ;; Now we have the new Xrefs header, so we insert |
7611 ;; it and replace the new article. | 8929 ;; it and replace the new article. |
7612 (nnheader-replace-header "Xref" new-xref) | 8930 (nnheader-replace-header "Xref" new-xref) |
7613 (gnus-request-replace-article | 8931 (gnus-request-replace-article |
7614 (cdr art-group) to-newsgroup (current-buffer)) | 8932 (cdr art-group) to-newsgroup (current-buffer)) |
7619 (cadr (assq action names)) article | 8937 (cadr (assq action names)) article |
7620 (nnheader-get-report (car to-method)))) | 8938 (nnheader-get-report (car to-method)))) |
7621 ((eq art-group 'junk) | 8939 ((eq art-group 'junk) |
7622 (when (eq action 'move) | 8940 (when (eq action 'move) |
7623 (gnus-summary-mark-article article gnus-canceled-mark) | 8941 (gnus-summary-mark-article article gnus-canceled-mark) |
7624 (gnus-message 4 "Deleted article %s" article))) | 8942 (gnus-message 4 "Deleted article %s" article) |
8943 ;; run the delete hook | |
8944 (run-hook-with-args 'gnus-summary-article-delete-hook | |
8945 action | |
8946 (gnus-data-header | |
8947 (assoc article (gnus-data-list nil))) | |
8948 gnus-newsgroup-name nil | |
8949 select-method))) | |
7625 (t | 8950 (t |
7626 (let* ((pto-group (gnus-group-prefixed-name | 8951 (let* ((pto-group (gnus-group-prefixed-name |
7627 (car art-group) to-method)) | 8952 (car art-group) to-method)) |
7628 (entry | 8953 (entry |
7629 (gnus-gethash pto-group gnus-newsrc-hashtb)) | 8954 (gnus-gethash pto-group gnus-newsrc-hashtb)) |
7630 (info (nth 2 entry)) | 8955 (info (nth 2 entry)) |
7631 (to-group (gnus-info-group info)) | 8956 (to-group (gnus-info-group info)) |
7632 to-marks) | 8957 to-marks) |
7633 ;; Update the group that has been moved to. | 8958 ;; Update the group that has been moved to. |
7634 (when (and info | 8959 (when (and info |
7635 (memq action '(move copy))) | 8960 (memq action '(move copy))) |
7636 (unless (member to-group to-groups) | 8961 (unless (member to-group to-groups) |
7641 (gnus-info-set-read | 8966 (gnus-info-set-read |
7642 info (gnus-add-to-range (gnus-info-read info) | 8967 info (gnus-add-to-range (gnus-info-read info) |
7643 (list (cdr art-group))))) | 8968 (list (cdr art-group))))) |
7644 | 8969 |
7645 ;; See whether the article is to be put in the cache. | 8970 ;; See whether the article is to be put in the cache. |
7646 (let ((marks gnus-article-mark-lists) | 8971 (let ((marks (if (gnus-group-auto-expirable-p to-group) |
8972 gnus-article-mark-lists | |
8973 (delete '(expirable . expire) | |
8974 (copy-sequence gnus-article-mark-lists)))) | |
7647 (to-article (cdr art-group))) | 8975 (to-article (cdr art-group))) |
7648 | 8976 |
7649 ;; Enter the article into the cache in the new group, | 8977 ;; Enter the article into the cache in the new group, |
7650 ;; if that is required. | 8978 ;; if that is required. |
7651 (when gnus-use-cache | 8979 (when gnus-use-cache |
7663 (push (cons to-article gnus-read-mark) gnus-newsgroup-reads) | 8991 (push (cons to-article gnus-read-mark) gnus-newsgroup-reads) |
7664 (setcdr (gnus-active to-group) to-article) | 8992 (setcdr (gnus-active to-group) to-article) |
7665 (setcdr gnus-newsgroup-active to-article)) | 8993 (setcdr gnus-newsgroup-active to-article)) |
7666 | 8994 |
7667 (while marks | 8995 (while marks |
7668 (when (memq article (symbol-value | 8996 (when (eq (gnus-article-mark-to-type (cdar marks)) 'list) |
7669 (intern (format "gnus-newsgroup-%s" | 8997 (when (memq article (symbol-value |
7670 (caar marks))))) | 8998 (intern (format "gnus-newsgroup-%s" |
7671 (push (cdar marks) to-marks) | 8999 (caar marks))))) |
7672 ;; If the other group is the same as this group, | 9000 (push (cdar marks) to-marks) |
7673 ;; then we have to add the mark to the list. | 9001 ;; If the other group is the same as this group, |
7674 (when (equal to-group gnus-newsgroup-name) | 9002 ;; then we have to add the mark to the list. |
7675 (set (intern (format "gnus-newsgroup-%s" (caar marks))) | 9003 (when (equal to-group gnus-newsgroup-name) |
7676 (cons to-article | 9004 (set (intern (format "gnus-newsgroup-%s" (caar marks))) |
7677 (symbol-value | 9005 (cons to-article |
7678 (intern (format "gnus-newsgroup-%s" | 9006 (symbol-value |
7679 (caar marks))))))) | 9007 (intern (format "gnus-newsgroup-%s" |
7680 ;; Copy the marks to other group. | 9008 (caar marks))))))) |
7681 (gnus-add-marked-articles | 9009 ;; Copy the marks to other group. |
7682 to-group (cdar marks) (list to-article) info)) | 9010 (gnus-add-marked-articles |
9011 to-group (cdar marks) (list to-article) info))) | |
7683 (setq marks (cdr marks))) | 9012 (setq marks (cdr marks))) |
7684 | 9013 |
7685 (gnus-request-set-mark to-group (list (list (list to-article) | 9014 (gnus-request-set-mark |
7686 'set | 9015 to-group (list (list (list to-article) 'add to-marks)))) |
7687 to-marks)))) | |
7688 | 9016 |
7689 (gnus-dribble-enter | 9017 (gnus-dribble-enter |
7690 (concat "(gnus-group-set-info '" | 9018 (concat "(gnus-group-set-info '" |
7691 (gnus-prin1-to-string (gnus-get-info to-group)) | 9019 (gnus-prin1-to-string (gnus-get-info to-group)) |
7692 ")")))) | 9020 ")")))) |
7697 (save-excursion | 9025 (save-excursion |
7698 (set-buffer copy-buf) | 9026 (set-buffer copy-buf) |
7699 (gnus-request-article-this-buffer article gnus-newsgroup-name) | 9027 (gnus-request-article-this-buffer article gnus-newsgroup-name) |
7700 (nnheader-replace-header "Xref" new-xref) | 9028 (nnheader-replace-header "Xref" new-xref) |
7701 (gnus-request-replace-article | 9029 (gnus-request-replace-article |
7702 article gnus-newsgroup-name (current-buffer))))) | 9030 article gnus-newsgroup-name (current-buffer)))) |
9031 | |
9032 ;; run the move/copy/crosspost/respool hook | |
9033 (run-hook-with-args 'gnus-summary-article-move-hook | |
9034 action | |
9035 (gnus-data-header | |
9036 (assoc article (gnus-data-list nil))) | |
9037 gnus-newsgroup-name | |
9038 to-newsgroup | |
9039 select-method)) | |
7703 | 9040 |
7704 ;;;!!!Why is this necessary? | 9041 ;;;!!!Why is this necessary? |
7705 (set-buffer gnus-summary-buffer) | 9042 (set-buffer gnus-summary-buffer) |
7706 | 9043 |
7707 (gnus-summary-goto-subject article) | 9044 (gnus-summary-goto-subject article) |
7708 (when (eq action 'move) | 9045 (when (eq action 'move) |
7709 (gnus-summary-mark-article article gnus-canceled-mark)))) | 9046 (gnus-summary-mark-article article gnus-canceled-mark)))) |
7710 (gnus-summary-remove-process-mark article)) | 9047 (gnus-summary-remove-process-mark article)) |
7711 ;; Re-activate all groups that have been moved to. | 9048 ;; Re-activate all groups that have been moved to. |
7712 (while to-groups | 9049 (save-excursion |
7713 (save-excursion | 9050 (set-buffer gnus-group-buffer) |
7714 (set-buffer gnus-group-buffer) | 9051 (let ((gnus-group-marked to-groups)) |
7715 (when (gnus-group-goto-group (car to-groups) t) | 9052 (gnus-group-get-new-news-this-group nil t))) |
7716 (gnus-group-get-new-news-this-group 1 t)) | |
7717 (pop to-groups))) | |
7718 | 9053 |
7719 (gnus-kill-buffer copy-buf) | 9054 (gnus-kill-buffer copy-buf) |
7720 (gnus-summary-position-point) | 9055 (gnus-summary-position-point) |
7721 (gnus-set-mode-line 'summary))) | 9056 (gnus-set-mode-line 'summary))) |
7722 | 9057 |
7723 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method) | 9058 (defun gnus-summary-copy-article (&optional n to-newsgroup select-method) |
7724 "Move the current article to a different newsgroup. | 9059 "Move the current article to a different newsgroup. |
7725 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. | 9060 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. |
9061 When called interactively, if TO-NEWSGROUP is nil, use the value of | |
9062 the variable `gnus-move-split-methods' for finding a default target | |
9063 newsgroup. | |
7726 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but | 9064 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but |
7727 re-spool using this method." | 9065 re-spool using this method." |
7728 (interactive "P") | 9066 (interactive "P") |
7729 (gnus-summary-move-article n to-newsgroup select-method 'copy)) | 9067 (gnus-summary-move-article n to-newsgroup select-method 'copy)) |
7730 | 9068 |
7732 "Crosspost the current article to some other group." | 9070 "Crosspost the current article to some other group." |
7733 (interactive "P") | 9071 (interactive "P") |
7734 (gnus-summary-move-article n nil nil 'crosspost)) | 9072 (gnus-summary-move-article n nil nil 'crosspost)) |
7735 | 9073 |
7736 (defcustom gnus-summary-respool-default-method nil | 9074 (defcustom gnus-summary-respool-default-method nil |
7737 "Default method for respooling an article. | 9075 "Default method type for respooling an article. |
7738 If nil, use to the current newsgroup method." | 9076 If nil, use to the current newsgroup method." |
7739 :type '(choice (gnus-select-method :value (nnml "")) | 9077 :type 'symbol |
7740 (const nil)) | |
7741 :group 'gnus-summary-mail) | 9078 :group 'gnus-summary-mail) |
9079 | |
9080 (defcustom gnus-summary-display-while-building nil | |
9081 "If non-nil, show and update the summary buffer as it's being built. | |
9082 If the value is t, update the buffer after every line is inserted. If | |
9083 the value is an integer (N), update the display every N lines." | |
9084 :group 'gnus-thread | |
9085 :type '(choice (const :tag "off" nil) | |
9086 number | |
9087 (const :tag "frequently" t))) | |
7742 | 9088 |
7743 (defun gnus-summary-respool-article (&optional n method) | 9089 (defun gnus-summary-respool-article (&optional n method) |
7744 "Respool the current article. | 9090 "Respool the current article. |
7745 The article will be squeezed through the mail spooling process again, | 9091 The article will be squeezed through the mail spooling process again, |
7746 which means that it will be put in some mail newsgroup or other | 9092 which means that it will be put in some mail newsgroup or other |
7760 (methname | 9106 (methname |
7761 (symbol-name (or gnus-summary-respool-default-method | 9107 (symbol-name (or gnus-summary-respool-default-method |
7762 (car (gnus-find-method-for-group | 9108 (car (gnus-find-method-for-group |
7763 gnus-newsgroup-name))))) | 9109 gnus-newsgroup-name))))) |
7764 (method | 9110 (method |
7765 (gnus-completing-read | 9111 (gnus-completing-read-with-default |
7766 methname "What backend do you want to use when respooling?" | 9112 methname "What backend do you want to use when respooling?" |
7767 methods nil t nil 'gnus-mail-method-history)) | 9113 methods nil t nil 'gnus-mail-method-history)) |
7768 ms) | 9114 ms) |
7769 (cond | 9115 (cond |
7770 ((zerop (length (setq ms (gnus-servers-using-backend | 9116 ((zerop (length (setq ms (gnus-servers-using-backend |
7782 (car (gnus-find-method-for-group gnus-newsgroup-name))) | 9128 (car (gnus-find-method-for-group gnus-newsgroup-name))) |
7783 (gnus-methods-using 'respool)) | 9129 (gnus-methods-using 'respool)) |
7784 (gnus-summary-move-article n nil method) | 9130 (gnus-summary-move-article n nil method) |
7785 (gnus-summary-copy-article n nil method))) | 9131 (gnus-summary-copy-article n nil method))) |
7786 | 9132 |
7787 (defun gnus-summary-import-article (file) | 9133 (defun gnus-summary-import-article (file &optional edit) |
7788 "Import an arbitrary file into a mail newsgroup." | 9134 "Import an arbitrary file into a mail newsgroup." |
7789 (interactive "fImport file: ") | 9135 (interactive "fImport file: \nP") |
7790 (let ((group gnus-newsgroup-name) | 9136 (let ((group gnus-newsgroup-name) |
7791 (now (current-time)) | 9137 (now (current-time)) |
7792 atts lines) | 9138 atts lines group-art) |
7793 (unless (gnus-check-backend-function 'request-accept-article group) | 9139 (unless (gnus-check-backend-function 'request-accept-article group) |
7794 (error "%s does not support article importing" group)) | 9140 (error "%s does not support article importing" group)) |
7795 (or (file-readable-p file) | 9141 (or (file-readable-p file) |
7796 (not (file-regular-p file)) | 9142 (not (file-regular-p file)) |
7797 (error "Can't read %s" file)) | 9143 (error "Can't read %s" file)) |
7798 (save-excursion | 9144 (save-excursion |
7799 (set-buffer (gnus-get-buffer-create " *import file*")) | 9145 (set-buffer (gnus-get-buffer-create " *import file*")) |
7800 (erase-buffer) | 9146 (erase-buffer) |
7801 (nnheader-insert-file-contents file) | 9147 (nnheader-insert-file-contents file) |
7802 (goto-char (point-min)) | 9148 (goto-char (point-min)) |
7803 (unless (nnheader-article-p) | 9149 (if (nnheader-article-p) |
7804 ;; This doesn't look like an article, so we fudge some headers. | 9150 (save-restriction |
9151 (goto-char (point-min)) | |
9152 (search-forward "\n\n" nil t) | |
9153 (narrow-to-region (point-min) (1- (point))) | |
9154 (goto-char (point-min)) | |
9155 (unless (re-search-forward "^date:" nil t) | |
9156 (goto-char (point-max)) | |
9157 (insert "Date: " (message-make-date (nth 5 atts)) "\n"))) | |
9158 ;; This doesn't look like an article, so we fudge some headers. | |
7805 (setq atts (file-attributes file) | 9159 (setq atts (file-attributes file) |
7806 lines (count-lines (point-min) (point-max))) | 9160 lines (count-lines (point-min) (point-max))) |
7807 (insert "From: " (read-string "From: ") "\n" | 9161 (insert "From: " (read-string "From: ") "\n" |
7808 "Subject: " (read-string "Subject: ") "\n" | 9162 "Subject: " (read-string "Subject: ") "\n" |
7809 "Date: " (message-make-date (nth 5 atts)) | 9163 "Date: " (message-make-date (nth 5 atts)) "\n" |
7810 "\n" | |
7811 "Message-ID: " (message-make-message-id) "\n" | 9164 "Message-ID: " (message-make-message-id) "\n" |
7812 "Lines: " (int-to-string lines) "\n" | 9165 "Lines: " (int-to-string lines) "\n" |
7813 "Chars: " (int-to-string (nth 7 atts)) "\n\n")) | 9166 "Chars: " (int-to-string (nth 7 atts)) "\n\n")) |
7814 (gnus-request-accept-article group nil t) | 9167 (setq group-art (gnus-request-accept-article group nil t)) |
7815 (kill-buffer (current-buffer))))) | 9168 (kill-buffer (current-buffer))) |
9169 (setq gnus-newsgroup-active (gnus-activate-group group)) | |
9170 (forward-line 1) | |
9171 (gnus-summary-goto-article (cdr group-art) nil t) | |
9172 (when edit | |
9173 (gnus-summary-edit-article)))) | |
9174 | |
9175 (defun gnus-summary-create-article () | |
9176 "Create an article in a mail newsgroup." | |
9177 (interactive) | |
9178 (let ((group gnus-newsgroup-name) | |
9179 (now (current-time)) | |
9180 group-art) | |
9181 (unless (gnus-check-backend-function 'request-accept-article group) | |
9182 (error "%s does not support article importing" group)) | |
9183 (save-excursion | |
9184 (set-buffer (gnus-get-buffer-create " *import file*")) | |
9185 (erase-buffer) | |
9186 (goto-char (point-min)) | |
9187 ;; This doesn't look like an article, so we fudge some headers. | |
9188 (insert "From: " (read-string "From: ") "\n" | |
9189 "Subject: " (read-string "Subject: ") "\n" | |
9190 "Date: " (message-make-date now) "\n" | |
9191 "Message-ID: " (message-make-message-id) "\n") | |
9192 (setq group-art (gnus-request-accept-article group nil t)) | |
9193 (kill-buffer (current-buffer))) | |
9194 (setq gnus-newsgroup-active (gnus-activate-group group)) | |
9195 (forward-line 1) | |
9196 (gnus-summary-goto-article (cdr group-art) nil t) | |
9197 (gnus-summary-edit-article))) | |
7816 | 9198 |
7817 (defun gnus-summary-article-posted-p () | 9199 (defun gnus-summary-article-posted-p () |
7818 "Say whether the current (mail) article is available from news as well. | 9200 "Say whether the current (mail) article is available from news as well. |
7819 This will be the case if the article has both been mailed and posted." | 9201 This will be the case if the article has both been mailed and posted." |
7820 (interactive) | 9202 (interactive) |
7828 nil))) | 9210 nil))) |
7829 | 9211 |
7830 (defun gnus-summary-expire-articles (&optional now) | 9212 (defun gnus-summary-expire-articles (&optional now) |
7831 "Expire all articles that are marked as expirable in the current group." | 9213 "Expire all articles that are marked as expirable in the current group." |
7832 (interactive) | 9214 (interactive) |
7833 (when (gnus-check-backend-function | 9215 (when (and (not gnus-group-is-exiting-without-update-p) |
7834 'request-expire-articles gnus-newsgroup-name) | 9216 (gnus-check-backend-function |
9217 'request-expire-articles gnus-newsgroup-name)) | |
7835 ;; This backend supports expiry. | 9218 ;; This backend supports expiry. |
7836 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name)) | 9219 (let* ((total (gnus-group-total-expirable-p gnus-newsgroup-name)) |
7837 (expirable (if total | 9220 (expirable (if total |
7838 (progn | 9221 (progn |
7839 ;; We need to update the info for | 9222 ;; We need to update the info for |
7863 (let ((nnmail-expiry-wait-function nil) | 9246 (let ((nnmail-expiry-wait-function nil) |
7864 (nnmail-expiry-wait expiry-wait)) | 9247 (nnmail-expiry-wait expiry-wait)) |
7865 (setq es (gnus-request-expire-articles | 9248 (setq es (gnus-request-expire-articles |
7866 expirable gnus-newsgroup-name))) | 9249 expirable gnus-newsgroup-name))) |
7867 (setq es (gnus-request-expire-articles | 9250 (setq es (gnus-request-expire-articles |
7868 expirable gnus-newsgroup-name)))) | 9251 expirable gnus-newsgroup-name))) |
7869 (unless total | 9252 (unless total |
7870 (setq gnus-newsgroup-expirable es)) | 9253 (setq gnus-newsgroup-expirable es)) |
7871 ;; We go through the old list of expirable, and mark all | 9254 ;; We go through the old list of expirable, and mark all |
7872 ;; really expired articles as nonexistent. | 9255 ;; really expired articles as nonexistent. |
7873 (unless (eq es expirable) ;If nothing was expired, we don't mark. | 9256 (unless (eq es expirable) ;If nothing was expired, we don't mark. |
7874 (let ((gnus-use-cache nil)) | 9257 (let ((gnus-use-cache nil)) |
7875 (while expirable | 9258 (dolist (article expirable) |
7876 (unless (memq (car expirable) es) | 9259 (when (and (not (memq article es)) |
7877 (when (gnus-data-find (car expirable)) | 9260 (gnus-data-find article)) |
7878 (gnus-summary-mark-article | 9261 (gnus-summary-mark-article article gnus-canceled-mark) |
7879 (car expirable) gnus-canceled-mark))) | 9262 (run-hook-with-args 'gnus-summary-article-expire-hook |
7880 (setq expirable (cdr expirable))))) | 9263 'delete |
9264 (gnus-data-header | |
9265 (assoc article (gnus-data-list nil))) | |
9266 gnus-newsgroup-name | |
9267 nil | |
9268 nil)))))) | |
7881 (gnus-message 6 "Expiring articles...done"))))) | 9269 (gnus-message 6 "Expiring articles...done"))))) |
7882 | 9270 |
7883 (defun gnus-summary-expire-articles-now () | 9271 (defun gnus-summary-expire-articles-now () |
7884 "Expunge all expirable articles in the current group. | 9272 "Expunge all expirable articles in the current group. |
7885 This means that *all* articles that are marked as expirable will be | 9273 This means that *all* articles that are marked as expirable will be |
7895 (defun gnus-summary-delete-article (&optional n) | 9283 (defun gnus-summary-delete-article (&optional n) |
7896 "Delete the N next (mail) articles. | 9284 "Delete the N next (mail) articles. |
7897 This command actually deletes articles. This is not a marking | 9285 This command actually deletes articles. This is not a marking |
7898 command. The article will disappear forever from your life, never to | 9286 command. The article will disappear forever from your life, never to |
7899 return. | 9287 return. |
9288 | |
7900 If N is negative, delete backwards. | 9289 If N is negative, delete backwards. |
7901 If N is nil and articles have been marked with the process mark, | 9290 If N is nil and articles have been marked with the process mark, |
7902 delete these instead." | 9291 delete these instead. |
9292 | |
9293 If `gnus-novice-user' is non-nil you will be asked for | |
9294 confirmation before the articles are deleted." | |
7903 (interactive "P") | 9295 (interactive "P") |
7904 (unless (gnus-check-backend-function 'request-expire-articles | 9296 (unless (gnus-check-backend-function 'request-expire-articles |
7905 gnus-newsgroup-name) | 9297 gnus-newsgroup-name) |
7906 (error "The current newsgroup does not support article deletion")) | 9298 (error "The current newsgroup does not support article deletion")) |
7907 (unless (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name)) | 9299 (unless (gnus-check-server (gnus-find-method-for-group gnus-newsgroup-name)) |
7908 (error "Couldn't open server")) | 9300 (error "Couldn't open server")) |
7909 ;; Compute the list of articles to delete. | 9301 ;; Compute the list of articles to delete. |
7910 (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<)) | 9302 (let ((articles (sort (copy-sequence (gnus-summary-work-articles n)) '<)) |
9303 (nnmail-expiry-target 'delete) | |
7911 not-deleted) | 9304 not-deleted) |
7912 (if (and gnus-novice-user | 9305 (if (and gnus-novice-user |
7913 (not (gnus-yes-or-no-p | 9306 (not (gnus-yes-or-no-p |
7914 (format "Do you really want to delete %s forever? " | 9307 (format "Do you really want to delete %s forever? " |
7915 (if (> (length articles) 1) | 9308 (if (> (length articles) 1) |
7923 (gnus-summary-remove-process-mark (car articles)) | 9316 (gnus-summary-remove-process-mark (car articles)) |
7924 ;; The backend might not have been able to delete the article | 9317 ;; The backend might not have been able to delete the article |
7925 ;; after all. | 9318 ;; after all. |
7926 (unless (memq (car articles) not-deleted) | 9319 (unless (memq (car articles) not-deleted) |
7927 (gnus-summary-mark-article (car articles) gnus-canceled-mark)) | 9320 (gnus-summary-mark-article (car articles) gnus-canceled-mark)) |
9321 (let* ((article (car articles)) | |
9322 (id (mail-header-id (gnus-data-header | |
9323 (assoc article (gnus-data-list nil)))))) | |
9324 (run-hook-with-args 'gnus-summary-article-delete-hook | |
9325 'delete id gnus-newsgroup-name nil | |
9326 nil)) | |
7928 (setq articles (cdr articles))) | 9327 (setq articles (cdr articles))) |
7929 (when not-deleted | 9328 (when not-deleted |
7930 (gnus-message 4 "Couldn't delete articles %s" not-deleted))) | 9329 (gnus-message 4 "Couldn't delete articles %s" not-deleted))) |
7931 (gnus-summary-position-point) | 9330 (gnus-summary-position-point) |
7932 (gnus-set-mode-line 'summary) | 9331 (gnus-set-mode-line 'summary) |
7936 "Edit the current article. | 9335 "Edit the current article. |
7937 This will have permanent effect only in mail groups. | 9336 This will have permanent effect only in mail groups. |
7938 If ARG is nil, edit the decoded articles. | 9337 If ARG is nil, edit the decoded articles. |
7939 If ARG is 1, edit the raw articles. | 9338 If ARG is 1, edit the raw articles. |
7940 If ARG is 2, edit the raw articles even in read-only groups. | 9339 If ARG is 2, edit the raw articles even in read-only groups. |
9340 If ARG is 3, edit the articles with the current handles. | |
7941 Otherwise, allow editing of articles even in read-only | 9341 Otherwise, allow editing of articles even in read-only |
7942 groups." | 9342 groups." |
7943 (interactive "P") | 9343 (interactive "P") |
7944 (let (force raw) | 9344 (let (force raw current-handles) |
7945 (cond | 9345 (cond |
7946 ((null arg)) | 9346 ((null arg)) |
7947 ((eq arg 1) (setq raw t)) | 9347 ((eq arg 1) |
7948 ((eq arg 2) (setq raw t | 9348 (setq raw t)) |
7949 force t)) | 9349 ((eq arg 2) |
7950 (t (setq force t))) | 9350 (setq raw t |
7951 (if (and raw (not force) (equal gnus-newsgroup-name "nndraft:drafts")) | 9351 force t)) |
7952 (error "Can't edit the raw article in group nndraft:drafts")) | 9352 ((eq arg 3) |
9353 (setq current-handles | |
9354 (and (gnus-buffer-live-p gnus-article-buffer) | |
9355 (with-current-buffer gnus-article-buffer | |
9356 (prog1 | |
9357 gnus-article-mime-handles | |
9358 (setq gnus-article-mime-handles nil)))))) | |
9359 (t | |
9360 (setq force t))) | |
9361 (when (and raw (not force) | |
9362 (member gnus-newsgroup-name '("nndraft:delayed" | |
9363 "nndraft:drafts" | |
9364 "nndraft:queue"))) | |
9365 (error "Can't edit the raw article in group %s" | |
9366 gnus-newsgroup-name)) | |
7953 (save-excursion | 9367 (save-excursion |
7954 (set-buffer gnus-summary-buffer) | 9368 (set-buffer gnus-summary-buffer) |
7955 (let ((mail-parse-charset gnus-newsgroup-charset) | 9369 (let ((mail-parse-charset gnus-newsgroup-charset) |
7956 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)) | 9370 (mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)) |
7957 (gnus-set-global-variables) | 9371 (gnus-set-global-variables) |
7960 (error "The current newsgroup does not support article editing")) | 9374 (error "The current newsgroup does not support article editing")) |
7961 (gnus-summary-show-article t) | 9375 (gnus-summary-show-article t) |
7962 (when (and (not raw) (gnus-buffer-live-p gnus-article-buffer)) | 9376 (when (and (not raw) (gnus-buffer-live-p gnus-article-buffer)) |
7963 (with-current-buffer gnus-article-buffer | 9377 (with-current-buffer gnus-article-buffer |
7964 (mm-enable-multibyte))) | 9378 (mm-enable-multibyte))) |
7965 (if (equal gnus-newsgroup-name "nndraft:drafts") | 9379 (if (member gnus-newsgroup-name '("nndraft:delayed" "nndraft:drafts")) |
7966 (setq raw t)) | 9380 (setq raw t)) |
7967 (gnus-article-edit-article | 9381 (gnus-article-edit-article |
7968 (if raw 'ignore | 9382 (if raw 'ignore |
7969 #'(lambda () | 9383 `(lambda () |
7970 (let ((mbl mml-buffer-list)) | 9384 (let ((mbl mml-buffer-list)) |
7971 (setq mml-buffer-list nil) | 9385 (setq mml-buffer-list nil) |
7972 (mime-to-mml) | 9386 (mime-to-mml ,'current-handles) |
7973 (make-local-hook 'kill-buffer-hook) | 9387 (let ((mbl1 mml-buffer-list)) |
7974 (let ((mml-buffer-list mml-buffer-list)) | 9388 (setq mml-buffer-list mbl) |
7975 (setq mml-buffer-list mbl) | 9389 (set (make-local-variable 'mml-buffer-list) mbl1)) |
7976 (make-local-variable 'mml-buffer-list)) | 9390 (gnus-make-local-hook 'kill-buffer-hook) |
7977 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))) | 9391 (add-hook 'kill-buffer-hook 'mml-destroy-buffers t t)))) |
7978 `(lambda (no-highlight) | 9392 `(lambda (no-highlight) |
7979 (let ((mail-parse-charset ',gnus-newsgroup-charset) | 9393 (let ((mail-parse-charset ',gnus-newsgroup-charset) |
9394 (message-options message-options) | |
9395 (message-options-set-recipient) | |
7980 (mail-parse-ignored-charsets | 9396 (mail-parse-ignored-charsets |
7981 ',gnus-newsgroup-ignored-charsets)) | 9397 ',gnus-newsgroup-ignored-charsets)) |
7982 ,(if (not raw) '(progn | 9398 ,(if (not raw) '(progn |
7983 (mml-to-mime) | 9399 (mml-to-mime) |
7984 (mml-destroy-buffers) | 9400 (mml-destroy-buffers) |
7994 | 9410 |
7995 (defun gnus-summary-edit-article-done (&optional references read-only buffer | 9411 (defun gnus-summary-edit-article-done (&optional references read-only buffer |
7996 no-highlight) | 9412 no-highlight) |
7997 "Make edits to the current article permanent." | 9413 "Make edits to the current article permanent." |
7998 (interactive) | 9414 (interactive) |
9415 (save-excursion | |
9416 ;; The buffer restriction contains the entire article if it exists. | |
9417 (when (article-goto-body) | |
9418 (let ((lines (count-lines (point) (point-max))) | |
9419 (length (- (point-max) (point))) | |
9420 (case-fold-search t) | |
9421 (body (copy-marker (point)))) | |
9422 (goto-char (point-min)) | |
9423 (when (re-search-forward "^content-length:[ \t]\\([0-9]+\\)" body t) | |
9424 (delete-region (match-beginning 1) (match-end 1)) | |
9425 (insert (number-to-string length))) | |
9426 (goto-char (point-min)) | |
9427 (when (re-search-forward | |
9428 "^x-content-length:[ \t]\\([0-9]+\\)" body t) | |
9429 (delete-region (match-beginning 1) (match-end 1)) | |
9430 (insert (number-to-string length))) | |
9431 (goto-char (point-min)) | |
9432 (when (re-search-forward "^lines:[ \t]\\([0-9]+\\)" body t) | |
9433 (delete-region (match-beginning 1) (match-end 1)) | |
9434 (insert (number-to-string lines)))))) | |
7999 ;; Replace the article. | 9435 ;; Replace the article. |
8000 (let ((buf (current-buffer))) | 9436 (let ((buf (current-buffer))) |
8001 (with-temp-buffer | 9437 (with-temp-buffer |
8002 (insert-buffer-substring buf) | 9438 (insert-buffer-substring buf) |
9439 | |
8003 (if (and (not read-only) | 9440 (if (and (not read-only) |
8004 (not (gnus-request-replace-article | 9441 (not (gnus-request-replace-article |
8005 (cdr gnus-article-current) (car gnus-article-current) | 9442 (cdr gnus-article-current) (car gnus-article-current) |
8006 (current-buffer) t))) | 9443 (current-buffer) t))) |
8007 (error "Couldn't replace article") | 9444 (error "Couldn't replace article") |
8021 (cdr gnus-article-current))) | 9458 (cdr gnus-article-current))) |
8022 (insert head) | 9459 (insert head) |
8023 (insert ".\n") | 9460 (insert ".\n") |
8024 (let ((nntp-server-buffer (current-buffer))) | 9461 (let ((nntp-server-buffer (current-buffer))) |
8025 (setq header (car (gnus-get-newsgroup-headers | 9462 (setq header (car (gnus-get-newsgroup-headers |
8026 (save-excursion | 9463 nil t)))) |
8027 (set-buffer gnus-summary-buffer) | |
8028 gnus-newsgroup-dependencies) | |
8029 t)))) | |
8030 (save-excursion | 9464 (save-excursion |
8031 (set-buffer gnus-summary-buffer) | 9465 (set-buffer gnus-summary-buffer) |
8032 (gnus-data-set-header | 9466 (gnus-data-set-header |
8033 (gnus-data-find (cdr gnus-article-current)) | 9467 (gnus-data-find (cdr gnus-article-current)) |
8034 header) | 9468 header) |
8035 (gnus-summary-update-article-line | 9469 (gnus-summary-update-article-line |
8036 (cdr gnus-article-current) header)))))) | 9470 (cdr gnus-article-current) header) |
9471 (if (gnus-summary-goto-subject | |
9472 (cdr gnus-article-current) nil t) | |
9473 (gnus-summary-update-secondary-mark | |
9474 (cdr gnus-article-current)))))))) | |
8037 ;; Update threads. | 9475 ;; Update threads. |
8038 (set-buffer (or buffer gnus-summary-buffer)) | 9476 (set-buffer (or buffer gnus-summary-buffer)) |
8039 (gnus-summary-update-article (cdr gnus-article-current))) | 9477 (gnus-summary-update-article (cdr gnus-article-current)) |
9478 (if (gnus-summary-goto-subject (cdr gnus-article-current) nil t) | |
9479 (gnus-summary-update-secondary-mark | |
9480 (cdr gnus-article-current)))) | |
8040 ;; Prettify the article buffer again. | 9481 ;; Prettify the article buffer again. |
8041 (unless no-highlight | 9482 (unless no-highlight |
8042 (save-excursion | 9483 (save-excursion |
8043 (set-buffer gnus-article-buffer) | 9484 (set-buffer gnus-article-buffer) |
8044 ;;;!!! Fix this -- article should be rehighlighted. | 9485 ;;;!!! Fix this -- article should be rehighlighted. |
8070 (interactive) | 9511 (interactive) |
8071 (let (gnus-mark-article-hook) | 9512 (let (gnus-mark-article-hook) |
8072 (gnus-summary-select-article) | 9513 (gnus-summary-select-article) |
8073 (save-excursion | 9514 (save-excursion |
8074 (set-buffer gnus-original-article-buffer) | 9515 (set-buffer gnus-original-article-buffer) |
8075 (save-restriction | 9516 (let ((groups (nnmail-article-group 'identity trace))) |
8076 (message-narrow-to-head) | 9517 (unless silent |
8077 (let ((groups (nnmail-article-group 'identity trace))) | 9518 (if groups |
8078 (unless silent | 9519 (message "This message would go to %s" |
8079 (if groups | 9520 (mapconcat 'car groups ", ")) |
8080 (message "This message would go to %s" | 9521 (message "This message would go to no groups")) |
8081 (mapconcat 'car groups ", ")) | 9522 groups))))) |
8082 (message "This message would go to no groups")) | |
8083 groups)))))) | |
8084 | 9523 |
8085 (defun gnus-summary-respool-trace () | 9524 (defun gnus-summary-respool-trace () |
8086 "Trace where the respool algorithm would put this article. | 9525 "Trace where the respool algorithm would put this article. |
8087 Display a buffer showing all fancy splitting patterns which matched." | 9526 Display a buffer showing all fancy splitting patterns which matched." |
8088 (interactive) | 9527 (interactive) |
8160 (defun gnus-summary-mark-as-processable (n &optional unmark) | 9599 (defun gnus-summary-mark-as-processable (n &optional unmark) |
8161 "Set the process mark on the next N articles. | 9600 "Set the process mark on the next N articles. |
8162 If N is negative, mark backward instead. If UNMARK is non-nil, remove | 9601 If N is negative, mark backward instead. If UNMARK is non-nil, remove |
8163 the process mark instead. The difference between N and the actual | 9602 the process mark instead. The difference between N and the actual |
8164 number of articles marked is returned." | 9603 number of articles marked is returned." |
8165 (interactive "p") | 9604 (interactive "P") |
8166 (let ((backward (< n 0)) | 9605 (if (and (null n) (gnus-region-active-p)) |
8167 (n (abs n))) | 9606 (gnus-uu-mark-region (region-beginning) (region-end) unmark) |
8168 (while (and | 9607 (setq n (prefix-numeric-value n)) |
8169 (> n 0) | 9608 (let ((backward (< n 0)) |
8170 (if unmark | 9609 (n (abs n))) |
8171 (gnus-summary-remove-process-mark | 9610 (while (and |
8172 (gnus-summary-article-number)) | 9611 (> n 0) |
8173 (gnus-summary-set-process-mark (gnus-summary-article-number))) | 9612 (if unmark |
8174 (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) | 9613 (gnus-summary-remove-process-mark |
8175 (setq n (1- n))) | 9614 (gnus-summary-article-number)) |
8176 (when (/= 0 n) | 9615 (gnus-summary-set-process-mark (gnus-summary-article-number))) |
8177 (gnus-message 7 "No more articles")) | 9616 (zerop (gnus-summary-next-subject (if backward -1 1) nil t))) |
8178 (gnus-summary-recenter) | 9617 (setq n (1- n))) |
8179 (gnus-summary-position-point) | 9618 (when (/= 0 n) |
8180 n)) | 9619 (gnus-message 7 "No more articles")) |
9620 (gnus-summary-recenter) | |
9621 (gnus-summary-position-point) | |
9622 n))) | |
8181 | 9623 |
8182 (defun gnus-summary-unmark-as-processable (n) | 9624 (defun gnus-summary-unmark-as-processable (n) |
8183 "Remove the process mark from the next N articles. | 9625 "Remove the process mark from the next N articles. |
8184 If N is negative, unmark backward instead. The difference between N and | 9626 If N is negative, unmark backward instead. The difference between N and |
8185 the actual number of articles unmarked is returned." | 9627 the actual number of articles unmarked is returned." |
8186 (interactive "p") | 9628 (interactive "P") |
8187 (gnus-summary-mark-as-processable n t)) | 9629 (gnus-summary-mark-as-processable n t)) |
8188 | 9630 |
8189 (defun gnus-summary-unmark-all-processable () | 9631 (defun gnus-summary-unmark-all-processable () |
8190 "Remove the process mark from all articles." | 9632 "Remove the process mark from all articles." |
8191 (interactive) | 9633 (interactive) |
8192 (save-excursion | 9634 (save-excursion |
8193 (while gnus-newsgroup-processable | 9635 (while gnus-newsgroup-processable |
8194 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable)))) | 9636 (gnus-summary-remove-process-mark (car gnus-newsgroup-processable)))) |
8195 (gnus-summary-position-point)) | 9637 (gnus-summary-position-point)) |
8196 | 9638 |
9639 (defun gnus-summary-add-mark (article type) | |
9640 "Mark ARTICLE with a mark of TYPE." | |
9641 (let ((vtype (car (assq type gnus-article-mark-lists))) | |
9642 var) | |
9643 (if (not vtype) | |
9644 (error "No such mark type: %s" type) | |
9645 (setq var (intern (format "gnus-newsgroup-%s" type))) | |
9646 (set var (cons article (symbol-value var))) | |
9647 (if (memq type '(processable cached replied forwarded recent saved)) | |
9648 (gnus-summary-update-secondary-mark article) | |
9649 ;;; !!! This is bogus. We should find out what primary | |
9650 ;;; !!! mark we want to set. | |
9651 (gnus-summary-update-mark gnus-del-mark 'unread))))) | |
9652 | |
8197 (defun gnus-summary-mark-as-expirable (n) | 9653 (defun gnus-summary-mark-as-expirable (n) |
8198 "Mark N articles forward as expirable. | 9654 "Mark N articles forward as expirable. |
8199 If N is negative, mark backward instead. The difference between N and | 9655 If N is negative, mark backward instead. The difference between N and |
8200 the actual number of articles marked is returned." | 9656 the actual number of articles marked is returned." |
8201 (interactive "p") | 9657 (interactive "p") |
8202 (gnus-summary-mark-forward n gnus-expirable-mark)) | 9658 (gnus-summary-mark-forward n gnus-expirable-mark)) |
8203 | 9659 |
9660 (defun gnus-summary-mark-as-spam (n) | |
9661 "Mark N articles forward as spam. | |
9662 If N is negative, mark backward instead. The difference between N and | |
9663 the actual number of articles marked is returned." | |
9664 (interactive "p") | |
9665 (gnus-summary-mark-forward n gnus-spam-mark)) | |
9666 | |
8204 (defun gnus-summary-mark-article-as-replied (article) | 9667 (defun gnus-summary-mark-article-as-replied (article) |
8205 "Mark ARTICLE replied and update the summary line." | 9668 "Mark ARTICLE as replied to and update the summary line. |
8206 (push article gnus-newsgroup-replied) | 9669 ARTICLE can also be a list of articles." |
8207 (let ((buffer-read-only nil)) | 9670 (interactive (list (gnus-summary-article-number))) |
8208 (when (gnus-summary-goto-subject article nil t) | 9671 (let ((articles (if (listp article) article (list article)))) |
8209 (gnus-summary-update-secondary-mark article)))) | 9672 (dolist (article articles) |
9673 (unless (numberp article) | |
9674 (error "%s is not a number" article)) | |
9675 (push article gnus-newsgroup-replied) | |
9676 (let ((buffer-read-only nil)) | |
9677 (when (gnus-summary-goto-subject article nil t) | |
9678 (gnus-summary-update-secondary-mark article)))))) | |
9679 | |
9680 (defun gnus-summary-mark-article-as-forwarded (article) | |
9681 "Mark ARTICLE as forwarded and update the summary line. | |
9682 ARTICLE can also be a list of articles." | |
9683 (let ((articles (if (listp article) article (list article)))) | |
9684 (dolist (article articles) | |
9685 (push article gnus-newsgroup-forwarded) | |
9686 (let ((buffer-read-only nil)) | |
9687 (when (gnus-summary-goto-subject article nil t) | |
9688 (gnus-summary-update-secondary-mark article)))))) | |
8210 | 9689 |
8211 (defun gnus-summary-set-bookmark (article) | 9690 (defun gnus-summary-set-bookmark (article) |
8212 "Set a bookmark in current article." | 9691 "Set a bookmark in current article." |
8213 (interactive (list (gnus-summary-article-number))) | 9692 (interactive (list (gnus-summary-article-number))) |
8214 (when (or (not (get-buffer gnus-article-buffer)) | 9693 (when (or (not (get-buffer gnus-article-buffer)) |
8215 (not gnus-current-article) | 9694 (not gnus-current-article) |
8216 (not gnus-article-current) | 9695 (not gnus-article-current) |
8217 (not (equal gnus-newsgroup-name (car gnus-article-current)))) | 9696 (not (equal gnus-newsgroup-name (car gnus-article-current)))) |
8218 (error "No current article selected")) | 9697 (error "No current article selected")) |
8219 ;; Remove old bookmark, if one exists. | 9698 ;; Remove old bookmark, if one exists. |
8220 (let ((old (assq article gnus-newsgroup-bookmarks))) | 9699 (gnus-pull article gnus-newsgroup-bookmarks) |
8221 (when old | |
8222 (setq gnus-newsgroup-bookmarks | |
8223 (delq old gnus-newsgroup-bookmarks)))) | |
8224 ;; Set the new bookmark, which is on the form | 9700 ;; Set the new bookmark, which is on the form |
8225 ;; (article-number . line-number-in-body). | 9701 ;; (article-number . line-number-in-body). |
8226 (push | 9702 (push |
8227 (cons article | 9703 (cons article |
8228 (save-excursion | 9704 (save-excursion |
8229 (set-buffer gnus-article-buffer) | 9705 (set-buffer gnus-article-buffer) |
8230 (count-lines | 9706 (count-lines |
8231 (min (point) | 9707 (min (point) |
8232 (save-excursion | 9708 (save-excursion |
8233 (goto-char (point-min)) | 9709 (article-goto-body) |
8234 (search-forward "\n\n" nil t) | |
8235 (point))) | 9710 (point))) |
8236 (point)))) | 9711 (point)))) |
8237 gnus-newsgroup-bookmarks) | 9712 gnus-newsgroup-bookmarks) |
8238 (gnus-message 6 "A bookmark has been added to the current article.")) | 9713 (gnus-message 6 "A bookmark has been added to the current article.")) |
8239 | 9714 |
8240 (defun gnus-summary-remove-bookmark (article) | 9715 (defun gnus-summary-remove-bookmark (article) |
8241 "Remove the bookmark from the current article." | 9716 "Remove the bookmark from the current article." |
8242 (interactive (list (gnus-summary-article-number))) | 9717 (interactive (list (gnus-summary-article-number))) |
8243 ;; Remove old bookmark, if one exists. | 9718 ;; Remove old bookmark, if one exists. |
8244 (let ((old (assq article gnus-newsgroup-bookmarks))) | 9719 (if (not (assq article gnus-newsgroup-bookmarks)) |
8245 (if old | 9720 (gnus-message 6 "No bookmark in current article.") |
8246 (progn | 9721 (gnus-pull article gnus-newsgroup-bookmarks) |
8247 (setq gnus-newsgroup-bookmarks | 9722 (gnus-message 6 "Removed bookmark."))) |
8248 (delq old gnus-newsgroup-bookmarks)) | |
8249 (gnus-message 6 "Removed bookmark.")) | |
8250 (gnus-message 6 "No bookmark in current article.")))) | |
8251 | 9723 |
8252 ;; Suggested by Daniel Quinlan <quinlan@best.com>. | 9724 ;; Suggested by Daniel Quinlan <quinlan@best.com>. |
8253 (defun gnus-summary-mark-as-dormant (n) | 9725 (defun gnus-summary-mark-as-dormant (n) |
8254 "Mark N articles forward as dormant. | 9726 "Mark N articles forward as dormant. |
8255 If N is negative, mark backward instead. The difference between N and | 9727 If N is negative, mark backward instead. The difference between N and |
8291 (gnus-summary-show-thread) | 9763 (gnus-summary-show-thread) |
8292 (let ((backward (< n 0)) | 9764 (let ((backward (< n 0)) |
8293 (gnus-summary-goto-unread | 9765 (gnus-summary-goto-unread |
8294 (and gnus-summary-goto-unread | 9766 (and gnus-summary-goto-unread |
8295 (not (eq gnus-summary-goto-unread 'never)) | 9767 (not (eq gnus-summary-goto-unread 'never)) |
8296 (not (memq mark (list gnus-unread-mark | 9768 (not (memq mark (list gnus-unread-mark gnus-spam-mark |
8297 gnus-ticked-mark gnus-dormant-mark))))) | 9769 gnus-ticked-mark gnus-dormant-mark))))) |
8298 (n (abs n)) | 9770 (n (abs n)) |
8299 (mark (or mark gnus-del-mark))) | 9771 (mark (or mark gnus-del-mark))) |
8300 (while (and (> n 0) | 9772 (while (and (> n 0) |
8301 (gnus-summary-mark-article nil mark no-expire) | 9773 (gnus-summary-mark-article nil mark no-expire) |
8315 (defun gnus-summary-mark-article-as-read (mark) | 9787 (defun gnus-summary-mark-article-as-read (mark) |
8316 "Mark the current article quickly as read with MARK." | 9788 "Mark the current article quickly as read with MARK." |
8317 (let ((article (gnus-summary-article-number))) | 9789 (let ((article (gnus-summary-article-number))) |
8318 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | 9790 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) |
8319 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | 9791 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) |
9792 (setq gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked)) | |
8320 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | 9793 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) |
8321 (push (cons article mark) gnus-newsgroup-reads) | 9794 (push (cons article mark) gnus-newsgroup-reads) |
8322 ;; Possibly remove from cache, if that is used. | 9795 ;; Possibly remove from cache, if that is used. |
8323 (when gnus-use-cache | 9796 (when gnus-use-cache |
8324 (gnus-cache-enter-remove-article article)) | 9797 (gnus-cache-enter-remove-article article)) |
8346 (if (<= article 0) | 9819 (if (<= article 0) |
8347 (progn | 9820 (progn |
8348 (gnus-error 1 "Can't mark negative article numbers") | 9821 (gnus-error 1 "Can't mark negative article numbers") |
8349 nil) | 9822 nil) |
8350 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | 9823 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) |
9824 (setq gnus-newsgroup-spam-marked | |
9825 (delq article gnus-newsgroup-spam-marked)) | |
8351 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | 9826 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) |
8352 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)) | 9827 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable)) |
8353 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads)) | 9828 (setq gnus-newsgroup-reads (delq article gnus-newsgroup-reads)) |
8354 (cond ((= mark gnus-ticked-mark) | 9829 (cond ((= mark gnus-ticked-mark) |
8355 (push article gnus-newsgroup-marked)) | 9830 (setq gnus-newsgroup-marked |
9831 (gnus-add-to-sorted-list gnus-newsgroup-marked | |
9832 article))) | |
9833 ((= mark gnus-spam-mark) | |
9834 (setq gnus-newsgroup-spam-marked | |
9835 (gnus-add-to-sorted-list gnus-newsgroup-spam-marked | |
9836 article))) | |
8356 ((= mark gnus-dormant-mark) | 9837 ((= mark gnus-dormant-mark) |
8357 (push article gnus-newsgroup-dormant)) | 9838 (setq gnus-newsgroup-dormant |
9839 (gnus-add-to-sorted-list gnus-newsgroup-dormant | |
9840 article))) | |
8358 (t | 9841 (t |
8359 (push article gnus-newsgroup-unreads))) | 9842 (setq gnus-newsgroup-unreads |
9843 (gnus-add-to-sorted-list gnus-newsgroup-unreads | |
9844 article)))) | |
8360 (gnus-pull article gnus-newsgroup-reads) | 9845 (gnus-pull article gnus-newsgroup-reads) |
8361 | 9846 |
8362 ;; See whether the article is to be put in the cache. | 9847 ;; See whether the article is to be put in the cache. |
8363 (and gnus-use-cache | 9848 (and gnus-use-cache |
8364 (vectorp (gnus-summary-article-header article)) | 9849 (vectorp (gnus-summary-article-header article)) |
8386 ;; If no mark is given, then we check auto-expiring. | 9871 ;; If no mark is given, then we check auto-expiring. |
8387 (when (null mark) | 9872 (when (null mark) |
8388 (setq mark gnus-del-mark)) | 9873 (setq mark gnus-del-mark)) |
8389 (when (and (not no-expire) | 9874 (when (and (not no-expire) |
8390 gnus-newsgroup-auto-expire | 9875 gnus-newsgroup-auto-expire |
8391 (memq mark gnus-auto-expirable-marks)) | 9876 (memq mark gnus-auto-expirable-marks)) |
8392 (setq mark gnus-expirable-mark)) | 9877 (setq mark gnus-expirable-mark)) |
8393 (let ((article (or article (gnus-summary-article-number))) | 9878 (let ((article (or article (gnus-summary-article-number))) |
8394 (old-mark (gnus-summary-article-mark article))) | 9879 (old-mark (gnus-summary-article-mark article))) |
8395 ;; Allow the backend to change the mark. | 9880 ;; Allow the backend to change the mark. |
8396 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) | 9881 (setq mark (gnus-request-update-mark gnus-newsgroup-name article mark)) |
8398 t | 9883 t |
8399 (unless article | 9884 (unless article |
8400 (error "No article on current line")) | 9885 (error "No article on current line")) |
8401 (if (not (if (or (= mark gnus-unread-mark) | 9886 (if (not (if (or (= mark gnus-unread-mark) |
8402 (= mark gnus-ticked-mark) | 9887 (= mark gnus-ticked-mark) |
9888 (= mark gnus-spam-mark) | |
8403 (= mark gnus-dormant-mark)) | 9889 (= mark gnus-dormant-mark)) |
8404 (gnus-mark-article-as-unread article mark) | 9890 (gnus-mark-article-as-unread article mark) |
8405 (gnus-mark-article-as-read article mark))) | 9891 (gnus-mark-article-as-read article mark))) |
8406 t | 9892 t |
8407 ;; See whether the article is to be put in the cache. | 9893 ;; See whether the article is to be put in the cache. |
8428 gnus-process-mark) | 9914 gnus-process-mark) |
8429 ((memq article gnus-newsgroup-cached) | 9915 ((memq article gnus-newsgroup-cached) |
8430 gnus-cached-mark) | 9916 gnus-cached-mark) |
8431 ((memq article gnus-newsgroup-replied) | 9917 ((memq article gnus-newsgroup-replied) |
8432 gnus-replied-mark) | 9918 gnus-replied-mark) |
9919 ((memq article gnus-newsgroup-forwarded) | |
9920 gnus-forwarded-mark) | |
8433 ((memq article gnus-newsgroup-saved) | 9921 ((memq article gnus-newsgroup-saved) |
8434 gnus-saved-mark) | 9922 gnus-saved-mark) |
8435 (t gnus-unread-mark)) | 9923 ((memq article gnus-newsgroup-recent) |
9924 gnus-recent-mark) | |
9925 ((memq article gnus-newsgroup-unseen) | |
9926 gnus-unseen-mark) | |
9927 (t gnus-no-mark)) | |
8436 'replied) | 9928 'replied) |
8437 (when (gnus-visual-p 'summary-highlight 'highlight) | 9929 (when (gnus-visual-p 'summary-highlight 'highlight) |
8438 (gnus-run-hooks 'gnus-summary-update-hook)) | 9930 (gnus-run-hooks 'gnus-summary-update-hook)) |
8439 t) | 9931 t) |
8440 | 9932 |
9933 (defun gnus-summary-update-download-mark (article) | |
9934 "Update the download mark." | |
9935 (gnus-summary-update-mark | |
9936 (cond ((memq article gnus-newsgroup-undownloaded) | |
9937 gnus-undownloaded-mark) | |
9938 (gnus-newsgroup-agentized | |
9939 gnus-downloaded-mark) | |
9940 (t | |
9941 gnus-no-mark)) | |
9942 'download) | |
9943 (gnus-summary-update-line t) | |
9944 t) | |
9945 | |
8441 (defun gnus-summary-update-mark (mark type) | 9946 (defun gnus-summary-update-mark (mark type) |
8442 (let ((forward (cdr (assq type gnus-summary-mark-positions))) | 9947 (let ((forward (cdr (assq type gnus-summary-mark-positions))) |
8443 (buffer-read-only nil)) | 9948 (buffer-read-only nil)) |
8444 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit) | 9949 (re-search-backward "[\n\r]" (gnus-point-at-bol) 'move-to-limit) |
8445 (when forward | 9950 (when forward |
8446 (when (looking-at "\r") | 9951 (when (looking-at "\r") |
8447 (incf forward)) | 9952 (incf forward)) |
8448 (when (<= (+ forward (point)) (point-max)) | 9953 (when (<= (+ forward (point)) (point-max)) |
8458 | 9963 |
8459 (defun gnus-mark-article-as-read (article &optional mark) | 9964 (defun gnus-mark-article-as-read (article &optional mark) |
8460 "Enter ARTICLE in the pertinent lists and remove it from others." | 9965 "Enter ARTICLE in the pertinent lists and remove it from others." |
8461 ;; Make the article expirable. | 9966 ;; Make the article expirable. |
8462 (let ((mark (or mark gnus-del-mark))) | 9967 (let ((mark (or mark gnus-del-mark))) |
8463 (if (= mark gnus-expirable-mark) | 9968 (setq gnus-newsgroup-expirable |
8464 (push article gnus-newsgroup-expirable) | 9969 (if (= mark gnus-expirable-mark) |
8465 (setq gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable))) | 9970 (gnus-add-to-sorted-list gnus-newsgroup-expirable article) |
9971 (delq article gnus-newsgroup-expirable))) | |
8466 ;; Remove from unread and marked lists. | 9972 ;; Remove from unread and marked lists. |
8467 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | 9973 (setq gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) |
8468 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) | 9974 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked)) |
9975 (setq gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked)) | |
8469 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) | 9976 (setq gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant)) |
8470 (push (cons article mark) gnus-newsgroup-reads) | 9977 (push (cons article mark) gnus-newsgroup-reads) |
8471 ;; Possibly remove from cache, if that is used. | 9978 ;; Possibly remove from cache, if that is used. |
8472 (when gnus-use-cache | 9979 (when gnus-use-cache |
8473 (gnus-cache-enter-remove-article article)) | 9980 (gnus-cache-enter-remove-article article)) |
8479 (if (<= article 0) | 9986 (if (<= article 0) |
8480 (progn | 9987 (progn |
8481 (gnus-error 1 "Can't mark negative article numbers") | 9988 (gnus-error 1 "Can't mark negative article numbers") |
8482 nil) | 9989 nil) |
8483 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked) | 9990 (setq gnus-newsgroup-marked (delq article gnus-newsgroup-marked) |
9991 gnus-newsgroup-spam-marked (delq article gnus-newsgroup-spam-marked) | |
8484 gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant) | 9992 gnus-newsgroup-dormant (delq article gnus-newsgroup-dormant) |
8485 gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable) | 9993 gnus-newsgroup-expirable (delq article gnus-newsgroup-expirable) |
8486 gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) | 9994 gnus-newsgroup-unreads (delq article gnus-newsgroup-unreads)) |
8487 | 9995 |
8488 ;; Unsuppress duplicates? | 9996 ;; Unsuppress duplicates? |
8489 (when gnus-suppress-duplicates | 9997 (when gnus-suppress-duplicates |
8490 (gnus-dup-unsuppress-article article)) | 9998 (gnus-dup-unsuppress-article article)) |
8491 | 9999 |
8492 (cond ((= mark gnus-ticked-mark) | 10000 (cond ((= mark gnus-ticked-mark) |
8493 (push article gnus-newsgroup-marked)) | 10001 (setq gnus-newsgroup-marked |
10002 (gnus-add-to-sorted-list gnus-newsgroup-marked article))) | |
10003 ((= mark gnus-spam-mark) | |
10004 (setq gnus-newsgroup-spam-marked | |
10005 (gnus-add-to-sorted-list gnus-newsgroup-spam-marked | |
10006 article))) | |
8494 ((= mark gnus-dormant-mark) | 10007 ((= mark gnus-dormant-mark) |
8495 (push article gnus-newsgroup-dormant)) | 10008 (setq gnus-newsgroup-dormant |
10009 (gnus-add-to-sorted-list gnus-newsgroup-dormant article))) | |
8496 (t | 10010 (t |
8497 (push article gnus-newsgroup-unreads))) | 10011 (setq gnus-newsgroup-unreads |
10012 (gnus-add-to-sorted-list gnus-newsgroup-unreads article)))) | |
8498 (gnus-pull article gnus-newsgroup-reads) | 10013 (gnus-pull article gnus-newsgroup-reads) |
8499 t))) | 10014 t))) |
8500 | 10015 |
8501 (defalias 'gnus-summary-mark-as-unread-forward | 10016 (defalias 'gnus-summary-mark-as-unread-forward |
8502 'gnus-summary-tick-article-forward) | 10017 'gnus-summary-tick-article-forward) |
8567 (defun gnus-summary-mark-unread-as-read () | 10082 (defun gnus-summary-mark-unread-as-read () |
8568 "Intended to be used by `gnus-summary-mark-article-hook'." | 10083 "Intended to be used by `gnus-summary-mark-article-hook'." |
8569 (when (memq gnus-current-article gnus-newsgroup-unreads) | 10084 (when (memq gnus-current-article gnus-newsgroup-unreads) |
8570 (gnus-summary-mark-article gnus-current-article gnus-read-mark))) | 10085 (gnus-summary-mark-article gnus-current-article gnus-read-mark))) |
8571 | 10086 |
8572 (defun gnus-summary-mark-read-and-unread-as-read () | 10087 (defun gnus-summary-mark-read-and-unread-as-read (&optional new-mark) |
8573 "Intended to be used by `gnus-summary-mark-article-hook'." | 10088 "Intended to be used by `gnus-summary-mark-article-hook'." |
8574 (let ((mark (gnus-summary-article-mark))) | 10089 (let ((mark (gnus-summary-article-mark))) |
8575 (when (or (gnus-unread-mark-p mark) | 10090 (when (or (gnus-unread-mark-p mark) |
8576 (gnus-read-mark-p mark)) | 10091 (gnus-read-mark-p mark)) |
8577 (gnus-summary-mark-article gnus-current-article gnus-read-mark)))) | 10092 (gnus-summary-mark-article gnus-current-article |
10093 (or new-mark gnus-read-mark))))) | |
10094 | |
10095 (defun gnus-summary-mark-current-read-and-unread-as-read (&optional new-mark) | |
10096 "Intended to be used by `gnus-summary-mark-article-hook'." | |
10097 (let ((mark (gnus-summary-article-mark))) | |
10098 (when (or (gnus-unread-mark-p mark) | |
10099 (gnus-read-mark-p mark)) | |
10100 (gnus-summary-mark-article (gnus-summary-article-number) | |
10101 (or new-mark gnus-read-mark))))) | |
10102 | |
10103 (defun gnus-summary-mark-unread-as-ticked () | |
10104 "Intended to be used by `gnus-summary-mark-article-hook'." | |
10105 (when (memq gnus-current-article gnus-newsgroup-unreads) | |
10106 (gnus-summary-mark-article gnus-current-article gnus-ticked-mark))) | |
8578 | 10107 |
8579 (defun gnus-summary-mark-region-as-read (point mark all) | 10108 (defun gnus-summary-mark-region-as-read (point mark all) |
8580 "Mark all unread articles between point and mark as read. | 10109 "Mark all unread articles between point and mark as read. |
8581 If given a prefix, mark all articles between point and mark as read, | 10110 If given a prefix, mark all articles between point and mark as read, |
8582 even ticked and dormant ones." | 10111 even ticked and dormant ones." |
8647 (interactive) | 10176 (interactive) |
8648 (let ((buffer-read-only nil)) | 10177 (let ((buffer-read-only nil)) |
8649 (let ((scored gnus-newsgroup-scored) | 10178 (let ((scored gnus-newsgroup-scored) |
8650 headers h) | 10179 headers h) |
8651 (while scored | 10180 (while scored |
8652 (unless (gnus-summary-goto-subject (caar scored)) | 10181 (unless (gnus-summary-article-header (caar scored)) |
8653 (and (setq h (gnus-summary-article-header (caar scored))) | 10182 (and (setq h (gnus-number-to-header (caar scored))) |
8654 (< (cdar scored) gnus-summary-expunge-below) | 10183 (< (cdar scored) gnus-summary-expunge-below) |
8655 (push h headers))) | 10184 (push h headers))) |
8656 (setq scored (cdr scored))) | 10185 (setq scored (cdr scored))) |
8657 (if (not headers) | 10186 (if (not headers) |
8658 (when (not no-error) | 10187 (when (not no-error) |
8659 (error "No expunged articles hidden")) | 10188 (error "No expunged articles hidden")) |
8660 (goto-char (point-min)) | 10189 (goto-char (point-min)) |
10190 (push gnus-newsgroup-limit gnus-newsgroup-limits) | |
10191 (setq gnus-newsgroup-limit (copy-sequence gnus-newsgroup-limit)) | |
10192 (mapcar (lambda (x) (push (mail-header-number x) | |
10193 gnus-newsgroup-limit)) | |
10194 headers) | |
8661 (gnus-summary-prepare-unthreaded (nreverse headers)) | 10195 (gnus-summary-prepare-unthreaded (nreverse headers)) |
8662 (goto-char (point-min)) | 10196 (goto-char (point-min)) |
8663 (gnus-summary-position-point) | 10197 (gnus-summary-position-point) |
8664 t)))) | 10198 t)))) |
8665 | 10199 |
8666 (defun gnus-summary-catchup (&optional all quietly to-here not-mark) | 10200 (defun gnus-summary-catchup (&optional all quietly to-here not-mark reverse) |
8667 "Mark all unread articles in this newsgroup as read. | 10201 "Mark all unread articles in this newsgroup as read. |
8668 If prefix argument ALL is non-nil, ticked and dormant articles will | 10202 If prefix argument ALL is non-nil, ticked and dormant articles will |
8669 also be marked as read. | 10203 also be marked as read. |
8670 If QUIETLY is non-nil, no questions will be asked. | 10204 If QUIETLY is non-nil, no questions will be asked. |
10205 | |
8671 If TO-HERE is non-nil, it should be a point in the buffer. All | 10206 If TO-HERE is non-nil, it should be a point in the buffer. All |
8672 articles before this point will be marked as read. | 10207 articles before (after, if REVERSE is set) this point will be marked |
10208 as read. | |
10209 | |
8673 Note that this function will only catch up the unread article | 10210 Note that this function will only catch up the unread article |
8674 in the current summary buffer limitation. | 10211 in the current summary buffer limitation. |
10212 | |
8675 The number of articles marked as read is returned." | 10213 The number of articles marked as read is returned." |
8676 (interactive "P") | 10214 (interactive "P") |
8677 (prog1 | 10215 (prog1 |
8678 (save-excursion | 10216 (save-excursion |
8679 (when (or quietly | 10217 (when (or quietly |
8690 (or (not gnus-use-cache) | 10228 (or (not gnus-use-cache) |
8691 (eq gnus-use-cache 'passive))) | 10229 (eq gnus-use-cache 'passive))) |
8692 (progn | 10230 (progn |
8693 (when all | 10231 (when all |
8694 (setq gnus-newsgroup-marked nil | 10232 (setq gnus-newsgroup-marked nil |
10233 gnus-newsgroup-spam-marked nil | |
8695 gnus-newsgroup-dormant nil)) | 10234 gnus-newsgroup-dormant nil)) |
8696 (setq gnus-newsgroup-unreads gnus-newsgroup-downloadable)) | 10235 (setq gnus-newsgroup-unreads |
10236 (gnus-sorted-nunion | |
10237 (gnus-intersection gnus-newsgroup-unreads | |
10238 gnus-newsgroup-downloadable) | |
10239 gnus-newsgroup-unfetched))) | |
8697 ;; We actually mark all articles as canceled, which we | 10240 ;; We actually mark all articles as canceled, which we |
8698 ;; have to do when using auto-expiry or adaptive scoring. | 10241 ;; have to do when using auto-expiry or adaptive scoring. |
8699 (gnus-summary-show-all-threads) | 10242 (gnus-summary-show-all-threads) |
8700 (when (gnus-summary-first-subject (not all) t) | 10243 (if (and to-here reverse) |
8701 (while (and | 10244 (progn |
8702 (if to-here (< (point) to-here) t) | 10245 (goto-char to-here) |
8703 (gnus-summary-mark-article-as-read gnus-catchup-mark) | 10246 (gnus-summary-mark-current-read-and-unread-as-read |
8704 (gnus-summary-find-next (not all) nil nil t)))) | 10247 gnus-catchup-mark) |
10248 (while (gnus-summary-find-next (not all)) | |
10249 (gnus-summary-mark-article-as-read gnus-catchup-mark))) | |
10250 (when (gnus-summary-first-subject (not all)) | |
10251 (while (and | |
10252 (if to-here (< (point) to-here) t) | |
10253 (gnus-summary-mark-article-as-read gnus-catchup-mark) | |
10254 (gnus-summary-find-next (not all)))))) | |
8705 (gnus-set-mode-line 'summary)) | 10255 (gnus-set-mode-line 'summary)) |
8706 t)) | 10256 t)) |
8707 (gnus-summary-position-point))) | 10257 (gnus-summary-position-point))) |
8708 | 10258 |
8709 (defun gnus-summary-catchup-to-here (&optional all) | 10259 (defun gnus-summary-catchup-to-here (&optional all) |
8716 ;; We check that there are unread articles. | 10266 ;; We check that there are unread articles. |
8717 (when (or all (gnus-summary-find-prev)) | 10267 (when (or all (gnus-summary-find-prev)) |
8718 (gnus-summary-catchup all t beg))))) | 10268 (gnus-summary-catchup all t beg))))) |
8719 (gnus-summary-position-point)) | 10269 (gnus-summary-position-point)) |
8720 | 10270 |
10271 (defun gnus-summary-catchup-from-here (&optional all) | |
10272 "Mark all unticked articles after (and including) the current one as read. | |
10273 If ALL is non-nil, also mark ticked and dormant articles as read." | |
10274 (interactive "P") | |
10275 (save-excursion | |
10276 (gnus-save-hidden-threads | |
10277 (let ((beg (point))) | |
10278 ;; We check that there are unread articles. | |
10279 (when (or all (gnus-summary-find-next)) | |
10280 (gnus-summary-catchup all t beg nil t))))) | |
10281 (gnus-summary-position-point)) | |
10282 | |
8721 (defun gnus-summary-catchup-all (&optional quietly) | 10283 (defun gnus-summary-catchup-all (&optional quietly) |
8722 "Mark all articles in this newsgroup as read." | 10284 "Mark all articles in this newsgroup as read. |
10285 This command is dangerous. Normally, you want \\[gnus-summary-catchup] | |
10286 instead, which marks only unread articles as read." | |
8723 (interactive "P") | 10287 (interactive "P") |
8724 (gnus-summary-catchup t quietly)) | 10288 (gnus-summary-catchup t quietly)) |
8725 | 10289 |
8726 (defun gnus-summary-catchup-and-exit (&optional all quietly) | 10290 (defun gnus-summary-catchup-and-exit (&optional all quietly) |
8727 "Mark all unread articles in this group as read, then exit. | 10291 "Mark all unread articles in this group as read, then exit. |
8728 If prefix argument ALL is non-nil, all articles are marked as read." | 10292 If prefix argument ALL is non-nil, all articles are marked as read. |
10293 If QUIETLY is non-nil, no questions will be asked." | |
8729 (interactive "P") | 10294 (interactive "P") |
8730 (when (gnus-summary-catchup all quietly nil 'fast) | 10295 (when (gnus-summary-catchup all quietly nil 'fast) |
8731 ;; Select next newsgroup or exit. | 10296 ;; Select next newsgroup or exit. |
8732 (if (and (not (gnus-group-quit-config gnus-newsgroup-name)) | 10297 (if (and (not (gnus-group-quit-config gnus-newsgroup-name)) |
8733 (eq gnus-auto-select-next 'quietly)) | 10298 (eq gnus-auto-select-next 'quietly)) |
8734 (gnus-summary-next-group nil) | 10299 (gnus-summary-next-group nil) |
8735 (gnus-summary-exit)))) | 10300 (gnus-summary-exit)))) |
8736 | 10301 |
8737 (defun gnus-summary-catchup-all-and-exit (&optional quietly) | 10302 (defun gnus-summary-catchup-all-and-exit (&optional quietly) |
8738 "Mark all articles in this newsgroup as read, and then exit." | 10303 "Mark all articles in this newsgroup as read, and then exit. |
10304 This command is dangerous. Normally, you want \\[gnus-summary-catchup-and-exit] | |
10305 instead, which marks only unread articles as read." | |
8739 (interactive "P") | 10306 (interactive "P") |
8740 (gnus-summary-catchup-and-exit t quietly)) | 10307 (gnus-summary-catchup-and-exit t quietly)) |
8741 | 10308 |
8742 (defun gnus-summary-catchup-and-goto-next-group (&optional all) | 10309 (defun gnus-summary-catchup-and-goto-next-group (&optional all) |
8743 "Mark all articles in this group as read and select the next group. | 10310 "Mark all articles in this group as read and select the next group. |
8868 (insert " " message-id)) | 10435 (insert " " message-id)) |
8869 (insert "References: " message-id "\n")))) | 10436 (insert "References: " message-id "\n")))) |
8870 (set-buffer gnus-summary-buffer) | 10437 (set-buffer gnus-summary-buffer) |
8871 (gnus-summary-unmark-all-processable) | 10438 (gnus-summary-unmark-all-processable) |
8872 (gnus-summary-update-article current-article) | 10439 (gnus-summary-update-article current-article) |
10440 (if (gnus-summary-goto-subject (cdr gnus-article-current) nil t) | |
10441 (gnus-summary-update-secondary-mark (cdr gnus-article-current))) | |
8873 (gnus-summary-rethread-current) | 10442 (gnus-summary-rethread-current) |
8874 (gnus-message 3 "Article %d is now the child of article %d" | 10443 (gnus-message 3 "Article %d is now the child of article %d" |
8875 current-article parent-article))))) | 10444 current-article parent-article))))) |
8876 | 10445 |
8877 (defun gnus-summary-toggle-threads (&optional arg) | 10446 (defun gnus-summary-toggle-threads (&optional arg) |
8899 "Show thread subtrees. | 10468 "Show thread subtrees. |
8900 Returns nil if no thread was there to be shown." | 10469 Returns nil if no thread was there to be shown." |
8901 (interactive) | 10470 (interactive) |
8902 (let ((buffer-read-only nil) | 10471 (let ((buffer-read-only nil) |
8903 (orig (point)) | 10472 (orig (point)) |
8904 ;; first goto end then to beg, to have point at beg after let | 10473 (end (gnus-point-at-eol)) |
8905 (end (progn (end-of-line) (point))) | 10474 ;; Leave point at bol |
8906 (beg (progn (beginning-of-line) (point)))) | 10475 (beg (progn (beginning-of-line) (point)))) |
8907 (prog1 | 10476 (prog1 |
8908 ;; Any hidden lines here? | 10477 ;; Any hidden lines here? |
8909 (search-forward "\r" end t) | 10478 (search-forward "\r" end t) |
8910 (subst-char-in-region beg end ?\^M ?\n t) | 10479 (subst-char-in-region beg end ?\^M ?\n t) |
8911 (goto-char orig) | 10480 (goto-char orig) |
8912 (gnus-summary-position-point)))) | 10481 (gnus-summary-position-point)))) |
8913 | 10482 |
8914 (defun gnus-summary-hide-all-threads () | 10483 (defun gnus-summary-maybe-hide-threads () |
8915 "Hide all thread subtrees." | 10484 "If requested, hide the threads that should be hidden." |
10485 (when (and gnus-show-threads | |
10486 gnus-thread-hide-subtree) | |
10487 (gnus-summary-hide-all-threads | |
10488 (if (or (consp gnus-thread-hide-subtree) | |
10489 (functionp gnus-thread-hide-subtree)) | |
10490 (gnus-make-predicate gnus-thread-hide-subtree) | |
10491 nil)))) | |
10492 | |
10493 ;;; Hiding predicates. | |
10494 | |
10495 (defun gnus-article-unread-p (header) | |
10496 (memq (mail-header-number header) gnus-newsgroup-unreads)) | |
10497 | |
10498 (defun gnus-article-unseen-p (header) | |
10499 (memq (mail-header-number header) gnus-newsgroup-unseen)) | |
10500 | |
10501 (defun gnus-map-articles (predicate articles) | |
10502 "Map PREDICATE over ARTICLES and return non-nil if any predicate is non-nil." | |
10503 (apply 'gnus-or (mapcar predicate | |
10504 (mapcar 'gnus-summary-article-header articles)))) | |
10505 | |
10506 (defun gnus-summary-hide-all-threads (&optional predicate) | |
10507 "Hide all thread subtrees. | |
10508 If PREDICATE is supplied, threads that satisfy this predicate | |
10509 will not be hidden." | |
8916 (interactive) | 10510 (interactive) |
8917 (save-excursion | 10511 (save-excursion |
8918 (goto-char (point-min)) | 10512 (goto-char (point-min)) |
8919 (gnus-summary-hide-thread) | 10513 (let ((end nil)) |
8920 (while (zerop (gnus-summary-next-thread 1 t)) | 10514 (while (not end) |
8921 (gnus-summary-hide-thread))) | 10515 (when (or (not predicate) |
10516 (gnus-map-articles | |
10517 predicate (gnus-summary-article-children))) | |
10518 (gnus-summary-hide-thread)) | |
10519 (setq end (not (zerop (gnus-summary-next-thread 1 t))))))) | |
8922 (gnus-summary-position-point)) | 10520 (gnus-summary-position-point)) |
8923 | 10521 |
8924 (defun gnus-summary-hide-thread () | 10522 (defun gnus-summary-hide-thread () |
8925 "Hide thread subtrees. | 10523 "Hide thread subtrees. |
10524 If PREDICATE is supplied, threads that satisfy this predicate | |
10525 will not be hidden. | |
8926 Returns nil if no threads were there to be hidden." | 10526 Returns nil if no threads were there to be hidden." |
8927 (interactive) | 10527 (interactive) |
8928 (let ((buffer-read-only nil) | 10528 (let ((buffer-read-only nil) |
8929 (start (point)) | 10529 (start (point)) |
8930 (article (gnus-summary-article-number))) | 10530 (article (gnus-summary-article-number))) |
9018 (gnus-message 7 "Can't go further")) | 10618 (gnus-message 7 "Can't go further")) |
9019 n)) | 10619 n)) |
9020 | 10620 |
9021 (defun gnus-summary-up-thread (n) | 10621 (defun gnus-summary-up-thread (n) |
9022 "Go up thread N steps. | 10622 "Go up thread N steps. |
9023 If N is negative, go up instead. | 10623 If N is negative, go down instead. |
9024 Returns the difference between N and how many steps down that were | 10624 Returns the difference between N and how many steps down that were |
9025 taken." | 10625 taken." |
9026 (interactive "p") | 10626 (interactive "p") |
9027 (gnus-summary-down-thread (- n))) | 10627 (gnus-summary-down-thread (- n))) |
9028 | 10628 |
9069 "Sort the summary buffer by article number. | 10669 "Sort the summary buffer by article number. |
9070 Argument REVERSE means reverse order." | 10670 Argument REVERSE means reverse order." |
9071 (interactive "P") | 10671 (interactive "P") |
9072 (gnus-summary-sort 'number reverse)) | 10672 (gnus-summary-sort 'number reverse)) |
9073 | 10673 |
10674 (defun gnus-summary-sort-by-random (&optional reverse) | |
10675 "Randomize the order in the summary buffer. | |
10676 Argument REVERSE means to randomize in reverse order." | |
10677 (interactive "P") | |
10678 (gnus-summary-sort 'random reverse)) | |
10679 | |
9074 (defun gnus-summary-sort-by-author (&optional reverse) | 10680 (defun gnus-summary-sort-by-author (&optional reverse) |
9075 "Sort the summary buffer by author name alphabetically. | 10681 "Sort the summary buffer by author name alphabetically. |
9076 If `case-fold-search' is non-nil, case of letters is ignored. | 10682 If `case-fold-search' is non-nil, case of letters is ignored. |
9077 Argument REVERSE means reverse order." | 10683 Argument REVERSE means reverse order." |
9078 (interactive "P") | 10684 (interactive "P") |
9106 (defun gnus-summary-sort-by-chars (&optional reverse) | 10712 (defun gnus-summary-sort-by-chars (&optional reverse) |
9107 "Sort the summary buffer by article length. | 10713 "Sort the summary buffer by article length. |
9108 Argument REVERSE means reverse order." | 10714 Argument REVERSE means reverse order." |
9109 (interactive "P") | 10715 (interactive "P") |
9110 (gnus-summary-sort 'chars reverse)) | 10716 (gnus-summary-sort 'chars reverse)) |
10717 | |
10718 (defun gnus-summary-sort-by-original (&optional reverse) | |
10719 "Sort the summary buffer using the default sorting method. | |
10720 Argument REVERSE means reverse order." | |
10721 (interactive "P") | |
10722 (let* ((buffer-read-only) | |
10723 (gnus-summary-prepare-hook nil)) | |
10724 ;; We do the sorting by regenerating the threads. | |
10725 (gnus-summary-prepare) | |
10726 ;; Hide subthreads if needed. | |
10727 (gnus-summary-maybe-hide-threads))) | |
9111 | 10728 |
9112 (defun gnus-summary-sort (predicate reverse) | 10729 (defun gnus-summary-sort (predicate reverse) |
9113 "Sort summary buffer by PREDICATE. REVERSE means reverse order." | 10730 "Sort summary buffer by PREDICATE. REVERSE means reverse order." |
9114 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate))) | 10731 (let* ((thread (intern (format "gnus-thread-sort-by-%s" predicate))) |
9115 (article (intern (format "gnus-article-sort-by-%s" predicate))) | 10732 (article (intern (format "gnus-article-sort-by-%s" predicate))) |
9128 (buffer-read-only) | 10745 (buffer-read-only) |
9129 (gnus-summary-prepare-hook nil)) | 10746 (gnus-summary-prepare-hook nil)) |
9130 ;; We do the sorting by regenerating the threads. | 10747 ;; We do the sorting by regenerating the threads. |
9131 (gnus-summary-prepare) | 10748 (gnus-summary-prepare) |
9132 ;; Hide subthreads if needed. | 10749 ;; Hide subthreads if needed. |
9133 (when (and gnus-show-threads gnus-thread-hide-subtree) | 10750 (gnus-summary-maybe-hide-threads))) |
9134 (gnus-summary-hide-all-threads)))) | |
9135 | 10751 |
9136 ;; Summary saving commands. | 10752 ;; Summary saving commands. |
9137 | 10753 |
9138 (defun gnus-summary-save-article (&optional n not-saved) | 10754 (defun gnus-summary-save-article (&optional n not-saved) |
9139 "Save the current article using the default saver function. | 10755 "Save the current article using the default saver function. |
9171 (gnus-kill-buffer save-buffer) | 10787 (gnus-kill-buffer save-buffer) |
9172 (gnus-summary-position-point) | 10788 (gnus-summary-position-point) |
9173 (gnus-set-mode-line 'summary) | 10789 (gnus-set-mode-line 'summary) |
9174 n)) | 10790 n)) |
9175 | 10791 |
9176 (defun gnus-summary-pipe-output (&optional arg) | 10792 (defun gnus-summary-pipe-output (&optional arg headers) |
9177 "Pipe the current article to a subprocess. | 10793 "Pipe the current article to a subprocess. |
9178 If N is a positive number, pipe the N next articles. | 10794 If N is a positive number, pipe the N next articles. |
9179 If N is a negative number, pipe the N previous articles. | 10795 If N is a negative number, pipe the N previous articles. |
9180 If N is nil and any articles have been marked with the process mark, | 10796 If N is nil and any articles have been marked with the process mark, |
9181 pipe those articles instead." | 10797 pipe those articles instead. |
9182 (interactive "P") | 10798 If HEADERS (the symbolic prefix), include the headers, too." |
10799 (interactive (gnus-interactive "P\ny")) | |
9183 (require 'gnus-art) | 10800 (require 'gnus-art) |
9184 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe)) | 10801 (let ((gnus-default-article-saver 'gnus-summary-save-in-pipe) |
10802 (gnus-save-all-headers (or headers gnus-save-all-headers))) | |
9185 (gnus-summary-save-article arg t)) | 10803 (gnus-summary-save-article arg t)) |
9186 (gnus-configure-windows 'pipe)) | 10804 (let ((buffer (get-buffer "*Shell Command Output*"))) |
10805 (when (and buffer | |
10806 (not (zerop (buffer-size buffer)))) | |
10807 (gnus-configure-windows 'pipe)))) | |
9187 | 10808 |
9188 (defun gnus-summary-save-article-mail (&optional arg) | 10809 (defun gnus-summary-save-article-mail (&optional arg) |
9189 "Append the current article to an mail file. | 10810 "Append the current article to an mail file. |
9190 If N is a positive number, save the N next articles. | 10811 If N is a positive number, save the N next articles. |
9191 If N is a negative number, save the N previous articles. | 10812 If N is a negative number, save the N previous articles. |
9238 (interactive "P") | 10859 (interactive "P") |
9239 (require 'gnus-art) | 10860 (require 'gnus-art) |
9240 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file)) | 10861 (let ((gnus-default-article-saver 'gnus-summary-save-body-in-file)) |
9241 (gnus-summary-save-article arg))) | 10862 (gnus-summary-save-article arg))) |
9242 | 10863 |
10864 (defun gnus-summary-muttprint (&optional arg) | |
10865 "Print the current article using Muttprint. | |
10866 If N is a positive number, save the N next articles. | |
10867 If N is a negative number, save the N previous articles. | |
10868 If N is nil and any articles have been marked with the process mark, | |
10869 save those articles instead." | |
10870 (interactive "P") | |
10871 (require 'gnus-art) | |
10872 (let ((gnus-default-article-saver 'gnus-summary-pipe-to-muttprint)) | |
10873 (gnus-summary-save-article arg t))) | |
10874 | |
9243 (defun gnus-summary-pipe-message (program) | 10875 (defun gnus-summary-pipe-message (program) |
9244 "Pipe the current article through PROGRAM." | 10876 "Pipe the current article through PROGRAM." |
9245 (interactive "sProgram: ") | 10877 (interactive "sProgram: ") |
9246 (gnus-summary-select-article) | 10878 (gnus-summary-select-article) |
9247 (let ((mail-header-separator "")) | 10879 (let ((mail-header-separator "")) |
9248 (gnus-eval-in-buffer-window gnus-article-buffer | 10880 (gnus-eval-in-buffer-window gnus-article-buffer |
9249 (save-restriction | 10881 (save-restriction |
9250 (widen) | 10882 (widen) |
9251 (let ((start (window-start)) | 10883 (let ((start (window-start)) |
9252 buffer-read-only) | 10884 buffer-read-only) |
9253 (message-pipe-buffer-body program) | 10885 (message-pipe-buffer-body program) |
9254 (set-window-start (get-buffer-window (current-buffer)) start)))))) | 10886 (set-window-start (get-buffer-window (current-buffer)) start)))))) |
9255 | 10887 |
9256 (defun gnus-get-split-value (methods) | 10888 (defun gnus-get-split-value (methods) |
9257 "Return a value based on the split METHODS." | 10889 "Return a value based on the split METHODS." |
9258 (let (split-name method result match) | 10890 (let (split-name method result match) |
9259 (when methods | 10891 (when methods |
9268 (when (cond | 10900 (when (cond |
9269 ((stringp match) | 10901 ((stringp match) |
9270 ;; Regular expression. | 10902 ;; Regular expression. |
9271 (ignore-errors | 10903 (ignore-errors |
9272 (re-search-forward match nil t))) | 10904 (re-search-forward match nil t))) |
9273 ((gnus-functionp match) | 10905 ((functionp match) |
9274 ;; Function. | 10906 ;; Function. |
9275 (save-restriction | 10907 (save-restriction |
9276 (widen) | 10908 (widen) |
9277 (setq result (funcall match gnus-newsgroup-name)))) | 10909 (setq result (funcall match gnus-newsgroup-name)))) |
9278 ((consp match) | 10910 ((consp match) |
9307 (format "these %d articles" (length articles)) | 10939 (format "these %d articles" (length articles)) |
9308 "this article"))) | 10940 "this article"))) |
9309 (to-newsgroup | 10941 (to-newsgroup |
9310 (cond | 10942 (cond |
9311 ((null split-name) | 10943 ((null split-name) |
9312 (gnus-completing-read default prom | 10944 (gnus-completing-read-with-default |
9313 gnus-active-hashtb | 10945 default prom |
9314 'gnus-valid-move-group-p | 10946 gnus-active-hashtb |
9315 nil prefix | 10947 'gnus-valid-move-group-p |
9316 'gnus-group-history)) | 10948 nil prefix |
10949 'gnus-group-history)) | |
9317 ((= 1 (length split-name)) | 10950 ((= 1 (length split-name)) |
9318 (gnus-completing-read (car split-name) prom | 10951 (gnus-completing-read-with-default |
9319 gnus-active-hashtb | 10952 (car split-name) prom |
9320 'gnus-valid-move-group-p | 10953 gnus-active-hashtb |
9321 nil nil | 10954 'gnus-valid-move-group-p |
9322 'gnus-group-history)) | 10955 nil nil |
10956 'gnus-group-history)) | |
9323 (t | 10957 (t |
9324 (gnus-completing-read nil prom | 10958 (gnus-completing-read-with-default |
9325 (mapcar (lambda (el) (list el)) | 10959 nil prom |
9326 (nreverse split-name)) | 10960 (mapcar (lambda (el) (list el)) |
9327 nil nil nil | 10961 (nreverse split-name)) |
9328 'gnus-group-history)))) | 10962 nil nil nil |
9329 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup)))) | 10963 'gnus-group-history)))) |
10964 (to-method (gnus-server-to-method (gnus-group-method to-newsgroup)))) | |
9330 (when to-newsgroup | 10965 (when to-newsgroup |
9331 (if (or (string= to-newsgroup "") | 10966 (if (or (string= to-newsgroup "") |
9332 (string= to-newsgroup prefix)) | 10967 (string= to-newsgroup prefix)) |
9333 (setq to-newsgroup default)) | 10968 (setq to-newsgroup default)) |
9334 (unless to-newsgroup | 10969 (unless to-newsgroup |
9363 (gnus-inhibit-treatment t)) | 10998 (gnus-inhibit-treatment t)) |
9364 (gnus-summary-select-article)) | 10999 (gnus-summary-select-article)) |
9365 (save-excursion | 11000 (save-excursion |
9366 (set-buffer gnus-article-buffer) | 11001 (set-buffer gnus-article-buffer) |
9367 (let ((handles (or gnus-article-mime-handles | 11002 (let ((handles (or gnus-article-mime-handles |
9368 (mm-dissect-buffer) (mm-uu-dissect)))) | 11003 (mm-dissect-buffer nil gnus-article-loose-mime) |
11004 (and gnus-article-emulate-mime | |
11005 (mm-uu-dissect))))) | |
9369 (when handles | 11006 (when handles |
9370 (gnus-summary-save-parts-1 type dir handles reverse) | 11007 (gnus-summary-save-parts-1 type dir handles reverse) |
9371 (unless gnus-article-mime-handles ;; Don't destroy this case. | 11008 (unless gnus-article-mime-handles ;; Don't destroy this case. |
9372 (mm-destroy-parts handles))))))) | 11009 (mm-destroy-parts handles))))))) |
9373 | 11010 |
9377 (cdr handle)) | 11014 (cdr handle)) |
9378 (when (if reverse | 11015 (when (if reverse |
9379 (not (string-match type (mm-handle-media-type handle))) | 11016 (not (string-match type (mm-handle-media-type handle))) |
9380 (string-match type (mm-handle-media-type handle))) | 11017 (string-match type (mm-handle-media-type handle))) |
9381 (let ((file (expand-file-name | 11018 (let ((file (expand-file-name |
9382 (file-name-nondirectory | 11019 (gnus-map-function |
9383 (or | 11020 mm-file-name-rewrite-functions |
9384 (mail-content-type-get | 11021 (file-name-nondirectory |
9385 (mm-handle-disposition handle) 'filename) | 11022 (or |
9386 (concat gnus-newsgroup-name | 11023 (mail-content-type-get |
9387 "." (number-to-string | 11024 (mm-handle-disposition handle) 'filename) |
9388 (cdr gnus-article-current))))) | 11025 (mail-content-type-get |
11026 (mm-handle-type handle) 'name) | |
11027 (concat gnus-newsgroup-name | |
11028 "." (number-to-string | |
11029 (cdr gnus-article-current)))))) | |
9389 dir))) | 11030 dir))) |
9390 (unless (file-exists-p file) | 11031 (unless (file-exists-p file) |
9391 (mm-save-part-to-file handle file)))))) | 11032 (mm-save-part-to-file handle file)))))) |
9392 | 11033 |
9393 ;; Summary extract commands | 11034 ;; Summary extract commands |
9450 b (1- e) (list 'gnus-number gnus-reffed-article-number | 11091 b (1- e) (list 'gnus-number gnus-reffed-article-number |
9451 gnus-mouse-face-prop gnus-mouse-face)) | 11092 gnus-mouse-face-prop gnus-mouse-face)) |
9452 (gnus-data-enter | 11093 (gnus-data-enter |
9453 after-article gnus-reffed-article-number | 11094 after-article gnus-reffed-article-number |
9454 gnus-unread-mark b (car pslist) 0 (- e b)) | 11095 gnus-unread-mark b (car pslist) 0 (- e b)) |
9455 (push gnus-reffed-article-number gnus-newsgroup-unreads) | 11096 (setq gnus-newsgroup-unreads |
11097 (gnus-add-to-sorted-list gnus-newsgroup-unreads | |
11098 gnus-reffed-article-number)) | |
9456 (setq gnus-reffed-article-number (1- gnus-reffed-article-number)) | 11099 (setq gnus-reffed-article-number (1- gnus-reffed-article-number)) |
9457 (setq pslist (cdr pslist))))))) | 11100 (setq pslist (cdr pslist))))))) |
9458 | 11101 |
9459 (defun gnus-pseudos< (p1 p2) | 11102 (defun gnus-pseudos< (p1 p2) |
9460 (let ((c1 (cdr (assq 'action p1))) | 11103 (let ((c1 (cdr (assq 'action p1))) |
9516 (setq header (or header (gnus-summary-article-header id)))) | 11159 (setq header (or header (gnus-summary-article-header id)))) |
9517 (if (and header | 11160 (if (and header |
9518 (not (gnus-summary-article-sparse-p (mail-header-number header)))) | 11161 (not (gnus-summary-article-sparse-p (mail-header-number header)))) |
9519 ;; We have found the header. | 11162 ;; We have found the header. |
9520 header | 11163 header |
9521 ;; If this is a sparse article, we have to nix out its | |
9522 ;; previous entry in the thread hashtb. | |
9523 (when (and header | |
9524 (gnus-summary-article-sparse-p (mail-header-number header))) | |
9525 (let* ((parent (gnus-parent-id (mail-header-references header))) | |
9526 (thread (and parent (gnus-id-to-thread parent)))) | |
9527 (when thread | |
9528 (delq (assq header thread) thread)))) | |
9529 ;; We have to really fetch the header to this article. | 11164 ;; We have to really fetch the header to this article. |
9530 (save-excursion | 11165 (save-excursion |
9531 (set-buffer nntp-server-buffer) | 11166 (set-buffer nntp-server-buffer) |
9532 (when (setq where (gnus-request-head id group)) | 11167 (when (setq where (gnus-request-head id group)) |
9533 (nnheader-fold-continuation-lines) | 11168 (nnheader-fold-continuation-lines) |
9581 (defun gnus-highlight-selected-summary () | 11216 (defun gnus-highlight-selected-summary () |
9582 "Highlight selected article in summary buffer." | 11217 "Highlight selected article in summary buffer." |
9583 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. | 11218 ;; Added by Per Abrahamsen <amanda@iesd.auc.dk>. |
9584 (when gnus-summary-selected-face | 11219 (when gnus-summary-selected-face |
9585 (save-excursion | 11220 (save-excursion |
9586 (let* ((beg (progn (beginning-of-line) (point))) | 11221 (let* ((beg (gnus-point-at-bol)) |
9587 (end (progn (end-of-line) (point))) | 11222 (end (gnus-point-at-eol)) |
9588 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>. | 11223 ;; Fix by Mike Dugan <dugan@bucrf16.bu.edu>. |
9589 (from (if (get-text-property beg gnus-mouse-face-prop) | 11224 (from (if (get-text-property beg gnus-mouse-face-prop) |
9590 beg | 11225 beg |
9591 (or (next-single-property-change | 11226 (or (next-single-property-change |
9592 beg gnus-mouse-face-prop nil end) | 11227 beg gnus-mouse-face-prop nil end) |
9609 ;; Create new overlay. | 11244 ;; Create new overlay. |
9610 (gnus-overlay-put | 11245 (gnus-overlay-put |
9611 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to)) | 11246 (setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to)) |
9612 'face gnus-summary-selected-face)))))) | 11247 'face gnus-summary-selected-face)))))) |
9613 | 11248 |
9614 ;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>. | 11249 (defvar gnus-summary-highlight-line-cached nil) |
11250 (defvar gnus-summary-highlight-line-trigger nil) | |
11251 | |
11252 (defun gnus-summary-highlight-line-0 () | |
11253 (if (and (eq gnus-summary-highlight-line-trigger | |
11254 gnus-summary-highlight) | |
11255 gnus-summary-highlight-line-cached) | |
11256 gnus-summary-highlight-line-cached | |
11257 (setq gnus-summary-highlight-line-trigger gnus-summary-highlight | |
11258 gnus-summary-highlight-line-cached | |
11259 (let* ((cond (list 'cond)) | |
11260 (c cond) | |
11261 (list gnus-summary-highlight)) | |
11262 (while list | |
11263 (setcdr c (cons (list (caar list) (list 'quote (cdar list))) | |
11264 nil)) | |
11265 (setq c (cdr c) | |
11266 list (cdr list))) | |
11267 (gnus-byte-compile (list 'lambda nil cond)))))) | |
11268 | |
9615 (defun gnus-summary-highlight-line () | 11269 (defun gnus-summary-highlight-line () |
9616 "Highlight current line according to `gnus-summary-highlight'." | 11270 "Highlight current line according to `gnus-summary-highlight'." |
9617 (let* ((list gnus-summary-highlight) | 11271 (let* ((beg (gnus-point-at-bol)) |
9618 (p (point)) | 11272 (article (or (gnus-summary-article-number) gnus-current-article)) |
9619 (end (progn (end-of-line) (point))) | 11273 (score (or (cdr (assq article |
9620 ;; now find out where the line starts and leave point there. | |
9621 (beg (progn (beginning-of-line) (point))) | |
9622 (article (gnus-summary-article-number)) | |
9623 (score (or (cdr (assq (or article gnus-current-article) | |
9624 gnus-newsgroup-scored)) | 11274 gnus-newsgroup-scored)) |
9625 gnus-summary-default-score 0)) | 11275 gnus-summary-default-score 0)) |
9626 (mark (or (gnus-summary-article-mark) gnus-unread-mark)) | 11276 (mark (or (gnus-summary-article-mark) gnus-unread-mark)) |
9627 (inhibit-read-only t)) | 11277 (inhibit-read-only t) |
9628 ;; Eval the cars of the lists until we find a match. | 11278 (default gnus-summary-default-score) |
9629 (let ((default gnus-summary-default-score)) | 11279 (default-high gnus-summary-default-high-score) |
9630 (while (and list | 11280 (default-low gnus-summary-default-low-score) |
9631 (not (eval (caar list)))) | 11281 (uncached (and gnus-summary-use-undownloaded-faces |
9632 (setq list (cdr list)))) | 11282 (memq article gnus-newsgroup-undownloaded)))) |
9633 (let ((face (cdar list))) | 11283 (let ((face (funcall (gnus-summary-highlight-line-0)))) |
9634 (unless (eq face (get-text-property beg 'face)) | 11284 (unless (eq face (get-text-property beg 'face)) |
9635 (gnus-put-text-property-excluding-characters-with-faces | 11285 (gnus-put-text-property-excluding-characters-with-faces |
9636 beg end 'face | 11286 beg (gnus-point-at-eol) 'face |
9637 (setq face (if (boundp face) (symbol-value face) face))) | 11287 (setq face (if (boundp face) (symbol-value face) face))) |
9638 (when gnus-summary-highlight-line-function | 11288 (when gnus-summary-highlight-line-function |
9639 (funcall gnus-summary-highlight-line-function article face)))) | 11289 (funcall gnus-summary-highlight-line-function article face)))))) |
9640 (goto-char p))) | |
9641 | 11290 |
9642 (defun gnus-update-read-articles (group unread &optional compute) | 11291 (defun gnus-update-read-articles (group unread &optional compute) |
9643 "Update the list of read articles in GROUP." | 11292 "Update the list of read articles in GROUP. |
11293 UNREAD is a sorted list." | |
9644 (let* ((active (or gnus-newsgroup-active (gnus-active group))) | 11294 (let* ((active (or gnus-newsgroup-active (gnus-active group))) |
9645 (entry (gnus-gethash group gnus-newsrc-hashtb)) | 11295 (entry (gnus-gethash group gnus-newsrc-hashtb)) |
9646 (info (nth 2 entry)) | 11296 (info (nth 2 entry)) |
9647 (prev 1) | 11297 (prev 1) |
9648 (unread (sort (copy-sequence unread) '<)) | |
9649 read) | 11298 read) |
9650 (if (or (not info) (not active)) | 11299 (if (or (not info) (not active)) |
9651 ;; There is no info on this group if it was, in fact, | 11300 ;; There is no info on this group if it was, in fact, |
9652 ;; killed. Gnus stores no information on killed groups, so | 11301 ;; killed. Gnus stores no information on killed groups, so |
9653 ;; there's nothing to be done. | 11302 ;; there's nothing to be done. |
9707 (gnus-get-unread-articles-in-group info (gnus-active group)) | 11356 (gnus-get-unread-articles-in-group info (gnus-active group)) |
9708 t)))) | 11357 t)))) |
9709 | 11358 |
9710 (defun gnus-offer-save-summaries () | 11359 (defun gnus-offer-save-summaries () |
9711 "Offer to save all active summary buffers." | 11360 "Offer to save all active summary buffers." |
9712 (save-excursion | 11361 (let (buffers) |
9713 (let ((buflist (buffer-list)) | 11362 ;; Go through all buffers and find all summaries. |
9714 buffers bufname) | 11363 (dolist (buffer (buffer-list)) |
9715 ;; Go through all buffers and find all summaries. | 11364 (when (and (setq buffer (buffer-name buffer)) |
9716 (while buflist | 11365 (string-match "Summary" buffer) |
9717 (and (setq bufname (buffer-name (car buflist))) | 11366 (save-excursion |
9718 (string-match "Summary" bufname) | 11367 (set-buffer buffer) |
9719 (save-excursion | 11368 ;; We check that this is, indeed, a summary buffer. |
9720 (set-buffer bufname) | 11369 (and (eq major-mode 'gnus-summary-mode) |
9721 ;; We check that this is, indeed, a summary buffer. | 11370 ;; Also make sure this isn't bogus. |
9722 (and (eq major-mode 'gnus-summary-mode) | 11371 gnus-newsgroup-prepared |
9723 ;; Also make sure this isn't bogus. | 11372 ;; Also make sure that this isn't a |
9724 gnus-newsgroup-prepared | 11373 ;; dead summary buffer. |
9725 ;; Also make sure that this isn't a dead summary buffer. | 11374 (not gnus-dead-summary-mode)))) |
9726 (not gnus-dead-summary-mode))) | 11375 (push buffer buffers))) |
9727 (push bufname buffers)) | 11376 ;; Go through all these summary buffers and offer to save them. |
9728 (setq buflist (cdr buflist))) | 11377 (when buffers |
9729 ;; Go through all these summary buffers and offer to save them. | 11378 (save-excursion |
9730 (when buffers | |
9731 (map-y-or-n-p | 11379 (map-y-or-n-p |
9732 "Update summary buffer %s? " | 11380 "Update summary buffer %s? " |
9733 (lambda (buf) | 11381 (lambda (buf) |
9734 (switch-to-buffer buf) | 11382 (switch-to-buffer buf) |
9735 (gnus-summary-exit)) | 11383 (gnus-summary-exit)) |
9736 buffers))))) | 11384 buffers))))) |
9737 | 11385 |
9738 (defun gnus-summary-setup-default-charset () | 11386 (defun gnus-summary-setup-default-charset () |
9739 "Setup newsgroup default charset." | 11387 "Setup newsgroup default charset." |
9740 (if (equal gnus-newsgroup-name "nndraft:drafts") | 11388 (if (member gnus-newsgroup-name '("nndraft:delayed" "nndraft:drafts")) |
9741 (setq gnus-newsgroup-charset nil) | 11389 (setq gnus-newsgroup-charset nil) |
9742 (let* ((name (and gnus-newsgroup-name | 11390 (let* ((ignored-charsets |
9743 (gnus-group-real-name gnus-newsgroup-name))) | |
9744 (ignored-charsets | |
9745 (or gnus-newsgroup-ephemeral-ignored-charsets | 11391 (or gnus-newsgroup-ephemeral-ignored-charsets |
9746 (append | 11392 (append |
9747 (and gnus-newsgroup-name | 11393 (and gnus-newsgroup-name |
9748 (or (gnus-group-find-parameter gnus-newsgroup-name | 11394 (gnus-parameter-ignored-charsets gnus-newsgroup-name)) |
9749 'ignored-charsets t) | |
9750 (let ((alist gnus-group-ignored-charsets-alist) | |
9751 elem (charsets nil)) | |
9752 (while (setq elem (pop alist)) | |
9753 (when (and name | |
9754 (string-match (car elem) name)) | |
9755 (setq alist nil | |
9756 charsets (cdr elem)))) | |
9757 charsets))) | |
9758 gnus-newsgroup-ignored-charsets)))) | 11395 gnus-newsgroup-ignored-charsets)))) |
9759 (setq gnus-newsgroup-charset | 11396 (setq gnus-newsgroup-charset |
9760 (or gnus-newsgroup-ephemeral-charset | 11397 (or gnus-newsgroup-ephemeral-charset |
9761 (and gnus-newsgroup-name | 11398 (and gnus-newsgroup-name |
9762 (or (gnus-group-find-parameter gnus-newsgroup-name 'charset) | 11399 (gnus-parameter-charset gnus-newsgroup-name)) |
9763 (let ((alist gnus-group-charset-alist) | |
9764 elem charset) | |
9765 (while (setq elem (pop alist)) | |
9766 (when (and name | |
9767 (string-match (car elem) name)) | |
9768 (setq alist nil | |
9769 charset (cadr elem)))) | |
9770 charset))) | |
9771 gnus-default-charset)) | 11400 gnus-default-charset)) |
9772 (set (make-local-variable 'gnus-newsgroup-ignored-charsets) | 11401 (set (make-local-variable 'gnus-newsgroup-ignored-charsets) |
9773 ignored-charsets)))) | 11402 ignored-charsets)))) |
9774 | 11403 |
9775 ;;; | 11404 ;;; |
9789 (defun gnus-summary-repair-multipart (article) | 11418 (defun gnus-summary-repair-multipart (article) |
9790 "Add a Content-Type header to a multipart article without one." | 11419 "Add a Content-Type header to a multipart article without one." |
9791 (interactive (list (gnus-summary-article-number))) | 11420 (interactive (list (gnus-summary-article-number))) |
9792 (gnus-with-article article | 11421 (gnus-with-article article |
9793 (message-narrow-to-head) | 11422 (message-narrow-to-head) |
11423 (message-remove-header "Mime-Version") | |
9794 (goto-char (point-max)) | 11424 (goto-char (point-max)) |
11425 (insert "Mime-Version: 1.0\n") | |
9795 (widen) | 11426 (widen) |
9796 (when (search-forward "\n--" nil t) | 11427 (when (search-forward "\n--" nil t) |
9797 (let ((separator (buffer-substring (point) (gnus-point-at-eol)))) | 11428 (let ((separator (buffer-substring (point) (gnus-point-at-eol)))) |
9798 (message-narrow-to-head) | 11429 (message-narrow-to-head) |
9799 (message-remove-header "Mime-Version") | |
9800 (message-remove-header "Content-Type") | 11430 (message-remove-header "Content-Type") |
9801 (goto-char (point-max)) | 11431 (goto-char (point-max)) |
9802 (insert (format "Content-Type: multipart/mixed; boundary=\"%s\"\n" | 11432 (insert (format "Content-Type: multipart/mixed; boundary=\"%s\"\n" |
9803 separator)) | 11433 separator)) |
9804 (insert "Mime-Version: 1.0\n") | |
9805 (widen)))) | 11434 (widen)))) |
9806 (let (gnus-mark-article-hook) | 11435 (let (gnus-mark-article-hook) |
9807 (gnus-summary-select-article t t nil article))) | 11436 (gnus-summary-select-article t t nil article))) |
9808 | 11437 |
9809 (defun gnus-summary-toggle-display-buttonized () | 11438 (defun gnus-summary-toggle-display-buttonized () |
9890 (gnus-summary-recenter) | 11519 (gnus-summary-recenter) |
9891 (gnus-summary-position-point) | 11520 (gnus-summary-position-point) |
9892 (gnus-set-mode-line 'summary) | 11521 (gnus-set-mode-line 'summary) |
9893 n)) | 11522 n)) |
9894 | 11523 |
11524 (defun gnus-summary-insert-articles (articles) | |
11525 (when (setq articles | |
11526 (gnus-sorted-difference articles | |
11527 (mapcar (lambda (h) | |
11528 (mail-header-number h)) | |
11529 gnus-newsgroup-headers))) | |
11530 (setq gnus-newsgroup-headers | |
11531 (gnus-merge 'list | |
11532 gnus-newsgroup-headers | |
11533 (gnus-fetch-headers articles) | |
11534 'gnus-article-sort-by-number)) | |
11535 ;; Suppress duplicates? | |
11536 (when gnus-suppress-duplicates | |
11537 (gnus-dup-suppress-articles)) | |
11538 | |
11539 ;; We might want to build some more threads first. | |
11540 (when (and gnus-fetch-old-headers | |
11541 (eq gnus-headers-retrieved-by 'nov)) | |
11542 (if (eq gnus-fetch-old-headers 'invisible) | |
11543 (gnus-build-all-threads) | |
11544 (gnus-build-old-threads))) | |
11545 ;; Let the Gnus agent mark articles as read. | |
11546 (when gnus-agent | |
11547 (gnus-agent-get-undownloaded-list)) | |
11548 ;; Remove list identifiers from subject | |
11549 (when gnus-list-identifiers | |
11550 (gnus-summary-remove-list-identifiers)) | |
11551 ;; First and last article in this newsgroup. | |
11552 (when gnus-newsgroup-headers | |
11553 (setq gnus-newsgroup-begin | |
11554 (mail-header-number (car gnus-newsgroup-headers)) | |
11555 gnus-newsgroup-end | |
11556 (mail-header-number | |
11557 (gnus-last-element gnus-newsgroup-headers)))) | |
11558 (when gnus-use-scoring | |
11559 (gnus-possibly-score-headers)))) | |
11560 | |
11561 (defun gnus-summary-insert-old-articles (&optional all) | |
11562 "Insert all old articles in this group. | |
11563 If ALL is non-nil, already read articles become readable. | |
11564 If ALL is a number, fetch this number of articles." | |
11565 (interactive "P") | |
11566 (prog1 | |
11567 (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<)) | |
11568 older len) | |
11569 (setq older | |
11570 ;; Some nntp servers lie about their active range. When | |
11571 ;; this happens, the active range can be in the millions. | |
11572 ;; Use a compressed range to avoid creating a huge list. | |
11573 (gnus-range-difference (list gnus-newsgroup-active) old)) | |
11574 (setq len (gnus-range-length older)) | |
11575 (cond | |
11576 ((null older) nil) | |
11577 ((numberp all) | |
11578 (if (< all len) | |
11579 (let ((older-range (nreverse older))) | |
11580 (setq older nil) | |
11581 | |
11582 (while (> all 0) | |
11583 (let* ((r (pop older-range)) | |
11584 (min (if (numberp r) r (car r))) | |
11585 (max (if (numberp r) r (cdr r)))) | |
11586 (while (and (<= min max) | |
11587 (> all 0)) | |
11588 (push max older) | |
11589 (setq all (1- all) | |
11590 max (1- max)))))) | |
11591 (setq older (gnus-uncompress-range older)))) | |
11592 (all | |
11593 (setq older (gnus-uncompress-range older))) | |
11594 (t | |
11595 (when (and (numberp gnus-large-newsgroup) | |
11596 (> len gnus-large-newsgroup)) | |
11597 (let* ((cursor-in-echo-area nil) | |
11598 (initial (gnus-parameter-large-newsgroup-initial | |
11599 gnus-newsgroup-name)) | |
11600 (input | |
11601 (read-string | |
11602 (format | |
11603 "How many articles from %s (%s %d): " | |
11604 (gnus-limit-string | |
11605 (gnus-group-decoded-name gnus-newsgroup-name) 35) | |
11606 (if initial "max" "default") | |
11607 len) | |
11608 (if initial | |
11609 (cons (number-to-string initial) | |
11610 0))))) | |
11611 (unless (string-match "^[ \t]*$" input) | |
11612 (setq all (string-to-number input)) | |
11613 (if (< all len) | |
11614 (let ((older-range (nreverse older))) | |
11615 (setq older nil) | |
11616 | |
11617 (while (> all 0) | |
11618 (let* ((r (pop older-range)) | |
11619 (min (if (numberp r) r (car r))) | |
11620 (max (if (numberp r) r (cdr r)))) | |
11621 (while (and (<= min max) | |
11622 (> all 0)) | |
11623 (push max older) | |
11624 (setq all (1- all) | |
11625 max (1- max)))))))))) | |
11626 (setq older (gnus-uncompress-range older)))) | |
11627 (if (not older) | |
11628 (message "No old news.") | |
11629 (gnus-summary-insert-articles older) | |
11630 (gnus-summary-limit (gnus-sorted-nunion old older)))) | |
11631 (gnus-summary-position-point))) | |
11632 | |
11633 (defun gnus-summary-insert-new-articles () | |
11634 "Insert all new articles in this group." | |
11635 (interactive) | |
11636 (prog1 | |
11637 (let ((old (sort (mapcar 'car gnus-newsgroup-data) '<)) | |
11638 (old-active gnus-newsgroup-active) | |
11639 (nnmail-fetched-sources (list t)) | |
11640 i new) | |
11641 (setq gnus-newsgroup-active | |
11642 (gnus-activate-group gnus-newsgroup-name 'scan)) | |
11643 (setq i (cdr gnus-newsgroup-active)) | |
11644 (while (> i (cdr old-active)) | |
11645 (push i new) | |
11646 (decf i)) | |
11647 (if (not new) | |
11648 (message "No gnus is bad news.") | |
11649 (gnus-summary-insert-articles new) | |
11650 (setq gnus-newsgroup-unreads | |
11651 (gnus-sorted-nunion gnus-newsgroup-unreads new)) | |
11652 (gnus-summary-limit (gnus-sorted-nunion old new)))) | |
11653 (gnus-summary-position-point))) | |
11654 | |
9895 (gnus-summary-make-all-marking-commands) | 11655 (gnus-summary-make-all-marking-commands) |
9896 | 11656 |
9897 (gnus-ems-redefine) | 11657 (gnus-ems-redefine) |
9898 | 11658 |
9899 (provide 'gnus-sum) | 11659 (provide 'gnus-sum) |
9900 | 11660 |
9901 (run-hooks 'gnus-sum-load-hook) | 11661 (run-hooks 'gnus-sum-load-hook) |
11662 | |
11663 ;; Local Variables: | |
11664 ;; coding: iso-8859-1 | |
11665 ;; End: | |
9902 | 11666 |
9903 ;;; arch-tag: 17c6748f-6d00-4d36-bf01-835c42f31235 | 11667 ;;; arch-tag: 17c6748f-6d00-4d36-bf01-835c42f31235 |
9904 ;;; gnus-sum.el ends here | 11668 ;;; gnus-sum.el ends here |