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

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

[elpa] externals/multishell ee12b22 08/23: Unravel conditional tangle (a


From: Stefan Monnier
Subject: [elpa] externals/multishell ee12b22 08/23: Unravel conditional tangle (and use bound-and-true-p)
Date: Sun, 29 Nov 2020 23:19:37 -0500 (EST)

branch: externals/multishell
commit ee12b22501f2ce5c1a742fe43dee5e221de0a018
Author: Ken Manheimer <ken.manheimer@gmail.com>
Commit: Ken Manheimer <ken.manheimer@gmail.com>

    Unravel conditional tangle (and use bound-and-true-p)
    
    Also include some code formatting refinements.
    
    From gnu people's fixes.
---
 multishell.el | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/multishell.el b/multishell.el
index 88f8789..fb1dd39 100644
--- a/multishell.el
+++ b/multishell.el
@@ -203,28 +203,25 @@ If optional UNBIND is true, globally unbind the key.
 
 * `multishell-activate-command-key' - Set this to get the binding or not.
 * `multishell-command-key' - The key to use for the binding, if appropriate."
-  (cond (unbind
-         (when (and (boundp 'multishell-command-key) multishell-command-key)
-           (global-unset-key multishell-command-key)))
-        ((not (and (boundp 'multishell-activate-command-key)
-                   (boundp 'multishell-command-key)))
-         nil)
-        ((and multishell-activate-command-key multishell-command-key)
-         (setq multishell--responsible-for-command-key t)
-         (global-set-key multishell-command-key 'multishell-pop-to-shell))))
+  (when (bound-and-true-p multishell-command-key)
+    (if unbind
+        (global-unset-key multishell-command-key)
+      (when (bound-and-true-p multishell-activate-command-key)
+        (setq multishell--responsible-for-command-key t)
+        (global-set-key multishell-command-key 'multishell-pop-to-shell)))))
 
 (defcustom multishell-activate-command-key nil
   "Set this to impose the `multishell-command-key' binding.
 
-You can instead manually bind `multishell-pop-to-shell` using emacs
-lisp, eg: (global-set-key \"\\M- \" 'multishell-pop-to-shell)."
+You can instead manually bind `multishell-pop-to-shell' using emacs
+lisp, eg: (global-set-key \"\\M- \" \\='multishell-pop-to-shell)."
   :type 'boolean
-  :set 'multishell-activate-command-key-setter)
+  :set #'multishell-activate-command-key-setter)
 
 ;; Implement the key customization whenever the package is loaded:
 (if (fboundp 'with-eval-after-load)
     (with-eval-after-load "multishell"
-                         (multishell-implement-command-key-choice))
+      (multishell-implement-command-key-choice))
   (eval-after-load "multishell"
     '(multishell-implement-command-key-choice)))
 



reply via email to

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