projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(remove_char_attribute): New function.
[chise/xemacs-chise.git-]
/
lisp
/
minibuf.el
diff --git
a/lisp/minibuf.el
b/lisp/minibuf.el
index
0061576
..
af83e9c
100644
(file)
--- a/
lisp/minibuf.el
+++ b/
lisp/minibuf.el
@@
-77,10
+77,12
@@
t means to return a list of all possible completions of STRING.
(defvar minibuffer-completion-confirm nil
"Non-nil => demand confirmation of completion before exiting minibuffer.")
(defvar minibuffer-completion-confirm nil
"Non-nil => demand confirmation of completion before exiting minibuffer.")
-(defvar minibuffer-confirm-incomplete nil
+(defcustom minibuffer-confirm-incomplete nil
"If true, then in contexts where completing-read allows answers which
are not valid completions, an extra RET must be typed to confirm the
"If true, then in contexts where completing-read allows answers which
are not valid completions, an extra RET must be typed to confirm the
-response. This is helpful for catching typos, etc.")
+response. This is helpful for catching typos, etc."
+ :type 'boolean
+ :group 'minibuffer)
(defcustom completion-auto-help t
"*Non-nil means automatically provide help for invalid completion input."
(defcustom completion-auto-help t
"*Non-nil means automatically provide help for invalid completion input."
@@
-344,7
+346,8
@@
minibuffer history if its length is less than that value."
keymap
readp
history
keymap
readp
history
- abbrev-table)
+ abbrev-table
+ default)
"Read a string from the minibuffer, prompting with string PROMPT.
If optional second arg INITIAL-CONTENTS is non-nil, it is a string
to be inserted into the minibuffer before reading input.
"Read a string from the minibuffer, prompting with string PROMPT.
If optional second arg INITIAL-CONTENTS is non-nil, it is a string
to be inserted into the minibuffer before reading input.
@@
-366,6
+369,8
@@
Fifth arg HISTORY, if non-nil, specifies a history list
Positions are counted starting from 1 at the beginning of the list.
Sixth arg ABBREV-TABLE, if non-nil, becomes the value of `local-abbrev-table'
in the minibuffer.
Positions are counted starting from 1 at the beginning of the list.
Sixth arg ABBREV-TABLE, if non-nil, becomes the value of `local-abbrev-table'
in the minibuffer.
+Seventh arg DEFAULT, if non-nil, will be returned when user enters
+ an empty string.
See also the variable completion-highlight-first-word-only for control over
completion display."
See also the variable completion-highlight-first-word-only for control over
completion display."
@@
-412,7
+417,8
@@
See also the variable completion-highlight-first-word-only for control over
;; `M-x doctor' makes history a local variable, and thus
;; our binding above is buffer-local and doesn't apply
;; once we switch buffers!!!! We demand better scope!
;; `M-x doctor' makes history a local variable, and thus
;; our binding above is buffer-local and doesn't apply
;; once we switch buffers!!!! We demand better scope!
- (_history_ history))
+ (_history_ history)
+ (minibuffer-default default))
(unwind-protect
(progn
(set-buffer (reset-buffer buffer))
(unwind-protect
(progn
(set-buffer (reset-buffer buffer))
@@
-490,8
+496,13
@@
See also the variable completion-highlight-first-word-only for control over
(let* ((val (progn (set-buffer buffer)
(if minibuffer-exit-hook
(run-hooks 'minibuffer-exit-hook))
(let* ((val (progn (set-buffer buffer)
(if minibuffer-exit-hook
(run-hooks 'minibuffer-exit-hook))
- (buffer-string)))
- (histval val)
+ (if (and (eq (char-after (point-min)) nil)
+ default)
+ default
+ (buffer-string))))
+ (histval (if (and default (string= val ""))
+ default
+ val))
(err nil))
(if readp
(condition-case e
(err nil))
(if readp
(condition-case e
@@
-784,7
+795,9
@@
Completion ignores case if the ambient value of
minibuffer-local-completion-map
minibuffer-local-must-match-map)
nil
minibuffer-local-completion-map
minibuffer-local-must-match-map)
nil
- history))
+ history
+ nil
+ default))
(if (and (string= ret "")
default)
default
(if (and (string= ret "")
default)
default
@@
-1237,7
+1250,9
@@
With prefix argument N, search for Nth previous match.
If N is negative, find the next or Nth next match."
(interactive
(let ((enable-recursive-minibuffers t)
If N is negative, find the next or Nth next match."
(interactive
(let ((enable-recursive-minibuffers t)
- (minibuffer-history-sexp-flag nil))
+ (minibuffer-history-sexp-flag nil)
+ (minibuffer-max-depth (and minibuffer-max-depth
+ (1+ minibuffer-max-depth))))
(if (eq 't (symbol-value minibuffer-history-variable))
(error "History is not being recorded in this context"))
(list (read-from-minibuffer "Previous element matching (regexp): "
(if (eq 't (symbol-value minibuffer-history-variable))
(error "History is not being recorded in this context"))
(list (read-from-minibuffer "Previous element matching (regexp): "
@@
-1285,7
+1300,9
@@
With prefix argument N, search for Nth next match.
If N is negative, find the previous or Nth previous match."
(interactive
(let ((enable-recursive-minibuffers t)
If N is negative, find the previous or Nth previous match."
(interactive
(let ((enable-recursive-minibuffers t)
- (minibuffer-history-sexp-flag nil))
+ (minibuffer-history-sexp-flag nil)
+ (minibuffer-max-depth (and minibuffer-max-depth
+ (1+ minibuffer-max-depth))))
(if (eq t (symbol-value minibuffer-history-variable))
(error "History is not being recorded in this context"))
(list (read-from-minibuffer "Next element matching (regexp): "
(if (eq t (symbol-value minibuffer-history-variable))
(error "History is not being recorded in this context"))
(list (read-from-minibuffer "Next element matching (regexp): "
@@
-1434,7
+1451,10
@@
only existing buffer names are allowed."
result)
(while (progn
(setq result (completing-read prompt alist nil require-match
result)
(while (progn
(setq result (completing-read prompt alist nil require-match
- nil 'buffer-history))
+ nil 'buffer-history
+ (if (bufferp default)
+ (buffer-name default)
+ default)))
(cond ((not (equal result ""))
nil)
((not require-match)
(cond ((not (equal result ""))
nil)
((not require-match)
@@
-1537,8
+1557,9
@@
only existing buffer names are allowed."
read-file-name-map
read-file-name-must-match-map)
nil
read-file-name-map
read-file-name-must-match-map)
nil
- history))
- ))
+ history
+ nil
+ default))))
;;; ;; Kludge! Put "/foo/bar" on history rather than "/default//foo/bar"
;;; (let ((hist (cond ((not history) 'minibuffer-history)
;;; ((consp history) (car history))
;;; ;; Kludge! Put "/foo/bar" on history rather than "/default//foo/bar"
;;; (let ((hist (cond ((not history) 'minibuffer-history)
;;; ((consp history) (car history))
@@
-1631,7
+1652,7
@@
only existing buffer names are allowed."
This will prompt with a dialog box if appropriate, according to
`should-use-dialog-box-p'.
Value is not expanded---you must call `expand-file-name' yourself.
This will prompt with a dialog box if appropriate, according to
`should-use-dialog-box-p'.
Value is not expanded---you must call `expand-file-name' yourself.
-Value is subject to interpreted by substitute-in-file-name however.
+Value is subject to interpretation by `substitute-in-file-name' however.
Default name to DEFAULT if user enters a null string.
(If DEFAULT is omitted, the visited file name is used,
except that if INITIAL-CONTENTS is specified, that combined with DIR is
Default name to DEFAULT if user enters a null string.
(If DEFAULT is omitted, the visited file name is used,
except that if INITIAL-CONTENTS is specified, that combined with DIR is
@@
-2116,9
+2137,15
@@
On mswindows devices, this uses `mswindows-color-list'."
(defun read-coding-system (prompt &optional default-coding-system)
"Read a coding-system (or nil) from the minibuffer.
Prompting with string PROMPT.
(defun read-coding-system (prompt &optional default-coding-system)
"Read a coding-system (or nil) from the minibuffer.
Prompting with string PROMPT.
-If the user enters null input, return second argument DEFAULT-CODING-SYSTEM."
+If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.
+DEFAULT-CODING-SYSTEM can be a string, symbol, or coding-system object."
(intern (completing-read prompt obarray 'find-coding-system t nil nil
(intern (completing-read prompt obarray 'find-coding-system t nil nil
- default-coding-system)))
+ (cond ((symbolp default-coding-system)
+ (symbol-name default-coding-system))
+ ((coding-system-p default-coding-system)
+ (symbol-name (coding-system-name default-coding-system)))
+ (t
+ default-coding-system)))))
(defun read-non-nil-coding-system (prompt)
"Read a non-nil coding-system from the minibuffer.
(defun read-non-nil-coding-system (prompt)
"Read a non-nil coding-system from the minibuffer.