Merge pull request #150 from atilaneves/emacs_temp_files

Fix issue #135: 'Emacs temporary files cause DCD to crash'. dcd-server n...
This commit is contained in:
Brian Schott 2014-08-03 22:17:33 +00:00
commit e8c5dc4b75
2 changed files with 25 additions and 25 deletions

View File

@ -150,21 +150,19 @@ If you want to restart server, use `ac-dcd-init-server' instead."
;; utility functions to call process ;; utility functions to call process
(defun ac-dcd-call-process (prefix &rest args)
(defun ac-dcd-call-process (prefix args) (if (null ac-dcd-executable)
(let ((buf (get-buffer-create ac-dcd-output-buffer-name)) (error (format "Could not find dcd-client executable"))
(let ((buf (get-buffer-create "*dcd-output*"))
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)
ac-dcd-executable nil buf nil ac-dcd-executable nil buf nil args))
args
))
(with-current-buffer buf (with-current-buffer buf
(goto-char (point-min)) (unless (eq 0 res)
(when (re-search-forward ac-dcd-error-message-regexp nil t)
(ac-dcd-handle-error res args)) (ac-dcd-handle-error res args))
;; Still try to get any useful input. ;; Still try to get any useful input.
(ac-dcd-parse-output prefix)))) (ac-dcd-parse-output prefix)))))
(defsubst ac-dcd-cursor-position () (defsubst ac-dcd-cursor-position ()
"Get cursor position to pass to dcd-client. "Get cursor position to pass to dcd-client.

View File

@ -101,6 +101,8 @@ struct ModuleCache
{ {
foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth)) foreach (fileName; dirEntries(path, "*.{d,di}", SpanMode.depth))
{ {
import std.path: baseName;
if(fileName.baseName.startsWith(".#")) continue;
getSymbolsInModule(fileName); getSymbolsInModule(fileName);
} }
} }