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

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

[nongnu] elpa/go-mode 5fbf6bd 048/495: remove unnecessary progns


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 5fbf6bd 048/495: remove unnecessary progns
Date: Sat, 7 Aug 2021 09:04:41 -0400 (EDT)

branch: elpa/go-mode
commit 5fbf6bd2747907363926fa2517f0883fcebf6edd
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>

    remove unnecessary progns
---
 go-mode.el | 69 ++++++++++++++++++++++++++++++--------------------------------
 1 file changed, 33 insertions(+), 36 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index 88573c1..eca059c 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -156,43 +156,40 @@ built-ins, functions, and some types.")
       (back-to-indentation)
       (if (go-in-string-p)
           (current-indentation)
-        (progn
-          (setq start-nesting (go-paren-level))
-          (if (looking-at "[])}]")
-              (progn
-                (while (and
-                        (not (bobp))
-                        (>= (go-paren-level) start-nesting))
-                  (skip-chars-backward "^[]{}()")
-                  (backward-char))
-                (if (go-previous-line-has-dangling-op-p)
-                    (- (current-indentation) tab-width)
-                  (current-indentation)))
+        (setq start-nesting (go-paren-level))
+        (if (looking-at "[])}]")
             (progn
-              (go--backward-irrelevant t)
-              (if (looking-back go-dangling-operators-regexp)
-                  ;; only one nesting for all dangling operators in one 
operation
-                  (if (go-previous-line-has-dangling-op-p)
-                      (current-indentation)
-                    (+ (current-indentation) tab-width))
-                (progn
-                  (go--backward-irrelevant)
-                  (if (go-previous-line-has-dangling-op-p)
-                      (setq outindent tab-width))
-                  (setq line-begin (line-beginning-position))
-                  (while (and
-                          (not (bobp))
-                          (> (point) line-begin)
-                          (>= (go-paren-level) start-nesting))
-                    (if (= 0 (skip-chars-backward "^[]{}()" line-begin))
-                        (backward-char))
-                    (if (go-in-string-p)
-                        (progn
-                          (go--backward-irrelevant)
-                          (setq line-begin (line-beginning-position)))))
-                  (if (and (< (go-paren-level) start-nesting))
-                      (+ (current-indentation) tab-width (- outindent))
-                    (- (current-indentation) outindent)))))))))))
+              (while (and
+                      (not (bobp))
+                      (>= (go-paren-level) start-nesting))
+                (skip-chars-backward "^[]{}()")
+                (backward-char))
+              (if (go-previous-line-has-dangling-op-p)
+                  (- (current-indentation) tab-width)
+                (current-indentation)))
+          (go--backward-irrelevant t)
+          (if (looking-back go-dangling-operators-regexp)
+              ;; only one nesting for all dangling operators in one operation
+              (if (go-previous-line-has-dangling-op-p)
+                  (current-indentation)
+                (+ (current-indentation) tab-width))
+            (go--backward-irrelevant)
+            (if (go-previous-line-has-dangling-op-p)
+                (setq outindent tab-width))
+            (setq line-begin (line-beginning-position))
+            (while (and
+                    (not (bobp))
+                    (> (point) line-begin)
+                    (>= (go-paren-level) start-nesting))
+              (if (= 0 (skip-chars-backward "^[]{}()" line-begin))
+                  (backward-char))
+              (if (go-in-string-p)
+                  (progn
+                    (go--backward-irrelevant)
+                    (setq line-begin (line-beginning-position)))))
+            (if (and (< (go-paren-level) start-nesting))
+                (+ (current-indentation) tab-width (- outindent))
+              (- (current-indentation) outindent))))))))
 
 (defun go-mode-indent-line ()
   (interactive)



reply via email to

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