From c99c448c657de2607cc3b7272366c208a632e9b0 Mon Sep 17 00:00:00 2001 From: Takahiro HIMURA Date: Tue, 14 Feb 2012 22:27:48 +0900 Subject: [PATCH] Fixed the conflicts with the package which modify (buffer-name) value. --- elisp/ghc-comp.el | 7 ++++--- elisp/ghc-info.el | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/elisp/ghc-comp.el b/elisp/ghc-comp.el index a4d59d2..b15dddb 100644 --- a/elisp/ghc-comp.el +++ b/elisp/ghc-comp.el @@ -270,12 +270,13 @@ unloaded modules are loaded") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun ghc-gather-import-modules-all-buffers () - (let ((bufs (mapcar 'buffer-name (buffer-list))) + (let ((bufs (mapcar (lambda (b) (cons (buffer-name b) (buffer-file-name b))) + (buffer-list))) ret) (save-excursion (dolist (buf bufs (ghc-uniq-lol ret)) - (when (string-match "\\.hs$" buf) - (set-buffer buf) + (when (and (cdr buf) (string-match "\\.hs$" (cdr buf))) + (set-buffer (car buf)) (ghc-add ret (ghc-gather-import-modules-buffer))))))) (defun ghc-gather-import-modules-buffer () diff --git a/elisp/ghc-info.el b/elisp/ghc-info.el index 4e39263..a470ea1 100644 --- a/elisp/ghc-info.el +++ b/elisp/ghc-info.el @@ -23,7 +23,7 @@ (let* ((expr0 (ghc-things-at-point)) (expr (if ask (ghc-read-expression expr0) expr0)) (cdir default-directory) - (file (buffer-name)) + (file buffer-file-name) (buf (get-buffer-create ghc-error-buffer-name))) (with-current-buffer buf (erase-buffer) @@ -120,7 +120,7 @@ (let* ((ln (int-to-string (line-number-at-pos))) (cn (int-to-string (current-column))) (cdir default-directory) - (file (buffer-name))) + (file buffer-file-name)) (ghc-read-lisp (lambda () (cd cdir)