checklink and emacs compile-mode

The following message is a courtesy copy of an article
that has been posted to comp.infosystems.www.authoring.html,gnu.emacs.help as well.

Wouldn't it be neat if checklink (http://www.w3.org/2000/07/checklink)
could be used with GNU Emacs' compile-mode?  Well, I sure hope one day
they take my advice (like the validator fellow did), and add emacs
compile-mode compatible line number output... I did a simple filter,
but it would be best if they did it right in the source, instead of us
playing catch-up with the output.

The idea is to make output like:

http://www.egroups.com/group/BoundaryPoint
-> http://groups.yahoo.com/group/BoundaryPoint	Lines: 528, 565
  Code: 302 -> 200 OK
To do: Usually nothing.

become:

1994us_can_border.htm:528:-> http://groups.yahoo.com/group/BoundaryPoint	Lines: 528, 565
1994us_can_border.htm:565:-> http://groups.yahoo.com/group/BoundaryPoint	Lines: 528, 565
http://www.egroups.com/group/BoundaryPoint
-> http://groups.yahoo.com/group/BoundaryPoint	Lines: 528, 565
  Code: 302 -> 200 OK
To do: Usually nothing.

Or something similar. Here are some lines from a Makefile:

/tmp/checklink_live_all:
	(unset ftp_proxy http_proxy;\
	checklink --masquerade . http://www.geocities.com/jidanni/ \
	`ls *.htm*|fgrep -v _en.htm`|\
	tee $@)
	cp $@ $@.backup$$$$
checklink_emacs: /tmp/checklink_live_all
	awk '{this=$$0};\
	 /^Processing/{file=$$0;sub(".*file://localhost/home/jidanni/geocities/","",file)};\
	 /Lines: /{remark=$$0;sub("\tLines: [0-9]+$$","",remark);line_no=$$NF;\
	 print file ":" line_no ":" remark;\
	if ($$0 ~/,/){print "$@ boob message: ******** oh no, there are more than one *********"};\
	if(last==""){last=this;next}};\
	 {print last;last=this};\
	 END{print last}' $?
#also if there are many -> -> ->, then we aren't perfect either

Anyway, see how much of a fuss it is?  and we are only halfway there
if we intend to do a complete job.

There's now
$ validate --emacs
why not also make a
$ checklink --emacs ?

P.S. An artistic nicety about the URL
http://www.w3.org/2000/07/checklink: I think it is bad because it
seems to have a date hardwired into it.  They replied that yes, but
they are committed that it is to be one of Berners-Lee's "Cool URLs
don't go away" ... well, that's nice, but I still say it _looks_ bad,
and may fool users into thinking that there is an "old place to click,
never mind".
-- 
http://www.geocities.com/jidanni/ Tel+886-4-25854780

Received on Tuesday, 13 November 2001 12:36:38 UTC