summaryrefslogtreecommitdiff
path: root/jabber-activity.el
diff options
context:
space:
mode:
authorMagnus Henoch <mange@freemail.hu>2007-07-16 18:04:29 +0000
committerKirill A. Korinskiy <catap@catap.ru>2007-07-16 18:04:29 +0000
commitba2beadda9e557fdb900506d59a5a5e1093edc5a (patch)
treedc750a3fb895badec31257786568e5b528ab5a33 /jabber-activity.el
parentc61716f16eac7df0b006ac7c3c018289607105fa (diff)
Revision: mange@freemail.hu--2005/emacs-jabber--cvs-head--0--patch-367
Creator: Magnus Henoch <mange@freemail.hu> Switch back to non-Jabber buffer in jabber-activity-switch-to Patch by Anthony Chaumas-Pellet
Diffstat (limited to 'jabber-activity.el')
-rw-r--r--jabber-activity.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/jabber-activity.el b/jabber-activity.el
index a62cd53..4da1c21 100644
--- a/jabber-activity.el
+++ b/jabber-activity.el
@@ -293,17 +293,23 @@ when there are unread messages which otherwise would be lost, if
;;; Interactive functions
+(defvar jabber-activity-last-buffer nil
+ "Last non-Jabber buffer used.")
+
(defun jabber-activity-switch-to (&optional jid-param)
"If JID-PARAM is provided, switch to that buffer. If JID-PARAM is nil and
there has been activity in another buffer, switch to that buffer. If no such
-buffer exists, switch back to most recently used buffer."
- (interactive)
- (if (or jid-param jabber-activity-jids)
- (let ((jid (or jid-param (car jabber-activity-jids))))
- (switch-to-buffer (jabber-activity-find-buffer-name jid))
- (jabber-activity-clean))
- ;; Switch back to the buffer used last
- (switch-to-buffer nil)))
+buffer exists, switch back to the last non Jabber chat buffer used."
+ (interactive)
+ (if (or jid-param jabber-activity-jids)
+ (let ((jid (or jid-param (car jabber-activity-jids))))
+ (unless (eq major-mode 'jabber-chat-mode)
+ (setq jabber-activity-last-buffer (current-buffer)))
+ (switch-to-buffer (jabber-activity-find-buffer-name jid))
+ (jabber-activity-clean))
+ ;; Switch back to the buffer used last
+ (when (buffer-live-p jabber-activity-last-buffer)
+ (switch-to-buffer jabber-activity-last-buffer))))
;;;###autoload
(define-minor-mode jabber-activity-mode