First, sorry for inconvinience.
I think I had spent too much time hacking 21.2.
And sorry for not responding soon. I was too tired after
applying my patches so I went home before reading
xemacs-beta. And I don't have internet connection there. :-(
Adrian Aichner <aichner(a)ecf.teradyne.com> writes:
Doing it right (following Kyle's suggestion) would in this
particular
case lead to awkward code bloat compared to the version before
Yoshiki's patch. The new feature of `completing-read', the DEFAULT
argument, cannot be relied upon (because XEmacs-21.1.8 does not have
it). Consequently the defaulting of an empty completion has to be
done just as before. Only, handling a possible
wrong-number-of-arguments makes the code unnecessarily hard to read
and understand.
I vote for reverting to the `bookmark-completing-read' version of
bookmark.el revision 1.2.
In this particular case, I think removing DEFAULT argument
is the best solution.
DEFAULT argument has three meanings.
1. The value is returned when user inputs empty string.
2. It will be put into the history when user enters empty
string.
3. Magical future history by M-n.
Probably 2 and 3 should be documented at Lispref.
First one can be easily simulated by something like
(setq val (completing-read "Prompt:" nil))
(if (string= val "")
(setq val default))
Second one can be simulates as:
(when (string= val "")
(setq val default)
(setq bookmark-history (cdr bookmark-history))
(or (eq bookmark-history t)
(null val)
(and bookmark-history (equal histval (car bookmark-history)))
(and (stringp val)
minibuffer-history-minimum-string-length
(< (length val)
minibuffer-history-minimum-string-length))
(set minibuffer-history-variable
(if minibuffer-history-uniquify
(cons histval (remove histval bookmark-history))
(cons histval bookmark-history)))))
And thrid one can be achieved by binding minibuffer-default
to default value.
First one is already done in bookmark.el. You can also do 2
and 3 but I don't think most one cares. It's relatively new
feature and I don't think supporing that is worth making
lisp code ugly.
Adrian, could you write a new patch?
--
Yoshiki Hayashi