GNU bug report logs - #11360
ERC completion case-sensitive

Previous Next

Package: emacs;

Reported by: Antoine Levitt <antoine.levitt <at> gmail.com>

Date: Fri, 27 Apr 2012 13:41:02 UTC

Severity: normal

Tags: fixed

Fixed in version 25.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 11360 in the body.
You can then email your comments to 11360 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-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Fri, 27 Apr 2012 13:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Antoine Levitt <antoine.levitt <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Apr 2012 13:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Antoine Levitt <antoine.levitt <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: ERC completion case-sensitive
Date: Fri, 27 Apr 2012 15:38:34 +0200
Hi,

ERC nickname completion got case sensitive a couple of commits ago (two
days at most, I'd say), while it wasn't before. Can someone fix it?

Antoine





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Sat, 05 May 2012 03:14:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#11360: ERC completion case-sensitive
Date: Fri, 04 May 2012 23:11:27 -0400
> ERC nickname completion got case sensitive a couple of commits ago (two
> days at most, I'd say), while it wasn't before.  Can someone fix it?

It was probably me, but I fail to see how/where that happened.
Can you give me a recipe to reproduce the problem starting from `emacs -Q'?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Sat, 05 May 2012 07:53:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Antoine Levitt <antoine.levitt <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#11360: ERC completion case-sensitive
Date: Sat, 05 May 2012 09:49:50 +0200
05/05/12 05:11, Stefan Monnier
>> ERC nickname completion got case sensitive a couple of commits ago (two
>> days at most, I'd say), while it wasn't before.  Can someone fix it?
>
> It was probably me, but I fail to see how/where that happened.
> Can you give me a recipe to reproduce the problem starting from `emacs -Q'?
>
>
>         Stefan

Hi,

emacs -Q
M-x erc
Confirm irc.freenode.net
Confirm 6667
pick a random nick, no password
type /join #emacs
Pick someone in the users list with a nickname that begins with a caps
(for instance, Test), and type the first characters in his name in lower
case (for instance tes), then tab.

It used to complete to the capitalized nickname. What I think happened
is that this is now controlled by completion-ignore-case while it used
to be controlled by an erc-specific setting. I think a good way to
proceed is to introduce an erc-completion-ignore-case that defaults to
t, and ignore case in erc completion if either
erc-completion-ignore-case or completion-ignore-case is t. A specific
setting seems like a good idea because presumably some people will want
case-insensitive completion in erc but not elsewhere.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Mon, 01 Jul 2013 12:53:02 GMT) Full text and rfc822 format available.

Message #14 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Barry Warsaw <barry <at> python.org>
To: 11360 <at> debbugs.gnu.org
Subject: Case sensitive ERC nick completion regression
Date: Mon, 1 Jul 2013 08:52:13 -0400
[Message part 1 (text/plain, inline)]
Has anybody looked into this bug in more detail since the original report?
This is happening to me too, and it does seem like a regression since Emacs
24.2.
[signature.asc (application/pgp-signature, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Tue, 30 Jul 2013 20:47:02 GMT) Full text and rfc822 format available.

Message #17 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Barry Warsaw <barry <at> python.org>
Cc: 11360 <at> debbugs.gnu.org
Subject: Re: bug#11360: Case sensitive ERC nick completion regression
Date: Tue, 30 Jul 2013 16:46:45 -0400
> Has anybody looked into this bug in more detail since the original report?
> This is happening to me too, and it does seem like a regression since Emacs
> 24.2.

I just installed a patch by Stephen Berman which might help.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Thu, 11 Sep 2014 19:32:02 GMT) Full text and rfc822 format available.

Message #20 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: 11360 <at> debbugs.gnu.org
Date: Thu, 11 Sep 2014 16:31:08 -0300
I'm having the same problem with the latest pretest.

Even worst, when using bitlbee, tab completion on an empty line gives:

FirstName
SecondName
....

But tab completion after /query gives:

firstname
secondname
....

This is not only visually inconsistent but, as the completion is case
sensitive, then that a given prefix successfully completes depends on
where the completion was triggered.

Best regards
--
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Thu, 11 Sep 2014 19:59:01 GMT) Full text and rfc822 format available.

