From: Sean O'Rourke Date: Wed, 28 Nov 2012 00:26:23 +0000 (-0800) Subject: Fix obnoxious "the X::Y manpage" links. X-Git-Url: https://repo.or.cz/w/sepia.git/commitdiff_plain/9966ce3af97664e6cbaf904d926b4566595526c4 Fix obnoxious "the X::Y manpage" links. --- diff --git a/sepia-w3m.el b/sepia-w3m.el index 25bd6a3..a66a83e 100644 --- a/sepia-w3m.el +++ b/sepia-w3m.el @@ -58,6 +58,9 @@ (while (re-search-forward "" nil t) (delete-region (match-beginning 3) (match-end 3)) + (save-match-data + (when (looking-at "the \\(\\S-+\\) manpage") + (replace-match (match-string 1)))) (save-restriction (narrow-to-region (match-beginning 2) (match-end 2)) (while (search-backward "/" nil t) @@ -69,6 +72,17 @@ (message "POD errors in %s" buf) (display-buffer (current-buffer)))))) +(defadvice w3m-about-perldoc (after fix-the-manpage) + "Handle about://perldoc-buffer/ links." + (when (string-match "\\`about://perldoc/" url) + (goto-char (point-min)) + (while (re-search-forward + "" nil t) + (save-match-data + (when (looking-at "the \\(\\S-+\\) manpage") + (replace-match (match-string 1))))) + "text/html")) + ;;;###autoload (defun sepia-w3m-view-pod (&optional buffer) (require 'w3m)