1
0
mirror of https://github.com/golang/go synced 2024-11-25 02:27:56 -07:00
go/misc/emacs/go-mode-load.el
Dominik Honnef b302d68ebc misc/emacs: Greatly improve go-mode for Emacs.
The original go-mode is plagued with odd behaviour, lack of
behaviour typical to modes in Emacs and bugs.

This change rewrites great parts of go-mode (basically only
keeping the gofmt and godoc functions).

Additionally it adds new features such as manipulating package
imports.

For more information please see
https://groups.google.com/group/golang-nuts/browse_frm/thread/3a9d6dae3369c0b5/1efe65e2f7afb190

Fixes #3618.
Fixes #4240.
Fixes #4322.
Fixes #4671.
Fixes #4726.

R=golang-dev, fullung, sameer, cw, arthur, proppy, adonovan, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/7314113
2013-02-26 13:48:32 -05:00

97 lines
2.9 KiB
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; go-mode-load.el --- automatically extracted autoloads
;;; Commentary:
;; To install go-mode, add the following lines to your .emacs file:
;; (add-to-list 'load-path "PATH CONTAINING go-mode-load.el" t)
;; (require 'go-mode-load)
;;
;; After this, go-mode will be used for files ending in '.go'.
;;
;; To compile go-mode from the command line, run the following
;; emacs -batch -f batch-byte-compile go-mode.el
;;
;; See go-mode.el for documentation.
;;
;; To update this file, evaluate the following form
;; (let ((generated-autoload-file buffer-file-name)) (update-file-autoloads "go-mode.el"))
;;; Code:
;;;### (autoloads (go-download-play godoc gofmt-before-save go-mode)
;;;;;; "go-mode" "go-mode.el" (20767 50749))
;;; Generated autoloads from go-mode.el
(autoload 'go-mode "go-mode" "\
Major mode for editing Go source text.
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)
\(fn)" t nil)
(add-to-list 'auto-mode-alist (cons "\\.go\\'" 'go-mode))
(autoload 'gofmt-before-save "go-mode" "\
Add this to .emacs to run gofmt on the current buffer when saving:
(add-hook 'before-save-hook 'gofmt-before-save).
Note that this will cause go-mode to get loaded the first time
you save any file, kind of defeating the point of autoloading.
\(fn)" t nil)
(autoload 'godoc "go-mode" "\
Show go documentation for a query, much like M-x man.
\(fn QUERY)" t nil)
(autoload 'go-download-play "go-mode" "\
Downloads a paste from the playground and inserts it in a Go
buffer. Tries to look for a URL at point.
\(fn URL)" t nil)
;;;***
(provide 'go-mode-load)
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; coding: utf-8
;; End:
;;; go-mode-load.el ends here