emacs-evil / emacs-evil/evil

cc errors on first line of string-edit buffer: text-read-only

Open
#2,005 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
3.9k
Forks
307
PR merge metrics
No merged PRs in 30d

Description

From `emacs -Q -L -l evil -l string-edit`:

```
(read-string-from-buffer "prompt:" "")
```

Pressing `cc` on the input text entered (whether it is empty or not), when there is no line following it, signals the following error:

```
Text is read-only
```

With `debug-ignored-errors` set to nil and `debug-on-error` turned on, here is the backtrace:

```
Debugger entered--Lisp error: (text-read-only)
evil-delete(10 31 line nil nil)
evil-change(10 31 line nil nil)
funcall-interactively(evil-change 10 31 line nil nil)
command-execute(evil-change)
read-string-from-buffer("prompt:" "")
(progn (read-string-from-buffer "prompt:" ""))
eval((progn (read-string-from-buffer "prompt:" "")) t)
elisp--eval-last-sexp(nil)
#f(compiled-function () #)()
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
command-execute(eval-last-sexp)
```

Without inputting any text, the backtrace instead says that the `beg` and `end` arguments are both 10. It seems unintuitive that evil-mode would attempt to delete the trailing newline in the prompt, which is marked read-only. `cc` works out of the box in analogous buffers like `eshell` due to avoiding crossing fields, but marking that text with the `field` text property also doesn't work in this particular case.

## additional info

```
M-x emacs-version
GNU Emacs 30.1.90 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2026-02-26
```

```
evil version 20250318.1816 from MELPA
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.