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

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

[nongnu] elpa/sweeprolog 0b545cc192 114/166: ADDED: (sweep-indent-line-e


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 0b545cc192 114/166: ADDED: (sweep-indent-line-ends-with-prefix-operator): New function
Date: Fri, 30 Sep 2022 04:59:30 -0400 (EDT)

branch: elpa/sweeprolog
commit 0b545cc1920332cf6ad31f49314eabf38e699e23
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    ADDED: (sweep-indent-line-ends-with-prefix-operator): New function
    
    (sweep-indent-line-indentation): use it
---
 sweep.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/sweep.el b/sweep.el
index 914155704f..f3b192942c 100644
--- a/sweep.el
+++ b/sweep.el
@@ -1110,7 +1110,7 @@ Interactively, a prefix arg means to prompt for BUFFER."
        ((sweep-indent-line-ends-with-else point))
        ((sweep-indent-line-ends-with-arg point))
        ((sweep-indent-line-ends-with-neck-p)              4)
-       ;; ((sweep-indent-line-ends-with-prefix-operator))
+       ((sweep-indent-line-ends-with-prefix-operator))
        (t (sweep-indent-line-fallback))))))
 
 (defun sweep-indent-line-fallback ()
@@ -1120,6 +1120,15 @@ Interactively, a prefix arg means to prompt for BUFFER."
     (back-to-indentation)
     (current-column)))
 
+(defun sweep-indent-line-ends-with-prefix-operator ()
+  (save-excursion
+    (end-of-line)
+    (skip-syntax-backward " ")
+    (when-let ((symbol (symbol-at-point)))
+      (when (member (symbol-name symbol) (sweep-prefix-operators))
+        (skip-syntax-backward "w_")
+        (+ (current-column) 4)))))
+
 (defun sweep-indent-line-ends-with-if ()
   (save-excursion
     (end-of-line)



reply via email to

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