Don't discard version number in ghc-resolve-package

and match last (i.e. newest) rather than first listed
package.
This commit is contained in:
Daniel Schoepe 2010-10-27 20:55:31 +02:00
parent 14014e1a5e
commit 562441deb6

View File

@ -22,8 +22,8 @@
(with-temp-buffer (with-temp-buffer
(call-process "ghc-pkg" nil t nil "find-module" "--simple-output" mod) (call-process "ghc-pkg" nil t nil "find-module" "--simple-output" mod)
(goto-char (point-min)) (goto-char (point-min))
(when (looking-at "^\\([^ ]+\\)-[0-9]") (when (re-search-forward "[^ ]+-[0-9]*\\(\\.[0-9]*\\)*$")
(match-string-no-properties 1)))) (match-string-no-properties 0))))
(defun ghc-resolve-document-path (pkg) (defun ghc-resolve-document-path (pkg)
(with-temp-buffer (with-temp-buffer
@ -70,4 +70,4 @@
(if (looking-at "^\\(import\\|module\\) +\\(qualified +\\)?\\([^ (\n]+\\)") (if (looking-at "^\\(import\\|module\\) +\\(qualified +\\)?\\([^ (\n]+\\)")
(match-string-no-properties 3)))) (match-string-no-properties 3))))
(provide 'ghc-doc) (provide 'ghc-doc)