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 15:10:23 +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:

>> No.  `do ... done' is no valid expression, i.e., it cannot stand on
>> its own but is only valid together with for, while, until, or repeat.
>
> It's not the point to care for that.

Well, when you say you want to move by expression or statement then it
seems legit to do exactly that and not move by half of a statement.

> It's about editing, reading, understanding the source.

I can understand that moving to the do wouldn't be bad with respect to
editing because it's nearer, e.g., two smaller steps might be better
than one large step which might already be too much.  But the same time
you argue that `forward-sexp' in a string should jump to its end instead
of moving word-wise in its contents first.

> What about a single "return" statement in code?

What's up with a single return statement in code?

> Nonetheless, will reflect this case again WRT the mode in question.

I don't get what you are trying to tell me.

>>> With cursor at third line, "set", expression is not recognised at
>>> all, C-M-f stops at the end of symbol "set"
>> Well, "command arg arg arg" in shell scripts is equivalent to
>> (command arg arg arg) in lisp with the distinction that with the lisp
>> syntax's parentheses you have a choice to move over the complete
>> expression (when point is on the opening paren) or inside it (when
>> point is on the "command").  Because the shell syntax doesn't have
>> delimiters for the funcall or at least the argument list, there's not
>> much you can do.
>
> Wrong.  We have the language's syntax and may follow it.

I don't get what you mean.

> Also these languages often are quite similar, thus aiming for some
> generics.

That's the whole purpose of SMIE: conveniently navigating/editing code
of different languages by defining what's a sexp in these languages
using a simple grammar.  Then the generic interface is just the set of
sexp-commands.

Bye,
Tassilo



reply via email to

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