unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#11861: 24.1.1; ido-mode and interactive f
@ 2012-07-04 14:53 Michael Brand
  2013-07-09  5:28 ` Leo Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Brand @ 2012-07-04 14:53 UTC (permalink / raw)
  To: 11861

Hi all

There is an unexpected behaviour of ido-mode that I could only drill
down from org-babel-load-file but not analyse further. Emacs 23.3.1
shows test.el as the first ido suggestion as expected, 24.1.1 does
not. Is this a bug in 24.1.1?

The issue is easily reproduced with the shell command:
emacs -q test.el --eval '(eval-buffer)'

and this file test.el:
#+BEGIN_SRC emacs-lisp
  (ido-mode 1)
  (ido-everywhere 1)
  (defun my-test (file)
    (interactive "fFile to load: ")
    (message "my-test file: %s" file))
  (call-interactively 'my-test)
#+END_SRC

Michael





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2012-07-04 14:53 bug#11861: 24.1.1; ido-mode and interactive f Michael Brand
@ 2013-07-09  5:28 ` Leo Liu
  2013-07-09 14:08   ` Michael Brand
  0 siblings, 1 reply; 10+ messages in thread
From: Leo Liu @ 2013-07-09  5:28 UTC (permalink / raw)
  To: Michael Brand; +Cc: 11861

On 2012-07-04 22:53 +0800, Michael Brand wrote:
> There is an unexpected behaviour of ido-mode that I could only drill
> down from org-babel-load-file but not analyse further. Emacs 23.3.1
> shows test.el as the first ido suggestion as expected, 24.1.1 does
> not. Is this a bug in 24.1.1?

I can't see any abnormal behaviour with latest ido in emacs trunk. Would
you be able to explain what the problem was? Thanks.

Leo





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-09  5:28 ` Leo Liu
@ 2013-07-09 14:08   ` Michael Brand
  2013-07-09 15:25     ` Leo Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Brand @ 2013-07-09 14:08 UTC (permalink / raw)
  To: Leo Liu; +Cc: 11861

Hi Leo

Thank you for looking into this.

On Tue, Jul 9, 2013 at 7:28 AM, Leo Liu <sdl.web@gmail.com> wrote:
> On 2012-07-04 22:53 +0800, Michael Brand wrote:
>> There is an unexpected behaviour of ido-mode that I could only drill
>> down from org-babel-load-file but not analyse further. Emacs 23.3.1
>> shows test.el as the first ido suggestion as expected, 24.1.1 does
>> not. Is this a bug in 24.1.1?
>
> I can't see any abnormal behaviour with latest ido in emacs trunk. Would
> you be able to explain what the problem was? Thanks.

