all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* ido-find-file
@ 2015-12-26 23:19 Sam Halliday
  2015-12-26 23:27 ` ido-find-file Sam Halliday
  2015-12-26 23:35 ` ido-find-file Dmitry Gutov
  0 siblings, 2 replies; 6+ messages in thread
From: Sam Halliday @ 2015-12-26 23:19 UTC (permalink / raw)
  To: help-gnu-emacs

Dear Emacs users,

I have been trying out ido-find-file as a replacement for find-file and it was going really well until I tried to open a directory in dired.

The default in normal find-file is for RET to open a directory in dired, but with ido-find-file, RET will open a (useless) buffer containing the name of the files in that directory and C-d is needed to open the directory in dired.

There is no way I'm going to be able to retrain my fingers to do that, and it is also undesirable behaviour. Is there any way to get ido-find-file to DWIM?

Best regards,
Sam


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

* Re: ido-find-file
  2015-12-26 23:19 ido-find-file Sam Halliday
@ 2015-12-26 23:27 ` Sam Halliday
  2015-12-26 23:48   ` ido-find-file Sam Halliday
  2015-12-26 23:35 ` ido-find-file Dmitry Gutov
  1 sibling, 1 reply; 6+ messages in thread
From: Sam Halliday @ 2015-12-26 23:27 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, 26 December 2015 23:20:00 UTC, Sam Halliday  wrote:
> Dear Emacs users,
> 
> I have been trying out ido-find-file as a replacement for find-file and it was going really well until I tried to open a directory in dired.
> 
> The default in normal find-file is for RET to open a directory in dired, but with ido-find-file, RET will open a (useless) buffer containing the name of the files in that directory and C-d is needed to open the directory in dired.
> 
> There is no way I'm going to be able to retrain my fingers to do that, and it is also undesirable behaviour. Is there any way to get ido-find-file to DWIM?


I found this hack from JohnWiegley http://www.emacswiki.org/emacs/InteractivelyDoThings#toc29 which does the job but is really quite ugly/long. It would be good if this was in the mainline and possible the default.

 (defun ido-smart-select-text ()
    "Select the current completed item.  Do NOT descend into directories."
    (interactive)
    (when (and (or (not ido-require-match)
                   (if (memq ido-require-match
                             '(confirm confirm-after-completion))
                       (if (or (eq ido-cur-item 'dir)
                               (eq last-command this-command))
                           t
                         (setq ido-show-confirm-message t)
                         nil))
                   (ido-existing-item-p))
               (not ido-incomplete-regexp))
      (when ido-current-directory
        (setq ido-exit 'takeprompt)
        (unless (and ido-text (= 0 (length ido-text)))
          (let ((match (ido-name (car ido-matches))))
            (throw 'ido
                   (setq ido-selected
                         (if match
                             (replace-regexp-in-string "/\\'" "" match)
                           ido-text)
                         ido-text ido-selected
                         ido-final-text ido-text)))))
      (exit-minibuffer)))
  
  (eval-after-load "ido"
    '(define-key ido-common-completion-map "\C-m" 'ido-smart-select-text))


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

* Re: ido-find-file
  2015-12-26 23:19 ido-find-file Sam Halliday
  2015-12-26 23:27 ` ido-find-file Sam Halliday
@ 2015-12-26 23:35 ` Dmitry Gutov
  1 sibling, 0 replies; 6+ messages in thread
From: Dmitry Gutov @ 2015-12-26 23:35 UTC (permalink / raw)
  To: Sam Halliday, help-gnu-emacs

On 12/27/2015 01:19 AM, Sam Halliday wrote:

> I have been trying out ido-find-file as a replacement for find-file and it was going really well until I tried to open a directory in dired.

You might prefer icomplete-mode over ido if you like more conservative 
behavior.

> The default in normal find-file is for RET to open a directory in dired, but with ido-find-file, RET will open a (useless) buffer containing the name of the files in that directory and C-d is needed to open the directory in dired.

Honestly, I'd just use C-j for that. And having to press C-d if I forget 
isn't too bad either.




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

* Re: ido-find-file
  2015-12-26 23:27 ` ido-find-file Sam Halliday
