[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed 53cafee 085/216: Add new commands to move to firs
From: |
Stefan Monnier |
Subject: |
[elpa] externals/objed 53cafee 085/216: Add new commands to move to first/last instance |
Date: |
Tue, 8 Jan 2019 12:29:17 -0500 (EST) |
branch: externals/objed
commit 53cafeec06929acdc455ae629752e45793b7a7fd
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>
Add new commands to move to first/last instance
---
README.asc | 6 +++---
objed.el | 28 +++++++++++++++++++++++++---
2 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/README.asc b/README.asc
index d86e991..4af06ac 100644
--- a/README.asc
+++ b/README.asc
@@ -183,9 +183,6 @@ Basic movement commands (switch the object type on
movement):
|kbd:[n/p]
|Move to the next/previous line and activate the line object.
-
-|kbd:[`/´]
-|Move forward/backward one symbol and activate the symbol object. Strings and
comments are skipped.
|===
@@ -229,6 +226,9 @@ determining the context:
|kbd:[t/h]
|If coming from basic movement the object at point is guessed based on
context. Point is moved to the beginning/end of object. This is useful to
"jump out" of the current context. On repeat move to the previous/next instance
of current object type
+|kbd:[`/´]
+|Goto first/last instance of current object type.
+
|kbd:[o]
|Activate the inner part of the object at point and move to the start. This is
useful to act on the content of the string, brackets and so on. On repeat
expand to other objects around current position.
diff --git a/objed.el b/objed.el
index 91f7ea3..4d3e0c3 100644
--- a/objed.el
+++ b/objed.el
@@ -680,8 +680,8 @@ the guessed object."
(define-key map (kbd "<M-right>") 'objed-indent-to-right-tab-stop)
(define-key map (kbd "<M-left>") 'objed-indent-to-left-tab-stop)
- (define-key map "`" 'objed-backward-symbol)
- (define-key map "´" 'objed-forward-symbol)
+ (define-key map "`" 'objed-top-object);;'objed-backward-symbol)
+ (define-key map "´" 'objed-bottom-object);;'objed-forward-symbol)
;; block expansions
(define-key map "l" 'objed-expand-block)
@@ -1578,7 +1578,29 @@ postitive prefix argument ARG move to the nth next
object."
(if (objed--basic-p)
(progn (objed-context-object)
(goto-char (objed--end)))
- (objed--goto-next (or arg 1))))
+ (objed--goto-next (or arg 1))))
+
+(defun objed-top-object ()
+ "Go to first instance of current object type."
+ (interactive)
+ (objed--get-next (point))
+ (let ((o (car (objed--collect-backward
+ (objed--min) (point-min)))))
+ (if (not o)
+ (message "Already at first instance")
+ (goto-char (car o))
+ (objed--update-current-object))))
+
+(defun objed-bottom-object ()
+ "Go to last instance of current object type."
+ (interactive)
+ (objed--get-next (point))
+ (let ((o (car (nreverse (objed--collect-forward
+ (objed--max) (point-max))))))
+ (if (not o)
+ (message "Already at last instance")
+ (goto-char (car o))
+ (objed--update-current-object))))
(defun objed-expand-context ()
"Expand to objects based on context.
- [elpa] externals/objed 5fbacd4 050/216: Cleanup, (continued)
- [elpa] externals/objed 5fbacd4 050/216: Cleanup, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 5f23c05 070/216: Fixup advice code, Stefan Monnier, 2019/01/08
- [elpa] externals/objed bd6a50c 092/216: Change bindings for surroundings, undo in region, Stefan Monnier, 2019/01/08
- [elpa] externals/objed aa8ba7b 093/216: Change DEL to behave as normal for char object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 21ca995 069/216: Cleanup malformed object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed d21fd72 073/216: Fix makup again, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 7c41d13 076/216: Fixup which-key paging commands, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 204ea88 095/216: Change surroundings binding, Stefan Monnier, 2019/01/08
- [elpa] externals/objed b54fa1a 077/216: Add more tests, Stefan Monnier, 2019/01/08
- [elpa] externals/objed deb059e 100/216: Update bindings, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 53cafee 085/216: Add new commands to move to first/last instance,
Stefan Monnier <=
- [elpa] externals/objed 919a72d 071/216: Adjust python block object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed b7ded6d 083/216: Improve tests, add more tests, Stefan Monnier, 2019/01/08
- [elpa] externals/objed e5f8bac 102/216: Improve undo in region, Stefan Monnier, 2019/01/08
- [elpa] externals/objed e5dfba1 096/216: Add extend commands, Stefan Monnier, 2019/01/08
- [elpa] externals/objed d770ddd 055/216: Don't exit after eval op, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 6907e69 058/216: Improve face object, Stefan Monnier, 2019/01/08
- [elpa] externals/objed cac61c3 084/216: Improve block objects, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 58af659 068/216: Start adding tests, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 655a636 090/216: Fix bug, Stefan Monnier, 2019/01/08
- [elpa] externals/objed 838094f 097/216: Working on #14, Stefan Monnier, 2019/01/08