Mercurial > emacs
annotate lisp/mail/mh-pick.el @ 49154:214790087d8f
.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Sat, 11 Jan 2003 22:49:02 +0000 |
parents | 30c4902b654d |
children |
rev | line source |
---|---|
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
1 ;;; mh-pick.el --- make a search pattern and search for a message in MH-E |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
2 |
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
3 ;; Copyright (C) 1993, 1995, 2001 Free Software Foundation, Inc. |
6365 | 4 |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
5 ;; Author: Bill Wohler <wohler@newt.com> |
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
6 ;; Maintainer: Bill Wohler <wohler@newt.com> |
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
7 ;; Keywords: mail |
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
8 ;; See: mh-e.el |
6365 | 9 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14169
diff
changeset
|
10 ;; This file is part of GNU Emacs. |
6365 | 11 |
11333 | 12 ;; GNU Emacs is free software; you can redistribute it and/or modify |
6365 | 13 ;; it under the terms of the GNU General Public License as published by |
14 ;; the Free Software Foundation; either version 2, or (at your option) | |
15 ;; any later version. | |
16 | |
11333 | 17 ;; GNU Emacs is distributed in the hope that it will be useful, |
6365 | 18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 ;; GNU General Public License for more details. | |
21 | |
22 ;; You should have received a copy of the GNU General Public License | |
14169 | 23 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
25 ;; Boston, MA 02111-1307, USA. | |
6365 | 26 |
27 ;;; Commentary: | |
28 | |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
29 ;; Internal support for MH-E package. |
6365 | 30 |
11332 | 31 ;;; Change Log: |
32 | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
33 ;; $Id: mh-pick.el,v 1.25 2002/12/04 18:51:50 wohler Exp $ |
11332 | 34 |
6365 | 35 ;;; Code: |
36 | |
37 (require 'mh-e) | |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
38 (require 'easymenu) |
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
39 (require 'gnus-util) |
6365 | 40 |
11332 | 41 ;;; Internal variables: |
42 | |
43 (defvar mh-pick-mode-map (make-sparse-keymap) | |
44 "Keymap for searching folder.") | |
45 | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
46 (defvar mh-searching-folder nil) ;Folder this pick is searching. |
6365 | 47 |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
48 ;;;###mh-autoload |
6365 | 49 (defun mh-search-folder (folder) |
11332 | 50 "Search FOLDER for messages matching a pattern. |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
51 This function uses the MH command `pick' to do the work. |
11332 | 52 Add the messages found to the sequence named `search'." |
6365 | 53 (interactive (list (mh-prompt-for-folder "Search" |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
54 mh-current-folder |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
55 t))) |
6365 | 56 (switch-to-buffer-other-window "pick-pattern") |
57 (if (or (zerop (buffer-size)) | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
58 (not (y-or-n-p "Reuse pattern? "))) |
6365 | 59 (mh-make-pick-template) |
60 (message "")) | |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
61 (setq mh-searching-folder folder) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
62 (message "%s" (substitute-command-keys |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
63 (concat "Type \\[mh-do-pick-search] to search messages, " |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
64 "\\[mh-help] for help.")))) |
6365 | 65 |
66 (defun mh-make-pick-template () | |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
67 "Initialize the current buffer with a template for a pick pattern." |
6365 | 68 (erase-buffer) |
69 (insert "From: \n" | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
70 "To: \n" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
71 "Cc: \n" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
72 "Date: \n" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
73 "Subject: \n" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
74 "---------\n") |
6365 | 75 (mh-pick-mode) |
76 (goto-char (point-min)) | |
77 (end-of-line)) | |
78 | |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
79 ;;; Menu extracted from mh-menubar.el V1.1 (31 July 2001) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
80 (easy-menu-define |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
81 mh-pick-menu mh-pick-mode-map "Menu for MH-E pick-mode" |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
82 '("Pick" |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
83 ["Execute the Search" mh-do-pick-search t])) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
84 |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
85 |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
86 ;;; Help Messages |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
87 ;;; Group messages logically, more or less. |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
88 (defvar mh-pick-mode-help-messages |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
89 '((nil |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
90 "Search messages: \\[mh-do-pick-search]\n" |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
91 "Move to a field by typing C-c C-f C-<field>\n" |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
92 "where <field> is the first letter of the desired field.")) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
93 "Key binding cheat sheet. |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
94 |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
95 This is an associative array which is used to show the most common commands. |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
96 The key is a prefix char. The value is one or more strings which are |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
97 concatenated together and displayed in the minibuffer if ? is pressed after |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
98 the prefix character. The special key nil is used to display the |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
99 non-prefixed commands. |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
100 |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
101 The substitutions described in `substitute-command-keys' are performed as |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
102 well.") |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
103 |
6365 | 104 (put 'mh-pick-mode 'mode-class 'special) |
105 | |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
106 (define-derived-mode mh-pick-mode fundamental-mode "MH-Pick" |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
107 "Mode for creating search templates in MH-E.\\<mh-pick-mode-map> |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
108 |
11332 | 109 After each field name, enter the pattern to search for. If a field's |
110 value does not matter for the search, leave it empty. To search the | |
111 entire message, supply the pattern in the \"body\" of the template. | |
112 Each non-empty field must be matched for a message to be selected. | |
113 To effect a logical \"or\", use \\[mh-search-folder] multiple times. | |
6365 | 114 When you have finished, type \\[mh-do-pick-search] to do the search. |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
115 |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
116 The value of `mh-pick-mode-hook' is a list of functions to be called, |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
117 with no arguments, upon entry to this mode. |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
118 |
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
119 \\{mh-pick-mode-map}" |
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
120 |
6365 | 121 (make-local-variable 'mh-searching-folder) |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
122 (easy-menu-add mh-pick-menu) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
123 (make-local-variable 'mh-help-messages) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
124 (setq mh-help-messages mh-pick-mode-help-messages) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
125 (run-hooks 'mh-pick-mode-hook)) |
6365 | 126 |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
127 ;;;###mh-autoload |
6365 | 128 (defun mh-do-pick-search () |
129 "Find messages that match the qualifications in the current pattern buffer. | |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
130 Messages are searched for in the folder named in `mh-searching-folder'. |
11332 | 131 Add the messages found to the sequence named `search'." |
6365 | 132 (interactive) |
133 (let ((pattern-buffer (buffer-name)) | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
134 (searching-buffer mh-searching-folder) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
135 range |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
136 msgs |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
137 (pattern nil) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
138 (new-buffer nil)) |
6365 | 139 (save-excursion |
140 (cond ((get-buffer searching-buffer) | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
141 (set-buffer searching-buffer) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
142 (setq range (list (format "%d-%d" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
143 mh-first-msg-num mh-last-msg-num)))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
144 (t |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
145 (mh-make-folder searching-buffer) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
146 (setq range '("all")) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
147 (setq new-buffer t)))) |
6365 | 148 (message "Searching...") |
149 (goto-char (point-min)) | |
11332 | 150 (while (and range |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
151 (setq pattern (mh-next-pick-field pattern-buffer))) |
6365 | 152 (setq msgs (mh-seq-from-command searching-buffer |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
153 'search |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
154 (mh-list-to-string |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
155 (list "pick" pattern searching-buffer |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
156 "-list" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
157 (mh-coalesce-msg-list range))))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
158 (setq range msgs)) ;restrict the pick range for next pass |
6365 | 159 (message "Searching...done") |
160 (if new-buffer | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
161 (mh-scan-folder searching-buffer msgs) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
162 (switch-to-buffer searching-buffer)) |
11332 | 163 (mh-add-msgs-to-seq msgs 'search) |
164 (delete-other-windows))) | |
6365 | 165 |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
166 (defun mh-seq-from-command (folder seq command) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
167 "In FOLDER, make a sequence named SEQ by executing COMMAND. |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
168 COMMAND is a list. The first element is a program name |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
169 and the subsequent elements are its arguments, all strings." |
6365 | 170 (let ((msg) |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
171 (msgs ()) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
172 (case-fold-search t)) |
6365 | 173 (save-excursion |
174 (save-window-excursion | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
175 (if (eq 0 (apply 'mh-exec-cmd-quiet nil command)) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
176 ;; "pick" outputs one number per line |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
177 (while (setq msg (car (mh-read-msg-list))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
178 (setq msgs (cons msg msgs)) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
179 (forward-line 1)))) |
6365 | 180 (set-buffer folder) |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
181 (setq msgs (nreverse msgs)) ;put in ascending order |
6365 | 182 msgs))) |
183 | |
184 (defun mh-next-pick-field (buffer) | |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
185 "Return the next piece of a pick argument extracted from BUFFER. |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
186 Return a list like (\"--fieldname\" \"pattern\") or (\"-search\" \"bodypat\") |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
187 or nil if no pieces remain." |
6365 | 188 (set-buffer buffer) |
189 (let ((case-fold-search t)) | |
190 (cond ((eobp) | |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
191 nil) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
192 ((re-search-forward "^\\([a-z][^: \t\n]*\\):[ \t]*\\([a-z0-9].*\\)$" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
193 nil t) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
194 (let* ((component |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
195 (format "--%s" |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
196 (downcase (buffer-substring (match-beginning 1) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
197 (match-end 1))))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
198 (pat (buffer-substring (match-beginning 2) (match-end 2)))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
199 (forward-line 1) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
200 (list component pat))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
201 ((re-search-forward "^-*$" nil t) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
202 (forward-char 1) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
203 (let ((body (buffer-substring (point) (point-max)))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
204 (if (and (> (length body) 0) (not (equal body "\n"))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
205 (list "-search" body) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
206 nil))) |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
207 (t |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
208 nil)))) |
6365 | 209 |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
210 |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
211 |
6365 | 212 ;;; Build the pick-mode keymap: |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
213 ;;; If this changes, modify mh-pick-mode-help-messages accordingly, above. |
47730
2568d5a27317
Upgraded to mh-e version 6.1.1.
Bill Wohler <wohler@newt.com>
parents:
42206
diff
changeset
|
214 (gnus-define-keys mh-pick-mode-map |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
215 "\C-c?" mh-help |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
216 "\C-c\C-c" mh-do-pick-search |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
217 "\C-c\C-f\C-b" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
218 "\C-c\C-f\C-c" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
219 "\C-c\C-f\C-d" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
220 "\C-c\C-f\C-f" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
221 "\C-c\C-f\C-r" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
222 "\C-c\C-f\C-s" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
223 "\C-c\C-f\C-t" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
224 "\C-c\C-fb" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
225 "\C-c\C-fc" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
226 "\C-c\C-fd" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
227 "\C-c\C-ff" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
228 "\C-c\C-fr" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
229 "\C-c\C-fs" mh-to-field |
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
230 "\C-c\C-ft" mh-to-field) |
6365 | 231 |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
232 (provide 'mh-pick) |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
233 |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
234 ;;; Local Variables: |
49120
30c4902b654d
Upgraded to MH-E version 7.1.
Bill Wohler <wohler@newt.com>
parents:
48595
diff
changeset
|
235 ;;; indent-tabs-mode: nil |
48595
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
236 ;;; sentence-end-double-space: nil |
8aaba207e44b
Upgraded to MH-E version 7.0.
Bill Wohler <wohler@newt.com>
parents:
47730
diff
changeset
|
237 ;;; End: |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14169
diff
changeset
|
238 |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
14169
diff
changeset
|
239 ;;; mh-pick.el ends here |