emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/objed 50769c9 3/9: Fix speedup version for identifier o


From: Clemens Radermacher
Subject: [elpa] externals/objed 50769c9 3/9: Fix speedup version for identifier object
Date: Fri, 1 Mar 2019 15:30:42 -0500 (EST)

branch: externals/objed
commit 50769c9b42e03174ca0aa632bd778047b2197d14
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Fix speedup version for identifier object
---
 objed.el | 38 ++++++++++++++++++++++++--------------
 1 file changed, 24 insertions(+), 14 deletions(-)

diff --git a/objed.el b/objed.el
index 1248de1..b813d89 100644
--- a/objed.el
+++ b/objed.el
@@ -1664,25 +1664,35 @@ postitive prefix argument ARG move to the nth next 
object."
 (defun objed-top-object ()
   "Go to first instance of current object type."
   (interactive)
-  (let ((top (save-excursion
-               (goto-char (point-min))
-               (objed--get-next (point)))))
-    (if (equal top objed--current-obj)
-        (message "Already at first instance")
-      (objed--update-current-object top)
-      (goto-char (objed--beg)))))
+  ;; TODO: creat macro keyword so delegation
+  ;; can happen automatically, when specified
+  (cond ((eq objed--object 'identifier)
+         (objed-first-identifier)
+         (objed--update-current-object))
+        (t
+         (let ((top (save-excursion
+                      (goto-char (point-min))
+                      (objed--get-next (point)))))
+           (if (equal top objed--current-obj)
+               (message "Already at first instance")
+             (objed--update-current-object top)
+             (goto-char (objed--beg)))))))
 
 
 (defun objed-bottom-object ()
   "Go to first instance of current object type."
   (interactive)
-  (let ((bot (save-excursion
-               (goto-char (point-max))
-               (objed--get-prev (point)))))
-    (if (equal bot objed--current-obj)
-        (message "Already at last instance")
-      (objed--update-current-object bot)
-      (goto-char (objed--beg)))))
+  (cond ((eq objed--object 'identifier)
+         (objed-last-identifier)
+         (objed--update-current-object))
+        (t
+         (let ((bot (save-excursion
+                      (goto-char (point-max))
+                      (objed--get-prev (point)))))
+           (if (equal bot objed--current-obj)
+               (message "Already at last instance")
+             (objed--update-current-object bot)
+             (goto-char (objed--beg)))))))
 
 
 (defun objed-expand-context ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]