Hello All,
The attached library senator.el (SEmantic NAvigaTOR) defines the
commands `senator-next-token' and `senator-previous-token' to navigate
between language semantic tokens in current buffer. It uses Eric
Ludlam's semantic bovinator tool (version 1.3.1) to parse the buffer and
find the language tokens.
To install, put the file senator.el on your Emacs-Lisp load path and
add (require 'senator) into your ~/.emacs startup file.
The best way to use these navigation commands is to bind them to
keyword shortcuts. The following example respectively binds
`senator-next-token' and `senator-previous-token' to [A-next]
(Alt+PageDown) and [A-prior] (Alt+PageUp) keys for the given mode:
(define-key mode-map [A-next] 'senator-next-token)
(define-key mode-map [A-prior] 'senator-previous-token)
You can customize the `senator-step-at-token-ids' and
`senator-step-at-start-end-token-ids' options to navigate only between
particular tokens and to step at start and end of some of them. To
have a mode specific customization, do something like this in a hook:
(add-hook 'mode-hook
(lambda ()
(setq senator-step-at-token-ids '(function variable))
(setq senator-step-at-start-end-token-ids '(function))
))
The above example specifies to navigate only between functions and
variables, and to step at start and end of functions only.
I hope this will help. Any feedback will be welcome.
Sincerely,
David
senator.el