From 9966ce3af97664e6cbaf904d926b4566595526c4 Mon Sep 17 00:00:00 2001 From: Sean O'Rourke Date: Tue, 27 Nov 2012 16:26:23 -0800 Subject: [PATCH] Fix obnoxious "the X::Y manpage" links. --- sepia-w3m.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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) -- 2.11.4.GIT