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

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

[elpa] externals/objed e35d7b8 001/166: Fix objed-object-activate for th


From: Clemens Radermacher
Subject: [elpa] externals/objed e35d7b8 001/166: Fix objed-object-activate for the case which-key isn't active
Date: Sun, 29 Dec 2019 08:20:50 -0500 (EST)

branch: externals/objed
commit e35d7b867752062168e7dd002f22664762d20ce1
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Fix objed-object-activate for the case which-key isn't active
---
 objed-objects.el | 64 ++++++++++++++++++++++++++++----------------------------
 objed.el         |  3 ++-
 2 files changed, 34 insertions(+), 33 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 269ceb7..7b63cb9 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -67,37 +67,37 @@
 
 (eval-and-compile
   (defun objed--transform-pos-data (plist)
-  (let ((np nil)
-        (alt nil)
-        (make nil)
-        (skip nil))
-    (unless (and (plist-get plist :beg)
-                 (plist-get plist :end))
-      (user-error "Malformed macro"))
-    (dolist (item plist)
-      (if (memq item '(:beg :ibeg :end :iend))
-          (progn (push item alt)
-                 (setq skip t))
-        (if (and skip
-                 (not (keywordp item)))
-            (push item alt)
-          (push item np)
-          (setq skip nil))))
-
-    (setq np (nreverse np))
-    (setq alt (nreverse alt))
-    (dolist (el alt)
-      (when (keywordp el)
-        (progn
-          (push el make)
-          (push (plist-get alt el) make))))
-    (setq make (nreverse make))
-    (push 'objed-make-object make)
-    (append np (list :get-obj)
-            ;; TODO:save-mark-and-excursion still needed?
-            ;; is wrapped already?
-            (list (append (list 'save-mark-and-excursion)
-                          (list make))))))
+    (let ((np nil)
+          (alt nil)
+          (make nil)
+          (skip nil))
+      (unless (and (plist-get plist :beg)
+                   (plist-get plist :end))
+        (user-error "Malformed macro"))
+      (dolist (item plist)
+        (if (memq item '(:beg :ibeg :end :iend))
+            (progn (push item alt)
+                   (setq skip t))
+          (if (and skip
+                   (not (keywordp item)))
+              (push item alt)
+            (push item np)
+            (setq skip nil))))
+
+      (setq np (nreverse np))
+      (setq alt (nreverse alt))
+      (dolist (el alt)
+        (when (keywordp el)
+          (progn
+            (push el make)
+            (push (plist-get alt el) make))))
+      (setq make (nreverse make))
+      (push 'objed-make-object make)
+      (append np (list :get-obj)
+              ;; TODO:save-mark-and-excursion still needed?
+              ;; is wrapped already?
+              (list (append (list 'save-mark-and-excursion)
+                            (list make))))))
 
   (defun objed--get-arg-plist (keylst valid &optional wrapped)
     "Wraps any forms of keys in keylst in `progn' and returns property list.
@@ -126,7 +126,7 @@ property list where each key has an associated progn."
                  ;; objed--block-p: dont run objeds advices here...
                  (push `(let ((objed--block-p t))
                           (save-mark-and-excursion
-                           ,@(nreverse forms)))
+                            ,@(nreverse forms)))
                        wrapped)))
              (objed--get-arg-plist keylst valid wrapped))
             (keylst
diff --git a/objed.el b/objed.el
index 0e02471..38cb3a3 100644
--- a/objed.el
+++ b/objed.el
@@ -1951,7 +1951,8 @@ back to `objed-initial-object' if no match found."
   (interactive)
   (objed--maybe-which-key objed-object-map "Object:")
   (let ((real-this-command (lookup-key objed-object-map (vector (read-key)))))
-    (when (fboundp #'which-key--hide-popup)
+    (when (and (bound-and-true-p which-key-mode)
+               (fboundp #'which-key--hide-popup))
       (which-key--hide-popup))
     (when real-this-command
       (call-interactively real-this-command))))



reply via email to

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