From xemacs-m  Mon Feb 17 10:24:41 1997
Received: from mgate2.uni-hannover.de (mgate2.uni-hannover.de [130.75.2.5])
	by xemacs.org (8.8.5/8.8.5) with SMTP id KAA20849
	for <xemacs-beta@xemacs.org>; Mon, 17 Feb 1997 10:24:40 -0600 (CST)
Received: from helios (actually helios.tnt.uni-hannover.de) 
          by mgate2.uni-hannover.de with SMTP (PP);
          Mon, 17 Feb 1997 17:26:10 +0100
Received: from daedalus.tnt.uni-hannover.de by helios (SMI-8.6/SMI-SVR4) 
          id RAA21140; Mon, 17 Feb 1997 17:23:50 +0100
Received: by daedalus.tnt.uni-hannover.de (SMI-8.6/SMI-SVR4) id RAA22292;
          Mon, 17 Feb 1997 17:23:47 +0100
Date: Mon, 17 Feb 1997 17:23:47 +0100
Message-Id: <199702171623.RAA22292@daedalus.tnt.uni-hannover.de>
From: Heiko Muenkel <muenkel@tnt.uni-hannover.de>
To: steve@miranova.com
Cc: xemacs-beta@xemacs.org
Subject: Re: Is your (favorite) package not in XEmacs and should be?
In-Reply-To: <m27mkb0wip.fsf@altair.xemacs.org>
References: <m27mkb0wip.fsf@altair.xemacs.org>
X-Face: n}R'l6CHRf>pi&bj7[x0CW3:kmXm@1)7m+l*9[fp;-Ow4Xe~=5E;skf?2> 
        y]f{HzB|Q(\V9+y$PP~.4G[2n4W7{6Ilm[AMY9B:0kj.K_$-d%p4YIF*bX;=ADp6{ 
        HS@NEv9c.VII+9PgXHASx}K(jy^t=q%qzZ72q1e4E;O!$A$`&wgtLk"1%p.nC_G!] 
        4d1!+J4Q#YD_iXeEy`1x)d\r$1Qn\'23n|[8Y_xzuXJJ7W(EGqnzB]`]aq??;+z=) 
        DW~\'Vq&F'g%QU[Mv2:}nS>SdZFTEC2GsgB=Q,:~H<R5S[:ZN%B:s0;|v1x"Jb
Mime-Version: 1.0 (generated by tm-edit 7.90)
Content-Type: text/plain; charset=US-ASCII

Another usefull package is my man-menu.el. It provides a pulldown
menu, if you are viewing a man- page. This menu contains items to jump
to the different sections of the displayed man- pages.

Here it is:
---- begin of man-menu.el ----
;;; man-menu.el
;;; v1.10;  17-Aug-1996
;;; Copyright (C) 1994, 1996 Heiko Muenkel
;;; email: muenkel@tnt.uni-hannover.de
;;;
;;;  This program is free software; you can redistribute it and/or modify
;;;  it under the terms of the GNU General Public License as published by
;;;  the Free Software Foundation; either version 2, or (at your option)
;;;  any later version.
;;;
;;;  This program is distributed in the hope that it will be useful,
;;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;;  GNU General Public License for more details.
;;;
;;;  You should have received a copy of the GNU General Public License
;;;  along with this program; if not, write to the Free Software
;;;  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
;;;
;;; 
;;; Description:
;;;
;;;	This file provides a pulldown menu for the manpage mode. The menu
;;;	has items to jump to the different sections of a manpage. These
;;;	sections are seperated by keywords and the keywords are used as
;;;	the item names. 
;;;	If the variable `Manual-match-topic-exactly' is set to nil, then
;;;	the pulldown menu is created with submenus, one for each manual
;;;	page in the buffer.
;;; 
;;; Installation: 
;;;   
;;;	Put this file in one of your lisp load path directories and
;;;	the following line in your .emacs file:
;;;		(require 'man-menu)
;;;
;;;     YOu can also use the following lines instead:
;;;	        (defun Man-install-menu ()
;;;		    (require 'man-menu)
;;;		    (remove-hook 'Manual-mode-hook 'Man-install-menu)
;;;		    (Man-install-keyword-pulldown-menu))
;;;		    
;;;		(add-hook 'Manual-mode-hook 'Man-install-menu)
;;;

(provide 'man-menu)

(defvar Man-menu nil
  "Pulldown menu for man.")

(defvar Man-keyword-regexp "\\(^[ ]*\\)\\([A-Z]+[ ]*[A-Z]+\\)$"
  "*Regular expression for the keyword search
in `Man-create-keyword-menu-list'")

(setq Man-keyword-regexp "\\(^[ ]*\\)\\(\\([A-Z]+[ ]*\\)+[A-Z]+\\)$")

(defun Man-goto-keyword (point)
  "Function for the menu-items of the keyword menu."
  (goto-char (1- point))
  (beginning-of-line)
  (set-window-start (get-buffer-window (current-buffer)) (point)))

(defun Man-create-keyword-menu-list (&optional bound)
  "Creates a list with menu items for `Man-create-keyword-menu'.
An optional second argument bounds the search; it is a buffer position."
  (cond ((search-forward-regexp Man-keyword-regexp
				bound
				t)
	 (cons
	  (vector
	   (buffer-substring (match-beginning 2)
			     (match-end 2))
	   (list 'Man-goto-keyword (point))
	   t)
	  (Man-create-keyword-menu-list bound)))
	(t ())))
	
(defun Man-search-manpage-starts ()
  "Returns an alist with the manpage starts.
Each sublist contains the start and end point of the manpage name."
  (cond ((search-forward "File:" nil t)
	 (forward-line)
	 (cons (list (point)
		     (search-forward ")"))
	       (Man-search-manpage-starts)))
	(t nil)))
   
(defun Man-create-multiple-keyword-menu-lists ()
  "Creates a menu with a submenu for every manpage in the buffer.
The submenu contains items to display the different sections of a manpage."
  (let ((manpage-starts (Man-search-manpage-starts))
	(menu-list nil))
    (while manpage-starts
      (setq 
       menu-list
       (append
	menu-list
	(list
	 (cons
	  (buffer-substring (car (car manpage-starts)) 
			    (car (cdr (car manpage-starts))))
	  (progn
	    (goto-char (car (cdr (car manpage-starts))))
	    (Man-create-keyword-menu-list (car (car (cdr manpage-starts))))
	    )))
	))
       (setq manpage-starts (cdr manpage-starts)))
    menu-list))

(defun Man-create-keyword-menu ()
  "Creates a menu from a Unix manual buffer.
The items are the keywords of the visited man page."
  (save-excursion
    (message "Creating keyword menu ...")
    (goto-char (point-min))
    (setq case-fold-search nil)
    (if Manual-match-topic-exactly
	(setq Man-menu
	      (cons
	       "Man"
	       (Man-create-keyword-menu-list)))
      (setq Man-menu
	      (cons
	       "Man"
	       (Man-create-multiple-keyword-menu-lists))))
    (setq case-fold-search default-case-fold-search)))

(defun Man-install-keyword-pulldown-menu ()
  "Installs the Unix manual keyword pulldown menu."
  (Man-create-keyword-menu)
  (set-buffer-menubar (copy-sequence current-menubar))
  (if (cdr Man-menu)
      (add-submenu nil Man-menu)))

(add-hook 'Manual-mode-hook 'Man-install-keyword-pulldown-menu)---- end of man-menu.el ----

