[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: mark-sexp again
From: |
Artur Malabarba |
Subject: |
Re: mark-sexp again |
Date: |
Mon, 8 Jun 2015 20:37:23 +0100 |
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
>>> inside.
>>
>> 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
consistent.
(abc def)
"abc def"
If you want to move out of a string, just use the same command you
would use on parentheses (`up-list').
If you want to mark a whole string while inside it, just use the same
procedure you would use on parentheses (`backward-up-list' with
`mark-sexp').
- mark-sexp again, Andreas Röhler, 2015/06/03
- Re: mark-sexp again, Stefan Monnier, 2015/06/03
- Re: mark-sexp again, Andreas Röhler, 2015/06/07
- Re: mark-sexp again, Stefan Monnier, 2015/06/08
- Re: mark-sexp again, Andreas Röhler, 2015/06/08
- Re: mark-sexp again, Artur Malabarba, 2015/06/08
- Re: mark-sexp again, Andreas Röhler, 2015/06/08
- Re: mark-sexp again,
Artur Malabarba <=
- Re: mark-sexp again, Andreas Röhler, 2015/06/09
- Re: mark-sexp again, Stefan Monnier, 2015/06/08