emacs-devel
[Top][All Lists]
Advanced

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

Re: with-output-to-temp-buffer [Re: reverting CJK input methods]


From: Kenichi Handa
Subject: Re: with-output-to-temp-buffer [Re: reverting CJK input methods]
Date: Thu, 6 May 2004 22:10:08 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Richard Stallman <address@hidden> writes:

>     fails because the function temp_output_buffer_setup calls
>     Ferase_buffer and it signals the error "Text is read-only".

>     Should we bind inhibit-read-only to t while calling
>     Ferase_buffer,

> That is the right fix.

>                  or modify Ferase_buffer itself so that it
>     doesn't signal the above error?

> This would be incorrect.

> As a general principle: don't make a general facility less natural or
> harder to describe, in order to solve a problem that occurs with a
> specific use of that facility.  Instead, fix the specific use.
> Only change the general facility if there's a reason to think
> it would be better, as a general facility, with the change.

I fully agree with that general principle.  But, for the
current case, I'm not sure it is the right thing that
erase-buffer signals such an error considering that it
removes even the narrowing restriction.

I grepped Ferase_buffer in src/*.c and found that this also
causes the similar problem.

(put-text-property 1 10 'help-echo (propertize "test tip" 'read-only t))

Once we add read-only text as a tool-tip (of course it's
nonsense to do such a thing), no more tooltip pops up
because the " *tip" buffer can't be erased by Ferase_buffer.

Another case is display-message-or-buffer.

If we eval this once,

(display-message-or-buffer (propertize "abc\n\n" 'read-only t))

the further try causes "Text is read-only" error.

I fear there's many other codes that pay attention to
buffer-read-only but not to read-only text-property.  In
almost all cases, I think what they want is to erase a
buffer completely including read-only text.

---
Ken'ichi HANDA
address@hidden




reply via email to

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