Emacs 23.3 invoked as described in my first post ("emacs -q test.el
--eval '(eval-buffer)'" with this

;;-----------------------------------------------------------
(ido-mode 1)
(ido-everywhere 1)
(defun my-test (file)
  (interactive "fFile to load: ")
  (message "my-test file: %s" file))
(call-interactively 'my-test)
;;-----------------------------------------------------------

in the file test.el and invoked from the directory where the file is
located) shows test.el highlighted as the first ido-suggestion in the
modeline prompt "File to load:". That is the file of the current
buffer test.el, as expected.

But Emacs 24.1, 24.2 and 24.3 show the alphabetically first file in
the directory, highlighted as the first ido-suggestion in the prompt.

Michael





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-09 14:08   ` Michael Brand
@ 2013-07-09 15:25     ` Leo Liu
  2013-07-09 20:28       ` Michael Brand
  0 siblings, 1 reply; 10+ messages in thread
From: Leo Liu @ 2013-07-09 15:25 UTC (permalink / raw)
  To: Michael Brand; +Cc: 11861

On 2013-07-09 22:08 +0800, Michael Brand wrote:
> in the file test.el and invoked from the directory where the file is
> located) shows test.el highlighted as the first ido-suggestion in the
> modeline prompt "File to load:". That is the file of the current
> buffer test.el, as expected.
>
> But Emacs 24.1, 24.2 and 24.3 show the alphabetically first file in
> the directory, highlighted as the first ido-suggestion in the prompt.

I loaded a version of ido.el from 28 Feb 2011 which is a few days before
the release of 23.3 and still couldn't reproduce this bug. I have 23.4
installed and couldn't reproduce either.

But from reading the code, the behaviour as you described in 23.3 would
be wrong anyway. You didn't specify any default filename in the
interactive form, there is no reason for ido to pick test.el as the
default.

HTH,
Leo





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-09 15:25     ` Leo Liu
@ 2013-07-09 20:28       ` Michael Brand
  2013-07-10  2:48         ` Leo Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Brand @ 2013-07-09 20:28 UTC (permalink / raw)
  To: Leo Liu; +Cc: 11861

Hi Leo

On Tue, Jul 9, 2013 at 5:25 PM, Leo Liu <sdl.web@gmail.com> wrote:
> On 2013-07-09 22:08 +0800, Michael Brand wrote:
>> in the file test.el and invoked from the directory where the file is
>> located) shows test.el highlighted as the first ido-suggestion in the
>> modeline prompt "File to load:". That is the file of the current
>> buffer test.el, as expected.
>>
>> But Emacs 24.1, 24.2 and 24.3 show the alphabetically first file in
>> the directory, highlighted as the first ido-suggestion in the prompt.
>
> I loaded a version of ido.el from 28 Feb 2011 which is a few days before
> the release of 23.3 and still couldn't reproduce this bug. I have 23.4
> installed and couldn't reproduce either.

?

There is no such bug in 23.3 and 23.4, both suggest test.el as
expected. I can reproduce the issue with 24.1, 24.2 and 24.3, these do
not suggest test.el. Did you try one of the latter with my example
command line with -q and my example file? I also assume you tried
while having additional files in the same directory with names
alphabetically before test.el.

> But from reading the code, the behaviour as you described in 23.3 would
> be wrong anyway.

> You didn't specify any default filename in the interactive form,

My previous interactive form in test.el seems not to be a good
example, so let me suggest to replace it with test_2.el with an
automated "M-x load-file":

emacs -q test_2.el -f eval-buffer

