From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sam Halliday Newsgroups: gmane.emacs.help Subject: Re: ido-find-file Date: Sat, 26 Dec 2015 15:48:58 -0800 (PST) Message-ID: <97862b00-5aef-44c9-a845-f66fd05d9e2d@googlegroups.com> References: <32558752-9f6e-45ea-b953-099d8fc5daf7@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1451173820 2675 80.91.229.3 (26 Dec 2015 23:50:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Dec 2015 23:50:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 27 00:50:19 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aCybJ-0000Kd-Eb for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Dec 2015 00:50:17 +0100 Original-Received: from localhost ([::1]:40222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCybI-0001iP-OR for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Dec 2015 18:50:16 -0500 X-Received: by 10.182.81.72 with SMTP id y8mr21937522obx.9.1451173739457; Sat, 26 Dec 2015 15:48:59 -0800 (PST) X-Received: by 10.50.134.69 with SMTP id pi5mr743182igb.5.1451173739438; Sat, 26 Dec 2015 15:48:59 -0800 (PST) Original-Path: usenet.stanford.edu!mv3no21573377igc.0!news-out.google.com!f6ni34690igq.0!nntp.google.com!mv3no21573367igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <32558752-9f6e-45ea-b953-099d8fc5daf7@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2.101.49.251; posting-account=kRukCAoAAAANs-vsVh9dFwo5kp5pwnPz Original-NNTP-Posting-Host: 2.101.49.251 User-Agent: G2/1.0 Injection-Date: Sat, 26 Dec 2015 23:48:59 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:216200 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108490 Archived-At: 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.