annotate lisp/vm/vm-minibuf.el @ 98:0d2f883870bc r20-1b1

Import from CVS: tag r20-1b1
author cvs
date Mon, 13 Aug 2007 09:13:56 +0200
parents 131b0175ea99
children 4be1180a9e89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; Minibuffer read functions for VM
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Copyright (C) 1993, 1994 Kyle E. Jones
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; the Free Software Foundation; either version 1, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (provide 'vm-minibuf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 (defun vm-minibuffer-complete-word (&optional exiting)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 (let ((opoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 trimmed-c-list c-list beg end diff word word-prefix-regexp completion)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; find the beginning and end of the word we're trying to complete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 (if (or (eobp) (memq (following-char) '(?\t ?\n ?\ )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (skip-chars-backward " \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (and (not (eobp)) (forward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (setq end (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (skip-chars-forward "^ \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (setq end (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (skip-chars-backward "^ \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (setq beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; copy the word into a string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (setq word (buffer-substring beg end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; trim the completion list down to just likely candidates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; then convert it to an alist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (setq word-prefix-regexp (concat "^" (regexp-quote word))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 trimmed-c-list (vm-delete-non-matching-strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 word-prefix-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 vm-minibuffer-completion-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 trimmed-c-list (mapcar 'list trimmed-c-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 c-list (mapcar 'list vm-minibuffer-completion-table))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; Try the word against the completion list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (and trimmed-c-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (setq completion (try-completion word trimmed-c-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; If completion is nil, figure out what prefix of the word would prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; something in the completion list... but only if the user is interested.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (if (and (null completion) vm-completion-auto-correct c-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (let ((i -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (while (null (setq completion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (try-completion (substring word 0 i) c-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (vm-decrement i))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (setq completion (substring word 0 i))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;; If completion is t, we had a perfect match already.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (if (eq completion t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (cond ((and (cdr trimmed-c-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (not (eq last-command 'vm-minibuffer-complete-word)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (and (not exiting)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (vm-minibuffer-completion-message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 "[Complete, but not unique]")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (vm-completion-auto-space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (insert " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (and (not exiting)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (vm-minibuffer-completion-message "[Sole completion]"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; Compute the difference in length between the completion and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;; word. A negative difference means no match and the magnitude
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; indicates the number of chars that need to be shaved off the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;; before a match will occur. A positive difference means a match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;; occurred and the magnitude specifies the number of new chars that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;; can be appended to the word as a completion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;; `completion' can be nil here, but the code works anyway because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;; (length nil) still equals 0!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (setq diff (- (length completion) (length word)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;; We have some completion chars. Insert them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ((> diff 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (insert (substring completion (- diff)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (if (and vm-completion-auto-space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (null (cdr trimmed-c-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (insert " ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ;; The word prefixed more than one string, but we can't complete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;; any further. Either give help or say "Ambiguous".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ((zerop diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (and (not exiting)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (if (null completion-auto-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (vm-minibuffer-completion-message "[Ambiguous]")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (vm-minibuffer-show-completions (sort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (mapcar 'car trimmed-c-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 'string-lessp)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;; The word didn't prefix anything... if vm-completion-auto-correct is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;; non-nil strip the offending characters and try again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (vm-completion-auto-correct
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (delete-char diff)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (vm-minibuffer-complete-word exiting))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;; if we're not auto-correcting and we're doing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;; multi-word, just let the user insert a space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (vm-completion-auto-space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (insert " "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;; completion utterly failed, tell the user so.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (and (not exiting)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (vm-minibuffer-completion-message "[No match]")))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (defun vm-minibuffer-complete-word-and-exit ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (vm-minibuffer-complete-word t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (exit-minibuffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (defun vm-minibuffer-completion-message (string &optional seconds)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 "Briefly display STRING to the right of the current minibuffer input.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 Optional second arg SECONDS specifies how long to keep the message visible;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 the default is 2 seconds.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 A keypress causes the immediate erasure of the STRING, and return of control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 to the calling program."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (let (omax (inhibit-quit t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (setq omax (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (insert " " string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (sit-for (or seconds 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (delete-region omax (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (defun vm-minibuffer-replace-word (word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (skip-chars-backward "^ \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (delete-region (point) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (insert word))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (defun vm-minibuffer-show-completions (list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 "Display LIST in a multi-column listing in the \" *Completions*\" buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 LIST should be a list of strings."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (set-buffer (get-buffer-create " *Completions*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (setq buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (use-local-map (make-sparse-keymap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ;; ignore vm-mutable-* here. the user shouldn't mind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ;; because when they exit the minibuffer the windows will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 ;; set right again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (display-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (insert "Possible completions are:\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (setq buffer-read-only t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (vm-show-list list 'vm-minibuffer-replace-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (list (current-local-map) minibuffer-local-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (goto-char (point-min))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (defun vm-show-list (list &optional function keymaps)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 "Display LIST in a multi-column listing in the current buffer at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 The current buffer must be displayed in some window at the time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 this function is called.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 LIST should be a list of strings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 Optional second argument FUNCTION will be called if the mouse is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 clicked on one of the strings in the current buffer. The string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 clicked upon will be passed to FUNCTION as its sole argument.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 Optional third argument KEYMAPS specifies a lists of keymaps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 where the FUNCTION should be bound to the mouse clicks. By
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 default the local keymap of the current buffer is used."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (or keymaps (setq keymaps (and (current-local-map)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (list (current-local-map)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (let ((buffer-read-only nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 tab-stops longest rows columns list-length q i w start command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 keymap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (cond ((and function keymaps (vm-mouse-support-possible-p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (setq command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (list 'lambda '(e) '(interactive "e")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (list 'let
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 '((string (vm-mouse-get-mouse-track-string e)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (list 'and 'string (list function 'string)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (while keymaps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (setq keymap (car keymaps))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (cond ((vm-mouse-xemacs-mouse-p)
54
05472e90ae02 Import from CVS: tag r19-16-pre2
cvs
parents: 36
diff changeset
184 (define-key keymap 'button1 command)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
185 (define-key keymap 'button2 command))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ((vm-mouse-fsfemacs-mouse-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (define-key keymap [down-mouse-1] 'ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (define-key keymap [drag-mouse-1] 'ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (define-key keymap [mouse-1] command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (define-key keymap [drag-mouse-2] 'ignore)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (define-key keymap [down-mouse-2] 'ignore)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
192 (define-key keymap [mouse-2] command)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (setq keymaps (cdr keymaps)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (setq w (vm-get-buffer-window (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (setq q list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 list-length 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 longest 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (while q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (setq longest (max longest (length (car q)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 list-length (1+ list-length)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 q (cdr q)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ;; provide for separation between columns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (setq longest (+ 3 longest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (setq columns (max 1 (/ (- (window-width w) 2) longest))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 rows (/ list-length columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 rows
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (+ (if (zerop (% list-length columns)) 0 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 rows))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (setq i columns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 tab-stops nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (while (not (zerop i))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (setq tab-stops (cons (* longest i) tab-stops)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 i (1- i)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (setq q list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 i 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (while q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (setq start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (insert (car q))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (and function (vm-mouse-set-mouse-track-highlight start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (setq i (1+ i)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 q (cdr q))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (if (zerop (% i columns))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (let ((tab-stop-list tab-stops))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (tab-to-tab-stop)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (defun vm-minibuffer-completion-help ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (let ((opoint (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 c-list beg end word word-prefix-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 ;; find the beginning and end of the word we're trying to complete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (if (or (eobp) (memq (following-char) '(?\t ?\n ?\ )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (skip-chars-backward " \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (and (not (eobp)) (forward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (setq end (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (skip-chars-forward "^ \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (setq end (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (skip-chars-backward "^ \t\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (setq beg (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (goto-char opoint)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;; copy the word into a string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (setq word (buffer-substring beg end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;; trim the completion list down to just likely candidates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ;; then convert it to an alist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (setq word-prefix-regexp (concat "^" (regexp-quote word))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 c-list (vm-delete-non-matching-strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 word-prefix-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 vm-minibuffer-completion-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 c-list (sort c-list (function string-lessp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (if c-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (vm-minibuffer-show-completions c-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (vm-minibuffer-completion-message " [No match]"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (defun vm-keyboard-read-string (prompt completion-list &optional multi-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (let ((minibuffer-local-map (copy-keymap minibuffer-local-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (vm-completion-auto-space multi-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (vm-minibuffer-completion-table completion-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (define-key minibuffer-local-map "\t" 'vm-minibuffer-complete-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (define-key minibuffer-local-map " " 'vm-minibuffer-complete-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (define-key minibuffer-local-map "?" 'vm-minibuffer-completion-help)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (if (not multi-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (define-key minibuffer-local-map "\r"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 'vm-minibuffer-complete-word-and-exit))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
265 ;; evade the XEmacs dialox box, yeccch.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
266 (let ((should-use-dialog-box nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
267 (read-string prompt))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (defvar last-nonmenu-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (defun vm-read-string (prompt completion-list &optional multi-word)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ;; handle alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (if (consp (car completion-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (setq completion-list (nreverse (mapcar 'car completion-list))))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 54
diff changeset
275 (if (and completion-list (vm-mouse-support-possible-p))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (cond ((and (vm-mouse-xemacs-mouse-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (or (button-press-event-p last-command-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (button-release-event-p last-command-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (menu-event-p last-command-event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (vm-mouse-read-string prompt completion-list multi-word))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 ((and (vm-mouse-fsfemacs-mouse-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (listp last-nonmenu-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (vm-mouse-read-string prompt completion-list multi-word))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (vm-keyboard-read-string prompt completion-list multi-word)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (vm-keyboard-read-string prompt completion-list multi-word)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (defun vm-read-number (prompt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (let (result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (while
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (string-match "^[ \t]*-?[0-9]+" (setq result (read-string prompt)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (string-to-int result)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (defun vm-read-password (prompt &optional confirm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 "Read and return a password from the minibuffer, prompting with PROMPT.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 Optional second argument CONFIRM non-nil means that the user will be asked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 to type the password a second time for confirmation and if there is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 mismatch, the process is repeated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 Line editing keys are:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 C-h, DEL rubout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 C-u, C-x line kill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 C-q, C-v literal next"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (catch 'return-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (let ((cursor-in-echo-area t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (echo-keystrokes 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (input-buffer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (help-form nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 (xxx "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (string nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 char done form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (setq input-buffer (get-buffer-create " *password*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (set-buffer input-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (while t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (erase-buffer)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 54
diff changeset
320 (vm-unsaved-message "%s%s" prompt
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (vm-truncate-string xxx (buffer-size)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (while (not (memq (setq char (read-char)) '(?\C-m ?\C-j)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (if (setq form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 (assq char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 '((?\C-h . (delete-char -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (?\C-? . (delete-char -1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (?\C-u . (delete-region 1 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (?\C-x . (delete-region 1 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (?\C-q . (quoted-insert 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (?\C-v . (quoted-insert 1))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (condition-case error-data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (eval form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (error t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (insert char))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 54
diff changeset
336 (vm-unsaved-message "%s%s" prompt
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (vm-truncate-string xxx (buffer-size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (cond ((and confirm string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (cond ((not (string= string (buffer-string)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 54
diff changeset
340 (vm-unsaved-message
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (concat prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (vm-truncate-string xxx (buffer-size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 " [Mismatch... try again.]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (ding)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (sit-for 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (setq string nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (t (throw 'return-value string))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (confirm
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (setq string (buffer-string))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 54
diff changeset
350 (vm-unsaved-message
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (concat prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (vm-truncate-string xxx (buffer-size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 " [Retype to confirm...]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (sit-for 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (t
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 54
diff changeset
356 (vm-unsaved-message "")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (throw 'return-value (buffer-string))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (and input-buffer (kill-buffer input-buffer)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (defun vm-keyboard-read-file-name (prompt &optional dir default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 must-match initial history)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 "Like read-file-name, except HISTORY's value is unaltered."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
363 (let ((oldvalue (symbol-value history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
364 ;; evade the XEmacs dialox box, yeccch.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
365 (should-use-dialog-box nil))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 (condition-case nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (read-file-name prompt dir default must-match initial history)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (wrong-number-of-arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (if history
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (let ((file-name-history (symbol-value history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (setq file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (read-file-name prompt dir default must-match initial))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 file )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (read-file-name prompt dir default must-match initial))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (and history (set history oldvalue)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 (defun vm-read-file-name (prompt &optional dir default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 must-match initial history)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 "Like read-file-name, except a mouse interface is used if a mouse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 click mouse triggered the current command."
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 54
diff changeset
383 (if (vm-mouse-support-possible-p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (cond ((and (vm-mouse-xemacs-mouse-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (or (button-press-event-p last-command-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (button-release-event-p last-command-event)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (menu-event-p last-command-event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (vm-mouse-read-file-name prompt dir default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 must-match initial history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 ((and (vm-mouse-fsfemacs-mouse-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (listp last-nonmenu-event))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (vm-mouse-read-file-name prompt dir default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 must-match initial history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (vm-keyboard-read-file-name prompt dir default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 must-match initial history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (vm-keyboard-read-file-name prompt dir default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 must-match initial history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400