[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Menuの見直し?
- From: Tsuyoshi CHO <mfalcon21@xxxxxxxxxxx>
- Date: Sat, 24 Jul 2004 00:42:40 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 07009
emacs-w3m developerのみなさま。
どうも、長です。
non-toolbarでネットサーフィン(死語)しようとしたのですが、
Menuがちょっと(w使いづらかったのでパッチを作成してみました。
キモは
* easymenuを利用するようにして、階層化・セパレータを導入した
# サポートするEmacenの範囲が同じWanderlustでも使用していたので、多分依存は問題無いと思うのですが...
* [Cancel Process]が常にOnがちょっと嫌だったので、w3m-current-processを見るようにした
* Prev/Next Sessionへの移動、Session Closeを追加した
* その他、メニュー項目を内部からの視点で整理されていたのを、外部からの視点で整理した(つもり)
です。
ただ、
* easymenuのrequireをどこですべきかわからないので、直前でrequireしている
->最適な位置へ変更していただきたいです。m(_ _)m
* Sessionが一つかどうかを (safe-length (w3m-list-buffers))でチェックしている
->古いEmacsenでsafe-lengthってOKでしょうか?
* メニューの修正が変かも(^^;
と心配がありますが...
# 動作確認がUser-Agentな環境でしか行えなかったというのもあります(-.-;
少しでも交ぜていただければ幸いです。
# 依存があるようなら、次期emacs-w3mでサポート範囲を見直しの時にでも...
以上です。
P.S.
"ついでに日本語メニューだー!!"とか考えて、 Tool barを参照したのですが、
(defconst w3m-toolbar
(if (equal "Japanese" w3m-language)
(let ((a (decode-coding-string "\e$B%\"\e(B" 'iso-2022-jp)));;ア
...この (let ((a …の必要性ってどういったものなのでしょうか?
ちょっと分らなすぎて手がだせませんでした(w
--
Tsuyoshi CHO <mfalcon21@hotmail.com>
・( (記号) [かっこ] [しょうかっこ] [まるかっこ] [ぱーれん]
これは特に問題はない。 (参照: ")", "<", ">", "[", "]", "{", "}")
2004-07-24 Tsuyoshi CHO <mfalcon21@hotmail.com>
* w3m.el: menu-modify
(w3m-menubar) append separator,hierarchy,session move(prev/next),session close, sort useful
(w3m-setup-menu) custom menu setup sequence replace by easymenu macro
--- /tools/Meadow2/backup_lisp/w3m/w3m.el 2004-06-30 00:05:28.001000000 +0900
+++ /tools/Meadow2/site-lisp/w3m/w3m.el 2004-07-23 23:42:23.983768000 +0900
@@ -2028,46 +2028,65 @@
[w3m-toolbar-db-history-icon w3m-db-history t "View Arrived URLs"]))
"Toolbar definition for emacs-w3m.")
+;; "View" is page viewing
+;; "Show" is link list showing
(defconst w3m-menubar
- '("W3M"
- ["Go to Home Page" w3m-gohome w3m-home-page]
+ '("w3m"
+ ("Session"
+ ["Create New Session..." w3m-goto-url-new-session t] ; "Go to... in the New Session"
+ ["Copy This Session" w3m-copy-buffer t] ; "Make a Copy of This Session"
+ "----" ;; separator
+ ["Move Previous Session" w3m-previous-buffer
+ (> (safe-length (w3m-list-buffers)) 1)]
+ ["Move Next Session" w3m-next-buffer
+ (> (safe-length (w3m-list-buffers)) 1)]
+ "----" ;; separator
+ ["Close This Session" w3m-delete-buffer
+ (> (safe-length (w3m-list-buffers)) 1)]
+ ) ;; end session
+ ["Download This URL" w3m-download-this-url t]
+ ["Download to..." w3m-download t]
+ "----" ;; separator
["Back to Previous Page" w3m-view-previous-page
(w3m-history-previous-link-available-p)]
["Forward to Next Page" w3m-view-next-page
(w3m-history-next-link-available-p)]
- ["View the parent page" w3m-view-parent-page
+ ["Up to Parent Page" w3m-view-parent-page
(w3m-parent-page-available-p)]
- ;;
+ ["Cancel Process" w3m-process-stop w3m-current-process]
["Reload This Page" w3m-reload-this-page w3m-current-url]
- ["Cancel Process" w3m-process-stop t]
- ["Toggle Images" w3m-toggle-inline-images (w3m-display-graphic-p)]
- ;;
- ["Redisplay This Page" w3m-redisplay-this-page w3m-current-url]
- ["Redisplay This Page with Charset"
- w3m-redisplay-with-charset w3m-current-url]
- ["Redisplay This Page with Content-type"
- w3m-redisplay-with-content-type w3m-current-url]
- ["Reset Charset and Content-type" w3m-redisplay-and-reset w3m-current-url]
- ;;
+ ("Redisplay"
+ ["Toggle Images" w3m-toggle-inline-images (w3m-display-graphic-p)]
+ "----" ;; separator
+ ["Redisplay This Page" w3m-redisplay-this-page w3m-current-url]
+ ["Redisplay This Page with Charset"
+ w3m-redisplay-with-charset w3m-current-url]
+ ["Redisplay This Page with Content-type"
+ w3m-redisplay-with-content-type w3m-current-url]
+ ["Reset Charset and Content-type" w3m-redisplay-and-reset w3m-current-url]
+ ) ;; end redisplay
+ ["Search the Internet..." w3m-search t]
+ ["Go to Home Page" w3m-gohome w3m-home-page]
["Go to..." w3m-goto-url t]
- ["Go to... in the New Session" w3m-goto-url-new-session t]
- ["Make a Copy of This Session" w3m-copy-buffer t]
- ;;
+ "----" ;; separator
["View Bookmark" w3m-bookmark-view t]
- ["Search the Internet" w3m-search t]
+ ("History"
+ ["Show a Visited URLs Tree" w3m-history t]
+ ["Show an Arrived URLs List" w3m-db-history t]
+ )
["Weather Forecast" w3m-weather t]
["Investigate with Antenna" w3m-antenna t]
- ;;
- ["View Source" w3m-view-source t]
- ["View Header" w3m-view-header t]
- ["Show a History" w3m-history t]
- ["View Arrived URLs" w3m-db-history t]
- ;;
- ["Download This URL" w3m-download-this-url t]
- ["Print the Current URL" w3m-print-current-url t]
- ;;
+ ("Resource"
+ ["View Source" w3m-view-source t]
+ ["View Header" w3m-view-header t]
+ ) ;; end resource
+ "----" ;; separator
["Send a Bug Report" report-emacs-w3m-bug t]
- )
+ "----" ;; separator
+ ["Print the Current URL" w3m-print-current-url t]
+ ["Close w3m" w3m-close-window t]
+ ["Quit w3m" w3m-quit t]
+ );; end w3m
"Menubar definition for emacs-w3m.")
(defvar w3m-cid-retrieve-function-alist nil)
@@ -2936,16 +2955,12 @@
(set (make-local-variable 'menu-bar-final-items)
(delq 'w3m items))))
(unless (keymapp (lookup-key w3m-mode-map [menu-bar w3m]))
- (let ((map (make-sparse-keymap (car w3m-menubar))))
- (define-key w3m-mode-map [menu-bar] (make-sparse-keymap))
- (when w3m-use-tab-menubar (w3m-setup-tab-menu))
- (define-key w3m-mode-map [menu-bar w3m] (cons (car w3m-menubar) map))
- (dolist (def (reverse (cdr w3m-menubar)))
- (define-key map (vector (aref def 1)) (cons (aref def 0)
- (aref def 1)))
- (put (aref def 1) 'menu-enable (aref def 2)))
- ;;(define-key map [separator-eval] '("--"))
- )))))
+ (require 'easymenu)
+ (easy-menu-define
+ w3m-mode-menu w3m-mode-map
+ "w3m menu item" w3m-menubar)
+ (easy-menu-add w3m-mode-menu)
+ ))))
(defun w3m-fontify-images ()
"Fontify img_alt strings of images in the buffer containing halfdump."