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

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

[elpa] externals/objed 5714dc0 8/9: Ignore errors when collecting object


From: Clemens Radermacher
Subject: [elpa] externals/objed 5714dc0 8/9: Ignore errors when collecting objects
Date: Sun, 24 Mar 2019 19:51:47 -0400 (EDT)

branch: externals/objed
commit 5714dc009f115ccb00bbd9a340822c1403f50055
Author: Clemens Radermacher <address@hidden>
Commit: Clemens Radermacher <address@hidden>

    Ignore errors when collecting objects
---
 objed-objects.el | 65 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 34 insertions(+), 31 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index b7bb0cd..4cac175 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -794,37 +794,6 @@ Position POS defaults to point."
                    (cdr (assq inv buffer-invisibility-spec)))
           (cl-return t))))))
 
-(defun objed--get-next (&optional from)
-  "Get next object from position or object.
-
-If FROM is a position search from there otherwise search starts
-from end of object FROM."
-  (let ((obj (or from objed--current-obj)))
-    (save-excursion
-      (when (and obj (not (objed--no-skipper-p)))
-        (if (integer-or-marker-p obj)
-            (goto-char obj)
-          (goto-char (objed--max obj))))
-      (unless (eobp)
-        (when (<= (point) (objed--beg))
-          (objed--skip-ws))
-        (objed--object :try-next)
-        (objed--get)))))
-
-(defun objed--get-prev (&optional from)
-  "Get previous object from position or object.
-
-If FROM is a position search from there otherwise search starts
-from beginning of object FROM."
-  (let ((obj (or from objed--current-obj)))
-    (save-excursion
-      (when obj
-        (if (integer-or-marker-p obj)
-            (goto-char obj)
-          (goto-char (objed--min obj))))
-      (unless (bobp)
-        (objed--object :try-prev)
-        (objed--get t)))))
 
 
 ;; * Object creation/manipulation
@@ -987,6 +956,40 @@ calculate the data of the object at current position using
       (prog1 nil
         (message "No %s found." o)))))
 
+(defun objed--get-next (&optional from)
+  "Get next object from position or object.
+
+If FROM is a position search from there otherwise search starts
+from end of object FROM."
+  (let ((obj (or from objed--current-obj)))
+    (save-excursion
+      (when (and obj (not (objed--no-skipper-p)))
+        (if (integer-or-marker-p obj)
+            (goto-char obj)
+          (goto-char (objed--max obj))))
+      (unless (eobp)
+        (when (<= (point) (objed--beg))
+          (objed--skip-ws))
+        (ignore-errors
+          (objed--object :try-next)
+          (objed--get))))))
+
+(defun objed--get-prev (&optional from)
+  "Get previous object from position or object.
+
+If FROM is a position search from there otherwise search starts
+from beginning of object FROM."
+  (let ((obj (or from objed--current-obj)))
+    (save-excursion
+      (when obj
+        (if (integer-or-marker-p obj)
+            (goto-char obj)
+          (goto-char (objed--min obj))))
+      (unless (bobp)
+        (ignore-errors
+        (objed--object :try-prev)
+        (objed--get t))))))
+
 
 (defun objed--distant-p (o)
   "Determine if point is outside object O."



reply via email to

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