annotate lisp/mail/mh-pick.el @ 12260:5b8203bdfd6a

Removed autoload from ispell-dictionary-alist, ispell-menu-map, ispell-menu-lucid, and ispell-menu-map-needed so users can more easily modify and upgrade entries. (ispell-dictionary-alist): Once more a single variable. (ispell-required-version): Documentation changes (ispell-skip-sgml): Documentation changes (ispell-command-loop): mode-line-format now shows misspelled word. (ispell-message-text-end): Can now process postscript version 1. (ispell-message-start-skip): New variable for block skips, set up for pgp and forward blocks. (ispell-message-end-skip): New variable for block skips, set up for pgp and forward blocks. (ispell-message): Added block message skipping. (ispell-buffer-local-parsing): Added html-mode.
author Richard M. Stallman <rms@gnu.org>
date Fri, 16 Jun 1995 05:13:01 +0000
parents 53174cfc29fa
children 14442ed0da63
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; mh-pick --- make a search pattern and search for a message in mh-e
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
2 ;; Time-stamp: <94/12/22 20:34:51 gildea>
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
4 ;; Copyright (C) 1993, 1995 Free Software Foundation, Inc.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
6 ;; This file is part of GNU Emacs.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
8 ;; GNU Emacs is free software; you can redistribute it and/or modify
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; it under the terms of the GNU General Public License as published by
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; any later version.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
13 ;; GNU Emacs is distributed in the hope that it will be useful,
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; GNU General Public License for more details.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
19 ;; along with GNU Emacs; see the file COPYING. If not, write to
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;;; Commentary:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24 ;; Internal support for mh-e package.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
26 ;;; Change Log:
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
27
11333
53174cfc29fa Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 11332
diff changeset
28 ;; $Id: mh-pick.el,v 1.2 1995/04/09 22:30:17 kwzh Exp kwzh $
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
29
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;;; Code:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 (provide 'mh-pick)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 (require 'mh-e)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 (defvar mh-pick-mode-hook nil
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 "Invoked in `mh-pick-mode' on a new pattern.")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
38 ;;; Internal variables:
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
39
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
40 (defvar mh-pick-mode-map (make-sparse-keymap)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
41 "Keymap for searching folder.")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
42
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
43 (defvar mh-searching-folder nil) ;Folder this pick is searching.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 (defun mh-search-folder (folder)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
46 "Search FOLDER for messages matching a pattern.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
47 Add the messages found to the sequence named `search'."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 (interactive (list (mh-prompt-for-folder "Search"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 mh-current-folder
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 t)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 (switch-to-buffer-other-window "pick-pattern")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 (if (or (zerop (buffer-size))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 (not (y-or-n-p "Reuse pattern? ")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 (mh-make-pick-template)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 (message ""))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 (setq mh-searching-folder folder))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 (defun mh-make-pick-template ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 ;; Initialize the current buffer with a template for a pick pattern.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 (erase-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 (insert "From: \n"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 "To: \n"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 "Cc: \n"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 "Date: \n"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 "Subject: \n"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 "---------\n")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 (mh-pick-mode)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 (goto-char (point-min))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 (end-of-line))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 (put 'mh-pick-mode 'mode-class 'special)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 (defun mh-pick-mode ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 "Mode for creating search templates in mh-e.\\<mh-pick-mode-map>
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
75 After each field name, enter the pattern to search for. If a field's
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
76 value does not matter for the search, leave it empty. To search the
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
77 entire message, supply the pattern in the \"body\" of the template.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
78 Each non-empty field must be matched for a message to be selected.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
79 To effect a logical \"or\", use \\[mh-search-folder] multiple times.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 When you have finished, type \\[mh-do-pick-search] to do the search.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 \\{mh-pick-mode-map}
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 Turning on mh-pick-mode calls the value of the variable mh-pick-mode-hook
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 if that value is non-nil."
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 (kill-all-local-variables)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 (make-local-variable 'mh-searching-folder)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 (use-local-map mh-pick-mode-map)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 (setq major-mode 'mh-pick-mode)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 (mh-set-mode-name "MH-Pick")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 (run-hooks 'mh-pick-mode-hook))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 (defun mh-do-pick-search ()
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 "Find messages that match the qualifications in the current pattern buffer.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 Messages are searched for in the folder named in mh-searching-folder.
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
96 Add the messages found to the sequence named `search'."
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 (interactive)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 (let ((pattern-buffer (buffer-name))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 (searching-buffer mh-searching-folder)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
100 range
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
101 msgs
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
102 (finding-messages t)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 (pattern nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 (new-buffer nil))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 (cond ((get-buffer searching-buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 (set-buffer searching-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
108 (setq range (list (format "%d-%d"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
109 mh-first-msg-num mh-last-msg-num))))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 (mh-make-folder searching-buffer)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
112 (setq range '("all"))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 (setq new-buffer t))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
114 (message "Searching...")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 (goto-char (point-min))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
116 (while (and range
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
117 (setq pattern (mh-next-pick-field pattern-buffer)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 (setq msgs (mh-seq-from-command searching-buffer
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 'search
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
120 (mh-list-to-string
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
121 (list "pick" pattern searching-buffer
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
122 "-list"
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
123 (mh-coalesce-msg-list range)))))
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
124 (setq range msgs)) ;restrict the pick range for next pass
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 (message "Searching...done")
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 (if new-buffer
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 (mh-scan-folder searching-buffer msgs)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 (switch-to-buffer searching-buffer))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
129 (mh-add-msgs-to-seq msgs 'search)
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
130 (delete-other-windows)))
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133 (defun mh-seq-from-command (folder seq seq-command)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 ;; In FOLDER, make a sequence named SEQ by executing COMMAND.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 ;; COMMAND is a list. The first element is a program name
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 ;; and the subsequent elements are its arguments, all strings.
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137 (let ((msg)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (msgs ())
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
139 (case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
140 (save-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 (save-window-excursion
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
142 (if (eq 0 (apply 'mh-exec-cmd-quiet nil seq-command))
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
143 ;; "pick" outputs one number per line
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 (while (setq msg (car (mh-read-msg-list)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
145 (setq msgs (cons msg msgs))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 (forward-line 1))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
147 (set-buffer folder)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
148 (setq msgs (nreverse msgs)) ;put in ascending order
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 msgs)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
150
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
151
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
152 (defun mh-next-pick-field (buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
153 ;; Return the next piece of a pick argument that can be extracted from the
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
154 ;; BUFFER.
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
155 ;; Return a list like ("--fieldname" "pattern") or ("-search" "bodypat")
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
156 ;; or NIL if no pieces remain.
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 (set-buffer buffer)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
158 (let ((case-fold-search t))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
159 (cond ((eobp)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
160 nil)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
161 ((re-search-forward "^\\([a-z][^: \t\n]*\\):[ \t]*\\([a-z0-9].*\\)$" nil t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 (let* ((component
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
163 (format "--%s"
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 (downcase (buffer-substring (match-beginning 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
165 (match-end 1)))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
166 (pat (buffer-substring (match-beginning 2) (match-end 2))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 (forward-line 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 (list component pat)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 ((re-search-forward "^-*$" nil t)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 (forward-char 1)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171 (let ((body (buffer-substring (point) (point-max))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 (if (and (> (length body) 0) (not (equal body "\n")))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
173 (list "-search" body)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
174 nil)))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
175 (t
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
176 nil))))
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
177
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
178 ;;; Build the pick-mode keymap:
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
179
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
180 (define-key mh-pick-mode-map "\C-c\C-c" 'mh-do-pick-search)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
181 (define-key mh-pick-mode-map "\C-c\C-f\C-b" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182 (define-key mh-pick-mode-map "\C-c\C-f\C-c" 'mh-to-field)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
183 (define-key mh-pick-mode-map "\C-c\C-f\C-d" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184 (define-key mh-pick-mode-map "\C-c\C-f\C-f" 'mh-to-field)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
185 (define-key mh-pick-mode-map "\C-c\C-f\C-r" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
186 (define-key mh-pick-mode-map "\C-c\C-f\C-s" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
187 (define-key mh-pick-mode-map "\C-c\C-f\C-t" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
188 (define-key mh-pick-mode-map "\C-c\C-fb" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
189 (define-key mh-pick-mode-map "\C-c\C-fc" 'mh-to-field)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
190 (define-key mh-pick-mode-map "\C-c\C-fd" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191 (define-key mh-pick-mode-map "\C-c\C-ff" 'mh-to-field)
11332
c9c652970786 New version from author.
Karl Heuer <kwzh@gnu.org>
parents: 6365
diff changeset
192 (define-key mh-pick-mode-map "\C-c\C-fr" 'mh-to-field)
6365
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
193 (define-key mh-pick-mode-map "\C-c\C-fs" 'mh-to-field)
a1b8926f7ece entered into RCS
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194 (define-key mh-pick-mode-map "\C-c\C-ft" 'mh-to-field)