tools/eval: associate plist with repl handlers

Also consolidates all REPLs (opened through the :tools eval module)
under one popup rule, which inhibits ESC from prematurely closing
them (#1944), and cleans up after their buffers *only* if their handlers
weren't specified to :persist, e.g.

  (set-repl-handler! 'some-mode #'some-repl-handler :persist t)

Also standardized ESS's REPL commands.
This commit is contained in:
Henrik Lissner 2019-10-23 21:39:19 -04:00
parent e6094f262f
commit 0b67251159
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
9 changed files with 71 additions and 47 deletions

View file

@ -21,19 +21,9 @@
(set-file-template! 'haskell-mode
:trigger #'haskell-auto-insert-module-template
:project t)
(set-repl-handler! '(haskell-mode
haskell-cabal-mode
literate-haskell-mode)
#'+haskell/open-repl)
;; Prevent the 'Kill the whole session (y or n)?' prompt caused by the popup
;; manager auto-killing haskell-interactive-mode's popup buffer (and process)
;; by settings :ttl to nil.
(set-popup-rule!
(lambda (bname _action)
(eq (buffer-local-value 'major-mode (get-buffer bname))
'haskell-interactive-mode))
:select t :ttl nil :quit nil)
(set-repl-handler!
'(haskell-mode haskell-cabal-mode literate-haskell-mode)
#'+haskell/open-repl :persist t)
(add-hook! 'haskell-mode-hook
#'haskell-collapse-mode ; support folding haskell code blocks