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

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

[elpa] externals/objed 638c89e 18/19: Choose initial object for object-a


From: Clemens Radermacher
Subject: [elpa] externals/objed 638c89e 18/19: Choose initial object for object-adctivate based on last-command
Date: Fri, 25 Jan 2019 07:51:32 -0500 (EST)

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

    Choose initial object for object-adctivate based on last-command
---
 objed.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/objed.el b/objed.el
index 7373cc0..94bacaa 100644
--- a/objed.el
+++ b/objed.el
@@ -317,7 +317,7 @@ removed."
   :type 'symbol)
 
 (defcustom objed-initial-object 'region
-  "Object to use for inititalization with `objed-activate'."
+  "Object to use as fallback for `objed-activate'."
   :group 'objed
   :type 'symbol)
 
@@ -1696,13 +1696,17 @@ Object is choosen based on context."
 (defun objed-activate (&optional obj)
   "Activate objed.
 
-Uses `objed-initial-object' for initialization.
+Uses associated `objed-cmd-alist' for `last-command' as initial
+object. Falls back to `objed-initial-object' if no match found.
 
 If called from code decide for activation with char object using
 `objed--activate'."
   (interactive)
   (if (called-interactively-p 'any)
-      (objed--init objed-initial-object)
+      (objed--init
+       (if (assq last-command objed-cmd-alist)
+           last-command
+         objed-initial-object))
     (when (objed-init-p)
       (objed--init (or obj 'char)))))
 



reply via email to

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