GNU bug report logs -
#1976
23.0.50; PC-do-completion should fix case if possible
Previous Next
Reported by: Denis Howe <denis.howe <at> gmail.com>
Date: Wed, 21 Jan 2009 14:55:03 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 1976 in the body.
You can then email your comments to 1976 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1976
; Package
emacs
.
(Wed, 21 Jan 2009 14:55:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Denis Howe <denis.howe <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 21 Jan 2009 14:55:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
[Message part 1 (text/plain, inline)]
My 2007-10-03 attempt to get this patch applied got no further than RMS's
request for someone to DTRT. It took several hours of my time to debug and
test, and the bug still bites me every time I re-install, so PLEASE could
someone apply it? Thanks.
------------------------------------------------------------
In the latest complete.el from CVS (v1.94), function "PC-do-completion"
fails to correct the case of the input being completed when:
- "completion-ignore-case" is true and
- "read-file-name-completion-ignore-case" is true and
- all possible completions have the same case
Ordinary completion preserves input case only where the potential
completions differ in case. If they agree then ordinary completion changes
the input case to that of the prefix.
For example, evaluate:
(partial-completion-mode 0)
(setq completion-ignore-case t)
(completing-read "Input: " '(("Den".1)("Denis".2)) nil t "d")
Hitting TAB runs ordinary "minibuffer-complete" which completes "d" to "Den"
(case corrected).
Enable partial completion:
(partial-completion-mode 1)
Re-evaluate the above completing-read.
Hitting TAB now runs "PC-complete" which completes "d" to "den" (fails to
correct input case).
I've tested the attached patch thoroughly. Please contact me if you want
any more background on this.
------------------------------------------------------------
ChangeLog entry:
2009-01-21 Denis Howe <denis.howe <at> gmail.com>
* complete.el (PC-do-completion): Correct case when unambiguous.
------------------------------------------------------------
cvs diff -cw complete.el
Index: complete.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/complete.el,v
retrieving revision 1.94
diff -c -w -r1.94 complete.el
*** complete.el 9 Jan 2009 04:44:19 -0000 1.94
--- complete.el 21 Jan 2009 14:21:17 -0000
***************
*** 737,744 ****
(setq prefix (PC-try-completion
(PC-chunk-after basestr skip) poss)))
(let ((first t) i)
- ;; Retain capitalization of user input even if
- ;; completion-ignore-case is set.
(if (eq mode 'word)
(setq prefix (PC-chop-word prefix basestr)))
(goto-char (+ beg (length dirname)))
--- 737,742 ----
***************
*** 746,760 ****
(setq i 0) ; index into prefix string
(while (< i (length prefix))
(if (and (< (point) end)
(eq (downcase (aref prefix i))
! (downcase (following-char))))
! ;; same char (modulo case); no action
! (forward-char 1)
! (if (and (< (point) end)
(and (looking-at " ")
(memq (aref prefix i)
! PC-delims-list)))
;; replace " " by the actual delimiter
(progn
(delete-char 1)
(insert (substring prefix i (1+ i))))
--- 744,757 ----
(setq i 0) ; index into prefix string
(while (< i (length prefix))
(if (and (< (point) end)
+ (or
(eq (downcase (aref prefix i))
! (downcase
(following-char)))
(and (looking-at " ")
(memq (aref prefix i)
! PC-delims-list))))
;; replace " " by the actual delimiter
+ ;; or input char by prefix char
(progn
(delete-char 1)
(insert (substring prefix i (1+ i))))
***************
*** 766,772 ****
(setq end (1- end))))
(setq improved t)
(insert (substring prefix i (1+
i)))
! (setq end (1+ end)))))
(setq i (1+ i)))
(or pt (setq pt (point)))
(looking-at PC-delim-regex))
--- 763,769 ----
(setq end (1- end))))
(setq improved t)
(insert (substring prefix i (1+
i)))
! (setq end (1+ end))))
(setq i (1+ i)))
(or pt (setq pt (point)))
(looking-at PC-delim-regex))
------------------------------------------------------------
End
-- Denis Howe <denis.howe <at> gmail.com>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1976
; Package
emacs
.
(Wed, 21 Jan 2009 22:20:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 21 Jan 2009 22:20:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 1976 <at> emacsbugs.donarmstrong.com (full text, mbox):
> My 2007-10-03 attempt to get this patch applied got no further than RMS's
> request for someone to DTRT. It took several hours of my time to debug and
> test, and the bug still bites me every time I re-install, so PLEASE could
> someone apply it? Thanks.
BTW, the default completion in Emacs-23 is very close to
partial-completion-mode. More to the point, if you remove `basic' from
`completion-styles', it should be pretty much identical except for the
following known differences:
- no <foo.h> style completion for file names.
- M-x lch TAB doesn't know how to expand to `list-command-history'.
And even if you don't remove `basic', the behavior is fairly close.
Also it should fix the problem you're reporting and provides
a few improvements.
Since partial-completion-mode is slated for obsolescence (tho not
marked obsolete yet), I'm interested to hear if you find some other
missing feature.
Stefan
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1976
; Package
emacs
.
(Wed, 21 Jan 2009 22:55:06 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Stefan Monnier <monnier <at> iro.umontreal.ca>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 21 Jan 2009 22:55:06 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1976
; Package
emacs
.
(Wed, 21 Jan 2009 23:15:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Denis Howe <denis.howe <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 21 Jan 2009 23:15:03 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
[Message part 1 (text/plain, inline)]
2009/1/21 Stefan Monnier <monnier <at> iro.umontreal.ca>
> the default completion in Emacs-23 is very close to partial-completion-mode
OMG, so it is! I've been using partial-completion-mode so long I can't
remember why I turned it on. What's even stupider is that I've never
actually used the "partial" feature. Thanks very much for the
enlightenment.
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#1976
; Package
emacs
.
(Wed, 21 Jan 2009 23:15:04 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Denis Howe <denis.howe <at> gmail.com>
:
Extra info received and forwarded to list. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
(Wed, 21 Jan 2009 23:15:04 GMT)
Full text and
rfc822 format available.
Reply sent
to
Chong Yidong <cyd <at> stupidchicken.com>
:
You have taken responsibility.
(Wed, 28 Jan 2009 15:45:05 GMT)
Full text and
rfc822 format available.
Notification sent
to
Denis Howe <denis.howe <at> gmail.com>
:
bug acknowledged by developer.
(Wed, 28 Jan 2009 15:45:05 GMT)
Full text and
rfc822 format available.
Message #30 received at 1976-done <at> emacsbugs.donarmstrong.com (full text, mbox):
> > the default completion in Emacs-23 is very close to
> > partial-completion-mode
>
> OMG, so it is! I've been using partial-completion-mode so long I
> can't remember why I turned it on. What's even stupider is that I've
> never actually used the "partial" feature. Thanks very much for the
> enlightenment.
In any case, I've checked in your patch to complete.el. Thanks.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> emacsbugs.donarmstrong.com
.
(Thu, 26 Feb 2009 15:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 16 years and 173 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.