Jan Vroonhof <vroonhof(a)math.ethz.ch> writes:
Hrvoje Niksic <hniksic(a)iskon.hr> writes:
> The DEFAULT argument you added does something different -- it affects
> what happens when you just press RET, and it stores the correct thing
> to history. It works nicely with the traditional "Insert something
> (default foo): " Emacs prompts. FSF's DEFAULT has the advantage that
> you can edit the default, and change it.
>
> If we had DEFAULT implemented, I would also recommend it over
> INITIAL-CONTENTS. I'm not sure whether we want it implemented. The
> M-n feature looks very weird to me.
I think it is a very weird feature for a first time user, however it
also very practical, and it doesn't get in the way. Now that we start
passing in the default value anyway for the history stuff, it seems to
be "cheap" to implement.
I'm for adding it as it won't hurt anybody. Now I remember
I typed M-n yesterday when I was prompted for ediff files.
It's also really easy to implement. There exists all code to
achieve this. All you have to do is bind minibuffer-default
variable. And with latter half of patch which enables
DEFAULT argument of read-file-name-2, you can use M-n when
you do M-x ediff.
I'll send this patch to xemacs-patches with ChangeLog later.
Index: minibuf.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/minibuf.el,v
retrieving revision 1.14.2.11
diff -u -u -r1.14.2.11 minibuf.el
--- minibuf.el 1999/12/22 08:24:38 1.14.2.11
+++ minibuf.el 1999/12/22 08:25:42
@@ -415,7 +415,9 @@
;; `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)
+ ;; But here we use dynamic scope.
+ (minibuffer-default default))
(unwind-protect
(progn
(set-buffer (reset-buffer buffer))
@@ -1550,8 +1552,9 @@
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))
--
Yoshiki Hayashi