[Top][All Lists]

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

Re: mark-sexp again

From: Andreas Röhler
Subject: Re: mark-sexp again
Date: Tue, 09 Jun 2015 08:24:38 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Am 08.06.2015 um 21:37 schrieb Artur Malabarba:
2015-06-08 19:55 GMT+01:00 Andreas Röhler <address@hidden>:
Am 08.06.2015 um 18:09 schrieb Artur Malabarba:
2015-06-08 15:24 GMT+01:00 Andreas Röhler <address@hidden>:
When inside a string, mark-sexp should mark the string. IMO doesn't make
sense to consider the contents then.

Example, cursor at beginning of docstring at "Just"

(defun foo1 ()
    "Just foo")

M-x mark-sexp RET marks word "Just", not the string.

Respectivly forward-sexp should reach the end of string, if called
That would make it redundant with `up-list'.

Don't think so:
I didn't mean the two commands are completely identical. I meant that
the action of moving out of a string while inside a string is already
achieved by the `up-list' command (which is also generally useful but
has no binding), so changing `forward-sexp' to do that as well would
be redundant. Specially since you'd be removing `forward-sexp's
ability to move inside a string, which is useful.

(list "asdfsdf adfsadf  " "asdfsd asd asdf " "asdfasf asdfsad ")

When started a "list",  forward-sexp travels string by string, which is ok
and also means, it recognises a string as sexp already.

Accordingly from inside a string, it should go to the end first.
You seem to think this would make forward-sexp more consistent, but it
would make it less consistent. Currently, a pair of parentheses
delineates a sexp in the same way that a pair of double quotes does.
If you place point at the "a" on the following two examples,
`forward-sexp' will do the exact same thing in both cases. That's

     (abc def)
     "abc def"

Expect forward-sexp to behave according to syntax of the language.
AFAIU in Emacs Lisp an sexp is either a list --empty or not-- or an element of a list.


(abc def)

has at least three sexp.

While a string seen from Emas Lisp is just a single one.

[ ... ]

reply via email to

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