Update extract module regexp for unicode quotes

GHC-7.8.x uses U+2018 and U+2019 for quotes.

Also do not call ghc-resolve-document-path if module cannot be extracted
in case of local functions.
This commit is contained in:
Iku Iwasa 2014-11-29 12:11:06 +09:00
parent e487a366d8
commit 3a88db6c2b

View File

@ -22,8 +22,8 @@
(setq expr (ghc-read-expression expr0))
(setq info (ghc-get-info expr0))
(setq mod (ghc-extact-module-from-info info)))
(setq pkg-ver-path (ghc-resolve-document-path mod))
(if (and pkg-ver-path mod)
(setq pkg-ver-path (and mod (ghc-resolve-document-path mod)))
(if pkg-ver-path
(ghc-display-document pkg-ver-path mod haskell-org expr)
(message "No document found"))))
@ -75,7 +75,7 @@
(apply 'concat (nreverse acc))))
(defun ghc-extact-module-from-info (info)
(when (string-match "\`\\([^']+\\)'" info)
(when (string-match "[`\u2018]\\([^'\u2019]+\\)['\u2019]" info)
(match-string 1 info)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;