[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/go-mode 438f671 082/495: update documentation
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/go-mode 438f671 082/495: update documentation |
Date: |
Sat, 7 Aug 2021 09:04:48 -0400 (EDT) |
branch: elpa/go-mode
commit 438f67142e5fad6494802623aa051ffad40cd67e
Author: Dominik Honnef <dominikh@fork-bomb.org>
Commit: Dominik Honnef <dominikh@fork-bomb.org>
update documentation
---
README.md | 8 ++++----
go-mode.el | 51 ++++++++++++++++++++++++++++++++++++++-------------
2 files changed, 42 insertions(+), 17 deletions(-)
diff --git a/README.md b/README.md
index 85906a6..c383b9d 100644
--- a/README.md
+++ b/README.md
@@ -28,14 +28,14 @@ Improvements
Features
========
-- Support for `C-M-a` (`beginning-of-defun`)
-- Support for `C-M-e` (`end-of-defun`)
-- Support for `C-M-h` (`mark-defun`)
+- Support for `C-M-a` (`beginning-of-defun`), `C-M-e` (`end-of-defun`)
+ and all functions that make use of defun navigation, such as `C-M-h`
+ (`mark-defun`), `C-x n d` (`narrow-to-defun`) and more.
- Two functions for sending code to the Playground (`go-play-buffer` and
`go-play-region`)
- A function for downloading code from the Playground into a Go buffer
(`go-download-play`)
+- A function for jumping to the file's imports (`go-goto-imports`)
- A function for adding imports, including tab completion (`go-import-add`,
bound to `C-c C-a`)
- A function for removing or commenting unused imports
(`go-remove-unused-imports`)
-- A function for jumping to the file's imports (`go-goto-imports`)
- Adds basic support for imenu (functions and variables)
Other extensions
diff --git a/go-mode.el b/go-mode.el
index 0a51fed..11eb8ea 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1,14 +1,8 @@
;;; go-mode.el --- Major mode for the Go programming language
-;; TODO:
-;; Features:
-;; - imports manipulations (add, remove, with sorting and grouping)
-;; Bugs:
-;; - Disable escapes in `` strings
-;; - Correct indentation for http://sprunge.us/iEaN
-;; - Fontify types in struct definitions
-;; - Fontify unicode in method receiver types, array/slice/map types
-;; and everywhere where type-name is being used
+;; Copyright 2013 The Go Authors. All rights reserved.
+;; Use of this source code is governed by a BSD-style
+;; license that can be found in the LICENSE file.
(eval-when-compile
(require 'cl))
@@ -197,7 +191,7 @@ some syntax analysis.")
(if (go-previous-line-has-dangling-op-p)
(current-indentation)
(+ (current-indentation) tab-width)))
- ((progn (zerop (go-paren-level)))
+ ((zerop (go-paren-level))
0)
((progn (go-goto-opening-parenthesis) (< (go-paren-level)
start-nesting))
(if (go-previous-line-has-dangling-op-p)
@@ -266,9 +260,40 @@ some syntax analysis.")
(define-derived-mode go-mode fundamental-mode "Go"
"Major mode for editing Go source text.
-This provides basic syntax highlighting for keywords, built-ins,
-functions, and some types. It also provides indentation that is
-\(almost) identical to gofmt."
+This mode provides (not just) basic editing capabilities for
+working with Go code. It offers almost complete syntax
+highlighting, indentation that is almost identical to gofmt,
+proper parsing of the buffer content to allow features such as
+navigation by function, manipulation of comments or detection of
+strings.
+
+Additionally to these core features, it offers various features to
+help with writing Go code. You can directly run buffer content
+through gofmt, read godoc documentation from within Emacs, modify
+and clean up the list of package imports or interact with the
+Playground (uploading and downloading pastes).
+
+The following extra functions are defined:
+
+- `gofmt'
+- `godoc'
+- `go-import-add'
+- `go-remove-unused-imports'
+- `go-goto-imports'
+- `go-play-buffer' and `go-play-region'
+- `go-download-play'
+
+If you want to automatically run `gofmt' before saving a file,
+add the following hook to your emacs configuration:
+
+\(add-hook 'before-save-hook 'gofmt-before-save)
+
+If you're looking for even more integration with Go, namely
+on-the-fly syntax checking, auto-completion and snippets, it is
+recommended to look at goflymake
+\(https://github.com/dougm/goflymake), gocode
+\(https://github.com/nsf/gocode) and yasnippet-go
+\(https://github.com/dominikh/yasnippet-go)"
;; Font lock
(set (make-local-variable 'font-lock-defaults)
- [nongnu] elpa/go-mode cd13093 034/495: use inhibit-read-only instead of toggle-read-only, (continued)
- [nongnu] elpa/go-mode cd13093 034/495: use inhibit-read-only instead of toggle-read-only, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b6dfdd4 037/495: Closes gh-5, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 9dbdf22 041/495: Do not skip over strings when checking for dangling operator, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 95c9519 049/495: when searching for anchor for indentation, do not limit search to one line, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 399393a 057/495: remove dead code, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode ee10287 059/495: Revert "Fix indentation for code after multi-line function signature", ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 79d5860 073/495: improve fontification, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 49b9355 074/495: do not change indentation if in multiline string, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 522543f 077/495: replace several defuns with macros, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 4aeb058 078/495: add cache to go-previous-line-has-dangling-op-p, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 438f671 082/495: update documentation,
ELPA Syncer <=
- [nongnu] elpa/go-mode c2366b2 084/495: formatting, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode fb9ab02 087/495: buffer-file-truename is an *abbreviated* truename, so use file-truename instead., ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 745c437 092/495: style fixes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c833b77 094/495: Fix cache invalidation for dangling operator cache, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 87c8b6e 096/495: do not use dangling op cache when buffer is narrowed, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 8e19ae5 097/495: add some documentation, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode b5960fe 099/495: nicer messages in gofmt, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 939d630 100/495: style fixes, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode 47b3928 102/495: disable read-only on error buffer before trying to write to it, ELPA Syncer, 2021/08/07
- [nongnu] elpa/go-mode c94ca2e 064/495: refactor, ELPA Syncer, 2021/08/07