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 ;;;###autoload
(defun +emacs-lisp/repl () (defun +emacs-lisp/repl ()
"Open an ielm REPL for Emacs Lisp." "Open the Emacs Lisp REPL (`ielm')."
(interactive) (interactive)
(ielm) (pop-to-buffer
(let ((buf (current-buffer))) (or (get-buffer "*ielm*")
(bury-buffer) (progn (ielm)
(pop-to-buffer buf))) (let ((buf (get-buffer "*ielm*")))
(bury-buffer buf)
buf)))))
;; ---- ert --------------------------------------------------- ;; ---- ert ---------------------------------------------------

View file

@ -6,9 +6,7 @@
(add-hook 'emacs-lisp-mode-hook '+emacs-lisp|hook) (add-hook 'emacs-lisp-mode-hook '+emacs-lisp|hook)
:config :config
(map! :map emacs-lisp-mode-map (set! :repl 'emacs-lisp-mode '+emacs-lisp/repl)
:m "gd" '+emacs-lisp/find-function)
(set! :rotate 'emacs-lisp-mode (set! :rotate 'emacs-lisp-mode
:symbols '(("t" "nil") :symbols '(("t" "nil")
("let" "let*") ("let" "let*")
@ -21,6 +19,9 @@
;; Don't affect lisp indentation (only `tab-width') ;; Don't affect lisp indentation (only `tab-width')
(set! :editorconfig :remove 'emacs-lisp-mode) (set! :editorconfig :remove 'emacs-lisp-mode)
(map! :map emacs-lisp-mode-map
:m "gd" '+emacs-lisp/find-function)
(defun +emacs-lisp|hook () (defun +emacs-lisp|hook ()
(setq mode-name "Elisp") ; [pedantry intensifies] (setq mode-name "Elisp") ; [pedantry intensifies]
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t) (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
@ -69,5 +70,9 @@
(def-package! slime (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 :init
(setq python-environment-directory doom-cache-dir (setq python-environment-directory doom-cache-dir
python-indent-guess-indent-offset-verbose nil python-indent-guess-indent-offset-verbose nil
python-shell-interpreter "ipython" python-shell-interpreter "python"
python-shell-interpreter-args "--deep-reload" python-shell-interpreter-args nil
python-shell-prompt-regexp "In \\[[0-9]+\\]: " python-shell-prompt-regexp "In \\[[0-9]+\\]: "
python-shell-prompt-block-regexp "\\.\\.\\.\\.: " python-shell-prompt-block-regexp "\\.\\.\\.\\.: "
python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: "

View file

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