SLY: Fix history patch to work with Evil Collection.

master
Pierre Neidhardt 2021-02-21 18:46:39 +01:00
parent 0ad53caae6
commit 76a1497f0a
1 changed files with 3 additions and 55 deletions

View File

@ -1,58 +1,6 @@
(define-derived-mode sly-mrepl-mode comint-mode "mrepl"
(sly-mode 1)
(cl-loop for (var value)
in `((comint-use-prompt-regexp nil)
(comint-inhibit-carriage-motion t)
(comint-input-sender sly-mrepl--input-sender)
(comint-output-filter-functions nil)
(comint-input-filter-functions nil)
(comint-history-isearch dwim)
(comint-input-ignoredups t)
(comint-input-history-ignore "^;") ;; XXX: Patched!
(comint-prompt-read-only t)
(comint-process-echoes nil)
(comint-completion-addsuffix "")
(indent-line-function lisp-indent-line)
(sly-mrepl--read-mark nil)
(sly-mrepl--pending-output nil)
(sly-mrepl--output-mark ,(point-marker))
(sly-mrepl--last-prompt-overlay ,(make-overlay 0 0 nil nil))
(sly-find-buffer-package-function sly-mrepl-guess-package)
(sly-autodoc-inhibit-autodoc
sly-mrepl-inside-string-or-comment-p)
(mode-line-process nil)
(parse-sexp-ignore-comments t)
(syntax-propertize-function sly-mrepl--syntax-propertize)
(forward-sexp-function sly-mrepl--forward-sexp)
(comint-scroll-show-maximum-output nil)
(comint-scroll-to-bottom-on-input nil)
(comint-scroll-to-bottom-on-output nil)
(inhibit-field-text-motion nil)
(lisp-indent-function sly-common-lisp-indent-function)
(open-paren-in-column-0-is-defun-start nil)
(buffer-file-coding-system utf-8-unix)
;; Paredit workaround (see
;; https://github.com/joaotavora/sly/issues/110)
(paredit-override-check-parens-function (lambda (_c) t))
(comment-start ";"))
do (set (make-local-variable var) value))
(set-marker-insertion-type sly-mrepl--output-mark nil)
(add-hook 'kill-emacs-hook 'sly-mrepl--save-all-histories)
;;(set (make-local-variable 'comint-get-old-input) 'ielm-get-old-input)
(set-syntax-table lisp-mode-syntax-table)
(set-keymap-parent sly-mrepl-mode-map nil)
(defun ambrevar/sly-fix-history-ignore ()
(set (make-local-variable 'comint-input-history-ignore) "^;"))
;; The REPL buffer has interactive text buttons
(sly-interactive-buttons-mode 1)
;; Add hooks to isearch-mode placed strategically after the ones
;; set by comint.el itself.
;;
(add-hook 'isearch-mode-hook 'sly-mrepl--setup-comint-isearch t t)
(add-hook 'isearch-mode-end-hook 'sly-mrepl--teardown-comint-isearch t t)
;; Add a post-command-handler
;;
(add-hook 'post-command-hook 'sly-mrepl--highlight-backreferences-maybe t t))
(advice-add 'sly-mrepl--read-input-ring :before 'ambrevar/sly-fix-history-ignore)
(provide 'patch-sly-history)