I want to use bitlbee within emacs erc irc-client.
Problem is that erc uses ctext as default and bitlbee expects iso-8859-15 input so my umlauts show all wrong on others.
Manually setting the encoding isn't a good option as its window specific and all msn contacts open their own buffer so the encoding should apply to each of my buddies.
I didn't find any simple solution to it but thought that something like following would work.
Make a function that is called when connecting to bitlbee server to identify with server and to change encoding of each of my buddy to more appropriate one.
I don't know lisp so here's where I need the help. I got the basics of the function defined below but I don't know how to parse command output and assign it to a list.
Sample output of 'blist all' command:
Code:
<root> buddyName buddyemail@hotmail.com msn(my.email@hotm Offline
<root> buddyName2 buddy2email@hotmail.com msn(my.email@hot Offline
Code:
;; add to erc-insert-pre-hook
;; call from hook when connecting to bitlbee
(defun set-bitlbee-encoding ()
"Set encoding for each member in bitlbee buddylist"
;; list to hold buddies, for now just command window
(setq buddies '("&bitlbee"))
;; how to make the commands run on bitlbee command window?
;; activate bitlbee account; run "identify <password>"
(eval (read-from-string "(format t \"identify <password>\")"))
;; run 'blist all' and parse buddy names from it to buddies list
(setq tempbuddies '(eval (read-from-string "(format t \"blist all\")")))
(while tempbuddies
(add-to-list 'buddies (nth 2 (split-string (car tempbuddies))))
(setq tempbuddies (cdr tempbuddies)))
;; iterate through buddies and apply encoding to them
(while buddies
(add-to-list 'erc-encoding-coding-alist '((car buddies) . iso-8859-15))
(setq buddies (cdr buddies))))