all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Proposal: make up-list escape strings
Date: Tue, 08 Apr 2014 18:47:04 -0700	[thread overview]
Message-ID: <5344A698.6080201@dancol.org> (raw)
In-Reply-To: <jwv61mjz4xi.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1715 bytes --]

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]

  reply	other threads:[~2014-04-09  1:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 23:14 Proposal: make up-list escape strings Daniel Colascione
2014-04-09  1:11 ` Stefan Monnier
2014-04-09  1:47   ` Daniel Colascione [this message]
2014-04-09  3:54     ` Stefan Monnier
2014-04-09  3:56     ` Stefan Monnier
2014-04-09  4:12       ` Daniel Colascione
2014-04-09  6:30         ` Daniel Colascione
2014-04-09 12:41           ` Stefan Monnier
2014-04-09 16:09             ` Daniel Colascione
2014-04-09  6:17 ` 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=5344A698.6080201@dancol.org \
    --to=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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.