Skip to content

Commit

Permalink
A couple of fixes for a case when buffer has no filepath assigned to it.
Browse files Browse the repository at this point in the history
  • Loading branch information
nsf committed Aug 9, 2013
1 parent 6ce9564 commit 0644e23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion emacs-company/company-go.el
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
nil
"-f=csv"
"autocomplete"
(buffer-file-name)
(or (buffer-file-name) "")
(concat "c" (int-to-string (- (point) 1))))
(with-current-buffer temp-buffer (buffer-string))
(kill-buffer temp-buffer))))
Expand Down
10 changes: 5 additions & 5 deletions emacs/go-autocomplete.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; go-autocomplete.el --- auto-complete-mode backend for go-mode

;; Copyright (C) 2010
;; Copyright (C) 2010

;; Author: Mikhail <tensai@cirno.in> Kuryshev
;; Keywords: languages
Expand All @@ -21,12 +21,12 @@

;;; Commentary:

;; Ensure that go-autocomplete in your load-path and add to your ~/.emacs
;; Ensure that go-autocomplete in your load-path and add to your ~/.emacs
;; following line:
;;
;; (require 'go-autocomplete)

;; Also you could setup any combination (for example M-TAB)
;; Also you could setup any combination (for example M-TAB)
;; for invoking auto-complete:
;;
;; (require 'auto-complete-config)
Expand All @@ -40,7 +40,7 @@

;(defvar go-reserved-keywords
; '("break" "case" "chan" "const" "continue" "default" "defer" "else"
; "fallthrough" "for" "func" "go" "goto" "if" "import" "interface"
; "fallthrough" "for" "func" "go" "goto" "if" "import" "interface"
; "map" "package" "range" "return" "select" "struct" "switch" "type" "var")
; "Go reserved keywords.")

Expand Down Expand Up @@ -77,7 +77,7 @@
nil
"-f=emacs"
"autocomplete"
(buffer-file-name)
(or (buffer-file-name) "")
(concat "c" (int-to-string (- (point) 1))))
(with-current-buffer temp-buffer (buffer-string))
(kill-buffer temp-buffer))))
Expand Down

0 comments on commit 0644e23

Please sign in to comment.