No NARF, only DOOM

This commit is contained in:
Henrik Lissner 2016-05-20 22:37:30 -04:00
parent a984bf4f26
commit ad225d2591
104 changed files with 1404 additions and 1409 deletions

View file

@ -1,36 +1,35 @@
;;; defuns-repl.el
;;;###autoload (autoload 'narf:repl "defuns-repl" nil t)
(evil-define-command narf:repl (&optional bang command)
;;;###autoload (autoload 'doom:repl "defuns-repl" nil t)
(evil-define-command doom:repl (&optional bang command)
:repeat nil
(interactive "<!><a>")
(if (and narf--repl-buffer (buffer-live-p narf--repl-buffer))
(narf/popup-buffer narf--repl-buffer)
(if (and doom--repl-buffer (buffer-live-p doom--repl-buffer))
(doom/popup-buffer doom--repl-buffer)
(rtog/toggle-repl (if (use-region-p) 4))
(setq narf--repl-buffer (current-buffer))
(setq doom--repl-buffer (current-buffer))
(when command
(with-current-buffer narf--repl-buffer
(with-current-buffer doom--repl-buffer
(insert command)
(unless bang (comint-send-input))))))
;;;###autoload (autoload 'narf:repl-eval "defuns-repl" nil t)
(evil-define-operator narf:repl-eval (&optional beg end bang)
;;;###autoload (autoload 'doom:repl-eval "defuns-repl" nil t)
(evil-define-operator doom:repl-eval (&optional beg end bang)
:type inclusive
:repeat nil
(interactive "<r><!>")
(let ((region-p (use-region-p))
(selection (s-trim (buffer-substring-no-properties beg end))))
(narf:repl bang)
(doom:repl bang)
(when (and region-p beg end)
(let* ((buf narf--repl-buffer)
(let* ((buf doom--repl-buffer)
(win (get-buffer-window buf)))
(unless (eq buf (narf/popup-p (get-buffer-window buf)))
(narf/popup-buffer buf))
(when (and narf--repl-buffer (buffer-live-p narf--repl-buffer))
(with-current-buffer narf--repl-buffer
(unless (eq buf (doom/popup-p (get-buffer-window buf)))
(doom/popup-buffer buf))
(when (and doom--repl-buffer (buffer-live-p doom--repl-buffer))
(with-current-buffer doom--repl-buffer
(goto-char (point-max))
(insert selection)))))))
(provide 'defuns-repl)
;;; defuns-repl.el ends here