The few things that annoy me of that interface is that to ping users, in slack you are expected to prepend the nick with an at sign. That makes autocompletion kinda useless because, as this redditor explains , it's a pain in the ass to type the nick, autocomplete, go back, add the @ sign, and move forward.
I haven't found a way to solve this in an elegant way, but as a hack, I could add tihs advice functions that will understand @nick as well as 'nick' when autocompleting. I'd love to be able to just type the name and the autocompletion framework fill the '@' sign itself, but I couldn't find it, so I'll try this approach I got so far and see if it works well enough for me.
I hope it's useful for some of you, dear emacslackers :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; http://puntoblogspot.blogspot.com.es/2017/01/autocomplete-erc-nicks-with-sign-for.html | |
(defun rgc-add-@-to-nicks (old-function &rest arguments) | |
"Add @nick alternatives to erc completion function." | |
(apply 'append | |
(mapcar (lambda (x) (list (concat "@" x) x)) | |
(apply old-function arguments)))) | |
(advice-add #'pcomplete-erc-nicks :around #'rgc-add-@-to-nicks) | |
;; Remove advice evaluating the following: | |
;; (advice-remove 'pcomplete-erc-nicks #'rgc-add-@-to-nicks) | |
No hay comentarios:
Publicar un comentario