From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#16747: 24.3.50; ido-find-file with ido-use-filename-at-point in dired inserts directory at point twice Date: Fri, 14 Feb 2014 08:05:32 +0200 Message-ID: <871tz61b6b.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1392358032 16434 80.91.229.3 (14 Feb 2014 06:07:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Feb 2014 06:07:12 +0000 (UTC) To: 16747@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 14 07:07:19 2014 Return-path: Envelope-to: geb-bug-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 1WEBvi-0007ZG-8d for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 07:07:18 +0100 Original-Received: from localhost ([::1]:49919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEBvh-0002wn-PO for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Feb 2014 01:07:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEBvY-0002wB-JD for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 01:07:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEBvS-0004In-Ot for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 01:07:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEBvS-0004Ig-LJ for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 01:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WEBvS-0004YC-9W for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 01:07:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Feb 2014 06:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 16747 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.139235797017402 (code B ref -1); Fri, 14 Feb 2014 06:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2014 06:06:10 +0000 Original-Received: from localhost ([127.0.0.1]:51484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WEBuc-0004Wb-AH for submit@debbugs.gnu.org; Fri, 14 Feb 2014 01:06:10 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:45444) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WEBuZ-0004WH-UM for submit@debbugs.gnu.org; Fri, 14 Feb 2014 01:06:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEBuO-00047H-KC for submit@debbugs.gnu.org; Fri, 14 Feb 2014 01:06:02 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40221) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEBuO-00047D-Gy for submit@debbugs.gnu.org; Fri, 14 Feb 2014 01:05:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEBuI-0002rT-C9 for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 01:05:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WEBuC-00045M-Hj for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 01:05:50 -0500 Original-Received: from mail-ea0-x235.google.com ([2a00:1450:4013:c01::235]:55362) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WEBuC-00045H-9E for bug-gnu-emacs@gnu.org; Fri, 14 Feb 2014 01:05:44 -0500 Original-Received: by mail-ea0-f181.google.com with SMTP id k10so3318346eaj.40 for ; Thu, 13 Feb 2014 22:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=vxl4GpSeNu372YUWCLBZl9ZPGfKdtU3C/cf8Td5wVe4=; b=xTBynAngZFKyadLyFd4UsKtXiO5xK9RqGJKMFs/Y15KzOgoeZpRI4TIviwCEdvJUX2 MsQvy9OMOBlXq2dZv1rJ6Q7uzyoGD28TgWaLbWatt91OUjfaW9Am1UjJjIwu1KjAT3HY fUr4Qyh7l6BcZkqnLp5f8J2zhGYMWO5qHHOuY4izZqjvkHeCIXtHD7dHX5pC+IVyhs82 TXLnLqcj6yVjzhMDIfSfuY+wgZ9ZvWCjOWzz3YMhB3Hpn8e1bUgi51Ctaf1hPFDbsMFv D6eyzutYGssJmmMUcidlAjrXyHHvm/dM908GcRFKJBVzaIaJHFCxS1Q5B3KrQ9y/ZvNT cmYA== X-Received: by 10.14.22.5 with SMTP id s5mr288015ees.85.1392357943531; Thu, 13 Feb 2014 22:05:43 -0800 (PST) Original-Received: from axl ([93.109.195.252]) by mx.google.com with ESMTPSA id j41sm15622047eey.15.2014.02.13.22.05.39 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 13 Feb 2014 22:05:41 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:85533 Archived-At: --=-=-= Content-Type: text/plain Tags: patch 1. (setq ido-use-filename-at-point t) 2. M-x ido-mode 3. Open a Dired buffer, move point to a directory, press C-x C-f. 4. See the directory name inserted in the prompt both as directory and a file name. In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.8.6) of 2014-02-07 on axl Repository revision: 116299 rgm@gnu.org-20140207032552-3ycw6hai2zl7yynq Windowing system distributor `The X.Org Foundation', version 11.0.11405000 System Description: Ubuntu 13.10 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=ido-use-filename-at-point.diff === modified file 'lisp/ido.el' --- lisp/ido.el 2014-01-31 06:34:44 +0000 +++ lisp/ido.el 2014-02-14 05:59:01 +0000 @@ -2375,14 +2375,14 @@ (if (eq ido-use-filename-at-point 'guess) (ffap-guesser) (ffap-string-at-point)))) - (not (string-match "^http:/" fn)) - (let ((absolute-fn (expand-file-name fn))) - (setq d (if (file-directory-p absolute-fn) - (file-name-as-directory absolute-fn) - (file-name-directory absolute-fn)))) - (file-directory-p d)) - (setq ido-current-directory d) - (setq initial (file-name-nondirectory fn)))))) + (not (string-match "^http:/" fn))) + (let ((absolute-fn (expand-file-name fn))) + (cond + ((file-directory-p absolute-fn) + (setq ido-current-directory (file-name-as-directory absolute-fn))) + ((file-directory-p (file-name-directory absolute-fn)) + (setq ido-current-directory (file-name-directory absolute-fn)) + (setq initial (file-name-nondirectory absolute-fn))))))))) (let (ido-saved-vc-hb (vc-handled-backends (and (boundp 'vc-handled-backends) vc-handled-backends)) --=-=-=--