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:27:38 -0800 (PST) Message-ID: <32558752-9f6e-45ea-b953-099d8fc5daf7@googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1451172622 19572 80.91.229.3 (26 Dec 2015 23:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Dec 2015 23:30:22 +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:30:21 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 1aCyHz-0006iE-2W for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Dec 2015 00:30:19 +0100 Original-Received: from localhost ([::1]:40132 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCyHy-0007bY-HK for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Dec 2015 18:30:18 -0500 X-Received: by 10.140.242.10 with SMTP id n10mr41077255qhc.9.1451172459664; Sat, 26 Dec 2015 15:27:39 -0800 (PST) X-Received: by 10.50.32.10 with SMTP id e10mr746154igi.2.1451172459630; Sat, 26 Dec 2015 15:27:39 -0800 (PST) Original-Path: usenet.stanford.edu!6no1007400qgy.0!news-out.google.com!l1ni3416igd.0!nntp.google.com!mv3no21569038igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: 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:27:39 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:216196 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:108487 Archived-At: 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))