logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: identifying readonly lines; filtering inserted text: msg#00025

Subject: Re: identifying readonly lines; filtering inserted text
Marvin Lyndon <marvin.lyndon@xxxxxxxxxxx> wrote:
>readonly by calling set_line_readonly(1); is there a way to detect attempts 
>to modify a line which is marked as readonly? My goal is to run a slang 
>function each time the user tries to modify a readonly line.
>I have noticed that a Runtime Error exception is emitted when I try to do 
>so; but is there a way for me to install a handler/"catch" statement for 
>those exceptions? Even if I succeed in doing so, how do I know that the

Not currently.  What you are asking for is something similar to the
"bob_eob_error_hook", which is called on "beginning/end of buffer"
errors (See the documentation for "set_buffer_hook").

>Runtime Error exception was generated by an attempt to write to a readonly 
>line? (No function equivalent to is_line_hidden() seems to exist...) I 
>thought it would be trivial to use update_hook for this, but it only calls 
>functions *after* the text insertion attempt has happened and so doesn't 
>give me a chance to detect it.

Currently, if an attempt is made to modify a read-only line, the
editor will issues a message indicating that the line is read-only.
What would your hook do?

Thanks,
--John




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>