[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `w3m-input-url' bug
- From: Katsumi Yamaoka <yamaoka@xxxxxxx>
- Date: Wed, 08 Sep 2010 12:32:14 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 11341
- References: <m1sk1l96y7.fsf@xxxxxxxxx> <b4miq2h21zj.fsf@xxxxxxx> <m1zkvt4qe4.fsf@xxxxxxxxx>
In [emacs-w3m : No.11340] Leo wrote:
> On 2010-09-07 13:05 +0100, Katsumi Yamaoka wrote:
>>> If a user calls w3m-input-url with INITIAL nil and DEFAULT non-nil, his
>>> intention is pretty clear but w3m-input-url overrides it anyway. I think
>>> this is a bug.
>>
>>> GNU Emacs actually prefers DEFAULT and considers INITIAL deprecated; see
>>> doc string of completing-read (23.x).
>>
>> So what evil does it cause in emacs-w3m?
> I wouldn't call it evil but it makes it difficult to customise the
> behaviour. For example, when I call w3m-goto-url I often don't want to
> edit the url suggested. I just want to go to a new one. So I would
> prefer w3m-input-url sets a default url and leaves the initial input
> empty. I can use a before advice to do that but then the prompt would
> not show the default url.
Well, I'm not quite sure if I got what you want. I see no difference
between 1 and 2 and between 3 and 4:
1. (w3m-input-url nil nil "DEF")
2. (completing-read "What? " nil nil nil nil nil "DEF")
3. (w3m-input-url nil "INIT" "DEF")
4. (completing-read "What? " nil nil nil "INIT" nil "DEF")
But is what you want something like the following?
--8<---------------cut here---------------start------------->8---
--- w3m.el~ 2010-09-06 03:39:33 +0000
+++ w3m.el 2010-09-08 03:29:33 +0000
@@ -4589,7 +4589,7 @@
"HOME"
default)
"): "))
- (if (or initial (not default))
+ (if (not default)
(if feeling-lucky "URL or Keyword: " "URL: ")
(format "URL %s(default %s): "
(if feeling-lucky "or Keyword " "")
--8<---------------cut here---------------end--------------->8---
If so, I agree with applying it to emacs-w3m.