
I) Adding additional syntax coloring
====================================


From done@ece.arizona.edu Tue Jul 22 22:09:23 1997
Date: Sun, 29 Jun 1997 10:16:13 -0700
From: Dan Nicolaescu <done@ece.arizona.edu>
To: fiskjm@ctrvax.Vanderbilt.Edu
Subject: article in Linuz Gazette

Hi!

I have one comment about the screen captures of Emacs and XEmacs in
your article in Linux Gazette at
http://www.ssc.com/lg/issue18/wkndmech.html

To truly ilustrate both emacsen syntax coloring capabilities you would
better take a snapshot after you put in your .emacs 
(setq font-lock-maximum-decoration t) and restart [X]Emacs.

Regards,
	Dan


II) Setting up func-menu
========================

x-gateway: relay1.UU.NET from xemacs to comp.emacs.xemacs; Tue, 24 Jun 1997 06:40:46 EDT
Date: Tue, 24 Jun 1997 11:30:48 +0100
Message-ID: <199706241030.LAA00716@charlie.videonetworks.com>
From: djh@videonetworks.com (David Hughes)
Subject: Re: Is func-menu what I'm looking for?
Newsgroups: comp.emacs.xemacs
Path: news.vanderbilt.edu!newsfeed.telalink.net!telalink!news.wildstar.net!news.inetnebr.com!news.enteract.com!newsfeed.enteract.com!chi-news.cic.net!news.mathworks.com!uunet!wendy-fate.uu.net!xemacs
Sender: xemacs-request@xemacs.org
Lines: 50
Xref: news.vanderbilt.edu comp.emacs.xemacs:16055

> Hi gurus,
> 
> I remember, a while ago, I used to be have a menu that would
> give me the name of the functions defined in the current buffer.
> The menu would also allow me to point to one particular function.
> 
> I'd like to be able to use that again, but I do not know
> which package does it.
> Is it func-menu?
> If so, where can I find it? I have tried, but I could
> not find it.


Add the following (or something like it) to your .emacs

;;; func-menu is a package that scans your source file for function
;;; definitions and makes a menubar entry that lets you jump to any
;;; particular function definition by selecting it from the menu.  The
;;; following code turns this on for all of the recognized languages.
;;; Scanning the buffer takes some time, but not much.
;;;
;;; Send bug reports, enhancements etc to:
;;; David Hughes <d.hughes@videonetworks.com>
;;;
(cond (running-xemacs
       (require 'func-menu)
       (define-key global-map 'f8 'function-menu)
       (add-hook 'find-file-hooks 'fume-add-menubar-entry)
       (define-key global-map "\C-cl" 'fume-list-functions)
       (define-key global-map "\C-cg" 'fume-prompt-function-goto)

       ;; The Hyperbole information manager package uses (shift button2) and
       ;; (shift button3) to provide context-sensitive mouse keys.  If you
       ;; use this next binding, it will conflict with Hyperbole's setup.
       ;; Choose another mouse key if you use Hyperbole.
       (define-key global-map '(shift button3) 'mouse-function-menu)

       ;; For descriptions of the following user-customizable variables,
       ;; type C-h v <variable>
       (setq fume-max-items 25
             fume-fn-window-position 3
             fume-auto-position-popup t
             fume-display-in-modeline-p t
             fume-menubar-menu-location "File"
             fume-buffer-name "*Function List*"
             fume-no-prompt-on-valid-default nil)
       ))

-- David Hughes


III) Larry Ayers article (LG Issue 11) on the kill-ring menu
============================================================

[Image] "Linux Gazette...making Linux just a little less scary! "[Image]

----------------------------------------------------------------------------

                        A "Kill-Ring" Menu For Xemacs

                               by Larry Ayers

                              Copyright © 1996

                 Published in Issue 11 of the Linux Gazette

----------------------------------------------------------------------------

Lately I've been enjoying exploring the myriad capabilities of GNU Emacs'
offspring and competitor, Xemacs. Aside from the burden of downloading the
voluminous source, Xemacs offers quite a few features which Gnu Emacs lacks.
Luckily for those considering a transition, the basic keystrokes and
commands are nearly identical.

One feature of Gnu Emacs which I began to miss after a while was the handy
pull-down menu which displays the first few words of each cut or copied
selection made in the current session, i.e. the "kill-ring". The prospect of
figuring out how the lisp files work which determine the menu-bar's
structure wasn't too appealing. I know a little lisp, but not enough to add
a new menu entry.

Some weeks later, while idly browsing through some emacs newsgroup headers,
I came across this posting, which I'll quote here in full:

In article <9604170740.AA26236@portia.uk.abs> imac@portia.rd.abs.alcatel.co.uk
(Ian MacKinnon) writes:

> When I used emacs (before I saw the light), I made use of a function
> mouse-menu-choose-yank which offered you the choice to yank from the recent
> history of selections via a popup menu, but I can't get it to work in
> XEmacs because x-popup-menu doesn't exist, and the parameters to
> popup-menu are different. Has anyone got an alternative. I enclose the
> ...

I have hacked the Emacs codes of mouse-menu-choose-yank to put in
Xemacs as follows:

(defvar yank-menu-length 40
  "*Maximum length of an item in the menu for select-and-yank.")
(defun select-and-yank-filter (menu)
  (let* ((count 0))
    (append menu
            (mapcar
             #'(lambda (str)
                 (if (> (length str) yank-menu-length)
                     (setq str (substring str 0 yank-menu-length)))
                 (prog1
                     (vector
                      str
                      (list
                       'progn
                       '(push-mark (point))
                       (list 'insert (list 'current-kill count t)))
                      t)
                   (setq count (1+ count))))
             kill-ring))))

