Hi everyone,

While using Column View I noticed that pressing any key not bound in
`org-columns-map' produces a confusing error message in the echo area:

  Text is read-only: #("Type 'e' to edit property" 6 7
  (font-lock-face help-key-binding face help-key-binding))

The cause is that `substitute-command-keys' propertizes the
keybinding with the help-key-binding face, and the resulting
string is stored verbatim in the overlay's read-only property.
When text-read-only is signaled, the default error handler
displays the propertized string in its raw form.

As a user new to org-columns I initially mistook this for a bug
in the package.  The attached patch wraps the result of
substitute-command-keys in substring-no-properties so the message
renders cleanly:

  Text is read-only: Type 'e' to edit property

The patch is attached as well as inlined below.  I'm not certain this is
the most appropriate fix — please let me know if a different approach
would be preferred.

Best,
-- 
Slawomir Grochowski

>From b57cb99932d4c87333ee660c703b729a8e933747 Mon Sep 17 00:00:00 2001
From: Slawomir Grochowski <[email protected]>
Date: Mon, 11 May 2026 17:15:03 +0200
Subject: [PATCH] org-colview: Strip text properties from read-only hint string
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lisp/org-colview.el (org-columns--mark-line-read-only): Wrap the
result of `substitute-command-keys' in `substring-no-properties'.

When the user presses any key not bound in `org-columns-map' while
in Column View, Emacs signals text-read-only using the string
stored in the overlay's read-only property. The default error
handler displays this string in the echo area, but because
`substitute-command-keys' applies the help-key-binding face to the
keybinding, the message renders as its raw representation:

  Text is read-only: #("Type ‘e’ to edit property" 6 7 (font-lock-face
  help-key-binding face help-key-binding))

rather than the intended hint. This is easily mistaken for a bug
in the package by users new to org-columns. Stripping text
properties with `substring-no-properties' produces a clean message:

  Text is read-only: "Type ‘e’ to edit property"
---
 lisp/org-colview.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index e201e83eb..a19efd8bd 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -481,9 +481,10 @@ line-beginning, keeping the rendered overlay region uneditable."
        'read-only
        (or org-columns--read-only-string
 	   (setq org-columns--read-only-string
-		 (substitute-command-keys
-		  "Type \\<org-columns-map>`\\[org-columns-edit-value]' \
-to edit property")))))))
+		 (substring-no-properties
+		  (substitute-command-keys
+		   "Type \\<org-columns-map>`\\[org-columns-edit-value]' \
+to edit property"))))))))
 
 (defun org-columns--remap-header-line ()
   "Remap the header line to default face if not already done."
-- 
2.39.5

Reply via email to