test_2.el:
;;-----------------------------------------------------------
(ido-mode 1)
(ido-everywhere 1)
(call-interactively 'load-file)
;;-----------------------------------------------------------

With 23.3 ido suggests the current buffer which I then can select,
with 24.1, 24.2 and 24.3 ido suggest the alphabetically first file of
the current directory, so I have to type the current buffer's file
name again.

> there is no reason for ido to pick test.el as the default.

Ok, for "M-x load-file" one could argue to use "M-x eval-buffer"
instead. But for "M-x org-babel-load-file" the ido suggestion was very
useful for me as I see no alternative except writing my own wrapper
for 24.1, 24.2 and 24.3 with the function current-buffer.

Michael





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-09 20:28       ` Michael Brand
@ 2013-07-10  2:48         ` Leo Liu
  2013-07-10 13:20           ` Michael Brand
  0 siblings, 1 reply; 10+ messages in thread
From: Leo Liu @ 2013-07-10  2:48 UTC (permalink / raw)
  To: Michael Brand; +Cc: 11861

On 2013-07-10 04:28 +0800, Michael Brand wrote:
> emacs -q test_2.el -f eval-buffer
>
> test_2.el:
> ;;-----------------------------------------------------------
> (ido-mode 1)
> (ido-everywhere 1)
> (call-interactively 'load-file)
> ;;-----------------------------------------------------------
>
> With 23.3 ido suggests the current buffer which I then can select,
> with 24.1, 24.2 and 24.3 ido suggest the alphabetically first file of
> the current directory, so I have to type the current buffer's file
> name again.

OK, I find a version of emacs 23.1 and was able to reproduce it i.e.
test_2.el is the first item.

But when I load the ido.el in 23.1 with emacs 24.x, test_2.el is no
longer the first item.

Could you check if this is the case for you too?

I am clueless where things might go wrong.

Leo





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-10  2:48         ` Leo Liu
@ 2013-07-10 13:20           ` Michael Brand
  2013-07-11  3:13             ` Leo Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Brand @ 2013-07-10 13:20 UTC (permalink / raw)
  To: Leo Liu; +Cc: 11861

Hi Leo

On Wed, Jul 10, 2013 at 4:48 AM, Leo Liu <sdl.web@gmail.com> wrote:
> OK, I find a version of emacs 23.1 and was able to reproduce it i.e.
> test_2.el is the first item.
>
> But when I load the ido.el in 23.1 with emacs 24.x, test_2.el is no
> longer the first item.
>
> Could you check if this is the case for you too?

Yes, confirmed, with minimal distance 23.3=23.4 vs. 24.1:
- Emacs 23.3:
  - ido.el original from 23.3: test_2.el is the first item, as expected
  - ido.el replaced from 24.1: test_2.el is the first item, as expected
- Emacs 24.1:
  - ido.el original from 24.1: test_2.el is not the first item, not as
    expected
  - ido.el replaced from 23.3: test_2.el is not the first item, not as
    expected

Michael





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-10 13:20           ` Michael Brand
@ 2013-07-11  3:13             ` Leo Liu
  2013-07-11  7:02               ` Michael Brand
  0 siblings, 1 reply; 10+ messages in thread
From: Leo Liu @ 2013-07-11  3:13 UTC (permalink / raw)
  To: Michael Brand; +Cc: 11861

On 2013-07-10 21:20 +0800, Michael Brand wrote:
> Yes, confirmed, with minimal distance 23.3=23.4 vs. 24.1:
> - Emacs 23.3:
>   - ido.el original from 23.3: test_2.el is the first item, as expected
>   - ido.el replaced from 24.1: test_2.el is the first item, as expected
> - Emacs 24.1:
>   - ido.el original from 24.1: test_2.el is not the first item, not as
>     expected
>   - ido.el replaced from 23.3: test_2.el is not the first item, not as
>     expected

I have committed a change to emacs-trunk. Will you be able to test it
and let me know if there are problems? Thanks.

Leo





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-11  3:13             ` Leo Liu
@ 2013-07-11  7:02               ` Michael Brand
  2013-07-11 15:42                 ` Leo Liu
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Brand @ 2013-07-11  7:02 UTC (permalink / raw)
  To: Leo Liu; +Cc: 11861

Hi Leo

On Thu, Jul 11, 2013 at 5:13 AM, Leo Liu <sdl.web@gmail.com> wrote:
> I have committed a change to emacs-trunk. Will you be able to test it
> and let me know if there are problems? Thanks.

Tested with Emacs 24.3 with your change for revision 113366 applied on
the original lisp/ido.el: Bug resolved, thank you.

Michael





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#11861: 24.1.1; ido-mode and interactive f
  2013-07-11  7:02               ` Michael Brand
@ 2013-07-11 15:42                 ` Leo Liu
  0 siblings, 0 replies; 10+ messages in thread
From: Leo Liu @ 2013-07-11 15:42 UTC (permalink / raw)
  To: Michael Brand; +Cc: 11861-done

Fixed in trunk.

On 2013-07-11 15:02 +0800, Michael Brand wrote:
> Tested with Emacs 24.3 with your change for revision 113366 applied on
> the original lisp/ido.el: Bug resolved, thank you.

Thanks for the confirmation.

Leo





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-07-11 15:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-04 14:53 bug#11861: 24.1.1; ido-mode and interactive f Michael Brand
2013-07-09  5:28 ` Leo Liu
2013-07-09 14:08   ` Michael Brand
2013-07-09 15:25     ` Leo Liu
2013-07-09 20:28       ` Michael Brand
2013-07-10  2:48         ` Leo Liu
2013-07-10 13:20           ` Michael Brand
2013-07-11  3:13             ` Leo Liu
2013-07-11  7:02               ` Michael Brand
2013-07-11 15:42                 ` Leo Liu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).