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

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

[elpa] externals/objed b7fbf71 106/216: Fixes #12, collect no-skipping o


From: Stefan Monnier
Subject: [elpa] externals/objed b7fbf71 106/216: Fixes #12, collect no-skipping objects correctly
Date: Tue, 8 Jan 2019 12:29:21 -0500 (EST)

branch: externals/objed
commit b7fbf71edeaf198adfdd1776978e138329523440
Author: Clemera <address@hidden>
Commit: Clemera <address@hidden>

    Fixes #12,  collect no-skipping objects correctly
---
 objed-objects.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 9a9f508..54515d8 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -482,12 +482,18 @@ and the current window."
                   (setq obj (objed--get-next (point)))
                   (not (equal obj sobj)))
         (setq sobj obj)
-        (goto-char (setq pos (objed--end obj)))
+        (if (objed--no-skipper-p)
+            (goto-char (setq pos (objed--beg obj)))
+        (goto-char (setq pos (objed--end obj))))
         (push (cons (objed--skip-forward (objed--beg obj) 'ws)
                     cw)
               posns)))
     (setq posns (nreverse posns))))
 
+(defun objed--no-skipper-p ()
+  (get (objed--name2func objed--object)
+       'objed-no-skip))
+
 (defun objed--collect-object-positions (beg end &optional fromp)
   "Collect object positions.
 
@@ -502,7 +508,8 @@ the objects and the current window."
            (or fromp (objed--min))
            beg)
           (objed--collect-forward
-           (or fromp (objed--max))
+           (or fromp (if (objed--no-skipper-p)
+                         (objed--min) (objed--max)))
            end)))
 
 
@@ -696,9 +703,7 @@ 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 (get (objed--name2func objed--object)
-                           'objed-no-skip)))
+      (when (and obj (not (objed--no-skipper-p)))
         (if (integer-or-marker-p obj)
             (goto-char obj)
           (goto-char (objed--max obj))))



reply via email to

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