help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Defining functions on the fly


From: Tassilo Horn
Subject: Re: Defining functions on the fly
Date: Tue, 16 Jun 2015 09:01:44 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

>>> i'm probably misunderstanding you, but does:
>>>     (defun (intern (concat "current-prefix-" foo) ...
>>> do what you need?
>> (defalias (intern (concat "current-prefix-" foo) ...) ...) can work, but
>> not with defun.  In any case, some concrete example of what he needs to
>> do would go a long way.
>>
>>
>>          Stefan
>
> Currently Emacs provides some scheme to fontify source code and some
> basic moves: linewise, symbol, word, paragraph, sexp.
>
> There is no idea of statement, block/loop or expression and a poor
> top-level --beginning/end-of-defun.

There is: `forward-sexp' and `backward-sexp'.  Although the name sexp is
a bit lisp-specific, sexp-based motion has been implemented for more
C-like languages, too.  For example, it works well for shell scripts and
Ruby programs.

See (info "(elisp) SMIE") for how to add sexp-based motion to your
favorite programming language mode.

Bye,
Tassilo



reply via email to

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