branch: externals/objed commit 638c89e9a2054411ba04a39aacee163b2003627d Author: Clemens Radermacher <clem...@posteo.net> Commit: Clemens Radermacher <clem...@posteo.net>
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)))))