@ 2015-12-26 23:48   ` Sam Halliday
  2015-12-26 23:51     ` ido-find-file Sam Halliday
  2015-12-27  0:00     ` ido-find-file Sam Halliday
  0 siblings, 2 replies; 6+ messages in thread
From: Sam Halliday @ 2015-12-26 23:48 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, 26 December 2015 23:27:44 UTC, Sam Halliday  wrote:
> On Saturday, 26 December 2015 23:20:00 UTC, Sam Halliday  wrote:
> > Dear Emacs users,
> > 
> > I have been trying out ido-find-file as a replacement for find-file and it was going really well until I tried to open a directory in dired.
> > 
> > The default in normal find-file is for RET to open a directory in dired, but with ido-find-file, RET will open a (useless) buffer containing the name of the files in that directory and C-d is needed to open the directory in dired.
> > 
> > There is no way I'm going to be able to retrain my fingers to do that, and it is also undesirable behaviour. Is there any way to get ido-find-file to DWIM?
> 
> 
> I found this hack from JohnWiegley http://www.emacswiki.org/emacs/InteractivelyDoThings#toc29 which does the job but is really quite ugly/long. It would be good if this was in the mainline and possible the default.
> 
>  (defun ido-smart-select-text ()
>     "Select the current completed item.  Do NOT descend into directories."
>     (interactive)
>     (when (and (or (not ido-require-match)
>                    (if (memq ido-require-match
>                              '(confirm confirm-after-completion))
>                        (if (or (eq ido-cur-item 'dir)
>                                (eq last-command this-command))
>                            t
>                          (setq ido-show-confirm-message t)
>                          nil))
>                    (ido-existing-item-p))
>                (not ido-incomplete-regexp))
>       (when ido-current-directory
>         (setq ido-exit 'takeprompt)
>         (unless (and ido-text (= 0 (length ido-text)))
>           (let ((match (ido-name (car ido-matches))))
>             (throw 'ido
>                    (setq ido-selected
>                          (if match
>                              (replace-regexp-in-string "/\\'" "" match)
>                            ido-text)
>                          ido-text ido-selected
>                          ido-final-text ido-text)))))
>       (exit-minibuffer)))
>   
>   (eval-after-load "ido"
>     '(define-key ido-common-completion-map "\C-m" 'ido-smart-select-text))

actually this hack doesn't do what I want. All I want is for ido-find-file to open up directories in dired instead of this functionless Fundamental mode it drops me into if I press RET when I select a directory.


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

* Re: ido-find-file
  2015-12-26 23:48   ` ido-find-file Sam Halliday
@ 2015-12-26 23:51     ` Sam Halliday
  2015-12-27  0:00     ` ido-find-file Sam Halliday
  1 sibling, 0 replies; 6+ messages in thread
From: Sam Halliday @ 2015-12-26 23:51 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, 26 December 2015 23:49:01 UTC, Sam Halliday  wrote:
> Fundamental mode it drops me into if I press RET when I select a directory.

Ignore this comment, I was browsing a new project (not written by me) and the first file in the directory was a list of files. I thought ido-find-file was opening up the directory list.


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

* Re: ido-find-file
  2015-12-26 23:48   ` ido-find-file Sam Halliday
  2015-12-26 23:51     ` ido-find-file Sam Halliday
@ 2015-12-27  0:00     ` Sam Halliday
  1 sibling, 0 replies; 6+ messages in thread
From: Sam Halliday @ 2015-12-27  0:00 UTC (permalink / raw)
  To: help-gnu-emacs

On Saturday, 26 December 2015 23:49:01 UTC, Sam Halliday  wrote:
> On Saturday, 26 December 2015 23:27:44 UTC, Sam Halliday  wrote:
> > On Saturday, 26 December 2015 23:20:00 UTC, Sam Halliday  wrote:
> > > Dear Emacs users,
> > > 
> > > I have been trying out ido-find-file as a replacement for find-file and it was going really well until I tried to open a directory in dired.
> > > 
> > > The default in normal find-file is for RET to open a directory in dired, but with ido-find-file, RET will open a (useless) buffer containing the name of the files in that directory and C-d is needed to open the directory in dired.
> > > 
> > > There is no way I'm going to be able to retrain my fingers to do that, and it is also undesirable behaviour. Is there any way to get ido-find-file to DWIM?
> > 
> > 
> > I found this hack from JohnWiegley http://www.emacswiki.org/emacs/InteractivelyDoThings#toc29 which does the job but is really quite ugly/long. It would be good if this was in the mainline and possible the default.
> > 
> >  (defun ido-smart-select-text ()
> >     "Select the current completed item.  Do NOT descend into directories."
> >     (interactive)
> >     (when (and (or (not ido-require-match)
> >                    (if (memq ido-require-match
> >                              '(confirm confirm-after-completion))
> >                        (if (or (eq ido-cur-item 'dir)
> >                                (eq last-command this-command))
> >                            t
> >                          (setq ido-show-confirm-message t)
> >                          nil))
> >                    (ido-existing-item-p))
> >                (not ido-incomplete-regexp))
> >       (when ido-current-directory
> >         (setq ido-exit 'takeprompt)
> >         (unless (and ido-text (= 0 (length ido-text)))
> >           (let ((match (ido-name (car ido-matches))))
> >             (throw 'ido
> >                    (setq ido-selected
> >                          (if match
> >                              (replace-regexp-in-string "/\\'" "" match)
> >                            ido-text)
> >                          ido-text ido-selected
> >                          ido-final-text ido-text)))))
> >       (exit-minibuffer)))
> >   
> >   (eval-after-load "ido"
> >     '(define-key ido-common-completion-map "\C-m" 'ido-smart-select-text))
> 
> actually this hack doesn't do what I want. All I want is for ido-find-file to open up directories in dired instead of this functionless Fundamental mode it drops me into if I press RET when I select a directory.

Another Sacha fix... (setq ido-show-dot-for-dired t) does exactly what I wanted. Sorry for the noise!


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

end of thread, other threads:[~2015-12-27  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-26 23:19 ido-find-file Sam Halliday
2015-12-26 23:27 ` ido-find-file Sam Halliday
2015-12-26 23:48   ` ido-find-file Sam Halliday
2015-12-26 23:51     ` ido-find-file Sam Halliday
2015-12-27  0:00     ` ido-find-file Sam Halliday
2015-12-26 23:35 ` ido-find-file Dmitry Gutov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.