- Subject: identifying readonly lines; filtering inserted text
 
- From: "Marvin Lyndon" <marvin.lyndon@xxxxxxxxxxx>
 
- Date: Thu, 17 Nov 2005 21:19:18 -0500
 
Dear fellow jed users,
I'm giving my first steps in slang/jed scripting, and would appreciate some 
help.
I am trying to provide for some basic "filtering"/"validation" when the user 
is updating some lines in a structured file. I know how to make a line 
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 
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.
Any guidance would be great.
Thanks so much
Marvin
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
  [2005 date index]
  [2005 thread index]
  
  [Thread Prev] [Thread Next]
      
  [Date Prev] [Date Next]