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

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

[nongnu] elpa/macrostep ab1685d858 1/2: Consistently use spaces for inde


From: ELPA Syncer
Subject: [nongnu] elpa/macrostep ab1685d858 1/2: Consistently use spaces for indentation
Date: Wed, 15 Mar 2023 20:00:39 -0400 (EDT)

branch: elpa/macrostep
commit ab1685d85820edf4532fde95b2fbcec0bacf3b1d
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Consistently use spaces for indentation
---
 macrostep.el | 92 +++++++++++++++++++++++++++++-------------------------------
 1 file changed, 45 insertions(+), 47 deletions(-)

diff --git a/macrostep.el b/macrostep.el
index 96a16bff68..975e1b4458 100644
--- a/macrostep.el
+++ b/macrostep.el
@@ -640,13 +640,12 @@ If no more macro expansions are visible after this, exit
 (defun macrostep-next-macro ()
   "Move point forward to the next macro form in macro-expanded text."
   (interactive)
-  (let* ((start
-        (if (get-text-property (point) 'macrostep-macro-start)
-            (1+ (point))
-          (point)))
-        (next (next-single-property-change start 'macrostep-macro-start)))
+  (let* ((start (if (get-text-property (point) 'macrostep-macro-start)
+                    (1+ (point))
+                  (point)))
+         (next (next-single-property-change start 'macrostep-macro-start)))
     (if next
-       (goto-char next)
+        (goto-char next)
       (error "No more macro forms found"))))
 
 (defun macrostep-prev-macro ()
@@ -655,15 +654,15 @@ If no more macro expansions are visible after this, exit
   (let (prev)
     (save-excursion
       (while
-         (progn
-           (setq prev
-                 (previous-single-property-change (point) 
'macrostep-macro-start))
-           (if (or (not prev)
-                   (get-text-property (1- prev) 'macrostep-macro-start))
-               nil
-             (prog1 t (goto-char prev))))))
+          (progn
+            (setq prev (previous-single-property-change
+                        (point) 'macrostep-macro-start))
+            (if (or (not prev)
+                    (get-text-property (1- prev) 'macrostep-macro-start))
+                nil
+              (prog1 t (goto-char prev))))))
     (if prev
-       (goto-char (1- prev))
+        (goto-char (1- prev))
       (error "No previous macro form found"))))
 
 
@@ -671,9 +670,7 @@ If no more macro expansions are visible after this, exit
 
 (defun macrostep-overlay-at-point ()
   "Return the innermost macro stepper overlay at point."
-  (let ((result
-        (get-char-property-and-overlay (point) 'macrostep-original-text)))
-    (cdr result)))
+  (cdr (get-char-property-and-overlay (point) 'macrostep-original-text)))
 
 (defun macrostep-collapse-overlay (overlay &optional no-restore-p)
   "Collapse a macro-expansion overlay and restore the unexpanded source text.
@@ -802,7 +799,7 @@ value of DEFINITION in the result will be nil."
         (let ((compiler-macro-definition
                (and macrostep-expand-compiler-macros
                     (or (get head 'compiler-macro)
-                       (get head 'cl-compiler-macro)))))
+                        (get head 'cl-compiler-macro)))))
           (if (and compiler-macro-definition
                    (not (eq form
                             (apply compiler-macro-definition form (cdr 
form)))))
@@ -834,11 +831,10 @@ expansion until a non-macro-call results."
       ((macro)
        (apply definition (cdr form)))
       ((compiler-macro)
-       (let ((expansion
-             (apply definition form (cdr form))))
-        (if (equal form expansion)
-            (error "Form left unchanged by compiler macro")
-          expansion))))))
+       (let ((expansion (apply definition form (cdr form))))
+         (if (equal form expansion)
+             (error "Form left unchanged by compiler macro")
+           expansion))))))
 
 (put 'macrostep-grab-environment-failed 'error-conditions
      '(macrostep-grab-environment-failed error))
@@ -867,14 +863,14 @@ lambda expression that returns its expansion."
       ;; we back up progressively through the containing forms until
       ;; it succeeds.
       (save-excursion
-       (catch 'done
-         (while t
-           (condition-case nil
-               (throw 'done (macrostep-environment-at-point-1))
-             (macrostep-grab-environment-failed
-              (condition-case nil
-                  (backward-sexp)
-                (scan-error (backward-up-list)))))))))))
+        (catch 'done
+          (while t
+            (condition-case nil
+                (throw 'done (macrostep-environment-at-point-1))
+              (macrostep-grab-environment-failed
+               (condition-case nil
+                   (backward-sexp)
+                 (scan-error (backward-up-list)))))))))))
 
 (defun macrostep-environment-at-point-1 ()
   "Attempt to extract the macro environment that would be active at point.
@@ -1032,10 +1028,10 @@ should be dynamically let-bound around calls to this 
function."
    ((listp sexp)
     ;; Print quoted and quasiquoted forms nicely.
     (let ((head (car sexp)))
-      (cond ((and (eq head 'quote)     ; quote
-                 (= (length sexp) 2))
-            (insert "'")
-            (macrostep-print-sexp (cadr sexp)))
+      (cond ((and (eq head 'quote)      ; quote
+                  (= (length sexp) 2))
+             (insert "'")
+             (macrostep-print-sexp (cadr sexp)))
 
             ((and (eq head '\`)         ; backquote
                   (= (length sexp) 2))
@@ -1048,12 +1044,12 @@ should be dynamically let-bound around calls to this 
function."
                (insert "`"))
              (macrostep-print-sexp (cadr sexp)))
 
-           ((and (memq head '(\, \,@)) ; unquote
-                 (= (length sexp) 2))
-            (princ head (current-buffer))
-            (macrostep-print-sexp (cadr sexp)))
+            ((and (memq head '(\, \,@)) ; unquote
+                  (= (length sexp) 2))
+             (princ head (current-buffer))
+             (macrostep-print-sexp (cadr sexp)))
 
-           (t                          ; other list form
+            (t                          ; other list form
              (cl-destructuring-bind (macro? . environment)
                  (or (assq sexp macrostep-collected-macro-form-alist)
                      '(nil . nil))
@@ -1106,14 +1102,16 @@ fontified using the same face (modulo the number of 
faces; see
 `macrostep-gensym-faces')."
   (or (get symbol 'macrostep-gensym-face)
       (progn
-       (if (not macrostep-gensyms-this-level)
-           (setq macrostep-gensym-depth (1+ macrostep-gensym-depth)
-                 macrostep-gensyms-this-level t))
-       (let ((face (ring-ref macrostep-gensym-faces macrostep-gensym-depth)))
-         (put symbol 'macrostep-gensym-face face)
-         face))))
+        (if (not macrostep-gensyms-this-level)
+            (setq macrostep-gensym-depth (1+ macrostep-gensym-depth)
+                  macrostep-gensyms-this-level t))
+        (let ((face (ring-ref macrostep-gensym-faces macrostep-gensym-depth)))
+          (put symbol 'macrostep-gensym-face face)
+          face))))
 
 
 (provide 'macrostep)
-
+;; Local Variables:
+;; indent-tabs-mode: nil
+;; End:
 ;;; macrostep.el ends here



reply via email to

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