From: George Kuzler Date: Wed, 22 Nov 2023 19:45:55 -0500 Subject: Fix "Text is read-only" on backspacing initial calc input Immediately after calc-mode opens the minibuffer for input (because you typed a digit, "e", etc), pressing backspace should clear the minibuffer and return you to the *Calculator* buffer. Instead, it leaves the minibuffer as-is and prints the message "Text is read-only"; this is because the function used, `erase-buffer', tries to erase the read-only minibuffer prompt. Using `delete-minibuffer-contents' fixes this, since it doesn't attempt to delete the prompt. * lisp/calc/calc.el (calcDigit-backspace): Use `delete-minibuffer-contents' instead of `erase-buffer'. --- lisp/calc/calc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index b347cc1da23..41aeb17c252 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -2491,7 +2491,7 @@ the United States." (defun calcDigit-backspace () (interactive) (cond ((eq last-command 'calcDigit-start) - (erase-buffer)) + (delete-minibuffer-contents)) (t (with-suppressed-warnings ((interactive-only backward-delete-char)) (backward-delete-char 1)))) (if (= (calc-minibuffer-size) 0) -- 2.42.0