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

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

[elpa] externals/objed 95503ca 046/216: Fix syntax object


From: Stefan Monnier
Subject: [elpa] externals/objed 95503ca 046/216: Fix syntax object
Date: Tue, 8 Jan 2019 12:29:09 -0500 (EST)

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

    Fix syntax object
---
 objed-objects.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/objed-objects.el b/objed-objects.el
index 8c72b40..b0c69e8 100644
--- a/objed-objects.el
+++ b/objed-objects.el
@@ -1903,10 +1903,11 @@ non-nil the indentation block can contain empty lines."
   (search-backward ">" nil t))
 
 
-(defun objed--what-face (pos)
-  (let ((face (or (get-char-property (pos) 'read-face-name)
-                  (get-char-property (pos) 'face))))
-    (unless (keywordp (car-safe face)) (list face))))
+(defun objed--what-face (&optional 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)
@@ -1938,7 +1939,7 @@ non-nil the indentation block can contain empty lines."
       (let ((continue t))
         (while (and continue (< (+ (point) 1) (point-max)))
           (forward-char)
-          (let ((forward-point-face (objed---what-face)))
+          (let ((forward-point-face (objed--what-face)))
             (if (= 32 (char-syntax (char-after)))
                 (setq forward-point (point))
               (if (equal point-face forward-point-face)
@@ -1953,6 +1954,7 @@ non-nil the indentation block can contain empty lines."
 
 (objed-define-object nil syntax
   :get-obj (objed--get-syntax-range)
+  ;; TODO: search for next same face as current...
   :try-next
   (re-search-forward "\\<" nil t)
   :try-prev



reply via email to

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