;;; -*- Mode: Lisp; Package: USER; Last modified: "2007/12/31 01:04:52" -*-
;;;
;;; This file is not part of xyzzy.
;;;
;;;   buf-menu-plus.l --- buffer-menu 偺奼挘斉(丠)
;;;
;;;     by HIE Masahiro <madoinu@ybb.ne.jp>
#|

仭奣梫

  丒僂傿儞僪僂傪暘妱偟側偄偱丆僇儗儞僩僂傿儞僪僂偵儕僗僩傪昞帵
  丒懠僂傿儞僪僂傪奐偄偰僶僢僼傽傪墈棗
  丒儅乕僋峴摍偵怓晅偗
  丒暋悢僶僢僼傽偵傑偲傔偰儅乕僋傪偮偗傞/偼偢偡
  丒僼傽僀儖偺側偄僶僢僼傽曐懚帪偵乽柤慜傪晅偗偰曐懚乿僟僀傾儘僌傪昞帵
  丒廔椆帪偵儅乕僋傪幚峴
  丒diff 偺幚峴
  丒暋悢僼傽僀儖堦妵僶僀僩僐儞僷僀儖
  丒暋悢僼傽僀儖堦妵報嶞
  丒幚峴(shell-execute)
  丒儅僂僗僟僽儖僋儕僢僋懳墳
  丒buffer-menu 婲摦帪偵丆傾僋僥傿僽偩偭偨僶僢僼傽偺峴偵堏摦
  丒婛掕偺僼儗乕儉偵堏摦偟偰婲摦乮梫 bufmenu.l乯


仭僀儞僗僩乕儖

  1. buf-menu-plus.l 傪 site-lisp 偵僐僺乕偡傞丅

  2. 昁梫偵墳偠丆僶僀僩僐儞僷僀儖偡傞丅

       M-x byte-compile-file

  3. .xyzzy 偐 siteinit.l 偵埲壓偺婰弎傪捛壛偡傞丅

      (require "buf-menu-plus")

  4. xyzzy 傪嵞婲摦偟丆愝掕傪斀塮偝偣傞丅
     siteinit.l 偵婰弎偟偨応崌偼嵞僟儞僾傕偡傞丅


仭婲摦曽朄

  丒C-x C-b 偱奼挘斉(丠)buffer-menu傪婲摦偟傑偡丅

  丒C-u 偲擖椡偟偰偐傜忋婰僐儅儞僪傪幚峴偡傞偲丆僼傽僀儖偵娭楢晅偗傜傟偨
    僶僢僼傽偺傒傪昞帵偟傑偡丅M-x buffer-menu-plus-visit 偱傕傛偄偱偡丅


仭僉乕僶僀儞僪

    RET : 僇乕僜儖峴偺僶僢僼傽傪奐偔
    TAB : 僇乕僜儖峴偺僶僢僼傽傪懠偺僂傿儞僪僂偱墈棗
    M-n : 師峴偺僶僢僼傽傪懠偺僂傿儞僪僂偱墈棗乮or M-Down乯
    M-p : 慜峴偺僶僢僼傽傪懠偺僂傿儞僪僂偱墈棗乮or M-Up乯
    0   : 僇乕僜儖峴偺僶僢僼傽傪僇儗儞僩僂傿儞僪僂偱奐偔
    1   : 僇乕僜儖峴偺僶僢僼傽傪奐偔仌懠偺僂傿儞僪僂傪暵偠傞
    b   : 僶僀僩僐儞僷僀儖儅乕僋 "B" 傪偮偗傞
    p   : 報嶞儅乕僋 "P" 傪晅偗傞
    D   : 慡偰偺僶僢僼傽偵嶍彍儅乕僋 "D" 傪偮偗傞
    S   : 枹曐懚僶僢僼傽偵曐懚儅乕僋 "S" 傪偮偗傞
    U   : 慡偰偺儅乕僋傪徚偡
    x   : 儅乕僋傪幚峴
    t   : diff 儅乕僋 "O" 傑偨偼 "N" 傪僩僌儖
    M-f : diff 傪幚峴
    M-s : 僇乕僜儖峴偺僼傽僀儖傪幚峴
    q   : buffer-menu 傪廔椆

  偦偺懠偼丆昗弨偺 buffer-menu (list-buffers) 偲摨偠丅乮偨傇傫乯

    f   : 僇乕僜儖峴偺僶僢僼傽傪奐偔
    s   : 曐懚儅乕僋 "S" 傪晅偗傞
    d   : 嶍彍儅乕僋 "D" 傪晅偗傞
    k   : 嶍彍儅乕僋 "D" 傪晅偗傞
    o   : 僇乕僜儖峴偺僶僢僼傽傪懠偺僂傿儞僪僂偱奐偔
    C-d : 嶍彍儅乕僋 "D" 傪晅偗偰慜偺峴偵堏摦
    C-k : 嶍彍儅乕僋 "D" 傪晅偗傞
    SPC : 師偺峴偵堏摦
    ~   : 曄峏儅乕僋傪徚偡
    u   : 儅乕僋傪徚偡


