fixing doc (#599).

This commit is contained in:
Kazu Yamamoto 2015-09-15 16:50:25 +09:00
parent 5af2c939b3
commit aad7cdebe5
2 changed files with 12 additions and 8 deletions

View File

@ -41,14 +41,16 @@
(ghc-defstruct pkg-ver-path pkg ver path) (ghc-defstruct pkg-ver-path pkg ver path)
(defun ghc-resolve-document-path (mod) (defun ghc-resolve-document-path (mod)
(with-temp-buffer (let ((root ghc-process-root))
(ghc-call-process ghc-module-command nil t nil "doc" mod) (with-temp-buffer
(goto-char (point-min)) (let ((default-directory root))
(when (looking-at "^\\([^ ]+\\)-\\([0-9]*\\(\\.[0-9]+\\)*\\) \\(.*\\)$") (ghc-call-process ghc-module-command nil t nil "doc" mod))
(ghc-make-pkg-ver-path (goto-char (point-min))
:pkg (match-string-no-properties 1) (when (looking-at "^\\([^ ]+\\)-\\([0-9]*\\(\\.[0-9]+\\)*\\) \\(.*\\)$")
:ver (match-string-no-properties 2) (ghc-make-pkg-ver-path
:path (match-string-no-properties 4))))) :pkg (match-string-no-properties 1)
:ver (match-string-no-properties 2)
:path (match-string-no-properties 4))))))
(defconst ghc-doc-local-format "file://%s/%s.html") (defconst ghc-doc-local-format "file://%s/%s.html")
(defconst ghc-doc-hackage-format (defconst ghc-doc-hackage-format

View File

@ -46,6 +46,8 @@
(buf (get-buffer-create (concat " ghc-mod:" name))) (buf (get-buffer-create (concat " ghc-mod:" name)))
(file (buffer-file-name)) (file (buffer-file-name))
(cpro (get-process name))) (cpro (get-process name)))
;; setting root in the original buffer, sigh
(setq ghc-process-root root)
(ghc-with-current-buffer buf (ghc-with-current-buffer buf
(setq ghc-process-original-buffer cbuf) (setq ghc-process-original-buffer cbuf)
(setq ghc-process-original-file file) (setq ghc-process-original-file file)