From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.bugs Subject: bug#15419: 24.3.50; file name as directory completion problem Date: Thu, 19 Sep 2013 17:21:33 +0200 Message-ID: <87pps44z2a.fsf@rosalinde.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1379604202 28705 80.91.229.3 (19 Sep 2013 15:23:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Sep 2013 15:23:22 +0000 (UTC) To: 15419@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 19 17:23:24 2013 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 1VMg4f-0007Ds-R4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Sep 2013 17:23:22 +0200 Original-Received: from localhost ([::1]:51733 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMg4f-00008A-Dj for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Sep 2013 11:23:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMg4U-00006w-R7 for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2013 11:23:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMg4N-0007kr-Md for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2013 11:23:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMg4N-0007km-Ia for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2013 11:23:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VMg4M-0003JZ-Ii for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2013 11:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stephen Berman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Sep 2013 15:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15419 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137960413312666 (code B ref -1); Thu, 19 Sep 2013 15:23:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Sep 2013 15:22:13 +0000 Original-Received: from localhost ([127.0.0.1]:49369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMg3T-0003I5-Jr for submit@debbugs.gnu.org; Thu, 19 Sep 2013 11:22:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57010) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VMg3N-0003HW-6w for submit@debbugs.gnu.org; Thu, 19 Sep 2013 11:22:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMg3A-0007Fn-Nt for submit@debbugs.gnu.org; Thu, 19 Sep 2013 11:21:55 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMg3A-0007Fj-IO for submit@debbugs.gnu.org; Thu, 19 Sep 2013 11:21:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMg34-0007zw-3r for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2013 11:21:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMg2x-0007Dx-Ua for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2013 11:21:42 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:49283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMg2x-0007Dn-BJ for bug-gnu-emacs@gnu.org; Thu, 19 Sep 2013 11:21:35 -0400 Original-Received: from rosalinde.fritz.box ([89.245.111.227]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MYcJi-1VQbtf3PsI-00VMyW for ; Thu, 19 Sep 2013 17:21:34 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V03:K0:uRnDg2CKKjNSsG9bz6xDxAMtaNHPtpRG5Fo6/TUva1co9laeua/ iPgqE0lKv24LM0PaoNfSLzcass1VE28ko4z8+hryAZ7i6iIZBEShyiiZ7oqWWDyV7hoDc0p w99EjY0blomZxymdS5z5cTqIO3ZGG7uZ2jLwPr+AX0QTSipbG1unYBqf2qoRHD/LbUlqWRl vv1APwtJ2nnIvy06ZYyuA== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] 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:78583 Archived-At: By default, file name completion adds `/' only if needed, e.g. given the file name "~/test/bla/abc", if I type `C-x C-f ~/test/bla/abc' and in the minibuffer delete either "a" or "a/" after "bl", in both case TAB correctly completes to "~/test/bla/abc" -- unless you do the following: 1. emacs -Q 2. M-c customize-option RET completion-category-overrides RET, press INS to add a new category, choose "file" from the Value Menu. check Completion Styles, press INS and choose "substring" from the Value Menu, press State and choose "Set for Current Session". 3. Now if I type `C-x C-f ~/test/bla/abc' and in the minibuffer delete "a/" after "bl", TAB again correctly completes to "~/test/bla/abc", but if I delete just "a" after "bl", TAB incorrectly completes to "~/test/bla//abc". I think what is happening is that when completion-category-overrides is set as above, this makes completion-file-name-table call file-name-all-completions, which calls file_name_completion (dired.c), which, if the file is a directory, calls Ffile_name_as_directory (fileio.c), which unconditionally adds `/' to the file name. (Without the file override, completion-file-name-table does not call file-name-all-completions in the above test case, but completes when (eq action 'lambda).) It looks like this could be fixed by adding a condition to the following code from file_name_completion to the effect that in the absolute file name containing `name', the next character after the last character in `name' is not `/'; but I don't know how to do this in Emacs C. if (directoryp) /* This completion is a directory; make it end with '/'. */ name = Ffile_name_as_directory (name); In GNU Emacs 24.3.50.4 (x86_64-suse-linux-gnu, GTK+ Version 3.4.4) of 2013-09-12 on rosalinde Bzr revision: 114244 xfq.free@gmail.com-20130912122217-i1l0xo8mslcti8bu Windowing system distributor `The X.Org Foundation', version 11.0.11203000 System Description: openSUSE 12.2 (x86_64) Configured using: `configure --without-toolkit-scroll-bars 'CFLAGS=-g3 -O0'' Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=local locale-coding-system: utf-8-unix default enable-multibyte-characters: t