Mercurial > hg > xemacs-beta
comparison lisp/prim/minibuf.el @ 120:cca96a509cfe r20-1b12
Import from CVS: tag r20-1b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:25:29 +0200 |
parents | 4be1180a9e89 |
children | b980b6286996 |
comparison
equal
deleted
inserted
replaced
119:d101af7320b8 | 120:cca96a509cfe |
---|---|
27 | 27 |
28 ;; Written by Richard Mlynarik 2-Oct-92 | 28 ;; Written by Richard Mlynarik 2-Oct-92 |
29 | 29 |
30 ;;; Code: | 30 ;;; Code: |
31 | 31 |
32 (defvar insert-default-directory t | 32 (defgroup minibuffer nil |
33 "Minibuffer customizations" | |
34 :group 'environment) | |
35 | |
36 | |
37 (defcustom insert-default-directory t | |
33 "*Non-nil means when reading a filename start with default dir in minibuffer." | 38 "*Non-nil means when reading a filename start with default dir in minibuffer." |
34 ) | 39 :type 'boolean |
40 :group 'minibuffer) | |
35 | 41 |
36 (defvar minibuffer-completion-table nil | 42 (defvar minibuffer-completion-table nil |
37 "Alist or obarray used for completion in the minibuffer. | 43 "Alist or obarray used for completion in the minibuffer. |
38 This becomes the ALIST argument to `try-completion' and `all-completions'. | 44 This becomes the ALIST argument to `try-completion' and `all-completions'. |
39 | 45 |
56 (defvar minibuffer-confirm-incomplete nil | 62 (defvar minibuffer-confirm-incomplete nil |
57 "If true, then in contexts where completing-read allows answers which | 63 "If true, then in contexts where completing-read allows answers which |
58 are not valid completions, an extra RET must be typed to confirm the | 64 are not valid completions, an extra RET must be typed to confirm the |
59 response. This is helpful for catching typos, etc.") | 65 response. This is helpful for catching typos, etc.") |
60 | 66 |
61 (defvar completion-auto-help t | 67 (defcustom completion-auto-help t |
62 "*Non-nil means automatically provide help for invalid completion input.") | 68 "*Non-nil means automatically provide help for invalid completion input." |
63 | 69 :type 'boolean |
64 (defvar enable-recursive-minibuffers nil | 70 :group 'minibuffer) |
71 | |
72 (defcustom enable-recursive-minibuffers nil | |
65 "*Non-nil means to allow minibuffer commands while in the minibuffer. | 73 "*Non-nil means to allow minibuffer commands while in the minibuffer. |
66 More precisely, this variable makes a difference when the minibuffer window | 74 More precisely, this variable makes a difference when the minibuffer window |
67 is the selected window. If you are in some other window, minibuffer commands | 75 is the selected window. If you are in some other window, minibuffer commands |
68 are allowed even if a minibuffer is active.") | 76 are allowed even if a minibuffer is active." |
69 | 77 :type 'boolean |
70 (defvar minibuffer-max-depth 1 | 78 :group 'minibuffer) |
79 | |
80 (defcustom minibuffer-max-depth 1 | |
71 ;; See comment in #'minibuffer-max-depth-exceeded | 81 ;; See comment in #'minibuffer-max-depth-exceeded |
72 "*Global maximum number of minibuffers allowed; | 82 "*Global maximum number of minibuffers allowed; |
73 compare to enable-recursive-minibuffers, which is only consulted when the | 83 compare to enable-recursive-minibuffers, which is only consulted when the |
74 minibuffer is reinvoked while it is the selected window.") | 84 minibuffer is reinvoked while it is the selected window." |
85 :type '(choice integer | |
86 (const :tag "Indefinite" nil)) | |
87 :group 'minibuffer) | |
75 | 88 |
76 ;; Moved to C. The minibuffer prompt must be setup before this is run | 89 ;; Moved to C. The minibuffer prompt must be setup before this is run |
77 ;; and that can only be done from the C side. | 90 ;; and that can only be done from the C side. |
78 ;(defvar minibuffer-setup-hook nil | 91 ;(defvar minibuffer-setup-hook nil |
79 ; "Normal hook run just after entry to minibuffer.") | 92 ; "Normal hook run just after entry to minibuffer.") |
156 (define-key map "\M-\t" 'comint-dynamic-complete) | 169 (define-key map "\M-\t" 'comint-dynamic-complete) |
157 (define-key map "\M-?" 'comint-dynamic-list-completions) | 170 (define-key map "\M-?" 'comint-dynamic-list-completions) |
158 map) | 171 map) |
159 "Minibuffer keymap used by shell-command and related commands.") | 172 "Minibuffer keymap used by shell-command and related commands.") |
160 | 173 |
161 (defvar use-dialog-box t | 174 (defcustom use-dialog-box t |
162 "Variable controlling usage of the dialog box. If nil, the dialog box | 175 "*Variable controlling usage of the dialog box. |
163 will never be used, even in response to mouse events.") | 176 If nil, the dialog box will never be used, even in response to mouse events." |
177 :type 'boolean | |
178 :group 'minibuffer) | |
164 | 179 |
165 (defvar minibuffer-electric-file-name-behavior t | 180 (defcustom minibuffer-electric-file-name-behavior t |
166 "If non-nil, slash and tilde in certain places cause immediate deletion. | 181 "*If non-nil, slash and tilde in certain places cause immediate deletion. |
167 These are the same places where this behavior would occur later on anyway, | 182 These are the same places where this behavior would occur later on anyway, |
168 in `substitute-in-file-name'.") | 183 in `substitute-in-file-name'." |
184 :type 'boolean | |
185 :group 'minibuffer) | |
169 | 186 |
170 (defun minibuffer-electric-slash () | 187 (defun minibuffer-electric-slash () |
171 ;; by Stig@hackvan.com | 188 ;; by Stig@hackvan.com |
172 (interactive) | 189 (interactive) |
173 (and minibuffer-electric-file-name-behavior | 190 (and minibuffer-electric-file-name-behavior |
258 Each minibuffer output is added with | 275 Each minibuffer output is added with |
259 (set minibuffer-history-variable | 276 (set minibuffer-history-variable |
260 (cons STRING (symbol-value minibuffer-history-variable)))") | 277 (cons STRING (symbol-value minibuffer-history-variable)))") |
261 (defvar minibuffer-history-position) | 278 (defvar minibuffer-history-position) |
262 | 279 |
263 (defvar minibuffer-history-minimum-string-length 3 | 280 (defcustom minibuffer-history-minimum-string-length 3 |
264 "If this variable is non-nil, a string will not be added to the | 281 "*If this variable is non-nil, a string will not be added to the |
265 minibuffer history if its length is less than that value.") | 282 minibuffer history if its length is less than that value." |
283 :type '(choice (const :tag "Any" nil) | |
284 integer) | |
285 :group 'minibuffer) | |
266 | 286 |
267 (defun read-from-minibuffer (prompt &optional initial-contents | 287 (defun read-from-minibuffer (prompt &optional initial-contents |
268 keymap | 288 keymap |
269 readp | 289 readp |
270 history | 290 history |
918 ;; | 938 ;; |
919 ;; There's some hackery in minibuffer-mouse-tracker to try to avoid the | 939 ;; There's some hackery in minibuffer-mouse-tracker to try to avoid the |
920 ;; ange-ftp stuff, but it doesn't work. | 940 ;; ange-ftp stuff, but it doesn't work. |
921 ;; | 941 ;; |
922 | 942 |
923 (defvar minibuffer-smart-completion-tracking-behavior nil | 943 (defcustom minibuffer-smart-completion-tracking-behavior nil |
924 "If non-nil, look for completions under mouse in all buffers. | 944 "*If non-nil, look for completions under mouse in all buffers. |
925 This allows you to click on something that looks like a completion | 945 This allows you to click on something that looks like a completion |
926 and have it selected, regardless of what buffer it is in. | 946 and have it selected, regardless of what buffer it is in. |
927 | 947 |
928 This is not enabled by default because | 948 This is not enabled by default because |
929 | 949 |
930 -- The \"mysterious\" highlighting in normal buffers is confusing to | 950 -- The \"mysterious\" highlighting in normal buffers is confusing to |
931 people not expecting it, and looks like a bug | 951 people not expecting it, and looks like a bug |
932 -- If ange-ftp is enabled, this tracking sometimes causes ange-ftp | 952 -- If ange-ftp is enabled, this tracking sometimes causes ange-ftp |
933 action as a result of mouse motion, which is *bad bad bad*. | 953 action as a result of mouse motion, which is *bad bad bad*. |
934 Hopefully this bug will be fixed at some point.") | 954 Hopefully this bug will be fixed at some point." |
955 :type 'boolean | |
956 :group 'minibuffer) | |
935 | 957 |
936 (defun minibuffer-smart-mouse-tracker (event) | 958 (defun minibuffer-smart-mouse-tracker (event) |
937 ;; Used as the mode-motion-hook of the minibuffer window, which is the | 959 ;; Used as the mode-motion-hook of the minibuffer window, which is the |
938 ;; value of `mouse-grabbed-buffer' while the minibuffer is active. If | 960 ;; value of `mouse-grabbed-buffer' while the minibuffer is active. If |
939 ;; the word under the mouse is a valid minibuffer completion, then it | 961 ;; the word under the mouse is a valid minibuffer completion, then it |
1991 | 2013 |
1992 ;;) ;; end of (featurep 'mule) | 2014 ;;) ;; end of (featurep 'mule) |
1993 | 2015 |
1994 | 2016 |
1995 | 2017 |
1996 (defvar force-dialog-box-use nil | 2018 (defcustom force-dialog-box-use nil |
1997 "If non-nil, always use a dialog box for asking questions, if possible. | 2019 "*If non-nil, always use a dialog box for asking questions, if possible. |
1998 You should *bind* this, not set it. This is useful if you're doing | 2020 You should *bind* this, not set it. This is useful if you're doing |
1999 something mousy but which wasn't actually invoked using the mouse.") | 2021 something mousy but which wasn't actually invoked using the mouse." |
2022 :type 'boolean | |
2023 :group 'minubuffer) | |
2000 | 2024 |
2001 ;; We include this here rather than dialog.el so it is defined | 2025 ;; We include this here rather than dialog.el so it is defined |
2002 ;; even when dialog boxes are not present. | 2026 ;; even when dialog boxes are not present. |
2003 (defun should-use-dialog-box-p () | 2027 (defun should-use-dialog-box-p () |
2004 "If non-nil, questions should be asked with a dialog box instead of the | 2028 "If non-nil, questions should be asked with a dialog box instead of the |