GNU bug report logs - #227
partial-completion-mode and completion-ignore-case combine to make 'read-file-name return a subdirectory when user enters the parent

Previous Next

Package: emacs;

Reported by: Trey Jackson <tjackson <at> wv.mentorg.com>

Date: Mon, 12 May 2008 18:30:02 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 227 in the body.
You can then email your comments to 227 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#227; Package emacs. Full text and rfc822 format available.

Acknowledgement sent to Trey Jackson <tjackson <at> wv.mentorg.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Trey Jackson <tjackson <at> wv.mentorg.com>
To: bug-gnu-emacs <at> gnu.org
Subject: partial-completion-mode and completion-ignore-case combine to make 'read-file-name return a subdirectory when user enters the parent
Date: Mon, 12 May 2008 11:23:25 -0700
scenario:  you have a directory (/scratch2/rfn-bug) that contains some number of files, and one sub-directory (/scratch2/rfn-bug/frog).
You are prompted for a file name via 'read-file-name, you enter "/scratch2/rfn-bug" and that is properly returned, you enter "/scratch2/rfn-bug/" and what is returned is "/scratch2/rfn-bug/frog"

To reproduce:

in a shell:
  mkdir /scratch2/rfn-bug
  touch /scratch2/rfn-bug/a
  touch /scratch2/rfn-bug/b
  mkdir /scratch2/rfn-bug/frog

Run emacs, and then evaluate:

   (setq read-file-name-completion-ignore-case t)
   (require 'complete)
   (partial-completion-mode t)
   (read-file-name prompt dir dir 'must-match nil 'file-directory-p)

When you enter "/scratch2/rfn-bug", you'll get back "/scratch2/rfn-bug"
When you enter "/scratch2/rfn-bug/", you'll get back "/scratch2/rfn-bug/frog"

If read-file-name-completion-ignore-case is nil, this problem does not happen.
If there are more than one subdirectory, this problem does not happen.
If the single subdirectory is a link, you get the same behavior.
Running on linux (as seen below).

I built this version of Emacs myself, but did nothing custom, just the
standard ./configure, gmake, gmake install.  This bug was reproduced running 
emacs w/out an initialization file.



thanks,

TJ



In GNU Emacs 22.1.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2007-06-13 on quartzville
Windowing system distributor `The X.Org Foundation', version 11.0.60802000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  partial-completion-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
<down-mouse-2> <mouse-2> <down-mouse-2> <mouse-2> C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-e C-b <backspace> 
<backspace> <backspace> t C-e C-j C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-e C-p C-e C-j / <return> <help-echo> 
( r e q u i r e SPC ' c o m p l e t e ) C-j C-p C-p 
C-p C-p C-e C-j / <return> C-n C-n C-n C-n ( p a r 
t i a l - c o m p l e t i o n - m o d e SPC t ) C-j 
C-p C-p C-p C-p C-p C-p C-p C-p C-e C-j / <return> 
<help-echo> M-x e m a <backspace> <backspace> <backspace> 
r e p o <tab> <backspace> o r <tab> <return>

Recent messages:
("emacs" "-q")
For information about the GNU Project and its goals, type C-h C-p. [2 times]
Mark set
prompt here after complete/scratch2/rfn-bug/
Loading advice...done
prompt here after complete/scratch2/rfn-bug/
prompt here after complete/scratch2/rfn-bug/frog/
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done




Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Trey Jackson <tjackson <at> wv.mentorg.com>:
bug acknowledged by developer. Full text and rfc822 format available.

Message #10 received at 227-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Trey Jackson <tjackson <at> wv.mentorg.com>
Cc: 227-done <at> debbugs.gnu.org
Subject: Re: partial-completion-mode and completion-ignore-case combine to make 'read-file-name return a subdirectory when user enters the parent
Date: Sun, 07 Sep 2008 17:02:12 -0400
>   mkdir /scratch2/rfn-bug
>   touch /scratch2/rfn-bug/a
>   touch /scratch2/rfn-bug/b
>   mkdir /scratch2/rfn-bug/frog
>
> Run emacs, and then evaluate:
>
>    (setq read-file-name-completion-ignore-case t)
>    (require 'complete)
>    (partial-completion-mode t)
>    (read-file-name prompt dir dir 'must-match nil 'file-directory-p)
>
> When you enter "/scratch2/rfn-bug/", you'll get back
> "/scratch2/rfn-bug/frog"

I've checked in a fix into CVS.  Thanks for the bug report.




bug archived. Request was from Debbugs Internal Request <don <at> donarmstrong.com> to internal_control <at> emacsbugs.donarmstrong.com. (Mon, 06 Oct 2008 14:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 261 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.