annotate lisp/mh-e/mh-funcs.el @ 108743:4b1caf0bded6

* progmodes/grep.el (grep-read-files): Fix multi-pattern aliases. Remove "all" from grep-files-aliases. Split grep-files-aliases by whitespace, call wildcard-to-regexp on substrings and concat them with "\\|". (Bug#6114)
author Juri Linkov <juri@jurta.org>
date Fri, 21 May 2010 23:43:04 +0300
parents 1d1d5d9bd884
children 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
1 ;;; mh-funcs.el --- MH-E functions not everyone will use right away
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
2
62847
aa8c2e12ee24 Upgraded to MH-E version 7.84.
Bill Wohler <wohler@newt.com>
parents: 62465
diff changeset
3 ;; Copyright (C) 1993, 1995,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 105867
diff changeset
4 ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
101471
14078457bc80 Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents: 100908
diff changeset
5 ;; Free Software Foundation, Inc.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
6
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
7 ;; Author: Bill Wohler <wohler@newt.com>
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
8 ;; Maintainer: Bill Wohler <wohler@newt.com>
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
9 ;; Keywords: mail
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
10 ;; See: mh-e.el
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
11
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
13
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79713
diff changeset
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79713
diff changeset
16 ;; the Free Software Foundation, either version 3 of the License, or
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79713
diff changeset
17 ;; (at your option) any later version.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
18
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
22 ;; GNU General Public License for more details.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
23
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 79713
diff changeset
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
26
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
27 ;;; Commentary:
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
28
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
29 ;; Putting these functions in a separate file lets MH-E start up faster,
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
30 ;; since less Lisp code needs to be loaded all at once.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
31
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
32 ;; Please add the functions in alphabetical order. If only one or two
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
33 ;; small support routines are needed, place them with the function;
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
34 ;; otherwise, create a separate section for them.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
35
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
36 ;;; Change Log:
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
37
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
38 ;;; Code:
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
39
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
40 (require 'mh-e)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
41 (require 'mh-scan)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
42
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
43 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
44 (defun mh-burst-digest ()
67246
bce5c0d2041c * mh-comp.el (mh-letter-mode): Use mh-highlight-citation-style instead
Bill Wohler <wohler@newt.com>
parents: 66477
diff changeset
45 "Break up digest into separate messages\\<mh-folder-mode-map>.
bce5c0d2041c * mh-comp.el (mh-letter-mode): Use mh-highlight-citation-style instead
Bill Wohler <wohler@newt.com>
parents: 66477
diff changeset
46
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
47 This command uses the MH command \"burst\" to break out each
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
48 message in the digest into its own message. Using this command,
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
49 you can quickly delete unwanted messages, like this: Once the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
50 digest is split up, toggle out of MH-Folder Show mode with
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
51 \\[mh-toggle-showing] so that the scan lines fill the screen and
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
52 messages aren't displayed. Then use \\[mh-delete-msg] to quickly
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
53 delete messages that you don't want to read (based on the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
54 \"Subject:\" header field). You can also burst the digest to
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
55 reply directly to the people who posted the messages in the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
56 digest. One problem you may encounter is that the \"From:\"
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
57 header fields are preceded with a \">\" so that your reply can't
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
58 create the \"To:\" field correctly. In this case, you must
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
59 correct the \"To:\" field yourself."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
60 (interactive)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
61 (let ((digest (mh-get-msg-num t)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
62 (mh-process-or-undo-commands mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
63 (mh-set-folder-modified-p t) ; lock folder while bursting
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
64 (message "Bursting digest...")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
65 (mh-exec-cmd "burst" mh-current-folder digest "-inplace")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
66 (with-mh-folder-updating (t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
67 (beginning-of-line)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
68 (delete-region (point) (point-max)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
69 (mh-regenerate-headers (format "%d-last" digest) t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
70 (mh-goto-cur-msg)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
71 (message "Bursting digest...done")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
72
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
73 ;;;###mh-autoload
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
74 (defun mh-copy-msg (range folder)
67313
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
75 "Copy RANGE to FOLDER\\<mh-folder-mode-map>.
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
76
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
77 If you wish to copy a message to another folder, you can use this
67759
b7b75914a27d Don't need to quote parenthesis within docstrings that are no longer
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
78 command (see the \"-link\" argument to \"refile\"). Like the
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
79 command \\[mh-refile-msg], this command prompts you for the name
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
80 of the target folder and you can specify a range. Note that
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
81 unlike the command \\[mh-refile-msg], the copy takes place
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
82 immediately. The original copy remains in the current folder.
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
83
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
84 Check the documentation of `mh-interactive-range' to see how
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
85 RANGE is read in interactive use."
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
86 (interactive (list (mh-interactive-range "Copy")
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
87 (mh-prompt-for-folder "Copy to" "" t)))
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
88 (let ((msg-list (let ((result ()))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
89 (mh-iterate-on-range msg range
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
90 (mh-notate nil mh-note-copied mh-cmd-note)
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
91 (push msg result))
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
92 result)))
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
93 (mh-exec-cmd "refile" (mh-coalesce-msg-list msg-list)
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
94 "-link" "-src" mh-current-folder folder)))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
95
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
96 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
97 (defun mh-kill-folder ()
67756
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
98 "Remove folder.
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
99
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
100 Remove all of the messages (files) within the current folder, and
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
101 then remove the folder (directory) itself.
67756
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
102
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
103 Run the abnormal hook `mh-kill-folder-suppress-prompt-hooks'. The
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
104 hook functions are called with no arguments and should return a
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
105 non-nil value to suppress the normal prompt when you remove a
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
106 folder. This is useful for folders that are easily regenerated."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
107 (interactive)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
108 (if (or (run-hook-with-args-until-success
67756
7ff92ad99326 * mh-alias.el (mh-alias-reload): Sync docstrings with manual.
Bill Wohler <wohler@newt.com>
parents: 67681
diff changeset
109 'mh-kill-folder-suppress-prompt-hooks)
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
110 (yes-or-no-p (format "Remove folder %s (and all included messages)? "
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
111 mh-current-folder)))
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
112 (let ((folder mh-current-folder)
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
113 (window-config mh-previous-window-config))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
114 (mh-set-folder-modified-p t) ; lock folder to kill it
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
115 (mh-exec-cmd-daemon "rmf" 'mh-rmf-daemon folder)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
116 (when (boundp 'mh-speed-folder-map)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
117 (mh-speed-invalidate-map folder))
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
118 (mh-remove-from-sub-folders-cache folder)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
119 (mh-set-folder-modified-p nil) ; so kill-buffer doesn't complain
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
120 (if (and mh-show-buffer (get-buffer mh-show-buffer))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
121 (kill-buffer mh-show-buffer))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
122 (if (get-buffer folder)
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
123 (kill-buffer folder))
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
124 (when window-config
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
125 (set-window-configuration window-config))
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
126 (message "Folder %s removed" folder))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
127 (message "Folder not removed")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
128
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
129 (defun mh-rmf-daemon (process output)
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
130 "The rmf PROCESS puts OUTPUT in temporary buffer.
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
131 Display the results only if something went wrong."
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
132 (set-buffer (get-buffer-create mh-temp-buffer))
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
133 (insert-before-markers output)
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
134 (when (save-excursion
62847
aa8c2e12ee24 Upgraded to MH-E version 7.84.
Bill Wohler <wohler@newt.com>
parents: 62465
diff changeset
135 (goto-char (point-min))
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
136 (re-search-forward "^rmf: " (point-max) t))
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
137 (display-buffer mh-temp-buffer)))
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
138
68105
5772368fe15e * mh-funcs.el:
Bill Wohler <wohler@newt.com>
parents: 68103
diff changeset
139 ;; Shush compiler.
70027
0e0916499a15 * mh-funcs.el (view-exit-action): No need to wrap defvar with
Bill Wohler <wohler@newt.com>
parents: 69712
diff changeset
140 (defvar view-exit-action)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
141
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
142 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
143 (defun mh-list-folders ()
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
144 "List mail folders."
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
145 (interactive)
49578
b35587af8747 Upgraded to MH-E version 7.2.
Bill Wohler <wohler@newt.com>
parents: 49459
diff changeset
146 (let ((temp-buffer mh-folders-buffer))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
147 (with-output-to-temp-buffer temp-buffer
105867
00c0adbb54a9 * mh-thread.el (mh-thread-set-tables):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 101561
diff changeset
148 (with-current-buffer temp-buffer
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
149 (erase-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
150 (message "Listing folders...")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
151 (mh-exec-cmd-output "folders" t (if mh-recursive-folders-flag
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
152 "-recurse"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
153 "-norecurse"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
154 (goto-char (point-min))
68529
7daec5f4a289 * mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68465
diff changeset
155 (mh-view-mode-enter)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
156 (setq view-exit-action 'kill-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
157 (message "Listing folders...done")))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
158
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
159 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
160 (defun mh-pack-folder (range)
67313
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
161 "Pack folder\\<mh-folder-mode-map>.
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
162
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
163 This command packs the folder, removing gaps from the numbering
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
164 sequence. If you don't want to rescan the entire folder
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
165 afterward, this command will accept a RANGE. Check the
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
166 documentation of `mh-interactive-range' to see how RANGE is read
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
167 in interactive use.
67313
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
168
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
169 This command will ask if you want to process refiles or deletes
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
170 first and then either run \\[mh-execute-commands] for you or undo
101520
a1d83c2b479e mh-e.el (mh-pack-folder-hook): New variable.
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 101471
diff changeset
171 the pending refiles and deletes.
a1d83c2b479e mh-e.el (mh-pack-folder-hook): New variable.
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 101471
diff changeset
172
101561
76170411fca7 (mh-pack-folder): Fix docstring.
Bill Wohler <wohler@newt.com>
parents: 101520
diff changeset
173 The hook `mh-pack-folder-hook' is run after the folder is packed;
76170411fca7 (mh-pack-folder): Fix docstring.
Bill Wohler <wohler@newt.com>
parents: 101520
diff changeset
174 see its documentation for variables it can use."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
175 (interactive (list (if current-prefix-arg
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
176 (mh-read-range "Scan" mh-current-folder t nil t
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents: 52401
diff changeset
177 mh-interpret-number-as-range-flag)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
178 '("all"))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
179 (let ((threaded-flag (memq 'unthread mh-view-ops)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
180 (mh-pack-folder-1 range)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
181 (mh-goto-cur-msg)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
182 (when mh-index-data
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
183 (mh-index-update-maps mh-current-folder))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
184 (cond (threaded-flag (mh-toggle-threads))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
185 (mh-index-data (mh-index-insert-folder-headers))))
101520
a1d83c2b479e mh-e.el (mh-pack-folder-hook): New variable.
Stephen Gildea <gildea@stop.mail-abuse.org>
parents: 101471
diff changeset
186 (run-hooks 'mh-pack-folder-hook)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
187 (message "Packing folder...done"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
188
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
189 (defun mh-pack-folder-1 (range)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
190 "Close and pack the current folder.
67313
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
191
2ae99b10dd40 * mh-comp.el (mh-forward): Went over all uses of the word "RANGE" in
Bill Wohler <wohler@newt.com>
parents: 67246
diff changeset
192 Display RANGE after packing, or the entire folder if RANGE is nil."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
193 (mh-process-or-undo-commands mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
194 (message "Packing folder...")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
195 (mh-set-folder-modified-p t) ; lock folder while packing
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
196 (save-excursion
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
197 (mh-exec-cmd-quiet t "folder" mh-current-folder "-pack"
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
198 "-norecurse" "-fast"))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
199 (mh-reset-threads-and-narrowing)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
200 (mh-regenerate-headers range))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
201
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
202 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
203 (defun mh-page-digest ()
67246
bce5c0d2041c * mh-comp.el (mh-letter-mode): Use mh-highlight-citation-style instead
Bill Wohler <wohler@newt.com>
parents: 66477
diff changeset
204 "Display next message in digest."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
205 (interactive)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
206 (mh-in-show-buffer (mh-show-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
207 ;; Go to top of screen (in case user moved point).
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
208 (move-to-window-line 0)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
209 (let ((case-fold-search nil))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
210 ;; Search for blank line and then for From:
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
211 (or (and (search-forward "\n\n" nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
212 (re-search-forward "^From:" nil t))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
213 (error "No more messages in digest")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
214 ;; Go back to previous blank line, then forward to the first non-blank.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
215 (search-backward "\n\n" nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
216 (forward-line 2)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
217 (mh-recenter 0)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
218
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
219 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
220 (defun mh-page-digest-backwards ()
67246
bce5c0d2041c * mh-comp.el (mh-letter-mode): Use mh-highlight-citation-style instead
Bill Wohler <wohler@newt.com>
parents: 66477
diff changeset
221 "Display previous message in digest."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
222 (interactive)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
223 (mh-in-show-buffer (mh-show-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
224 ;; Go to top of screen (in case user moved point).
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
225 (move-to-window-line 0)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
226 (let ((case-fold-search nil))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
227 (beginning-of-line)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
228 (or (and (search-backward "\n\n" nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
229 (re-search-backward "^From:" nil t))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
230 (error "No previous message in digest")))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
231 ;; Go back to previous blank line, then forward to the first non-blank.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
232 (if (search-backward "\n\n" nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
233 (forward-line 2))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
234 (mh-recenter 0)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
235
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
236 ;;;###mh-autoload
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
237 (defun mh-pipe-msg (command include-header)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
238 "Pipe message through shell command COMMAND.
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
239
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
240 You are prompted for the Unix command through which you wish to
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
241 run your message. If you give a prefix argument INCLUDE-HEADER to
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
242 this command, the message header is included in the text passed
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
243 to the command."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
244 (interactive
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
245 (list (read-string "Shell command on message: ") current-prefix-arg))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
246 (let ((msg-file-to-pipe (mh-msg-filename (mh-get-msg-num t)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
247 (message-directory default-directory))
105867
00c0adbb54a9 * mh-thread.el (mh-thread-set-tables):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 101561
diff changeset
248 (with-current-buffer (get-buffer-create mh-temp-buffer)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
249 (erase-buffer)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
250 (insert-file-contents msg-file-to-pipe)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
251 (goto-char (point-min))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
252 (if (not include-header) (search-forward "\n\n"))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
253 (let ((default-directory message-directory))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
254 (shell-command-on-region (point) (point-max) command nil)))))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
255
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
256 ;;;###mh-autoload
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
257 (defun mh-sort-folder (&optional extra-args)
67988
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
258 "Sort folder.
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
259
67988
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
260 By default, messages are sorted by date. The option
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
261 `mh-sortm-args' holds extra arguments to pass on to the command
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
262 \"sortm\" when a prefix argument EXTRA-ARGS is used."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
263 (interactive "P")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
264 (mh-process-or-undo-commands mh-current-folder)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
265 (setq mh-next-direction 'forward)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
266 (mh-set-folder-modified-p t) ; lock folder while sorting
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
267 (message "Sorting folder...")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
268 (let ((threaded-flag (memq 'unthread mh-view-ops)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
269 (mh-exec-cmd "sortm" mh-current-folder (if extra-args mh-sortm-args))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
270 (when mh-index-data
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
271 (mh-index-update-maps mh-current-folder))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
272 (message "Sorting folder...done")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
273 (mh-scan-folder mh-current-folder "all")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
274 (cond (threaded-flag (mh-toggle-threads))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
275 (mh-index-data (mh-index-insert-folder-headers)))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
276
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
277 ;;;###mh-autoload
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
278 (defun mh-store-msg (directory)
67760
9c3504ae6060 Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents: 67759
diff changeset
279 "Unpack message created with \"uudecode\" or \"shar\".
67246
bce5c0d2041c * mh-comp.el (mh-letter-mode): Use mh-highlight-citation-style instead
Bill Wohler <wohler@newt.com>
parents: 66477
diff changeset
280
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
281 The default DIRECTORY for extraction is the current directory;
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
282 however, you have a chance to specify a different extraction
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
283 directory. The next time you use this command, the default
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
284 directory is the last directory you used. If you would like to
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
285 change the initial default directory, customize the option
67988
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
286 `mh-store-default-directory', change the value from \"Current\"
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
287 to \"Directory\", and then enter the name of the directory for
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
288 storing the content of these messages."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
289 (interactive (list (let ((udir (or mh-store-default-directory
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
290 default-directory)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
291 (read-file-name "Store message in directory: "
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
292 udir udir nil))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
293 (let ((msg-file-to-store (mh-msg-filename (mh-get-msg-num t))))
105867
00c0adbb54a9 * mh-thread.el (mh-thread-set-tables):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 101561
diff changeset
294 (with-current-buffer (get-buffer-create mh-temp-buffer)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
295 (erase-buffer)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
296 (insert-file-contents msg-file-to-store)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
297 (mh-store-buffer directory))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
298
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
299 (defun mh-store-buffer (directory)
67988
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
300 "Unpack buffer created with \"uudecode\" or \"shar\".
67758
6b063593fdad Follow Emacs coding conventions. Use default setting of
Bill Wohler <wohler@newt.com>
parents: 67756
diff changeset
301
67988
7882fc7df359 * mh-alias.el (mh-alias-grab-from-field): Remove leading * from
Bill Wohler <wohler@newt.com>
parents: 67760
diff changeset
302 See `mh-store-msg' for a description of DIRECTORY."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
303 (interactive (list (let ((udir (or mh-store-default-directory
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
304 default-directory)))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
305 (read-file-name "Store buffer in directory: "
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
306 udir udir nil))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
307 (let ((store-directory (expand-file-name directory))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
308 (sh-start (save-excursion
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
309 (goto-char (point-min))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
310 (if (re-search-forward
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
311 "^#![ \t]*/bin/sh\\|^#\\|^: " nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
312 (progn
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
313 ;; The "cut here" pattern was removed from above
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
314 ;; because it seemed to hurt more than help.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
315 ;; But keep this to make it easier to put it back.
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
316 (if (looking-at "^[^a-z0-9\"]*cut here\\b")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
317 (forward-line 1))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
318 (beginning-of-line)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
319 (if (looking-at "^[#:]....+\n\\( ?\n\\)?end$")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
320 nil ;most likely end of a uuencode
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
321 (point))))))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
322 (command "sh")
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
323 (uudecode-filename "(unknown filename)")
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
324 log-begin)
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
325 (if (not sh-start)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
326 (save-excursion
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
327 (goto-char (point-min))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
328 (if (re-search-forward "^begin [0-7]+ " nil t)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
329 (setq uudecode-filename
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
330 (buffer-substring (point)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
331 (progn (end-of-line) (point)))))))
105867
00c0adbb54a9 * mh-thread.el (mh-thread-set-tables):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 101561
diff changeset
332 (with-current-buffer (get-buffer-create mh-log-buffer)
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
333 (setq log-begin (mh-truncate-log-buffer))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
334 (if (not (file-directory-p store-directory))
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
335 (progn
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
336 (insert "mkdir " directory "\n")
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
337 (call-process "mkdir" nil mh-log-buffer t store-directory)))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
338 (insert "cd " directory "\n")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
339 (setq mh-store-default-directory directory)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
340 (if (not sh-start)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
341 (progn
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
342 (setq command "uudecode")
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
343 (insert uudecode-filename " being uudecoded...\n"))))
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
344 (set-window-start (display-buffer mh-log-buffer) log-begin) ;watch progress
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
345 (let ((default-directory (file-name-as-directory store-directory)))
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
346 (if (equal (call-process-region sh-start (point-max) command
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
347 nil mh-log-buffer t)
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
348 0)
105867
00c0adbb54a9 * mh-thread.el (mh-thread-set-tables):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 101561
diff changeset
349 (with-current-buffer mh-log-buffer
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
350 (insert "\n(mh-store finished)\n"))
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
351 (error "Error occurred during execution of %s" command)))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
352
50702
7dd3d5eae9c7 Upgraded to MH-E version 7.3.
Bill Wohler <wohler@newt.com>
parents: 49598
diff changeset
353 ;;;###mh-autoload
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
354 (defun mh-undo-folder ()
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
355 "Undo all refiles and deletes in the current folder."
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
356 (interactive)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
357 (cond ((or mh-do-not-confirm-flag
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
358 (yes-or-no-p "Undo all commands in folder? "))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
359 (setq mh-delete-list nil
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
360 mh-refile-list nil
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
361 mh-seq-list nil
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
362 mh-next-direction 'forward)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
363 (with-mh-folder-updating (nil)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
364 (mh-remove-all-notation)))
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
365 (t
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
366 (message "Commands not undone"))))
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
367
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
368 (provide 'mh-funcs)
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
369
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67313
diff changeset
370 ;; Local Variables:
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67313
diff changeset
371 ;; indent-tabs-mode: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67313
diff changeset
372 ;; sentence-end-double-space: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67313
diff changeset
373 ;; End:
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
374
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 67313
diff changeset
375 ;; arch-tag: 1936c4f1-4843-438e-bc4b-a63bb75a7762
49459
06b77df47802 * mh-e: Created directory. ChangeLog will appear in a week when we
Bill Wohler <wohler@newt.com>
parents:
diff changeset
376 ;;; mh-funcs.el ends here