unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Matthias Meulien <orontee@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 51926@debbugs.gnu.org
Subject: bug#51926: 29.0.50; Narrow to defun fails with Javascript async functions
Date: Fri, 19 Nov 2021 23:22:19 +0100	[thread overview]
Message-ID: <87v90n3hwk.fsf@gmail.com> (raw)
In-Reply-To: <87tug9kbfj.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 18 Nov 2021 11:25:36 +0100")

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Yup; I can reproduce this in Emacs 29, too.  I've poked at it now, and
> it's surprisingly difficult to fix this, due to the way these functions
> are constructed.  But I think I've got it working now in Emacs 29.

I pulled last HEAD of master which includes:

   6cad3dc75e..: Lars Ingebrigtsen 2021-11-18 Fix `narrow-to-defun' in
   "async function" in js-mode

Unfortunately it has improved but it doesn't always work as
expected. With a buffer with following content:

async function test() {
    // cursor here
}

it now works when cursor is on the first line ("async function test...")
AND not after the opening brace. After that brace, on first line or
second line, it fails...
-- 
Matthias





  parent reply	other threads:[~2021-11-19 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-17 20:11 bug#51926: 29.0.50; Narrow to defun fails with Javascript async functions Matthias Meulien
2021-11-18 10:25 ` Lars Ingebrigtsen
2021-11-18 11:30   ` Matthias Meulien
2021-11-19 22:22   ` Matthias Meulien [this message]
2021-11-20  9:21     ` Lars Ingebrigtsen

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=87v90n3hwk.fsf@gmail.com \
    --to=orontee@gmail.com \
    --cc=51926@debbugs.gnu.org \
    --cc=larsi@gnus.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).