For this to work, you have to put on your menu bar the following submenu
(use add-submenu for that for example):

      ("Select and Yank"
       :included kill-ring
       :filter select-and-yank-filter)

Hope this help

-----------------------------------------------------------------------
PHAM Dinh Tuan                         | e-mail: Dinh-Tuan.Pham@imag.fr
Laboratoire de Modelisation et Calcul  | Tel: +33 76 51 44 23
BP 53, 38041 Grenoble cedex (France)   | Fax: +33 76 63 12 63
-----------------------------------------------------------------------

It took a little experimenting to get this to work. The first section of
lisp code, ending with "kill-ring))))", can be copied unaltered into the
xemacs section of your ~/.emacs file. If you're using Xemacs 19.14 (the
current version), it goes into your ~/.xemacs-options file.

The second, shorter lisp snippet needs one small addition:

           (add-submenu nil '("Kill-Ring"
                     :included kill-ring
                     :filter select-and-yank-filter))

As well as adding the proper syntax for add-submenu, I shortened the
menu-title, but it could be called anything you like.

When I first restarted Xemacs after placing this code into the init file the
new submenu was nowhere to be seen. I surmised that I'd made some error, and
put off further experimentation for another time. A few minutes later I was
busily editing some file. I happened to glance up at the menu-bar and found
a brand-new kill-ring submenu. Surprisingly the new menu only appears after
a selection has been cut or copied.

I was happy, and thought that by relating my experience I could encourage
other Xemacs users (especially the ones who know as little lisp as I do!) to
try this neat hack. Thanks to Dinh Tuan Pham, if he or she should happen to
see this.


IV) Setting up MET-% to jump to matching paren
==============================================

x-gateway: relay3.UU.NET from xemacs to comp.emacs.xemacs; Mon, 23 Jun 1997 08:22:07 EDT
Date: Mon, 23 Jun 1997 08:20:35 -0400
From: steger@WILLEY.tautron.com (Tom Steger)
Message-ID: <199706231220.IAA09570@huck.tautron.com>
Subject: Re: matching parenthesis
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Md5: yOGKPHL0YSjI2n6HF4u3zg==
Newsgroups: comp.emacs.xemacs
Path: news.vanderbilt.edu!uunet!wendy-fate.uu.net!xemacs
Sender: xemacs-request@xemacs.org
Lines: 62
Xref: news.vanderbilt.edu comp.emacs.xemacs:15931

> From xemacs.org!xemacs-request@bort.mv.net Mon Jun 23 02:10:26 1997
> Resent-Date: Sun, 22 Jun 1997 15:52:25 -0500 (CDT)
> From: Chetan Vora <mv!chet@mink.mt.att.com>
> Subject: matching parenthesis
> Date: Sun, 22 Jun 1997 16:13:57 -0400
> Nntp-Posting-Host: 135.21.110.*
> Mime-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Xref: uunet comp.emacs.xemacs:23301
> To: mv!xemacs@xemacs.org
> Resent-Message-Id: <"vsp4X2.0.8g4.72Php"@xemacs>
> Resent-From: mv!xemacs@xemacs.org
> X-Mailing-List: <xemacs@xemacs.org> archive/latest/6515
> X-Loop: xemacs@xemacs.org
> Resent-Sender: mv!xemacs-request@xemacs.org
> 
> Hi,
> 
> Is there a command in xemacs19.15 by which I can go to a matching
>  parenthesis (like % in vi) ??
> 
> I do have the parenthesis library working which highlights the 
> matching parenthesis but if the matching parenthesis is out
> of the page how do I get to it without moving the cursor ??
> 
> Thanks in advance,
> Chetan
> 

I got the following from hall@grumpy.nl.nuwc.navy.mil in response to a similar 
question. I bound it to ALT %.


(defun goto-matching-paren ()
       "Move cursor to matching paren."
            (interactive)
            (let* ((oldpos (point)) (blinkpos))
              (condition-case ()
                (setq blinkpos (scan-sexps oldpos 1))
                (error nil))

            (if blinkpos
              (setq blinkpos (1- blinkpos))
              (condition-case ()
                (setq blinkpos (scan-sexps (1+ oldpos) -1))
                (error nil)))

            (setq mismatch
                (/= (char-after oldpos)
                (logand (lsh (aref (syntax-table)
                                       (char-after blinkpos))
                                  -8) 255)))

          (if mismatch
              (progn
                (setq blinkpos nil)
                (message "Mismatched parentheses"))
               (if blinkpos
                (goto-char blinkpos)))))

(global-set-key "\M-%" 'goto-matching-paren)
