2

I tried to follow emacswiki article about Jabber.el to configure it on my Emacs. However, my changes do not works.

  • Alerts stealth the minibuffer, and its annoying to see an alert when I'm doing something there.
  • I get alerts for every message people send to MUCs, which is something I would really like to avoid and instead being alerted when somebody highlights me.
  • I cannot set xmessage for alerts (I tried linnotify, but it doesn't works; maybe is something with my tiled window manager SpectrWM), and when some activity happens the MUC's name is added to the modeline, clobbering it.

Jabber.el is a great package, but this things make it annoying and distracting, how can I fix them?

My Emacs conf for Jabber.el:

(setf
 jabber-history-enabled t
 jabber-use-global-history nil
 jabber-backlog-number 40
 jabber-backlog-days 30
 jabber-alert-presence-message-function (lambda (who oldstatus newstatus statusnext) nil)
 jabber-invalid-certificate-servers '("chat.deshackra.com")
)

(defun notify-jabber-notify (from buf text proposed-alert)
  "Notifica sobre nuevos mensajes en Jabber vía notify.el"
  (when (or jabber-message-alert-same-buffer
           (not (memq (selected-window) (get-buffer-window-list buf))))
    (if (jabber-muc-sender-p from)
        (notify (format "(MP) %s"
                        (jabber-jid-displayname (jabber-jid-user from)))
                (format "%s: %s" (jabber-jid-resource from) text)))
    (notify (format "%s" (jabber-jid-displayname from))
            text)))

(defun my-jabber-chat-delete-or-bury ()
  (interactive)
  (if (eq 'jabber-chat-mode major-mode)
      (condition-case e 
          (delete-frame)
        (error 
         (if (string= "Attempt to delete the sole visible or iconified frame" 
                      (cadr e))
             (bury-buffer))))))

;;(define-key jabber-chat-mode-map [escape] 'my-jabber-chat-delete-or-bury)
;;(add-hook 'jabber-alert-message-hooks 'notify-jabber-notify)

(if (daemonp)
    ;; nos conecta a todas las cuentas jabber!
    (progn 
      (load-file (expand-file-name "jabber.secret.gpg" user-emacs-directory))
      (ignore-errors 
        (jabber-connect-all))))
Sean Allred
  • 6,861
  • 16
  • 85
shackra
  • 2,702
  • 18
  • 47

1 Answers1

1

If you customize the variable jabber-alert-muc-hooks (M-x customize-option RET jabber-alert-muc-hooks), you'll see that most of the alerts come in pairs, one with -personal appended, i.e. jabber-muc-echo and jabber-muc-echo-personal. Disable jabber-muc-echo and enable jabber-muc-echo-personal, and you'll only see alerts when someone highlights you.

"Highlighting" is defined as a message starting with your nick, followed by one of the symbols in jabber-muc-looks-personalising-symbols.

legoscia
  • 6,012
  • 29
  • 54
  • By some weird reason, I keep getting alerts in my mode-line. Any suggestion on how to debug this? [this is what I have related to jabber.el in my custom.el file](http://dpaste.com/245A3DG) – shackra Dec 11 '14 at 21:07
  • 1
    That's strange. Perhaps you could try `M-x debug-on-entry` on `jabber-muc-echo`, and see where it gets called from. – legoscia Dec 12 '14 at 11:02
  • The problem wasn't with `jabber-muc-echo` but with `jabber-activity-mode`, I just turn it off (`nil`) from `Easy Customization` and it fixes my issue! – shackra Dec 19 '14 at 00:25