From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: 20732@debbugs.gnu.org
Subject: bug#20732: in-string-p fails
Date: Fri, 05 Jun 2015 13:53:13 +0200 [thread overview]
Message-ID: <55718DA9.8090709@easy-emacs.de> (raw)
In-Reply-To: <55717B4E.7000900@easy-emacs.de>
Am 05.06.2015 um 12:34 schrieb Andreas Röhler:
>
> Am 05.06.2015 um 08:01 schrieb Andreas Röhler:
>>
> Meanwhile think calling "widen" here is a mistake. Rather accept
> narrowing might change the buffers state WRT in-string-p
>
> Here the corrected forms:
>
> (defun ar-in-string-p ()
> "Return position, if inside or at opening delimiter.
>
> Otherwise return nil. "
> (interactive)
> (let* ((pps (parse-partial-sexp (point-min) (point)))
> (erg (and (nth 3 pps) (nth 8 pps)))
> (la (unless erg (when (eq (char-syntax (char-after)) 34)
> (point)))))
> (setq erg (or erg la))
> (when (interactive-p) (message "%s" erg))
> erg))
>
> (defun ar-in-string-p-fast ()
> "Returns start position if inside, nil otherwise. "
> (ignore-errors (nth 8 (parse-partial-sexp (point-min) (point)))))
>
>
>
Sorry, nth 8 would be not enough:
(defun ar-in-string-p-fast ()
"Returns start position if inside, nil otherwise. "
(ignore-errors (nth 3 (parse-partial-sexp (point-min) (point)))))
next prev parent reply other threads:[~2015-06-05 11:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 9:27 bug#20732: in-string-p fails Andreas Röhler
2015-06-04 9:58 ` Dmitry Gutov
2015-06-04 11:50 ` Andreas Röhler
2015-06-04 21:06 ` Dmitry Gutov
2015-06-05 5:41 ` Andreas Röhler
2015-06-05 6:01 ` Andreas Röhler
2015-06-05 8:36 ` Dmitry Gutov
2015-06-05 8:58 ` Andreas Röhler
2015-06-05 11:17 ` Dmitry Gutov
2015-06-05 10:34 ` Andreas Röhler
2015-06-05 11:53 ` Andreas Röhler [this message]
2015-06-05 12:52 ` Andreas Röhler
2015-06-05 15:18 ` Stefan Monnier
2015-06-05 20:06 ` Dmitry Gutov
2015-06-04 16:00 ` Stefan Monnier
2015-06-04 20:59 ` Dmitry Gutov
2015-06-04 22:29 ` Stefan Monnier
2015-06-05 12:17 ` Dmitry Gutov
2015-06-05 15:19 ` Stefan Monnier
2015-06-06 9:59 ` Dmitry Gutov
2015-06-06 18:37 ` Drew Adams
2015-06-06 18:41 ` Dmitry Gutov
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=55718DA9.8090709@easy-emacs.de \
--to=andreas.roehler@easy-emacs.de \
--cc=20732@debbugs.gnu.org \
/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.