From 562441deb6a1a2794dd0d1ae8bb564aaedefe222 Mon Sep 17 00:00:00 2001 From: Daniel Schoepe Date: Wed, 27 Oct 2010 20:55:31 +0200 Subject: [PATCH] Don't discard version number in ghc-resolve-package and match last (i.e. newest) rather than first listed package. --- elisp/ghc-doc.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/elisp/ghc-doc.el b/elisp/ghc-doc.el index e90a5a3..ca7d6ac 100644 --- a/elisp/ghc-doc.el +++ b/elisp/ghc-doc.el @@ -22,8 +22,8 @@ (with-temp-buffer (call-process "ghc-pkg" nil t nil "find-module" "--simple-output" mod) (goto-char (point-min)) - (when (looking-at "^\\([^ ]+\\)-[0-9]") - (match-string-no-properties 1)))) + (when (re-search-forward "[^ ]+-[0-9]*\\(\\.[0-9]*\\)*$") + (match-string-no-properties 0)))) (defun ghc-resolve-document-path (pkg) (with-temp-buffer @@ -70,4 +70,4 @@ (if (looking-at "^\\(import\\|module\\) +\\(qualified +\\)?\\([^ (\n]+\\)") (match-string-no-properties 3)))) -(provide 'ghc-doc) \ No newline at end of file +(provide 'ghc-doc)