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

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

[elpa] externals/objed 38887bb 107/216: Adjust textblock object


From: Stefan Monnier
Subject: [elpa] externals/objed 38887bb 107/216: Adjust textblock object
Date: Tue, 8 Jan 2019 12:29:21 -0500 (EST)

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

    Adjust textblock object
---
 objed-objects.el | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 54515d8..eeeff00 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1536,21 +1536,23 @@ Ignores simple structured expressions like words or 
symbols."
 
 (objed-define-object nil textblock
   :get-obj
-  (if (or (not (derived-mode-p 'prog-mode))
-          (derived-mode-p 'text-mode)
-          (objed--in-comment-p)
-          (objed--in-string-p))
+  (when (or (not (derived-mode-p 'prog-mode))
+            (derived-mode-p 'text-mode)
+            (objed--in-comment-p)
+            (objed--in-string-p))
     (objed--with-narrow-for-text
      (let ((bounds (objed--get-textblock-bounds)))
        (when (and bounds
                   (or (not (eq (car bounds) (point-min)))
                       (not (eq (cdr bounds) (point-max)))))
-         (objed-make-object :obounds bounds))))
-    (error "No textblock here"))
+         (objed-make-object :obounds bounds)))))
+  ;; TODO: narrow for current string/object
   :try-next
-  (forward-sentence 1)
+  (objed--with-narrow-for-text
+   (forward-sentence 1))
   :try-prev
-  (forward-sentence -1))
+  (objed--with-narrow-for-text
+   (forward-sentence -1)))
 
 
 (defun objed--column (pos)



reply via email to

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