bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: helpful messages whensoever one hits a wrong key


From: Johan Bockgård
Subject: Re: helpful messages whensoever one hits a wrong key
Date: Wed, 14 Jun 2006 01:43:18 +0200
User-agent: Gnus/5.110005 (No Gnus v0.5) Emacs/22.0.50 (gnu/linux)

Miles Bader <miles@gnu.org> writes:

> I dunno, maybe showing a huge help message immediately would suck,
> but the general idea of having a buffer/region-specific alternative
> error message for trying to modify read-only text would be a good
> thing

You can have a region-somewhat-specific error message by using a
string-valued `read-only' text property (in Emacs 22):

    (insert (propertize "xxx" 'read-only "Bork Bork Bork!"))

    An attempt to modify the text displays

        Text is read-only: "Bork Bork Bork!"


This feature seems to be undocumented.

-- 
Johan Bockgård





reply via email to

[Prev in Thread] Current Thread [Next in Thread]