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)
(defun ghc-resolve-document-path (mod)
(with-temp-buffer
(ghc-call-process ghc-module-command nil t nil "doc" mod)
(goto-char (point-min))
(when (looking-at "^\\([^ ]+\\)-\\([0-9]*\\(\\.[0-9]+\\)*\\) \\(.*\\)$")
(ghc-make-pkg-ver-path
:pkg (match-string-no-properties 1)
:ver (match-string-no-properties 2)
:path (match-string-no-properties 4)))))
(let ((root ghc-process-root))
(with-temp-buffer
(let ((default-directory root))
(ghc-call-process ghc-module-command nil t nil "doc" mod))
(goto-char (point-min))
(when (looking-at "^\\([^ ]+\\)-\\([0-9]*\\(\\.[0-9]+\\)*\\) \\(.*\\)$")
(ghc-make-pkg-ver-path
: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-hackage-format

View File

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