Message #23 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita <at> gmail.com>
To: 11360 <at> debbugs.gnu.org
Subject: Re: none
Date: Thu, 11 Sep 2014 16:58:13 -0300
I've been debugging a bit. Below is a fix for the case inconsistency
issue.

The case inconsistency is due to the fact that users are hashed into
erc-server-users using (erc-downcase nick). But then
pcomplete-erc-all-nicks builds the completion list from the hash
keys. This is wrong because the keys are the downcased nicks, not the
real nicks themselves. This is also inconsistent with the way
pcomplete-erc-nicks works (this one does use the real nick).

Changing (erc-server-user-nickname user) for nick in
pcomplete-erc-all-nicks will fix this one:

(defun pcomplete-erc-all-nicks (&optional postfix)
  "Returns a list of all nicks on the current server."
  (let (nicks)
    (erc-with-server-buffer
      (maphash (lambda (nick user)
                 (setq nicks (cons
                              (concat (erc-server-user-nickname user) postfix)
                              nicks)))
               erc-server-users))
      nicks))

Best regards
--
Carlos

Carlos Pita <carlosjosepita <at> gmail.com> writes:

> I'm having the same problem with the latest pretest.
>
> Even worst, when using bitlbee, tab completion on an empty line gives:
>
> FirstName
> SecondName
> ....
>
> But tab completion after /query gives:
>
> firstname
> secondname
> ....
>
> This is not only visually inconsistent but, as the completion is case
> sensitive, then that a given prefix successfully completes depends on
> where the completion was triggered.
>
> Best regards
> --
> Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Sun, 27 Dec 2015 21:27:02 GMT) Full text and rfc822 format available.

Message #26 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Barry Warsaw <barry <at> python.org>, 11360 <at> debbugs.gnu.org
Subject: Re: bug#11360: Case sensitive ERC nick completion regression
Date: Sun, 27 Dec 2015 22:26:25 +0100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> Has anybody looked into this bug in more detail since the original report?
>> This is happening to me too, and it does seem like a regression since Emacs
>> 24.2.
>
> I just installed a patch by Stephen Berman which might help.

When I try to do nick completion in erc now, it seems like it's case
sensitive again, so I think it probably worked.  And I'm closing this
report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 11360 <at> debbugs.gnu.org and Antoine Levitt <antoine.levitt <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2015 21:27:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Tue, 12 Jan 2016 19:03:01 GMT) Full text and rfc822 format available.

Message #31 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Barry Warsaw <barry <at> python.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 11360 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#11360: Case sensitive ERC nick completion regression
Date: Tue, 12 Jan 2016 14:02:39 -0500
[Message part 1 (text/plain, inline)]
On Dec 27, 2015, at 10:26 PM, Lars Ingebrigtsen wrote:

>When I try to do nick completion in erc now, it seems like it's case
>sensitive again, so I think it probably worked.  And I'm closing this
>report.

Sorry, I don't understand.  I want case-insensitive completion of nicks.

Cheers.
[Message part 2 (application/pgp-signature, inline)]

Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 12 Jan 2016 19:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Thu, 04 Feb 2016 06:47:01 GMT) Full text and rfc822 format available.

Message #36 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Barry Warsaw <barry <at> python.org>
Cc: 11360 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#11360: Case sensitive ERC nick completion regression
Date: Thu, 04 Feb 2016 17:45:36 +1100
Barry Warsaw <barry <at> python.org> writes:

> On Dec 27, 2015, at 10:26 PM, Lars Ingebrigtsen wrote:
>
>>When I try to do nick completion in erc now, it seems like it's case
>>sensitive again, so I think it probably worked.  And I'm closing this
>>report.
>
> Sorry, I don't understand.  I want case-insensitive completion of nicks.

Sorry; I misread your message.

I've now been following the completion code down the rabbit hole, and
via approx. 23 indirections, the completion is actually done by
`try-completions'.  And that respects the `completion-ignore-case'
variable.

However, TAB is bound to `completion-at-point', which does not allow any
way to have that variable be bound.  So I think we'll just have to bind
TAB to an erc function that binds that variable, and then call
`completion-at-point'.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 04 Feb 2016 06:53:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.1, send any further explanations to 11360 <at> debbugs.gnu.org and Antoine Levitt <antoine.levitt <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 04 Feb 2016 06:53:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Fri, 05 Feb 2016 13:39:02 GMT) Full text and rfc822 format available.

