X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fminibuf.el;h=8177a3edc8c3beb9bab89f8f6c65234286a198ff;hb=2df059c60e547b9e6c827eea2682bd1511983dc0;hp=44dab2082626f3033c2e2f5883d8fe41c70185f9;hpb=3062d425fac0473eb5aa2efc0bb002f6ce0cb028;p=chise%2Fxemacs-chise.git.1 diff --git a/lisp/minibuf.el b/lisp/minibuf.el index 44dab20..8177a3e 100644 --- a/lisp/minibuf.el +++ b/lisp/minibuf.el @@ -271,8 +271,7 @@ in `substitute-in-file-name'." If `zmacs-regions' is true, and the zmacs region is active in this buffer, then this key deactivates the region without beeping." (interactive) - (if (and (region-active-p) - (eq (current-buffer) (zmacs-region-buffer))) + (if (region-active-p) ;; pseudo-zmacs compatibility: don't beep if this ^G is simply ;; deactivating the region. If it is inactive, beep. nil @@ -765,17 +764,21 @@ See also the variable `completion-highlight-first-word-only' for &optional predicate require-match initial-contents history default) "Read a string in the minibuffer, with completion. -Args: PROMPT, TABLE, PREDICATE, REQUIRE-MATCH, INITIAL-CONTENTS, HISTORY. + PROMPT is a string to prompt with; normally it ends in a colon and a space. TABLE is an alist whose elements' cars are strings, or an obarray. +TABLE can also be a function which does the completion itself. PREDICATE limits completion to a subset of TABLE. -See `try-completion' for more details on completion, TABLE, and PREDICATE. +See `try-completion' and `all-completions' for more details + on completion, TABLE, and PREDICATE. + If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless - the input is (or completes to) an element of TABLE or is null. - If it is also not t, Return does not exit if it does non-null completion. + the input is (or completes to) an element of TABLE or is null. + If it is also not t, Return does not exit if it does non-null completion. If INITIAL-CONTENTS is non-nil, insert it in the minibuffer initially. If it is (STRING . POSITION), the initial input is STRING, but point is placed POSITION characters into the string. + HISTORY, if non-nil, specifies a history list and optionally the initial position in the list. It can be a symbol, which is the history list variable to use, @@ -785,7 +788,9 @@ HISTORY, if non-nil, specifies a history list which INITIAL-CONTENTS corresponds to). If HISTORY is `t', no history will be recorded. Positions are counted starting from 1 at the beginning of the list. -DEFAULT, if non-nil, is the default value. +DEFAULT, if non-nil, will be returned when the user enters an empty + string. + Completion ignores case if the ambient value of `completion-ignore-case' is non-nil." (let ((minibuffer-completion-table table) @@ -1665,22 +1670,22 @@ If DEFAULT-VALUE is non-nil, return that if user enters an empty :activate-callback 'read-file-name-activate-callback) (goto-char (point-min) completion-buf))))) -(defun read-file-name-1 (history prompt dir default - must-match initial-contents - completer) +(defun read-file-name-1 (type history prompt dir default + must-match initial-contents + completer) (if (should-use-dialog-box-p) (condition-case nil (let ((file (apply #'make-dialog-box - 'file `(:title ,(capitalize-string-as-title - ;; Kludge: Delete ": " off the end. - (replace-in-string prompt ": $" "")) - ,@(and dir (list :initial-directory - dir)) - :file-must-exist ,must-match - ,@(and initial-contents - (list :initial-filename - initial-contents)))))) + type `(:title ,(capitalize-string-as-title + ;; Kludge: Delete ": " off the end. + (replace-in-string prompt ": $" "")) + ,@(and dir (list :initial-directory + dir)) + :file-must-exist ,must-match + ,@(and initial-contents + (list :initial-filename + initial-contents)))))) ;; hack -- until we implement reading a directory properly, ;; allow a file as indicating the directory it's in (if (and (eq completer 'read-directory-name-internal) @@ -1731,8 +1736,8 @@ Fifth arg INITIAL-CONTENTS specifies text to start with. If this is not Sixth arg HISTORY specifies the history list to use. Default is `file-name-history'. DIR defaults to current buffer's directory default." - (read-file-name-1 - (or history 'file-name-history) + (read-file-name-1 + 'file (or history 'file-name-history) prompt dir (or default (and initial-contents (abbreviate-file-name (expand-file-name @@ -1762,9 +1767,9 @@ Sixth arg HISTORY specifies the history list to use. Default is `file-name-history'. DIR defaults to current buffer's directory default." (read-file-name-1 - (or history 'file-name-history) - prompt dir (or default default-directory) must-match initial-contents - 'read-directory-name-internal)) + 'directory (or history 'file-name-history) + prompt dir (or default default-directory) must-match initial-contents + 'read-directory-name-internal)) ;; Environment-variable and ~username completion hack @@ -2191,7 +2196,9 @@ whether it is a file(/result) or a directory (/result/)." "/usr/local/lib/X11R5/X11/" "/usr/X11/lib/X11/" "/usr/lib/X11/" + "/usr/share/X11/" "/usr/local/lib/X11/" + "/usr/local/share/X11/" "/usr/X386/lib/X11/" "/usr/x386/lib/X11/" "/usr/XFree86/lib/X11/"