From: Magnus H. <leg...@us...> - 2013-08-25 14:49:17
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "emacs-jabber". The branch, master has been updated via a50b9f490254a350b258bada5866acfb69d34a31 (commit) from c335fc5b6a8c60d0a4969842e1e3d876f21dda79 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a50b9f490254a350b258bada5866acfb69d34a31 Author: Magnus Henoch <mag...@gm...> Date: Sun Aug 25 15:49:06 2013 +0100 Display menu by default if user installed the package If the user installed the package into `package-user-dir' (as opposed to a system-wide installation), it should be fine to display a Jabber menu by default (which still can be turned off). diff --git a/jabber-menu.el b/jabber-menu.el index 47957ee..1135c0f 100644 --- a/jabber-menu.el +++ b/jabber-menu.el @@ -87,12 +87,12 @@ "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." +If maybe, display if jabber.el is installed under `package-user-dir', or +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))) + (const :tag "When installed by user, or when any accounts have been configured or connected" maybe))) (defun jabber-menu (&optional remove) "Put \"Jabber\" menu on menubar. @@ -109,10 +109,21 @@ With prefix argument, remove it." (define-key-after (lookup-key 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 - (bound-and-true-p jabber-connections)))))) + :visible + ;; If the package was installed by the user personally, it's + ;; probably ok to "clutter" the menu bar with a Jabber menu. + (let ((user-installed-package + (and (bound-and-true-p package-user-dir) + (string= + (file-name-as-directory + (expand-file-name ".." (file-name-directory load-file-name))) + (file-name-as-directory + (expand-file-name package-user-dir)))))) + `(or (eq jabber-display-menu t) + (and (eq jabber-display-menu 'maybe) + (or ,user-installed-package + jabber-account-list + (bound-and-true-p jabber-connections))))))) (defvar jabber-jid-chat-menu nil "Menu items for chat menu") ----------------------------------------------------------------------- Summary of changes: jabber-menu.el | 25 ++++++++++++++++++------- 1 files changed, 18 insertions(+), 7 deletions(-) hooks/post-receive -- emacs-jabber |