Skip to content

Commit

Permalink
Move some defconsts up to fix compiler warnings.
Browse files Browse the repository at this point in the history
Fixes #352.

Closes: #356 [via git-merge-pr]
  • Loading branch information
muirdm authored and psanford committed Apr 25, 2020
1 parent e8eea7f commit 734d523
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions go-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ constant is changed.")
go-identifier-regexp
"\\)("))

(defconst go--comment-start-regexp "[[:space:]]*\\(?:/[/*]\\)")
(defconst go--case-regexp "\\([[:space:]]*case\\([[:space:]]\\|$\\)\\)")
(defconst go--case-or-default-regexp (concat "\\(" go--case-regexp "\\|" "[[:space:]]*default:\\)"))

(defconst go-builtins
'("append" "cap" "close" "complex" "copy"
"delete" "imag" "len" "make" "new"
Expand Down Expand Up @@ -1181,8 +1185,6 @@ Return non-nil if point changed lines."
(setq count (if (and count (< count 0 )) -1 1)))
moved))

(defconst go--comment-start-regexp "[[:space:]]*\\(?:/[/*]\\)")

(defun go--case-comment-p (indent)
"Return non-nil if looking at a comment attached to a case statement.
Expand Down Expand Up @@ -1238,9 +1240,6 @@ INDENT is the normal indent of this line, i.e. that of the case body."
;; aligned with "case", leave it that way
(= (current-indentation) (- indent tab-width)))))))

(defconst go--case-regexp "\\([[:space:]]*case\\([[:space:]]\\|$\\)\\)")
(defconst go--case-or-default-regexp (concat "\\(" go--case-regexp "\\|" "[[:space:]]*default:\\)"))

(defun go-mode-indent-line ()
(interactive)
(let (indent
Expand Down

0 comments on commit 734d523

Please sign in to comment.