[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 259110b 396/495: Use a named function for before-c
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 259110b 396/495: Use a named function for before-change-functions. |
Date: |
Sat, 7 Aug 2021 09:05:55 -0400 (EDT) |
branch: elpa/go-mode
commit 259110bfd7acb62196b09487d0883429b444bf1b
Author: Matt Armstrong <marmstrong@google.com>
Commit: Dominik Honnef <dominik@honnef.co>
Use a named function for before-change-functions.
Create go--reset-dangling-cache-before-change and add that to
before-change-functions, rather than adding a lambda. The effect is the
same, but this allows people to easily find the file responsible when
looking at before-change-functions in Emacs' help system (such as with
describe-variable).
Closes: gh-159 [via git-merge-pr]
---
go-mode.el | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/go-mode.el b/go-mode.el
index b2a8bd0..bbb635a 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -955,6 +955,12 @@ Function result is a unparenthesized type or a parameter
list."
(go--match-parameter-list end))
(t nil)))
+(defun go--reset-dangling-cache-before-change (&optional unused-beg unused-end)
+ "Reset `go-dangling-cache'.
+
+This is intended to be called from `before-change-functions'."
+ (setq go-dangling-cache (make-hash-table :test 'eql)))
+
;;;###autoload
(define-derived-mode go-mode prog-mode "Go"
"Major mode for editing Go source text.
@@ -1048,7 +1054,7 @@ with goflymake \(see URL
`https://github.com/dougm/goflymake'), gocode
(set (make-local-variable 'compilation-error-screen-columns) nil)
(set (make-local-variable 'go-dangling-cache) (make-hash-table :test 'eql))
- (add-hook 'before-change-functions (lambda (x y) (setq go-dangling-cache
(make-hash-table :test 'eql))) t t)
+ (add-hook 'before-change-functions #'go--reset-dangling-cache-before-change
t t)
;; ff-find-other-file
(setq ff-other-file-alist 'go-other-file-alist)
- [nongnu] elpa/go-mode 51f507c 315/495: Complete list of commands in mode docstring, (continued)
- [nongnu] elpa/go-mode 51f507c 315/495: Complete list of commands in mode docstring, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 004575e 330/495: Don't leave godef buffer around, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 409cc64 344/495: cmd/oracle: usability improvements to "describe", "referrers", ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode d9d47fa 332/495: go.tools/oracle: change -ptalog default to ""., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode bd236e5 367/495: cmd/guru: emacs: update default-directory, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 2db2ff6 333/495: go.tools/oracle: change -pos flag syntax from "file pos-pos" to file:pos-pos., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 17a7d8a 370/495: cmd/guru: emacs: add function for expandiong region, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode dbc9124 378/495: Move go-guru.el to top level, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b949a9b 363/495: cmd/guru: emacs: add go-guru-debug variable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 04a2946 380/495: Merge branch 'import-guru', ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 259110b 396/495: Use a named function for before-change-functions.,
ELPA Syncer <=
- [nongnu] elpa/go-mode d964767 399/495: Use forward-word-strictly when available, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7c38d6a 477/495: Improve commenting partial lines., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 24990df 400/495: Some simple style fixes for issues found by checkdoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 10d6ab4 486/495: Allow leading spaces for compilation error message, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e79970d 224/495: fix beginning-of-defun for abs(count) > 1, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode cec546c 306/495: Clarify some points in NEWS, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 5c1c546 307/495: Don't fontify parenthesis of multi-line type declaration, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 99b06da 408/495: Describe gofmt-args in the readme and the gofmt docstring (also gofmt-command), ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7c50c80 410/495: Always move back to same column after applying rcs patch, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e20a54a 426/495: Speed up go-previous-line-has-dangling-op-p, ELPA Syncer, 2021/08/07