[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/objed af6490a 2/9: Speedup goto first/last object
From: |
Clemens Radermacher |
Subject: |
[elpa] externals/objed af6490a 2/9: Speedup goto first/last object |
Date: |
Fri, 1 Mar 2019 15:30:42 -0500 (EST) |
branch: externals/objed
commit af6490a6aebf14a5f4de6917043b362a4fae14f1
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>
Speedup goto first/last object
---
objed.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/objed.el b/objed.el
index be44287..1248de1 100644
--- a/objed.el
+++ b/objed.el
@@ -1664,24 +1664,26 @@ postitive prefix argument ARG move to the nth next
object."
(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)
+ (let ((top (save-excursion
+ (goto-char (point-min))
+ (objed--get-next (point)))))
+ (if (equal top objed--current-obj)
(message "Already at first instance")
- (goto-char (car o))
- (objed--update-current-object))))
+ (objed--update-current-object top)
+ (goto-char (objed--beg)))))
+
(defun objed-bottom-object ()
- "Go to last instance of current object type."
+ "Go to first instance of current object type."
(interactive)
- (objed--get-next (point))
- (let ((o (car (nreverse (objed--collect-forward
- (objed--max) (point-max))))))
- (if (not o)
+ (let ((bot (save-excursion
+ (goto-char (point-max))
+ (objed--get-prev (point)))))
+ (if (equal bot objed--current-obj)
(message "Already at last instance")
- (goto-char (car o))
- (objed--update-current-object))))
+ (objed--update-current-object bot)
+ (goto-char (objed--beg)))))
+
(defun objed-expand-context ()
"Expand to objects based on context.
- [elpa] externals/objed updated (bdfe220 -> 65d3430), Clemens Radermacher, 2019/03/01
- [elpa] externals/objed 8b08ae2 4/9: Accept object position data for init, Clemens Radermacher, 2019/03/01
- [elpa] externals/objed af6490a 2/9: Speedup goto first/last object,
Clemens Radermacher <=
- [elpa] externals/objed 50769c9 3/9: Fix speedup version for identifier object, Clemens Radermacher, 2019/03/01
- [elpa] externals/objed 70f20ec 1/9: Add objed-mode commands to move to first last instance of identifier, Clemens Radermacher, 2019/03/01
- [elpa] externals/objed 97efbbe 5/9: Ensure objed exits when entering the minibuffer, Clemens Radermacher, 2019/03/01
- [elpa] externals/objed 95e5438 7/9: Update key descriptions, Clemens Radermacher, 2019/03/01
- [elpa] externals/objed 1b7af5b 8/9: Change some default bindings, Clemens Radermacher, 2019/03/01
- [elpa] externals/objed 2742f55 6/9: Add two commands to move to ibeg/ieng of oap, Clemens Radermacher, 2019/03/01
- [elpa] externals/objed 65d3430 9/9: Version bump, Clemens Radermacher, 2019/03/01