unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ikumi Keita <ikumi@ikumi.que.jp>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 41522@debbugs.gnu.org
Subject: bug#41522: 26.3; Narrowing can prevent syntax propertization
Date: Tue, 26 May 2020 02:02:15 +0900	[thread overview]
Message-ID: <9801.1590426135@localhost> (raw)
In-Reply-To: <8f0d1e94-f918-4315-d5d5-ac1ee4df3477@yandex.ru>

Hi Dmitry, thanks for your reply.

>>>>> Dmitry Gutov <dgutov@yandex.ru> writes:
> Our current stance on the matter is that, in the simple case, code
> should call syntax-ppss from "widened" state.

I suppose that this means that the code should call syntax-ppss (or
something like it) "before" narrowing is done, right? This code works
for me
----------------------------------------------------------------------
(progn (goto-char (point-max))
       (syntax-propertize (point)) ; <-
       (narrow-to-region (point) (- (point) 50))
       (syntax-ppss)
       (widen))
----------------------------------------------------------------------
while these don't:
----------------------------------------------------------------------
(progn (goto-char (point-max))
       (narrow-to-region (point) (- (point) 50))
       (syntax-ppss)
       (widen)
       (syntax-ppss) ; <-
)
----------------------------------------------------------------------
----------------------------------------------------------------------
(progn (goto-char (point-max))
       (narrow-to-region (point) (- (point) 50))
       (syntax-ppss)
       (widen)
       (syntax-propertize (point)) ; <-
)
----------------------------------------------------------------------

> And the code which doesn't should be fixed. Or if it really need to do
> that (for some reason), it should take care to handle any undesired
> sife-effects itself.

Hmm, then elisp programmers have to check whether each function used in
the code uses narrowing+syntactic functions inside it if this kind of
problem happens. I feel it a bit troublesome but at the same time I
understand it is very difficult to solve this problem cleanly.

OK, I try to be aware of this matter afterwards. Thanks for your
advice!

Regards,
Ikumi Keita





  reply	other threads:[~2020-05-25 17:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25  8:42 bug#41522: 26.3; Narrowing can prevent syntax propertization Ikumi Keita
2020-05-25 15:04 ` Dmitry Gutov
2020-05-25 17:02   ` Ikumi Keita [this message]
2020-05-25 22:12     ` 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

  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=9801.1590426135@localhost \
    --to=ikumi@ikumi.que.jp \
    --cc=41522@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /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).