branch: externals/objed
commit f01a171afe04511baec8120bdd21994def6540c2
Author: Clemens Radermacher <[email protected]>
Commit: Clemens Radermacher <[email protected]>
Make objed-init suitable for advices
---
objed.el | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/objed.el b/objed.el
index 8eb85d0..cedac42 100644
--- a/objed.el
+++ b/objed.el
@@ -1258,12 +1258,12 @@ See `objed-cmd-alist'."
(or (memq major-mode '(messages-buffer-mode help-mode))
(not (derived-mode-p 'comint-mode 'special-mode 'dired-mode)))))
-(defun objed-init (&optional obj)
- "Function for activating objed by hooks.
+(defun objed-init (&rest _)
+ "Function for activating objed by hooks or advices.
-Initialize with OBJ which defaults to `objed--object'."
+Initialize with `objed--object' or char if unset."
(when (funcall objed-init-p-function)
- (objed--init (or obj objed--object 'char))))
+ (objed--init (or objed--object 'char))))
(defun objed--init-later (&rest _)
"Init after command loop returned to top level."
@@ -2017,7 +2017,8 @@ back to `objed-initial-object' if no match found."
(if (assq last-command objed-cmd-alist)
last-command
objed-initial-object))
- (objed-init obj)))
+ (let ((objed--object obj))
+ (objed-init))))
;;;###autoload