[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 8fb900e 062/495: refactor
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 8fb900e 062/495: refactor |
Date: |
Sat, 7 Aug 2021 09:04:44 -0400 (EDT) |
branch: elpa/go-mode
commit 8fb900e8f4e554f013cc622051438a62e34e3925
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>
refactor
---
go-mode.el | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 7559966..bea6c15 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -149,6 +149,15 @@ built-ins, functions, and some types.")
(go--backward-irrelevant t)
(looking-back go-dangling-operators-regexp)))
+(defun go-goto-opening-parenthesis ()
+ (let ((start-nesting (go-paren-level)))
+ (while (and (not (bobp))
+ (>= (go-paren-level) start-nesting))
+ (if (= 0 (skip-chars-backward "^[{("))
+ (if (go-in-string-or-comment-p)
+ (go-goto-beginning-of-string-or-comment)
+ (backward-char))))))
+
(defun go-indentation-at-point (point)
(save-excursion
(let (start-nesting (outindent 0))
@@ -159,10 +168,7 @@ built-ins, functions, and some types.")
(setq start-nesting (go-paren-level))
(if (looking-at "[])}]")
(progn
- (while (and (not (bobp))
- (>= (go-paren-level) start-nesting))
- (skip-chars-backward "^[]{}()")
- (backward-char))
+ (go-goto-opening-parenthesis)
(if (go-previous-line-has-dangling-op-p)
(- (current-indentation) tab-width)
(current-indentation)))
@@ -175,12 +181,7 @@ built-ins, functions, and some types.")
(go--backward-irrelevant)
(if (= (go-paren-level) 0)
0
- (while (and (not (bobp))
- (>= (go-paren-level) start-nesting))
- (if (= 0 (skip-chars-backward "^[]{}()"))
- (backward-char))
- (if (go-in-string-p)
- (go--backward-irrelevant)))
+ (go-goto-opening-parenthesis)
(if (< (go-paren-level) start-nesting)
(progn
(if (go-previous-line-has-dangling-op-p)
- [nongnu] elpa/go-mode 8216ff9 076/495: some nicer lisp, (continued)
- [nongnu] elpa/go-mode 8216ff9 076/495: some nicer lisp, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7d47e3c 079/495: remove old go-propertize-syntax code, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 58640c3 080/495: Do not consider \ an escape character when in raw strings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0c25389 081/495: do not set syntax-propertize-function for emacsen that don't know it (GNU Emacs <24 for one), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0ecc391 086/495: document issue with go build -o /dev/null, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d7c48cb 089/495: give in and require cl at runtime, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 23310e5 090/495: be more lenient when finding commented imports, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2d500b3 091/495: builtins and keywords need to be surrounded by symbols, not word characters, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 71c7f59 101/495: use correct regexps for labels, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3139c0f 107/495: fix regexp-opt usage for emacs <24, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8fb900e 062/495: refactor,
ELPA Syncer <=
- [nongnu] elpa/go-mode 183c028 068/495: use (car (last)) instead of (car (reverse)), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 0f71cee 083/495: add autoload cookie to gofmt-before-save, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f0059f6 098/495: in go-packages, skip over directories that do not contain a /pkg subdirectory, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3d3ba73 103/495: Use completing-read in godoc--read-query, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 67bb849 108/495: use \\_< instead of \\< and do so in a way that won't break XEmacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4637dd6 110/495: Mention gofmt rewrite in README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d910a0d 112/495: Make _ a word constituent to accomodate inferiority of XEmacs, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c1074a1 114/495: improve regexps for array, slice and map types, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a88f1d5 115/495: add support for godef, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4935203 117/495: add guidelines for contributions, ELPA Syncer, 2021/08/07