Article View: gnu.epoch.misc
Article #1289Using xmenu toolkit ??
From: Marc Andreessen
Date: Tue, 30 Jun 1992 09:03
Date: Tue, 30 Jun 1992 09:03
75 lines
2631 bytes
2631 bytes
This is a modified version of a small package Thierry Cambon posted a
while back; all I use it for is to pop up a menu of buffers.
Marc
;;;
;;; xmenu.el
;;; provide an interface to Richard Hess' xmenu for xemacs & epoch
;;;
;;; part of the code is taken from the x-buffer-menu function in x-mouse.el
;;; and from the Epoch FAQ example by Philippe Bondono
;;;
;;; Control-mouse-left will pop up a menu in the current window
;;; with two submenus (submenus and entries can be added in the
;;; sp macro below)
;;;
;;; Thierry Cambon (T.Cambon@frcl.bull.fr)
;;;
(defun create-buffer-menu-entry (buffer)
(concat buffer "=" "switch-to-buffer " buffer))
(defun create-buffer-menu-entry-list ()
(mapcar 'create-buffer-menu-entry
(let ((tail (buffer-list))
head)
(while tail
(let ((elt (car tail)))
(if (not (string-match "^ "
(buffer-name elt)))
(setq head (cons
(format
"%s"
(buffer-name elt))
head))))
(setq tail (cdr tail)))
(reverse head))))
(defun interpret-output (process output)
(let ((com (read-from-string output)))
(if (>= (cdr com) (length output))
(funcall (car com))
(funcall (car com) (substring output (cdr com) -1)))))
(defmacro sp-old ()
(` (start-process "xmenu" nil
"/usr/local/bin/xmenu" "-heading" "Epoch Menu"
"-menu" "Tools"
"Undo=undo"
"Dired=dired-other-screen"
"-unem"
"-menu" "Buffers"
(,@ (create-buffer-menu-entry-list))
"-unem")))
(defmacro sp ()
(` (start-process "xmenu" nil
"/usr/local/bin/xmenu" "-heading" "Epoch Buffers"
(,@ (create-buffer-menu-entry-list)) )))
(defun make-menu (arg)
(interactive)
(set-process-filter (sp)
'interpret-output))
(global-set-mouse mouse-left mouse-control 'make-menu)
Marc
--
Marc Andreessen
Epoch Development Team
University of Illinois at Urbana-Champaign
marca@ncsa.uiuc.edu
Technical Details
Message-ID:
<9206302303.AA03932@wintermute.ncsa.uiuc.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ncsa.uiuc.edu!marcaReferences:
<1992Jun30.173040.29279@cc.umontreal.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,e9cca454bf9fa4b4 X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1992-06-30 08:59:20 PST Newsgroups: gnu.epoch.misc Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ncsa.uiuc.edu!marca From: marca@ncsa.uiuc.edu (Marc Andreessen) Subject: Using xmenu toolkit ?? Message-ID: <9206302303.AA03932@wintermute.ncsa.uiuc.edu> Sender: daemon@cis.ohio-state.edu Organization: GNUs Not Usenet References: <1992Jun30.173040.29279@cc.umontreal.ca> Distribution: gnu Date: Tue, 30 Jun 1992 09:03:47 GMT Lines: 76