Comments on tidy.el

The location of the tidy source code has changed. Patch:

@@ -33,7 +34,7 @@
 ;; utility that can fix common errors in your mark-up and clean up
 ;; sloppy editing automatically. See
-;;       <>
+;;       <>
 ;; for more details.  This package provides the following functions:

Newer versions of tidy report the number of warnings and errors differently. Therefore the parsing in tidy.el doesn’t work anymore. The following patch allows for both the old and the new versions.

@@ -1893,10 +1893,15 @@ generated by that program are sent to \"*tidy-errors*\" buffer."
       (set-buffer error-buffer)
       (goto-char (point-min))
-      (when (re-search-forward (concat
+      (when (or
+			 (re-search-forward (concat
 				"\\([0-9]+\\) warnings?, "
 				"\\([0-9]+\\) errors? were found!")
 			       nil t)
+				(re-search-forward (concat
+				"Tidy found \\([0-9]+\\) warnings? and "
+				"\\([0-9]+\\) errors?!")
+			       nil t))
 	(setq warnings (string-to-number (match-string 1)))
 	(setq errors (string-to-number (match-string 2)))
 	(setq tidy-message (match-string 0)))

And I also suggest a message when there are no errors/warnings:

@@ -1861,7 +1861,7 @@ generated by that program are sent to \"*tidy-errors*\" buffer."
 	 (errors 0)
 	 (warnings 0)
-	 (tidy-message "")
+	 (tidy-message "Tidy found no errors")
 	 (seg-error nil))
     (if (> start end) (setq end (mark) start (point))) ;; rare case swap

pietvo 2020-01-07 17:36 UTC

Please make sure you contribute only your own work. IP numbers are made available via the page history. If you want to keep it a secret, you need to use Tor. See TextFormattingRules for how to format text. See StyleGuide for the suggested writing style on this wiki.

To save this page you must answer this question:

What is the greatest editor out there?