unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: emacs-devel@gnu.org
Subject: Re: locked narrowing in ELisp
Date: Wed, 17 Aug 2022 09:03:08 -0400	[thread overview]
Message-ID: <jwvfshvc9fh.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <79484704-f981-5c12-e000-333b75499520@yandex.ru> (Dmitry Gutov's message of "Wed, 17 Aug 2022 04:00:28 +0300")

>> Such a display-only narrowing might be a good alternative for many uses
>> of narrowing, but narrowing is also used quite commonly (either by the
>> end-user or in ELisp code) in order to restrict the effect of an
>> operation (like search&replace) to a particular region.
>
> Certain operations could look up the "soft narrowing" bounds and act
> accordingly, if it's implemented in the core and appropriately documented.

Could be, but unless we go through the whole C code looking for checks
of BEGV/ZV and updating the code to also check the "soft bounds" this
won't work reliably enough to replace existing uses of narrowing.

> To my understanding, there are more commands and facilities that want to
> ignore user-level narrowing, rather than the ones that want to obey it. Also
> a lot of "undecided" ones, waiting for someone to report that they should,
> in fact, ignore narrowing.

But for backward compatibility reasons, we can't break the cases that
need the bounds to be hard, even if it could fix some cases.


        Stefan




  reply	other threads:[~2022-08-17 13:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 20:18 locked narrowing in ELisp Stefan Monnier
2022-08-17  0:05 ` Dmitry Gutov
2022-08-17  0:55   ` Stefan Monnier
2022-08-17  1:00     ` Dmitry Gutov
2022-08-17 13:03       ` Stefan Monnier [this message]
2022-08-17 13:40         ` Dmitry Gutov
2022-08-17 13:55           ` Eli Zaretskii
2022-08-17 14:03             ` Dmitry Gutov
2022-08-17 14:20               ` Eli Zaretskii
2022-08-17 23:13                 ` Dmitry Gutov
2022-08-18  1:58                   ` Stefan Monnier
2022-08-18 21:42                     ` Dmitry Gutov
2022-08-18  6:25                   ` Eli Zaretskii
2022-08-18 23:10                     ` Dmitry Gutov
2022-08-19  6:31                       ` Eli Zaretskii
2022-08-22  0:59                         ` Dmitry Gutov
2022-08-17 11:44   ` Eli Zaretskii
2022-08-17 11:54     ` Dmitry Gutov
2022-08-17  5:59 ` Po Lu

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=jwvfshvc9fh.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@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 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).