Re: example of how I created 'emacs compatible' validator error line numbers

>>>>> "Liam" == Liam Quinn <liam@htmlhelp.com> writes:

Liam> Hi Dan,
Liam> Attached is a version of "validate" that includes a "--emacs" command-line
Liam> option.  Please let me know if this does what you want, and feel free to
Liam> suggest any changes.

Liam> Is "--emacs" a good name for the option, or would "--gnu-emacs" be better?

OK, emacs is right.  Back in Bell Labs we had to differentiate, but I
not anymore, eh.

One thing you gotta do or else it will drive the emacs people nuts, is
to give an option perhaps on by default when one chooses --emacs, that
will not just mention the first of a certain error type, but will list
them all, e.g., tidy gets all these, so we can correct them in one
edit session:

tidy -emacs tmp_to_the_editor.htm
unrecognized option -a use -help to list options
unrecognized option -s use -help to list options

[Ragget should quit out on an error like this, as -m is "modify
original files" etc.... anyways I had 'emacs: yes' in the config file, I
was just trying to make it more obvious for this e-mail, but didn't
check the invocation method.]

Tidy (vers 4th August 2000) Parsing "tmp_to_the_editor.htm"
tmp_to_the_editor.htm:21:1: Warning: <table> lacks "summary" attribute
tmp_to_the_editor.htm:29:1: Warning: <table> lacks "summary" attribute
tmp_to_the_editor.htm:49:1: Warning: <table> lacks "summary" attribute
tmp_to_the_editor.htm:271:1: Warning: <table> lacks "summary" attribute

tmp_to_the_editor.htm: Document content looks like HTML 3.2
4 warnings/errors were found!

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
  <META
   name="generator"
   content="HTML Tidy, see www.w3.org">
  <META
   http-equiv="Content-Type"
   content="text/html; charset=big5">

Liam, don't you think it is odd, my document is jam packed with
Chinese chars, and tidy chooses 3.2!  Mr. Ragget doesn't respond to
email.

Anyway, for your program,
*** Errors validating tmp_to_the_editor.htm: ***
tmp_to_the_editor.htm:1:1: missing document type declaration; assuming HTML 4.01 Transitional
Don't you want to add a line "...1:1:Bailing out" or "cannot proceed
with no doctype"?

OK, fixed that, now
validate --emacs tmp_to_the_editor.htm
*** Errors validating tmp_to_the_editor.htm: ***
tmp_to_the_editor.htm:26:15: there is no attribute "WIDTH" for this element (in this HTML version)

but one would go to that line and fix it, thinking all is well, but
one must rerun validate several times for it to find all of
them... imagine if it took several trips to city hall to get several
problems straightened out, because the official was only willing to
divulge one problem per visit.

True one could search in the document for further instances of the
problem, but that search would probably find plenty of OK items too
and miss some errors due to the search string having different
spacing, etc.  So, add a switch to show all instances of each error...
-- 
http://www.geocities.com/jidanni Tel886-4-25854780 ¿n¤¦¥§

Received on Thursday, 26 April 2001 05:16:09 UTC