I have the following code in my init.el
, in which a key stroke (C-c y
) is defined a sequence of two other key strokes (C-c C-y
C-x C-e
). The first one moves up the cursor to the ending parenthesis of the enclosing list; the second key stroke evaluate the S-expression at that location:
(defun paredit-move-to-end-of-top-level ()
(interactive)
(back-to-indentation)
(forward-char 2)
(condition-case nil
(paredit-forward-up 1000)
(error nil))
)
(global-set-key (kbd "C-x C-y") 'paredit-move-to-end-of-top-level)
(defalias 'eval-next-sexp
(kbd "C-x C-y C-x C-e")
)
(global-set-key (kbd "C-x y") 'eval-next-sexp)
However, the second keystroke in the sequence does not seem to print output to the echo area as it should be. If I hit the combined keystroke C-x y
in the following expression (where | indicate cursor):
(+ 1| 2)
nothing is printed in the echo area. But if I do C-x C-y
C-x C-e
separately, it prints
=> 3
in the echo area, as expected.
How can I fix the key binging configuration so that the last key stroke (C-x C-e
) prints its output to echo line as it usually does?
(This is with Emacs 28, scheme/geiser mode)