[Top][All Lists]

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

[elpa] externals/objed 41be963 054/216: Adjust textblock and block objec

From: Stefan Monnier
Subject: [elpa] externals/objed 41be963 054/216: Adjust textblock and block object order
Date: Tue, 8 Jan 2019 12:29:10 -0500 (EST)

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

    Adjust textblock and block object order
 objed-objects.el | 27 +++++++++++----------------
 objed.el         |  2 +-
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 6b416ab..4b32c0a 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1407,28 +1407,21 @@ Ignores simple structured expressions like words or 
 (objed-define-object nil textblock
-  (when (or (not (derived-mode-p 'prog-mode))
-            (derived-mode-p 'text-mode)
-            (objed--in-comment-p)
-            (objed--in-string-p))
+  (if (or (not (derived-mode-p 'prog-mode))
+          (derived-mode-p 'text-mode)
+          (objed--in-comment-p)
+          (objed--in-string-p))
      (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)))))
+         (objed-make-object :obounds bounds))))
+    (error "No textblock here"))
-  (forward-word 1)
-  (or (objed--in-string-or-comment-p)
-      (derived-mode-p 'text-mode)
-      (not (derived-mode-p 'prog-mode)))
+  (forward-sentence 1)
-  (forward-word -1)
-  (or (objed--in-string-or-comment-p)
-      (derived-mode-p 'text-mode)
-      (not (derived-mode-p 'prog-mode))))
+  (forward-sentence -1))
 (defun objed--column (pos)
@@ -1897,13 +1890,15 @@ non-nil the indentation block can contain empty lines."
 (defun objed--what-face (&optional pos)
+  "Return face at POS."
   (let* ((pos (or pos (point)))
          (face (or (get-text-property pos 'face))))
      (unless (keywordp (car-safe face)) (list face))))
 ;; from `evil-textobj-syntax'
-(defun objed--get-syntax-range (&optional inclusive arg)
+(defun objed--get-syntax-range ()
+  "Return range of equal face before/after point."
   (let ((point-face (objed--what-face))
         (backward-point (point)) ; last char when stop, including white space
         (backward-none-space-point (point)) ; last none white space char
diff --git a/objed.el b/objed.el
index 547087c..6bc59af 100644
--- a/objed.el
+++ b/objed.el
@@ -1252,7 +1252,7 @@ matches IREGEX is not displayed."
 ;; * Basic Movement, Block Objects (textblocks)
-(defvar objed--block-objects '(line buffer iblock section paragraph indent 
+(defvar objed--block-objects '(line buffer iblock section textblock indent 
   "List of objects which are 'line based'.
 Objects which are built by lines of text.")

reply via email to

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