Merge pull request #154 from tsukimizake/master

Update emacs integration
This commit is contained in:
Brian Schott 2014-08-09 07:38:12 +00:00
commit 043b32357d
2 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@
##Requirements ##Requirements
* You must have the [auto-complete](https://github.com/auto-complete/auto-complete) package. * You must have the [auto-complete](https://github.com/auto-complete/auto-complete) package.
[yasnippet](https://github.com/capitaomorte/yasnippet) and [popwin](https://github.com/m2ym/popwin-el) is recommended. And, [yasnippet](https://github.com/capitaomorte/yasnippet) and [popwin](https://github.com/m2ym/popwin-el) is recommended.
* Make sure dcd-client and dcd-server is in your exec-path. Otherwise, please set the variable ```dcd-exectutable``` and ```dcd-server-executable``` using ```M-x customize```. * Make sure dcd-client and dcd-server is in your exec-path. Otherwise, please set the variable ```dcd-exectutable``` and ```dcd-server-executable``` using ```M-x customize```.
## Setup ## Setup
@ -13,10 +13,11 @@
;;; ac-dcd ;;; ac-dcd
(add-to-list 'load-path "path_to_ac-dcd.el") (add-to-list 'load-path "path_to_ac-dcd.el")
(require 'ac-dcd) (require 'ac-dcd)
(add-to-list 'ac-modes 'd-mode)
(add-hook 'd-mode-hook (add-hook 'd-mode-hook
'(lambda () "set up ac-dcd" '(lambda () "set up ac-dcd"
(auto-complete-mode t)
(yas-minor-mode-on)
(ac-dcd-maybe-start-server) (ac-dcd-maybe-start-server)
(add-to-list 'ac-sources 'ac-source-dcd))) (add-to-list 'ac-sources 'ac-source-dcd)))

View File

@ -153,7 +153,7 @@ If you want to restart server, use `ac-dcd-init-server' instead."
(defun ac-dcd-call-process (prefix args) (defun ac-dcd-call-process (prefix args)
(if (null ac-dcd-executable) (if (null ac-dcd-executable)
(error (format "Could not find dcd-client executable")) (error (format "Could not find dcd-client executable"))
(let ((buf (get-buffer-create "*dcd-output*")) (let ((buf (get-buffer-create ac-dcd-output-buffer-name))
res) res)
(with-current-buffer buf (erase-buffer)) (with-current-buffer buf (erase-buffer))
(setq res (apply 'call-process-region (point-min) (point-max) (setq res (apply 'call-process-region (point-min) (point-max)
@ -501,6 +501,7 @@ so I have to replace it with struct name."
(goto-char (point-min)) (goto-char (point-min))
(forward-char (string-to-number offset)))))))) (forward-char (string-to-number offset))))))))
;; utilities for goto-definition ;; utilities for goto-definition
(defun ac-dcd-call-process-for-symbol-declaration (pos) (defun ac-dcd-call-process-for-symbol-declaration (pos)
@ -530,7 +531,7 @@ output is just like following.\n
(cons (match-string 1) (match-string 2))) (cons (match-string 1) (match-string 2)))
(cons nil nil))) (cons nil nil)))
)) ))
(provide 'ac-dcd) (provide 'ac-dcd)
;;; ac-dcd.el ends here ;;; ac-dcd.el ends here