tags 26891 patch quit John Mastro writes: > Using lisp-indent-line in an eval-expression minibuffer (i.e. M-:) works > in Emacs 25 but causes a "Text is read-only" error in Emacs 26. > > To reproduce: > 1. Run emacs -Q > 2. Evaluate the code below > 3. Type M-: > 4. Hit TAB > > Here's the code: > > (defun init-eval-expression-minibuffer () > (setq-local indent-line-function #'lisp-indent-line) > (local-set-key (kbd "TAB") #'indent-for-tab-command)) > > (add-hook 'eval-expression-minibuffer-setup-hook > #'init-eval-expression-minibuffer) > > Point will move to the very beginning of the minibuffer (on the "E" in > "Eval") and you'll see a "Text is read only" message. (I called it an > error above but it doesn't actually invoke the debugger even with > debug-on-error and debug-on-signal non-nil). > > It doesn't matter whether you have entered text or not before hitting > TAB. indent-line-to doesn't respect field boundaries (i.e., moves into the "Eval: " prompt text) because it uses backward-to-indentation. This patch to change it to back-to-indentation seems to fix it. I'm not sure why back-to-indentation and backward-to-indentation are inconsistent...