Languide comes with definitions of common statement types for several
programming languages. You can add more, and of course contribute them
for public use should you so wish.
The file statement-nav-directions.el implements the basic movements
needed to navigate around statements. Directions for specific
statement parts in various programming languages are defined in such
files as languide-lisp-like.el, languide-c-like.el and so forth;
languide-c-like is a fairly rich source of examples.
Normally, a sequence of directions is followed, and the last one is
taken as the result, that is, the thing to leave selected. To allow
multipart selections, as versor does, you can indicate a step of
the directions as selecting what it moves over, by wrapping it in a
call to “remember
”.
Strings in the directions are searched for (as regexps) and moved
over.
Any elisp function calls may be used in the directions, and their
effect on point will be, but those listed on
statement-navigate-list-selector-functions
are treated
specially: they are expected to return a cons of the start and end
positions of the piece of text they describe. Thus, only such
functions should be used as the last step of a set of directions, and
only these should be given as the argument to “remember”. You can
write your own functions of this nature, but you must add them to
statement-navigate-list-selector-functions
for them to work
properly.
The selection functions are as follows:
expression
expressions
expression-contents
preceding-expression
statement
defmodal
” definitions for the major mode concerned, for the
functions move-into-previous-statement
,
move-into-next-statement
,
beginning-of-statement-internal
, and
end-of-statement-internal
. (If you define these, you should
also define identify-statement
, compound-statement-open
,
compound-statement-close
,
insert-compound-statement-open
, and
insert-compound-statement-close
.)
statements
statement-contents
from-start-of-statement
upto
start-of-match