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

Re: .w3m/.sessions too damn big



>>>>> In [emacs-w3m : No.10738] 青田さん wrote:
> .w3m/.sessions が大きくなりすぎてそのため Emacs の動きが遅くなってしまう、
> という話。 クラッシュ復元機能のためにページを開くごとにセッションを保存
> していることと、 w3m-history-flat も保存していることがこの巨大化の原因だ
> と思います。

> そこで w3m-history-slimed-history-flat() という関数を追加して slim した
> history-flat を保存するようにしようと思うのですがいかがでしょうか?

よろしいのではないでしょうか。

(defun w3m-history-slimed-history-flat (history-flat)
  "Slim the given history HISTORY-FLAT."

;; slimed -> slimmed

> w3m-history-slimed-history-flat() は、 emacs-w3m の履歴ツリーを他のブラウ
> ザの履歴のように "Next" と "Prev" だけでたどれるページのみのツリーにして
> しまうものです。

えーと、Next と Prev でアクセスできるすべてのページを網羅してい
ないような気が。実験方法:

M-x w3m-history-add-arrived-db RET yes RET

で、でたらめな history を作ってから M-x w3m-history-slim RET。
もう少し追ってみますね。さらに +5 -5 くらいの範囲に絞ってしまっ
ても良いかもしれません。

それから、上記のような実験をする場合に、次のようにしておくと便利
です。

(defun w3m-history-slim ()
  "Slim the history.
This makes the history slim so that it may have only the pages that
are accessible by PREV and NEXT operations."
  (interactive)
  (let ((position (caddar w3m-history-flat)))
    (setq w3m-history-flat (w3m-history-slimed-history-flat w3m-history-flat))
    (prog1
	(w3m-history-tree position)
      (when (and (interactive-p)
		 (equal w3m-current-url "about://history/"))
	(w3m-reload-this-page)))))
-- 
山岡