Last active
March 6, 2016 00:32
-
-
Save johnmastro/c8bf5013b4e47cdd3ea0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This is just an example related to the discussion in this Emacs.SE question: | |
;; https://emacs.stackexchange.com/questions/20732/how-do-i-enable-indentation-in-an-inferior-scheme/ | |
(defun newline-indent-comint-send-input () | |
(interactive) | |
(newline-and-indent) | |
(comint-send-input)) | |
(with-eval-after-load 'cmuscheme | |
(define-key inferior-scheme-mode-map (kbd "RET") #'newline-indent-comint-send-input)) | |
;; This (below) appears to work (after, admittedly, very limited testing) but | |
;; I'm worried it may be fragile. Hopefully some further input will come via the | |
;; Emacs help mailing list. | |
;; | |
;; I asked about the topic here: https://lists.gnu.org/archive/html/help-gnu-emacs/2016-03/msg00075.html | |
(defun newline-indent-comint-send-input () | |
(interactive) | |
(comint-send-input) | |
(unless (save-excursion (forward-char -1) | |
(eq (field-at-pos (point)) 'output)) | |
(indent-for-tab-command))) | |
(with-eval-after-load 'cmuscheme | |
(define-key inferior-scheme-mode-map (kbd "RET") #'newline-indent-comint-send-input)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment