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

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

[nongnu] elpa/macrostep 3f965b0 048/110: Use new `macrostep-macro-start`


From: ELPA Syncer
Subject: [nongnu] elpa/macrostep 3f965b0 048/110: Use new `macrostep-macro-start` text property
Date: Sat, 7 Aug 2021 09:18:00 -0400 (EDT)

branch: elpa/macrostep
commit 3f965b0ee1765a122d68736d730b9f7aed39dbfb
Author: joddie <jonxfield@gmail.com>
Commit: joddie <jonxfield@gmail.com>

    Use new `macrostep-macro-start` text property
    
    This property should be placed on the first character of each macro form
    in the expanded text.  It was previously conflated with saving
    the *structure* represented by the expansion in the
    `macrostep-expanded-text` property.  This is (currently) useful for the
    Emacs Lisp implementation, but may not be for other implementations,
    including SLIME, so it is cleaner to separate the two properties.
---
 macrostep.el | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/macrostep.el b/macrostep.el
index 2bac0ba..fa3e5b9 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -497,10 +497,10 @@ If no more macro expansions are visible after this, exit
   "Move point forward to the next macro form in macro-expanded text."
   (interactive)
   (let* ((start 
-        (if (get-text-property (point) 'macrostep-expanded-text)
+        (if (get-text-property (point) 'macrostep-macro-start)
             (1+ (point))
           (point)))
-        (next (next-single-property-change start 'macrostep-expanded-text)))
+        (next (next-single-property-change start 'macrostep-macro-start)))
     (if next
        (goto-char next)
       (error "No more macro forms found"))))
@@ -513,9 +513,9 @@ If no more macro expansions are visible after this, exit
       (while
          (progn
            (setq prev
-                 (previous-single-property-change (point) 
'macrostep-expanded-text))
+                 (previous-single-property-change (point) 
'macrostep-macro-start))
            (if (or (not prev)
-                   (get-text-property (1- prev) 'macrostep-expanded-text))
+                   (get-text-property (1- prev) 'macrostep-macro-start))
                nil
              (prog1 t (goto-char prev))))))
     (if prev
@@ -829,6 +829,7 @@ expansion will not be fontified.  See also
              (macrostep-propertize
                  (insert "`")
                'macrostep-expanded-text sexp
+               'macrostep-macro-start t
                'font-lock-face 'macrostep-macro-face)
              (macrostep-print-sexp (cadr sexp) t))
 
@@ -859,6 +860,7 @@ expansion will not be fontified.  See also
                      ;; opening paren
                      (macrostep-propertize
                          (insert "(")
+                       'macrostep-macro-start t
                        'macrostep-expanded-text sexp)
                      ;; Fontify the head of the macro
                      (macrostep-propertize
@@ -948,11 +950,8 @@ expansion will not be fontified.  See also
               (let* ((sexp (slime-sexp-at-point))
                      (macro-type (macrostep-slime-macro-form-p sexp)))
                 (when macro-type
-                  ;; Hack to make `macrostep-next-macro' etc. work.
-                  ;; TODO: Re-consider how macro forms are marked in
-                  ;; expanded text.
                   (put-text-property paren-begin paren-end
-                                     'macrostep-expanded-text sexp)
+                                     'macrostep-macro-start t)
                   (put-text-property symbol-begin symbol-end
                                      'font-lock-face
                                      (cl-ecase macro-type



reply via email to

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