3

Is there a way to get completion-at-point to work inside edebug-eval-expression (i.e. similarly to the way it works in eval-expression)? Presently, when I press tab inside of a call to edebug-eval-expression, there are no completion candidates despite tab being bound to completion-at-point.

This behavior occurs even in vanilla Emacs 25.3.1 without any configuration. Does anyone know of a workaround?

Tobias
  • 32,569
  • 1
  • 34
  • 75
Qudit
  • 828
  • 8
  • 16

1 Answers1

3

The reason for that behavior is simply that different interactive forms are used in edebug-eval-expression and eval-expression. You can just override the interactive form of edebug-eval-expression with a part of the interactive form of eval-expression. (Direct replacement of the interactive form does not work since that two functions differ in the number of arguments.)

(defun lispTZA-edebug-eval-expression-completion (expr)
  "Replace interactive-spec of `edebug-eval-expression'
with `read--expression' from `eval-expression' to get completion working."
  (interactive (list (read--expression "Eval: "))))

(advice-add 'edebug-eval-expression :before #'lispTZA-edebug-eval-expression-completion)
Tobias
  • 32,569
  • 1
  • 34
  • 75