[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:
要望:リンクを新しいバ
ッファで開く機能
XEmacs で gutter の buffer tab にタイトルを表示するようにしてみ
ました。まだ CVS commit していませんが、たぶん今日中に実施します。
(setq w3m-pop-up-windows nil
w3m-pop-up-frames nil)
の条件で以下を使うと、なかなかカッチョいいです。
(defadvice format-buffers-tab-line
(around w3m-xmas-show-current-title-in-buffer-tab (buffer) activate)
"Advised by Emacs-W3M.
Show the current title string in the buffer tab. Unfortunately,
existing XEmacs does not support showing non-ascii characters. When a
title contains non-ascii characters, show a url name by default."
(with-current-buffer buffer
(if (eq 'w3m-mode major-mode)
(let ((len (specifier-instance buffers-tab-default-buffer-line-length))
(name (if (string-match "^[ -~]+$" w3m-current-title)
w3m-current-title
(if (string-match "^[^/:]+:/+" w3m-current-url)
(substring w3m-current-url (match-end 0))
w3m-current-url))))
(setq ad-return-value
(if (and (> len 0)
(> (length name) len))
(concat (substring name 0 (- len 3)) "...")
name)))
ad-do-it)))
(add-hook 'w3m-display-hook
(lambda (&rest args)
(update-tab-in-gutter (selected-frame))))
--
Katsumi Yamaoka <yamaoka@namazu.org>