all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#18509: 24.3.93; [patch] erc completion case inconsistency
@ 2014-09-19 14:01 Carlos Pita
  2015-12-27 20:43 ` Lars Ingebrigtsen
  2016-02-04  6:03 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Carlos Pita @ 2014-09-19 14:01 UTC (permalink / raw)
  To: 18509

(The following was a follow up to bug #11360, but I decided to report it
separately as they're not quite the same issues and, also, because I
know how to fix this one but not the other.)

When using the bitlbee channel (this is the example I have, the issue is
not specific to bitlbee at all), 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.

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 issue. I'm not attaching an
explicit patch as the fix is quite trivial, but the resulting
pcomplete-erc-all-nicks should look like:



(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
                              ;; change this -----.
                              ;;                  v
                              (concat (erc-server-user-nickname user) postfix)
                              nicks)))
               erc-server-users))
      nicks))



Best regards
--
Carlos


------------------------------------------------------------

In GNU Emacs 24.3.93.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
 of 2014-09-11 on archiso
Windowing system distributor `The X.Org Foundation', version 11.0.11600000
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#18509: 24.3.93; [patch] erc completion case inconsistency
  2014-09-19 14:01 bug#18509: 24.3.93; [patch] erc completion case inconsistency Carlos Pita
@ 2015-12-27 20:43 ` Lars Ingebrigtsen
  2016-02-04  6:03 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-27 20:43 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 18509

Carlos Pita <carlosjosepita@gmail.com> writes:

> Changing (erc-server-user-nickname user) for nick in
> pcomplete-erc-all-nicks will fix this issue. I'm not attaching an
> explicit patch as the fix is quite trivial, but the resulting
> pcomplete-erc-all-nicks should look like:

Can you send a patch for this instead?

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#18509: 24.3.93; [patch] erc completion case inconsistency
  2014-09-19 14:01 bug#18509: 24.3.93; [patch] erc completion case inconsistency Carlos Pita
  2015-12-27 20:43 ` Lars Ingebrigtsen
@ 2016-02-04  6:03 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-04  6:03 UTC (permalink / raw)
  To: Carlos Pita; +Cc: 18509

Carlos Pita <carlosjosepita@gmail.com> writes:

> Changing (erc-server-user-nickname user) for nick in
> pcomplete-erc-all-nicks will fix this issue. I'm not attaching an
> explicit patch as the fix is quite trivial, but the resulting
> pcomplete-erc-all-nicks should look like:

Thanks; installed in emacs-25.

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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-04  6:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-19 14:01 bug#18509: 24.3.93; [patch] erc completion case inconsistency Carlos Pita
2015-12-27 20:43 ` Lars Ingebrigtsen
2016-02-04  6:03 ` Lars Ingebrigtsen

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.