emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ssh-deploy 0e7c608 031/133: Deployment menu only shows


From: Stefan Monnier
Subject: [elpa] externals/ssh-deploy 0e7c608 031/133: Deployment menu only shows when current buffer is deployment
Date: Sat, 27 Mar 2021 14:48:38 -0400 (EDT)

branch: externals/ssh-deploy
commit 0e7c6086bea41a83f0f32a75e4eade03af835628
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Deployment menu only shows when current buffer is deployment
---
 ssh-deploy.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/ssh-deploy.el b/ssh-deploy.el
index 34635b0..1cfc997 100644
--- a/ssh-deploy.el
+++ b/ssh-deploy.el
@@ -3,8 +3,8 @@
 ;; Author: Christian Johansson <christian@cvj.se>
 ;; Maintainer: Christian Johansson <christian@cvj.se>
 ;; Created: 5 Jul 2016
-;; Modified: 30 Oct 2018
-;; Version: 2.04
+;; Modified: 31 Oct 2018
+;; Version: 2.05
 ;; Keywords: tools, convenience
 ;; URL: https://github.com/cjohansson/emacs-ssh-deploy
 
@@ -1344,7 +1344,13 @@
     (define-key map [dl] '("Download" . ssh-deploy-download-handler))
     map))
 
-(define-key-after global-map [menu-bar sshdeploy] (cons "Deployment" 
ssh-deploy-menu-map) 'tools)
+(defun ssh-deploy-menu-map-update ()
+  "Update menu map and only show menu if deployment is active."
+  (if (and ssh-deploy-root-local ssh-deploy-root-remote)
+      (define-key-after global-map [menu-bar sshdeploy] (cons "Deployment" 
ssh-deploy-menu-map) 'tools)
+    (define-key-after global-map [menu-bar sshdeploy] 'undefined 'tools)))
+
+(add-hook 'menu-bar-update-hook 'ssh-deploy-menu-map-update)
 
 
 ;;; Mode Line



reply via email to

[Prev in Thread] Current Thread [Next in Thread]