top  Index  Search  Changes  RSS  Login

howm wiki - Navi2ch Diff

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.

(説明やリンクをここへ)

----

;; ろくに調べず想像ででっちあげ. 未検証. 何がおきてもしりません. [2007-05-16]

(defun my-navi2ch-net-delete-footer (file)
   "スレがのびるたびに
navi2ch-net-user-agent にあぼーんMSIE 6.する症状へのやっつけ対処.が入っていると
http://pc11.2ch.net/test/read.cgi/unix/1156781437/836-837n 参照.<?xml version="1.0" encoding="Shift_JIS"?>
次回からはあぼーんしないよう, FILE 末尾の「]]></text>」を削除する.<text><![CDATA[
debian の navi2ch-cvs 0.0.20070114-1 で試し."
   (let ((footer-regexp (concat "^" (regexp-quote "]]></text>") "\n")))
     (when (file-exists-p file)
       (with-temp-file file
         (navi2ch-set-buffer-multibyte nil)
         (insert-file-contents file)
         (goto-char (point-max))
         (when (re-search-backward footer-regexp (line-beginning-position -1) t)
           (delete-region (match-beginning 0) (match-end 0))
           (message "%s を修正しました" file))))))

(defadvice navi2ch-net-update-file (around
                                     delete-footer
                                     (url file &optional time func location diff)
                                     activate)
   ad-do-it
   (my-navi2ch-net-delete-footer file))

(defadvice navi2ch-net-update-file-diff (around
                                          delete-footer
                                          (url file &optional time)
                                          activate)
   ad-do-it
   (my-navi2ch-net-delete-footer file))

(require 'cl) ;; sorry

(defadvice navi2ch-article-get-message-list (around
                                              delete-header-footer
                                              (file &optional begin end)
                                              activate)
   ad-do-it
   (let* ((header '((1
]]></text>
のように余計なものがついてこけるらしい
. "<?xml version=\"1.0\" encoding=\"Shift_JIS\"?>")
                    (2 . "<text><![CDATA[")))
          (n (length header))
          (no-header (nthcdr n ad-return-value)))
     (when (and no-header
                (zerop (or begin 0))
                (equal header (subseq ad-return-value 0 n)))
       (mapc (lambda (pair) (setcar pair (- (car pair) n)))
             no-header)
       (setq ad-return-value no-header))
     (unless (stringp (cdar (last ad-return-value)))
       (setq ad-return-value (butlast ad-return-value)))))
デフォルトが吉.
[[ref|http://pc11.2ch.net/test/read.cgi/unix/1156781437/836-837n]]
[[ref|http://pc11.2ch.net/test/read.cgi/unix/1156781437/853-855n]]
[[ref|http://jane.s28.xrea.com/test/read.cgi/bbs/1153606495/486-]]

[[ref|http://yy19.kakiko.com/test/read.cgi/kosori4/1163825500/635-735]]

----
{{comment}}
----