[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 3200a9f 301/495: Support electric-indent-mode
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 3200a9f 301/495: Support electric-indent-mode |
Date: |
Sat, 7 Aug 2021 09:05:36 -0400 (EDT) |
branch: elpa/go-mode
commit 3200a9fc36ef6f5a2a5588d54a5790ad168ffd1e
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>
Support electric-indent-mode
---
NEWS | 2 ++
go-mode.el | 18 +++++++++++-------
2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/NEWS b/NEWS
index 27c768f..dea5c4f 100644
--- a/NEWS
+++ b/NEWS
@@ -50,6 +50,8 @@ go-mode-1.4.0 (???)
* Fix parsing of test output in compilation-mode for new versions of
Emacs. It's probably broken in older versions now.
+ * Add support for electric-indent-mode.
+
go-mode-1.3.1 (2015-07-03)
* The 1.3.0 release forgot to update the version in the package
diff --git a/go-mode.el b/go-mode.el
index c6f97c3..091eba6 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -426,18 +426,19 @@ For mode=set, all covered lines will have this weight."
(defvar go-mode-map
(let ((m (make-sparse-keymap)))
- (define-key m "}" #'go-mode-insert-and-indent)
- (define-key m ")" #'go-mode-insert-and-indent)
- (define-key m "," #'go-mode-insert-and-indent)
- (define-key m ":" #'go-mode-insert-and-indent)
- (define-key m "=" #'go-mode-insert-and-indent)
+ (unless (boundp 'electric-indent-chars)
+ (define-key m "}" #'go-mode-insert-and-indent)
+ (define-key m ")" #'go-mode-insert-and-indent)
+ (define-key m "," #'go-mode-insert-and-indent)
+ (define-key m ":" #'go-mode-insert-and-indent)
+ (define-key m "=" #'go-mode-insert-and-indent))
(define-key m (kbd "C-c C-a") #'go-import-add)
(define-key m (kbd "C-c C-j") #'godef-jump)
(define-key m (kbd "C-x 4 C-c C-j") #'godef-jump-other-window)
(define-key m (kbd "C-c C-d") #'godef-describe)
(define-key m (kbd "C-c C-f") 'go-goto-map)
m)
- "Keymap used by Go mode to implement electric keys.")
+ "Keymap used by go-mode.")
(easy-menu-define go-mode-menu go-mode-map
"Menu for Go mode."
@@ -967,6 +968,9 @@ with goflymake \(see URL
`https://github.com/dougm/goflymake'), gocode
go--font-lock-syntactic-keywords)
(set (make-local-variable 'font-lock-multiline) t))
+ (if (boundp 'electric-indent-chars)
+ (set (make-local-variable 'electric-indent-chars) '(?\n ?} ?\) ?, ?:
?=)))
+
(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)
@@ -990,7 +994,7 @@ with goflymake \(see URL
`https://github.com/dougm/goflymake'), gocode
;; processed from the beginning. It's important that our entry comes
;; before gnu, because gnu matches go test output, but includes the
;; leading whitespace in the file name.
- ;;
+ ;;
;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2001-12/msg00674.html
;; documents the old, reverseed order.
(when (and (boundp 'compilation-error-regexp-alist)
- [nongnu] elpa/go-mode f58910a 276/495: Reimplement go--in-function-p to do as the name says, (continued)
- [nongnu] elpa/go-mode f58910a 276/495: Reimplement go--in-function-p to do as the name says, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f44854b 278/495: More idiomatic docstrings, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9424ab3 283/495: Map C-g f to goto-function and C-g n to goto-function-name, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode abc56d4 286/495: Rename go-goto-return-value to go-goto-return-values, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e4cd631 288/495: Update AUTHORS, automate process, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 63e67b1 290/495: go-goto-docstring: fix insertion of function name, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7c5e9ad 303/495: Avoid warning because of font-lock-syntactic-keywords, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode bdf353a 304/495: Use cl-lib instead of cl, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 82ebf74 302/495: Don't make ":", ", " or "=" electric, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode a49cdb8 305/495: Evaluate (featurep 'xemacs) at compile time, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 3200a9f 301/495: Support electric-indent-mode,
ELPA Syncer <=
- [nongnu] elpa/go-mode 53f50f7 299/495: Make godoc command and completion configurable, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 1a0541c 312/495: Simplify go-packages-go-list by using process-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 404f8ca 308/495: Improve README and NEWS entries for new goto commands, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode f12f2cc 319/495: Add support for gogetdoc, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 7fec5b2 317/495: Move test Go files to testdata, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 648ad3d 311/495: Use null-device instead of /dev/null, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode e035e60 309/495: Mention GOPATH detection in README, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 43da263 313/495: Simplify go-root-and-paths by using process-lines, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 95c74ba 324/495: Update URL to gogetdoc tool., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 228ded4 314/495: Use cons instead of append, ELPA Syncer, 2021/08/07