仭diff

  diff 偺幚峴偵偼丆diff.exe 偑昁梫偲側傝傑偡丅偳偙偐偐傜庤偵擖傟偰偔偩偝偄丅

  buffer-menu 偱斾妑偟偨偄僶僢僼傽偵僇乕僜儖傪崌傢偣丆t 傪墴偟傑偡丅偙偺僉
  乕偵傛傝儅乕僋偑僩僌儖偟傑偡偑丆`O' 偑 old file丆`N' 偑 new file 偲側傝
  傑偡丅儅乕僋傪晅偗偨傜丆M-f 傪擖椡偟丆diff 傪幚峴偟傑偡丅

  diff 幚峴屻偵偼丆懳徾僶僢僼傽偵懳偟 revert-buffer 傪幚峴偟丆diff 偺寢壥
  傪僶僢僼傽偵斀塮偝偣傑偡丅


仭僇僗僞儅僀僘

  buffer-menu 偐傜 navigate 傪幚峴偡傞偵偼偙傫側姶偠偱丅堦棗偐傜慖戰偱偒傞
  偺偱偪傚偭偲曋棙偐傕丅

    ;;; browser 偱奐偔 (M-b)
    (defun buf-menu-plus-navigate ()
      (interactive)
      (save-excursion
        (bx:navigate (get-buffer-file-name (ed::buffer-menu-buffname)))))
    (define-key ed::*buffer-menu-mode-map* #\M-b 'buf-menu-plus-navigate)


仭峏怴棜楌

  [Version 1.02] 2007-12-31 (寧)
  丒MIT儔僀僙儞僗偵偟偨丅

  [Version 1.01] 2005-02-03 (Thu)
  丒岞奐梡偵偄偔傜偐惍棟丅

  [Version 1.00] 2003-10-05 (Sun)
  丒弶斉嶌惉丅


仭儔僀僙儞僗

  buf-menu-plus.l 偼MIT儔僀僙儞僗偵婎偯偄偰棙梡壜擻偱偡丅
  <http://www.opensource.org/licenses/mit-license.php>

Copyright (c) 2007 HIE Masahiro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

|#

(provide "buf-menu-plus")

;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;
;;;  仭 曄悢愝掕乮揔摉偵僇僗僞儅僀僘偡傞偁偨傝乯
;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;

;;; 廔椆帪偵儅乕僋傪幚峴偡傞
(defvar *buf-menu-plus-execute-mark-before-quit* t)

;;; 僶僢僼傽傪慖戰偟偨屻 buffer-menu 傪廔椆偡傞
(defvar *buf-menu-plus-close-buffer* t)

;;; diff 幚峴屻丆彑庤偵僨傿僗僋偐傜撉傒捈偡
(defvar *buf-menu-plus-diff-revert-buffer-no-question* t)

;;; 僞僀僩儖偺怓
(defvar *buffer-menu-plus-color-title* '(:color 14))

;;; 僙僷儗乕僞偺怓
(defvar *buffer-menu-plus-color-sep* '(:color 15))

;;; 嶍彍儅乕僋峴偺怓
(defvar *buffer-menu-plus-color-D* '(:color 1))

;;; 嶍彍儅乕僋峴(枹曐懚僶僢僼傽)偺怓
(defvar *buffer-menu-plus-color-*D* '(:color 1 0 :bold))

;;; 曐懚儅乕僋峴偺怓
(defvar *buffer-menu-plus-color-S* '(:color 4 0 :bold))

;;; 僶僀僩僐儞僷僀儖/報嶞儅乕僋偺怓
(defvar *buffer-menu-plus-color-BP* '(:color 4))

;;; Diff 儅乕僋乮Old乯峴偺怓
(defvar *buffer-menu-plus-color-O* '(:color 10 0 :bold))

;;; Diff 儅乕僋乮New乯峴偺怓
(defvar *buffer-menu-plus-color-N* '(:color 13 0 :bold))

;;; 僇儗儞僩僶僢僼傽偺怓
(defvar *buffer-menu-plus-color-dot* '(:color 0 0 :bold))

;;; *hoge* 僶僢僼傽偺怓
(defvar *buffer-menu-plus-color-** '(:color 9))


;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;
;;;  仭 偦偺懠偺曄悢愝掕
;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;

(defvar *buf-menu-plus-buffer-name* "*Buffer List*")
(defvar *buf-menu-plus-diff-list* nil)
(defvar *buf-menu-plus-windows* nil)
(defvar *buffer-menu-plus-hook* nil)


;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;
;;;  仭 buffer-menu
;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;

(defun buffer-menu-plus (&optional arg)
  "奼挘斉(丠)buffer-menu"
  (interactive)
  (setf *buf-menu-plus-windows* (count-windows))
  ;; bufmenu.l 偑偁傟偽婛掕偺僼儗乕儉偵堏摦偟偨傝
  (when (fboundp 'bufmenu-select-default-frame)
    (bufmenu-select-default-frame))
  (let (winconf)
    (setq winconf (current-window-configuration))
    (setq *list-buffers-plus-winconf* (current-window-configuration))
    (list-buffers (or arg *prefix-args*))
    (set-window-configuration winconf)
    (set-buffer *buf-menu-plus-buffer-name*)
    (scan-buffer "^\\." :regexp t))
  ;; 僶僢僼傽偺忬懺傪挷惍
  (make-local-variable 'regexp-keyword-list)
  (setf regexp-keyword-list
	(compile-regexp-keyword-list
	 `(("^ MR.*" t ,*buffer-menu-plus-color-title*)
	   ("^[ -]+$" t ,*buffer-menu-plus-color-sep*)
	   ("^.[^*]D.*" t ,*buffer-menu-plus-color-D*)
	   ("^.\\*D.*" t ,*buffer-menu-plus-color-*D*)
	   ("^.S[^D].*" t ,*buffer-menu-plus-color-S*)
	   ("^..[BP].*" t ,*buffer-menu-plus-color-BP*)
	   ("^..O.*" t ,*buffer-menu-plus-color-O*)
	   ("^..N.*" t ,*buffer-menu-plus-color-N*)
	   ("^\\..*" t ,*buffer-menu-plus-color-dot*)
	   ("^....\\*.*" t ,*buffer-menu-plus-color-**)
	   )))
  (let ((buf (selected-buffer)))
    (set-local-window-flags buf *window-flag-line-number* nil)
    (set-local-window-flags buf *window-flag-newline* nil)
    (set-local-window-flags buf *window-flag-eof* nil))
  (run-hooks '*buffer-menu-plus-hook*))

(defun buffer-menu-plus-visit ()
  "bufmenu-plus 僼傽僀儖偵娭楢晅偗傜傟偨僶僢僼傽堦棗"
  (interactive)
  (buffer-menu-plus t))

(defun buf-menu-plus-execute ()
  "bufmenu-plus 儅乕僋傪幚峴"
  (interactive)
  ;; 曐懚
  (goto-char (point-min))
  (while (scan-buffer "^.S" :regexp t)
    (save-excursion
      (set-buffer (ed::buffer-menu-buffname))
      (if (get-buffer-file-name)
	  (save-buffer)
	(progn
	  (refresh-screen)
	  (save-buffer-dialog))))
    (forward-line 1))
  ;; 嶍彍
  (goto-char (point-min))
  (while (scan-buffer "^..D" :regexp t)
    (delete-buffer (ed::buffer-menu-buffname))
    (forward-line 1))
  ;; 僶僀僩僐儞僷僀儖
  (goto-char (point-min))
  (while (scan-buffer "^..B" :regexp t)
    (byte-compile-file (get-buffer-file-name (ed::buffer-menu-buffname)))
    (forward-line 1))
  ;; 報嶞
  (goto-char (point-min))
  (let ((i 0))
    (while (scan-buffer "^..P" :regexp t)
      (if (zerop i)
	  (progn
	    (print-dialog (ed::buffer-menu-buffname))
	    (setq i (1+ i)))
	(print-buffer (ed::buffer-menu-buffname)))
      (forward-line 1)))
  (buffer-menu-plus))


;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;
;;;  仭 buffer-menu 儅乕僋傪偮偗傞
;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;

(defun buf-menu-plus-unmark-all ()
  "bufmenu-plus 偤傫傇偺儅乕僋傪奜偡"
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (goto-line 3)
    (while (not (eobp))
      (buffer-menu-unmark))))

(defun buf-menu-plus-delete-all ()
  "bufmenu-plus 偤傫傇偵嶍彍儅乕僋"
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (goto-line 3)
    (while (not (eobp))
      (if (equal (ed::buffer-menu-buffname) "*scratch*")
	  (next-line)
	(buffer-menu-delete)))))

(defun buf-menu-plus-save-all ()
  "bufmenu-plus 枹曐懚僶僢僼傽偵曐懚儅乕僋"
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (goto-line 3)
    (while (scan-buffer "^.\\*" :regexp t)
      (if (equal (ed::buffer-menu-buffname) "*scratch*")
	  (next-line)
	(buffer-menu-save)))))

;;; shell-execute
(defun buf-menu-plus-shell-execute ()
  "bufmenu-plus shell-execute"
  (interactive)
  (shell-execute (get-buffer-file-name (ed::buffer-menu-buffname))))

(defun buf-menu-plus-byte-compile ()
  "bufmenu-plus 僶僀僩僐儞僷僀儖偡傞僼傽僀儖偵儅乕僋"
  (interactive)
  (ed::buffer-menu-buffer-exist-p)
  (goto-column 2)
  (let ((buffer-read-only nil))
    (declare (special buffer-read-only))
    (insert #\B)
    (delete-char 1))
  (forward-line 1))

(defun buf-menu-plus-print ()
  "bufmenu-plus 報嶞偡傞僼傽僀儖偵儅乕僋"
  (interactive)
  (ed::buffer-menu-buffer-exist-p)
  (goto-column 2)
  (let ((buffer-read-only nil))
    (declare (special buffer-read-only))
    (insert #\P)
    (delete-char 1))
  (forward-line 1))

(defun buf-menu-plus-mark-diff ()
  "bufmenu-plus diff 偡傞僼傽僀儖偵儅乕僋"
  (interactive)
  (ed::buffer-menu-buffer-exist-p)
  (goto-column 2)
  (let ((buffer-read-only nil))
    (declare (special buffer-read-only))
    (if (not (save-excursion
	       (goto-char (point-min))
	       (scan-buffer "^..O" :regexp t)))
	(insert #\O)
      (if (not (save-excursion
		 (goto-char (point-min))
		 (scan-buffer "^..N" :regexp t)))
	  (insert #\N)
	(insert #\SPC)))
    (delete-char 1)))

;;; buffer-menu傪暵偠傞
(defun buf-menu-plus-quit ()
  "bufmenu-plus 廔椆"
  (interactive)
  ;;儅乕僋傪幚峴
  (when (and *buf-menu-plus-execute-mark-before-quit*
	     (save-excursion
	       (goto-char (point-min))
	       (scan-buffer "^.\\(S\\|.[BDP]\\)" :regexp t))
	     (yes-or-no-p "儅乕僋傪幚峴偡傞丠"))
    (buf-menu-plus-execute))
  ;;昁梫偵墳偠僂傿儞僪僂傪暵偠傞
  (when (< *buf-menu-plus-windows* (count-windows))
    (delete-other-windows))
  (kill-buffer (selected-buffer)))


;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;
;;;  仭 buffer-menu 僶僢僼傽傪慖戰偟偰奐偔
;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;

(defun buf-menu-plus-1-window ()
  "bufmenu-plus 僇乕僜儖峴偺僶僢僼傽傪奐偔仌懠偺僂傿儞僪僂傪暵偠傞"
  (interactive)
  (buffer-menu-1-window)
  (when *buf-menu-plus-close-buffer*
    (delete-buffer *buf-menu-plus-buffer-name*)))

(defun buf-menu-plus-other-window ()
  "bufmenu-plus 僇乕僜儖峴偺僶僢僼傽傪懠僂傿儞僪僂偱墈棗"
  (interactive)
  (save-excursion
    (ed::buffer-menu-other-window)
    (other-window -1)))

(defun buf-menu-plus-view-next (&optional (arg -1))
  "bufmenu-plus "
  (interactive)
  (next-virtual-line arg)
  (buf-menu-plus-other-window))

(defun buf-menu-plus-view-previous (&optional (arg 1))
  "bufmenu-plus "
  (interactive)
  (buf-menu-plus-view-next 1))

(defun buf-menu-plus-this-window ()
  "bufmenu-plus 僇乕僜儖峴偺僶僢僼傽傪僇儗儞僩僂傿儞僪僂偱奐偔"
  (interactive)
  (buffer-menu-this-window)
  (when *buf-menu-plus-close-buffer*
    (delete-buffer *buf-menu-plus-buffer-name*)))

(defun buf-menu-plus-left-press ()
  "bufmenu-plus 僟僽儖僋儕僢僋偱奐偔"
  (interactive)
  (let ((click (mod *last-mouse-click-count* 6)))
    (if (= click 2)
	(buf-menu-plus-open)
      (mouse-left-press))))

;;; 僇乕僜儖峴偺僶僢僼傽傪僇儗儞僩僂傿儞僪僂偱奐偔
(defun buf-menu-plus-open ()
  "bufmenu-plus 僇乕僜儖峴偺僶僢僼傽傪奐偔"
  (interactive)
  (if (= *buf-menu-plus-windows* (count-windows))
      (buf-menu-plus-this-window)
    (buf-menu-plus-1-window)))


;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;
;;;  仭 buffer-menu 偐傜 diff
;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;

(require "diff")

(defun buf-menu-plus-diff ()
  "bufmenu-plus diff幚峴"
  (interactive)
  (define-key *diff-mode-map* #\q 'buf-menu-plus-diff-quit)
  (setq *buf-menu-plus-diff-list* nil)
  (let (o n)
    (goto-char (point-min))
    (while (scan-buffer "^..O" :regexp t)
      (push (ed::buffer-menu-buffname) *buf-menu-plus-diff-list*)
      (setq o (get-buffer-file-name (ed::buffer-menu-buffname)))
      (forward-line 1))
    (goto-char (point-min))
    (while (scan-buffer "^..N" :regexp t)
      (push (ed::buffer-menu-buffname) *buf-menu-plus-diff-list*)
      (setq n (get-buffer-file-name (ed::buffer-menu-buffname)))
      (forward-line 1))
    (buf-menu-plus-quit)
    (if (and o n)
	(diff n o)
      (message "僼傽僀儖偑側偄傛傫"))
    ))

(defun buf-menu-plus-diff-quit ()
  "bufmenu-plus diff廔椆仌僨傿僗僋偐傜撉傒捈偡"
  (interactive)
  (diff-quit)
  (with-set-buffer
    (dolist (buffer *buf-menu-plus-diff-list* t)
      (when (find-buffer buffer)
	(or (null (get-buffer-file-name buffer))
	    (null (buffer-local-value buffer 'verify-visited-file-modtime))
	    (verify-visited-file-modtime buffer)
	    (save-excursion
	      (set-buffer buffer)
	      (when (or *buf-menu-plus-diff-revert-buffer-no-question*
			(yes-or-no-p "僨傿僗僋偐傜撉傒捈偟傑偡偐?"))
		(update-visited-file-modtime)
		(revert-buffer)))))))
  (setq *buf-menu-plus-diff-list* nil)
  ;;栠偝側偔偰傕幚奞偼側偄傛偆側婥偑偡傞偗傟偳乧
  (define-key *diff-mode-map* #\q 'diff-quit)
  t)


;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;
;;;  仭 buffer-menu 僉乕僶僀儞僪
;;; 劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅劅 ;;;

(define-key ed::*buffer-menu-mode-map* #\LBtnUp 'buf-menu-plus-left-press)

(define-key ed::*buffer-menu-mode-map* #\U   'buf-menu-plus-unmark-all)
(define-key ed::*buffer-menu-mode-map* #\D   'buf-menu-plus-delete-all)
(define-key ed::*buffer-menu-mode-map* #\S   'buf-menu-plus-save-all)

(define-key ed::*buffer-menu-mode-map* #\RET 'buf-menu-plus-open)
(define-key ed::*buffer-menu-mode-map* #\TAB 'buf-menu-plus-other-window)
(define-key ed::*buffer-menu-mode-map* #\M-Up 'buf-menu-plus-view-next)
(define-key ed::*buffer-menu-mode-map* #\M-Down 'buf-menu-plus-view-previous)
(define-key ed::*buffer-menu-mode-map* #\M-p 'buf-menu-plus-view-next)
(define-key ed::*buffer-menu-mode-map* #\M-n 'buf-menu-plus-view-previous)
(define-key ed::*buffer-menu-mode-map* #\1   'buf-menu-plus-1-window)
(define-key ed::*buffer-menu-mode-map* #\0   'buf-menu-plus-this-window)
(define-key ed::*buffer-menu-mode-map* #\b   'buf-menu-plus-byte-compile)
(define-key ed::*buffer-menu-mode-map* #\p   'buf-menu-plus-print)
(define-key ed::*buffer-menu-mode-map* #\q   'buf-menu-plus-quit)
(define-key ed::*buffer-menu-mode-map* #\x   'buf-menu-plus-execute)
(define-key ed::*buffer-menu-mode-map* #\t   'buf-menu-plus-mark-diff)
(define-key ed::*buffer-menu-mode-map* #\M-f 'buf-menu-plus-diff)
(define-key ed::*buffer-menu-mode-map* #\M-s 'buf-menu-plus-shell-execute)

;;; buffer-menu 婲摦
(define-key ctl-x-map #\C-b 'buffer-menu-plus)


;;; buf-menu-plus.l ends here.
