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 16:00:13 -0800 (PST) Message-ID: <49d64550-5636-4ede-b124-6d04b874d1d7@googlegroups.com> References: <32558752-9f6e-45ea-b953-099d8fc5daf7@googlegroups.com> <97862b00-5aef-44c9-a845-f66fd05d9e2d@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 1451174718 14536 80.91.229.3 (27 Dec 2015 00:05:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 27 Dec 2015 00:05:18 +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 01:05:17 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 1aCypo-0003vl-Qq for geh-help-gnu-emacs@m.gmane.org; Sun, 27 Dec 2015 01:05:16 +0100 Original-Received: from localhost ([::1]:40275 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aCypo-000403-4F for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Dec 2015 19:05:16 -0500 X-Received: by 10.66.237.38 with SMTP id uz6mr41208659pac.12.1451174414081; Sat, 26 Dec 2015 16:00:14 -0800 (PST) X-Received: by 10.50.78.232 with SMTP id e8mr745953igx.6.1451174414049; Sat, 26 Dec 2015 16:00:14 -0800 (PST) Original-Path: usenet.stanford.edu!mv3no15541464igc.0!news-out.google.com!f6ni34690igq.0!nntp.google.com!mv3no21575268igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: <97862b00-5aef-44c9-a845-f66fd05d9e2d@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: Sun, 27 Dec 2015 00:00:14 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:216202 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:108492 Archived-At: 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!