Message #43 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#11360: ERC completion case-sensitive
Date: Fri, 05 Feb 2016 08:38:16 -0500
> erc-completion-ignore-case or completion-ignore-case is t. A specific
> setting seems like a good idea because presumably some people will want
> case-insensitive completion in erc but not elsewhere.

There are 2 notions of "case-sensitivity" when it comes to completion:
- whether the case is semantically significant in the end result
  (i.e. is "FirstName" another user than "firstname"?).
- whether the user wants "FirstName" be considered as a valid candidate
  for completion of "fir".

The current completion code somewhat conflates the two, but in terms of
"what should Emacs do" the difference is important.  Of course, the
second consideration only applies when the first is true.

So: is the case semantically significant, here?


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Fri, 05 Feb 2016 19:09:02 GMT) Full text and rfc822 format available.

Message #46 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Barry Warsaw <barry <at> python.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 11360 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#11360: Case sensitive ERC nick completion regression
Date: Fri, 5 Feb 2016 14:08:05 -0500
[Message part 1 (text/plain, inline)]
On Feb 04, 2016, at 05:45 PM, Lars Ingebrigtsen wrote:

>I've now been following the completion code down the rabbit hole, and via
>approx. 23 indirections, the completion is actually done by
>`try-completions'.  And that respects the `completion-ignore-case' variable.
>
>However, TAB is bound to `completion-at-point', which does not allow any way
>to have that variable be bound.  So I think we'll just have to bind TAB to an
>erc function that binds that variable, and then call `completion-at-point'.

Thanks Lars.  I remember trying to chase the rabbit too when I originally
reported the problem, but quickly lost my sanity.

I think you're right about binding TAB to a special function.

Cheers,
-Barry
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Sat, 06 Feb 2016 03:18:02 GMT) Full text and rfc822 format available.

Message #49 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 11360 <at> debbugs.gnu.org
Subject: Re: bug#11360: ERC completion case-sensitive
Date: Sat, 06 Feb 2016 14:17:30 +1100
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> erc-completion-ignore-case or completion-ignore-case is t. A specific
>> setting seems like a good idea because presumably some people will want
>> case-insensitive completion in erc but not elsewhere.
>
> There are 2 notions of "case-sensitivity" when it comes to completion:
> - whether the case is semantically significant in the end result
>   (i.e. is "FirstName" another user than "firstname"?).
> - whether the user wants "FirstName" be considered as a valid candidate
>   for completion of "fir".
>
> The current completion code somewhat conflates the two, but in terms of
> "what should Emacs do" the difference is important.  Of course, the
> second consideration only applies when the first is true.
>
> So: is the case semantically significant, here?

irc retains case, but it doesn't use it to distinguish.  That is, if you
have a nick "Larsi", you can't have a nick "larsi".

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#11360; Package emacs. (Sat, 06 Feb 2016 14:07:02 GMT) Full text and rfc822 format available.

Message #52 received at 11360 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 11360 <at> debbugs.gnu.org
Subject: Re: bug#11360: ERC completion case-sensitive
Date: Sat, 06 Feb 2016 09:06:07 -0500
>>> erc-completion-ignore-case or completion-ignore-case is t. A specific
>>> setting seems like a good idea because presumably some people will want
>>> case-insensitive completion in erc but not elsewhere.
>> 
>> There are 2 notions of "case-sensitivity" when it comes to completion:
>> - whether the case is semantically significant in the end result
>> (i.e. is "FirstName" another user than "firstname"?).
>> - whether the user wants "FirstName" be considered as a valid candidate
>> for completion of "fir".
>> 
>> The current completion code somewhat conflates the two, but in terms of
>> "what should Emacs do" the difference is important.  Of course, the
>> second consideration only applies when the first is true.
>> 
>> So: is the case semantically significant, here?

> irc retains case, but it doesn't use it to distinguish.  That is, if you
> have a nick "Larsi", you can't have a nick "larsi".

Thanks, so we should indeed use completion-table-case-fold (and make it
work).


        Stefan


PS: but in the mean time, setting completion-ignore-case buffer-locally
is the better fix for emacs-25.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 06 Mar 2016 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 164 days ago.

Previous Next


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