[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 69db302 126/216: Some mroe init changes
From: |
Stefan Monnier |
Subject: |
[elpa] externals/objed 69db302 126/216: Some mroe init changes |
Date: |
Tue, 8 Jan 2019 12:29:24 -0500 (EST) |
branch: externals/objed
commit 69db30246552013aeee20998053bef856d14c6c9
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>
Some mroe init changes
---
objed.el | 40 +++++++++++++++++-----------------------
1 file changed, 17 insertions(+), 23 deletions(-)
diff --git a/objed.el b/objed.el
index 09a0734..d3d8e9b 100644
--- a/objed.el
+++ b/objed.el
@@ -336,6 +336,7 @@ See also `objed-disabled-p'"
(yank-pop . region)
;; misc
(which-key-C-h-dispatch . char)
+ (recenter-top-bottom . line)
)
"Entry commands and associated objects."
:group 'objed
@@ -358,8 +359,8 @@ be used to restore previous states."
read-only-mode
undo
undo-only
- recenter-top-bottom
delete-other-windows
+ reposition-window
)
"Regular Emacs commands which should not exit modal edit state.
@@ -612,20 +613,16 @@ update to given object."
(goto-char (objed--beg)))))))
-(defun objed--get-object-for-cmd (cmd)
+(defun objed--switch-to-object-for-cmd (cmd)
"Guess which object to use.
CMD is the command for which object should be guessed. Returns
cons of guessed object and its state."
- (let ((c (cdr (assq cmd objed-cmd-alist)))
- (o nil))
- (cond ((consp c)
- (if (symbolp (cdr c))
- c
- (when (setq o (objed--at-p c))
- (cons o 'whole))))
- (c
- (cons c 'whole)))))
+ (let ((o (cdr (assq cmd objed-cmd-alist))))
+ (if o
+ (objed--switch-to o (if (eq cmd #'back-to-indentation)
+ 'inner 'whole))
+ (objed--update-current-object))))
;; * Keymaps
@@ -1185,10 +1182,8 @@ SYM is a symbol (command or object symbol) used to
initialize."
;; init object
(if (commandp sym)
(let* ((objed--block-p t)
- (initf (cdr (assq sym objed--after-init-alist)))
- (os (objed--get-object-for-cmd sym)))
- (when os
- (objed--switch-to (car os) (cdr os)))
+ (initf (cdr (assq sym objed--after-init-alist))))
+ (objed--switch-to-object-for-cmd sym)
(when initf (funcall initf objed--opoint)))
(objed--switch-to sym))
@@ -1223,13 +1218,11 @@ mode line hint is removed again."
Reinitializes the current object in case the current command is
one of `objed-keeper-commands'."
- (let ((ocmd (lookup-key objed-map (this-command-keys-vector)))
- (o nil))
+ (let ((ocmd (lookup-key objed-map (this-command-keys-vector))))
(or (commandp ocmd)
- (and (or (memq this-command objed-keeper-commands)
- (and (setq o (cdr (assq this-command objed-cmd-alist)))
- (symbolp o)
- (setq objed--object o)))
+ (and this-command
+ (or (memq this-command objed-keeper-commands)
+ (assq this-command objed-cmd-alist))
(prog1 #'ignore
(add-hook 'post-command-hook 'objed--reinit-object-one-time nil
t))))))
@@ -1238,10 +1231,11 @@ one of `objed-keeper-commands'."
"To be used with `post-command-hook'.
Reinitializes current object and removes itself from the hook."
- (when objed--buffer
+ (when (and objed--buffer
+ this-command)
(with-current-buffer objed--buffer
(remove-hook 'post-command-hook 'objed--reinit-object-one-time t)
- (objed--update-current-object))))
+ (objed--switch-to-object-for-cmd this-command))))
(defun objed-hl-function ()
- [elpa] externals/objed fc11d2b 119/216: Fix skipping ws if point is after the object, (continued)
- [elpa] externals/objed fc11d2b 119/216: Fix skipping ws if point is after the object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed d50117d 114/216: Fix kill-op error, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 49e36fd 123/216: Change back to indentation behavior, Stefan Monnier, 2019/01/08
- [elpa] externals/objed ce608d8 115/216: Add symbol object back, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 051028c 129/216: Fix init for entry commands which use after-init-alist, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 4b21416 112/216: Fix endless textblock search, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 703d634 131/216: Move some op bindings to more emacsy bindings, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 92fd6e7 135/216: Fix marking instances in objects not surrounding point, Stefan Monnier, 2019/01/08
- [elpa] externals/objed b9866d6 101/216: Fix undo op behavior, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 0e1d041 105/216: Simplify object macro usage, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 69db302 126/216: Some mroe init changes,
Stefan Monnier <=
- [elpa] externals/objed 0c5a4e3 147/216: Version bump, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 7617799 136/216: Allow testing different emacs versions, Stefan Monnier, 2019/01/08
- [elpa] externals/objed f5904c2 142/216: Add eval commands to keeper commands, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 734711a 124/216: Add move-to-window-line-top-bottom to activation cmds, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 9c816e2 133/216: Improve mark all for repeated object invokation, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 8e9ab88 152/216: Markup, Stefan Monnier, 2019/01/08
- [elpa] externals/objed a94bfdf 145/216: Add extend functionality, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 0de9c61 159/216: Further improve objed-expand, Stefan Monnier, 2019/01/08
- [elpa] externals/objed ac6ecb0 149/216: Mention new extend functionality, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 4a84e59 174/216: Bind this-command when executing region command, Stefan Monnier, 2019/01/08