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

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

[nongnu] elpa/go-mode 8216ff9 076/495: some nicer lisp


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 8216ff9 076/495: some nicer lisp
Date: Sat, 7 Aug 2021 09:04:47 -0400 (EDT)

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

    some nicer lisp
---
 go-mode.el | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/go-mode.el b/go-mode.el
index 549f547..ca1a54b 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -149,8 +149,7 @@ some syntax analysis.")
     (setq pos (point))
     (beginning-of-line)
     (if (or (looking-at "^[[:word:]]+:") (looking-at "^[[:space:]]*\\(case 
.+\\|default\\):"))
-        (progn (forward-line -1)
-               (end-of-line))
+        (end-of-line 0)
       (goto-char pos))
     (if (/= start-pos (point))
         (go--backward-irrelevant stop-at-string))
@@ -169,7 +168,7 @@ some syntax analysis.")
       (setq group "^[{("))
     (while (and (not (bobp))
                 (>= (go-paren-level) start-nesting))
-      (if (= 0 (skip-chars-backward group))
+      (if (zerop (skip-chars-backward group))
           (if (go-in-string-or-comment-p)
               (go-goto-beginning-of-string-or-comment)
             (backward-char))))))
@@ -193,7 +192,7 @@ some syntax analysis.")
         (if (go-previous-line-has-dangling-op-p)
             (current-indentation)
           (+ (current-indentation) tab-width)))
-       ((progn  (= (go-paren-level) 0))
+       ((progn  (zerop (go-paren-level)))
         0)
        ((progn (go-goto-opening-parenthesis) (< (go-paren-level) 
start-nesting))
         (if (go-previous-line-has-dangling-op-p)
@@ -215,7 +214,7 @@ some syntax analysis.")
         (goto-char point)
       (setq indent (go-indentation-at-point))
       (if (looking-at "[[:word:]]+:\\([[:space:]]*/.+\\)?$\\|case 
.+:\\|default:")
-          (setq indent (- indent tab-width)))
+          (decf indent tab-width))
       (setq shift-amt (- indent (current-column)))
       (if (zerop shift-amt)
           nil
@@ -342,7 +341,7 @@ Replace the current buffer on success; display errors on 
failure."
                         (goto-char (point-max))
                         (insert ?\n)))
 
-                  (if (= 0 (shell-command-on-region (point-min) (point-max)
+                  (if (zerop (shell-command-on-region (point-min) (point-max)
                                                     (concat "gofmt" flag)
                                                     patchbuf nil errbuf))
                       ;; gofmt succeeded: replace buffer or apply patch hunks.
@@ -675,10 +674,9 @@ will be commented, otherwise they will be removed 
completely."
   (interactive "P")
   (save-excursion
     (let ((cur-buffer (current-buffer)) flymake-state lines)
-      (if (boundp 'flymake-mode)
-          (progn
-            (setq flymake-state flymake-mode)
-            (flymake-mode-off)))
+      (when (boundp 'flymake-mode)
+        (setq flymake-state flymake-mode)
+        (flymake-mode-off))
       (save-some-buffers nil (lambda () (equal cur-buffer (current-buffer))))
       (if (buffer-modified-p)
           (message "Cannot operate on unsaved buffer")



reply via email to

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