all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: "João Távora" <joaotavora@gmail.com>
Cc: "help-gnu-emacs@gnu.org List" <help-gnu-emacs@gnu.org>
Subject: Re: moving in js
Date: Fri, 10 Aug 2012 08:45:19 +0200	[thread overview]
Message-ID: <5024ADFF.6090405@easy-emacs.de> (raw)
In-Reply-To: <CALDnm53ofQU75URh1H+oyD4x2Ccv57mx4ngY9deRAhUWsJCV7w@mail.gmail.com>

Am 10.08.2012 03:14, schrieb João Távora:
>> Single words and symbols also are not balanced expressions IMO.
>> When on ba|z
>>
>> (foo (bar ba|z) quux)
>>
>> C-M-b would reach |baz
>>
>> (foo (bar |baz) quux)
>>
>> i.e, it would do backward-word
>
> No, it's doing backward-sexp. "baz" happens to also be a sexp (an
> atomic), and it's not a question of opinion (see below).
>
>> a repeat would do backward-word again, a third would error
>>
>> Can't see any relation to stipulated move over balanced expression here.
>>
>> Looks fairly arbitrary.
>
> It's not. In lisp-mode, where this is clearer (but as we have seen it
> can and has been generalized to other programming modes), a word and a
> symbol are also sexp's. See http://en.wikipedia.org/wiki/S-expression:

Thanks pointing at.

IMO we have a conflict of notion between "symbolic expression" and "balanced expression", the latter stated in Emacs lisp info.

An atom is an symbolic expression. But where is the balance in singularity established by atom? For a balance you need a counterpart.

> a sexp can be an atom or a list ( a . b ) where a and b are themselves
> sexp's. As you have found, backward-word doesn't error,  because it
> doesn't care about sexp's. But backward-sexp does :-) , indeed it
> *must* error to tell you there are no more sexp's backwards at that
> level.
>

let's go on with a example from link given

"((milk juice) (honey marmalade))

is a two-element S-expression whose elements are also two-element S-expressions"

Go at beginning of honey and do backward-sexp --> error

A move command should look for a next element - preferably in same level.
But don't expect a kind of validation from, saying: oh, this list ends here.

It should just pick the next suitable element than.


> IMO this is one of the best designed features in Emacs, and one many
> non-Emacs users envy. When I move and delete with the C-M-* keys, I
> get structured editing for free. And (shameless plug) if I add
> autopair.el to that, I don't need paredit.el at all.  Furthermore,
> because Emacs generalizes the sexp concept to other modes via
> syntax-tables,  structured editing (and autopair) "just work" in
> almost every programming mode that defines delimiters.

okay, a use-case is an argument
Will look there, maybe get a clue.


>
>> CC to help, as it might be of some interest for others to.
>
> of course, I forgot to send my previous message to the list.
>




  reply	other threads:[~2012-08-10  6:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 19:11 moving in js Andreas Röhler
2012-08-07 20:33 ` Peter Dyballa
2012-08-08  5:37   ` Andreas Röhler
2012-08-08 17:37     ` João Távora
2012-08-09  5:45       ` Andreas Röhler
     [not found]         ` <CALDnm512KSuJw+ZScjnn59x7OZLnWOfyZzLVBe_4CiLqdKTAkA@mail.gmail.com>
2012-08-09 16:20           ` Andreas Röhler
     [not found]             ` <CALDnm537EEG=6s9KJrqSZN35zBTg=GLcE7OBJy8h=N4zAD03cA@mail.gmail.com>
2012-08-09 17:19               ` Andreas Röhler
2012-08-10  1:14                 ` João Távora
2012-08-10  6:45                   ` Andreas Röhler [this message]
     [not found]                     ` <CALDnm52urB5ZD7gkDeGE4irOn+J-EWzLVcDfEetZVrf95ZESEA@mail.gmail.com>
2012-08-10 11:15                       ` Andreas Röhler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5024ADFF.6090405@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.