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

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

RE: [External] : forward-sexp


From: Drew Adams
Subject: RE: [External] : forward-sexp
Date: Sun, 13 Aug 2023 15:04:50 +0000

> > While every mode is entitled to design commands at their needs, it
> > must respect semantic.
> >
> > ‘sexp’ is documented as ‘balanced expression’.
> >
> > If an expression starts with an [, I'm holding its balancing
> > counterpart as obvious. No ( or other char may come into scope.
> 
> But only if [ and ( are treated as a parenthesis by the major mode.

Exactly the point.
___

Andreas: If you feel that a sexp is defined
poorly for `fundamental-mode', or if you feel
that it's defined as you think it should be
but `forward-sexp' in `fundamental-mode'
doesn't fit that definition, then consider
reporting a bug or requesting an enhancement:
`M-x report-emacs-bug'.

That's the point.  A "sexp" is _whatever the
major mode says it is_.  And `forward-sexp',
in any mode, should move past the next sexp
according to what the mode defines as a sexp.

(By "should", I mean _conventionally_, so
that code relying on `forward-sexp' works as
one expects.  Nothing _prevents_ a mode from
defining `forward-sexp' from doing anything
it wants: ringing a bell, baking a cake,...

And no, it's not "obvious" that `]' is a
balanced counterpart to `['.  And neither is
it obvious, even if that were always the case,
that what follows `[' up till the next `]' is
to be ignored.

All such "sexp" behavior is _defined_ by the
mode, _for_ the mode.  "Sexp is of the mode,
by the mode, and for the mode." - A.L. 

You seem to have some underlying assumptions
wrt `[' (or perhaps wrt `(') that you don't
express explicitly, and which conflict with
how "sexp" is defined for `fundamental-mode'
(or perhaps for _any_ mode?).

`M-x report-emacs-bug', to make your
expectations/preferences explicit.   But be
specific, wrt both the mode and the exact
behavior you expect/want.

reply via email to

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