lang{emacs-lisp,python,ruby}: improve repl integration

This commit is contained in:
Henrik Lissner 2017-03-04 18:31:18 -05:00
parent 6f439b355c
commit ca75c1cf49
4 changed files with 24 additions and 14 deletions

View file

@ -20,12 +20,14 @@ C-u), then reveal the function in a popup window."
;;;###autoload
(defun +emacs-lisp/repl ()
"Open an ielm REPL for Emacs Lisp."
"Open the Emacs Lisp REPL (`ielm')."
(interactive)
(ielm)
(let ((buf (current-buffer)))
(bury-buffer)
(pop-to-buffer buf)))
(pop-to-buffer
(or (get-buffer "*ielm*")
(progn (ielm)
(let ((buf (get-buffer "*ielm*")))
(bury-buffer buf)
buf)))))
;; ---- ert ---------------------------------------------------

View file

@ -6,9 +6,7 @@
(add-hook 'emacs-lisp-mode-hook '+emacs-lisp|hook)
:config
(map! :map emacs-lisp-mode-map
:m "gd" '+emacs-lisp/find-function)
(set! :repl 'emacs-lisp-mode '+emacs-lisp/repl)
(set! :rotate 'emacs-lisp-mode
:symbols '(("t" "nil")
("let" "let*")
@ -21,6 +19,9 @@
;; Don't affect lisp indentation (only `tab-width')
(set! :editorconfig :remove 'emacs-lisp-mode)
(map! :map emacs-lisp-mode-map
:m "gd" '+emacs-lisp/find-function)
(defun +emacs-lisp|hook ()
(setq mode-name "Elisp") ; [pedantry intensifies]
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
@ -69,5 +70,9 @@
(def-package! slime
:config (setq inferior-lisp-program "clisp"))
:config
(setq inferior-lisp-program "clisp"
;; enable fuzzy matching in code buffer and SLIME REPL
slime-complete-symbol*-fancy t
slime-complete-symbol-function 'slime-fuzzy-complete-symbol))

View file

@ -5,8 +5,8 @@
:init
(setq python-environment-directory doom-cache-dir
python-indent-guess-indent-offset-verbose nil
python-shell-interpreter "ipython"
python-shell-interpreter-args "--deep-reload"
python-shell-interpreter "python"
python-shell-interpreter-args nil
python-shell-prompt-regexp "In \\[[0-9]+\\]: "
python-shell-prompt-block-regexp "\\.\\.\\.\\.: "
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "

View file

@ -7,10 +7,8 @@
:init
(add-hook 'ruby-mode-hook 'flycheck-mode)
:config
(set! :build 'rake 'ruby-mode '+ruby/rake)
(set! :company-backend 'ruby-mode '(company-dabbrev-code))
(set! :electric 'ruby-mode :words '("else" "end" "elseif"))
(set! :repl 'ruby-mode 'inf-ruby)
(setq ruby-deep-indent-paren t)
;; Don't interfere with my custom RET behavior
(define-key ruby-mode-map [?\n] nil)
@ -65,6 +63,8 @@
(def-package! inf-ruby
:commands (inf-ruby inf-ruby-console-auto)
:init
(set! :repl 'ruby-mode 'inf-ruby)
:config
(set! :company-backend 'inf-ruby-mode '(company-inf-ruby)))
@ -78,4 +78,7 @@
;;
;; (def-project-mode! +ruby-rake-mode
;; :files "Rakefile")
;; :files "Rakefile"
;; :init
;; (set! :build 'rake '+ruby-rake-mode '+ruby/rake
;; :when (doom-project-has! "Rakefile")))