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

[xyzzy:01277] popup-buffer



みなさん、こんにちは。

また、ちょっとおもしろいかも。
ひまだなー(^^;

----------------------------------------
;;; -*- Mode: Lisp; Package: EDITOR -*-
;;;
;;; This file is part of xyzzy.
;;;

(provide "buffer-menu")

(in-package "editor")

(export '(popup-buffer *popup-buffer-menu*))

(defvar *popup-buffer-menu* nil)
(setq *popup-buffer-menu* (create-popup-menu nil))

(defun popup-buffer ()
  (interactive)
  (while (get-menu-position *popup-buffer-menu* 'buffer)
    (delete-menu *popup-buffer-menu* 'buffer))
  (continue-pre-selection)
#|  (set-window *last-mouse-window*) |#
  (save-excursion
    (dolist (buffer (buffer-list))
      (let ((menu-item (buffer-name buffer)))
	(add-menu-item *popup-buffer-menu* 'buffer
		       menu-item
		       #'(lambda ()
			   (interactive)
			   (pop-to-buffer menu-item))))))
  (track-popup-menu *popup-buffer-menu*))

(global-set-key '(#\C-c #\C-b) 'popup-buffer)

--------
須田誠也
EZU11330@xxxxxxxxxxx

Index Home