[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: patch for sb-ibm-dev.el



山下 純司です。

すみません。
[emacs-w3m:02425] のパッチでは古いページを読むのに不具合がありました。

今回のパッチの方がやりたいことをより厳密にやっています。

--- sb-ibm-dev.el.orig  Thu Dec 13 20:46:55 2001
+++ sb-ibm-dev.el       Fri Dec 14 16:31:00 2001
@@ -143,10 +143,17 @@
                                     (match-string 1) (match-string 2))))))
        (delete-region beg end))
       (goto-char (point-min))
-      (if (re-search-forward "<!--[  ]*Contents[  ]*-->" nil t nil)
-         (delete-region (progn (beginning-of-line) (point))
-                        (progn (re-search-forward "</table>" nil t nil))))
-      (if (re-search-forward "<!--[  ]*End of Contents[  ]*-->" nil t nil)
+      ;; Remove sidebar if exist
+      (if (and (re-search-forward "<!--[  ]*Contents[  ]*-->" nil t nil)
+              (re-search-forward "<!--[  ]*Sidebar Gutter[  ]*-->" nil t nil))
+         (let ((sidebar-start (re-search-backward "<table")))
+           (if (re-search-forward "<!--[  ]*Start TOC[  ]*-->" nil t nil)
+               (delete-region (point)
+                              (re-search-forward "</table>" nil t nil)))
+           (delete-region sidebar-start
+                          (re-search-forward "</table>" nil t nil))))
+
+      (if (re-search-forward "<!--[  ]*\\(End of Contents\\|END PAPER BODY\\)[  ]*-->" nil t nil)
          (progn
            (beginning-of-line)
            (delete-region (point) (point-max)))


-- 
山下 純司	mailto:ysjj@unixuser.org