* bug#8256: widget-complete does not complete for type 'directory on w32
2011-03-15 13:08 ` Lennart Borgman
@ 2011-03-15 14:48 ` Eli Zaretskii
2011-03-15 14:50 ` bug#8256: widget-complete does not complete for type 'directory onw32 Drew Adams
` (2 subsequent siblings)
3 siblings, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2011-03-15 14:48 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 8256
> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Tue, 15 Mar 2011 14:08:33 +0100
> Cc: 8256@debbugs.gnu.org
>
> On Tue, Mar 15, 2011 at 2:00 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> > We are probably doing different things, because you didn't provide the
> > exact recipe for reproducing the problem. Could you please give such
> > a recipe, starting with "emacs -Q"?
>
> Is that really possible for such a simple thing?;-)
Yes, it is. I was trying to reproduce this with a real defcustom
(archive-tmpdir, if you want to know), not with a fictitious
defcustom.
> emacs -Q
> Paste to *scratch* this code:
>
> (defcustom my-dir nil
> "doc"
> :type 'directory)
>
> Eval it.
> M-x customize-option RET my-dir RET
>
> Place point in the directory value field and erase "nil" that is there.
> Now in the empty directory value field press ESC-TAB (or do M-x
> widget-complete).
>
> This fails for me with the message I gave before:
>
> > complete-symbol: No completions available; use M-x visit-tags-table
> > or M-x semantic-mode
>
> Write for example "c:/" in the field and try again. It fails the same way.
I see the same on GNU/Linux (except that "C:/" should be replaced with
a "/", of course). So this is not w32-specific.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory onw32
2011-03-15 13:08 ` Lennart Borgman
2011-03-15 14:48 ` Eli Zaretskii
@ 2011-03-15 14:50 ` Drew Adams
2011-03-15 15:27 ` Lennart Borgman
2011-03-15 16:01 ` bug#8256: widget-complete does not complete for type 'directory on w32 Juanma Barranquero
2011-03-15 17:18 ` Stefan Monnier
3 siblings, 1 reply; 18+ messages in thread
From: Drew Adams @ 2011-03-15 14:50 UTC (permalink / raw)
To: 'Lennart Borgman', 'Eli Zaretskii'; +Cc: 8256
> (defcustom my-dir nil "doc" :type 'directory)
>
> M-x customize-option RET my-dir RET
You get a type mismatch, of course, since nil is not a directory.
> Place point in the directory value field and erase "nil"
> that is there. Now in the empty directory value field
> press ESC-TAB. This fails
Try again, with a valid directory as the default value - e.g. "c:/foo/"
Keep in mind too that the completion uses `default-directory'. Dunno whether
that's always appropriate, but that's what it uses.
But I agree that regardless of the initial type mismatch, you should be able to
type a legitimate directory prefix and get completion.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory onw32
2011-03-15 14:50 ` bug#8256: widget-complete does not complete for type 'directory onw32 Drew Adams
@ 2011-03-15 15:27 ` Lennart Borgman
0 siblings, 0 replies; 18+ messages in thread
From: Lennart Borgman @ 2011-03-15 15:27 UTC (permalink / raw)
To: Drew Adams; +Cc: 8256
On Tue, Mar 15, 2011 at 3:50 PM, Drew Adams <drew.adams@oracle.com> wrote:
>> (defcustom my-dir nil "doc" :type 'directory)
>>
>> M-x customize-option RET my-dir RET
>
> You get a type mismatch, of course, since nil is not a directory.
>
>> Place point in the directory value field and erase "nil"
>> that is there. Now in the empty directory value field
>> press ESC-TAB. This fails
>
> Try again, with a valid directory as the default value - e.g. "c:/foo/"
Ah, you are right. It kind of works with a valid default. (And this
does not have to be an existing directory.)
That was quite unexpected. And it is of course very inconvenient that
you can not customize a variable the normal way just because the
default value happens to be bad.
I think similar troubles in other places in custom too, but I can't
remember where now.
> Keep in mind too that the completion uses `default-directory'. Dunno whether
> that's always appropriate, but that's what it uses.
Thanks. I see a little bit different behaviour, but, yes, there is
another bug. This is what I see:
I looked at two rather similar cases that does not behave the same:
1) Default is a non-existing directory. If I try to complete this I
get completion candidates. It looks like it complets against
default-directory.
2) Default is "", but I enter the same directory into the directory
field in custom. Now I get no completion candidates.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory on w32
2011-03-15 13:08 ` Lennart Borgman
2011-03-15 14:48 ` Eli Zaretskii
2011-03-15 14:50 ` bug#8256: widget-complete does not complete for type 'directory onw32 Drew Adams
@ 2011-03-15 16:01 ` Juanma Barranquero
2011-03-15 16:16 ` Lennart Borgman
2011-03-15 17:18 ` Stefan Monnier
3 siblings, 1 reply; 18+ messages in thread
From: Juanma Barranquero @ 2011-03-15 16:01 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 8256
On Tue, Mar 15, 2011 at 14:08, Lennart Borgman
<lennart.borgman@gmail.com> wrote:
>> We are probably doing different things, because you didn't provide the
>> exact recipe for reproducing the problem. Could you please give such
>> a recipe, starting with "emacs -Q"?
>
> Is that really possible for such a simple thing?;-)
It's really so difficult to understand that giving an "emacs -Q"
recipe should be the *standard*, *default* way to make a bug report
and by not making so you waste other people's time?
Juanma
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory on w32
2011-03-15 16:01 ` bug#8256: widget-complete does not complete for type 'directory on w32 Juanma Barranquero
@ 2011-03-15 16:16 ` Lennart Borgman
2011-03-15 17:12 ` Juanma Barranquero
0 siblings, 1 reply; 18+ messages in thread
From: Lennart Borgman @ 2011-03-15 16:16 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: 8256
On Tue, Mar 15, 2011 at 5:01 PM, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Tue, Mar 15, 2011 at 14:08, Lennart Borgman
> <lennart.borgman@gmail.com> wrote:
>
>>> We are probably doing different things, because you didn't provide the
>>> exact recipe for reproducing the problem. Could you please give such
>>> a recipe, starting with "emacs -Q"?
>>
>> Is that really possible for such a simple thing?;-)
>
> It's really so difficult to understand that giving an "emacs -Q"
> recipe should be the *standard*, *default* way to make a bug report
> and by not making so you waste other people's time?
That was not the problem here. The problem was that perhaps was not
clear enough that I did give it.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory on w32
2011-03-15 16:16 ` Lennart Borgman
@ 2011-03-15 17:12 ` Juanma Barranquero
2012-02-22 20:25 ` Glenn Morris
0 siblings, 1 reply; 18+ messages in thread
From: Juanma Barranquero @ 2011-03-15 17:12 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 8256
On Tue, Mar 15, 2011 at 17:16, Lennart Borgman
<lennart.borgman@gmail.com> wrote:
> That was not the problem here. The problem was that perhaps was not
> clear enough that I did give it.
Not giving an "emacs -Q" recipe in a bug report is always* a problem.
* [unless the nature of the bug precludes doing so, which is infrequent]
Juanma
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory on w32
2011-03-15 13:08 ` Lennart Borgman
` (2 preceding siblings ...)
2011-03-15 16:01 ` bug#8256: widget-complete does not complete for type 'directory on w32 Juanma Barranquero
@ 2011-03-15 17:18 ` Stefan Monnier
2011-03-15 17:40 ` Lennart Borgman
2011-03-15 18:04 ` bug#8256: widget-complete does not complete for type 'directory onw32 Drew Adams
3 siblings, 2 replies; 18+ messages in thread
From: Stefan Monnier @ 2011-03-15 17:18 UTC (permalink / raw)
To: Lennart Borgman; +Cc: 8256
> emacs -Q
> Paste to *scratch* this code:
> (defcustom my-dir nil
> "doc"
> :type 'directory)
> Eval it.
> M-x customize-option RET my-dir RET
Problem here: nil is not a directory, so the above defcustom is not
valid. Oddly enough Customize does not signal the error, and instead
gets into a weird state. Once you set my-dir to a string, things work
much better.
Stefan
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory on w32
2011-03-15 17:18 ` Stefan Monnier
@ 2011-03-15 17:40 ` Lennart Borgman
2011-03-15 18:04 ` bug#8256: widget-complete does not complete for type 'directory onw32 Drew Adams
1 sibling, 0 replies; 18+ messages in thread
From: Lennart Borgman @ 2011-03-15 17:40 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 8256
On Tue, Mar 15, 2011 at 6:18 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> emacs -Q
>> Paste to *scratch* this code:
>
>> (defcustom my-dir nil
>> "doc"
>> :type 'directory)
>
>> Eval it.
>> M-x customize-option RET my-dir RET
>
> Problem here: nil is not a directory, so the above defcustom is not
> valid. Oddly enough Customize does not signal the error, and instead
> gets into a weird state. Once you set my-dir to a string, things work
> much better.
What should signal that it the defcustom is not valid? And when?
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#8256: widget-complete does not complete for type 'directory onw32
2011-03-15 17:18 ` Stefan Monnier
2011-03-15 17:40 ` Lennart Borgman
@ 2011-03-15 18:04 ` Drew Adams
2011-03-15 18:11 ` Lennart Borgman
1 sibling, 1 reply; 18+ messages in thread
From: Drew Adams @ 2011-03-15 18:04 UTC (permalink / raw)
To: 'Stefan Monnier', 'Lennart Borgman'; +Cc: 8256
> Problem here: nil is not a directory, so the above defcustom is not
> valid. Oddly enough Customize does not signal the error, and instead
> gets into a weird state. Once you set my-dir to a string, things work
> much better.
Customize does indicate the type mismatch, as usual via `(mismatch)'.
^ permalink raw reply [flat|nested] 18+ messages in thread