unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: 24434@debbugs.gnu.org
Subject: bug#24434: [25.1.1] parse-partial-sexp: opening delimiter missed
Date: Thu, 15 Sep 2016 08:26:30 +0200	[thread overview]
Message-ID: <16b36b2f-8991-5724-0b17-949fcaf8691c@easy-emacs.de> (raw)
In-Reply-To: <CAM-tV-85752vUR7SnDUujB6uOs8yuKWA9fUUMniwnG5qhWhPPg@mail.gmail.com>



On 14.09.2016 16:04, Noam Postavsky wrote:
> tag 24434 moreinfo
> quit
>
> On Wed, Sep 14, 2016 at 5:46 AM, Andreas Röhler
> <andreas.roehler@easy-emacs.de> wrote:
>> python-mode, problem seems not restricted to.
>>
>> When after curly bracket in example below from
>> https://docs.python.org/3/library/string.html#formatstrings
>> 6.1.3. Format String Syntax:
>>
>> str.format("Bring me a {
>>
>> depth-in-paren. i.e.
>>
>> (nth 0 (parse-partial-sexp ...))
> This bug report is a bit incomplete, what do you put for "..."?

(point-min) (point)

>
>> should indicate "2", but says "1".
>>
>> When outside a string, `{' is recognized as opener.
> I think this is correct, parse-partial-sexp detects whether it's in a
> string-literal or not. If you want to parse the contents of the string
> literal, FROM should be inside the literal.

Thanks. This works for me:

(defun in-string-interpolation-maybe ()
   (let ((pps (parse-partial-sexp (point-min) (point))))
     (and (nth 3 pps) (nth 3 (parse-partial-sexp (1+ (nth 8 pps)) 
(point))))))







  reply	other threads:[~2016-09-15  6:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14  9:46 bug#24434: [25.1.1] parse-partial-sexp: opening delimiter missed Andreas Röhler
2016-09-14 14:04 ` Noam Postavsky
2016-09-15  6:26   ` Andreas Röhler [this message]
2016-09-15 12:50     ` npostavs

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16b36b2f-8991-5724-0b17-949fcaf8691c@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=24434@debbugs.gnu.org \
    --cc=npostavs@users.sourceforge.net \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).