aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2009-08-02 14:56:04 +0000
committerJason Rumney2009-08-02 14:56:04 +0000
commit2aafe8087c996eda241abf47ca03283ee6d9f5a3 (patch)
tree74846f50edf2c38b20cb3823b8f71a24d7eb7b53
parente094097c751bd3c02b6b372ad70c4ac8f98fec60 (diff)
downloademacs-2aafe8087c996eda241abf47ca03283ee6d9f5a3.tar.gz
emacs-2aafe8087c996eda241abf47ca03283ee6d9f5a3.zip
(read-file-name): Treat confirm options to
MUSTMATCH as nil when invoking x-file-dialog. (Bug#3969)
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/minibuffer.el17
2 files changed, 19 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index de88dfbca6b..ea810df92f7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12009-08-02 Jason Rumney <jasonr@gnu.org>
2
3 * minibuffer.el (read-file-name): Treat confirm options to
4 MUSTMATCH as nil when invoking x-file-dialog. (Bug#3969)
5
12009-08-02 Chong Yidong <cyd@stupidchicken.com> 62009-08-02 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * font-lock.el (font-lock-string-face, font-lock-builtin-face) 8 * font-lock.el (font-lock-string-face, font-lock-builtin-face)
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 911a6b3c2d9..13c850d3eaa 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1134,7 +1134,8 @@ DIR should be an absolute directory name. It defaults to the value of
1134If this command was invoked with the mouse, use a graphical file 1134If this command was invoked with the mouse, use a graphical file
1135dialog if `use-dialog-box' is non-nil, and the window system or X 1135dialog if `use-dialog-box' is non-nil, and the window system or X
1136toolkit in use provides a file dialog box. For graphical file 1136toolkit in use provides a file dialog box. For graphical file
1137dialogs, any non-nil value of MUSTMATCH is equivalent to t. 1137dialogs, any the special values of MUSTMATCH; `confirm' and
1138`confirm-after-completion' are treated as equivalent to nil.
1138 1139
1139See also `read-file-name-completion-ignore-case' 1140See also `read-file-name-completion-ignore-case'
1140and `read-file-name-function'." 1141and `read-file-name-function'."
@@ -1180,7 +1181,16 @@ and `read-file-name-function'."
1180 default-filename))) 1181 default-filename)))
1181 ;; If DEFAULT-FILENAME not supplied and DIR contains 1182 ;; If DEFAULT-FILENAME not supplied and DIR contains
1182 ;; a file name, split it. 1183 ;; a file name, split it.
1183 (let ((file (file-name-nondirectory dir))) 1184 (let ((file (file-name-nondirectory dir))
1185 ;; When using a dialog, revert to nil and non-nil
1186 ;; interpretation of mustmatch. confirm options
1187 ;; need to be interpreted as nil, otherwise
1188 ;; it is impossible to create new files using
1189 ;; dialogs with the default settings.
1190 (dialog-mustmatch
1191 (and (not (eq mustmatch 'confirm))
1192 (not (eq mustmatch 'confirm-after-completion))
1193 mustmatch)))
1184 (when (and (not default-filename) 1194 (when (and (not default-filename)
1185 (not (zerop (length file)))) 1195 (not (zerop (length file))))
1186 (setq default-filename file) 1196 (setq default-filename file)
@@ -1189,7 +1199,8 @@ and `read-file-name-function'."
1189 (setq default-filename 1199 (setq default-filename
1190 (expand-file-name default-filename dir))) 1200 (expand-file-name default-filename dir)))
1191 (setq add-to-history t) 1201 (setq add-to-history t)
1192 (x-file-dialog prompt dir default-filename mustmatch 1202 (x-file-dialog prompt dir default-filename
1203 dialog-mustmatch
1193 (eq predicate 'file-directory-p))))) 1204 (eq predicate 'file-directory-p)))))
1194 1205
1195 (replace-in-history (eq (car-safe file-name-history) val))) 1206 (replace-in-history (eq (car-safe file-name-history) val)))