Mercurial > emacs
comparison lisp/mh-e/mh-seq.el @ 67681:3a8785724cca
* mh-acros.el:
* mh-alias.el:
* mh-comp.el:
* mh-customize.el:
* mh-e.el:
* mh-funcs.el:
* mh-gnus.el:
* mh-identity.el:
* mh-inc.el:
* mh-index.el:
* mh-init.el:
* mh-junk.el:
* mh-mime.el:
* mh-pick.el:
* mh-print.el:
* mh-seq.el:
* mh-speed.el:
* mh-utils.el:
Follow commenting conventions. Don't use ;;; form so much, except for
headings. Precede headings with page feed. This was mostly already
done, so I made it a convention. Did not update copyright on a couple
of files since this was an insignificant change.
author | Bill Wohler <wohler@newt.com> |
---|---|
date | Mon, 19 Dec 2005 23:32:16 +0000 |
parents | 772ee2be41b9 |
children | 6b063593fdad |
comparison
equal
deleted
inserted
replaced
67680:b7c68d3426e1 | 67681:3a8785724cca |
---|---|
76 (require 'mh-e) | 76 (require 'mh-e) |
77 | 77 |
78 ;; Shush the byte-compiler | 78 ;; Shush the byte-compiler |
79 (defvar tool-bar-mode) | 79 (defvar tool-bar-mode) |
80 | 80 |
81 | |
82 | |
81 ;;; Data structures (used in message threading)... | 83 ;;; Data structures (used in message threading)... |
84 | |
82 (mh-defstruct (mh-thread-message (:conc-name mh-message-) | 85 (mh-defstruct (mh-thread-message (:conc-name mh-message-) |
83 (:constructor mh-thread-make-message)) | 86 (:constructor mh-thread-make-message)) |
84 (id nil) | 87 (id nil) |
85 (references ()) | 88 (references ()) |
86 (subject "") | 89 (subject "") |
89 (mh-defstruct (mh-thread-container (:conc-name mh-container-) | 92 (mh-defstruct (mh-thread-container (:conc-name mh-container-) |
90 (:constructor mh-thread-make-container)) | 93 (:constructor mh-thread-make-container)) |
91 message parent children | 94 message parent children |
92 (real-child-p t)) | 95 (real-child-p t)) |
93 | 96 |
97 | |
94 | 98 |
95 ;;; Internal variables: | 99 ;;; Internal variables: |
100 | |
96 (defvar mh-last-seq-used nil | 101 (defvar mh-last-seq-used nil |
97 "Name of seq to which a msg was last added.") | 102 "Name of seq to which a msg was last added.") |
98 | 103 |
99 (defvar mh-non-seq-mode-line-annotation nil | 104 (defvar mh-non-seq-mode-line-annotation nil |
100 "Saved value of `mh-mode-line-annotation' when narrowed to a seq.") | 105 "Saved value of `mh-mode-line-annotation' when narrowed to a seq.") |
101 | 106 |
107 | |
108 | |
102 ;;; Maps and hashes... | 109 ;;; Maps and hashes... |
110 | |
103 (defvar mh-thread-id-hash nil | 111 (defvar mh-thread-id-hash nil |
104 "Hashtable used to canonicalize message identifiers.") | 112 "Hashtable used to canonicalize message identifiers.") |
105 (defvar mh-thread-subject-hash nil | 113 (defvar mh-thread-subject-hash nil |
106 "Hashtable used to canonicalize subject strings.") | 114 "Hashtable used to canonicalize subject strings.") |
107 (defvar mh-thread-id-table nil | 115 (defvar mh-thread-id-table nil |
375 ((gethash msg deleted-hash) | 383 ((gethash msg deleted-hash) |
376 (mh-notate nil mh-note-deleted mh-cmd-note)))))) | 384 (mh-notate nil mh-note-deleted mh-cmd-note)))))) |
377 | 385 |
378 | 386 |
379 | 387 |
380 ;;; Commands to manipulate sequences. Sequences are stored in an alist | 388 ;;; Commands to manipulate sequences. |
381 ;;; of the form: | 389 |
382 ;;; ((seq-name msgs ...) (seq-name msgs ...) ...) | 390 ;; Sequences are stored in an alist of the form: |
391 ;; ((seq-name msgs ...) (seq-name msgs ...) ...) | |
383 | 392 |
384 (defvar mh-sequence-history ()) | 393 (defvar mh-sequence-history ()) |
385 | 394 |
386 ;;;###mh-autoload | 395 ;;;###mh-autoload |
387 (defun mh-read-seq-default (prompt not-empty) | 396 (defun mh-read-seq-default (prompt not-empty) |
410 (msgs (mh-seq-to-msgs seq))) | 419 (msgs (mh-seq-to-msgs seq))) |
411 (if (and (null msgs) not-empty) | 420 (if (and (null msgs) not-empty) |
412 (error "No messages in sequence `%s'" seq)) | 421 (error "No messages in sequence `%s'" seq)) |
413 seq)) | 422 seq)) |
414 | 423 |
424 | |
425 | |
415 ;;; Functions to read ranges with completion... | 426 ;;; Functions to read ranges with completion... |
427 | |
416 (defvar mh-range-seq-names) | 428 (defvar mh-range-seq-names) |
417 (defvar mh-range-history ()) | 429 (defvar mh-range-history ()) |
418 (defvar mh-range-completion-map (copy-keymap minibuffer-local-completion-map)) | 430 (defvar mh-range-completion-map (copy-keymap minibuffer-local-completion-map)) |
419 (define-key mh-range-completion-map " " 'self-insert-command) | 431 (define-key mh-range-completion-map " " 'self-insert-command) |
420 | 432 |
700 (default default) | 712 (default default) |
701 (t (mh-get-msg-num t)))) | 713 (t (mh-get-msg-num t)))) |
702 | 714 |
703 | 715 |
704 | 716 |
705 ;;; Commands to handle new 'subject sequence. | 717 ;;; Commands to handle new 'subject sequence ("Poor man's threading" by psg) |
706 ;;; Or "Poor man's threading" by psg. | 718 |
707 | 719 ;; XXX: The function mh-subject-to-sequence-unthreaded uses the magic number |
708 ;;; XXX: The function mh-subject-to-sequence-unthreaded uses the magic number | 720 ;; 41 for the max size of the subject part. Avoiding this would be desirable. |
709 ;;; 41 for the max size of the subject part. Avoiding this would be desirable. | |
710 (defun mh-subject-to-sequence (all) | 721 (defun mh-subject-to-sequence (all) |
711 "Put all following messages with same subject in sequence 'subject. | 722 "Put all following messages with same subject in sequence 'subject. |
712 If arg ALL is t, move to beginning of folder buffer to collect all messages. | 723 If arg ALL is t, move to beginning of folder buffer to collect all messages. |
713 If arg ALL is nil, collect only messages fron current one on forward. | 724 If arg ALL is nil, collect only messages fron current one on forward. |
714 | 725 |
967 command behaves like \\[mh-thread-delete]." | 978 command behaves like \\[mh-thread-delete]." |
968 (interactive) | 979 (interactive) |
969 (if (memq 'unthread mh-view-ops) | 980 (if (memq 'unthread mh-view-ops) |
970 (mh-thread-delete) | 981 (mh-thread-delete) |
971 (mh-delete-subject))) | 982 (mh-delete-subject))) |
983 | |
984 | |
972 | 985 |
973 ;;; Message threading: | 986 ;;; Message threading: |
974 | 987 |
975 (defmacro mh-thread-initialize-hash (var test) | 988 (defmacro mh-thread-initialize-hash (var test) |
976 "Initialize the hash table in VAR. | 989 "Initialize the hash table in VAR. |
1743 (message "No messages in %s sequence" mh-tick-seq)) | 1756 (message "No messages in %s sequence" mh-tick-seq)) |
1744 (t (mh-narrow-to-seq mh-tick-seq)))) | 1757 (t (mh-narrow-to-seq mh-tick-seq)))) |
1745 | 1758 |
1746 (provide 'mh-seq) | 1759 (provide 'mh-seq) |
1747 | 1760 |
1748 ;;; Local Variables: | 1761 ;; Local Variables: |
1749 ;;; indent-tabs-mode: nil | 1762 ;; indent-tabs-mode: nil |
1750 ;;; sentence-end-double-space: nil | 1763 ;; sentence-end-double-space: nil |
1751 ;;; End: | 1764 ;; End: |
1752 | 1765 |
1753 ;;; arch-tag: 8e952711-01a2-485b-bf21-c9e3ad4de942 | 1766 ;; arch-tag: 8e952711-01a2-485b-bf21-c9e3ad4de942 |
1754 ;;; mh-seq.el ends here | 1767 ;;; mh-seq.el ends here |