From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: Correct ido behavior? Date: Sat, 27 Feb 2010 17:05:43 +0100 Message-ID: <87k4tyy888.fsf@telefonica.net> References: <87ljeesrxf.fsf@cube.wickedbsd.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1267286769 29999 80.91.229.12 (27 Feb 2010 16:06:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 27 Feb 2010 16:06:09 +0000 (UTC) Cc: Timo Myyra To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 27 17:06:05 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NlPB6-0001s2-S8 for ged-emacs-devel@m.gmane.org; Sat, 27 Feb 2010 17:06:05 +0100 Original-Received: from localhost ([127.0.0.1]:54498 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlPB6-0004vg-CT for ged-emacs-devel@m.gmane.org; Sat, 27 Feb 2010 11:06:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NlPB1-0004va-C6 for emacs-devel@gnu.org; Sat, 27 Feb 2010 11:05:59 -0500 Original-Received: from [140.186.70.92] (port=50009 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NlPB0-0004vR-Dq for emacs-devel@gnu.org; Sat, 27 Feb 2010 11:05:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NlPAz-0007Qz-RC for emacs-devel@gnu.org; Sat, 27 Feb 2010 11:05:58 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:33723) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NlPAz-0007Qg-Kh for emacs-devel@gnu.org; Sat, 27 Feb 2010 11:05:57 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NlPAx-0001nS-DR for emacs-devel@gnu.org; Sat, 27 Feb 2010 17:05:55 +0100 Original-Received: from 83.32.115.245 ([83.32.115.245]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Feb 2010 17:05:55 +0100 Original-Received: from ofv by 83.32.115.245 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Feb 2010 17:05:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 83.32.115.245 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.92 (gnu/linux) Cancel-Lock: sha1:J6Zd9qi6i4NdL+mvMLrHKaXiVWc= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121445 Archived-At: Timo Myyra writes: > I'm using the Emacs from Bzr and I wonder if following is the normal > ido behavior. > > When I enable the "ido-use-filename-at-point" and use find-file it > works just fine if theres a file name at cursor. But if the cursor is > on empty space the find-file defaults to parent directory instead of > current directory which I expected. > > For example, if the cursor is on empty line and current working > directory is my home, then the find file starts in "/home/" instead of > "/home/zmyrgel/". > > Is this the correct behaviour or is this a bug? Please M-x report-emacs-bug and attach the patch below. === modified file 'lisp/ido.el' --- lisp/ido.el 2010-01-18 19:34:55 +0000 +++ lisp/ido.el 2010-02-27 16:02:36 +0000 @@ -2288,7 +2288,9 @@ (ffap-guesser) (ffap-string-at-point)))) (not (string-match "^http:/" fn)) - (setq d (file-name-directory (expand-file-name fn))) + (setq d (if (file-directory-p (expand-file-name fn)) + (file-name-as-directory (expand-file-name fn)) + (file-name-directory (expand-file-name fn)))) (file-directory-p d)) (setq ido-current-directory d) (setq initial (file-name-nondirectory fn))))))