From: Magnus H. <leg...@us...> - 2007-07-16 18:04:35
|
Update of /cvsroot/emacs-jabber/emacs-jabber In directory sc8-pr-cvs17:/tmp/cvs-serv6598 Modified Files: AUTHORS jabber-activity.el Log Message: Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-367 Creator: Magnus Henoch <ma...@fr...> Switch back to non-Jabber buffer in jabber-activity-switch-to Patch by Anthony Chaumas-Pellet Index: jabber-activity.el =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-activity.el,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- jabber-activity.el 5 Feb 2007 21:59:03 -0000 1.27 +++ jabber-activity.el 16 Jul 2007 18:04:29 -0000 1.28 @@ -293,17 +293,23 @@ ;;; 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 Index: AUTHORS =================================================================== RCS file: /cvsroot/emacs-jabber/emacs-jabber/AUTHORS,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- AUTHORS 28 Apr 2007 15:00:36 -0000 1.9 +++ AUTHORS 16 Jul 2007 18:04:29 -0000 1.10 @@ -3,6 +3,7 @@ Magnus Henoch Contributors: +Anthony Chaumas-Pellet Mathias Dahl Mario Domenech Goulart Nolan Eakins |