0

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)

tinlyx
  • 1,276
  • 1
  • 12
  • 27
  • It prints it here, also when starting with `emacs -Q`. Have you tried to reproduce this starting from `emacs -Q`? When using `emacs -Q`, to install paredit, you have to [install Melpa first](https://melpa.org/#/getting-started) (i.e. copy and evaluate the lines in the first code block). – dalanicolai Sep 18 '22 at 09:00

0 Answers0