[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 8ddf0b3 433/495: Speed up go-goto-opening-parenthe
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 8ddf0b3 433/495: Speed up go-goto-opening-parenthesis |
Date: |
Sat, 7 Aug 2021 09:06:03 -0400 (EDT) |
branch: elpa/go-mode
commit 8ddf0b369cff246d7e14f4592c8c053bda36b2eb
Author: Muir Manders <muir@retailnext.net>
Commit: Peter Sanford <psanford@sanford.io>
Speed up go-goto-opening-parenthesis
Reimplement to use syntax tables directly rather than
backward-up-list. It is much faster now, and it seems to work the same
for our use case. Certain files are affected more than others. For
example, reindenting golang/src/cmd/internal/obj/x86/avx_optabs.go
went from 19.6s to 5.7s after this change.
I think it is faster because syntax-ppss caches the syntax info,
where backward-up-list calls up-list which calls scan-lists which does
a lot of work every time.
Closes: #283 [via git-merge-pr]
---
go-mode.el | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/go-mode.el b/go-mode.el
index 6ccddde..b5575d2 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -66,11 +66,9 @@ Return non-nil if there was a paren to move up to."
;; function's outcome.
;; Silently fail if there's no matching opening parenthesis.
- (condition-case nil
- (progn
- (backward-up-list)
- t)
- (scan-error nil)))
+ (let ((open-char (nth 1 (syntax-ppss))))
+ (when open-char
+ (goto-char open-char))))
(defconst go-dangling-operators-regexp "[^-]-\\|[^+]\\+\\|[/*&><.=|^]")
- [nongnu] elpa/go-mode 791dfa5 418/495: require subr-x when interpreting go-guru.el, (continued)
- [nongnu] elpa/go-mode 791dfa5 418/495: require subr-x when interpreting go-guru.el, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b02c6f6 414/495: Fix local variables list., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 120fb91 419/495: Use "guru -tags=xxx yyy", not "guru -tags=xxx, yyy", ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode ed5c2cf 421/495: Fixed compiler warnings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 77c6aae 422/495: Fix quotation marks in the gofmt doc string, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3f60838 424/495: Move testdata under test/ directory., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3ba1982 427/495: Handle indentation for nested dangling operators, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f6b1398 429/495: Fix filename handling in godoc-gogetdoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 00e72cd 431/495: Update default for godoc-and-godef-command, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 6b67088 432/495: Support trailing commas as dangling operators., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8ddf0b3 433/495: Speed up go-goto-opening-parenthesis,
ELPA Syncer <=
- [nongnu] elpa/go-mode fdc1545 436/495: Fix indent for case statement comments, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d387378 438/495: indent: handle comments after multiline case lists, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fbf2544 444/495: Improve fill-paragraph for comment blocks., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e7e0157 447/495: indent: fix indent at top level of file, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3bc7479 450/495: Fix infinite loop in fill-region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 88ffc9e 452/495: Add github action yaml file to run ert tests, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4f15abf 449/495: Fix fill-paragraph for certain block comments., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a13b814 448/495: Add option to reuse a single buffer for godoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a82369b 453/495: Readme: add basic information about gopls., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 839190b 455/495: Run all tests in GH CI, ELPA Syncer, 2021/08/07