Use temporary buffer for ghc-display
Instead of opening a normal editable buffer (in which editing text does not make a lot of sense), use Emacs's temporary buffer. Benefits: - Read only: Text cannot be modified when focused. - Much easier to close (press q), after reading or copying from the warning/error. Signed-off-by: Rohan Jain <crodjer@gmail.com>
This commit is contained in:
parent
cc519edc98
commit
a21178d2af
@ -147,7 +147,8 @@
|
||||
(defconst ghc-error-buffer-name "*GHC Info*")
|
||||
|
||||
(defun ghc-display (fontify ins-func)
|
||||
(let ((buf (get-buffer-create ghc-error-buffer-name)))
|
||||
(let ((buf ghc-error-buffer-name))
|
||||
(with-output-to-temp-buffer buf
|
||||
(with-current-buffer buf
|
||||
(erase-buffer)
|
||||
(funcall ins-func)
|
||||
@ -157,7 +158,7 @@
|
||||
(turn-off-haskell-font-lock)
|
||||
(haskell-font-lock-defaults-create)
|
||||
(turn-on-haskell-font-lock)))
|
||||
(display-buffer buf)))
|
||||
(display-buffer buf))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user