From: Richard Stallman <rms@gnu.org>
To: "Andreas Röhler" <andreas.roehler@online.de>
Cc: emacs-devel@gnu.org
Subject: Re: [ra5ul@comcast.net: case-insensitive partial-completion-mode issue]
Date: Thu, 06 Dec 2007 16:43:25 -0500 [thread overview]
Message-ID: <E1J0OVB-0001Ep-Bk@fencepost.gnu.org> (raw)
In-Reply-To: <200712060902.19961.andreas.roehler@online.de> (message from Andreas Röhler on Thu, 6 Dec 2007 09:02:18 +0100)
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)
next prev parent reply other threads:[~2007-12-06 21:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1J0OVB-0001Ep-Bk@fencepost.gnu.org \
--to=rms@gnu.org \
--cc=andreas.roehler@online.de \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).