Update of /cvsroot/emacs-jabber/emacs-jabber
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv15066
Modified Files:
jabber.texi jabber-menu.el
Log Message:
Revision: ma...@fr...--2005/emacs-jabber--cvs-head--0--patch-607
Creator: Magnus Henoch <ma...@fr...>
Menu hacking
New variable jabber-display-menu controls whether Jabber menu is on menu bar.
Default: yes, if there is evidence that the user uses Jabber.
Put Jabber menu last instead of first.
Update documentation.
Index: jabber.texi
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber.texi,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- jabber.texi 21 Sep 2008 19:30:36 -0000 1.135
+++ jabber.texi 22 Oct 2008 23:12:37 -0000 1.136
@@ -1659,14 +1659,18 @@
@node Menu, Customizing the roster buffer, Account settings, Customization
@section Menu
-@findex jabber-menu
+@vindex jabber-display-menu
@cindex Menus
+There is a Jabber menu on the menu bar with some common commands. By
+default, it is displayed only if you are connected, or if you have
+configured any accounts. You can set the variable
+@code{jabber-display-menu} to @code{t} or @code{nil}, to have the menu
+displayed always or never, respectively. The default behaviour
+corresponds to the setting @code{maybe}.
-If you want a Jabber menu on the menu bar with some common commands,
-type @kbd{M-x jabber-menu}. You can remove it again with @kbd{C-u M-x
-jabber-menu}. Unfortunately, this cannot be changed through Customize
-settings, so you need to add @code{(jabber-menu)} to your @file{.emacs}
-to enable it permanently.
+@findex jabber-menu
+Earlier, the way to have the menu appear was to call the function
+@code{jabber-menu}. It still works, but is considered obsolete.
@node Customizing the roster buffer, Customizing the chat buffer, Menu, Customization
@section Customizing the roster buffer
Index: jabber-menu.el
===================================================================
RCS file: /cvsroot/emacs-jabber/emacs-jabber/jabber-menu.el,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- jabber-menu.el 27 Dec 2005 21:44:36 -0000 1.4
+++ jabber-menu.el 22 Oct 2008 23:12:37 -0000 1.5
@@ -1,7 +1,7 @@
;; jabber-menu.el - menu definitions
+;; Copyright (C) 2003, 2004, 2008 - Magnus Henoch - ma...@fr...
;; Copyright (C) 2002, 2003, 2004 - tom berger - ob...@in...
-;; Copyright (C) 2003, 2004 - Magnus Henoch - ma...@fr...
;; This file is a part of jabber.el.
@@ -21,13 +21,31 @@
(defvar jabber-menu (make-sparse-keymap "jabber-menu"))
+(defcustom jabber-display-menu 'maybe
+ "Decide whether the \"Jabber\" menu is displayed in the menu bar.
+If t, always display.
+If nil, never display.
+If maybe, display if any of `jabber-account-list' or `jabber-connections'
+is non-nil."
+ :group 'jabber
+ :type '(choice (const :tag "Never" nil)
+ (const :tag "Always" t)
+ (const :tag "When any accounts have been configured or connected" maybe)))
+
(defun jabber-menu (&optional remove)
"Put \"Jabber\" menu on menubar.
With prefix argument, remove it."
(interactive "P")
- (define-key global-map
- [menu-bar jabber-menu]
- (and (not remove) (cons "Jabber" jabber-menu))))
+ (setq jabber-display-menu (if remove nil t))
+ (force-mode-line-update))
+(make-obsolete 'jabber-menu "set the variable `jabber-display-menu' instead")
+
+(define-key-after global-map
+ [menu-bar jabber-menu]
+ (list 'menu-item "Jabber" jabber-menu
+ :visible '(or (eq jabber-display-menu t)
+ (and (eq jabber-display-menu 'maybe)
+ (or jabber-account-list jabber-connections)))))
(define-key jabber-menu
[jabber-menu-connect]
|