Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1920)

Delta Between Two Patch Sets: misc/emacs/go-mode.el

Issue 5370101: code review 5370101: misc/emacs: add delete builtin
Left Patch Set: Created 13 years, 4 months ago
Right Patch Set: diff -r be4d7ed4ed68 https://go.googlecode.com/hg/ Created 13 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 ;;; go-mode.el --- Major mode for the Go programming language 1 ;;; go-mode.el --- Major mode for the Go programming language
2 2
3 ;;; Commentary: 3 ;;; Commentary:
4 4
5 ;; For installation instructions, see go-mode-load.el 5 ;; For installation instructions, see go-mode-load.el
6 6
7 ;;; To do: 7 ;;; To do:
8 8
9 ;; * Indentation is *almost* identical to gofmt 9 ;; * Indentation is *almost* identical to gofmt
10 ;; ** We think struct literal keys are labels and outdent them 10 ;; ** We think struct literal keys are labels and outdent them
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 (defvar go-mode-keywords 62 (defvar go-mode-keywords
63 '("break" "default" "func" "interface" "select" 63 '("break" "default" "func" "interface" "select"
64 "case" "defer" "go" "map" "struct" 64 "case" "defer" "go" "map" "struct"
65 "chan" "else" "goto" "package" "switch" 65 "chan" "else" "goto" "package" "switch"
66 "const" "fallthrough" "if" "range" "type" 66 "const" "fallthrough" "if" "range" "type"
67 "continue" "for" "import" "return" "var") 67 "continue" "for" "import" "return" "var")
68 "All keywords in the Go language. Used for font locking and 68 "All keywords in the Go language. Used for font locking and
69 some syntax analysis.") 69 some syntax analysis.")
70 70
71 (defvar go-mode-font-lock-keywords 71 (defvar go-mode-font-lock-keywords
72 (let ((builtins '("append" "cap" "close" "complex" "copy" "imag" "len" 72 (let ((builtins '("append" "cap" "close" "complex" "copy" "delete" "imag" "len "
73 "make" "new" "panic" "print" "println" "real" "recover")) 73 "make" "new" "panic" "print" "println" "real" "recover"))
74 (constants '("nil" "true" "false" "iota")) 74 (constants '("nil" "true" "false" "iota"))
75 (type-name "\\s *\\(?:[*(]\\s *\\)*\\(?:\\w+\\s *\\.\\s *\\)?\\(\\w+\\)" ) 75 (type-name "\\s *\\(?:[*(]\\s *\\)*\\(?:\\w+\\s *\\.\\s *\\)?\\(\\w+\\)" )
76 ) 76 )
77 `((,(regexp-opt go-mode-keywords 'words) . font-lock-keyword-face) 77 `((,(regexp-opt go-mode-keywords 'words) . font-lock-keyword-face)
78 (,(regexp-opt builtins 'words) . font-lock-builtin-face) 78 (,(regexp-opt builtins 'words) . font-lock-builtin-face)
79 (,(regexp-opt constants 'words) . font-lock-constant-face) 79 (,(regexp-opt constants 'words) . font-lock-constant-face)
80 ;; Function names in declarations 80 ;; Function names in declarations
81 ("\\<func\\>\\s *\\(\\w+\\)" 1 font-lock-function-name-face) 81 ("\\<func\\>\\s *\\(\\w+\\)" 1 font-lock-function-name-face)
82 ;; Function names in methods are handled by function call pattern 82 ;; Function names in methods are handled by function call pattern
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 "Show go documentation for a query, much like M-x man." 582 "Show go documentation for a query, much like M-x man."
583 (interactive (list (godoc-read-query))) 583 (interactive (list (godoc-read-query)))
584 (unless (string= query "") 584 (unless (string= query "")
585 (set-process-sentinel 585 (set-process-sentinel
586 (start-process-shell-command "godoc" (godoc-get-buffer query) 586 (start-process-shell-command "godoc" (godoc-get-buffer query)
587 (concat "godoc " query)) 587 (concat "godoc " query))
588 'godoc-buffer-sentinel) 588 'godoc-buffer-sentinel)
589 nil)) 589 nil))
590 590
591 (provide 'go-mode) 591 (provide 'go-mode)
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b