Mercurial > emacs
annotate lisp/mh-e/mh-inc.el @ 107660:e6a6d8c247e4
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Wed, 24 Mar 2010 06:29:13 +0000 |
parents | 1d1d5d9bd884 |
children | 376148b31b5e |
rev | line source |
---|---|
67760
9c3504ae6060
Follow MH-E Developers Guide conventions. Use `' quotes for Help
Bill Wohler <wohler@newt.com>
parents:
67681
diff
changeset
|
1 ;;; mh-inc.el --- MH-E "inc" and separate mail spool handling |
68465 | 2 |
106815 | 3 ;; Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010 |
101474
f38094af65e7
Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents:
100908
diff
changeset
|
4 ;; Free Software Foundation, Inc. |
50702 | 5 |
6 ;; Author: Peter S. Galbraith <psg@debian.org> | |
7 ;; Maintainer: Bill Wohler <wohler@newt.com> | |
8 ;; Keywords: mail | |
9 ;; See: mh-e.el | |
10 | |
11 ;; This file is part of GNU Emacs. | |
12 | |
94663
90c9ebd43589
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79713
diff
changeset
|
13 ;; GNU Emacs is free software: you can redistribute it and/or modify |
50702 | 14 ;; 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
|
15 ;; 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
|
16 ;; (at your option) any later version. |
50702 | 17 |
18 ;; GNU Emacs is distributed in the hope that it will be useful, | |
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 ;; GNU General Public License for more details. | |
22 | |
23 ;; 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
|
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
50702 | 25 |
26 ;;; Commentary: | |
27 | |
68465 | 28 ;; Support for inc. In addition to reading from the system mailbox, |
29 ;; inc can also be used to incorporate mail from multiple spool files | |
30 ;; into separate folders. See "C-h v mh-inc-spool-list". | |
50702 | 31 |
32 ;;; Change Log: | |
33 | |
34 ;;; Code: | |
35 | |
68465 | 36 (require 'mh-e) |
56673
e9a6cbc8ca5e
Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents:
52401
diff
changeset
|
37 (mh-require-cl) |
50702 | 38 |
39 (defvar mh-inc-spool-map-help nil | |
68465 | 40 "Help text for `mh-inc-spool-map'.") |
50702 | 41 |
42 (define-key mh-inc-spool-map "?" | |
43 '(lambda () | |
44 (interactive) | |
45 (if mh-inc-spool-map-help | |
68465 | 46 (mh-help mh-inc-spool-map-help) |
50702 | 47 (mh-ephem-message |
68465 | 48 "There are no keys defined yet; customize `mh-inc-spool-list'")))) |
49 | |
50 ;;;###mh-autoload | |
51 (defun mh-inc-spool-make () | |
52 "Make all commands and defines keys for contents of `mh-inc-spool-list'." | |
53 (setq mh-inc-spool-map-help nil) | |
54 (when mh-inc-spool-list | |
55 (loop for elem in mh-inc-spool-list | |
56 do (let ((spool (nth 0 elem)) | |
57 (folder (nth 1 elem)) | |
58 (key (nth 2 elem))) | |
59 (progn | |
60 (mh-inc-spool-generator folder spool) | |
61 (mh-inc-spool-def-key key folder)))))) | |
62 | |
63 (defalias 'mh-inc-spool-make-no-autoload 'mh-inc-spool-make) | |
50702 | 64 |
65 (defun mh-inc-spool-generator (folder spool) | |
66 "Create a command to inc into FOLDER from SPOOL file." | |
67 (let ((folder1 (make-symbol "folder")) | |
68 (spool1 (make-symbol "spool"))) | |
69 (set folder1 folder) | |
70 (set spool1 spool) | |
71 (setf (symbol-function (intern (concat "mh-inc-spool-" folder))) | |
72 `(lambda () | |
68465 | 73 ,(format "Inc spool file %s into folder %s." spool folder) |
50702 | 74 (interactive) |
75 (mh-inc-folder ,spool1 (concat "+" ,folder1)))))) | |
76 | |
77 (defun mh-inc-spool-def-key (key folder) | |
78 "Define a KEY in `mh-inc-spool-map' to inc FOLDER and collect help string." | |
79 (when (not (= 0 key)) | |
80 (define-key mh-inc-spool-map (format "%c" key) | |
81 (intern (concat "mh-inc-spool-" folder))) | |
68465 | 82 (add-to-list 'mh-inc-spool-map-help |
83 (concat "[" (char-to-string key) "] inc " folder " folder\n") | |
84 t))) | |
50702 | 85 |
86 (provide 'mh-inc) | |
87 | |
67681 | 88 ;; Local Variables: |
89 ;; indent-tabs-mode: nil | |
90 ;; sentence-end-double-space: nil | |
91 ;; End: | |
50702 | 92 |
67681 | 93 ;; arch-tag: 3713cf2a-6082-4cb4-8ce2-99d9acaba835 |
50702 | 94 ;;; mh-inc.el ends here |