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'.  (Bug#67395)

Copyright-paperwork-exempt: yes
This commit is contained in:
George Kuzler 2023-11-22 19:45:55 -05:00 committed by Eli Zaretskii
parent 662d54775d
commit f7dc020212

View file

@ -2477,7 +2477,7 @@ the United States."
(defun calcDigit-backspace ()
(interactive)
(cond ((eq last-command 'calcDigit-start)
(erase-buffer))
(delete-minibuffer-contents))
(t (backward-delete-char 1)))
(if (= (calc-minibuffer-size) 0)
(progn