emacs-devel
[Top][All Lists]
Advanced

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

Re: Proposal: make up-list escape strings


From: Daniel Colascione
Subject: Re: Proposal: make up-list escape strings
Date: Tue, 08 Apr 2014 18:47:04 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 04/08/2014 06:11 PM, Stefan Monnier wrote:
>> +If ESCAPE-STRINGS is non-nil (as it is interactively), treat
>> +encoding strings as sexps."
>    ^^^^^^^^
>    enclosing, right?  ;-)

That'll learn me some.

> Why limit this to strings?  It makes just as much sense to do it for
> comments, doesn't it?

It's a bit harder to implement for comments (as in, rewrite up-list
using parse-partial-sexp), and I'm not sure it's as useful. Probably not
too bad though.

> 
>>      (while (/= arg 0)
>>        (if (null forward-sexp-function)
>> -          (goto-char (or (scan-lists (point) inc 1) (buffer-end arg)))
>> +          (condition-case err
>> +              (goto-char (or (scan-lists (point) inc 1) (buffer-end arg)))
>> +            (scan-error
>> +             (or (and escape-strings
>> +                      (let ((syntax (syntax-ppss)))
>> +                        (and (nth 3 syntax)
>> +                             (nth 8 syntax))
>> +                        (goto-char (nth 8 syntax))
>> +                        (when (> arg 0) (forward-sexp))
>> +                        t))
>> +                 (signal (car err) (cdr err)))))
> 
> If @ is point, I think that from
> 
>       (a "b (c (d @ e) " "f) g" h)
> 
> up-list should move to
> 
>       (a "b (c (d e)@ " "f) g" h)
> 
> and then to
> 
>       (a "b (c (d e) "@ "f) g" h)
> 
> whereas I think your code would move to
> 
>       (a "b (c (d e) " "f)@ g" h)

I'm not sure which behavior is more useful. Your proposed behavior is a
departure from what we have today, and one could make a case for either
approach. I haven't heard anyone complain about up-list crossing string
boundaries.


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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