saving window configration.
This commit is contained in:
parent
81ca3fe816
commit
cfa7466eef
@ -25,6 +25,16 @@
|
|||||||
;; must be sorted
|
;; must be sorted
|
||||||
(defvar ghc-reserved-keyword '("case" "deriving" "do" "else" "if" "in" "let" "module" "of" "then" "where"))
|
(defvar ghc-reserved-keyword '("case" "deriving" "do" "else" "if" "in" "let" "module" "of" "then" "where"))
|
||||||
|
|
||||||
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;;;
|
||||||
|
;;; Local Variables
|
||||||
|
;;;
|
||||||
|
|
||||||
|
(defvar ghc-window-configuration nil)
|
||||||
|
|
||||||
|
(mapc 'make-variable-buffer-local
|
||||||
|
'(ghc-window-configuration))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;
|
;;;
|
||||||
;;; Initializer
|
;;; Initializer
|
||||||
@ -105,14 +115,24 @@
|
|||||||
((not (string= pattern completion)) ;; ???
|
((not (string= pattern completion)) ;; ???
|
||||||
(delete-region beg end)
|
(delete-region beg end)
|
||||||
(insert completion)
|
(insert completion)
|
||||||
(delete-other-windows))
|
(ghc-reset-window-configuration))
|
||||||
(t ;; multiple completions
|
(t ;; multiple completions
|
||||||
(let* ((list0 (all-completions pattern symbols))
|
(let* ((list0 (all-completions pattern symbols))
|
||||||
(list (sort list0 'string<)))
|
(list (sort list0 'string<)))
|
||||||
(if (> (length list) 1)
|
(if (= (length list) 1)
|
||||||
(with-output-to-temp-buffer ghc-completion-buffer-name
|
(ghc-reset-window-configuration)
|
||||||
(display-completion-list list pattern))
|
(ghc-save-window-configuration)
|
||||||
(delete-other-windows)))))))
|
(with-output-to-temp-buffer ghc-completion-buffer-name
|
||||||
|
(display-completion-list list pattern))))))))
|
||||||
|
|
||||||
|
(defun ghc-save-window-configuration ()
|
||||||
|
(unless (get-buffer-window ghc-completion-buffer-name)
|
||||||
|
(setq ghc-window-configuration (current-window-configuration))))
|
||||||
|
|
||||||
|
(defun ghc-reset-window-configuration ()
|
||||||
|
(when ghc-window-configuration
|
||||||
|
(set-window-configuration ghc-window-configuration)
|
||||||
|
(setq ghc-window-configuration nil)))
|
||||||
|
|
||||||
(defun ghc-select-completion-symbol ()
|
(defun ghc-select-completion-symbol ()
|
||||||
(cond
|
(cond
|
||||||
|
Loading…
Reference in New Issue
Block a user