unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Cc: Gregory Heytings <gregory@heytings.org>
Subject: Re: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing.
Date: Fri, 30 Dec 2022 11:22:12 -0500	[thread overview]
Message-ID: <jwvk028zxbs.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20221125175209.51166C004B6@vcs2.savannah.gnu.org> (Gregory Heytings's message of "Fri, 25 Nov 2022 12:52:09 -0500 (EST)")

>     Reworked locked narrowing.
>     
>     * src/editfns.c: (narrowing_locks): New alist to hold the narrowing
>     locks and their buffers.
>     (narrowing_lock_get_bound, narrowing_lock_peek_tag)
>     (narrowing_lock_push, narrowing_lock_pop): New functions to access
>     and update 'narrowing_locks'.
>     (reset_outermost_narrowings, unwind_reset_outermost_narrowing):
>     Functions moved from src/xdisp.c, and rewritten with the above
>     functions.
>     (Fwiden): Use the above functions. Update docstring.
>     (Fnarrow_to_region, Fnarrowing_lock, Fnarrowing_unlock): Use the above
>     functions.
>     (syms_of_editfns): Remove the 'narrowing-locks' variable.
>     
>     * src/lisp.h: Make 'reset_outermost_narrowings' externally visible.
>     
>     * src/xdisp.c (reset_outermost_narrowings)
>     unwind_reset_outermost_narrowing): Functions moved to src/editfns.c.
>     
>     * lisp/subr.el (with-locked-narrowing): Improved macro, with a helper
>     function.

[ Sorry for coming late.  ]
This commit (which is now on emacs-29 branch) still has some problems:

- I don't see any mention of those new features in etc/NEWS.
- I can't think of a case where a piece of code could/should make use of
  `narrowing-unlock`.
- In `nlinum--line-number-at-pos`, I want to circumvent the narrowing
  lock due to long lines (since its performance is only affected by
  buffer size but not by line length), but I can't see how to do that.
  The only primitive I see which would let me get out of the locked
  narrowing is `narrowing-unlock` but:
  - I don't know which tag(s) to use.
  - I don't want to remove the lock, I only want to circumvent it
    temporarily, and I can't see how to re-install a lock after
    removing it (`narrowing-lock` doesn't fit the bill because I don't
    know the bounds of the lock and because that would not preserve the
    stacking order of locks).


-- Stefan




           reply	other threads:[~2022-12-30 16:22 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20221125175209.51166C004B6@vcs2.savannah.gnu.org>]

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=jwvk028zxbs.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=gregory@heytings.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).