all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: John Wiegley <jwiegley@gmail.com>
Cc: Alan Mackenzie <acm@muc.de>, 23019@debbugs.gnu.org
Subject: bug#23019: parse-partial-sexp doesn't output the full state needed for its continuance.
Date: Mon, 04 Apr 2016 08:15:52 -0400	[thread overview]
Message-ID: <jwvoa9p1t35.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <m2r3emgv8x.fsf@newartisans.com> (John Wiegley's message of "Sun,  03 Apr 2016 15:53:02 -0700")

>> I'd like to hear what John thinks about the idea of re-using "nth 5" instead
>> of adding a new entry, but other than that, I think it's OK to commit,
>> thanks.
> How long has this stuff been out in the field?

Many many years.

> Do you think it's well known enough that anyone is depending on the
> earlier behavior of the nth 5 value?

There are definitely packages which use the (nth 5 ..) value returned
from parse-partial-sexp.  E.g. cperl-mode does:

			    state (parse-partial-sexp pre-B p))
		      (or (nth 3 state)
			  (nth 4 state)
			  (nth 5 state)
			  (error "`%s' inside `%s' BLOCK" A if-string))
as well as

	     (let ((pps (parse-partial-sexp (point) found)))
	       (or (nth 3 pps) (nth 4 pps) (nth 5 pps)))))

and verilog-mode does:

		 (setq state (parse-partial-sexp (point) end-mod-point 0 t nil))
		 (or (> (car state) 0)	; in parens
		     (nth 5 state)		; comment
		     ))

sh-script also uses it, along with perl-mode.

> I have a feeling it's OK to re-use it.

That's also my feeling.  All the uses I've found would be unaffected
(e.g. because they're in modes where there are no 2-char comment
markers, so there is really no change in behavior; or because it's only
used at positions which can't be in the middle of a 2-char comment
marker).
It's a "natural extension" of the previous meaning of "nth 5".

But admittedly, it's hard/impossible to find all uses, so I can't claim
with confidence that it won't break some code somewhere.


        Stefan





  reply	other threads:[~2016-04-04 12:15 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15  9:13 bug#23019: parse-partial-sexp doesn't output the full state needed for its continuance Alan Mackenzie
2016-03-15  9:35 ` Andreas Röhler
2016-03-15 10:15   ` Alan Mackenzie
2016-03-15 13:38     ` Andreas Röhler
2016-03-17 12:58 ` Stefan Monnier
2016-03-17 21:49   ` Alan Mackenzie
2016-03-18  4:49     ` Stefan Monnier
2016-03-18 15:11       ` Alan Mackenzie
2016-03-18 15:22         ` Alan Mackenzie
2016-03-18 16:23         ` Stefan Monnier
2016-03-18 18:25           ` Alan Mackenzie
2016-03-18 19:36             ` Stefan Monnier
2016-03-19 17:06               ` Alan Mackenzie
2016-03-20  1:30                 ` Stefan Monnier
2016-03-20 13:41                   ` Alan Mackenzie
2016-04-03 22:53                   ` John Wiegley
2016-04-04 12:15                     ` Stefan Monnier [this message]
2016-04-05 12:54                     ` Alan Mackenzie
2016-04-05 13:50                       ` Stefan Monnier
2016-04-05 14:44                         ` Alan Mackenzie
2016-03-18 16:27     ` Stefan Monnier
2016-03-18 19:16       ` Alan Mackenzie
2016-03-18 19:40         ` Stefan Monnier

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=jwvoa9p1t35.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=23019@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=jwiegley@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.