swarm-support
[Top][All Lists]
Advanced

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

Re: Speedbar/ObjC


From: Steve Emsley
Subject: Re: Speedbar/ObjC
Date: Mon, 15 Feb 1999 16:20:58 GMT

Apologies if this is repeated ... This time I'll be less thrifty and
keep the phone line active for long enough !

>>>>> "Jan" == Jan Kreft <address@hidden> writes:

    Jan> Hi Steve, sounds interesting. Never got beyond highlighting
    Jan> of ObjC myself. So, what can speedbar etc. do for you and how
    Jan> do you do it?

Hi Jan,
   Sorry about the delay ... I was recovering from being hit on the
   head with the elisp ref manual ;-/

PROBLEM:     Navigating around a multifile Swarm model.

SOLUTION:    This works for Emacs 20.2.1 anyway! 
             
             Upgrade cc-mode to a version > 5.10
             http://www.python.org/Emacs/cc-mode

             Install speedbar
             ftp://ftp.ultranet.com:/pub/zappo/speedbar-0.8.tar.gz

             Teach imenu about ObjectiveC but putting this in .emacs

;;; ................................................. &emac-objc ...
;;; Objective C mode

(add-hook 'objc-mode-hook             'objc-mode-hook-imenu-fun)

(defun objc-mode-hook-imenu-fun ()
  (setq imenu-generic-expression
        (list
         '("*Class methods*" 
         "^ ?[+][\t]*\\((\\([^)\n]+\\))[\t]*\\)?\\([a-zA-Z0-9_~$]+:?\\)" 
         4)
         '("*methods*" 
         "^ ?-[\t]*\\((\\([^)\n]+\\))[\t]*\\)?\\([a-zA-Z0-9_~$]+:?\\)" 
         4)
         ))
  (imenu-add-to-menubar "Methods"))

(setq speedbar-add-supported-extension "\\.m$")

;;; Bind speedbar to a function key
(global-set-key [f8]                  'speedbar-get-focus)

;;; The imenu default is not to sort entries. If you want to sort
;;; by name then uncomment the following. 

;;(setq imenu-sort-function `imenu--sort-by-name)

;;; Really this should be buffer local since using speedbar/imenu with
;;; LaTeX multifiles is better if the logical structure is maintained.
;;;.............................................................

DOCUMENTATION:  Quoting from the GNU Emacs manual.

Making and Using a Speedbar Frame

An Emacs frame can have a speedbar, which is a vertical window that
serves as a scrollable menu of files you could visit and tags within
those files. To create a speedbar, type M-x speedbar; this creates a
speedbar window for the selected frame. From then on, you can click on
a file name in the speedbar to visit that file in the corresponding
Emacs frame, or click on a tag name to jump to that tag in the Emacs
frame.

Initially the speedbar lists the immediate contents of the current
directory, one file per line. Each line also has a box, `[+]' or
`<+>', that you can click on with Mouse-2 to "open up" the contents of
that item. If the line names a directory, opening it adds the contents
of that directory to the speedbar display, underneath the directory's
own line. If the line lists an ordinary file, opening it up adds a
list of the tags in that file to the speedbar display. When a file is
opened up, the `[+]' changes to `[-]'; you can click on that box to
"close up" that file (hide its contents).

ADDENDUM: Since speedbar-jump-to focus does just that I usually hide
the frame underneath the main frame. Having got this working I saw it
was good and wanted more. I got it to work with LaTeX but not with the
imenu.el that came with my distribution. Changing to an earlier
version solved the problem. If you like to do the same I can send my
working imenu.el

ADDITIONAL: The line above with &emac-objc works with the tinybm.el
package and imenu to allow you to break up your code into sections.
For instance: createMethods, setMethods, getMethods etc. Installing
the package allows to to enter these bookmarks and navigate via a
pop-up menu or keys e.g. [SHIFT][LEFT] for bookmark-forward. The
author, Jari Aalto, needed to modify the code to get it to work with
objectiveC. I guess by the modification date that he's incorporated
the change:
        ftp://cs.uta.fi/pub/ssjaaa/tiny-tools-beta.zip

Hope this helps. Now back to ObjectiveC for a long-earned rest ;-/
Steve

-- 

  Steve Emsley             Avoid the Gates of Hell.  Use Linux
-----------------------------------------------------------------
  address@hidden                    www.oikos.ac.uk/~sme


-- 

  Steve Emsley             Avoid the Gates of Hell.  Use Linux
-----------------------------------------------------------------
  address@hidden                    www.oikos.ac.uk/~sme

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]