* [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
@ 2007-11-29 1:03 Richard Stallman
2007-12-06 8:02 ` Andreas Röhler
2007-12-06 8:49 ` Andreas Röhler
0 siblings, 2 replies; 23+ messages in thread
From: Richard Stallman @ 2007-11-29 1:03 UTC (permalink / raw)
To: emacs-devel
Would someone please fix this and ack?
The trunk is enough.
------- Start of forwarded message -------
X-Spam-Status: No, score=1.4 required=5.0 tests=DNS_FROM_RFC_POST,
UNPARSEABLE_RELAY autolearn=no version=3.1.0
Mime-Version: 1.0 (Apple Message framework v752.2)
Content-Type: text/plain; charset=US-ASCII; format=flowed
Message-Id: <EA657C97-03FD-48A3-8C57-D41293F6665E@comcast.net>
From: rahul <ra5ul@comcast.net>
Date: Tue, 27 Nov 2007 17:07:01 -0800
To: bug-gnu-emacs@gnu.org
Subject: case-insensitive partial-completion-mode issue
(setq partial-completion-mode t)
(setq read-file-name-completion-ignore-case t)
C-x C-f fi <tab> completes to FILE.TXT
C-x C-f DI/FI <tab> completes to DIRECTORY/FILE.TXT
but, C-x C-f di/fi <tab> won't complete to DIRECTORY/FILE.TXT
i found a similar bug in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2006-11/msg00706.html
and a recent patch for it:
http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00053.html
but it didn't fix this problem (tested against current cvs).
------- End of forwarded message -------
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-11-29 1:03 [ra5ul@comcast.net: case-insensitive partial-completion-mode issue] Richard Stallman
@ 2007-12-06 8:02 ` Andreas Röhler
2007-12-06 21:43 ` Richard Stallman
2007-12-06 8:49 ` Andreas Röhler
1 sibling, 1 reply; 23+ messages in thread
From: Andreas Röhler @ 2007-12-06 8:02 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Donnerstag, 6. Dezember 2007 03:11 schrieb Richard Stallman:
> [I sent this message a week ago but did not get a response.]
>
> Would someone please fix this and ack?
> The trunk is enough.
>
> ------- Start of forwarded message -------
> X-Spam-Status: No, score=1.4 required=5.0 tests=DNS_FROM_RFC_POST,
> UNPARSEABLE_RELAY autolearn=no version=3.1.0
> Mime-Version: 1.0 (Apple Message framework v752.2)
> Content-Type: text/plain; charset=US-ASCII; format=flowed
> Message-Id: <EA657C97-03FD-48A3-8C57-D41293F6665E@comcast.net>
> From: rahul <ra5ul@comcast.net>
> Date: Tue, 27 Nov 2007 17:07:01 -0800
> To: bug-gnu-emacs@gnu.org
> Subject: case-insensitive partial-completion-mode issue
>
> (setq partial-completion-mode t)
> (setq read-file-name-completion-ignore-case t)
>
> C-x C-f fi <tab> completes to FILE.TXT
> C-x C-f DI/FI <tab> completes to DIRECTORY/FILE.TXT
>
> but, C-x C-f di/fi <tab> won't complete to DIRECTORY/FILE.TXT
>
> i found a similar bug in emacs-devel:
> http://lists.gnu.org/archive/html/emacs-devel/2006-11/msg00706.html
>
> and a recent patch for it:
> http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00053.html
>
> but it didn't fix this problem (tested against current cvs).
> ------- End of forwarded message -------
AFAIS error is in line 555 of completion.el
;; Convert search pattern to a standard regular expression
(setq regex (regexp-quote basestr)
Value of `read-file-name-completion-ignore-case' seems
not readed in.
If `read-file-name-completion-ignore-case' is t,
`regexp-quote' probably can't be used.
If I'm right so far, a case-folding `regexp-quote' is
needed.
Probably such a form is already written somewhere. Any
help appreciated.
Andreas Röhler
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-11-29 1:03 [ra5ul@comcast.net: case-insensitive partial-completion-mode issue] Richard Stallman
2007-12-06 8:02 ` Andreas Röhler
@ 2007-12-06 8:49 ` Andreas Röhler
2007-12-06 21:43 ` Richard Stallman
1 sibling, 1 reply; 23+ messages in thread
From: Andreas Röhler @ 2007-12-06 8:49 UTC (permalink / raw)
To: rms; +Cc: rahul, emacs-devel
Am Donnerstag, 6. Dezember 2007 03:11 schrieb Richard Stallman:
> [I sent this message a week ago but did not get a response.]
>
> Would someone please fix this and ack?
> The trunk is enough.
>
> ------- Start of forwarded message -------
> X-Spam-Status: No, score=1.4 required=5.0 tests=DNS_FROM_RFC_POST,
> UNPARSEABLE_RELAY autolearn=no version=3.1.0
> Mime-Version: 1.0 (Apple Message framework v752.2)
> Content-Type: text/plain; charset=US-ASCII; format=flowed
> Message-Id: <EA657C97-03FD-48A3-8C57-D41293F6665E@comcast.net>
> From: rahul <ra5ul@comcast.net>
> Date: Tue, 27 Nov 2007 17:07:01 -0800
> To: bug-gnu-emacs@gnu.org
> Subject: case-insensitive partial-completion-mode issue
>
> (setq partial-completion-mode t)
> (setq read-file-name-completion-ignore-case t)
>
> C-x C-f fi <tab> completes to FILE.TXT
> C-x C-f DI/FI <tab> completes to DIRECTORY/FILE.TXT
>
> but, C-x C-f di/fi <tab> won't complete to DIRECTORY/FILE.TXT
>
> i found a similar bug in emacs-devel:
> http://lists.gnu.org/archive/html/emacs-devel/2006-11/msg00706.html
>
> and a recent patch for it:
> http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00053.html
>
> but it didn't fix this problem (tested against current cvs).
> ------- End of forwarded message -------
>
>
BTW problem here doesn't occur, if
`case-fold-search' is t
As `read-file-name-completion-ignore-case' seems not
honoured anyway by completion.el, maybe simply drop
that var and use `case-fold-search' instead?
Andreas Röhler
GNU Emacs 23.0.50.2 (i686-pc-linux-gnu, GTK+ Version
2.10.6) of 2007-10-30
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-06 8:02 ` Andreas Röhler
@ 2007-12-06 21:43 ` Richard Stallman
2007-12-07 15:07 ` Andreas Röhler
0 siblings, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-06 21:43 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
AFAIS error is in line 555 of completion.el
;; Convert search pattern to a standard regular expression
(setq regex (regexp-quote basestr)
Value of `read-file-name-completion-ignore-case' seems
not readed in.
If `read-file-name-completion-ignore-case' is t,
`regexp-quote' probably can't be used.
How does that conclusion follow?
Can this be fixed by binding `case-fold-search' to the proper value
(probably `completion-ignore-case') around the calls that search for
or match with that regexp? If that approach won't work, can you
explain why not?
Here's a patch that I think ought to do the job.
Does it work?
*** complete.el 06 Dec 2007 08:26:56 -0500 1.81
--- complete.el 06 Dec 2007 13:10:34 -0500
***************
*** 632,655 ****
table
pred)))
(setq p compl)
! (when (and compl abbreviated)
! (if filename
! (progn
! (setq p nil)
! (dolist (x compl)
! (when (string-match regex x)
! (push x p)))
! (setq basestr (try-completion "" p)))
! (setq basestr (mapconcat 'list str "-"))
! (delete-region beg end)
! (setq end (+ beg (length basestr)))
! (insert basestr))))
(while p
(and (string-match regex (car p))
(progn
(set-text-properties 0 (length (car p)) '() (car p))
(setq poss (cons (car p) poss))))
! (setq p (cdr p))))
;; If table had duplicates, they can be here.
(delete-dups poss)
--- 632,657 ----
table
pred)))
(setq p compl)
! (when (and compl abbreviated)
! (if filename
! (progn
! (setq p nil)
! (let ((case-fold-search completion-ignore-case))
! (dolist (x compl)
! (when (string-match regex x)
! (push x p))))
! (setq basestr (try-completion "" p)))
! (setq basestr (mapconcat 'list str "-"))
! (delete-region beg end)
! (setq end (+ beg (length basestr)))
! (insert basestr))))
! (let ((case-fold-search completion-ignore-case))
(while p
(and (string-match regex (car p))
(progn
(set-text-properties 0 (length (car p)) '() (car p))
(setq poss (cons (car p) poss))))
! (setq p (cdr p)))))
;; If table had duplicates, they can be here.
(delete-dups poss)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-06 8:49 ` Andreas Röhler
@ 2007-12-06 21:43 ` Richard Stallman
2007-12-07 13:04 ` Andreas Röhler
0 siblings, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-06 21:43 UTC (permalink / raw)
To: Andreas Röhler; +Cc: ra5ul, emacs-devel
As `read-file-name-completion-ignore-case' seems not
honoured anyway by completion.el, maybe simply drop
that var and use `case-fold-search' instead?
The standard minibuffer completion routines do obey
`read-file-name-completion-ignore-case', don't they?
We just need to fix complete.el to do so.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-06 21:43 ` Richard Stallman
@ 2007-12-07 13:04 ` Andreas Röhler
2007-12-08 0:04 ` Richard Stallman
0 siblings, 1 reply; 23+ messages in thread
From: Andreas Röhler @ 2007-12-07 13:04 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Donnerstag, 6. Dezember 2007 22:43 schrieb Richard Stallman:
> As `read-file-name-completion-ignore-case' seems not
> honoured anyway by completion.el, maybe simply drop
> that var and use `case-fold-search' instead?
>
> The standard minibuffer completion routines do obey
> `read-file-name-completion-ignore-case', don't they?
Basically, see below.
> We just need to fix complete.el to do so.
>
Hope so but don't know at all.
Thanks having gratuitously ignored my mistake with
complete/completion.el
After some more checks this morning the issue AFAIS now
mixes with "completion over directories"
Emacs -Q
GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6) of 2007-11-18
~/tmp> touch Bar.txt
~/tmp> touch bar.txt
Directory up
~/>
read-file-name-completion-ignore-case ==> t
C-x C-f ~/t/B TAB ==> ~/tmp/Bar.txt
but
C-x C-f ~/t/b TAB ==> ~/t*/b Ambiguous dir name
however
C-x C-f ~/te/b TAB ==> ~/tmp/bar.txt
;;;;;;;;;;;;
Now the example given by OP
/~> touch FILE.TXT
~/> mkdir DIRECTORY
~/> touch DIRECTORY/FILE.TXT
Partial-Completion mode enabled
(setq read-file-name-completion-ignore-case t)
C-x C-f ~/F ==> F
*Completions*
FILE.TXT Foo-Bar
...
firefox-installer/ firefox/
;;;;;;;;;
OK
C-x C-f ~/f ==> f ;;;;;; as above, OK
C-x C-f ~/d/f ==> Error: if: Opening directory: datei oder Verzeichnis nicht
gefunden, /MY-PATH/d/
C-x C-f ~/D/f ==> Error: if: Opening directory: datei oder Verzeichnis nicht
gefunden, /MY-PATH/D/
But
C-x C-f ~/D/F ==> ~/DIRECTORY/FILE.TXT
;;;;;;;;;
Evaluated your patch afterwards nonetheless: as
expected same behaviour.
No ideas how to fix this at the moment.
Andreas Röhler
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-06 21:43 ` Richard Stallman
@ 2007-12-07 15:07 ` Andreas Röhler
0 siblings, 0 replies; 23+ messages in thread
From: Andreas Röhler @ 2007-12-07 15:07 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Donnerstag, 6. Dezember 2007 22:43 schrieb Richard Stallman:
> AFAIS error is in line 555 of completion.el
>
> ;; Convert search pattern to a standard regular expression
> (setq regex (regexp-quote basestr)
>
> Value of `read-file-name-completion-ignore-case' seems
> not readed in.
>
> If `read-file-name-completion-ignore-case' is t,
> `regexp-quote' probably can't be used.
>
> How does that conclusion follow?
>
That was wrong probably. Point is elsewhere seen from today.
PC-do-completion calls
file-expand-wildcards in files.el
which calls in files.el Here the case question comes in:
(defun wildcard-to-regexp (wildcard)
"Given a shell file name pattern WILDCARD, return an equivalent regexp.
The generated regexp will match a filename only if the filename
matches that wildcard according to shell rules. Only wildcards known
by `sh' are supported."
:~/DIRECTORY> ls F*
FILE.TXT
:~/DIRECTORY> ls f*
ls: Zugriff auf f* nicht möglich: Datei oder Verzeichnis nicht gefunden
:~/DIRECTORY> ls -I f*
FILE.TXT
So expansion follows `case-fold-search'?
Seems
(let ((case-fold-search completion-ignore-case))
is the right path, just not the right place?
Andreas Röhler
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-07 13:04 ` Andreas Röhler
@ 2007-12-08 0:04 ` Richard Stallman
2007-12-08 12:12 ` Andreas Röhler
0 siblings, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-08 0:04 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
Does my patch seem correct?
In other words, did it fix part of the problem?
Did it cause any new problem?
Basically, should I install it?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-08 0:04 ` Richard Stallman
@ 2007-12-08 12:12 ` Andreas Röhler
2007-12-09 12:37 ` Richard Stallman
2007-12-09 12:37 ` Richard Stallman
0 siblings, 2 replies; 23+ messages in thread
From: Andreas Röhler @ 2007-12-08 12:12 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 887 bytes --]
Am Samstag, 8. Dezember 2007 01:04 schrieb Richard Stallman:
> Does my patch seem correct?
>
> In other words, did it fix part of the problem?
> Did it cause any new problem?
> Basically, should I install it?
>
>
20071208-an-ed.txt
No. It's not there, at least not for this bug.
Meanwhile I think I got the error:
`wildcard-to-regexp' returns always case-sensitive.
Attached the edebug-messages for that part.
Avoiding a call to `wildcard-to-regexp' when
`(directory-files' is called within
`file-expand-wildcards' solves the problem here.
As it's in the core of files.el, I'd hesitate to change
it there. Maybe complete.el should have an own
`file-expand-wildcards'-function?
Attached the diff against CVS files.el so far.
BTW `read-file-name-completion-ignore-case' can't be
saved after customization to `t' with Emacs -Q.
Andreas Röhler
[-- Attachment #2: 20071208-an-ed.txt --]
[-- Type: text/plain, Size: 1058 bytes --]
20071208-an-ed.txt
Result: "F*"
Result: "\\`F[^\0]*\\'"
Result: ("FILE.TXT")
Result: "f*"
Result: "\\`f[^\0]*\\'"
Result: nil
if: Reading directory: datei oder Verzeichnis nicht gefunden, /home/speck/DIR
diff -c MY-PATH/emacs/20071207/emacs/lisp/files.el MY-PATH/progarbeit/emacs/veraendert/files.el
*** MY-PATH/emacs/20071207/emacs/lisp/files.el 2007-12-07 11:13:22.000000000 +0100
--- MY-PATH/progarbeit/emacs/veraendert/files.el 2007-12-08 13:03:37.000000000 +0100
***************
*** 4796,4802 ****
(file-name-nondirectory name))
name))
(directory-files (or (car dirs) ".") full
! (wildcard-to-regexp nondir))))))
(setq contents
(nconc
(if (and (car dirs) (not full))
--- 4796,4805 ----
(file-name-nondirectory name))
name))
(directory-files (or (car dirs) ".") full
!
! ;;; (wildcard-to-regexp nondir)
! nondir
! )))))
(setq contents
(nconc
(if (and (car dirs) (not full))
Diff finished. Sat Dec 8 13:03:51 2007
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-08 12:12 ` Andreas Röhler
@ 2007-12-09 12:37 ` Richard Stallman
2007-12-10 6:37 ` Andreas Röhler
2007-12-09 12:37 ` Richard Stallman
1 sibling, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-09 12:37 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
Meanwhile I think I got the error:
`wildcard-to-regexp' returns always case-sensitive.
I disagree with that statement.
For instance, (wildcard-to-regexp "foo*") returns "\\`foo[^
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-08 12:12 ` Andreas Röhler
2007-12-09 12:37 ` Richard Stallman
@ 2007-12-09 12:37 ` Richard Stallman
2007-12-10 7:34 ` Andreas Röhler
1 sibling, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-09 12:37 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
Your patch consists of passing the wildcard string to `directory-files'
instead of a regexp. The third argument of `directory-files' is supposed
to be a regexp, so how can that be right?
What I see in the code is that `directory-files' does case-sensitive
matching on systems where file names are case-sensitive. That seems correct.
As far as I can see, `file-expand-wildcards' is correct too.
If you think there is a bug in `file-expand-wildcards', can you please
provide a test case for that bug?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-09 12:37 ` Richard Stallman
@ 2007-12-10 6:37 ` Andreas Röhler
2007-12-10 15:18 ` Richard Stallman
0 siblings, 1 reply; 23+ messages in thread
From: Andreas Röhler @ 2007-12-10 6:37 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Sonntag, 9. Dezember 2007 13:37 schrieb Richard Stallman:
> Meanwhile I think I got the error:
>
> `wildcard-to-regexp' returns always case-sensitive.
>
> I disagree with that statement.
>
> For instance, (wildcard-to-regexp "foo*") returns "\\`foo[^
Yes, but never "\\`fOo[^ or "\\`FOo[^ or or "\\`Foo[^
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-09 12:37 ` Richard Stallman
@ 2007-12-10 7:34 ` Andreas Röhler
2007-12-10 15:19 ` Richard Stallman
0 siblings, 1 reply; 23+ messages in thread
From: Andreas Röhler @ 2007-12-10 7:34 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Sonntag, 9. Dezember 2007 13:37 schrieb Richard Stallman:
> Your patch consists of passing the wildcard string to `directory-files'
> instead of a regexp. The third argument of `directory-files' is supposed
> to be a regexp, so how can that be right?
>
I just played around looking for a working
expression. That worked, which doesn't mean, it's
perfect.
Here my forms to check it (both are effective):
;;; (defun my-directory-files ()
;;; " "
;;; (interactive)
;;; (setq case-fold-search nil)
;;; (message "%s" (directory-files (expand-file-name
(substitute-in-file-name "~/DIRECTORY/DIRECTORY/")) t "f*"))
;;; (setq case-fold-search t)
;;; (message "%s" (directory-files (expand-file-name
(substitute-in-file-name "~/DIRECTORY/DIRECTORY/")) t "f*"))
;;; (setq case-fold-search nil)
;;; (message "%s" (directory-files (expand-file-name
(substitute-in-file-name "~/DIRECTORY/DIRECTORY/")) t "F*"))
;;; (setq case-fold-search t)
;;; (message "%s" (directory-files (expand-file-name
(substitute-in-file-name "~/DIRECTORY/DIRECTORY/")) t "F*")))
(defun my-directory-files ()
" "
(interactive)
(setq case-fold-search nil)
(message "%s" (directory-files default-directory t "f*"))
(setq case-fold-search t)
(message "%s" (directory-files default-directory t "f*"))
(setq case-fold-search nil)
(message "%s" (directory-files default-directory t "F*"))
(setq case-fold-search t)
(message "%s" (directory-files default-directory t "F*")))
;;; ==> (MY-PATH/DIRECTORY/DIRECTORY/. MY-PATH/DIRECTORY/DIRECTORY/..
MY-PATH/DIRECTORY/DIRECTORY/FILE.TXT) [4 times]
;;;;;;;;;;;;
Probably expression should start with `\\`'
Case-insensitive partial-completion now worked with
empty or nearly empty directories.
However, starting at HOMEDIR, Emacs never returned.
Reason I suspect in that, possible completions now
factorize. Case-insensitiveness might be good for a
single search, not for a wide range of combinations.
From there status quo seems better and more useful than
realising that feature, which might cause bug-reports
when called from filled directories.
So if my first impression was:
"Value of `read-file-name-completion-ignore-case' seems
not readed in."
AFAIU it should stay so. Maybe doku of pcm could tell about that.
> What I see in the code is that `directory-files' does case-sensitive
> matching on systems where file names are case-sensitive.
Don't think so. See result ==> ... [4 times]
Matching ignored value of case-fold-search.
> That seems
> correct. As far as I can see, `file-expand-wildcards' is correct too.
Yes
Andreas Röhler
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-10 6:37 ` Andreas Röhler
@ 2007-12-10 15:18 ` Richard Stallman
2007-12-10 17:03 ` Andreas Röhler
0 siblings, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-10 15:18 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
> For instance, (wildcard-to-regexp "foo*") returns "\\`foo[^
Yes, but never "\\`fOo[^ or "\\`FOo[^ or or "\\`Foo[^
You are being too terse. I do not understand your point.
Would it help if someone who speaks German contacts you
so you can explain your point to him in German?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-10 7:34 ` Andreas Röhler
@ 2007-12-10 15:19 ` Richard Stallman
2007-12-10 17:17 ` Andreas Röhler
0 siblings, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-10 15:19 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
(defun my-directory-files ()
" "
(interactive)
(setq case-fold-search nil)
(message "%s" (directory-files default-directory t "f*"))
(setq case-fold-search t)
(message "%s" (directory-files default-directory t "f*"))
(setq case-fold-search nil)
(message "%s" (directory-files default-directory t "F*"))
(setq case-fold-search t)
(message "%s" (directory-files default-directory t "F*")))
directory-files is supposed to ignore case
if the system treats file names as case-insensitive.
It does not obey case-fold-search.
;;; ==> (MY-PATH/DIRECTORY/DIRECTORY/. MY-PATH/DIRECTORY/DIRECTORY/..
MY-PATH/DIRECTORY/DIRECTORY/FILE.TXT) [4 times]
What system are you using?
Perhaps we need something like directory-files which does obey
case-fold-search. Is that the issue?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-10 15:18 ` Richard Stallman
@ 2007-12-10 17:03 ` Andreas Röhler
0 siblings, 0 replies; 23+ messages in thread
From: Andreas Röhler @ 2007-12-10 17:03 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Montag, 10. Dezember 2007 16:18 schrieb Richard Stallman:
> > For instance, (wildcard-to-regexp "foo*") returns "\\`foo[^
>
> Yes, but never "\\`fOo[^ or "\\`FOo[^ or or "\\`Foo[^
>
> You are being too terse.
Sorry for that. Seems I'm not strong in communication.
> I do not understand your point.
>
> Would it help if someone who speaks German contacts you
> so you can explain your point to him in German?
>
>
Always welcome. As you have my tel.no, please feel free
to give it to any person which might be helpful.
In this question however I think we may close that
thread, as the original case is settled (at least in my
mind): `partial-completion-mode' always should act
case-sensitive, otherwise Emacs will crash because of
too much calculation in certain conditions. It's no
need to change the code, it works fine as is.
Andreas Röhler
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-10 15:19 ` Richard Stallman
@ 2007-12-10 17:17 ` Andreas Röhler
2007-12-11 19:00 ` Richard Stallman
0 siblings, 1 reply; 23+ messages in thread
From: Andreas Röhler @ 2007-12-10 17:17 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Montag, 10. Dezember 2007 16:19 schrieb Richard Stallman:
> (defun my-directory-files ()
> " "
> (interactive)
> (setq case-fold-search nil)
> (message "%s" (directory-files default-directory t "f*"))
> (setq case-fold-search t)
> (message "%s" (directory-files default-directory t "f*"))
> (setq case-fold-search nil)
> (message "%s" (directory-files default-directory t "F*"))
> (setq case-fold-search t)
> (message "%s" (directory-files default-directory t "F*")))
>
> directory-files is supposed to ignore case
> if the system treats file names as case-insensitive.
> It does not obey case-fold-search.
>
> ;;; ==> (MY-PATH/DIRECTORY/DIRECTORY/. MY-PATH/DIRECTORY/DIRECTORY/..
> MY-PATH/DIRECTORY/DIRECTORY/FILE.TXT) [4 times]
>
> What system are you using?
>
Suse 10.2, GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6) of
2007-12-09
> Perhaps we need something like directory-files which does obey
> case-fold-search. Is that the issue?
>
As said in other thread: it's nothing to
do. Case-sensitivenes is TRT here, case-fold would lead
into never ending trouble because of
multiplied--factorizing--calculations.
Think someone want to partial-complete not just one
~/DIRECTORY/FILE.TXT
but ~/d/d/d/d/f
with maybe several hundred files starting with [dD] in
the directories. Emacs wouldn't return from that task.
Here I see a soure of never ending bug reports.
Better to tell: partial-completion-mode works
case-sensitive. (As is, fine!)
Andreas Röhler
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-10 17:17 ` Andreas Röhler
@ 2007-12-11 19:00 ` Richard Stallman
2007-12-12 7:11 ` Andreas Röhler
0 siblings, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-11 19:00 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
> directory-files is supposed to ignore case
> if the system treats file names as case-insensitive.
> It does not obey case-fold-search.
>
> ;;; ==> (MY-PATH/DIRECTORY/DIRECTORY/. MY-PATH/DIRECTORY/DIRECTORY/..
> MY-PATH/DIRECTORY/DIRECTORY/FILE.TXT) [4 times]
>
> What system are you using?
>
Suse 10.2, GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6) of
2007-12-09
That is very strange! On GNU/Linux, directory-files is supposed
to be case-sensitive. And when I try it, it is case-sensitive.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-11 19:00 ` Richard Stallman
@ 2007-12-12 7:11 ` Andreas Röhler
2007-12-12 22:52 ` Richard Stallman
2007-12-14 21:52 ` Sven Joachim
0 siblings, 2 replies; 23+ messages in thread
From: Andreas Röhler @ 2007-12-12 7:11 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
Am Dienstag, 11. Dezember 2007 20:00 schrieb Richard Stallman:
> > directory-files is supposed to ignore case
> > if the system treats file names as case-insensitive.
> > It does not obey case-fold-search.
> >
> > ;;; ==> (MY-PATH/DIRECTORY/DIRECTORY/.
> > MY-PATH/DIRECTORY/DIRECTORY/.. MY-PATH/DIRECTORY/DIRECTORY/FILE.TXT)
> > [4 times]
> >
> > What system are you using?
>
> Suse 10.2, GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6)
> of 2007-12-09
>
> That is very strange! On GNU/Linux, directory-files is supposed
> to be case-sensitive. And when I try it, it is case-sensitive.
>
>
Meanwhile I discovered: with that test-form, Emacs not only
reads case-insensitive all "[fF]", but the whole
directory is grasped.
Maybe that's correct in that circumstances? Didn't
encounter problems with `directory-files' elsewhere.
Probably it's that incomplete regexp which caused that.
Andreas Röhler
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-12 7:11 ` Andreas Röhler
@ 2007-12-12 22:52 ` Richard Stallman
2007-12-14 21:28 ` Andreas Röhler
2007-12-14 21:52 ` Sven Joachim
1 sibling, 1 reply; 23+ messages in thread
From: Richard Stallman @ 2007-12-12 22:52 UTC (permalink / raw)
To: Andreas Röhler; +Cc: emacs-devel
Meanwhile I discovered: with that test-form, Emacs not only
reads case-insensitive all "[fF]", but the whole
directory is grasped.
Can you try debugging this with GDB?
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-12 22:52 ` Richard Stallman
@ 2007-12-14 21:28 ` Andreas Röhler
2007-12-16 19:35 ` Richard Stallman
0 siblings, 1 reply; 23+ messages in thread
From: Andreas Röhler @ 2007-12-14 21:28 UTC (permalink / raw)
To: rms; +Cc: Sven Joachim, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
Am Mittwoch, 12. Dezember 2007 23:52 schrieb Richard Stallman:
> Meanwhile I discovered: with that test-form, Emacs not only
> reads case-insensitive all "[fF]", but the whole
> directory is grasped.
>
> Can you try debugging this with GDB?
>
>
Attached what came from bt with break at
`directory_files_internal'
Having no experience with gdb, my possibilities are
quite restricted. Nonetheless, if you may
tell me how to proceed I will try my best.
Andreas Röhler
GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6) of 2007-12-09
[-- Attachment #2: bt1.txt.gz --]
[-- Type: application/x-gzip, Size: 1101 bytes --]
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-12 7:11 ` Andreas Röhler
2007-12-12 22:52 ` Richard Stallman
@ 2007-12-14 21:52 ` Sven Joachim
1 sibling, 0 replies; 23+ messages in thread
From: Sven Joachim @ 2007-12-14 21:52 UTC (permalink / raw)
To: Andreas Röhler; +Cc: rms, emacs-devel
On 2007-12-12 08:11 +0100, Andreas Röhler wrote:
> Am Dienstag, 11. Dezember 2007 20:00 schrieb Richard Stallman:
>> > directory-files is supposed to ignore case
>> > if the system treats file names as case-insensitive.
>> > It does not obey case-fold-search.
>> >
>> > ;;; ==> (MY-PATH/DIRECTORY/DIRECTORY/.
>> > MY-PATH/DIRECTORY/DIRECTORY/.. MY-PATH/DIRECTORY/DIRECTORY/FILE.TXT)
>> > [4 times]
>> >
>> > What system are you using?
>>
>> Suse 10.2, GNU Emacs 23.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.10.6)
>> of 2007-12-09
>>
>> That is very strange! On GNU/Linux, directory-files is supposed
>> to be case-sensitive. And when I try it, it is case-sensitive.
>>
>>
>
> Meanwhile I discovered: with that test-form, Emacs not only
> reads case-insensitive all "[fF]", but the whole
> directory is grasped.
That's because your regexp was actually "[fF]*" which matches any
string, even an empty one, and thus any filename. You want to use
something like "^[fF]" instead.
Sven
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
2007-12-14 21:28 ` Andreas Röhler
@ 2007-12-16 19:35 ` Richard Stallman
0 siblings, 0 replies; 23+ messages in thread
From: Richard Stallman @ 2007-12-16 19:35 UTC (permalink / raw)
To: Andreas Röhler; +Cc: svenjoac, emacs-devel
Attached what came from bt with break at
`directory_files_internal'
Try using the `n' and `s' commands to step thru from there,
and examine relevant Lisp Object values with the `pr' command.
See the file etc/DEBUG for specific Emacs debugging advice and the GDB
manual for general GDB usage advice.
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2007-12-16 19:35 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29 1:03 [ra5ul@comcast.net: case-insensitive partial-completion-mode issue] Richard Stallman
2007-12-06 8:02 ` Andreas Röhler
2007-12-06 21:43 ` Richard Stallman
2007-12-07 15:07 ` Andreas Röhler
2007-12-06 8:49 ` Andreas Röhler
2007-12-06 21:43 ` Richard Stallman
2007-12-07 13:04 ` Andreas Röhler
2007-12-08 0:04 ` Richard Stallman
2007-12-08 12:12 ` Andreas Röhler
2007-12-09 12:37 ` Richard Stallman
2007-12-10 6:37 ` Andreas Röhler
2007-12-10 15:18 ` Richard Stallman
2007-12-10 17:03 ` Andreas Röhler
2007-12-09 12:37 ` Richard Stallman
2007-12-10 7:34 ` Andreas Röhler
2007-12-10 15:19 ` Richard Stallman
2007-12-10 17:17 ` Andreas Röhler
2007-12-11 19:00 ` Richard Stallman
2007-12-12 7:11 ` Andreas Röhler
2007-12-12 22:52 ` Richard Stallman
2007-12-14 21:28 ` Andreas Röhler
2007-12-16 19:35 ` Richard Stallman
2007-12-14 21:52 ` Sven Joachim
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.