From 3a88db6c2bfdbcd9829a259568fd47fb18a8d3f6 Mon Sep 17 00:00:00 2001 From: Iku Iwasa Date: Sat, 29 Nov 2014 12:11:06 +0900 Subject: [PATCH] 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. --- 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 cfb5e61..46fe2aa 100644 --- a/elisp/ghc-doc.el +++ b/elisp/ghc-doc.el @@ -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))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;