Created
May 8, 2013 00:00
-
-
Save legumbre/5537184 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(defun erc-format-privmessage (nick msg privp msgp) | |
"Format a PRIVMSG in an insertable fashion." | |
(let* ((mark-s (if msgp (if privp "*" "") "-")) | |
(mark-e (if msgp (if privp "*" ">") "-")) | |
(str (format "%s%s%s %s" mark-s nick mark-e msg)) | |
(nick-face (if privp 'erc-nick-msg-face 'erc-nick-default-face)) | |
(msg-face (if privp 'erc-direct-msg-face 'erc-default-face))) | |
;; add text properties to text before the nick, the nick and after the nick | |
(erc-put-text-property 0 (length mark-s) 'face msg-face str) | |
(erc-put-text-property (length mark-s) (+ (length mark-s) (length nick)) | |
'face nick-face str) | |
(erc-put-text-property (+ (length mark-s) (length nick)) (length str) | |
'face msg-face str) | |
str)) | |
(setq erc-insert-timestamp-function 'erc-insert-timestamp-right) | |
(setq erc-timestamp-format "%H:%M") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment