GNU logs - #62333, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 21 Mar 2023 14:15:01 +0000
Resent-Message-ID: <handler.62333.B.167940806710189 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 62333 <at> debbugs.gnu.org
Cc: casouri@HIDDEN
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.167940806710189
          (code B ref -1); Tue, 21 Mar 2023 14:15:01 +0000
Received: (at submit) by debbugs.gnu.org; 21 Mar 2023 14:14:27 +0000
Received: from localhost ([127.0.0.1]:60066 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pecks-0002eG-ND
	for submit <at> debbugs.gnu.org; Tue, 21 Mar 2023 10:14:27 -0400
Received: from lists.gnu.org ([209.51.188.17]:45690)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <wkirschbaum@HIDDEN>) id 1peckr-0002e6-86
 for submit <at> debbugs.gnu.org; Tue, 21 Mar 2023 10:14:26 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <wkirschbaum@HIDDEN>)
 id 1peckr-0004vq-1n
 for bug-gnu-emacs@HIDDEN; Tue, 21 Mar 2023 10:14:25 -0400
Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <wkirschbaum@HIDDEN>)
 id 1pecko-0001ZN-5c
 for bug-gnu-emacs@HIDDEN; Tue, 21 Mar 2023 10:14:24 -0400
Received: by mail-wm1-x330.google.com with SMTP id
 bg16-20020a05600c3c9000b003eb34e21bdfso11181377wmb.0
 for <bug-gnu-emacs@HIDDEN>; Tue, 21 Mar 2023 07:14:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679408060;
 h=mime-version:message-id:date:subject:cc:to:from:user-agent:from:to
 :cc:subject:date:message-id:reply-to;
 bh=7/pbHx8xOkOr8+k+P2w86NNrFo5PIp3sHmQpfI5YDGM=;
 b=NBcYqnst2FfUpt0qBp4k/HvjAVN+8Ze8VlsGRQiLg/UYpa8O2rhr9k5Gpg2q48BH0V
 62cvTHBXYc/+NFBQ8u0U+UMZaEDIXAGSA2TF9b/kjoozvBVVLxIYkKLO0BuBq42YnFXC
 qYDsIO8U8Ugy79k+wPc989xjCk1l+D5AJYyWR33p+cxJBD1ge2ekyEopyRHFCIATZNaI
 EFWlcR+sy4RbriWfkqnRb4j7m/ULnCwR302HHn3JKujvwvJPwQFMyP7PnFAF47lJGyaX
 kSjvFHkeXWp1JIYKcQ/tTu5hsUgQFJS1N4rdE54ZSpbFfv6kM5hnqlCxqD+YyPwLFAni
 9jIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679408060;
 h=mime-version:message-id:date:subject:cc:to:from:user-agent
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=7/pbHx8xOkOr8+k+P2w86NNrFo5PIp3sHmQpfI5YDGM=;
 b=EFfLzHF3I6jfBuoJPx9uHGfgL/qSpnG7RVacEqIxFriRJ7VXzak/5AaqvKRab3Tlz9
 LF6taYtPw+Va6ih6qYT1vmWY05cr/0xxhxTY3/qBChuFTXqQCgxGF3+oKFj2w4vDLeE4
 sdVGQp+Ti5UeGZf6jWYU1mIcrcX4IF3xbLy4J8ti3UE9m8W9nvYEV80UoqcbQS6yOle3
 AOq+jTwo/wCnJiG3KFCRg4G8VbXj2ZsJlgxB0COE0/foViJUmzDUv9hmNlUrWM7C36mk
 ZL3+FZt4o3+Z3txJLvY6wv0c5m3ZT36JuMwQE9GmsvdG4Gf+utPqvoewuUUvAWJ3nuqR
 PKhg==
X-Gm-Message-State: AO0yUKXBOcS7xgCkYAGThwOLXhy4yja2LG+nLDcX2LX0Y6SSyEKaESDP
 QqPcLApGYU5jVpjN+/3po+lxheRzRoE=
X-Google-Smtp-Source: AK7set9Dk75cGsl9qMq9iYb4YPTb7pAm8uqCF9YDg+oA1FbBqVox028tYMxUryt4IwAwIP1s15aMiA==
X-Received: by 2002:a1c:f70f:0:b0:3ed:ff92:dd2a with SMTP id
 v15-20020a1cf70f000000b003edff92dd2amr2614017wmh.12.1679408059831; 
 Tue, 21 Mar 2023 07:14:19 -0700 (PDT)
Received: from melissa.local
 (ec2-13-245-158-50.af-south-1.compute.amazonaws.com. [13.245.158.50])
 by smtp.gmail.com with ESMTPSA id
 1-20020a05600c22c100b003ede06f3178sm7553935wmg.31.2023.03.21.07.14.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Mar 2023 07:14:19 -0700 (PDT)
User-agent: mu4e 1.9.3; emacs 30.0.50
From: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>
Date: Tue, 21 Mar 2023 16:00:04 +0200
Message-ID: <87fs9yur7r.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
Received-SPF: pass client-ip=2a00:1450:4864:20::330;
 envelope-from=wkirschbaum@HIDDEN; helo=mail-wm1-x330.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)


With the following text in a buffer with elixir-ts-mode:

def foo() do
end

When I delete the `)` and re-insert it, the tree-sitter syntax 
tree does
not fully recover and the `do end` part is absent when observing 
using
treesit-explore-mode.

Before removing the `)`:

(source
 (call target: (identifier)
  (arguments
   (call target: (identifier)
    (arguments ( ))))
  (do_block do end)))

after re-inserting `)`:

(source
 (call target: (identifier)
  (arguments
   (call target: (identifier)
    (arguments ( ))))))

I can see the same behaviour using ruby-ts-mode when I remove the
following expression:

(setq-local syntax-propertize-function 
#'ruby-ts--syntax-propertize)

The ruby syntax I tested with:

def foo()
end

When I add a local `syntax-propertize-function' function to 
elixir-ts-mode
it also solves the problem of not fully recovering the tree-sitter
syntax tree.  It does not seem to matter what the function 
achieves
thought, so am a bit confused.


In GNU Emacs 30.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.17.8) of 2023-03-20 built on 
 melissa.local
Repository revision: 42fba8f36b19536964d6deb6a34f3fd1c02b43dd
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --with-native-compilation=aot --with-tree-sitter 
 --with-json
 --with-pgtk'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ 
JPEG
JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY 
PDUMPER
PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF 
TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP XIM GTK3 ZLIB
Important settings:
  value of $LANG: en_ZA.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Elixir

Minor modes in effect:
  electric-pair-mode: t
  erc-notifications-mode: t
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-netsplit-mode: t
  erc-log-mode: t
  erc-services-mode: t
  erc-spelling-mode: t
  erc-match-mode: t
  erc-hl-nicks-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  erc-networks-mode: t
  display-line-numbers-mode: t
  flyspell-mode: t
  whitespace-mode: t
  global-floatpays-mode: t
  floatpays-mode: t
  marginalia-mode: t
  savehist-mode: t
  vertico-mode: t
  global-corfu-mode: t
  corfu-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  flymake-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  global-git-commit-mode: t
  shell-dirtrack-mode: t
  server-mode: t
  which-key-mode: t
  override-global-mode: t
  global-treesit-auto-mode: t
  treesit-explore-mode: t
  pixel-scroll-precision-mode: t
  repeat-mode: t
  winner-mode: t
  save-place-mode: t
  which-function-mode: t
  global-auto-revert-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/wilhelm/.config/emacs/elpa/transient-20230315.1520/transient 
hides /usr/local/share/emacs/30.0.50/lisp/transient

Features:
(shadow view emacsbug shortdoc cus-start elec-pair descr-text 
sgml-mode
facemenu ruby-ts-mode ruby-mode em-unix em-term term ehelp 
em-script
em-prompt em-pred em-ls em-hist em-glob em-extpipe em-cmpl em-dirs
em-basic em-banner em-alias esh-mode esh-var eshell esh-cmd 
esh-ext
esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
tramp-cmds tramp-archive tramp-gvfs tramp tramp-loaddefs trampver
tramp-integration tramp-compat ls-lisp cl-print consult-imenu 
c-ts-mode
pulse jka-compr help-fns radix-tree consult-xref char-fold 
heex-ts-mode
elixir-ts-mode-tests ert-x dired-aux vc-hg vc-bzr vc-src vc-sccs 
vc-cvs
vc-rcs gnus-dired diff-hl-dired erts-mode misearch multi-isearch
goto-addr files-x git-rebase magit-extras face-remap cape 
network-stream
erc-desktop-notifications erc-imenu epa-file erc-image image-dired
image-dired-tags image-dired-external image-dired-util image-mode 
exif
erc-list erc-menu erc-join erc-ring erc-pcomplete erc-track 
erc-netsplit
erc-log erc-services erc-spelling erc-match erc-hl-nicks 
erc-button
erc-fill erc-stamp erc-goodies erc erc-backend erc-networks 
erc-common
erc-compat erc-loaddefs cursor-sensor display-line-numbers 
flyspell
ispell disp-table whitespace init.el mu4e-alert time ht alert 
log4e
notifications gntp mu4e mu4e-org mu4e-main mu4e-view gnus-art 
mm-uu
mml2015 mm-view mml-smime smime dig gnus-sum gnus-group gnus-undo
gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source 
utf7 nnoo
gnus-spec gnus-int gnus-range gnus-win gnus nnheader range 
mu4e-headers
mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search 
mu4e-lists
mu4e-bookmarks mu4e-mark mu4e-message flow-fill mule-util hl-line
mu4e-contacts mu4e-update mu4e-folders mu4e-server mu4e-context
mu4e-obsolete mu4e-vars mu4e-helpers mu4e-config ido srht plz verb 
js
c-ts-common denote mastodon mastodon-toot mastodon-iso persist
mastodon-http request flycheck-package package-build
package-build-badges package-recipe package-lint finder lisp-mnt 
eat
elfeed-show elfeed-search shr pixel-fill kinsoku elfeed-csv elfeed
elfeed-curl elfeed-log elfeed-db elfeed-lib url-queue url-file 
xml-query
fontaine modus-vivendi-theme modus-themes embark-consult 
consult-vertico
consult magit-bookmark bookmark embark-org org-element org-persist 
xdg
org-id org-refile avl-tree embark ffap marginalia savehist 
orderless
vertico kind-icon svg-lib svg dom xml corfu-terminal popon corfu 
eglot
external-completion array ert debug backtrace jsonrpc posframe
yasnippet-snippets yasnippet flycheck avy org-toc org-contrib 
org-clock
ob-shell ob-elixir async ob-async org ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list
org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval
org-cycle org-table ol org-fold org-fold-core org-keys oc 
org-loaddefs
cal-menu calendar cal-loaddefs org-version org-compat org-macs 
yaml-mode
terraform-mode hcl-mode php-mode mode-local find-func speedbar 
ezimage
dframe cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles 
cc-align
php-face php php-project flymake-proc flymake cc-engine cc-vars 
cc-defs
erlang-start erlang etags fileloop generator xref project tempo 
align
mix use-package-bind-key elixir-ts-mode dockerfile-mode sh-script 
smie
executable pcmpl-args pcmpl-linux pcmpl-unix git-modes 
gitignore-mode
gitconfig-mode conf-mode gitattributes-mode diff-hl log-view 
vc-dir ewoc
vc forge-list forge-commands forge-semi forge-bitbucket buck 
forge-gogs
gogs forge-gitea gtea forge-gitlab glab forge-github ghub-graphql 
treepy
gsexp ghub url-http url-gw nsm url-auth let-alist gnutls 
forge-notify
forge-revnote forge-pullreq forge-issue forge-topic yaml 
parse-time
iso8601 bug-reference forge-post markdown-mode color forge-repo 
forge
forge-core forge-db closql emacsql-sqlite emacsql-sqlite-common 
emacsql
emacsql-compiler git-timemachine vc-git vc-dispatcher 
magit-submodule
magit-blame magit-stash magit-reflog magit-bisect magit-push 
magit-pull
magit-fetch magit-clone magit-remote magit-commit magit-sequence
magit-notes magit-worktree magit-tag magit-merge magit-branch
magit-reset magit-files magit-refs magit-status magit magit-repos
magit-apply magit-wip magit-log magit-diff smerge-mode diff 
diff-mode
git-commit log-edit message sendmail yank-media puny rfc822 mml 
mml-sec
epa epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums
mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util 
add-log
magit-core magit-autorevert magit-margin magit-transient 
magit-process
with-editor comp comp-cstr warnings rx shell pcomplete server 
magit-mode
transient magit-git magit-base magit-section format-spec crm 
compat
functions restclient advice noutline outline which-key ripgrep 
thingatpt
grep ag vc-svn compile text-property-search comint ansi-osc 
ansi-color
find-dired s dired-rainbow dired-subtree dired-hacks-utils dash 
dired
dired-loaddefs all-the-icons all-the-icons-faces data-material
data-weathericons data-octicons data-fileicons data-faicons
data-alltheicons exec-path-from-shell edmacro kmacro bind-key 
easy-mmode
use-package-ensure use-package-core finder-inf 
erc-hl-nicks-autoloads
forge-autoloads php-mode-autoloads kind-icon-autoloads 
erlang-autoloads
eat-autoloads flycheck-package-autoloads package-lint-autoloads
mastodon-autoloads persist-autoloads request-autoloads 
ripgrep-autoloads
terraform-mode-autoloads dired-subtree-autoloads 
yaml-mode-autoloads
avy-autoloads closql-autoloads srht-autoloads plz-autoloads
markdown-mode-autoloads verb-autoloads restclient-autoloads
embark-consult-autoloads embark-autoloads erc-image-autoloads
mu4e-alert-autoloads elfeed-autoloads cape-autoloads
marginalia-autoloads hcl-mode-autoloads corfu-terminal-autoloads
popon-autoloads package-build-autoloads derived yaml-autoloads
dockerfile-mode-autoloads treesit-auto-autoloads treesit-auto 
treesit
magit-autoloads pcase git-timemachine-autoloads 
emmet-mode-autoloads
ht-autoloads org-roam-autoloads magit-section-autoloads
emacsql-autoloads ag-autoloads posframe-autoloads
yasnippet-snippets-autoloads yasnippet-autoloads 
which-key-autoloads
ox-hugo-autoloads fontaine-autoloads diff-hl-autoloads
ob-async-autoloads async-autoloads all-the-icons-autoloads 
ts-autoloads
exunit-autoloads denote-autoloads f-autoloads s-autoloads
git-modes-autoloads tomelr-autoloads vertico-autoloads
flycheck-autoloads pkg-info-autoloads epl-autoloads deft-autoloads
git-commit-autoloads with-editor-autoloads ob-elixir-autoloads
pcmpl-args-autoloads consult-dir-autoloads consult-autoloads
mix-autoloads dired-rainbow-autoloads dired-hacks-utils-autoloads
orderless-autoloads dash-autoloads alert-autoloads log4e-autoloads
gntp-autoloads ghub-autoloads treepy-autoloads corfu-autoloads
org-contrib-autoloads web-mode-autoloads transient-autoloads info
compat-autoloads exec-path-from-shell-autoloads svg-lib-autoloads
package browse-url url url-proxy url-privacy url-expand 
url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util 
mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs
password-cache json map byte-opt gv bytecomp byte-compile url-vars
native cl-extra help-mode pixel-scroll cua-base subr-x repeat 
winner
ring saveplace which-func imenu autorevert filenotify cus-edit pp
cus-load icons wid-edit cl-loaddefs cl-lib early-init rmc 
iso-transl
tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win 
term/common-win
pgtk-dnd tool-bar dnd fontset image regexp-opt fringe 
tabulated-list
replace newcomment text-mode lisp-mode prog-mode register page 
tab-bar
menu-bar rfn-eshadow isearch easymenu timer select scroll-bar 
mouse
jit-lock font-lock syntax font-core term/tty-colors frame 
minibuffer
nadvice seq simple cl-generic indonesian philippine cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech 
european
ethiopic indian cyrillic chinese composite emoji-zwj charscript 
charprop
case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face 
macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable 
backquote
threads dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo gtk pgtk lcms2 multi-tty 
make-network-process
native-compile emacs)

Memory information:
((conses 16 1519596 4641956)
 (symbols 48 97383 393)
 (strings 32 400012 126802)
 (string-bytes 1 12971136)
 (vectors 16 149074)
 (vector-slots 8 4019930 2141693)
 (floats 8 1373 14870)
 (intervals 56 61927 21199)
 (buffers 984 80))




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>
Subject: bug#62333: Acknowledgement (30.0.50; Issue with tree-sitter
 syntax tree during certain changes)
Message-ID: <handler.62333.B.167940806710189.ack <at> debbugs.gnu.org>
References: <87fs9yur7r.fsf@HIDDEN>
X-Gnu-PR-Message: ack 62333
X-Gnu-PR-Package: emacs
Reply-To: 62333 <at> debbugs.gnu.org
Date: Tue, 21 Mar 2023 14:15:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 62333 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
62333: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62333
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Mar 2023 01:04:01 +0000
Resent-Message-ID: <handler.62333.B62333.16795333909208 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org
Cc: casouri@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16795333909208
          (code B ref 62333); Thu, 23 Mar 2023 01:04:01 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 01:03:10 +0000
Received: from localhost ([127.0.0.1]:36944 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pf9ME-0002OS-8D
	for submit <at> debbugs.gnu.org; Wed, 22 Mar 2023 21:03:10 -0400
Received: from mail-ed1-f41.google.com ([209.85.208.41]:34528)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pf9MC-0002OC-A7
 for 62333 <at> debbugs.gnu.org; Wed, 22 Mar 2023 21:03:08 -0400
Received: by mail-ed1-f41.google.com with SMTP id b20so47255006edd.1
 for <62333 <at> debbugs.gnu.org>; Wed, 22 Mar 2023 18:03:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679533382;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=/BpZ/NJDdRGAkkMUmss/Z2sccZx+ul/VFz3ut3vPSpM=;
 b=b/LeXdC5NF8cz2XGVXhg9nU9hXY/Eakp+qmmQjYK2V+M84R5nVKoN8ejGdumnaL85G
 UnTGp4ucHeugPHHOCm5deCGz80lF1mJLJ9cuRL/hP+o7taOeyLt7pf2167rUIzhh+Mg4
 Cz/x7S71BYR8J+J9tZ6teSfQm3dll6r9VpohZbQYqs3QKe8x/FLCIC2cG5kZMGZ/ccIy
 2zOYAwlTGdK6g4L7RgVZhftX2sSfEjUOHM7UyDeWHbG8g87E9hbHrfdj49igCG3Pyz4i
 0af1vuf79nRuf09hUj9QNs5YWeDHNumSLJUSGi13jndVV68jPYuuJSCk18jvvfcKQ6eC
 eAdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679533382;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=/BpZ/NJDdRGAkkMUmss/Z2sccZx+ul/VFz3ut3vPSpM=;
 b=FzNdYzFNaA5u9n9oR+qrD8hQmgt0wWTW+A0hpujjv/rO3ndH4F8ZoyTUFY1N99NJDG
 DEa7i5KYUJMhbDcwwEtazT/8lE/4U2GzxVUQ2bjgpynGMIvrLLb9rUFXyYIJyIl0ESiH
 z1lI1b3KiBlopGioO5GcavNcIpLCnrP5eR28bXSN6/U5Q4FAxgV8L2CnbR7doS52B5Od
 KxdH1Iq8LWarPt4p17gGk/qzwpJVxD9vCOztoK3Kvkh/QVe4xpOkp9U0sNpHzcAxX1XW
 g5twWMCCQyTcNQcHvVltqHevArXeJmh+VAWCz/3F/BfIawPvI/L/AIMsgERWd5818yYI
 yOTw==
X-Gm-Message-State: AO0yUKU7pbAcwbAO8myLiVc26jVYlFiKswjx3npTTzWg1EkU5Q8mcnk7
 +a+VTS6eMbz4PDNvGxqDykk=
X-Google-Smtp-Source: AK7set8lPiCjfUpAU+ClNfEwWmCXvlmSu6McPWhBiI4pf3Imt5Vl1iayyc9B/CVudm2esfxeAliAXQ==
X-Received: by 2002:aa7:da0a:0:b0:501:cced:9c6c with SMTP id
 r10-20020aa7da0a000000b00501cced9c6cmr7958727eds.7.1679533382100; 
 Wed, 22 Mar 2023 18:03:02 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 u22-20020a50d516000000b004ad601533a3sm8545169edi.55.2023.03.22.18.03.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Mar 2023 18:03:01 -0700 (PDT)
Message-ID: <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
Date: Thu, 23 Mar 2023 03:03:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <87fs9yur7r.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 21/03/2023 16:00, Wilhelm Kirschbaum wrote:
> 
> With the following text in a buffer with elixir-ts-mode:
> 
> def foo() do
> end
> 
> When I delete the `)` and re-insert it, the tree-sitter syntax tree does
> not fully recover and the `do end` part is absent when observing using
> treesit-explore-mode.
> 
> Before removing the `)`:
> 
> (source
> (call target: (identifier)
>   (arguments
>    (call target: (identifier)
>     (arguments ( ))))
>   (do_block do end)))
> 
> after re-inserting `)`:
> 
> (source
> (call target: (identifier)
>   (arguments
>    (call target: (identifier)
>     (arguments ( ))))))
> 
> I can see the same behaviour using ruby-ts-mode when I remove the
> following expression:
> 
> (setq-local syntax-propertize-function #'ruby-ts--syntax-propertize)
> 
> The ruby syntax I tested with:
> 
> def foo()
> end
> 
> When I add a local `syntax-propertize-function' function to elixir-ts-mode
> it also solves the problem of not fully recovering the tree-sitter
> syntax tree.  It does not seem to matter what the function achieves
> thought, so am a bit confused.

I can repro both scenarios. Except with ruby-ts-mode, the difference in 
printed AST is the added wrapping in (program ...). But the visible 
result is similar: "end" not being highlighted.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Mar 2023 03:04:01 +0000
Resent-Message-ID: <handler.62333.B62333.167954062021651 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167954062021651
          (code B ref 62333); Thu, 23 Mar 2023 03:04:01 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 03:03:40 +0000
Received: from localhost ([127.0.0.1]:37007 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfBEq-0005d9-FV
	for submit <at> debbugs.gnu.org; Wed, 22 Mar 2023 23:03:40 -0400
Received: from mail-pl1-f175.google.com ([209.85.214.175]:37613)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pfBEo-0005cu-Co
 for 62333 <at> debbugs.gnu.org; Wed, 22 Mar 2023 23:03:38 -0400
Received: by mail-pl1-f175.google.com with SMTP id o2so13674061plg.4
 for <62333 <at> debbugs.gnu.org>; Wed, 22 Mar 2023 20:03:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679540612;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=JemUBy5tdmu/V0eid1nZqffVPwNiwZavVNdpr9ueyRk=;
 b=iDuciPbhCWtoiirHa9544Lrb2IBht9C1IQ72Ooj54/nBZ9j4ZsizKRj+HeakK6Drch
 YZvq01Sb3aQm0R3i9ofzLV41SdZ9tteGe808HK2jZKeWMrzUwrp+vCwYSYFr/i9ccg1I
 t2i/ZAQ95nvNXoOCJpeyRe/nC3f3xFCGnREuwm8es58JDsdccbS+R+1M7/di6C+cnUwr
 YQVssQiodBh4Kz6XGNVbK9frqekwEBlM9uAihWgF0RUed9vVpIN6LxJYKACilx70XVGK
 lCiWBlIOPsctLIbkMLzlixIQOL+n+DkxfbFG+Waz0xnMeMPbZFsC9Q5TAD2yoecOEdm5
 KL7A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679540612;
 h=references:to:cc:in-reply-to:date:subject:mime-version:message-id
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=JemUBy5tdmu/V0eid1nZqffVPwNiwZavVNdpr9ueyRk=;
 b=RvN5gCgQAwr4+9aU3Vg9WdObsLjAnroum1FEFoq3MZDEE1vFoPZY/6dL489baLcuMG
 mE29UAv03Ri+RWO5RERn9w64UdQ5f8UT1SrMP7PFg2roDuFNPpMyp4fcPzdZdyJcPIgP
 0M1sf23d7W6Gh7xPZrjQ+ZFFRnyn855kcW7nDLUiFExEGhwRMHF5vh0U47euorizGCLY
 Q5rZumOlM4MDxD25ouCOyjaD0sUnRfTNgefXWBHTMSZVSK+yOwAUaOc373ifL0Vi/F4T
 diLI0av48G60qhObRS79CZiOpz8RtDvjQQvyfh9kt0l8YIVrahAMS8DlM6t57iloFRYm
 KRpQ==
X-Gm-Message-State: AO0yUKX5dESEtYDWAVR3t+Lc6oSqHr8IYBQYHebqnS+/WGVJXLC63TGn
 8mK2KhPUmG+yBXepL5KBEuk=
X-Google-Smtp-Source: AK7set+/uiw3rObRZAXJJZfsUVoO07ApTfZM2Ecf4rIc6cX80ycypF1gOTQpBWMJS4ioY0GrvzyZcg==
X-Received: by 2002:a05:6a20:b23:b0:d9:e45d:95cd with SMTP id
 x35-20020a056a200b2300b000d9e45d95cdmr1219730pzf.17.1679540612383; 
 Wed, 22 Mar 2023 20:03:32 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 a17-20020aa780d1000000b0062814f38d33sm3866986pfn.170.2023.03.22.20.03.31
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 22 Mar 2023 20:03:32 -0700 (PDT)
From: Yuan Fu <casouri@HIDDEN>
Message-Id: <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
Content-Type: multipart/mixed;
 boundary="Apple-Mail=_2866BD3A-595E-469D-A094-41C9C5DC1924"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
Date: Wed, 22 Mar 2023 20:03:20 -0700
In-Reply-To: <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


--Apple-Mail=_2866BD3A-595E-469D-A094-41C9C5DC1924
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8



> On Mar 22, 2023, at 6:03 PM, Dmitry Gutov <dgutov@HIDDEN> wrote:
>=20
> On 21/03/2023 16:00, Wilhelm Kirschbaum wrote:
>> With the following text in a buffer with elixir-ts-mode:
>> def foo() do
>> end
>> When I delete the `)` and re-insert it, the tree-sitter syntax tree =
does
>> not fully recover and the `do end` part is absent when observing =
using
>> treesit-explore-mode.
>> Before removing the `)`:
>> (source
>> (call target: (identifier)
>>  (arguments
>>   (call target: (identifier)
>>    (arguments ( ))))
>>  (do_block do end)))
>> after re-inserting `)`:
>> (source
>> (call target: (identifier)
>>  (arguments
>>   (call target: (identifier)
>>    (arguments ( ))))))
>> I can see the same behaviour using ruby-ts-mode when I remove the
>> following expression:
>> (setq-local syntax-propertize-function #'ruby-ts--syntax-propertize)
>> The ruby syntax I tested with:
>> def foo()
>> end
>> When I add a local `syntax-propertize-function' function to =
elixir-ts-mode
>> it also solves the problem of not fully recovering the tree-sitter
>> syntax tree.  It does not seem to matter what the function achieves
>> thought, so am a bit confused.
>=20
> I can repro both scenarios. Except with ruby-ts-mode, the difference =
in printed AST is the added wrapping in (program ...). But the visible =
result is similar: "end" not being highlighted.

The problem seems to be caused by narrowing during fontification: when =
parsing, tree-sitter sees that BUF_ZV_BYTE is smaller than it=E2=80=99s =
visible_end, and removed the part after the parenthesis from the parse =
tree. I suspect this has to do with the narrowed fontification we added =
for dealing with long lines.=20

CC=E2=80=99ed Eli because I don=E2=80=99t really know anything about the =
locked narrow thing besides that it exists. In particular, how does it =
determine when and where to narrow?


To see it in action, apply this patch, and repeat Wilhelm=E2=80=99s =
experiment: remove the =E2=80=9C)=E2=80=9D and reinsert it. You should =
see

start: 9, oend: 10, nend: 9
start: 9, oend: 10, nend: 9
start: 9, oend: 9, nend: 10
start: 9, oend: 9, nend: 10
2.5 start: 10, oend: 18, nend: 10 =E2=80=94> culprit

(Make sure to turn off electric-pair-mode to reduce noise.)

Yuan


--Apple-Mail=_2866BD3A-595E-469D-A094-41C9C5DC1924
Content-Disposition: attachment;
	filename=print.diff
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="print.diff"
Content-Transfer-Encoding: 7bit

diff --git a/src/treesit.c b/src/treesit.c
index 5a4fe3e8803..9b46dcef2d1 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -806,6 +806,7 @@ treesit_record_change (ptrdiff_t start_byte, ptrdiff_t old_end_byte,
 	  eassert (start_offset <= old_end_offset);
 	  eassert (start_offset <= new_end_offset);
 
+	  printf("start: %ld, oend: %ld, nend: %ld\n", start_offset, old_end_offset, new_end_offset);
 	  treesit_tree_edit_1 (tree, start_offset, old_end_offset,
 			       new_end_offset);
 	  XTS_PARSER (lisp_parser)->need_reparse = true;
@@ -925,6 +926,7 @@ treesit_sync_visible_region (Lisp_Object parser)
   if (visible_beg > BUF_BEGV_BYTE (buffer))
     {
       /* Tree-sitter sees: insert at the beginning.  */
+      printf("1 start: %d, oend: %d, nend: %ld\n", 0, 0, visible_beg - BUF_BEGV_BYTE (buffer));
       treesit_tree_edit_1 (tree, 0, 0, visible_beg - BUF_BEGV_BYTE (buffer));
       visible_beg = BUF_BEGV_BYTE (buffer);
       eassert (visible_beg <= visible_end);
@@ -933,6 +935,9 @@ treesit_sync_visible_region (Lisp_Object parser)
   if (visible_end < BUF_ZV_BYTE (buffer))
     {
       /* Tree-sitter sees: insert at the end.  */
+      printf("2 start: %ld, oend: %ld, nend: %ld\n", visible_end - visible_beg,
+	     visible_end - visible_beg,
+	     BUF_ZV_BYTE (buffer) - visible_beg);
       treesit_tree_edit_1 (tree, visible_end - visible_beg,
 			   visible_end - visible_beg,
 			   BUF_ZV_BYTE (buffer) - visible_beg);
@@ -942,6 +947,9 @@ treesit_sync_visible_region (Lisp_Object parser)
   else if (visible_end > BUF_ZV_BYTE (buffer))
     {
       /* Tree-sitter sees: delete at the end.  */
+      printf("2.5 start: %ld, oend: %ld, nend: %ld\n", BUF_ZV_BYTE (buffer) - visible_beg,
+			   visible_end - visible_beg,
+			   BUF_ZV_BYTE (buffer) - visible_beg);
       treesit_tree_edit_1 (tree, BUF_ZV_BYTE (buffer) - visible_beg,
 			   visible_end - visible_beg,
 			   BUF_ZV_BYTE (buffer) - visible_beg);
@@ -952,6 +960,7 @@ treesit_sync_visible_region (Lisp_Object parser)
   if (visible_beg < BUF_BEGV_BYTE (buffer))
     {
       /* Tree-sitter sees: delete at the beginning.  */
+      printf("3 start: %d, oend: %ld, nend: %d\n", 0, BUF_BEGV_BYTE (buffer) - visible_beg, 0);
       treesit_tree_edit_1 (tree, 0, BUF_BEGV_BYTE (buffer) - visible_beg, 0);
       visible_beg = BUF_BEGV_BYTE (buffer);
       eassert (visible_beg <= visible_end);

--Apple-Mail=_2866BD3A-595E-469D-A094-41C9C5DC1924--




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Mar 2023 04:21:02 +0000
Resent-Message-ID: <handler.62333.B62333.167954522929905 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167954522929905
          (code B ref 62333); Thu, 23 Mar 2023 04:21:02 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 04:20:29 +0000
Received: from localhost ([127.0.0.1]:37042 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfCRB-0007mH-CC
	for submit <at> debbugs.gnu.org; Thu, 23 Mar 2023 00:20:29 -0400
Received: from mail-ed1-f54.google.com ([209.85.208.54]:44946)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pfCR9-0007m5-Mw
 for 62333 <at> debbugs.gnu.org; Thu, 23 Mar 2023 00:20:28 -0400
Received: by mail-ed1-f54.google.com with SMTP id eh3so81387682edb.11
 for <62333 <at> debbugs.gnu.org>; Wed, 22 Mar 2023 21:20:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679545221;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=nvrROjsBWzzhFsK8992ZQO2kSBzyKKW/gY9Ggsl5Cew=;
 b=L0yIcjZtIMtXhBAktOQdDnlgkGvzbNyCb9MXuM9jLZ2pFpS0dlruaH6C8e6xgPpRGv
 L5+iBI5H224kd9SUAbt0CCbCKq4rV6GVPvICjLWF4RYtIIvlWHQUJi6BCJxKY7psVBA5
 fGZRUpKF9sRpbFYRnEy/ow1QrpE+fxUudAU1oVo8Gotqn+eGMgvvpSy2fSLWCTdP6pJ3
 J0Yblx2hQJtNbraOGEF84X/ffMWweWxSNKX3DGiWws/rM/VlsA4mSwNJjyBKLojyKW/l
 Ybg8pQ3qwpaSrMnazk9jsAPj91JuE6h2VxwykVtqF1qpDygFBl/SVJyJfPhPLxMf8NlN
 GWxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679545221;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=nvrROjsBWzzhFsK8992ZQO2kSBzyKKW/gY9Ggsl5Cew=;
 b=HiOrEpkSnilKHDeKYfj99VUMkR7L02cnpjebRCCeTjM/7nh9SC58jehAHnFspI4YYa
 6Z+e3JZrS+bMbcJijGTpYyLko4/5Etvh1b4eRREYfcC8iPQCHOpjBtpfmdp/c8kwm+x4
 TukyGnvtGGPO4Octxhon6pkTQXT4+wGKePZ23yXjxCzP1lxa3+4LrmWTd9xLk/qCULOX
 onxAdSoIXtgi28O19GX8Xs4POm/O2qJYY6MLUPrHoWXBVb42LBhqWSnNEA2Oo3KX26eo
 qQYk7FBlrQhRak1LMosbTH53+7zOY/vRaPfkE/sGO0cc8wk+JjZ/0M15sIY2P4uin0Oc
 046w==
X-Gm-Message-State: AO0yUKVjRf1iht/bunJsCny9AhbK4rqYSSN28GaQzkkY4VaEAQ964qlK
 68gcJqIpJ6M8wczboQzXDB4=
X-Google-Smtp-Source: AK7set83S9MJCijrTkqlIqEmQgwVIBxsZeDED0LKOctRbwJibU2ChLf7xRYDtW3SWaKSg2cEjNBOJw==
X-Received: by 2002:aa7:cfce:0:b0:500:2e94:26aa with SMTP id
 r14-20020aa7cfce000000b005002e9426aamr9190310edy.20.1679545221236; 
 Wed, 22 Mar 2023 21:20:21 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 d28-20020a50cd5c000000b004fbdfbb5acesm8627444edj.89.2023.03.22.21.20.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 22 Mar 2023 21:20:20 -0700 (PDT)
Message-ID: <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN>
Date: Thu, 23 Mar 2023 06:20:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 23/03/2023 05:03, Yuan Fu wrote:
> I suspect this has to do with the narrowed fontification we added for dealing with long lines.

I'm pretty sure that one should only get used when the buffer contains a 
line longer than 10000 characters.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Mar 2023 07:14:02 +0000
Resent-Message-ID: <handler.62333.B62333.16795556012812 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: casouri@HIDDEN, Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16795556012812
          (code B ref 62333); Thu, 23 Mar 2023 07:14:02 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 07:13:21 +0000
Received: from localhost ([127.0.0.1]:37186 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfF8S-0000jI-T9
	for submit <at> debbugs.gnu.org; Thu, 23 Mar 2023 03:13:21 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41760)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pfF8Q-0000j4-R8
 for 62333 <at> debbugs.gnu.org; Thu, 23 Mar 2023 03:13:19 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pfF8J-0007wj-TT; Thu, 23 Mar 2023 03:13:13 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=79rN7AN1uPlf1t2F39wMNUPWhOIuVYMiD/MVgsLFm5I=; b=b6VVScgx+ZAh
 POI8pveIMm8e810byzPaVjUI6GdrfriT6B18805WGtHmNNUlsT3YLQyqvHExIrcqd1im6L6y/kkyY
 rgvBI58r4g2ipfeme+NXE3vr/8Ca27Vw8rUz/f16KOr54K7hlkQ0zZj0HmzcD2TpYIKdekZCNsUIT
 Ks24nQh+m/x+ZQ9GnFmW0Lmy46Aq2hew3CAPh3GpGxfQfgYj7XDjNk9pXeiQIBmS1AcY8wYnHBLj2
 BY8M/6Vr1Xrxs/xANzmOzkIg46timPaWQQsLo+MF5kMRMUzTK7Fkcnkuy20lwngOLuhkLHesowV+5
 tauYzoHSL9TzGwpFRMXuxw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pfF8J-0002kF-CH; Thu, 23 Mar 2023 03:13:11 -0400
Date: Thu, 23 Mar 2023 09:13:28 +0200
Message-Id: <83h6uc549z.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> (message from
 Dmitry Gutov on Thu, 23 Mar 2023 06:20:19 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 23 Mar 2023 06:20:19 +0200
> Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org,
>  Eli Zaretskii <eliz@HIDDEN>
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 23/03/2023 05:03, Yuan Fu wrote:
> > I suspect this has to do with the narrowed fontification we added for dealing with long lines.
> 
> I'm pretty sure that one should only get used when the buffer contains a 
> line longer than 10000 characters.

Yes (but I believe the threshold is 50K characters).

The narrowing must come from somewhere else.  Yuan, how did you see
that ZV was changed?  Can you run with a breakpoint in
Fnarrow_to_region, and see which Lisp code does that?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Mar 2023 21:20:02 +0000
Resent-Message-ID: <handler.62333.B62333.167960635022230 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167960635022230
          (code B ref 62333); Thu, 23 Mar 2023 21:20:02 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 21:19:10 +0000
Received: from localhost ([127.0.0.1]:39446 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfSL0-0005mU-I5
	for submit <at> debbugs.gnu.org; Thu, 23 Mar 2023 17:19:10 -0400
Received: from mail-pj1-f51.google.com ([209.85.216.51]:53190)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pfSKy-0005mG-4r
 for 62333 <at> debbugs.gnu.org; Thu, 23 Mar 2023 17:19:08 -0400
Received: by mail-pj1-f51.google.com with SMTP id x15so12273119pjk.2
 for <62333 <at> debbugs.gnu.org>; Thu, 23 Mar 2023 14:19:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679606342;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=KXa8RovKoh5sPtGQyE+wXwiEl9IaRPgt4djSDaN9bMY=;
 b=GuV4lwM7lJgHgdoyyp63Gxn6etrABVOcHoXv0BukYK3AdQhLbfBI74IsBNQ01GhAwj
 RcZMOK+HlzC+bT669xBsxFJs5Rdau6gQEuer19cYSLQl6m2YvMdl0LKrJiS6lRiST8ot
 +0VdsmsdORxoZy1YKaSA4ufPMA0p2wJAD6mgtb7b3oYhNcbWiK9tIX5AG7cdcxgDrqua
 i6giqyXt6o2v4gIi736gy83jKfTtkpNQES1x2xIWM9E+BamPmTP7+3PNmXwhL7lkCjPr
 LZfVLJ5ZdRGCGGLguL7v+NXUezIkAB6D+YSU42B7ogrR0SrcSfwmxMPweMbWmNUqPt0Y
 BEsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679606342;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=KXa8RovKoh5sPtGQyE+wXwiEl9IaRPgt4djSDaN9bMY=;
 b=uwomvGT9Q5iskrMLU2WQTvyvOBMZM4cq17/L6FIVgM2B4Qooosf2q0jb64wwMS7mC/
 QgHFhINgaGGUW/gsexsE7Cc8YfjD8fOfPloMCU625AP2LXIW8jNLYrVukARSNXhwNHdb
 sJpIz5/PtCp42D90mUHGKfmMZPqpWY6cGMAx6DGAGZCunSMR34Stpyjl9WtI4pji3rJX
 w+tNNaQeelSKgQORIxEmUkM3z3oBXpFpbZ6VGYKb8MAGQRr1PdVmFglxEaARqGiYvXZo
 N8sVMHziEjuisJeyZY21oGicHoEdYiEpYjEov5E4k66s11Emw8maA5tm6M21EQal6qav
 x8XA==
X-Gm-Message-State: AAQBX9eJYJTo60ol9ipfzjb0spX9NDr2ziBX0PY4UyEh0b8kZ2iL5PXz
 VayZRlWWebhGZ95S1L3JOAM=
X-Google-Smtp-Source: AKy350Z397AZ6o7pbLdVKsUeR2vjAdUDxW8RZdp7IzGLgJZnv2VIQw/77AKXKH07cd7rDUjuDQzRxA==
X-Received: by 2002:a17:90b:4c52:b0:23b:4376:f8cb with SMTP id
 np18-20020a17090b4c5200b0023b4376f8cbmr338245pjb.26.1679606342337; 
 Thu, 23 Mar 2023 14:19:02 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 gl17-20020a17090b121100b00231227781d5sm1750791pjb.2.2023.03.23.14.19.01
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 23 Mar 2023 14:19:02 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83h6uc549z.fsf@HIDDEN>
Date: Thu, 23 Mar 2023 14:18:50 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Mar 23, 2023, at 12:13 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> Date: Thu, 23 Mar 2023 06:20:19 +0200
>> Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, =
62333 <at> debbugs.gnu.org,
>> Eli Zaretskii <eliz@HIDDEN>
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>=20
>> On 23/03/2023 05:03, Yuan Fu wrote:
>>> I suspect this has to do with the narrowed fontification we added =
for dealing with long lines.
>>=20
>> I'm pretty sure that one should only get used when the buffer =
contains a=20
>> line longer than 10000 characters.
>=20
> Yes (but I believe the threshold is 50K characters).
>=20
> The narrowing must come from somewhere else.  Yuan, how did you see
> that ZV was changed?  Can you run with a breakpoint in
> Fnarrow_to_region, and see which Lisp code does that?

I did that, some observations:

1. This doesn=E2=80=99t reproduce on Linux (it does on Mac).
2. The function that narrowed the region is blink-matching-open
3. If I (advice-add 'blink-matching-open :around #=E2=80=99ignore) on my =
Mac, it =E2=80=9Csolves=E2=80=9D the problem

I guess the question now is why redisplay is triggered in =
blink-matching-open on Mac?

Yuan=




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Mar 2023 21:31:02 +0000
Resent-Message-ID: <handler.62333.B62333.167960704623592 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167960704623592
          (code B ref 62333); Thu, 23 Mar 2023 21:31:02 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 21:30:46 +0000
Received: from localhost ([127.0.0.1]:39465 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfSWD-00068R-Pz
	for submit <at> debbugs.gnu.org; Thu, 23 Mar 2023 17:30:45 -0400
Received: from mail-ed1-f47.google.com ([209.85.208.47]:39555)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pfSWC-00068C-15
 for 62333 <at> debbugs.gnu.org; Thu, 23 Mar 2023 17:30:44 -0400
Received: by mail-ed1-f47.google.com with SMTP id ek18so559111edb.6
 for <62333 <at> debbugs.gnu.org>; Thu, 23 Mar 2023 14:30:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679607038;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=komLahMXPXPoKU24I5g2ZTTywXpt0g6YD05lbxlPB88=;
 b=YOKpKHLKTpKj+0r/SyzAN7fErFKBOdmVKIqjDg1FgY9Y81HagET3VVQPWLI5pyFAjm
 B2BzTneANsty0kWlW5f2SuEhvOkApqLtfRCuXfVDqaO7Fzkb9hqgqjLQce2a8IXZqBf1
 bFvwesyD53j8CnXm8KMNpfggiAHzPfywiR/pbD9QuWASx3L5bTWT5/tAEXg8QYWPYxXj
 xbfc18lCPbZ6m7hS+qMeRmAtVlFlVGvxlU6/kp4XXubJAKEoedvpdYaF1GvIXXjDOxl2
 W/MtY3SURM+29PaxZ1bNu1tADGd5FysxzlOZ18i35pQzcopyVu5SJtYNjbA+oA5YdxH8
 snNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679607038;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=komLahMXPXPoKU24I5g2ZTTywXpt0g6YD05lbxlPB88=;
 b=ZW65RtVzXwQh/bjpwokAa9lyzDf45mZMCz/JY95uHJ/Q1vO5gnt7NHKC9zbRGBhzR4
 9jNE59qr83xH2KRw4c00V4LvZwQ1WwGgRhHdGGv+dZQNnXnLxImg77RjsHZZ8rD49b8w
 UljSMfsCiTV2YenKLXEiZCyPWfAtNol0taz38qp2PZNK1F5ED+FRRQ/jZ+mGQiBpgYx0
 F6ay2PI4r8C4vrp/ztMaYkxxH0Ijemdh7u/Y49Po0D3RI+v4ekL3LZBMa9PGZjqcxFu+
 WxyvWZ0/94WtLetq0D0YDX519r176tyMh1UktqQTQw7f0oWYbkusovIwU9lV1or1dK56
 5eag==
X-Gm-Message-State: AAQBX9fLk5yZhjL8hHl4ltV2wXLmesFEkGKSXcdrUpi3GTDRvOzzzWtY
 Tb+pju7wOek7g5T4H1HL2yE=
X-Google-Smtp-Source: AKy350aB0HmFBbfvco5OVWYdmsBYKSCFXsE3WFzv/z/7WIkng165/RMygsCkxGc14mUSCqD56FV+8A==
X-Received: by 2002:a05:6402:74a:b0:4fc:e605:556a with SMTP id
 p10-20020a056402074a00b004fce605556amr772592edy.5.1679607037849; 
 Thu, 23 Mar 2023 14:30:37 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 x2-20020a50ba82000000b004fb30fc1dabsm9611293ede.96.2023.03.23.14.30.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Mar 2023 14:30:37 -0700 (PDT)
Message-ID: <85a18b39-1dac-ccaf-d7e9-3f644deb8fb9@HIDDEN>
Date: Thu, 23 Mar 2023 23:30:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 23/03/2023 23:18, Yuan Fu wrote:
> 1. This doesn’t reproduce on Linux (it does on Mac).

It does reproduce on my Linux machine, though.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Mar 2023 22:08:02 +0000
Resent-Message-ID: <handler.62333.B62333.167960927327468 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167960927327468
          (code B ref 62333); Thu, 23 Mar 2023 22:08:02 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 22:07:53 +0000
Received: from localhost ([127.0.0.1]:39506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfT66-00078v-1h
	for submit <at> debbugs.gnu.org; Thu, 23 Mar 2023 18:07:53 -0400
Received: from mail-ed1-f49.google.com ([209.85.208.49]:43000)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pfT5f-00078H-8e
 for 62333 <at> debbugs.gnu.org; Thu, 23 Mar 2023 18:07:48 -0400
Received: by mail-ed1-f49.google.com with SMTP id o12so786516edb.9
 for <62333 <at> debbugs.gnu.org>; Thu, 23 Mar 2023 15:07:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679609227;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=PtzQMz/O/R6W9L67nqiUN/ivaYGMXlMnmN3Q/g8tbxQ=;
 b=qKplix6FMXGaqmKTqdKEnPacYeArCFvybNgxSdbun3/PCEGMX/anJhxYXYuGYr1fzL
 yRzDWDdxYrlxkEsyHlFUbMf9G/UjgPmKxJIP4tt2NZjhqix36Xvfrn9NX7gDnzMHiTdt
 x49sp7dTluXxbNbOTE+PpnxozMaQBoAUKPAGpJ7PFv0IICDK6oqv4aM9iss13NPmwYXU
 BDD4A3CSs+CYwmasSp//8ptdVteepB3l+AXBfgGJiL2RyiRv09+HQmw6ukSn4tpLtAMH
 ZEtXkK/FXbCPRQb5c4k0QAL+QJwKqL7mIQuwH1ic3AoxLJst0A41/x43r7vR6hEJTs55
 ZhmQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679609227;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=PtzQMz/O/R6W9L67nqiUN/ivaYGMXlMnmN3Q/g8tbxQ=;
 b=5yqp72i4eB8aLgOpCjheoaeKXjf8j9SODMRoabAUgdsbpQX5vpezwv6DqJ6jWcaOC9
 w3bF8OPvpwjW5AcD5KBBUOcf96IHPZpv2/t+YPeJX1LrT9+IW87kp4t6HkyNcFLrcmKI
 8iuCXlNBEmEpZPG/1CscNuRhrbn64fBR6C2nbjJGQxmGdQOgr8kzz6cobnFSSNKJK1b/
 MrHjZPGs/PNNWEUE2Ho9JKHK63adhI4R5TecnGPIv7ckXSKA2OgLXgaNoFRwRSFifEJN
 KCJzKt7TBxpy8dGvib3kLiIvbeeIwvvoTvW68bJYF/L2Ot8Fv4hKmQ/Uu3UpSIrg7uNN
 selw==
X-Gm-Message-State: AAQBX9ciRZlSDRf6jQRy96AUL0FAm5zvqAlSy7En3xVXbm97SOxMdzZx
 2HQv/tn7VPl8M4ryA4jrTLE=
X-Google-Smtp-Source: AKy350bnCB2cqI/Q9K5RY7EtddOKag/5Bc/YY+pWgiLV0MW7/MXNlbUNcsUkt/8uz5IMI2ZenegkTA==
X-Received: by 2002:aa7:c646:0:b0:4a0:e305:a0de with SMTP id
 z6-20020aa7c646000000b004a0e305a0demr1049903edr.19.1679609221988; 
 Thu, 23 Mar 2023 15:07:01 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 u6-20020a50d506000000b004fd2aab4953sm9819859edi.45.2023.03.23.15.06.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 23 Mar 2023 15:07:01 -0700 (PDT)
Message-ID: <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
Date: Fri, 24 Mar 2023 00:06:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 23/03/2023 23:18, Yuan Fu wrote:
> I guess the question now is why redisplay is triggered in blink-matching-open

blink-matching-open calls sit-for after adjusting overlays.

sit-for starts with a redisplay.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 24 Mar 2023 00:00:02 +0000
Resent-Message-ID: <handler.62333.B62333.16796159955154 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16796159955154
          (code B ref 62333); Fri, 24 Mar 2023 00:00:02 +0000
Received: (at 62333) by debbugs.gnu.org; 23 Mar 2023 23:59:55 +0000
Received: from localhost ([127.0.0.1]:39541 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfUqZ-0001L4-Cq
	for submit <at> debbugs.gnu.org; Thu, 23 Mar 2023 19:59:55 -0400
Received: from mail-pj1-f41.google.com ([209.85.216.41]:33487)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pfUqW-0001Ko-UW
 for 62333 <at> debbugs.gnu.org; Thu, 23 Mar 2023 19:59:53 -0400
Received: by mail-pj1-f41.google.com with SMTP id
 p13-20020a17090a284d00b0023d2e945aebso4614123pjf.0
 for <62333 <at> debbugs.gnu.org>; Thu, 23 Mar 2023 16:59:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679615982;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=NbSU9BJH6Y8Y7VcJzMt9iv0nvPXUwjffxHK5epkbJRs=;
 b=VfLSP1whLUGiyg1A9aDhuXyBEogH8TkuGlb6ZMdJO6mlNXwUwCJEUlIg0hLaJtdPgj
 hYJPGmpY91zq7nMoSHqVCYKsdysh+KA2ci2o04fWqNo7htD7wWBB8r/Z3nqrcC3q/IkT
 ud4X8Y6j4RV6cV6E1KSGPw7eoyCMwJ7sfMei4fbmQPKmpC8OD/X+mnj3LE0APMeen8DU
 JmVfzPGCwP64wXvvsaPJpNFwTYNeA4K8ydRmKhQ6Z9ITITuU40/fsEe90AlohjtnT+zn
 96aO/7km5DlRbtwR6xNuu0qS1QTIj4eDh0px80El2P9x/Qr3IN5HkGEarslnUDRBihgg
 jvDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679615982;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=NbSU9BJH6Y8Y7VcJzMt9iv0nvPXUwjffxHK5epkbJRs=;
 b=M9j1gLctIRlw/d/y3rHydbekK/w2dINeAZyiC+AOZZxgK6uzCutlGNuXCWyfXt0z0S
 H2KIRjtiUFvCpjL0mdpHCveT3OrkVawGNkN0FVVvproV2YegvjKPROvMdC2J+rgtPMD1
 lsSernfjaOTuE01ikTLYY07sADc+i9HyQrry/lLRSK8ZWZzGxTxmjzxiiYoem4hyYOKo
 QFox7iAbIrUcxgEaukMxfYCLnqP+uM7oUcagi3wL0bkoLg5GBuiCDPsM63QLjnthmvmg
 B5m8dmg/1eGvKbfp/Nafo400nImh2bDF5imOPMFM3Kf5QVTc0sp2H9h0ctAJAfKErqi/
 8ndg==
X-Gm-Message-State: AAQBX9cMrlmWa5sAantte2AU6l30OBMP8nVQl8OSYuhfhKGup1l0TjKC
 T3NmKUax9/109wZRlsWVR8Y=
X-Google-Smtp-Source: AKy350YZsR+LbIKWHhFXnoMUeOg0aTno24GHPgzPCbEvRFROAuywQhunhMKMAKPIVdsB6pST7sOKuA==
X-Received: by 2002:a17:90a:301:b0:23f:81c0:eadd with SMTP id
 1-20020a17090a030100b0023f81c0eaddmr626644pje.47.1679615979981; 
 Thu, 23 Mar 2023 16:59:39 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 l9-20020a17090b078900b0023b4c0ef8f2sm1835508pjz.20.2023.03.23.16.59.39
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 23 Mar 2023 16:59:39 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
Date: Thu, 23 Mar 2023 16:59:28 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Mar 23, 2023, at 3:06 PM, Dmitry Gutov <dgutov@HIDDEN> wrote:
>=20
> On 23/03/2023 23:18, Yuan Fu wrote:
>> I guess the question now is why redisplay is triggered in =
blink-matching-open
>=20
> blink-matching-open calls sit-for after adjusting overlays.
>=20
> sit-for starts with a redisplay.

But it=E2=80=99s not called when narrow-to-region is in effect.

Yuan=




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 24 Mar 2023 06:07:01 +0000
Resent-Message-ID: <handler.62333.B62333.167963796711377 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>
Cc: wkirschbaum@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167963796711377
          (code B ref 62333); Fri, 24 Mar 2023 06:07:01 +0000
Received: (at 62333) by debbugs.gnu.org; 24 Mar 2023 06:06:07 +0000
Received: from localhost ([127.0.0.1]:39686 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pfaYw-0002xP-RU
	for submit <at> debbugs.gnu.org; Fri, 24 Mar 2023 02:06:07 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33764)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pfaYt-0002wp-1F
 for 62333 <at> debbugs.gnu.org; Fri, 24 Mar 2023 02:06:05 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pfaYm-0005Xl-9o; Fri, 24 Mar 2023 02:05:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=NDWAt2PTxsVZ8JzPyvRF3pr+pG503YI3TPlWw9ows1I=; b=V9e+LvFJnF1l5wrNWiHs
 ZTVo2KcSuoE5KEnexNhAOQsipzWrnQ9um/PWFg30kbZsNB4cz7nck+Db6U9qVkQ0nBtfysOCRA7Vj
 fT4nZLYnr5iM43gvAdXExF3cnuPig+zqEOUogEJhC9I7GkAo27jSvLtf03S293h9794Fykzp82/oC
 gxh1dYNcL+BGFTDCjOPcKG8S0P7I1fgf/XtT24C+GOahCiJVWwlgDptqtmABiU1/jzmv2uN+KZSh7
 4/SYrFdASxk5pNwsEsKlv3x1UG3ttJN8KTcZCWgkzh0vjVfNsrbQOPcqOhSQLBrAI2ywSh3Y6TaQ+
 1jBojakjHK+U3Q==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pfaYf-0002zv-Ug; Fri, 24 Mar 2023 02:05:56 -0400
Date: Fri, 24 Mar 2023 09:05:48 +0300
Message-Id: <83sfduelab.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> (message from
 Yuan Fu on Thu, 23 Mar 2023 16:59:28 -0700)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Thu, 23 Mar 2023 16:59:28 -0700
> Cc: Eli Zaretskii <eliz@HIDDEN>,
>  Wilhelm Kirschbaum <wkirschbaum@HIDDEN>,
>  62333 <at> debbugs.gnu.org
> 
> > On Mar 23, 2023, at 3:06 PM, Dmitry Gutov <dgutov@HIDDEN> wrote:
> > 
> > On 23/03/2023 23:18, Yuan Fu wrote:
> >> I guess the question now is why redisplay is triggered in blink-matching-open
> > 
> > blink-matching-open calls sit-for after adjusting overlays.
> > 
> > sit-for starts with a redisplay.
> 
> But it’s not called when narrow-to-region is in effect.

Exactly.  So the question is now: why does treesit.c see ZV changed,
if by the time it is supposed to be called from redisplay the
restriction is restored?

Is the problematic code in treesit.c really called from redisplay
triggered by sit-for in blink-matching-open?  Can you show the C and
Lisp backtrace from the call that "sees that BUF_ZV_BYTE is smaller
than its visible_end"?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 24 Mar 2023 17:30:02 +0000
Resent-Message-ID: <handler.62333.B62333.167967898831265 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167967898831265
          (code B ref 62333); Fri, 24 Mar 2023 17:30:02 +0000
Received: (at 62333) by debbugs.gnu.org; 24 Mar 2023 17:29:48 +0000
Received: from localhost ([127.0.0.1]:41293 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pflEa-00088D-2a
	for submit <at> debbugs.gnu.org; Fri, 24 Mar 2023 13:29:48 -0400
Received: from mail-oa1-f46.google.com ([209.85.160.46]:40476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pflEY-000880-AN
 for 62333 <at> debbugs.gnu.org; Fri, 24 Mar 2023 13:29:46 -0400
Received: by mail-oa1-f46.google.com with SMTP id
 586e51a60fabf-177b78067ffso2429329fac.7
 for <62333 <at> debbugs.gnu.org>; Fri, 24 Mar 2023 10:29:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679678980;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=0wh8vtLxCD59fYLdcRR50zDpjMDB2oYF7D7a45ram7s=;
 b=MrhzNWTDG38zh8R9BgIgUT0Yeohf3ROoeceW8NePQ1d9ZHl1gMv6C6GDkIsD7qjC61
 knvvIAhIIbi0kM7SaX9DKAQ9PC3EZ0xgwhGuYE9Z47rAbzANROF9l2SotMAuLYtKqqU9
 yMPoKy1K0kOFJ8Hnqo0PZxPq7gMAWy3rR83p0KpAqEw3qJ2RP4APTHxsTPEyY0Xkj89/
 8nWzSGgqsNm46cxld6pc/fD87fJCss1VIA0pAnuRmEX29dwZNOoywXBWmuC0HlmfSgqJ
 6AhG3gvAE6zMCYRZ/66I5ZjS7VWaoC5UzcnwLdoe68+hCgZCAU2oEpq40lncFI5NJ785
 I1Rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679678980;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=0wh8vtLxCD59fYLdcRR50zDpjMDB2oYF7D7a45ram7s=;
 b=K2XOHXC/CzNtRKuf1Pi0+7/otu7mlFA6NySoj7YmJ3ndfKoGojvCPFfTVD9EBq9eZj
 Vk86F92ngSb3v+8loQVASHrg5ZtDHw5qDBFMMJ5qacBu+wocAlfjKMSXdEQgQWG+r6zU
 0/hJQi6V+0SvB6uDWDHlqhHtG0NnO37oveHKf01By/VH040wPDPEWcvqAxdT6ZW57zNx
 bm+L8pKyNoD395sUA+ovZpRtVut3VC+bZKmEvoT82MkOUzIpXdGdDatcY+88XZaSh5SP
 o1bzxlIaQanpz45TuZZewivRBfRHBf+gTB0mKoxyREvlx6QZ4vvzCuP0oMOtMjqIyMVc
 fneg==
X-Gm-Message-State: AAQBX9fEuKCp7sKYw9vdVdb16C/jOD8vcip0OWTcgh/U+nUsZA9dMC2Q
 Cb2QHhwFZC7nzihmHK59SpqnsUb4ZrM=
X-Google-Smtp-Source: AKy350YKwyZR8UQBJR1rqpYW4lLU+Yn2NY3Yby7gpgsEf3GUxpYnYnVjSp1FDUUvr0eqEh5QD5ASzA==
X-Received: by 2002:a17:902:fa0c:b0:1a0:6690:d3d1 with SMTP id
 la12-20020a170902fa0c00b001a06690d3d1mr1406833plb.6.1679643309917; 
 Fri, 24 Mar 2023 00:35:09 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 p6-20020a1709028a8600b00194c2f78581sm13496621plo.199.2023.03.24.00.35.08
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 24 Mar 2023 00:35:09 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83sfduelab.fsf@HIDDEN>
Date: Fri, 24 Mar 2023 00:34:58 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Mar 23, 2023, at 11:05 PM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Thu, 23 Mar 2023 16:59:28 -0700
>> Cc: Eli Zaretskii <eliz@HIDDEN>,
>> Wilhelm Kirschbaum <wkirschbaum@HIDDEN>,
>> 62333 <at> debbugs.gnu.org
>>=20
>>> On Mar 23, 2023, at 3:06 PM, Dmitry Gutov <dgutov@HIDDEN> wrote:
>>>=20
>>> On 23/03/2023 23:18, Yuan Fu wrote:
>>>> I guess the question now is why redisplay is triggered in =
blink-matching-open
>>>=20
>>> blink-matching-open calls sit-for after adjusting overlays.
>>>=20
>>> sit-for starts with a redisplay.
>>=20
>> But it=E2=80=99s not called when narrow-to-region is in effect.
>=20
> Exactly.  So the question is now: why does treesit.c see ZV changed,
> if by the time it is supposed to be called from redisplay the
> restriction is restored?
>=20
> Is the problematic code in treesit.c really called from redisplay
> triggered by sit-for in blink-matching-open?  Can you show the C and
> Lisp backtrace from the call that "sees that BUF_ZV_BYTE is smaller
> than its visible_end"?

Ah, I made a mistake, it isn=E2=80=99t that it doesn=E2=80=99t reproduce =
on Linux, but rather it doesn=E2=80=99t reproduce on emacs-29. Since =
I=E2=80=99m able to reproduce it on Linux, I set a breakpoint and the =
backtrace explains it: blink-match-open calls forward-sexp, which calls =
elixir-ts=E2=80=94forward-sexp, which accesses the parse tree, which =
causes tree-sitter to reparse in the narrowed context.

But normally tree-sitter will reparse again when redisplay fontifies the =
buffer, because now the visible portion is back to the whole buffer. =
Tree-sitter didn=E2=80=99t do that because I made a mistake when =
modifying treesit_ensure_parsed. I moved the code that checks for the =
need_reparse flag before treesit_sync_visible_region, which sets the =
need_reparse flag if it detects that narrow situation has changed.

Well, this is a bit embarrassing, there is even a comment warning this =
mistake, but anyway, I pushed a fix, once it gets merged into master, =
the problem should go away.=20

As things stands right now, every time blink-match-open blinks the =
matching parenthesis, tree-sitter would reparse the buffer twice, =
that=E2=80=99s not exactly ideal. Blink-match-open=E2=80=99s use of =
narrowing is legit, and we can=E2=80=99t just automatically widen in =
tree-sitter functions.

Yuan







Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 01:52:02 +0000
Resent-Message-ID: <handler.62333.B62333.167970911914580 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167970911914580
          (code B ref 62333); Sat, 25 Mar 2023 01:52:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 01:51:59 +0000
Received: from localhost ([127.0.0.1]:41796 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pft4Z-0003n6-7R
	for submit <at> debbugs.gnu.org; Fri, 24 Mar 2023 21:51:59 -0400
Received: from mail-wr1-f47.google.com ([209.85.221.47]:34476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pft4X-0003mr-AK
 for 62333 <at> debbugs.gnu.org; Fri, 24 Mar 2023 21:51:57 -0400
Received: by mail-wr1-f47.google.com with SMTP id v1so3448621wrv.1
 for <62333 <at> debbugs.gnu.org>; Fri, 24 Mar 2023 18:51:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679709111;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=RjpFoAmwwHkswfT0rV4ePqyml0Rf7pIRU+z36FMFrvE=;
 b=oHlu/M/1va4X3BmLoOyr0iUhEeehtoZ7xdz/JaCoTAmFRIsldrNOXs53lG92KxK3IL
 SGGl2/j+rnN7920aMQH4r0aHQQVknQv8wtTNRXx/19fGQJ/VX7KkJ2W1Rbn6KRjDXgj9
 AmyGS/DzPJDVnPjhDr7NJdbR9MsNlVAVCBUMxk3JCIAu9OK/4Ta7BJK0KWiTNP04Bath
 zQPYnOTJsnd65Z0EVgYW3rgr2Ii4FVuQf2R7sOHYOscqQfg+A58D90GUIqGlW34oZLZE
 4luiXSiwXF0Og1ep2IueUBzh3gFutSTsWJ/it7HiQwr7p+AtujU3sVYukpExyIBXwjeC
 PgQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679709111;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=RjpFoAmwwHkswfT0rV4ePqyml0Rf7pIRU+z36FMFrvE=;
 b=6NqessPmGpH2jQKvj1C4iK1r+xr7fGovkH/yh+uVqn+wMPkrCKaVhnPobVs18k5V1n
 H017g8vSkcpd7P/X/be0xzvur0WiZM0F4UhohryySY6dolnAztggdrYIpnn4S8xszMzi
 stS1IhtgaTbH5Me7/tXNmxDdgWkQNIi3D4Nj62w4NXS3klmLj8GqEEcuDHg3+JLehS/V
 0MeYzxBhNlm+RphI+rhqbQ+o/VKQDf2dswEInzckbq1Xy195hpzcse+0t2sZgJPYvkk3
 C91Kil2Me1LF9+bvazOQBp66SkvpumR0cu12iWfz4fmPuV961zMWB64BDzKD/Dp4Qp2A
 nmiQ==
X-Gm-Message-State: AAQBX9fs68a5pcnZ7ZBewYRX4PEC27m1lDfFM+KqUJr8I9nIokegkBsv
 57BpHj4LcyO5990qTjJKEpo=
X-Google-Smtp-Source: AKy350avZOxlUuVgC+NVrLL58v4UKKmciGrt30BIoMWQBX705imy1vv6gCck05XqGeoye1XMJwaZlw==
X-Received: by 2002:adf:f4cd:0:b0:2da:3ef5:5a39 with SMTP id
 h13-20020adff4cd000000b002da3ef55a39mr3245496wrp.14.1679709111082; 
 Fri, 24 Mar 2023 18:51:51 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 q7-20020adff947000000b002d419f661d6sm17991895wrr.82.2023.03.24.18.51.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 24 Mar 2023 18:51:50 -0700 (PDT)
Message-ID: <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN>
Date: Sat, 25 Mar 2023 03:51:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 24/03/2023 09:34, Yuan Fu wrote:
 > Well, this is a bit embarrassing, there is even a comment warning 
this mistake, but anyway, I pushed a fix, once it gets merged into 
master, the problem should go away.

Excellent, thanks.

> As things stands right now, every time blink-match-open blinks the matching parenthesis, tree-sitter would reparse the buffer twice, that’s not exactly ideal. Blink-match-open’s use of narrowing is legit, and we can’t just automatically widen in tree-sitter functions.

Not ideal indeed.

Aside from the performance impact, we could also see cases where the 
"narrowed" parse tree contains errors (due to incomplete code) which 
make the tree itself less useful. Especially when the narrowing's end is 
closer to the current position than in blink-matching-open's usage.

Not sure how to solve that, but suppose we had a way to convey to 
treesit.c that it shouldn't change the visibility bounds for the parser 
in this particular instance? Though that would raise the issue of code 
trying to use node positions beyond the current accessible range.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 12:35:02 +0000
Resent-Message-ID: <handler.62333.B62333.167974767819749 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167974767819749
          (code B ref 62333); Sat, 25 Mar 2023 12:35:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 12:34:38 +0000
Received: from localhost ([127.0.0.1]:42058 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg36T-00058T-JA
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 08:34:37 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48116)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pg36R-00058D-OC
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 08:34:36 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg36L-0006pE-Vu; Sat, 25 Mar 2023 08:34:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=0K46ZDrRBkXdqLGdPkcu0MUuH098aMmfEnsR2wCbR5w=; b=KhnFJdxVkJqH+L20dLNl
 Z8zqII+ZxHkG6LYuMg7lAAcXgIwLpHK05c6O4IloYh+8A02ClM5jAIalrkGpCyKxZDnYNqaoRuwNc
 1euEeFrikLc2+bBPJONf4NsGIah7ffactXCXoCp1cZp5WoWad4+JYjHiKOTr+4U8al8ueUd1okWfB
 nWypKSXE4n5CUq9hEp0HLKmolog+47NpDm4dcpQyZzW0ZbQmSfkiF2jETJuZx8p5CChvhvaxCIMgL
 KkgewzGRIo5a1pulaDK7BJHpQnmhDPMHJdBGQ4IBBXv89o6dh8JXviS7KgF+n0dW6k0odAbcBU5W7
 c9+W3sHMrYrObw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg36L-00078H-3N; Sat, 25 Mar 2023 08:34:29 -0400
Date: Sat, 25 Mar 2023 15:34:26 +0300
Message-Id: <83jzz5c8ml.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> (message from
 Dmitry Gutov on Sat, 25 Mar 2023 03:51:48 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 25 Mar 2023 03:51:48 +0200
> Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 24/03/2023 09:34, Yuan Fu wrote:
>  > Well, this is a bit embarrassing, there is even a comment warning 
> this mistake, but anyway, I pushed a fix, once it gets merged into 
> master, the problem should go away.
> 
> Excellent, thanks.
> 
> > As things stands right now, every time blink-match-open blinks the matching parenthesis, tree-sitter would reparse the buffer twice, that’s not exactly ideal. Blink-match-open’s use of narrowing is legit, and we can’t just automatically widen in tree-sitter functions.
> 
> Not ideal indeed.
> 
> Aside from the performance impact, we could also see cases where the 
> "narrowed" parse tree contains errors (due to incomplete code) which 
> make the tree itself less useful. Especially when the narrowing's end is 
> closer to the current position than in blink-matching-open's usage.
> 
> Not sure how to solve that, but suppose we had a way to convey to 
> treesit.c that it shouldn't change the visibility bounds for the parser 
> in this particular instance? Though that would raise the issue of code 
> trying to use node positions beyond the current accessible range.

Exactly.  Which is why I don't think this is the right way.

Is there any real reason blink-matching-open narrows the buffer?  If
we could remove that narrowing, the problem with the parser's taking
notice of it would be gone.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 13:01:01 +0000
Resent-Message-ID: <handler.62333.B62333.167974923422938 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167974923422938
          (code B ref 62333); Sat, 25 Mar 2023 13:01:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 13:00:34 +0000
Received: from localhost ([127.0.0.1]:42121 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg3Va-0005xu-0l
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 09:00:34 -0400
Received: from mail-wr1-f46.google.com ([209.85.221.46]:38427)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pg3VY-0005xd-PQ
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 09:00:33 -0400
Received: by mail-wr1-f46.google.com with SMTP id q19so1202222wrc.5
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 06:00:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679749226;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=/LaY8YNE6aALpGA4X6raPDa0gMm3pXFb3xw5hKZk0l8=;
 b=nFqy2PW/bLz2EPz2xOSVS3DN2niT7ycn/BZTkNPJbsDFBSy5C7/a1UDewLuIjw0H6/
 +qdkTb6NYM8QlG/wDKEV5SFceFw92SFHvT1+SeoCCQ3g1/OoJPjpbUzpAkFpMSgvc9JU
 xEPdURIIh4uWlE3fMXB1mNfzhV4qT5sraRIvaUFxuukJDZ2xd9om3QvR1n94Za1aacBb
 xN/RiJq6AVQ/i5bdQkWGOAMKw4lAlKpe2OmIxpY2BhjMHF8crhniCicdAW0nvntmfmpM
 +t5eDhnkjLuCD8DzszL3t53Qkq2/hrvj7oBtkABiGyfbsOlwB36VqWLx0WupPUhWJ70E
 9+kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679749226;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=/LaY8YNE6aALpGA4X6raPDa0gMm3pXFb3xw5hKZk0l8=;
 b=fCH8iCSoag5FHSrF0jTJsZqiANO1ZFRbSWwLanT4FULUSk8spaiaYJYsOl5xSEBrlj
 Y371C7vMbROdwOm3n9DTVUjUTSzJWWNO/3FoW3fs9ZHR3k+xiNw+ZropB2mOnWKm6Ay9
 gBPjshRktXiAkmlz2y2tLUZR/+lVgsHhMoGefn0j5h3alJ63aia3FlZIj3+yL/wRhVXK
 vv3ZADif6+SgzC1+VzNrCXu6ClUUWlmCCzaR6BktkRs7It2v8pkjR68IunBYJuhz36QP
 PkxFwsUpCzZPg2UCHQqyoSZ8JELitxb2GxRjlQSFIfQwjBz5hrkvJ/AC2H33EJ2CiwNL
 HeVw==
X-Gm-Message-State: AAQBX9eneBfHA8ED38le+hraBjvBT+SkFJMNZvuMwI/3+EPbrRE5iSAr
 Qe2BlMQv2TM5Nh9ahXhfgMM=
X-Google-Smtp-Source: AKy350aWNsjc9TnCjixUULXLgjzO7cyYKf6nCv1yPYZ8sklHtg2OrnSrJ82uLWWWEOpyaH1jF0WwAQ==
X-Received: by 2002:adf:f30c:0:b0:2cf:ed87:37c9 with SMTP id
 i12-20020adff30c000000b002cfed8737c9mr4610323wro.11.1679749226560; 
 Sat, 25 Mar 2023 06:00:26 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 w2-20020a5d6802000000b002cfe687fc7asm20535495wru.67.2023.03.25.06.00.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 25 Mar 2023 06:00:26 -0700 (PDT)
Message-ID: <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN>
Date: Sat, 25 Mar 2023 15:00:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83jzz5c8ml.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 25/03/2023 14:34, Eli Zaretskii wrote:
>> Not ideal indeed.
>>
>> Aside from the performance impact, we could also see cases where the
>> "narrowed" parse tree contains errors (due to incomplete code) which
>> make the tree itself less useful. Especially when the narrowing's end is
>> closer to the current position than in blink-matching-open's usage.
>>
>> Not sure how to solve that, but suppose we had a way to convey to
>> treesit.c that it shouldn't change the visibility bounds for the parser
>> in this particular instance? Though that would raise the issue of code
>> trying to use node positions beyond the current accessible range.
> Exactly.  Which is why I don't think this is the right way.
> 
> Is there any real reason blink-matching-open narrows the buffer?  If
> we could remove that narrowing, the problem with the parser's taking
> notice of it would be gone.

Performance: to avoid scanning for the matching paren too far in the buffer.

Which might seem like not that big a deal, or could even be handled in a 
special way here using the parse tree, but narrowing has been used for 
this purpose for a long time (to limit various kinds of searches or 
movements), so fundamentally the problem will still be with us.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 13:15:01 +0000
Resent-Message-ID: <handler.62333.B62333.167975006424491 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167975006424491
          (code B ref 62333); Sat, 25 Mar 2023 13:15:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 13:14:24 +0000
Received: from localhost ([127.0.0.1]:42138 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg3iu-0006Ms-Ai
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 09:14:23 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45940)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pg3ip-0006Md-3q
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 09:14:18 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg3ij-0000yj-NA; Sat, 25 Mar 2023 09:14:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=lTg0FJJLlli/7P/5LimMs+5qaoC7FtqbcqfjCYvQy+Y=; b=PBmMo1Ci88tn
 MiAm9NBgPtRK6royo9Ffhmv7JIKkWiLvCLLPN8KLvSzbuBNYyws5ukagEwZFtHIkmqSGFkbMPabt/
 81QutZQGMlucJiyuTsA5zPzEZ6Bfqxq6dNEtitNIcVAzXMSKXbxjj1uTKcOUmzyARFrPIu1IyUvSb
 IQIunPgooIwvU+q29Yn1myugEAGFnsg1mLpbfnLGdp6+NVbOlcNrRoo14s14qHyUCphvaKVvR/bFP
 Gc3cA+toUWlnH6zWnq4QRwRGwPr0CxsvELGwBvO7XabhHrJozeurlWuWVdqfuhZn9TwJ7H4jZ6uHu
 8pi3ZPMzgQxbqeElryCx+g==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg3ie-0002BJ-50; Sat, 25 Mar 2023 09:14:04 -0400
Date: Sat, 25 Mar 2023 16:14:00 +0300
Message-Id: <83edpdc6sn.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> (message from
 Dmitry Gutov on Sat, 25 Mar 2023 15:00:24 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 25 Mar 2023 15:00:24 +0200
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 25/03/2023 14:34, Eli Zaretskii wrote:
> > 
> > Is there any real reason blink-matching-open narrows the buffer?  If
> > we could remove that narrowing, the problem with the parser's taking
> > notice of it would be gone.
> 
> Performance: to avoid scanning for the matching paren too far in the buffer.

If that's the only reason, then tree-sitter based modes could widen
back in their sexp-moving functions, since they use the parse data for
this, right?

> Which might seem like not that big a deal, or could even be handled in a 
> special way here using the parse tree, but narrowing has been used for 
> this purpose for a long time (to limit various kinds of searches or 
> movements), so fundamentally the problem will still be with us.

There are many fundamental problems we cannot solve, but I'd settle
with solving some of their particular instances, one at a time.  In
this case, the problem is caused by a mode-specific function that uses
parser data, and is called inside a restriction.  So let's try solving
this particular combination of factors, if we can.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 13:45:02 +0000
Resent-Message-ID: <handler.62333.B62333.167975186827234 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167975186827234
          (code B ref 62333); Sat, 25 Mar 2023 13:45:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 13:44:28 +0000
Received: from localhost ([127.0.0.1]:42202 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg4C4-00075C-Hc
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 09:44:28 -0400
Received: from mail-wm1-f51.google.com ([209.85.128.51]:55114)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pg4C3-00074z-4Z
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 09:44:27 -0400
Received: by mail-wm1-f51.google.com with SMTP id s13so2580859wmr.4
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 06:44:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679751861;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=k4728vb+cvQaKGoZGvTFibWdW7gImRp63o7CgC47YF0=;
 b=Du5lnnn1pzfYl9/QS+n5D3VLfRvhOsKeW7ol9qMMhen7Jrfk/+9dyomLsi4XdNLLSj
 OTglSq7AwEvg2FyiItDAmq5FrcGrtuiL4D0MaGdhUu9NiVIOrR/qpQDwwed2oxFngVPS
 e4uPBoSzjj8fBffdddfNJ1r1i/cXuHO30rTs2BSs+IY4H6pwKkQroomqXve50kAAQr3t
 noD6eJoafGjXLeUey37nYvBU4j1k+lskaRDqUYGQJX7VgE9EnHUiBy5gNFIJ6cuy4/6R
 XIGQVDxihtdTwahQhuD5KP0xfFi2hCICQner6wS+V+1xzFHhesqD+Bbq/1ie2pefnHpR
 KcCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679751861;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=k4728vb+cvQaKGoZGvTFibWdW7gImRp63o7CgC47YF0=;
 b=MeI7uQLl1ubyJKQBlVQnZIjEyfkGjyUBIRRYVZsmv0UDy2PpcWaiFvqREMzXzQ56IJ
 HF0bjHTRh12DH/zFGC4V64SMvWgxJl6SGnBW31xnl/vRD8tMHh24tConyJW/kvePvaja
 ww52FLoFvd2Ha1E/Rozgo8sPkgvZxli/JSip9n5t9QJcEjb+axMPlM6uTv6kFFJgmNMJ
 moaZh0L6qM+M9S7RzhlmEEEZxm8UKOEu4u57VnJjzu/23wZLvjtxh+4tnWMd9+SaEMar
 K0bkrwsOLdBgVXIpXSTNozgq8r4VlBtdhc8t2t/7kyH4ru9T6rlmZAY43i/ODoHtOdi0
 /jiw==
X-Gm-Message-State: AO0yUKXZVsrxiCfvv2kFxxp6QiGAlR8wmKTmQ3ynsHS4dqoCKvOabWvr
 TN5q4pJfemslOjsVGZ84Jrs=
X-Google-Smtp-Source: AK7set/fDYx3TpfThB1LYK5fJUdtW5QddfHZXzHJxjLYzLRhEzKD0BS1ekVFE/TyBh+Wk3LS8dRpBg==
X-Received: by 2002:a05:600c:2157:b0:3ed:cf2a:3fe8 with SMTP id
 v23-20020a05600c215700b003edcf2a3fe8mr5361422wml.8.1679751860525; 
 Sat, 25 Mar 2023 06:44:20 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 h3-20020a05600c314300b003e1202744f2sm2946246wmo.31.2023.03.25.06.44.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 25 Mar 2023 06:44:20 -0700 (PDT)
Message-ID: <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN>
Date: Sat, 25 Mar 2023 15:44:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83edpdc6sn.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 25/03/2023 15:14, Eli Zaretskii wrote:
>> Date: Sat, 25 Mar 2023 15:00:24 +0200
>> Cc:wkirschbaum@HIDDEN,casouri@HIDDEN,62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov<dgutov@HIDDEN>
>>
>> On 25/03/2023 14:34, Eli Zaretskii wrote:
>>> Is there any real reason blink-matching-open narrows the buffer?  If
>>> we could remove that narrowing, the problem with the parser's taking
>>> notice of it would be gone.
>> Performance: to avoid scanning for the matching paren too far in the buffer.
> If that's the only reason, then tree-sitter based modes could widen
> back in their sexp-moving functions, since they use the parse data for
> this, right?

Not necessarily: it doesn't know the purpose for which the narrowing was 
applied. Could be for a mixed-major-mode thing, or some other purpose. 
Long lines?

Do we recall the exact design idea why tree-sitter visibility is limited 
by the narrowing bounds? Because if we wanted to widen in all similar 
situations, we might as well make it not obey the narrowing at all.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 14:10:02 +0000
Resent-Message-ID: <handler.62333.B62333.167975338530763 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167975338530763
          (code B ref 62333); Sat, 25 Mar 2023 14:10:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 14:09:45 +0000
Received: from localhost ([127.0.0.1]:43143 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg4aW-000807-Tw
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 10:09:45 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42652)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pg4aU-0007zr-TK
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 10:09:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg4aO-00083g-5a; Sat, 25 Mar 2023 10:09:36 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=9/wEqtfv6BBUOcYtmXkJ+DEGgxlo2moU5PETsbh1wfI=; b=EXlxMt9T+mNV
 KkyWnsdBLTMt8OHh++W0vw4Bvk5XLyU6nawxJzVdxs3Q/4COxzPqnSQxmBvABVLySD1+gPcbB/xjz
 LgSN7W15L0TORO1cRCNMN9g/7MmP2gtfP0QSby8ZS6RW6BtuZJLgrlN+RX5UDUU+FaowhueAXYSPp
 jyOh/IuGw555JRueGU9iErKNvJfMi13jWxZqNN196x14ENYIipGNFjN4PgNtLciRhns+XJX1MBwO6
 yRF2HDJtQ4Z96O6SC8Pl36fdTBJgF7m25xTVRx8CmC5uK9/H7Lmwr+MsZBMPaAoaNs9fFemVW584g
 Y18or7yJ92CMdDncfd4XtQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg4aN-00013y-DW; Sat, 25 Mar 2023 10:09:35 -0400
Date: Sat, 25 Mar 2023 17:09:33 +0300
Message-Id: <831qlcdisi.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> (message from
 Dmitry Gutov on Sat, 25 Mar 2023 15:44:18 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 25 Mar 2023 15:44:18 +0200
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> > If that's the only reason, then tree-sitter based modes could widen
> > back in their sexp-moving functions, since they use the parse data for
> > this, right?
> 
> Not necessarily: it doesn't know the purpose for which the narrowing was 
> applied. Could be for a mixed-major-mode thing, or some other purpose. 

mixed-major-mode shouldn't be a problem.

> Long lines?

Easy to test, and the call to widen will do nothing anyway in that
case.

> Do we recall the exact design idea why tree-sitter visibility is limited 
> by the narrowing bounds?

For the same reason: because the buffer is inaccessible outside the
restriction, and tree-sitter wants to access the buffer text.

> Because if we wanted to widen in all similar situations, we might as
> well make it not obey the narrowing at all.

It is impossible to not obey narrowing, not in Emacs.  I told that and
explained that many times already, including simple examples of what
trouble this could cause to even the most innocent Lisp code.  I hoped
that by now this should no longer be brought forward.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 14:19:02 +0000
Resent-Message-ID: <handler.62333.B62333.167975390331750 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167975390331750
          (code B ref 62333); Sat, 25 Mar 2023 14:19:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 14:18:23 +0000
Received: from localhost ([127.0.0.1]:43180 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg4is-0008G2-O8
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 10:18:23 -0400
Received: from mail-wm1-f45.google.com ([209.85.128.45]:36661)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pg4ir-0008Fp-5L
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 10:18:21 -0400
Received: by mail-wm1-f45.google.com with SMTP id
 j18-20020a05600c1c1200b003ee5157346cso4717024wms.1
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 07:18:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679753895;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=jfq/XHSDFteeuKBALXukhAvy3IS3sVXtOdmzWFU2VZ0=;
 b=TFX89oLO2epzZ1ZFjN/jrUlRmBM70Io8vLDQz/tcA4aDP+qsA4si4JDRw/AvtT7pqC
 QQTseFGo0o93ZxAuRS//CFSo1jkzbEY1EcNVrIi6kt7eUOwywFgH5xO72id0DHWr73hO
 POokoYGTCH5fMv+l8HSWQDrAhiSzNTQ/s+VHqOtmsLzSJbfnByjsNPCpMIuu2jbWPZe5
 mfaomSAgCY0FrsSm98PhnXV9HH1I1C1QucxS9HmAXylcbuVuwOPaEJ2PHm6EUss8WSis
 a/OSwjfwDGrvqRQu2w6a2vijeW7B4r1QX34aZ/AptPbJonRaNbRAQx/qfFDtJCn/4cJ3
 P04Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679753895;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=jfq/XHSDFteeuKBALXukhAvy3IS3sVXtOdmzWFU2VZ0=;
 b=7YuErgVJQAZHvJDNfCv0oxGutDLT8aR1hts9YkYJpGe84C3GhMYTjC+QTSJTuAW/J8
 rw7uhC44ssjNTHx10uV1fTp0coV0S4ZJbdbpoFRL+OT/N6RcJP72hlelGKbn7rzLovgO
 n3ndFwRxcuvsIse23B3t25Ol98X33abcbr+aCxWD1qvAUVsRdNHLa0qOSZ46Gbc71kJE
 jIDYpvdzr7iB/10U0dGOACyRlwHU/OJtj7oy/+Cy29Us5Nz+L2un0vy3xB8pw7NN4m0e
 J/Efivj8k1f9ZITG+AS3PWAT2l8TPRz951n0qqUKsX/99k6/u3acLuoa9ak6o1kh+KLc
 3/ag==
X-Gm-Message-State: AO0yUKWMskQSAq2ubwzHLGfiyS5LtL0kocI20bE06GECaYadvNr8VfpC
 xnEaCTiyK7zdH2tS7RSsssw=
X-Google-Smtp-Source: AK7set9vXctj9n1WKj3na8DKMJRy5+AOaaXzlyH6MC8bukqgthasJbPZ469EjmkziRU2pNh/25awnw==
X-Received: by 2002:a1c:6a19:0:b0:3e2:201a:5bcc with SMTP id
 f25-20020a1c6a19000000b003e2201a5bccmr4900688wmc.33.1679753895313; 
 Sat, 25 Mar 2023 07:18:15 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 o9-20020a05600c510900b003ed793d9de0sm14278658wms.1.2023.03.25.07.18.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 25 Mar 2023 07:18:14 -0700 (PDT)
Message-ID: <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN>
Date: Sat, 25 Mar 2023 16:18:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <831qlcdisi.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 25/03/2023 16:09, Eli Zaretskii wrote:
>> Date: Sat, 25 Mar 2023 15:44:18 +0200
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>>> If that's the only reason, then tree-sitter based modes could widen
>>> back in their sexp-moving functions, since they use the parse data for
>>> this, right?
>>
>> Not necessarily: it doesn't know the purpose for which the narrowing was
>> applied. Could be for a mixed-major-mode thing, or some other purpose.
> 
> mixed-major-mode shouldn't be a problem.

Why wouldn't it?

>> Long lines?
> 
> Easy to test, and the call to widen will do nothing anyway in that
> case.

Okay. Because of locked narrowing, I guess.

>> Do we recall the exact design idea why tree-sitter visibility is limited
>> by the narrowing bounds?
> 
> For the same reason: because the buffer is inaccessible outside the
> restriction, and tree-sitter wants to access the buffer text.
> 
>> Because if we wanted to widen in all similar situations, we might as
>> well make it not obey the narrowing at all.
> 
> It is impossible to not obey narrowing, not in Emacs.  I told that and
> explained that many times already, including simple examples of what
> trouble this could cause to even the most innocent Lisp code.  I hoped
> that by now this should no longer be brought forward.

Okay. But do you advocate all uses of tree-sitter to (widen) first?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 14:43:01 +0000
Resent-Message-ID: <handler.62333.B62333.16797553231805 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16797553231805
          (code B ref 62333); Sat, 25 Mar 2023 14:43:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 14:42:03 +0000
Received: from localhost ([127.0.0.1]:43214 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg55m-0000T3-RS
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 10:42:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35412)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pg55k-0000SO-El
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 10:42:01 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg55d-00083i-Q3; Sat, 25 Mar 2023 10:41:53 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=k+/RCpFAk6FLcxSLEWy4QQOGAAor0nMZ8mrTFADGZt0=; b=QT6JAQd3Vjoh
 POcZ9K+cb8q3ia76WIb+Bi0+kp9zuW9jbJGO8pALW9tTnPjsJSKX39o64kTHtTBZd20hFj4IeRrfD
 boWFB1HgsmW2CiV+57BHd9yLaTt8hrMkmSYHUDNiRTjkc5msnbElurXwKveWeeWiOZcSIOd0NyqYu
 X0/rH0JU3idR4dakn466cxFu37Jen3jLKL1pKQCHVJ9E1c9FQzbg633I+CdrmjJu/g0j5OE/AcXdW
 kRC1JMrKAp4bQGWzZUynVPLY/n8DZVDbCHXZupJE+rN5QnJJj9fm/ID3zEE4jAZDhvXb5WRwtJpPR
 iqmVvCs84n5QRzWxS8F12Q==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg55d-0000ka-8O; Sat, 25 Mar 2023 10:41:53 -0400
Date: Sat, 25 Mar 2023 17:41:49 +0300
Message-Id: <83wn34c2qa.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> (message from
 Dmitry Gutov on Sat, 25 Mar 2023 16:18:12 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN>
X-Spam-Score: -1.9 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.9 (--)

> Date: Sat, 25 Mar 2023 16:18:12 +0200
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> > mixed-major-mode shouldn't be a problem.
> 
> Why wouldn't it?

Because the sexp ends inside the current mode's block.

> >> Long lines?
> > 
> > Easy to test, and the call to widen will do nothing anyway in that
> > case.
> 
> Okay. Because of locked narrowing, I guess.

Yes.

> >> Because if we wanted to widen in all similar situations, we might as
> >> well make it not obey the narrowing at all.
> > 
> > It is impossible to not obey narrowing, not in Emacs.  I told that and
> > explained that many times already, including simple examples of what
> > trouble this could cause to even the most innocent Lisp code.  I hoped
> > that by now this should no longer be brought forward.
> 
> Okay. But do you advocate all uses of tree-sitter to (widen) first?

No, just in sexp-movement functions, at least for now.  If we discover
this is need in many more situations, we might consider more drastic
measures.  But I don't think we are there yet.  We've discovered just
one such case, in just one such mode, and it's on master.  We still
have ample time to see how widespread this is.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 15:26:01 +0000
Resent-Message-ID: <handler.62333.B62333.16797579356124 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16797579356124
          (code B ref 62333); Sat, 25 Mar 2023 15:26:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 15:25:35 +0000
Received: from localhost ([127.0.0.1]:43249 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg5lr-0001aX-Ep
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 11:25:35 -0400
Received: from mail-wm1-f48.google.com ([209.85.128.48]:53912)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pg5lm-0001aG-M5
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 11:25:30 -0400
Received: by mail-wm1-f48.google.com with SMTP id p34so2684762wms.3
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 08:25:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679757921;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=7kIarL5duj7CWFYIrKo+z+i3aj4fmRaS/vzSmSjQQfA=;
 b=O2NfSDCGJtQmsPYpRqmyIM6T2+hqsXmNRoi568zTmdq+iiJcu9x0/91St14VI2lCSo
 bEd/s6xRNLaN4+eGv+7wzc2tCytntVxvKuY5YxCkl3bVe6y4WCWQ5uj0ggFHdCF7oaIr
 rmVkbSvHlJI3Q1mIJ7rsqOmtptarf4p8WrMl4roON51Y9hfGCwbI5BnJTPJKp0rC5lx3
 xe8gWVy3CR2jnQk4j9/GtYNZcZfAKVlOiwV4oUavH4iQ6X5lgmu2XNdYkStkJ1EMYrEW
 4DfYVEnFP4Nex7vCttAsvs4YquYmQGmbBj1VchdfoSiUocmMPSCPWRqX06Z8njB0GKDe
 W2Hw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679757921;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=7kIarL5duj7CWFYIrKo+z+i3aj4fmRaS/vzSmSjQQfA=;
 b=CjzNAblBlw171OeKaNPudOLpl+f3VwHdItqPQX6FgejN656w2FoJ9h/+/AgbF8utYl
 s35nmSWyzKVp0TDYnXCMalDnT2PPBwlSH6GFv8eD/Dt0Fsec17KSA+dBU3CkI38ElAgN
 cQmgZ8DdzyT1VVbDm9Or40ObYma3wGIrOue/D4XG0xXz+EeMx0MeP5QJDmUOWrXUNhCf
 TGy0Ka2K8UWaTM1udVCI2g6bfhDhOl0UaudFk5enl0siuYPwrfj1N+IjQKWqrgOgXdyF
 oZX3PP3luOWoiEoanVjJEYTvon9Yp8YI45H0F/DeEfXF+DLL5oM7U0FcnrXF9npfDj/J
 qunA==
X-Gm-Message-State: AO0yUKWstrk/6QwvC2kYNsUFigoihsA6PqxtGaUWGp77REvUbpiXO/4u
 cg0nYlI9saGWqaAH4z6e9qIHDFSHxK4U4g==
X-Google-Smtp-Source: AK7set9+4VYpYbSuUP4/ih+j7voANxnWcklOvoxi8j8VBlACtZF03/TZyO3Coo5DO4MSdJvQqr1shw==
X-Received: by 2002:a05:600c:214c:b0:3ed:358e:c1ec with SMTP id
 v12-20020a05600c214c00b003ed358ec1ecmr4969950wml.0.1679757920617; 
 Sat, 25 Mar 2023 08:25:20 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 j36-20020a05600c1c2400b003ebf73acf9asm15241868wms.3.2023.03.25.08.25.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 25 Mar 2023 08:25:20 -0700 (PDT)
Message-ID: <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
Date: Sat, 25 Mar 2023 17:25:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83wn34c2qa.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 25/03/2023 16:41, Eli Zaretskii wrote:
>> Date: Sat, 25 Mar 2023 16:18:12 +0200
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>>> mixed-major-mode shouldn't be a problem.
>>
>> Why wouldn't it?
> 
> Because the sexp ends inside the current mode's block.

But if the mmm framework narrowed the region to the current mode's 
block, widening will force tree-sitter to parse the whole buffer. Which 
might even result in parse errors (instead of meaningful parse nodes) 
near point.

Or consider the case when the code in the current snippet is incomplete 
(e.g. a missing paren). Then it might find a "match" somewhere far outside.

>>>> Because if we wanted to widen in all similar situations, we might as
>>>> well make it not obey the narrowing at all.
>>>
>>> It is impossible to not obey narrowing, not in Emacs.  I told that and
>>> explained that many times already, including simple examples of what
>>> trouble this could cause to even the most innocent Lisp code.  I hoped
>>> that by now this should no longer be brought forward.
>>
>> Okay. But do you advocate all uses of tree-sitter to (widen) first?
> 
> No, just in sexp-movement functions, at least for now.  If we discover
> this is need in many more situations, we might consider more drastic
> measures.  But I don't think we are there yet.  We've discovered just
> one such case, in just one such mode, and it's on master.  We still
> have ample time to see how widespread this is.

I'm not sure whether tree-sitter is going to be used with mmm-mode (or 
similar) a lot, since it has its own provisions for mixing languages.

But I'd also like to consider the other cases where we *don't* want to 
widen first. Any of them come to mind?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 15:58:01 +0000
Resent-Message-ID: <handler.62333.B62333.16797598539837 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16797598539837
          (code B ref 62333); Sat, 25 Mar 2023 15:58:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 15:57:33 +0000
Received: from localhost ([127.0.0.1]:43290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg6Gr-0002Yb-2m
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 11:57:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:57858)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pg6Gp-0002YI-HU
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 11:57:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg6Gh-0003W3-7F; Sat, 25 Mar 2023 11:57:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=UDVd2qMJm2Pe+5x2b6w6zvrwp/7aparRw5jN+YoRGGI=; b=GL0iftHCUbLB
 yB/ws15zcvqqQVeLyxr1lbljDx5frnWXw4F4BlsfZ4U6MpAlRdnljtXQntkf5l0KKmw8koRTUHlcQ
 Q/i49xk8Mrc0wHHoo3oBdV/RVlw/dn4ATO1ran2iRuTQd/a9h/FhO0EUodPLWqgVL45/ATkvUXrfV
 a/a5ImtQ+gGD/nAgJoDoC4y4VO0uSnXWx4PttroYh1XiC/JZfV011S0j4uuNfz5CsIy3/UWvGwzmX
 hQMQMPeWmw48yimIgD9KOmeK4np8EjQ1bk1GaexkP13z7rdQrX63uII2T4X7pO/TJA2hh9vNnuB33
 mRKXfU1DkOogQSnXP6Rg+g==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg6Gg-0003RN-Kt; Sat, 25 Mar 2023 11:57:22 -0400
Date: Sat, 25 Mar 2023 18:57:19 +0300
Message-Id: <83r0tcbz8g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> (message from
 Dmitry Gutov on Sat, 25 Mar 2023 17:25:17 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
X-Spam-Score: -1.9 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.9 (--)

> Date: Sat, 25 Mar 2023 17:25:17 +0200
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 25/03/2023 16:41, Eli Zaretskii wrote:
> >> Date: Sat, 25 Mar 2023 16:18:12 +0200
> >> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> >> From: Dmitry Gutov <dgutov@HIDDEN>
> >>
> >>> mixed-major-mode shouldn't be a problem.
> >>
> >> Why wouldn't it?
> > 
> > Because the sexp ends inside the current mode's block.
> 
> But if the mmm framework narrowed the region to the current mode's 
> block, widening will force tree-sitter to parse the whole buffer.

No, because such a mode mode should already make sure this doesn't
happen.

> >> Okay. But do you advocate all uses of tree-sitter to (widen) first?
> > 
> > No, just in sexp-movement functions, at least for now.  If we discover
> > this is need in many more situations, we might consider more drastic
> > measures.  But I don't think we are there yet.  We've discovered just
> > one such case, in just one such mode, and it's on master.  We still
> > have ample time to see how widespread this is.
> 
> I'm not sure whether tree-sitter is going to be used with mmm-mode (or 
> similar) a lot, since it has its own provisions for mixing languages.
> 
> But I'd also like to consider the other cases where we *don't* want to 
> widen first. Any of them come to mind?

No, not off the top of my head.

I think we should try this in this one case, and see if other cases
come up.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 16:04:01 +0000
Resent-Message-ID: <handler.62333.B62333.167976023210618 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: "wkirschbaum@HIDDEN" <wkirschbaum@HIDDEN>, "casouri@HIDDEN" <casouri@HIDDEN>, "62333 <at> debbugs.gnu.org" <62333 <at> debbugs.gnu.org>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167976023210618
          (code B ref 62333); Sat, 25 Mar 2023 16:04:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 16:03:52 +0000
Received: from localhost ([127.0.0.1]:43294 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg6Mx-0002lC-T2
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:03:52 -0400
Received: from forward500b.mail.yandex.net ([178.154.239.144]:42804)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dgutov@HIDDEN>) id 1pg6Mu-0002ky-Ds
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:03:50 -0400
Received: from mail-nwsmtp-mxback-production-main-752.sas.yp-c.yandex.net
 (mail-nwsmtp-mxback-production-main-752.sas.yp-c.yandex.net
 [IPv6:2a02:6b8:c14:4297:0:640:335d:0])
 by forward500b.mail.yandex.net (Yandex) with ESMTP id 766C25EB5D;
 Sat, 25 Mar 2023 19:03:46 +0300 (MSK)
Received: from mail.yandex.ru (2a02:6b8:c08:3919:0:640:73f2:0
 [2a02:6b8:c08:3919:0:640:73f2:0])
 by mail-nwsmtp-mxback-production-main-752.sas.yp-c.yandex.net (mxback/Yandex)
 with HTTP id g3Hxw71W3Sw0-QOniOlhg; Sat, 25 Mar 2023 19:03:46 +0300
X-Yandex-Fwd: 1
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail;
 t=1679760226; bh=RsqpoumqGkSaq57uBOzeNNOy1pDTeYI+W36+zOgjDPY=;
 h=Message-Id:References:Date:Cc:Subject:In-Reply-To:To:From;
 b=TpyTce4QmKCGqdlY766vsgVuoS1BFE/CV/ZAQBrPrxl3GEN4Qb7pNRCV7hVIZrWOn
 LYPYIUr1GYox2jxAyZzSaXKgWTLWu4bomUIbcsTBloUQnrmmWPfW8M0g036NXSLV3a
 LQVTI0FrpTj6oZxx1h2LjaXePId4eGnQfi31Keao=
Authentication-Results: mail-nwsmtp-mxback-production-main-752.sas.yp-c.yandex.net;
 dkim=pass header.i=@yandex.ru
Received: by umbzx4hqxrw5qxo7.sas.yp-c.yandex.net with HTTP;
 Sat, 25 Mar 2023 19:03:45 +0300
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83r0tcbz8g.fsf@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
MIME-Version: 1.0
X-Mailer: Yamail [ http://yandex.ru ] 5.0
Date: Sat, 25 Mar 2023 19:03:45 +0300
Message-Id: <1967361679760225@HIDDEN>
Content-Transfer-Encoding: base64
Content-Type: text/html; charset=utf-8
X-Spam-Score: 1.7 (+)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  17:57, 25 March 2023, Eli Zaretskii : Date: Sat, 25 Mar 2023
 17:25:17 +0200 Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, Dmitry Gutov
 On 25/03/2023 16:41, Eli Zaretskii wrote: >> Date: Sat, 25 Mar 2023 16:18:12
 +0200 >> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
 >> From: Dmitry Gutov >> >>> mixed-major-mod [...] 
 Content analysis details:   (1.7 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (dgutov[at]yandex.ru)
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [178.154.239.144 listed in list.dnswl.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.1 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts
 0.0 HTML_MESSAGE           BODY: HTML included in message
 0.6 HTML_MIME_NO_HTML_TAG  HTML-only message, but there is no HTML
 tag
 1.0 FREEMAIL_REPLY         From and body contain different freemails
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

PGJyIC8+PGJyIC8+MTc6NTcsIDI1IE1hcmNoIDIwMjMsIEVsaSBaYXJldHNraWkgJmx0O2VsaXpA
Z251Lm9yZyZndDs6PGJyIC8+PGJsb2NrcXVvdGUgY2xhc3M9IjIxMGU3YTg0OGU4ZmNiNDV3bWkt
cXVvdGUiPjxibG9ja3F1b3RlIGNsYXNzPSIyMTBlN2E4NDhlOGZjYjQ1d21pLXF1b3RlIj7CoERh
dGU6IFNhdCwgMjUgTWFyIDIwMjMgMTc6MjU6MTcgKzAyMDA8YnIgLz7CoENjOiA8YSBocmVmPSJt
YWlsdG86d2tpcnNjaGJhdW1AZ21haWwuY29tIj53a2lyc2NoYmF1bUBnbWFpbC5jb208L2E+LCA8
YSBocmVmPSJtYWlsdG86Y2Fzb3VyaUBnbWFpbC5jb20iPmNhc291cmlAZ21haWwuY29tPC9hPiwg
PGEgaHJlZj0ibWFpbHRvOjYyMzMzQGRlYmJ1Z3MuZ251Lm9yZyI+NjIzMzNAZGViYnVncy5nbnUu
b3JnPC9hPjxiciAvPsKgRnJvbTogRG1pdHJ5IEd1dG92ICZsdDs8YSBocmVmPSJtYWlsdG86ZGd1
dG92QHlhbmRleC5ydSI+ZGd1dG92QHlhbmRleC5ydTwvYT4mZ3Q7PGJyIC8+wqA8YnIgLz7CoE9u
IDI1LzAzLzIwMjMgMTY6NDEsIEVsaSBaYXJldHNraWkgd3JvdGU6PGJyIC8+wqAmZ3Q7Jmd0OyBE
YXRlOiBTYXQsIDI1IE1hciAyMDIzIDE2OjE4OjEyICswMjAwPGJyIC8+wqAmZ3Q7Jmd0OyBDYzog
PGEgaHJlZj0ibWFpbHRvOndraXJzY2hiYXVtQGdtYWlsLmNvbSI+d2tpcnNjaGJhdW1AZ21haWwu
Y29tPC9hPiwgPGEgaHJlZj0ibWFpbHRvOmNhc291cmlAZ21haWwuY29tIj5jYXNvdXJpQGdtYWls
LmNvbTwvYT4sIDxhIGhyZWY9Im1haWx0bzo2MjMzM0BkZWJidWdzLmdudS5vcmciPjYyMzMzQGRl
YmJ1Z3MuZ251Lm9yZzwvYT48YnIgLz7CoCZndDsmZ3Q7IEZyb206IERtaXRyeSBHdXRvdiAmbHQ7
PGEgaHJlZj0ibWFpbHRvOmRndXRvdkB5YW5kZXgucnUiPmRndXRvdkB5YW5kZXgucnU8L2E+Jmd0
OzxiciAvPsKgJmd0OyZndDs8YnIgLz7CoCZndDsmZ3Q7Jmd0OyBtaXhlZC1tYWpvci1tb2RlIHNo
b3VsZG4ndCBiZSBhIHByb2JsZW0uPGJyIC8+wqAmZ3Q7Jmd0OzxiciAvPsKgJmd0OyZndDsgV2h5
IHdvdWxkbid0IGl0PzxiciAvPsKgJmd0OyA8YnIgLz7CoCZndDsgQmVjYXVzZSB0aGUgc2V4cCBl
bmRzIGluc2lkZSB0aGUgY3VycmVudCBtb2RlJ3MgYmxvY2suPGJyIC8+wqA8YnIgLz7CoEJ1dCBp
ZiB0aGUgbW1tIGZyYW1ld29yayBuYXJyb3dlZCB0aGUgcmVnaW9uIHRvIHRoZSBjdXJyZW50IG1v
ZGUncyA8YnIgLz7CoGJsb2NrLCB3aWRlbmluZyB3aWxsIGZvcmNlIHRyZWUtc2l0dGVyIHRvIHBh
cnNlIHRoZSB3aG9sZSBidWZmZXIuPGJyIC8+PC9ibG9ja3F1b3RlPjxwPjxiciAvPk5vLCBiZWNh
dXNlIHN1Y2ggYSBtb2RlIG1vZGUgc2hvdWxkIGFscmVhZHkgbWFrZSBzdXJlIHRoaXMgZG9lc24n
dDxiciAvPmhhcHBlbi48L3A+PC9ibG9ja3F1b3RlPjxkaXY+SG93PzwvZGl2PjxiciAvPjxibG9j
a3F1b3RlIGNsYXNzPSIyMTBlN2E4NDhlOGZjYjQ1d21pLXF1b3RlIj48YmxvY2txdW90ZSBjbGFz
cz0iMjEwZTdhODQ4ZThmY2I0NXdtaS1xdW90ZSI+wqAmZ3Q7Jmd0OyBPa2F5LiBCdXQgZG8geW91
IGFkdm9jYXRlIGFsbCB1c2VzIG9mIHRyZWUtc2l0dGVyIHRvICh3aWRlbikgZmlyc3Q/PGJyIC8+
wqAmZ3Q7IDxiciAvPsKgJmd0OyBObywganVzdCBpbiBzZXhwLW1vdmVtZW50IGZ1bmN0aW9ucywg
YXQgbGVhc3QgZm9yIG5vdy4gIElmIHdlIGRpc2NvdmVyPGJyIC8+wqAmZ3Q7IHRoaXMgaXMgbmVl
ZCBpbiBtYW55IG1vcmUgc2l0dWF0aW9ucywgd2UgbWlnaHQgY29uc2lkZXIgbW9yZSBkcmFzdGlj
PGJyIC8+wqAmZ3Q7IG1lYXN1cmVzLiAgQnV0IEkgZG9uJ3QgdGhpbmsgd2UgYXJlIHRoZXJlIHll
dC4gIFdlJ3ZlIGRpc2NvdmVyZWQganVzdDxiciAvPsKgJmd0OyBvbmUgc3VjaCBjYXNlLCBpbiBq
dXN0IG9uZSBzdWNoIG1vZGUsIGFuZCBpdCdzIG9uIG1hc3Rlci4gIFdlIHN0aWxsPGJyIC8+wqAm
Z3Q7IGhhdmUgYW1wbGUgdGltZSB0byBzZWUgaG93IHdpZGVzcHJlYWQgdGhpcyBpcy48YnIgLz7C
oDxiciAvPsKgSSdtIG5vdCBzdXJlIHdoZXRoZXIgdHJlZS1zaXR0ZXIgaXMgZ29pbmcgdG8gYmUg
dXNlZCB3aXRoIG1tbS1tb2RlIChvciA8YnIgLz7CoHNpbWlsYXIpIGEgbG90LCBzaW5jZSBpdCBo
YXMgaXRzIG93biBwcm92aXNpb25zIGZvciBtaXhpbmcgbGFuZ3VhZ2VzLjxiciAvPsKgPGJyIC8+
wqBCdXQgSSdkIGFsc28gbGlrZSB0byBjb25zaWRlciB0aGUgb3RoZXIgY2FzZXMgd2hlcmUgd2Ug
KmRvbid0KiB3YW50IHRvIDxiciAvPsKgd2lkZW4gZmlyc3QuIEFueSBvZiB0aGVtIGNvbWUgdG8g
bWluZD88YnIgLz48L2Jsb2NrcXVvdGU+PHA+PGJyIC8+Tm8sIG5vdCBvZmYgdGhlIHRvcCBvZiBt
eSBoZWFkLjxiciAvPjxiciAvPkkgdGhpbmsgd2Ugc2hvdWxkIHRyeSB0aGlzIGluIHRoaXMgb25l
IGNhc2UsIGFuZCBzZWUgaWYgb3RoZXIgY2FzZXM8YnIgLz5jb21lIHVwLjxiciAvPjwvcD48L2Js
b2NrcXVvdGU+SSB0aGluayB3ZSBzaG91bGQgdHJ5IHRvIGFuc3dlciB0aGUgcmVsZXZhbnQgcXVl
c3Rpb25zIGZpcnN0Lg==




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 16:25:02 +0000
Resent-Message-ID: <handler.62333.B62333.167976149413064 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167976149413064
          (code B ref 62333); Sat, 25 Mar 2023 16:25:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 16:24:54 +0000
Received: from localhost ([127.0.0.1]:43324 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg6hD-0003OQ-Pn
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:24:54 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52844)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pg6h5-0003Nv-0b
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 12:24:46 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg6gw-0003PQ-AO; Sat, 25 Mar 2023 12:24:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=cNPrLtL0bPElCdRtNqY5QdaNEl5fJG4F2czwboeXK9A=; b=P1SrLjM+P8rf
 AyMHy7Yg4h++5pg+qIJyI2LdfeGOT9L0znX2W02W6KGOpTh5kzRsvzBQYKfCXo/faSye/lrVLwz6C
 gwQy9brP8TdyIM6Fe5GY2DTp0G9n4BujDVxzpZn5QrIVP9KTl4BG/h+M9FvzUJJ1Q7JEXekJtOfv0
 97t364XgI7iqXhZIRMiw79hrX2B2z1g8NuT6r/aDHzgBXqUyKF/h060kmJeyEFONN9Fh4i/hXgGvf
 n03bM8YpbKyMM84Y1UWcjttPxV965PAgf/Bi+TdcZ5/Vq49o0on0yM37iSSdrH4xE7etdlE5t+5Zx
 t8/vWqhjBli0rLeyhanAAQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg6gq-0000Be-OO; Sat, 25 Mar 2023 12:24:25 -0400
Date: Sat, 25 Mar 2023 19:24:22 +0300
Message-Id: <83mt40bxzd.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <1967361679760225@HIDDEN> (message
 from Dmitry Gutov on Sat, 25 Mar 2023 19:03:45 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Dmitry Gutov <dgutov@HIDDEN>
> Cc: "wkirschbaum@HIDDEN" <wkirschbaum@HIDDEN>,
> 	"casouri@HIDDEN" <casouri@HIDDEN>,
> 	"62333 <at> debbugs.gnu.org" <62333 <at> debbugs.gnu.org>
> Date: Sat, 25 Mar 2023 19:03:45 +0300
> 
>   But if the mmm framework narrowed the region to the current mode's 
>   block, widening will force tree-sitter to parse the whole buffer.
> 
>  No, because such a mode mode should already make sure this doesn't
>  happen.
> 
> How?

The same way it makes sure a given parser is used only on the portion
of the buffer where the corresponding language is used.

>   But I'd also like to consider the other cases where we *don't* want to 
>   widen first. Any of them come to mind?
> 
>  No, not off the top of my head.
> 
>  I think we should try this in this one case, and see if other cases
>  come up.
> 
> I think we should try to answer the relevant questions first.

If we can, sure.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 17:06:01 +0000
Resent-Message-ID: <handler.62333.B62333.167976392427028 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167976392427028
          (code B ref 62333); Sat, 25 Mar 2023 17:06:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 17:05:24 +0000
Received: from localhost ([127.0.0.1]:43370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg7KV-00071s-S0
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 13:05:24 -0400
Received: from mail-wm1-f45.google.com ([209.85.128.45]:43945)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pg7KU-00071b-Fr
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 13:05:22 -0400
Received: by mail-wm1-f45.google.com with SMTP id
 o24-20020a05600c511800b003ef59905f26so2697094wms.2
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 10:05:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679763916;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=I7XeI5x3L/trcdZrTicgHyh4YAOUCs8yYgKpAMUYnjY=;
 b=qufP7gE9Fao63TOKGc5ixtpfdRErFE/p5seDR7ppvtsPj+o/CnAc/JYVIvPQbDRDNS
 czJvaatxtVSUWKPyhw10lqe15aCN4Si1s+NMohgJ60wvuKdqYAb5ViMefag3v0tSTwy0
 VVDqz34xsFgbyFke0wajZKbkfnvjI1UZDadOvAoZAsWobBVZLmEWWZ5tiRyP7kYt2I6q
 Qoz4/3PTi2feb+6FRSCwN/cVqn9tubTCb473B1Ow6r2CqWPFb2lfLsPgaXQ53sNVVRAb
 /pifKrE4zFH5lhOaYritwGm1rFZLaEfnxouWY5f0P6iUjttkmfvyOo2Ky8bMgWRRvMjZ
 8vwQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679763916;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=I7XeI5x3L/trcdZrTicgHyh4YAOUCs8yYgKpAMUYnjY=;
 b=eUO1/iWAe6EvHMBnU2xtmk7vhBFDhtEM6S0lgaSwHAOGbDPO85bMndx7it/fcD10wY
 xWcw5RpDt2oybw0q7+Me0Sk7QrXsiofgULVVeMRJZAhz+7gGRSuJLQlTXyjXiunNND3o
 GKRoPNmAHCr37Gz+wrOxpLsVK5Y7pSS7lpdYmKuifwpF7qa8eBm6cyHK0bz+0GGE9iwJ
 gjR0LOGhjVfByuzeOvHpw49KKbqJk7aYb3n0DgJ8CmYoxMdzjJv6HZPyDk8t5YntK1xP
 nbuBGHbiBru9z7qpjhNbwsfFBszwg7ZL/Z/Xd2GbMzzgQmS0XYwX9pdcJ+a9X783TAt5
 QXtQ==
X-Gm-Message-State: AO0yUKVNZtBIwmPOSfUdL/uGs6PdoOslOqGy1kvc1fOPLfe3GjItH0NF
 aCXAkJK3TXdH6zhZ66r8rzc=
X-Google-Smtp-Source: AK7set8f/mayPqTJ2mLxV7xTfgNc5U6JuNM5C2u14sNZa1AsHInWvZvtblyde5F/o4+AN681tvuOhQ==
X-Received: by 2002:a05:600c:2118:b0:3eb:39e0:3530 with SMTP id
 u24-20020a05600c211800b003eb39e03530mr4823694wml.41.1679763916346; 
 Sat, 25 Mar 2023 10:05:16 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 i6-20020a05600c354600b003ede6540190sm3472098wmq.0.2023.03.25.10.05.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 25 Mar 2023 10:05:15 -0700 (PDT)
Message-ID: <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
Date: Sat, 25 Mar 2023 19:05:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83mt40bxzd.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 25/03/2023 18:24, Eli Zaretskii wrote:
>> From: Dmitry Gutov <dgutov@HIDDEN>
>> Cc: "wkirschbaum@HIDDEN" <wkirschbaum@HIDDEN>,
>> 	"casouri@HIDDEN" <casouri@HIDDEN>,
>> 	"62333 <at> debbugs.gnu.org" <62333 <at> debbugs.gnu.org>
>> Date: Sat, 25 Mar 2023 19:03:45 +0300
>>
>>    But if the mmm framework narrowed the region to the current mode's
>>    block, widening will force tree-sitter to parse the whole buffer.
>>
>>   No, because such a mode mode should already make sure this doesn't
>>   happen.
>>
>> How?
> 
> The same way it makes sure a given parser is used only on the portion
> of the buffer where the corresponding language is used.

It uses narrowing. Major modes are not supposed to 'widen' willy-nilly.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 17:41:02 +0000
Resent-Message-ID: <handler.62333.B62333.167976604430538 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167976604430538
          (code B ref 62333); Sat, 25 Mar 2023 17:41:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 17:40:44 +0000
Received: from localhost ([127.0.0.1]:43399 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg7sh-0007wT-VS
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 13:40:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39984)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pg7sf-0007wE-He
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 13:40:42 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg7sX-0003kf-Rz; Sat, 25 Mar 2023 13:40:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=ENmoS0vZraOwjRDQ2imUUgcN1adiiHp0jnlQq7hBesQ=; b=Cqzd+6eyWoA+
 sDVGO5ix8cw6gtQQsQ+tCw0xnZzSe2+3LZ22RiTspv899FihZSRTRW69UmcEGDHZDuuPlnrC4lpzt
 AzWkux1Tg92WAJZBYgy5b55w2v0/4Z0WTrzJ7G2HttRLfglr4fcA2TigsIB3P78518LMLyOEldxEF
 jaJKy3n61oLct7z9qCL9q6ReOYrvtitVZgr6fRAPOOWn0nMwla0TbO99KEgVdzoZlanonnaHJAPbB
 ldyH6ODGBJuVkWHOTax+S5O2yWFFOgA5wMmVGmSN8frQyn3hvHvVmuxYyooPEfNUqwMlIvZbbiXdh
 mvM3D1BBjc/Kq0xA8hT5SQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pg7sX-0005rX-BP; Sat, 25 Mar 2023 13:40:33 -0400
Date: Sat, 25 Mar 2023 20:40:30 +0300
Message-Id: <83jzz4bugh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN> (message from
 Dmitry Gutov on Sat, 25 Mar 2023 19:05:13 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 25 Mar 2023 19:05:13 +0200
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 25/03/2023 18:24, Eli Zaretskii wrote:
> >> From: Dmitry Gutov <dgutov@HIDDEN>
> >> Cc: "wkirschbaum@HIDDEN" <wkirschbaum@HIDDEN>,
> >> 	"casouri@HIDDEN" <casouri@HIDDEN>,
> >> 	"62333 <at> debbugs.gnu.org" <62333 <at> debbugs.gnu.org>
> >> Date: Sat, 25 Mar 2023 19:03:45 +0300
> >>
> >>    But if the mmm framework narrowed the region to the current mode's
> >>    block, widening will force tree-sitter to parse the whole buffer.
> >>
> >>   No, because such a mode mode should already make sure this doesn't
> >>   happen.
> >>
> >> How?
> > 
> > The same way it makes sure a given parser is used only on the portion
> > of the buffer where the corresponding language is used.
> 
> It uses narrowing.

How does that work with features such as font-lock, which do widen?

Anyway, isn't this discussion a bit premature, as no TS mode has been
used with the mmm framework yet?  Because when they do, I imagine they
will need to invent some mechanism that is more reliable than
narrowing.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 19:33:01 +0000
Resent-Message-ID: <handler.62333.B62333.16797727399942 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16797727399942
          (code B ref 62333); Sat, 25 Mar 2023 19:33:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 19:32:19 +0000
Received: from localhost ([127.0.0.1]:43543 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pg9ch-0002aI-Kh
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 15:32:19 -0400
Received: from mail-pf1-f171.google.com ([209.85.210.171]:46755)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pg9cg-0002a2-6y
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 15:32:18 -0400
Received: by mail-pf1-f171.google.com with SMTP id cu12so3219193pfb.13
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 12:32:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679772732;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=am8zMRk96WhVo8Gz1hhPALpLqidkqFHbifBgDqDqI2I=;
 b=Z6KWdcOAfmCOlejPsnv635Yfv2VYpC5IhScwEYM0RFKLU1gfUQfX6pPlrZNAowi8bs
 Qf/Kq9kWYTeip8RjKE/CI8Uj7xDFh0jIThqDFmqgxOQGwWhk4LvteC4AQATlPBeDtqP3
 lC1No2P9AbdU6FMm3JnUEZbkVljkY5IilTJ9KQ65wjM2AOc8Wv8V/iwgOnMKN1tYoUVR
 QWuJ8LFwqfZIXxLUhZ65xIrn8oqlepngr0VC3Rphfj051IAEyxngdljrm/egNMbUOOcI
 BjF/cyCC+FbIQSKt5C3JP4+FNVbxa5eM3wQj3JoCXJb5RLJcpYDHmpkUFSstdcEpAeZX
 zqbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679772732;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=am8zMRk96WhVo8Gz1hhPALpLqidkqFHbifBgDqDqI2I=;
 b=5E7WLc+9MAm0ZZPz4eKOsJNuXf+V7FmL7HGBIe5+v3O1Hf/xQG8oWXIvsy2h/Ch/Vc
 KcsjKFC+G9kRpYato35ixb1zjya9lBck3Wlj8bCYvfubLb/AYQpuNT8HLhTgoVgGvHUi
 UUeKxcOBEEv+ao0ZORhw+W8pKxDeEBWhTwbIUlFs59SM+jGB0bCTtpBlsHXyLorcjiKS
 TUkW3msUjQq/wR6hGu90Dn6a8P5Dn5e7WJds7XuYB2iZuEYY9fNp8eez4n/zJ7biCy3u
 zmDZigibd3KS75USySApC93Xq+TgX2DMfFFzgjkisvtMAUEVUZGC19dWOlSW+/uUNozR
 /UqQ==
X-Gm-Message-State: AAQBX9fGlARRzGePHO5XnaMIhoTorqgsQHWElmzpIqTI3HfHEWM4D/5/
 z8kjsPz3aOxxQOlpQPJ28wE=
X-Google-Smtp-Source: AKy350YXBYH7spFnNkk9jVRssnGTkygmaYPhx9ttT/GLUfqz8Gcag5xwrKBVzb1UcWDTCbWv2obR5A==
X-Received: by 2002:aa7:8ec3:0:b0:625:cc03:df34 with SMTP id
 b3-20020aa78ec3000000b00625cc03df34mr6339328pfr.1.1679772732233; 
 Sat, 25 Mar 2023 12:32:12 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 j6-20020a62e906000000b0062a56e51fd7sm4731217pfh.188.2023.03.25.12.32.11
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 25 Mar 2023 12:32:11 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83jzz4bugh.fsf@HIDDEN>
Date: Sat, 25 Mar 2023 12:31:58 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


I don=E2=80=99t think we should blindly widen in tree-sitter sexp =
functions, but not because of mmm-mode=E2=80=94tree-sitter ranges should =
have that mostly covered. My primary concern is that what if narrowing =
is intended by the caller?

But I don=E2=80=99t have any good idea for blink-matching right now.

Yuan=




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 22:58:02 +0000
Resent-Message-ID: <handler.62333.B62333.167978505430662 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167978505430662
          (code B ref 62333); Sat, 25 Mar 2023 22:58:02 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 22:57:34 +0000
Received: from localhost ([127.0.0.1]:43638 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgCpK-0007yU-AI
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 18:57:34 -0400
Received: from mail-wm1-f47.google.com ([209.85.128.47]:37640)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgCpH-0007yD-Oi
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 18:57:32 -0400
Received: by mail-wm1-f47.google.com with SMTP id
 n10-20020a05600c4f8a00b003ee93d2c914so4818354wmq.2
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 15:57:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679785046;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=Qcu+9+ucx4Pu+/fOPRGT/vbK7Ctk8wgg4ksWYs0Cxms=;
 b=FSttaytTGXf/ZalgZw9W3rFGzS3MVZCYHFBlXAo742kLAQVfRnbYXtCoeC3FEMYEwx
 rFDFrJIKbO0X0wHm6tNniKioN6MyQhCRYY7fCdBk+LIfIBa3pErA89FLI6im8cipFIdp
 Kww02UN+ymKpAoEVqAEpYsCioLhzC/LQxCaGweS9tRCewzZmm0MipBU4Sn15CrCjLRk1
 +Hw2JC2AatFj7ZmTLIsMPIu1i1uqwKExYjpzvBFiG3o9qdzJORdeQYNlf/rN+Nuc10ZS
 L40LNCJiHIAPhQid0KdbQIoU9+61kdIi4HUFT0lsYKUDVctBo6gMVDpJad/Am7LbR0aa
 KAow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679785046;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=Qcu+9+ucx4Pu+/fOPRGT/vbK7Ctk8wgg4ksWYs0Cxms=;
 b=36+r+NT66AV1cAaJNf8LuIsyUU3yj6eq9EEWCl7evsfTnxkq2JT78C5xUZnhHwjEOF
 ZtytEWMT/HKq0FDfs9XziM3osQu04YG7PEyuq5XMhH1yVghLrbMy5IDMGDuegV2INNf0
 NqRCMkvE2Np1ou+f1xCSSMt4LqgHyO8ZwYflJN0XS+SfLOvou0S/IPFinqDHZRJIeVKZ
 +cuAhuuU41U5YJ6PRhoiArjYFB4k+I419oXIFskAL7VXOk7DN0UZwAoPKsZHSoVzkfCS
 5Qfy5P3N9BDe6Wcl3cl4bdDFy72NXt20fIZviNKhmebdRRtfppNPb4RpfycWrAEHkfCI
 lfxA==
X-Gm-Message-State: AO0yUKWGsLWdWh5Zj4XBX4o7PnfGYSwmc4zlwNH0Cb4k9UIvy5JAj+17
 FB8PrhxtA3/ZhbcR996xlmTmsiWS7D1ZLg==
X-Google-Smtp-Source: AK7set/ssuZ8NqM/o1bA1PV7BdIWhvY4BWJ+Ny+rIV1udIcNbYSbpbGSvhGF2ip+dpY3YlFUDQm+5A==
X-Received: by 2002:a7b:c409:0:b0:3ee:19b4:a2e6 with SMTP id
 k9-20020a7bc409000000b003ee19b4a2e6mr5660394wmi.19.1679785045809; 
 Sat, 25 Mar 2023 15:57:25 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 p20-20020a7bcc94000000b003edd1c44b57sm8974070wma.27.2023.03.25.15.57.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 25 Mar 2023 15:57:25 -0700 (PDT)
Message-ID: <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
Date: Sun, 26 Mar 2023 00:57:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83jzz4bugh.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 25/03/2023 19:40, Eli Zaretskii wrote:
>> Date: Sat, 25 Mar 2023 19:05:13 +0200
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>> On 25/03/2023 18:24, Eli Zaretskii wrote:
>>>> From: Dmitry Gutov <dgutov@HIDDEN>
>>>> Cc: "wkirschbaum@HIDDEN" <wkirschbaum@HIDDEN>,
>>>> 	"casouri@HIDDEN" <casouri@HIDDEN>,
>>>> 	"62333 <at> debbugs.gnu.org" <62333 <at> debbugs.gnu.org>
>>>> Date: Sat, 25 Mar 2023 19:03:45 +0300
>>>>
>>>>     But if the mmm framework narrowed the region to the current mode's
>>>>     block, widening will force tree-sitter to parse the whole buffer.
>>>>
>>>>    No, because such a mode mode should already make sure this doesn't
>>>>    happen.
>>>>
>>>> How?
>>>
>>> The same way it makes sure a given parser is used only on the portion
>>> of the buffer where the corresponding language is used.
>>
>> It uses narrowing.
> 
> How does that work with features such as font-lock, which do widen?

Using font-lock-dont-widen.

We've had this discussion several times over by now. Should it be 
documented somewhere?

> Anyway, isn't this discussion a bit premature, as no TS mode has been
> used with the mmm framework yet?

There is no reason to assume that: the combinations of modes are just a 
matter of user configuration. And so far it should be working okay.

> Because when they do, I imagine they
> will need to invent some mechanism that is more reliable than
> narrowing.

"They" is me. I'd rather the general mechanism keeps working, or we come 
up with another general mechanism that is a better substitute, before 
breaking this one.

And anyway, I like I mentioned, this will break this common pattern as well:

   (save-restriction
     (narrow-to-region ... some-limit-position)
     (forward-sexp))

I've used it in ruby-syntax-propertize-percent-literal, for example. 
Except with 'forward-list' rather than 'forward-sexp', but others can 
use the latter.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sat, 25 Mar 2023 23:31:01 +0000
Resent-Message-ID: <handler.62333.B62333.16797870081245 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16797870081245
          (code B ref 62333); Sat, 25 Mar 2023 23:31:01 +0000
Received: (at 62333) by debbugs.gnu.org; 25 Mar 2023 23:30:08 +0000
Received: from localhost ([127.0.0.1]:43650 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgDKp-0000K1-R7
	for submit <at> debbugs.gnu.org; Sat, 25 Mar 2023 19:30:08 -0400
Received: from mail-wr1-f48.google.com ([209.85.221.48]:41476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgDKo-0000Hw-NQ
 for 62333 <at> debbugs.gnu.org; Sat, 25 Mar 2023 19:30:07 -0400
Received: by mail-wr1-f48.google.com with SMTP id h17so5139473wrt.8
 for <62333 <at> debbugs.gnu.org>; Sat, 25 Mar 2023 16:30:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679787001;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=rhYN1Go4wxuNKyTlqiQyAhRjPFKRM02o0HgYocdZqWA=;
 b=ePHPKdWU3kM2TqhkXOwWBLD/N3mLhwwNonhNlZpgg4/L39nlAEryt2SAQ4uamBqGD4
 njFdeDzzOD1u8mhHRrK6GCQXUH2C8fGe+leoUAmqsngNM/N5a72kBj1pVEn3uscML+f+
 QZbr57MviyQFVH471Z673vMCjRth5Vh8DegO+Z0SO6gJLXnejg2t1E2//RkxV5j8nCns
 kAlTpFpsuZJYX33raCmCeQgVRuEoBOaqtdvQv/dHKzDtNp80JBVBqd+Lu0EC1vGRgoLg
 J7i6QBs/+YmvXjtdSNY2Jo/xHlqAD1WMS39lGDFiW3oT+FFJRb/wI+Ymc/VlpSuZpiQK
 y+Rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679787001;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=rhYN1Go4wxuNKyTlqiQyAhRjPFKRM02o0HgYocdZqWA=;
 b=Av3tMpejB37izHyPN3YTzjBlH/WxjbyAYMevEdF5ZAb/R3abwGlp/HxqD+XUTOe385
 zn24sZGfyGt50j5lYhtwdBe5JRG7X4CSz7md2NUu2EiUwS8tFkE0EGwrEdcNR2jbimvm
 SOMVp0PqCbkjNlAvJlKZeFljmkTdwxq+CqjtonvgHel8UX1dK7qqSjhwsP7xTzXYlZ5j
 hwQdo/Yxznx2+lQtTdvNwMDCAufejbFef3225JvuDrsxHDTZ4rxIFCYjGjjgInx4CS2X
 5XWWTPbPQ/k1xYoYKWW34hZpq89xOlF4Z+dkf496zyGIeutkBmBwjMlVnwCibAf4H/oc
 Fv6Q==
X-Gm-Message-State: AAQBX9cN14NRceAqpH7QpbL4mBXRrCybEvwyv8pKOgWMpKxKHFZR99LI
 Hc8wF+As+DexpgSEiqkEHEM=
X-Google-Smtp-Source: AKy350YGv4DE2xGKiyt6VnePfH2wpT4RTW0ZFdX8R1bah2P+vH7vfLhUeiMyCiAarC7is6ZNZ2BkXg==
X-Received: by 2002:adf:f34b:0:b0:2cf:e956:9740 with SMTP id
 e11-20020adff34b000000b002cfe9569740mr8314294wrp.6.1679787000687; 
 Sat, 25 Mar 2023 16:30:00 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 o6-20020adfeac6000000b002c71a32394dsm21572771wrn.64.2023.03.25.16.29.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 25 Mar 2023 16:30:00 -0700 (PDT)
Message-ID: <1ef42ce9-e7a5-5a21-e4a4-f8affb45541d@HIDDEN>
Date: Sun, 26 Mar 2023 01:29:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 25/03/2023 21:31, Yuan Fu wrote:
> 
> I don’t think we should blindly widen in tree-sitter sexp functions, but not because of mmm-mode—tree-sitter ranges should have that mostly covered. My primary concern is that what if narrowing is intended by the caller?

Yes.

> But I don’t have any good idea for blink-matching right now.

show-paren-mode has show-paren-data-function (which treesit should also 
plug into, I think).

Since we're looking for ad-hoc solutions, we could add a similar 
extension point for blink-matching-paren.

Or even try to reuse show-paren-data-function: just specialize in a 
limited number of cases - check that (nth 1 data) matches point, and 
then take the elements 3,4 and perform the existing checks on them. 
There might be some differences in behavior, but probably nothing some 
checks using 'syntax-after' couldn't handle.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 Mar 2023 04:29:01 +0000
Resent-Message-ID: <handler.62333.B62333.167980491631073 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>
Cc: wkirschbaum@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167980491631073
          (code B ref 62333); Sun, 26 Mar 2023 04:29:01 +0000
Received: (at 62333) by debbugs.gnu.org; 26 Mar 2023 04:28:36 +0000
Received: from localhost ([127.0.0.1]:43794 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgHzg-000857-Be
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 00:28:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:39986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pgHze-00084s-9K
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 00:28:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgHzY-0004kz-Qa; Sun, 26 Mar 2023 00:28:28 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=kiFSRSPT5MiEhdqf9joAD1Hby7M8RSvM2USDd6DtBLI=; b=iXgxq3EONHdYhCnl4pfg
 3v0ogVmqS3veJKsygxU8niYG+9sHXiqHeSsx496PgHtit/i68VeRyEnlgzGf7fupHH0Cxwk3I77Bv
 UYtcRojntl+J/4n4HOSZWeMo+NaIPiCwkhlB94/Re5/+ZUliaJDWYN5UeN+Fwu9LO/gmJRk5o7rtV
 Jgd3pyFH3Gs6XJPtiw/DMqskGasTp5g3Ii8W3WrYRS1e2frOxPPbkyHCB8SubDfXJ5+2+SnntRK64
 hFdh6FyfNxFPK3Hi9xSbatXrqoUtbaG+RTX7nLZGMDP0CIlgeVZZ5lvyB6MhXO8nJwFCcTFMThMEs
 LKhRDhpuk/BFvg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgHzY-00056S-6C; Sun, 26 Mar 2023 00:28:28 -0400
Date: Sun, 26 Mar 2023 07:28:27 +0300
Message-Id: <83a600b0gk.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN> (message from
 Yuan Fu on Sat, 25 Mar 2023 12:31:58 -0700)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Sat, 25 Mar 2023 12:31:58 -0700
> Cc: Dmitry Gutov <dgutov@HIDDEN>,
>  Wilhelm Kirschbaum <wkirschbaum@HIDDEN>,
>  62333 <at> debbugs.gnu.org
> 
> 
> I don’t think we should blindly widen in tree-sitter sexp functions, but not because of mmm-mode—tree-sitter ranges should have that mostly covered. My primary concern is that what if narrowing is intended by the caller?

What could be the reason for the caller to narrow when calling a
sexp-movement function?  Keep in mind that the only narrowing that
matters is one that prevents the sexp-movement function to find the
target of the movement.

> But I don’t have any good idea for blink-matching right now.

We could leave this alone for now, but in that case let's at least add
some FIXME comment in the relevant place(s), so that we could later
revisit this.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 Mar 2023 05:05:01 +0000
Resent-Message-ID: <handler.62333.B62333.16798070812399 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16798070812399
          (code B ref 62333); Sun, 26 Mar 2023 05:05:01 +0000
Received: (at 62333) by debbugs.gnu.org; 26 Mar 2023 05:04:41 +0000
Received: from localhost ([127.0.0.1]:43830 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgIYb-0000cd-Ef
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 01:04:41 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pgIYZ-0000cR-NP
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 01:04:40 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgIYU-0003L7-08; Sun, 26 Mar 2023 01:04:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=dgzvVCuYqXQGEUNiiF1Ux0GEvwYoN1QDazXtZYvIsRk=; b=nfhmKJS7Ygs5
 7tvQOYPermX6g/GI1G/YfajmBFgCNZaNFMb7MknqQ1A5FI1MsPkDCnsqMDG1WPNgrzyBoT4d3VP0a
 XB4U/lF43GsojBssrIPNfNHqAUXQYJxL3rnyWDq02dRW2zFajEE2/JAWr3dz8/hQmLEF2kUme8dDD
 4MYz4tc/CX3/KABmmLt5roanuS/WLL5I3XN3GqTVmIcbKiB6gD5IZi+unxoHHbyPk28v0hZzk1N5o
 PJAyXwW9J0nd58vJP8cIoGKQAD8rqrVgF9eVNhjRf2fFkhETDVERm+flZLXzU7AQGLeSC/IyZJNAN
 chHOQvgxyAx2KnE89EP47A==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgIYQ-0006qd-QW; Sun, 26 Mar 2023 01:04:33 -0400
Date: Sun, 26 Mar 2023 08:04:30 +0300
Message-Id: <831qlcaysh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN> (message from
 Dmitry Gutov on Sun, 26 Mar 2023 00:57:22 +0200)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 26 Mar 2023 00:57:22 +0200
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> > How does that work with features such as font-lock, which do widen?
> 
> Using font-lock-dont-widen.

That's only for font-lock.  Parsing was not on the table when that was
introduced, so it doesn't have a similar mechanism.

> We've had this discussion several times over by now. Should it be 
> documented somewhere?

Probably, but that's a tangent.

> > Anyway, isn't this discussion a bit premature, as no TS mode has been
> > used with the mmm framework yet?
> 
> There is no reason to assume that: the combinations of modes are just a 
> matter of user configuration. And so far it should be working okay.

Again, I'm talking about using a parser library.  We may need to
introduce a way of limiting the parser to a certain range of buffer
text positions, independently of narrowing.  As we all know, narrowing
is a problematic feature to use in Lisp programs, so maybe we should
do this better in the case of parsers.  Then problems like this one
could be solved more cleanly and simply.

> And anyway, I like I mentioned, this will break this common pattern as well:
> 
>    (save-restriction
>      (narrow-to-region ... some-limit-position)
>      (forward-sexp))
> 
> I've used it in ruby-syntax-propertize-percent-literal, for example. 
> Except with 'forward-list' rather than 'forward-sexp', but others can 
> use the latter.

You want to repeat all the arguments we already brought up?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 Mar 2023 09:26:02 +0000
Resent-Message-ID: <handler.62333.B62333.167982274130784 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167982274130784
          (code B ref 62333); Sun, 26 Mar 2023 09:26:02 +0000
Received: (at 62333) by debbugs.gnu.org; 26 Mar 2023 09:25:41 +0000
Received: from localhost ([127.0.0.1]:44065 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgMdA-00080S-IV
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 05:25:40 -0400
Received: from mail-wm1-f48.google.com ([209.85.128.48]:51943)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgMd8-00080E-Pm
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 05:25:39 -0400
Received: by mail-wm1-f48.google.com with SMTP id o32so3389565wms.1
 for <62333 <at> debbugs.gnu.org>; Sun, 26 Mar 2023 02:25:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679822733;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=5Dz1bRNUrWy4Lh+bKNynIeoAulJ+vflHmjGcgHhti3M=;
 b=BUiyIHlH2Fvn+uNLT6lyHrylsfMUhBttSD4vXuHlKW5K4rxiakvfr0pEd/ChVjiXqW
 3t92odhtv5bgKbEnXl2oNP4vJYvKZljXIy2sZJv2/NJOl8cIAjnNMr+Z3W2YBz4GUeBT
 tG7IKXPsPzUWbvvGQMMRq5B1RP2UXF4qP0Rg/tL5j+alZ6+stfGNlRdvJ/DUHrlpqJhf
 L0dQdVpixBnYiMscUrhDgYhlPCSP337rZOSqd56/DcveKsYLLxMgOPFAFHXxyn9A/XiK
 o+jwP56m8Oz71qK54DtPmU48qEW6/8ro7ulPnFiUKrKujU/YToQ4rEGoe6gINCa5UQgk
 00RQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679822733;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=5Dz1bRNUrWy4Lh+bKNynIeoAulJ+vflHmjGcgHhti3M=;
 b=5O9eZVZ5ghaf7VvN8Dleg/dNA1SmDdSnrIWssR1s5N64bQoheAV9xEiZnVqSHMPhQr
 5xXe4H9e+HcfPuqtY1OzmKx+FCy6UdboM9oX9Ss5p7gBb7Z+rkxpTnBl9E3DcjQJC8p1
 FxXhdQcibzHprrWdHJoawmEmDDYxAxk00IsuDseAwM1NNAfgk3zDPA9NZZVvI6j3Fv7H
 OMEmqR8PLyuhAMEY0CAkxppTsW5VoqueiatspqNQYSYNQ1OTE0+BGqBgy4TipdvIkHnH
 NZDGBiBOgAACQt9G2ecEk6tJmH+gndrqqMCHR/svNkj22Cmk1v+4lYW3MtVGRfPil3nd
 YmNg==
X-Gm-Message-State: AO0yUKXlsgq4yJCt8AFpqK6HWDNqPzAOyHnd4Zjg5eeqq1BQx0RLlVTP
 aGjm4a7nU3PbcZSwui537tg=
X-Google-Smtp-Source: AK7set9rUlcaDOCrOqdv7IM/9aldJ9bgt7PAunCV3tXi83CisNn/6SN8AbdzP0717MsAFeDYgNKrkg==
X-Received: by 2002:a1c:7910:0:b0:3eb:3998:8c05 with SMTP id
 l16-20020a1c7910000000b003eb39988c05mr6093572wme.6.1679822732777; 
 Sun, 26 Mar 2023 02:25:32 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 o9-20020a05600c510900b003ed793d9de0sm16994393wms.1.2023.03.26.02.25.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 26 Mar 2023 02:25:32 -0700 (PDT)
Message-ID: <29679184-7366-0167-9e94-def97048f663@HIDDEN>
Date: Sun, 26 Mar 2023 12:25:30 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <831qlcaysh.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 26/03/2023 08:04, Eli Zaretskii wrote:
>> Date: Sun, 26 Mar 2023 00:57:22 +0200
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>>> How does that work with features such as font-lock, which do widen?
>>
>> Using font-lock-dont-widen.
> 
> That's only for font-lock.  Parsing was not on the table when that was
> introduced, so it doesn't have a similar mechanism.

Parsing is on-demand, by font-lock and other features.

>> We've had this discussion several times over by now. Should it be
>> documented somewhere?
> 
> Probably, but that's a tangent.
> 
>>> Anyway, isn't this discussion a bit premature, as no TS mode has been
>>> used with the mmm framework yet?
>>
>> There is no reason to assume that: the combinations of modes are just a
>> matter of user configuration. And so far it should be working okay.
> 
> Again, I'm talking about using a parser library.  We may need to
> introduce a way of limiting the parser to a certain range of buffer
> text positions, independently of narrowing.

Except it's already limited by narrowing.

> As we all know, narrowing
> is a problematic feature to use in Lisp programs, so maybe we should
> do this better in the case of parsers.  Then problems like this one
> could be solved more cleanly and simply.

Narrowing problematic to use in Lisp?

>> And anyway, I like I mentioned, this will break this common pattern as well:
>>
>>     (save-restriction
>>       (narrow-to-region ... some-limit-position)
>>       (forward-sexp))
>>
>> I've used it in ruby-syntax-propertize-percent-literal, for example.
>> Except with 'forward-list' rather than 'forward-sexp', but others can
>> use the latter.
> 
> You want to repeat all the arguments we already brought up?

You might choose to ignore a third-party mode, but breaking a common 
pattern seems more dangerous.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 Mar 2023 10:02:02 +0000
Resent-Message-ID: <handler.62333.B62333.16798248722099 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16798248722099
          (code B ref 62333); Sun, 26 Mar 2023 10:02:02 +0000
Received: (at 62333) by debbugs.gnu.org; 26 Mar 2023 10:01:12 +0000
Received: from localhost ([127.0.0.1]:44099 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgNBY-0000Xm-DK
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 06:01:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58746)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pgNBX-0000XY-98
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 06:01:11 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgNBQ-0007qr-Au; Sun, 26 Mar 2023 06:01:04 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=qleRDqit2tSuMJ7DLaKV8qIAAoyVl60tTtXEFkTYdPo=; b=boQjz6LXokej
 213wc1RPuL6feHbDbjSokB/SJvpqh0HkEbTQeL/iRCHYJlGOpfrEs+5b6Ro5sy0iLgl+BcC/RY2Il
 HKDIV5Zcq6bE52ghBXl8uUaXnAXTJH+dE0k0xHWsXtO3uChkOJQx8l3fd+j7NHooYBZwj2KzvLckD
 cECBoxaQskA65VyPXUOQlB3wAMUhBSfCfhFIsJdBKVrnk2OWM50XGT++/chsJF//6220yVosjBQyz
 pPILnntRbHfAdQWgZ/NpSdhBx1Qn6sCyK9Gee0iO+TRqc0G7OVegH97dygTBUFI25bRuOeIsKWv1g
 2B9422KMPfV7Wc793gRhRQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgNBP-0006Se-QE; Sun, 26 Mar 2023 06:01:04 -0400
Date: Sun, 26 Mar 2023 13:01:02 +0300
Message-Id: <83v8inal29.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <29679184-7366-0167-9e94-def97048f663@HIDDEN> (message from
 Dmitry Gutov on Sun, 26 Mar 2023 12:25:30 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sun, 26 Mar 2023 12:25:30 +0300
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 26/03/2023 08:04, Eli Zaretskii wrote:
> >> Date: Sun, 26 Mar 2023 00:57:22 +0200
> >> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> >> From: Dmitry Gutov <dgutov@HIDDEN>
> >>
> >>> How does that work with features such as font-lock, which do widen?
> >>
> >> Using font-lock-dont-widen.
> > 
> > That's only for font-lock.  Parsing was not on the table when that was
> > introduced, so it doesn't have a similar mechanism.
> 
> Parsing is on-demand, by font-lock and other features.

So you are suggesting to introduce kludges like font-lock-dont-widen
in all of those places?  I don't even see how we will find them all in
advance, let alone fix them or make sure they do what we want.

> > Again, I'm talking about using a parser library.  We may need to
> > introduce a way of limiting the parser to a certain range of buffer
> > text positions, independently of narrowing.
> 
> Except it's already limited by narrowing.

Which is a fragile, semi-broken means, as we all know.

> > As we all know, narrowing
> > is a problematic feature to use in Lisp programs, so maybe we should
> > do this better in the case of parsers.  Then problems like this one
> > could be solved more cleanly and simply.
> 
> Narrowing problematic to use in Lisp?

Yes, because users can easily change narrowing.  We've had problems
with that many times, and even some attempts at solving it, so why are
you pretending you don't know about those deficiencies?

> >> And anyway, I like I mentioned, this will break this common pattern as well:
> >>
> >>     (save-restriction
> >>       (narrow-to-region ... some-limit-position)
> >>       (forward-sexp))
> >>
> >> I've used it in ruby-syntax-propertize-percent-literal, for example.
> >> Except with 'forward-list' rather than 'forward-sexp', but others can
> >> use the latter.
> > 
> > You want to repeat all the arguments we already brought up?
> 
> You might choose to ignore a third-party mode, but breaking a common 
> pattern seems more dangerous.

??? How does that follow from what I said?

Look, I'm trying to see how we could come up with an infrastructure
that will support multiple modes and other similar features in the
same buffer without relying on narrowing, thus bypassing the
disadvantages and difficulties that come with narrowing.  I think we
have a good chance here to come up with such a solution, specifically
for features that us a parsing library.  If you aren't interested in
discussing that, and think we should stick to narrowing, then this
goes nowhere, and I'd rather bow out of it.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 Mar 2023 22:01:02 +0000
Resent-Message-ID: <handler.62333.B62333.1679868031742 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.1679868031742
          (code B ref 62333); Sun, 26 Mar 2023 22:01:02 +0000
Received: (at 62333) by debbugs.gnu.org; 26 Mar 2023 22:00:31 +0000
Received: from localhost ([127.0.0.1]:46032 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgYPe-0000Bt-Kc
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 18:00:31 -0400
Received: from mail-wm1-f52.google.com ([209.85.128.52]:37561)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgYPc-0000Bd-Du
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 18:00:29 -0400
Received: by mail-wm1-f52.google.com with SMTP id
 n10-20020a05600c4f8a00b003ee93d2c914so5851443wmq.2
 for <62333 <at> debbugs.gnu.org>; Sun, 26 Mar 2023 15:00:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679868022;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=9Oi9j8eJL7/nD1QEy70M/3n7TIVb6pFgfsJ9GDVQ9ak=;
 b=LlDLMD+a0tjgfCa8xrgXfvfkaLYm26RVgITBLS1Jdtkx2HeoJeI/6EKJ7wZAJ8Okv7
 bz/UHecz2CRDjdDjRtgA6Xbv5DjTPFGl12jSK8mPlECgPXNFjZ9msQBKh1EORX+A/nY6
 2CX82yO7aUoZTPGtaYDfPPgr9/mQiDRjB5902uwGjNoPmMrwfzX6fKCKKo3TXOqYLSBh
 xVdArULkWfUSQR56dmxh/6gFM6L/wUz/wHLv8DIQ+FyqSN8TgBwjOXPB0OMX5H8Uo/IP
 jJwimkNhYHX/eIUa6k7egpoy39pejLbP//c2+tl9+L6AXo3PVQsQbOdNUEvUQ8memADO
 yyTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679868022;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=9Oi9j8eJL7/nD1QEy70M/3n7TIVb6pFgfsJ9GDVQ9ak=;
 b=CZHmHlCkI/p0XNbgPsJ2KrCygHXMPGwxS5UGl8QskGFFN/KfNQEBglcA0B3cldiPyF
 f+jp85Cr/AXS9xyjvWv6e4imPU5ODK9wN7y0cWfTBup3ukn22/kckOZq3gqH+1EH3FXj
 AHG8AuoQg9ZT7eeTRyZWFZedO0+G5LftBbM2iTkUjHMT0kD51+jyh1+O428Bf1XFEDAk
 5hXmgSiqPJN78JbfZHgDCwLJSa9HEdsD4xlMzlk1EeBa+r3Rrlt1BwvIHaJ8YSFoSixP
 siVIh/m9kCVdPzneu8Hvo/VXFFf5CM+UUgmMPX3jZHGGOO6G4hyaW/gqH7MdnM0ira2s
 g1xA==
X-Gm-Message-State: AAQBX9eG/CzrtgJ9dGhzfNLVoN6tXQwhsGbIquUt3PLpp1oZ8kV3Nrbp
 awT1FqLTzeNR0dtT6kfLhVI=
X-Google-Smtp-Source: AKy350YyUVW+cvzHHq3w4RyjVA8woulPKei7icSj/CC8WNtMfsjl/OBGgpPQFzy3DrdQFSQetjkP+A==
X-Received: by 2002:a7b:ce84:0:b0:3ef:6fee:803a with SMTP id
 q4-20020a7bce84000000b003ef6fee803amr209742wmj.35.1679868022332; 
 Sun, 26 Mar 2023 15:00:22 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 l18-20020a05600c4f1200b003ef67848a21sm4778400wmq.13.2023.03.26.15.00.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 26 Mar 2023 15:00:21 -0700 (PDT)
Message-ID: <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
Date: Mon, 27 Mar 2023 01:00:20 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83v8inal29.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 26/03/2023 13:01, Eli Zaretskii wrote:
>> Date: Sun, 26 Mar 2023 12:25:30 +0300
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>> On 26/03/2023 08:04, Eli Zaretskii wrote:
>>>> Date: Sun, 26 Mar 2023 00:57:22 +0200
>>>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>>>> From: Dmitry Gutov <dgutov@HIDDEN>
>>>>
>>>>> How does that work with features such as font-lock, which do widen?
>>>>
>>>> Using font-lock-dont-widen.
>>>
>>> That's only for font-lock.  Parsing was not on the table when that was
>>> introduced, so it doesn't have a similar mechanism.
>>
>> Parsing is on-demand, by font-lock and other features.
> 
> So you are suggesting to introduce kludges like font-lock-dont-widen
> in all of those places?

font-lock-dont-widen is a kludge, but that's largely determined by the 
way it's defined and used.

If we take indent-for-tab-command, for example, it doesn't have such a 
variable, and doesn't really need to: the top-level command calls 
'widen', and then indent-line-function (set by major mode and altered by 
e.g. mmm-mode) is free to impose its specific bounds.

I think, as far the immediate problem is concerned, blink-matching-paren 
could use the same route. And could even try to reuse 
show-paren-data-function instead of creating its own customization point.

> I don't even see how we will find them all in
> advance, let alone fix them or make sure they do what we want.

Just do it step-by-step.

The "grand unified theory of mixed major modes" has been attempted a few 
times in the past, and never reached anything practical. That's not to 
say nobody should try again, but they should keep that in mind.

>>> Again, I'm talking about using a parser library.  We may need to
>>> introduce a way of limiting the parser to a certain range of buffer
>>> text positions, independently of narrowing.
>>
>> Except it's already limited by narrowing.
> 
> Which is a fragile, semi-broken means, as we all know.

What is a broken mess, is user-level narrowing. And how the downstream 
code can never guess the purpose the narrowing was applied for.

>>> As we all know, narrowing
>>> is a problematic feature to use in Lisp programs, so maybe we should
>>> do this better in the case of parsers.  Then problems like this one
>>> could be solved more cleanly and simply.
>>
>> Narrowing problematic to use in Lisp?
> 
> Yes, because users can easily change narrowing.  We've had problems
> with that many times, and even some attempts at solving it, so why are
> you pretending you don't know about those deficiencies?

Because I suggested deprecating certain uses of it several times, and 
always got a "no" for an answer.

>>>> And anyway, I like I mentioned, this will break this common pattern as well:
>>>>
>>>>      (save-restriction
>>>>        (narrow-to-region ... some-limit-position)
>>>>        (forward-sexp))
>>>>
>>>> I've used it in ruby-syntax-propertize-percent-literal, for example.
>>>> Except with 'forward-list' rather than 'forward-sexp', but others can
>>>> use the latter.
>>>
>>> You want to repeat all the arguments we already brought up?
>>
>> You might choose to ignore a third-party mode, but breaking a common
>> pattern seems more dangerous.
> 
> ??? How does that follow from what I said?
> 
> Look, I'm trying to see how we could come up with an infrastructure
> that will support multiple modes and other similar features in the
> same buffer without relying on narrowing, thus bypassing the
> disadvantages and difficulties that come with narrowing.  I think we
> have a good chance here to come up with such a solution, specifically
> for features that us a parsing library.  If you aren't interested in
> discussing that, and think we should stick to narrowing, then this
> goes nowhere, and I'd rather bow out of it.

What I've seen here so far is you suggesting we go ahead and break the 
existing convention and then let "them" (third-party authors including 
myself) come up with a new working one.

My stance here is we shouldn't break it before we create a new one. And 
I'm happy to discuss it, of course. Just please don't expect me to take 
the initiative at this point.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 Mar 2023 22:54:02 +0000
Resent-Message-ID: <handler.62333.B62333.167987118415878 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167987118415878
          (code B ref 62333); Sun, 26 Mar 2023 22:54:02 +0000
Received: (at 62333) by debbugs.gnu.org; 26 Mar 2023 22:53:04 +0000
Received: from localhost ([127.0.0.1]:46090 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgZEV-000481-Jo
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 18:53:03 -0400
Received: from mail-pj1-f54.google.com ([209.85.216.54]:54260)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pgZET-00047W-7H
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 18:53:01 -0400
Received: by mail-pj1-f54.google.com with SMTP id q102so6052861pjq.3
 for <62333 <at> debbugs.gnu.org>; Sun, 26 Mar 2023 15:53:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679871175;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=XgpDxCuZWM74HrbDWsgdK3H0JVr2sAHq8ZQm7VgMF8Y=;
 b=CJhbLc/Uoba5odlhxbn5lj12EX/igpRic48m6DAfbMcwn/OQLgEbLT4qN4jIu3vjKi
 qQsk+guN3QOOHSa8LP2sl/nJhQmm5Ablbft63vxzU2nwwo/6cL5c0dVtBCw46z9gwA+1
 q20/b347zanN9PsPUNeAJP5rR+fONCObp/Nqc51AFBTRyRM3juBJ7uFhxLEZv7oCOLg6
 tHOgfgHhyB8yTzm9cpkArqARFLU36SM21Y1baZt6cRWhmvH9/y2HM0zyX3fmbN4nZlMD
 GjU2SItQxoxXCStxoLUFmDQ9Xdr7HdJt4j3p2pxtSO7aht25218p9xw0rxc5fdFUrpeb
 /4Mg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679871175;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=XgpDxCuZWM74HrbDWsgdK3H0JVr2sAHq8ZQm7VgMF8Y=;
 b=4yglU5Cuvyd0B39EZUtC7O4Zksdv/f1s5Z14jQtFNDm+g6ZZffXLvbrf00v9qTsPn1
 ZTaz8CLmkg5bywpVp/A1sBuB5rCsWDzfObvtLB04aL6lpkgzfNu0GbGRkcJ3inSxUXt9
 HG1DqsIIPO40gXLiPBbxsygJ89svPJUmuM4KwAN1thGM/4QZta1ggSKGObhyXW/ScMi5
 x1/L3xGMeSFw/hI94/ewnOboUJpHgl7rgKZhMhOtese50rRc1azKCt0kzNQNTAhV0bAX
 q1l6EIMUgKTdj9i2+Wq1k9qKWIu/wucys8HBUuHz1Soy/FCWYWvCgozKewgTEQXHOA+o
 VO0A==
X-Gm-Message-State: AAQBX9cFm3Upvgpk2J/CGz2BfMAxUNnb6imu6yurqd6AiOJ4KEMX4GaH
 ulDfe4TBNJ+qpL8yuGXvLfo=
X-Google-Smtp-Source: AKy350YY9eqkV+0rTjJ1sBV2JXyZ5udDKh9eHb033qjGBtMv3b2olOo0yU/r5lpqs8vz4O41ybt7DQ==
X-Received: by 2002:a17:902:f693:b0:1a1:d4ca:a161 with SMTP id
 l19-20020a170902f69300b001a1d4caa161mr12790693plg.36.1679871175057; 
 Sun, 26 Mar 2023 15:52:55 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 y20-20020a170902b49400b00196807b5189sm17699882plr.292.2023.03.26.15.52.54
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 26 Mar 2023 15:52:54 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <1ef42ce9-e7a5-5a21-e4a4-f8affb45541d@HIDDEN>
Date: Sun, 26 Mar 2023 15:52:43 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <A51363F4-12C5-46F7-832A-E4E47C0A7A72@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
 <1ef42ce9-e7a5-5a21-e4a4-f8affb45541d@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Mar 25, 2023, at 4:29 PM, Dmitry Gutov <dgutov@HIDDEN> wrote:
>=20
> On 25/03/2023 21:31, Yuan Fu wrote:
>> I don=E2=80=99t think we should blindly widen in tree-sitter sexp =
functions, but not because of mmm-mode=E2=80=94tree-sitter ranges should =
have that mostly covered. My primary concern is that what if narrowing =
is intended by the caller?
>=20
> Yes.
>=20
>> But I don=E2=80=99t have any good idea for blink-matching right now.
>=20
> show-paren-mode has show-paren-data-function (which treesit should =
also plug into, I think).
>=20
> Since we're looking for ad-hoc solutions, we could add a similar =
extension point for blink-matching-paren.
>=20
> Or even try to reuse show-paren-data-function: just specialize in a =
limited number of cases - check that (nth 1 data) matches point, and =
then take the elements 3,4 and perform the existing checks on them. =
There might be some differences in behavior, but probably nothing some =
checks using 'syntax-after' couldn't handle.

Sounds good, I can work on this. This links to something I=E2=80=99ve =
been working on, namely some system that allows one to map abstract =
general constructs like pair, list, defun, assignment, etc, to =
grammar-specific definitions like a tree-sitter node type, and =
automatically construct functions accessing those information. We =
already have a primitive version of it: right now if you set =
treesit-defun-type-regexp, treesit-beginning/end-of-defun and =
treesit-defun-at-point would just work. I want to extend it further to =
allow you to get defun name, argument list, etc, and everything else I =
mentioned earlier.

If we can pull it off, a user only need to specify what is a pair and =
how to find the matching pair according to the language grammar, and the =
rest is automatic (a tree-sitter function for show-paren-data-function =
and blink-matching-paren).

Yuan=




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 26 Mar 2023 22:59:02 +0000
Resent-Message-ID: <handler.62333.B62333.167987149416358 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167987149416358
          (code B ref 62333); Sun, 26 Mar 2023 22:59:02 +0000
Received: (at 62333) by debbugs.gnu.org; 26 Mar 2023 22:58:14 +0000
Received: from localhost ([127.0.0.1]:46094 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgZJW-0004Fl-Ci
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 18:58:14 -0400
Received: from mail-pj1-f53.google.com ([209.85.216.53]:50755)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pgZJU-0004FU-L5
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 18:58:13 -0400
Received: by mail-pj1-f53.google.com with SMTP id d13so6093068pjh.0
 for <62333 <at> debbugs.gnu.org>; Sun, 26 Mar 2023 15:58:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679871487;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=nAcyI1uSIK8SRWuGpKa6az8mCgyQ0XkaYbjAm+cyncA=;
 b=PuOpj+J9B+8/0YuBUDLRLYNCawm5kyIZfCvTJSn470eX4VfMY5vAag1aiU6ibzDgMS
 z/w5OrignTMT/1PiB0Wn8lM0O/zuJMwBzgyX3flqwEUC8BuIO8+ETbbEUcGA4GIkLatj
 O+RZFNjKzJ1gyT9FPIhaY1/TlDapYpeg0MiRcWqyRhSqlHCSRPSlfJPU7PfA2U59cwUb
 wNPCWa6UKWvKwn1RLsOYbhlq4lD/xmNE3l1MkE5w4MaZ8MCTlW3UzRzdBYt3x0D3fDKa
 i0ilj7kI5gd7J/HHFHJPSTcBhlCLVyOJZ5BMo9KSBP/6/icZXH1Kzn7HaDJdfHX5Ao7G
 HoSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679871487;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=nAcyI1uSIK8SRWuGpKa6az8mCgyQ0XkaYbjAm+cyncA=;
 b=BUjKtvvY1Gnr9iwGPqp0XiCdymV3OtmAqlOnpvnt8I2vGFXCQegtBnQPkhTOXVSkld
 sTe1HjQLARFIi+AxCVQrPjtxgKDAQxrL0CN6SLrYQaRsxUtq8v541iW/RceEADA0NjSm
 I+TVWk15ygK0gp9kbyLbKjpQ2GJiz5SG9dBV4QIdK0nw0T0R6i3fYhJM2+I5o31OuJgO
 UlFUaOBZYACnzsLup2JB2/KjHnw7//cdkZOcxvlzxohHwtTaHwgUV/7wDy4g1Y0Jv4e4
 h2BAkBAgeL0R70i0Mo0vdj8zHhnaTcfU7ryrNJf6a06Oysxe1338sMhOLF/ZzbhEXZoZ
 ZOyQ==
X-Gm-Message-State: AAQBX9e+5nQq/kOF/0nPPpJI2CAZHnGmDtcoxlzdqQXoZxPwF/GYfmJR
 znj3K4wAU4cqirgK7RBVf+0=
X-Google-Smtp-Source: AKy350ZBve5mvcU1ybfqXDfP0JfcliZBEDaPq7Wstu0HkhgFYDv5AmR0TZe4FNvGC2WBiU9Of1I+YQ==
X-Received: by 2002:a17:903:110e:b0:1a1:bfd6:f890 with SMTP id
 n14-20020a170903110e00b001a1bfd6f890mr12281579plh.9.1679871486671; 
 Sun, 26 Mar 2023 15:58:06 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 13-20020a170902c24d00b0017a032d7ae4sm17739614plg.104.2023.03.26.15.58.05
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Sun, 26 Mar 2023 15:58:06 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83a600b0gk.fsf@HIDDEN>
Date: Sun, 26 Mar 2023 15:57:55 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <C51E765F-4D67-4B0C-B88B-670FEBD1B090@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
 <83a600b0gk.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Mar 25, 2023, at 9:28 PM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Sat, 25 Mar 2023 12:31:58 -0700
>> Cc: Dmitry Gutov <dgutov@HIDDEN>,
>> Wilhelm Kirschbaum <wkirschbaum@HIDDEN>,
>> 62333 <at> debbugs.gnu.org
>>=20
>>=20
>> I don=E2=80=99t think we should blindly widen in tree-sitter sexp =
functions, but not because of mmm-mode=E2=80=94tree-sitter ranges should =
have that mostly covered. My primary concern is that what if narrowing =
is intended by the caller?
>=20
> What could be the reason for the caller to narrow when calling a
> sexp-movement function?  Keep in mind that the only narrowing that
> matters is one that prevents the sexp-movement function to find the
> target of the movement.

Maybe the user narrowed to a defun when writing code. There is a bug =
report on narrow-to-defun not working right in c-ts-mode, so there are =
definitely people who work like that.

>> But I don=E2=80=99t have any good idea for blink-matching right now.
>=20
> We could leave this alone for now, but in that case let's at least add
> some FIXME comment in the relevant place(s), so that we could later
> revisit this.

Dmitry=E2=80=99s idea sounds good, we can add a tree-sitter backend for =
show-paren-data-function, and make the backend for blink-matching-paren =
configurable, then add a backend for it that uses =
show-paren-data-function, which in turn uses tree-sitter (or we add a =
backend that uses tree-sitter directly). In either case, the tree-sitter =
backend don=E2=80=99t need to use narrowing and we are good.

Yuan





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 01:30:02 +0000
Resent-Message-ID: <handler.62333.B62333.167988056330958 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167988056330958
          (code B ref 62333); Mon, 27 Mar 2023 01:30:02 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 01:29:23 +0000
Received: from localhost ([127.0.0.1]:46151 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgbfn-00083G-0K
	for submit <at> debbugs.gnu.org; Sun, 26 Mar 2023 21:29:23 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:52942)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgbfl-000832-4g
 for 62333 <at> debbugs.gnu.org; Sun, 26 Mar 2023 21:29:21 -0400
Received: by mail-wm1-f42.google.com with SMTP id l37so4135444wms.2
 for <62333 <at> debbugs.gnu.org>; Sun, 26 Mar 2023 18:29:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679880555;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=1jedoUjaH7MTHs7RdF7as8WovRGrdotTAPYrlWTrvXM=;
 b=BBlnKt/HwUhzYhr/wk6GaiAGeQcPn6aFzCqOJZ7ywlJEKwskfCb4Wi8wvuGixxasrO
 N0bSkUOOP2tmUwQFdOIQzdS8rSiT0dkarDXjyn+hJTr/yRFB3ch1uypNQ/4yzdeFmKQb
 x0URdImDqE6pC+pqZXya22Jn5+WlOaweh8kswre7lpf+ANrsqmXH5Cz9GBDZOU3O0q6M
 pWcvU5fuF9WQCnGn/Uj+AAX5VyFPK2055d1feCMmBmaHonwWlhLwSWvO3y0rvpjRVBFZ
 8gcD/NXQpo47XlzorVmOeHL9UZrYbQKLpfEGinwYhDvkQVrmmXkeIgoMiZuj+zFGUkZn
 5mcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679880555;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=1jedoUjaH7MTHs7RdF7as8WovRGrdotTAPYrlWTrvXM=;
 b=eHVZyuh9TUCmi+ZRqEkHTaN+q3qpxDnTpZOwoLIF1vS2lyRlo4IqpE5wST2NHC64XS
 hYD9rrN5EhkcLsWWcI9YuPFrj3oJ6xlD+rrjRBCLr/WFWYMTKVBkOHq1IRumhpJShAmi
 fD4wF90HdurXOcbXiplBQS/R9KXLs0FwmOvGwap6eHDnx4bAX1pWfb25CFIVMY4PSm7T
 /VUlnc2C+G0bAO8l2W6S0BJazu9jzTlZmX7dSEvaTmRIqoAd4PwkUaIM7lUY2BvHTq6P
 39jW5pHuHgtKOlX7uDfTcKy8HbGjOEv1FPPYpy4RbhphEQWZwMMzN7QPKFIQdOvlCs+m
 jyJg==
X-Gm-Message-State: AO0yUKUFTHZEPtjzxeE17lQO6j8mNLhGAtcfZRnCncAiOb7ptWl5E8W6
 QAJ4FBjL9Xdx0HoN5jpNoWY=
X-Google-Smtp-Source: AK7set+lFKv3qa+to8s79i3SmtgfkjQFHBAe4ZZ8qmnhp8mN1wUoMp1RX+10NsQtKy2uzQevBp5M3Q==
X-Received: by 2002:a7b:cb92:0:b0:3ea:ed4d:38f6 with SMTP id
 m18-20020a7bcb92000000b003eaed4d38f6mr8151134wmi.4.1679880554951; 
 Sun, 26 Mar 2023 18:29:14 -0700 (PDT)
Received: from [192.168.0.2] ([85.132.229.92])
 by smtp.googlemail.com with ESMTPSA id
 k22-20020a05600c1c9600b003eda46d6792sm6901036wms.32.2023.03.26.18.29.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 26 Mar 2023 18:29:14 -0700 (PDT)
Message-ID: <7e84105a-7506-5e7a-5cca-bd83b6982d75@HIDDEN>
Date: Mon, 27 Mar 2023 04:29:12 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
 <1ef42ce9-e7a5-5a21-e4a4-f8affb45541d@HIDDEN>
 <A51363F4-12C5-46F7-832A-E4E47C0A7A72@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <A51363F4-12C5-46F7-832A-E4E47C0A7A72@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 27/03/2023 01:52, Yuan Fu wrote:
> If we can pull it off, a user only need to specify what is a pair and how to find the matching pair according to the language grammar, and the rest is automatic (a tree-sitter function for show-paren-data-function and blink-matching-paren).

Sounds good. Indeed, for this feature a registry of opener-closers 
should suffice.

Another command that could use it, is an implementation of 
backward-up-list. Somehow the default up-list manages to use SMIE's 
forward-sexp-function (and backward...) definitions automatically, but 
not tree-sitter's. I've been told it's expected for now, so I think 
opener-closers are the missing piece (either to enhance 
treesit-forward-sexp/treesit-backward-sexp to resemble the originals 
more closely, or to implement treesit-backward-up).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 08:25:02 +0000
Resent-Message-ID: <handler.62333.B62333.167990548811470 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167990548811470
          (code B ref 62333); Mon, 27 Mar 2023 08:25:02 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 08:24:48 +0000
Received: from localhost ([127.0.0.1]:46442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgi9o-0002yv-7e
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 04:24:48 -0400
Received: from heytings.org ([95.142.160.155]:55900)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1pgi9l-0002yk-FN
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 04:24:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1679905484;
 bh=kQVtVdwW4zNMyMBDKre3S9KHLmRYr4ScXoss+4XbRcc=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=H1PDfh+o6TdzFu/7Y1SbwXGUigxecGfFDP3QyPqwI0RamFSY58Hc/o8gGuXoyDXKu
 9yWHyj7acjN1McrHYY6RlE2W6T/g0E3BJo9fI0oDFDYOCcXGzTC+C3tRP/fSQk9WnV
 /+YSjY3DNxSoVIWbezIN/CuHWTu4FhHmgJjJT5y2gAKX2tOojRpg9Cj7p3T3NlTzuh
 fyVpx6cS1zmZrWSO6ke9wBh1LTaCWwf0sVuAqUnvsfk0ivk2GSwKli4DwE61J2DeCR
 1fxwXBosFvGCt6L0o0mRuTbL0r2dP0Gk4yhG1lY95uHZTr1fseaZYafb9NJcK/6WrF
 4UHw1GDY2GxlQ==
Date: Mon, 27 Mar 2023 08:24:42 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
Message-ID: <728618716b8c5349d27e@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN>
 <83jzz5c8ml.fsf@HIDDEN> <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN>
 <83edpdc6sn.fsf@HIDDEN> <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN>
 <831qlcdisi.fsf@HIDDEN> <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN>
 <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=us-ascii
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>>>> Again, I'm talking about using a parser library.  We may need to 
>>>> introduce a way of limiting the parser to a certain range of buffer 
>>>> text positions, independently of narrowing.
>>> 
>>> Except it's already limited by narrowing.
>> 
>> Which is a fragile, semi-broken means, as we all know.
>
> What is a broken mess, is user-level narrowing. And how the downstream 
> code can never guess the purpose the narrowing was applied for.
>

Note that this is what labeled narrowings attempts to solve.  It's perhaps 
not the best way to deal with code that has existed for a long time 
(because such code is not prepared to handle that kind of narrowing 
gracefully), but I don't see why it couldn't be used in new code/modes 
such as tree-sitter ones.  It is independent of user-level narrowing, and 
downstream code can act differently depending on the reason for which the 
narrowing was applied.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 13:31:02 +0000
Resent-Message-ID: <handler.62333.B62333.167992380422134 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167992380422134
          (code B ref 62333); Mon, 27 Mar 2023 13:31:02 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 13:30:04 +0000
Received: from localhost ([127.0.0.1]:46821 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgmvD-0005ko-26
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 09:30:03 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43152)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pgmv9-0005k8-RB
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 09:30:00 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgmv4-00021K-DM; Mon, 27 Mar 2023 09:29:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=WJbrZLkEWat7feWedTvbEq91XrWP2fD/Hx7jljkL3tQ=; b=Pu+bWwakFDyt
 kz0d+THzMbbwsetbAYwVvfQQnh85IbQXsxqK3QzqQPJU6IJqKNvioYu7EoHvMmAqcnRLOpqYyO3Cm
 LIcKU6rlq7ER/J1mXzYCyzwp9MZ2zHhnlXYeJ7kTUFaMR2xtImUiBQ6tno/KVfhCV4N/E6gq0tw8a
 ShHooLfP+F6FCt9btgPGQ7g3nbH22htCeMA76Tf+dzzmKmMTr/4gO/snJaTkLhEszxWRY3qxpMa/p
 /BNo6EFUaryYHVY2uM2c9KvVszEDmF8hvDg3ANTfytmfHaBQssQS6jsWhav7bp/ZpYh/5Du6KSGCl
 dtsuAuueCywhEyBp/QsJkg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgmv3-0004hG-0s; Mon, 27 Mar 2023 09:29:53 -0400
Date: Mon, 27 Mar 2023 16:29:55 +0300
Message-Id: <83fs9q9vak.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> (message from
 Dmitry Gutov on Mon, 27 Mar 2023 01:00:20 +0300)
References: <87fs9yur7r.fsf@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 27 Mar 2023 01:00:20 +0300
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> > So you are suggesting to introduce kludges like font-lock-dont-widen
> > in all of those places?
> 
> font-lock-dont-widen is a kludge, but that's largely determined by the 
> way it's defined and used.

With parser-based features, we have an opportunity to do this in a
cleaner manner.

> If we take indent-for-tab-command, for example, it doesn't have such a 
> variable, and doesn't really need to: the top-level command calls 
> 'widen', and then indent-line-function (set by major mode and altered by 
> e.g. mmm-mode) is free to impose its specific bounds.

I thought about a lower-level, infrastructure-level, mechanism that
could be used to restrict a parser to a certain region of the buffer.
Then this could be used by every feature based on parsers, instead of
us having to invent a separate solution for each one.

> The "grand unified theory of mixed major modes" has been attempted a few 
> times in the past, and never reached anything practical.

But here we have a unique opportunity to maybe find a solution, at
least for stuff based on tree-sitter and similar libraries.  That
maybe not "grand", but certainly "respectable".

> >> Except it's already limited by narrowing.
> > 
> > Which is a fragile, semi-broken means, as we all know.
> 
> What is a broken mess, is user-level narrowing.

Which is why restricting parsers should not be a user-level feature.

> > Look, I'm trying to see how we could come up with an infrastructure
> > that will support multiple modes and other similar features in the
> > same buffer without relying on narrowing, thus bypassing the
> > disadvantages and difficulties that come with narrowing.  I think we
> > have a good chance here to come up with such a solution, specifically
> > for features that us a parsing library.  If you aren't interested in
> > discussing that, and think we should stick to narrowing, then this
> > goes nowhere, and I'd rather bow out of it.
> 
> What I've seen here so far is you suggesting we go ahead and break the 
> existing convention and then let "them" (third-party authors including 
> myself) come up with a new working one.

You are mixing two semi-separate issues: how to fix the immediate
problem with blink-matching-paren (if we consider it a serious
problem), and how to try solving similar issues as a whole.  The
latter is a long-term goal, and we can discuss it freely and calmly;
whereby ideas can be brought up even if they might not be the most
clever ones or the ones with which you personally agree.

> My stance here is we shouldn't break it before we create a new one.

No one broke anything.  We are just discussing ideas.  Please don't
exaggerate.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 13:33:01 +0000
Resent-Message-ID: <handler.62333.B62333.167992397622430 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Yuan Fu <casouri@HIDDEN>
Cc: wkirschbaum@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167992397622430
          (code B ref 62333); Mon, 27 Mar 2023 13:33:01 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 13:32:56 +0000
Received: from localhost ([127.0.0.1]:46826 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgmy0-0005pi-8C
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 09:32:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:47234)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pgmxy-0005pS-4N
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 09:32:54 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgmxs-0005bi-T9; Mon, 27 Mar 2023 09:32:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Hq8/2PA1Y63B5A739p9b72lCuOiV200JoU8mY423gvY=; b=MekxfuTSbiGIi/BdY453
 /1h2zIYjjGqrM09P9dOgouCv9mWba+iFPQNxzLzlO55L7tG/6s/Zzx3vXvVFQ+4FP8jzhbDS5PyLd
 28vtxRbPnEPYDlvYaNObnGaVckjJaa2KOBqEkCO4yS9M05xULyUdAjJPSGMzcddA1rXzdW9HigoOF
 5S73p2fiAh8Z3IjNYws/hAKqP4WsaRhe5KlwRvkYIO2reuIS/a3ZBeLVTE+bPpEnJHTyW/dQxvDoq
 xgqq1KzbFOb/XPPELs0359dqmvQfMDxGHpPD5g7X9sV8h681GUdld5rFOU67L+HPHq9jt4QAIXsl6
 NtciKle/k+CHSQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgmxq-0004UH-Bf; Mon, 27 Mar 2023 09:32:47 -0400
Date: Mon, 27 Mar 2023 16:32:48 +0300
Message-Id: <83edpa9v5r.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <C51E765F-4D67-4B0C-B88B-670FEBD1B090@HIDDEN> (message from
 Yuan Fu on Sun, 26 Mar 2023 15:57:55 -0700)
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
 <83a600b0gk.fsf@HIDDEN> <C51E765F-4D67-4B0C-B88B-670FEBD1B090@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Yuan Fu <casouri@HIDDEN>
> Date: Sun, 26 Mar 2023 15:57:55 -0700
> Cc: Dmitry Gutov <dgutov@HIDDEN>,
>  Wilhelm Kirschbaum <wkirschbaum@HIDDEN>,
>  62333 <at> debbugs.gnu.org
> 
> > We could leave this alone for now, but in that case let's at least add
> > some FIXME comment in the relevant place(s), so that we could later
> > revisit this.
> 
> Dmitry’s idea sounds good, we can add a tree-sitter backend for show-paren-data-function, and make the backend for blink-matching-paren configurable, then add a backend for it that uses show-paren-data-function, which in turn uses tree-sitter (or we add a backend that uses tree-sitter directly). In either case, the tree-sitter backend don’t need to use narrowing and we are good.

Is this suitable for the release branch?  It sounds non-trivial, and
the problem is not very severe, to say the least.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 13:40:02 +0000
Resent-Message-ID: <handler.62333.B62333.167992438323069 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167992438323069
          (code B ref 62333); Mon, 27 Mar 2023 13:40:02 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 13:39:43 +0000
Received: from localhost ([127.0.0.1]:46846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgn4Y-000600-MA
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 09:39:42 -0400
Received: from eggs.gnu.org ([209.51.188.92]:41930)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pgn4W-0005zl-Or
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 09:39:41 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgn4Q-0007Ss-DH; Mon, 27 Mar 2023 09:39:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=8qJx1kLlWGOXzGlvfHOq2U7gj3funt/HQ+3v8F0HwV4=; b=JLEzU4N2WkaR
 Uin2rCdIMOjHpxd0vhB1nYcHu6vkdsQe6BezP45oBFO+lAkOh4tDJM8e3LfhW3K+BN8y73/B/1XFo
 Cn7R7Smvjey1QyF0Sv7DjbBdacB71CqRdgGPDyo9GYGZ9YJS5+sduJSqK/1rdF4zhhVC6UKORNpwj
 CtZoniYLZyC3e25HbelJWQOkOmBB13lnZvnLFvP4KuBtvYHs0o6qGpEmBpdUtomlKjV0zT5owaYJV
 tJwF0FMtxKqK5395ly18RK8GTaK6WlZfPPexoWKYaMcLFSciRKolyUDOYDwmimrgcaifE9BDB4BVZ
 DeZ4xDhdNMbQq8QTC6O6dQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pgn4P-0003ny-TI; Mon, 27 Mar 2023 09:39:34 -0400
Date: Mon, 27 Mar 2023 16:39:37 +0300
Message-Id: <83bkke9uue.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <728618716b8c5349d27e@HIDDEN> (message from Gregory
 Heytings on Mon, 27 Mar 2023 08:24:42 +0000)
References: <87fs9yur7r.fsf@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN>
 <83jzz5c8ml.fsf@HIDDEN> <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN>
 <83edpdc6sn.fsf@HIDDEN> <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN>
 <831qlcdisi.fsf@HIDDEN> <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN>
 <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 27 Mar 2023 08:24:42 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: Eli Zaretskii <eliz@HIDDEN>, wkirschbaum@HIDDEN, casouri@HIDDEN, 
>     62333 <at> debbugs.gnu.org
> 
> >> Which is a fragile, semi-broken means, as we all know.
> >
> > What is a broken mess, is user-level narrowing. And how the downstream 
> > code can never guess the purpose the narrowing was applied for.
> 
> Note that this is what labeled narrowings attempts to solve.

Labeled narrowing cannot solve this because it does nothing to
alleviate the problems with user-defined narrowing.  So if the user
narrows the buffer, we cannot do anything to safely widen in the
general case, and labeled narrowing cannot help us.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Yuan Fu <casouri@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 18:44:02 +0000
Resent-Message-ID: <handler.62333.B62333.167994264030104 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Wilhelm Kirschbaum <wkirschbaum@HIDDEN>, 62333 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167994264030104
          (code B ref 62333); Mon, 27 Mar 2023 18:44:02 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 18:44:00 +0000
Received: from localhost ([127.0.0.1]:48442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgrp2-0007pU-2w
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 14:44:00 -0400
Received: from mail-pj1-f47.google.com ([209.85.216.47]:52019)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <casouri@HIDDEN>) id 1pgrp0-0007pI-GP
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 14:43:58 -0400
Received: by mail-pj1-f47.google.com with SMTP id j13so8565690pjd.1
 for <62333 <at> debbugs.gnu.org>; Mon, 27 Mar 2023 11:43:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679942632;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=lRHnhDGWx3A7VJUBXV06Ercj3Ped9ZYNBrNuQ7otpQQ=;
 b=B0eCYXwgLrzyEZOF6kGj8gvUomkfClBNSlkf9EArdU6PkLa/bof/zzY9ACY8fwm2zn
 Ic+xMhHgOGJ5FrC0sJcWNWvlxnscGaRA/2QWVGLEbw8Er9CXi9ivMoAVomGBH7PmX4xj
 2/wTghKVEylHpEArzoitY0ob4YomT12bW0SYnrP6wcScmRtXg8ccNwCVM98tD9tRBcxS
 rHD2TuK/2Y5NrjeOto01Grg4Bn71yAJoY1Zey4BKh37t/sy4yMK+hlu8o2gAdwNGA0J6
 XlJH0jHaNR54RvCF6mr69DfpA26HfdiKMOVWET8Cl9gMVsFpNm129opmFMJ2FnWj1fjs
 t3cw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679942632;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=lRHnhDGWx3A7VJUBXV06Ercj3Ped9ZYNBrNuQ7otpQQ=;
 b=WFWHJETuEifgKVpKvc1kBYExVwAw14sW+7hrOvwFHQMA0BcsZduNI8Zgyyb1iPbzuO
 sztGEzIG1Vhd7JlWFZzzOvheC6ET9sJAsqO+rLZtlwUX+GE2a7lDEwas8F76/uRCnWEf
 3aT8awElJRjlUmp6HFkBRHDku4mZE/ND8ZbxJ9eJJQ+jkhCfbpm2zwhmCg9v73L1tYRb
 jpm4nXVZpg2kLJl7uJUoDvzkeMWWS9CtPuBG+XSY3oVFnvBwmBInQcQmUrQc2zM5EHpX
 sewEUdoVgqTMdbms4XX/Ob4FcwCQp02i28FOL/lHbe44fA76z5kOJjWlfJUxJ+bI5Tv7
 8pYg==
X-Gm-Message-State: AAQBX9dMwh7u9WPNsguHybGbj8biyKHYSiMPuYld9gXHdzZ2u8Gqr3GU
 AXMpDD0MgBaRGhZK9u4I+0s=
X-Google-Smtp-Source: AKy350bGtrdO8nAXIjZ6y/9+nrJn5kH+7RHG9Ms24GOGipvqAUFqQ93j64E8rbT/dyAIwnvbPa5uUw==
X-Received: by 2002:a17:90b:3911:b0:23f:9d83:ad76 with SMTP id
 ob17-20020a17090b391100b0023f9d83ad76mr13727073pjb.23.1679942632451; 
 Mon, 27 Mar 2023 11:43:52 -0700 (PDT)
Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com.
 [172.117.161.177]) by smtp.gmail.com with ESMTPSA id
 b17-20020a631b51000000b004e28be19d1csm18392052pgm.32.2023.03.27.11.43.51
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 27 Mar 2023 11:43:51 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\))
From: Yuan Fu <casouri@HIDDEN>
In-Reply-To: <83edpa9v5r.fsf@HIDDEN>
Date: Mon, 27 Mar 2023 11:43:40 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <5213F025-B8CE-4405-92A7-2D38BE8A2776@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <2fd8f2b8-d9c4-c825-a789-f2d42324859f@HIDDEN>
 <09539C5E-23DA-4B00-A3F6-873A41D6A2CE@HIDDEN>
 <c41a767a-010c-040d-75b2-3a628758dd9a@HIDDEN> <83h6uc549z.fsf@HIDDEN>
 <665745A2-FDC8-45DE-BFF5-2F688FC85431@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <35322CB1-DF75-47C1-9B66-21260C437006@HIDDEN>
 <83a600b0gk.fsf@HIDDEN> <C51E765F-4D67-4B0C-B88B-670FEBD1B090@HIDDEN>
 <83edpa9v5r.fsf@HIDDEN>
X-Mailer: Apple Mail (2.3731.400.51.1.1)
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



> On Mar 27, 2023, at 6:32 AM, Eli Zaretskii <eliz@HIDDEN> wrote:
>=20
>> From: Yuan Fu <casouri@HIDDEN>
>> Date: Sun, 26 Mar 2023 15:57:55 -0700
>> Cc: Dmitry Gutov <dgutov@HIDDEN>,
>> Wilhelm Kirschbaum <wkirschbaum@HIDDEN>,
>> 62333 <at> debbugs.gnu.org
>>=20
>>> We could leave this alone for now, but in that case let's at least =
add
>>> some FIXME comment in the relevant place(s), so that we could later
>>> revisit this.
>>=20
>> Dmitry=E2=80=99s idea sounds good, we can add a tree-sitter backend =
for show-paren-data-function, and make the backend for =
blink-matching-paren configurable, then add a backend for it that uses =
show-paren-data-function, which in turn uses tree-sitter (or we add a =
backend that uses tree-sitter directly). In either case, the tree-sitter =
backend don=E2=80=99t need to use narrowing and we are good.
>=20
> Is this suitable for the release branch?  It sounds non-trivial, and
> the problem is not very severe, to say the least.

No, it=E2=80=99s intended for the master branch. Emacs-29 doesn=E2=80=99t =
have the blink-matching-paren problem anyway, since it doesn=E2=80=99t =
have treesit-forward-sexp.=20

Yuan=




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 20:06:01 +0000
Resent-Message-ID: <handler.62333.B62333.16799475115818 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16799475115818
          (code B ref 62333); Mon, 27 Mar 2023 20:06:01 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 20:05:11 +0000
Received: from localhost ([127.0.0.1]:48504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgt5b-0001Vm-A8
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 16:05:11 -0400
Received: from heytings.org ([95.142.160.155]:56706)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1pgt5Y-0001Vb-Ry
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 16:05:09 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1679947507;
 bh=3ULPHliZ87l0pzhI2MR0sczcNLWdkuVxY2V9QPd/alE=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=oEZkdaIwuSA+s5V5ou1ddNH/OIwQDjlg68vesarqyX+kt344oM33IEJjCFRJBUZ+N
 xRNqRKrNKT/IfK6vI7Yh780+zbqUSaP2AbbJjOCyipo3MLpTzHo6WQgonJKQYk+nsQ
 +4Ttz/KjIx8MUcTnVK4IS094MxqhHjyZbz1Et1a24yY8CGBic1plEcBDObBcZCVFB3
 9xhmCl4GQNlsZSk+pb3riPhMgkjBC183h798myKYIOtwrhb7zy5jHM9urt7JFUBjMt
 aY3y6kKUNvFPvxiXByn57GXZvYUyWDzTBZWfAf/gAXaKqEr6UXPCB+cdvXHgp550+l
 nYbJmbbh1llpw==
Date: Mon, 27 Mar 2023 20:05:07 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <83bkke9uue.fsf@HIDDEN>
Message-ID: <728618716b5bdf2ef2da@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN>
 <29679184-7366-0167-9e94-def97048f663@HIDDEN> <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=us-ascii
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>>>>>> Again, I'm talking about using a parser library.  We may need to 
>>>>>> introduce a way of limiting the parser to a certain range of buffer 
>>>>>> text positions, independently of narrowing.
>>>>>
>>>>> Except it's already limited by narrowing.
>>>>
>>>> Which is a fragile, semi-broken means, as we all know.
>>>
>>> What is a broken mess, is user-level narrowing. And how the downstream 
>>> code can never guess the purpose the narrowing was applied for.
>>
>> Note that this is what labeled narrowings attempts to solve.
>
> Labeled narrowing cannot solve this because it does nothing to alleviate 
> the problems with user-defined narrowing.  So if the user narrows the 
> buffer, we cannot do anything to safely widen in the general case, and 
> labeled narrowing cannot help us.
>

I must be missing something, but I don't understand what you mean.  If a 
user has narrowed a buffer to a certain region A-B, and if we want to 
limit a parser to a certain region C-D, we can do that safely with

(with-narrowing C D :label 'parser-library BODY)

which will work, independently of the A-B narrowing set by the user, and 
will reset the narrowing to A-B upon return.  And functions inside BODY 
will have to use (without-narrowing :label 'parser-library ...) to get 
access to the whole buffer.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 23:07:01 +0000
Resent-Message-ID: <handler.62333.B62333.167995838823795 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>, Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167995838823795
          (code B ref 62333); Mon, 27 Mar 2023 23:07:01 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 23:06:28 +0000
Received: from localhost ([127.0.0.1]:48576 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgvv1-0006Bi-Kz
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 19:06:27 -0400
Received: from mail-wm1-f45.google.com ([209.85.128.45]:35475)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgvv0-0006BS-44
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 19:06:26 -0400
Received: by mail-wm1-f45.google.com with SMTP id
 bg16-20020a05600c3c9000b003eb34e21bdfso8330584wmb.0
 for <62333 <at> debbugs.gnu.org>; Mon, 27 Mar 2023 16:06:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679958380;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=he4DPbdL2qbTuaoSnqAEVCMyuuMxaF1xkc2qTSiYoJc=;
 b=dGsMjYxxbbzqPhJAnynupmiuhF9VtF/b4w4HQWtGurPzClpBD1DihLcuDYyEQG06Fq
 JaFHKJGweWO51Xkkf+OMypF8fe1tyBjfnQ8Ft2RaKAE8+eAoVd5C4UzgK/ZH/lBZcagj
 PfSTUrt69KPo/aOyHeZmTvGC2GT/yKDrTqR0tk6OtlvWfZLMVRRfubPdm2pyKjZyvgpo
 a7x6NTheTM1EiflB/IcReCoYm0gEIoidpcl8Qj+4MLSnS7E5lMnSk6I59nWz3nIyvRUC
 oM33x82Zg/cK2ECTPjvq6XNicXgBPNzwiGQ29hum8J9euwVVgIuq0fuQGgW4u3LZ/N2+
 /SHw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679958380;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=he4DPbdL2qbTuaoSnqAEVCMyuuMxaF1xkc2qTSiYoJc=;
 b=ub7wkTLhHIUJei0EqJxd5OsjMRtZtF1FsoTYhZzoz2DxEfZzr9c/6QDO1a1n2LoCds
 1hpLKoxjIMGADlJ5AJetSUzc67v2AZZgQwOeGVRStSQQSxYvxbmwbhvvM8kK6Xwa3uBR
 70CofkTVtSrfk05coLI8gcpd7d/DbN+ObcLLXB7g8FEF8Y7PBooyO1dleyANnAYpKWUl
 4DhvMRvFqLrddFNJ63sN+8IJO2f4KVopO6OSO5ccYBjD5w+2HTASM08U0oPFrK6o42O7
 V/fCNCc86LgVJtKn3ldmzH+EjWVwkrGamMqYxP54Zn4COPv/RZYNibydAqkHd+VUTefV
 LwIw==
X-Gm-Message-State: AO0yUKULzNkUtbTRirUgm9A8xlz3snuZnBwBPqBNKCcMOFZQjU/psC7j
 iWNhkdPRZHGAabEdamRIZsc=
X-Google-Smtp-Source: AK7set9y9epUSFXIUU3/JQxQDEvuc0zKcAnJz/iwAutCpp5yWkR3105escojxGVHnZFS6CkqQ4brOQ==
X-Received: by 2002:a05:600c:500d:b0:3ee:93d2:c915 with SMTP id
 n13-20020a05600c500d00b003ee93d2c915mr11666499wmr.6.1679958379958; 
 Mon, 27 Mar 2023 16:06:19 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 fc9-20020a05600c524900b003ee2a0d49dbsm10441255wmb.25.2023.03.27.16.06.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Mar 2023 16:06:19 -0700 (PDT)
Message-ID: <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN>
Date: Tue, 28 Mar 2023 02:06:17 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83bkke9uue.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 27/03/2023 16:39, Eli Zaretskii wrote:
>> Date: Mon, 27 Mar 2023 08:24:42 +0000
>> From: Gregory Heytings<gregory@HIDDEN>
>> cc: Eli Zaretskii<eliz@HIDDEN>,wkirschbaum@HIDDEN,casouri@HIDDEN,
>>      62333 <at> debbugs.gnu.org
>>
>>>> Which is a fragile, semi-broken means, as we all know.
>>> What is a broken mess, is user-level narrowing. And how the downstream
>>> code can never guess the purpose the narrowing was applied for.
>> Note that this is what labeled narrowings attempts to solve.
> Labeled narrowing cannot solve this because it does nothing to
> alleviate the problems with user-defined narrowing.  So if the user
> narrows the buffer, we cannot do anything to safely widen in the
> general case, and labeled narrowing cannot help us.

Is that because we don't think the user level narrowing is done purely 
for visual effect? There is, again, a fair amount of confusion there, 
but judging by regular user requests for make this or that command 
ignore user-level narrowing, it seems like "purely visual" should be the 
default interpretation. And for harder narrowing, users could have a 
separate command, or a prefit arg, or etc.

When I'm talking user-level, I mean interactive 'C-x n', of course.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 23:21:01 +0000
Resent-Message-ID: <handler.62333.B62333.167995921925029 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167995921925029
          (code B ref 62333); Mon, 27 Mar 2023 23:21:01 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 23:20:19 +0000
Received: from localhost ([127.0.0.1]:48580 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgw8R-0006Vd-4g
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 19:20:19 -0400
Received: from mail-wr1-f52.google.com ([209.85.221.52]:47071)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgw8P-0006VR-HW
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 19:20:17 -0400
Received: by mail-wr1-f52.google.com with SMTP id r29so10345385wra.13
 for <62333 <at> debbugs.gnu.org>; Mon, 27 Mar 2023 16:20:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679959212;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=GMq2XbV7Ze57sHLYjCHOpPvC/m2zrJ01ZrAOjxM4qsg=;
 b=FZhLq1ox8YsPzS0lbHnKSq8D8nOx484L/zPYvXKfQdp+ZtRXNZjGxlsdJgcSpgCo2S
 3v3/IEYvTRJFemnQyv9DuRCZ/oTP1k8VuU/3bzKdsAhm05q+4gkesX/VuOz5ts9XiL35
 G2QfDJmC1zM+Tygikg8E9Hr5nj0zOk963g0vgXyThgQ8p/H8cEKNxkBcxKTUKbxam0lZ
 HEeJMpZlV/BPPeU/Z6VxUKjcCWvjYuqcxlWzPr3tQ2/pJeVeuwc3RcCZCXQAVXQx52Dy
 OplkoV4mB4ZKOHwkJQfjgEl+1kUd3owEerlQuxEUR6KQ4V+f/SQ+Forf0FNOKDJeAJIt
 N5og==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679959212;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=GMq2XbV7Ze57sHLYjCHOpPvC/m2zrJ01ZrAOjxM4qsg=;
 b=HYk0BHLa9SeDNneH36R5/2t1KiyjQdgfZxLGM87ZVncYAP9e8kEOy2SaJO+27waXFZ
 jGGpKGbhQ3z4npNBPeaircizhvlLqYLAo8ptLbRHlU1i3NedRGfZJ27bFokQXPp3fv11
 PoPb4h5HuikLe/aBwzpvTH1FzWqR2545HmFsJJrJhPrZnJ7ZNIxsyZFfD6BPzvsonwvV
 KWiowMr77t32VIsjlt9Y4EFhU3XfPn6nRXe/rOWaky+g+1W2njwK+egxLoMoXwR/3Ar1
 kM52DC9Mp1+jWTxGnMb9/ph7F5Z7WI2pA2jmfX4xzQSLwJOU5QYE3VtzfnEcmx/tKpzR
 +BuQ==
X-Gm-Message-State: AAQBX9fAYJpIv91Ym8CvOAItmwqoNo3gsuEwVGDii3Bk+UIfF1fLLyY1
 P2YlHZdbcs6INfXBqgPzGgSmb6Q6Ywk=
X-Google-Smtp-Source: AKy350ZI9/uRKBW3sAWY7uSbnljKM4AavYKHh3pECzCYpmhlyyQosrPtxyzdoAEtx/zivDlmBRH9Og==
X-Received: by 2002:adf:f887:0:b0:2ce:a9e9:4905 with SMTP id
 u7-20020adff887000000b002cea9e94905mr11860378wrp.34.1679959211626; 
 Mon, 27 Mar 2023 16:20:11 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 x2-20020a5d60c2000000b002cfe71153b4sm26091373wrt.60.2023.03.27.16.20.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Mar 2023 16:20:11 -0700 (PDT)
Message-ID: <683e0eb4-8f36-b8bd-ab0b-022845cafdac@HIDDEN>
Date: Tue, 28 Mar 2023 02:20:09 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <728618716b8c5349d27e@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 27/03/2023 11:24, Gregory Heytings wrote:
> 
>>>>> Again, I'm talking about using a parser library.  We may need to 
>>>>> introduce a way of limiting the parser to a certain range of buffer 
>>>>> text positions, independently of narrowing.
>>>>
>>>> Except it's already limited by narrowing.
>>>
>>> Which is a fragile, semi-broken means, as we all know.
>>
>> What is a broken mess, is user-level narrowing. And how the downstream 
>> code can never guess the purpose the narrowing was applied for.
>>
> 
> Note that this is what labeled narrowings attempts to solve.  It's 
> perhaps not the best way to deal with code that has existed for a long 
> time (because such code is not prepared to handle that kind of narrowing 
> gracefully), but I don't see why it couldn't be used in new code/modes 
> such as tree-sitter ones.  It is independent of user-level narrowing, 
> and downstream code can act differently depending on the reason for 
> which the narrowing was applied.

It indeed sounds like something we had considered before: different 
types of narrowing (at the time we only wanted to distinguish between 
two types: "soft" and "hard", the latter for use by mixed-mode features, 
or other stuff which wanted to preclude full widening, such as Info). 
But that fizzled out on the prototyping stage.

(Aside: tree-sitter itself has its own support for "ranges", which will 
work without any narrowing related stuff as long as grammars for all 
langs are available -- or perhaps the combination should be available as 
a grammar too, I'm not sure -- anyway, it doesn't need much help, but it 
would still be nice to support embedding tree-sitter managed code inside 
"regular" modes, or have better support for mixing said regular modes, 
something we already do.)

The new narrowing feature with labels kind of resembles that, except if 
I'm thinking about "intents", I could probably enumerate "visual" (for 
interactive narrowing), "hard" (for mixed-mode stuff or Info), or... 
"movement" (simply performed to constrain movement, but without goal to 
alter the parsing context -- such as narrowing before calling 
forward-sexp, in blink-matching-paren's example). These could be 
documented and assigned relative depth, sorting them like "hard > 
movement > visual", where code willing to undo "movement" would 
naturally undo "visual" as well, and code will to undo "hard" narrowing 
would undo them all.

How treesit-forward-sexp would handle "movement" narrowing is something 
up for discussion, though: maybe just ignore it (given that there is no 
performance tax), or maybe it would still perform a position check at 
the end (after finding the matching paren), to see if it ends up beyond 
the accessible region.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 27 Mar 2023 23:34:02 +0000
Resent-Message-ID: <handler.62333.B62333.167996002726472 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.167996002726472
          (code B ref 62333); Mon, 27 Mar 2023 23:34:02 +0000
Received: (at 62333) by debbugs.gnu.org; 27 Mar 2023 23:33:47 +0000
Received: from localhost ([127.0.0.1]:48585 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pgwLS-0006ss-Ka
	for submit <at> debbugs.gnu.org; Mon, 27 Mar 2023 19:33:47 -0400
Received: from mail-wm1-f43.google.com ([209.85.128.43]:39524)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pgwLR-0006sg-Ep
 for 62333 <at> debbugs.gnu.org; Mon, 27 Mar 2023 19:33:46 -0400
Received: by mail-wm1-f43.google.com with SMTP id
 i5-20020a05600c354500b003edd24054e0so8326983wmq.4
 for <62333 <at> debbugs.gnu.org>; Mon, 27 Mar 2023 16:33:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1679960019;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=9OOPw4XXgx4I2Wbzj7ytcO0jpIVLhxgA/ww6NjOrLkg=;
 b=osxLjyWKmnOqTseVn9h0HvlpLji7s7R2a/D61syLaZQht59EHD1WAo6UMcx6K9UMjH
 Fyu2snQsQnmdhElLrdT8a5WX3XPZExuvCKYiHj2km+cqU8yO+W0p/FbjeHJ7v/GieZn+
 pcF5oe/X5NzEyrxZhfTbubHHhpQMw+LWYjH64w9Pnm/jk8wepjKi4Jldcybjw3Aqrhow
 zb9QzcMRfHfVBqU4OU6OyxI75iu/vnTM2WsLugboUDHOPXupdBSAWMugjqBDNm5QCYUj
 RDtBjettfXsNlw+PSGSX0FhXMw0nRaonGrWr4IgOZtFQkQndJn7VUXZLgH29B8jdtJBc
 /ZdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1679960019;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=9OOPw4XXgx4I2Wbzj7ytcO0jpIVLhxgA/ww6NjOrLkg=;
 b=yvEMkoNF+XSdxFnFyJHQCe17gurCSioUnAeoV9Dyn75Gl+nHz1Uo3OR7JLHrbSGuBO
 nZBxHWIM44FvNqD9AKKRljbk8JlpS5KAPAHARkaLkieKEWIyGQZIeobAGZSCkIunB6Z8
 JF0t0r+cKDHi14tRQig+q6oX1P02/ZVUWpjDlpZFheVu75ajH1ZrsTC8lDbwo9DH/DVp
 L1C931Ao2IxylV/Csp4SyWje2G8dY+lBeLXKZEupZa0OhXV9PtnE+T+25OXGoRt4qlBr
 8agSY9scPDzo8206visg+VrQIJQx4CAhFV0FIciZTSgKsxJRvLXUlr9O0DAoi4GyBUjr
 dUxw==
X-Gm-Message-State: AO0yUKWGQ7SdX00/UMxWfxJ3BWk9YN49/5USWFsUuTh+IwlxTwyjf5yP
 l0KlshKOvUw/k24hois35sM5YmFV7lk=
X-Google-Smtp-Source: AK7set+lhUX1zHcnEv8dCb9miI5zloP3sLo8yWpXKBT2+x9pW4mJpeJ7NbK6YtBJvOtog7UZubodXA==
X-Received: by 2002:a05:600c:2909:b0:3eb:383c:1870 with SMTP id
 i9-20020a05600c290900b003eb383c1870mr10942815wmd.11.1679960019474; 
 Mon, 27 Mar 2023 16:33:39 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 z4-20020a05600c0a0400b003ef4cd057f5sm10423062wmp.4.2023.03.27.16.33.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 27 Mar 2023 16:33:39 -0700 (PDT)
Message-ID: <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
Date: Tue, 28 Mar 2023 02:33:38 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83fs9q9vak.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 27/03/2023 16:29, Eli Zaretskii wrote:
>> Date: Mon, 27 Mar 2023 01:00:20 +0300
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>>> So you are suggesting to introduce kludges like font-lock-dont-widen
>>> in all of those places?
>>
>> font-lock-dont-widen is a kludge, but that's largely determined by the
>> way it's defined and used.
> 
> With parser-based features, we have an opportunity to do this in a
> cleaner manner.

parser-based features don't need this at all, if considered in 
isolation. But if we try to combine them with existing mode, or existing 
packages, they need to play by the common rules. Which they currently do.

>> If we take indent-for-tab-command, for example, it doesn't have such a
>> variable, and doesn't really need to: the top-level command calls
>> 'widen', and then indent-line-function (set by major mode and altered by
>> e.g. mmm-mode) is free to impose its specific bounds.
> 
> I thought about a lower-level, infrastructure-level, mechanism that
> could be used to restrict a parser to a certain region of the buffer.
> Then this could be used by every feature based on parsers, instead of
> us having to invent a separate solution for each one.

Like narrowing, but just for parsers? But parsers obey narrowing 
already. Sounds a bit like conceptual duplication. How does this solve 
blink-matching-paren issue anyway?

>> The "grand unified theory of mixed major modes" has been attempted a few
>> times in the past, and never reached anything practical.
> 
> But here we have a unique opportunity to maybe find a solution, at
> least for stuff based on tree-sitter and similar libraries.  That
> maybe not "grand", but certainly "respectable".

tree-sitter has its own support for mixed languages.

>>>> Except it's already limited by narrowing.
>>>
>>> Which is a fragile, semi-broken means, as we all know.
>>
>> What is a broken mess, is user-level narrowing.
> 
> Which is why restricting parsers should not be a user-level feature.

We're talking elisp-level, though. The problem with interactive 
narrowing, is its impossible to tell apart from one effected by Lisp. 
And they usually have different goals.

>>> Look, I'm trying to see how we could come up with an infrastructure
>>> that will support multiple modes and other similar features in the
>>> same buffer without relying on narrowing, thus bypassing the
>>> disadvantages and difficulties that come with narrowing.  I think we
>>> have a good chance here to come up with such a solution, specifically
>>> for features that us a parsing library.  If you aren't interested in
>>> discussing that, and think we should stick to narrowing, then this
>>> goes nowhere, and I'd rather bow out of it.
>>
>> What I've seen here so far is you suggesting we go ahead and break the
>> existing convention and then let "them" (third-party authors including
>> myself) come up with a new working one.
> 
> You are mixing two semi-separate issues: how to fix the immediate
> problem with blink-matching-paren (if we consider it a serious
> problem), and how to try solving similar issues as a whole.

Not mixing anything. We have one proposal for improving 
blink-matching-paren integration anyway. It should be compatible with 
whatever we choose regarding narrowing and mixed modes.

> The
> latter is a long-term goal, and we can discuss it freely and calmly;
> whereby ideas can be brought up even if they might not be the most
> clever ones or the ones with which you personally agree.

I'm not looking for "clever".

>> My stance here is we shouldn't break it before we create a new one.
> 
> No one broke anything.  We are just discussing ideas.  Please don't
> exaggerate.

I never said anybody has broken anything already.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 11:31:02 +0000
Resent-Message-ID: <handler.62333.B62333.168000304020741 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168000304020741
          (code B ref 62333); Tue, 28 Mar 2023 11:31:02 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 11:30:40 +0000
Received: from localhost ([127.0.0.1]:49065 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ph7XE-0005Nf-DB
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:30:40 -0400
Received: from eggs.gnu.org ([209.51.188.92]:38628)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ph7XA-00052D-JE
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:30:39 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph7X5-0002fN-4n; Tue, 28 Mar 2023 07:30:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=yDDBVJy1MHRyS+Kb1QPeSS/AdvxUyThdHk1CYr0PvW8=; b=lgnz6zUSeG7C
 ry1vprwZwCT6aq38zrbFgfaf0syGtx6DWCXu7oymV4L1GOyVZf3yMdVwwqH8jbaz6t42RNUnAdPh9
 D9/QcX+ubc53nDseLsySkn5YlQzmGOsIWkbizVgAC8jxKobZRWvWJCITHdYyAt1ItqYZWLnxgRpJN
 1fBPRv7cHKMNAQ1KC5WYaBK2AAABLnBBc3z9EKfWCZMRDNZTHGC5gyVQ6uGic3o2YdIM2/fZGHYLW
 7ITcStH8OazWjZQHp774Ao127PIkc2QxC5a/H5sBEQEPMsgGRATHZ3yJZoyPFIKKDA0Vpxa8hSNPJ
 YKwWPa8pfUzIv6NsQRDAMA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph7X4-0004yr-14; Tue, 28 Mar 2023 07:30:30 -0400
Date: Tue, 28 Mar 2023 14:30:34 +0300
Message-Id: <83jzz1865h.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <728618716b5bdf2ef2da@HIDDEN> (message from Gregory
 Heytings on Mon, 27 Mar 2023 20:05:07 +0000)
References: <87fs9yur7r.fsf@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN>
 <29679184-7366-0167-9e94-def97048f663@HIDDEN> <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <728618716b5bdf2ef2da@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 27 Mar 2023 20:05:07 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: dgutov@HIDDEN, wkirschbaum@HIDDEN, casouri@HIDDEN, 
>     62333 <at> debbugs.gnu.org
> 
> > Labeled narrowing cannot solve this because it does nothing to alleviate 
> > the problems with user-defined narrowing.  So if the user narrows the 
> > buffer, we cannot do anything to safely widen in the general case, and 
> > labeled narrowing cannot help us.
> 
> I must be missing something, but I don't understand what you mean.  If a 
> user has narrowed a buffer to a certain region A-B, and if we want to 
> limit a parser to a certain region C-D, we can do that safely with
> 
> (with-narrowing C D :label 'parser-library BODY)

(You mean with-restriction.)

> which will work, independently of the A-B narrowing set by the user, and 
> will reset the narrowing to A-B upon return.

It will only work if [C..D] is inside [A..B].  It will not work if a
Lisp program wants to widen [A..B], i.e. if [C..D] is larger than
[A..B].




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 11:34:01 +0000
Resent-Message-ID: <handler.62333.B62333.168000318523326 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168000318523326
          (code B ref 62333); Tue, 28 Mar 2023 11:34:01 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 11:33:05 +0000
Received: from localhost ([127.0.0.1]:49070 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ph7ZZ-000649-03
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:33:05 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58676)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ph7ZX-00063g-3W
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:33:03 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph7ZR-0003Jf-SH; Tue, 28 Mar 2023 07:32:57 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=l9WLFmtyGfftNWXcs9RBWlWWbIGToAOpk4Hy5W+QsjA=; b=mseYmntDyT6D
 ep502821ZmKwxyJIj725y+FVVXcop5N7VnCB48iXRy85mJLwmZr3woN5JyF+3tz5YPMPZhHEbawuq
 5YBzGDBfuOEIRkvyzhZZ/QQUWsPTIUBTiYemTOKMG2FGV1GMy9pqjtFOi36F1VwXK3lawaHO+gLfd
 75HXyF812Eg7VE+E2tZKhQIxszknqCSOPUCLBFd90MP0NP5cyf2iht9kObJkUyhVoif2k32tvKFHc
 UqnVt/HMfgRO+gvY+vJAlAhTb74y7HDeybVeYkTzNi+M8l3aWZ2PzKpHp1Yup5Z49Vhkn2XZhboi+
 qeherZ/NJjJoMny6Vk8GQQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph7ZO-0006XH-G6; Tue, 28 Mar 2023 07:32:57 -0400
Date: Tue, 28 Mar 2023 14:32:59 +0300
Message-Id: <83ilel861g.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> (message from
 Dmitry Gutov on Tue, 28 Mar 2023 02:06:17 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 28 Mar 2023 02:06:17 +0300
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 27/03/2023 16:39, Eli Zaretskii wrote:
> >> Date: Mon, 27 Mar 2023 08:24:42 +0000
> >> From: Gregory Heytings<gregory@HIDDEN>
> >> cc: Eli Zaretskii<eliz@HIDDEN>,wkirschbaum@HIDDEN,casouri@HIDDEN,
> >>      62333 <at> debbugs.gnu.org
> >>
> >>>> Which is a fragile, semi-broken means, as we all know.
> >>> What is a broken mess, is user-level narrowing. And how the downstream
> >>> code can never guess the purpose the narrowing was applied for.
> >> Note that this is what labeled narrowings attempts to solve.
> > Labeled narrowing cannot solve this because it does nothing to
> > alleviate the problems with user-defined narrowing.  So if the user
> > narrows the buffer, we cannot do anything to safely widen in the
> > general case, and labeled narrowing cannot help us.
> 
> Is that because we don't think the user level narrowing is done purely 
> for visual effect?

Indeed, it isn't always for visual effect.

> judging by regular user requests for make this or that command 
> ignore user-level narrowing, it seems like "purely visual" should be the 
> default interpretation.

I think you base your judgment on feedback from users who are not used
to take advantage of narrowing in editing.  I think most young people
aren't, since this feature is more-or-less unique to Emacs.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 11:39:01 +0000
Resent-Message-ID: <handler.62333.B62333.168000350523783 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168000350523783
          (code B ref 62333); Tue, 28 Mar 2023 11:39:01 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 11:38:25 +0000
Received: from localhost ([127.0.0.1]:49076 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ph7ei-0006BW-QI
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:38:25 -0400
Received: from eggs.gnu.org ([209.51.188.92]:58246)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ph7eg-0006BJ-BT
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:38:23 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph7ea-0004SL-I0; Tue, 28 Mar 2023 07:38:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=JfxXogxzz8UgoCyme2enn495/9YLR+RMK38MSrd43vA=; b=PkZBla1g3w6Z
 F63SKosSEBgaRYgwZNAfxdujtm/xMKAhtjJLXABZMW7yHAilfya147bvP7UVLp3b+UoXw0kC0UP/E
 kVXjuo4rpStjtkEgekycbq4WzEQvdsxI1D5iZE9vz223GTTFf+dL0ZvAyRWuJHTPnSbwvQZAFPCQN
 8FMkS6Dq5fKey8ioR26grJr5SLOcYTVOBc+5cWI2hpCNKFQ/AvysZmqvllD0jSEMk6lhKR83NCJ4l
 o8OcQq9df69iPDr3h/Rstwkrr+5z7/MgFq0tUaB1Y2JJuWfLCrM22g7Kz4rAT0cEvXWHtmG5yU3mI
 QKzhY2wxfaCdDThFIzYU9Q==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph7ea-0006wI-1c; Tue, 28 Mar 2023 07:38:16 -0400
Date: Tue, 28 Mar 2023 14:38:21 +0300
Message-Id: <83h6u585si.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> (message from
 Dmitry Gutov on Tue, 28 Mar 2023 02:33:38 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <491b788f-c3c3-4877-daa0-f515be9f3a17@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN> <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 28 Mar 2023 02:33:38 +0300
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> > With parser-based features, we have an opportunity to do this in a
> > cleaner manner.
> 
> parser-based features don't need this at all, if considered in 
> isolation. But if we try to combine them with existing mode, or existing 
> packages, they need to play by the common rules. Which they currently do.

Sorry, I don't see the relevance of that to what I wrote above.

> >> If we take indent-for-tab-command, for example, it doesn't have such a
> >> variable, and doesn't really need to: the top-level command calls
> >> 'widen', and then indent-line-function (set by major mode and altered by
> >> e.g. mmm-mode) is free to impose its specific bounds.
> > 
> > I thought about a lower-level, infrastructure-level, mechanism that
> > could be used to restrict a parser to a certain region of the buffer.
> > Then this could be used by every feature based on parsers, instead of
> > us having to invent a separate solution for each one.
> 
> Like narrowing, but just for parsers? But parsers obey narrowing 
> already. Sounds a bit like conceptual duplication. How does this solve 
> blink-matching-paren issue anyway?

We could widen without fearing that a parser will "invade" regions of
buffer text that we don't want it to wander into.

> >> The "grand unified theory of mixed major modes" has been attempted a few
> >> times in the past, and never reached anything practical.
> > 
> > But here we have a unique opportunity to maybe find a solution, at
> > least for stuff based on tree-sitter and similar libraries.  That
> > maybe not "grand", but certainly "respectable".
> 
> tree-sitter has its own support for mixed languages.

So your argument about mmm framework was a red herring, cause that
problem doesn't exist wrt tree-sitter parsers?

> >>>> Except it's already limited by narrowing.
> >>>
> >>> Which is a fragile, semi-broken means, as we all know.
> >>
> >> What is a broken mess, is user-level narrowing.
> > 
> > Which is why restricting parsers should not be a user-level feature.
> 
> We're talking elisp-level, though. The problem with interactive 
> narrowing, is its impossible to tell apart from one effected by Lisp. 
> And they usually have different goals.

Yes.  So if this new feature will not be exposed to users, those
dangers will be avoided.

> >> What I've seen here so far is you suggesting we go ahead and break the
> >> existing convention and then let "them" (third-party authors including
> >> myself) come up with a new working one.
> > 
> > You are mixing two semi-separate issues: how to fix the immediate
> > problem with blink-matching-paren (if we consider it a serious
> > problem), and how to try solving similar issues as a whole.
> 
> Not mixing anything. We have one proposal for improving 
> blink-matching-paren integration anyway. It should be compatible with 
> whatever we choose regarding narrowing and mixed modes.
> 
> > The
> > latter is a long-term goal, and we can discuss it freely and calmly;
> > whereby ideas can be brought up even if they might not be the most
> > clever ones or the ones with which you personally agree.
> 
> I'm not looking for "clever".
> 
> >> My stance here is we shouldn't break it before we create a new one.
> > 
> > No one broke anything.  We are just discussing ideas.  Please don't
> > exaggerate.
> 
> I never said anybody has broken anything already.

You did say that my ideas break something, see above.  Ideas cannot
break any code, so this argument shouldn't be brought up if you want a
calm and rational discussion.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 11:40:01 +0000
Resent-Message-ID: <handler.62333.B62333.168000355823881 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168000355823881
          (code B ref 62333); Tue, 28 Mar 2023 11:40:01 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 11:39:18 +0000
Received: from localhost ([127.0.0.1]:49080 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ph7fa-0006D6-CZ
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:39:18 -0400
Received: from heytings.org ([95.142.160.155]:57544)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1ph7fX-0006Cx-QE
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 07:39:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1680003554;
 bh=PzvPOXkFJY4pXJ/JFygpojGRu8FutHWyEWiFJZqz6aY=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=dEfG9/JAb4Os0GXyu1WooJIvtRi4EBpU9QXBSqucd9cCPiiOW22w8IxcrceQt2k3E
 zhrhjjx8nypOQiRqYy+doQP8K6+nRrkVniKrJiEjD+ZEXIL9YqlIEcJqmHFFrbBgPD
 Xv4R8CGvKN2JHbKm3ymKQwVLbJIZVZ+8xMTyV4Cv4OSxR2OB3Iqeb4HBe6berMe6+h
 /Sx6DzTiUGVtB9+A4BzJW0SmrjWGCKtu8acnQLPw1/4YrYA7wlYeB36+2GkUYT5qPu
 QSFfe9iROyGMCiRRhmA0EuBXUWAgjCMibYnpeaY+3axTjVYTBoKTMoeftLwWXwsvL6
 OoEVqxe10qM0w==
Date: Tue, 28 Mar 2023 11:39:13 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <83jzz1865h.fsf@HIDDEN>
Message-ID: <d60cc5d44da44a1b6130@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <728618716b5bdf2ef2da@HIDDEN> <83jzz1865h.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>> which will work, independently of the A-B narrowing set by the user, 
>> and will reset the narrowing to A-B upon return.
>
> It will only work if [C..D] is inside [A..B].  It will not work if a 
> Lisp program wants to widen [A..B], i.e. if [C..D] is larger than 
> [A..B].
>

Hmmm... no, it will work for any values of [C..D]: (widen) is equivalent 
to (narrow-to-region 1 (1+ (buffer-size))), and in general the bounds 
given to 'narrow-to-region' are not limited by the current narrowing.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 12:12:02 +0000
Resent-Message-ID: <handler.62333.B62333.168000549527286 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168000549527286
          (code B ref 62333); Tue, 28 Mar 2023 12:12:02 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 12:11:35 +0000
Received: from localhost ([127.0.0.1]:49118 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ph8Ap-000762-CN
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 08:11:35 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48854)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ph8An-00075m-Cr
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 08:11:33 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph8Ah-0001nh-Bv; Tue, 28 Mar 2023 08:11:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=nT0TADC2qOcxf6X5AiJbX4z1VTtF2DKWs6gggQXQYTY=; b=AXNW6aTneDia
 hQbm7a4XHnHodTgPHLxsvBtDMg46MCEOoCl5RvoA9ZR1ojtTIknoAxhP17oVWJZTJnwT4ql77IDTZ
 9fow6BATtBlShPqO7d+VJeScgM3xIWPqkiQLzaH7/AixyDYihzc5S7K1siE+qFAA+2t0OESpvtFOv
 X4T8cvsbEquk3lbill6ZNFUSMOUUoPGIF4h+F5OSCGQ+BdRC7SuQpwfU/XDYM/Mib9hJzHB8T+qBd
 Qv8vEuHv9In3hI1QG2hXqsSETnIwn5Aaq0o2U0lbQpqA2sAWSboaONbmlYdaKfQM9DVeEk5n7Yl62
 K307O/22FZ+hcGgZ9i7Q9g==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph8Ag-00058h-P3; Tue, 28 Mar 2023 08:11:27 -0400
Date: Tue, 28 Mar 2023 15:11:31 +0300
Message-Id: <838rfh8498.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <d60cc5d44da44a1b6130@HIDDEN> (message from Gregory
 Heytings on Tue, 28 Mar 2023 11:39:13 +0000)
References: <87fs9yur7r.fsf@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <728618716b5bdf2ef2da@HIDDEN> <83jzz1865h.fsf@HIDDEN>
 <d60cc5d44da44a1b6130@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 28 Mar 2023 11:39:13 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: dgutov@HIDDEN, wkirschbaum@HIDDEN, casouri@HIDDEN, 
>     62333 <at> debbugs.gnu.org
> 
> 
> >> which will work, independently of the A-B narrowing set by the user, 
> >> and will reset the narrowing to A-B upon return.
> >
> > It will only work if [C..D] is inside [A..B].  It will not work if a 
> > Lisp program wants to widen [A..B], i.e. if [C..D] is larger than 
> > [A..B].
> >
> 
> Hmmm... no, it will work for any values of [C..D]: (widen) is equivalent 
> to (narrow-to-region 1 (1+ (buffer-size))), and in general the bounds 
> given to 'narrow-to-region' are not limited by the current narrowing.

with-restriction signals an error if you call it wit a region that is
outside of the current restriction.  At least it does here.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 12:26:02 +0000
Resent-Message-ID: <handler.62333.B62333.168000630728610 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168000630728610
          (code B ref 62333); Tue, 28 Mar 2023 12:26:02 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 12:25:07 +0000
Received: from localhost ([127.0.0.1]:49122 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ph8Nu-0007RN-Qv
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 08:25:07 -0400
Received: from heytings.org ([95.142.160.155]:57606)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1ph8Nt-0007RC-1V
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 08:25:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1680006303;
 bh=1fCiH57NY9Q1+GOIwNUi9s6/XFuICs/bk3rd4R2C/yg=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=M2HQcP6Ri55EimxyEQ4NoaQu4DzfwxNdr1f1ecQhmlb+AmyVP9ZhWFX/bPy0LG5l2
 02rrkTHHIPxxluumpNybmVEJ4EALsHfjnscXxbHNnmCI3ZOzomPSI3/r/Sbp3rXJdC
 cFe4K3aStXdzoCMVrA/hIzowBrK843boiC2Tk5WDTBB4titMQ80PZ76uoZVRgd6f73
 94IvB0ifsAGVHt+A+nTjaD7iSawBZlT1gCRAAdUz9a4x8gNbJG+USgowC0RdzslEAc
 32QBj4QLPRw8B30KTJc/4418GldWIXF5JDtOEMT3yTWHY9J6cZLAUazAtMUwjoVKv5
 SwmHmhNs2KpGw==
Date: Tue, 28 Mar 2023 12:25:03 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <838rfh8498.fsf@HIDDEN>
Message-ID: <d60cc5d44df333ad8722@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN>
 <83bkke9uue.fsf@HIDDEN> <728618716b5bdf2ef2da@HIDDEN>
 <83jzz1865h.fsf@HIDDEN> <d60cc5d44da44a1b6130@HIDDEN>
 <838rfh8498.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>> Hmmm... no, it will work for any values of [C..D]: (widen) is 
>> equivalent to (narrow-to-region 1 (1+ (buffer-size))), and in general 
>> the bounds given to 'narrow-to-region' are not limited by the current 
>> narrowing.
>
> with-restriction signals an error if you call it wit a region that is 
> outside of the current restriction.  At least it does here.
>

Do you have a recipe?  It should not signal an error, and I can't 
reproduce that.  With this for instance:

M-: (global-set-key (kbd "C-t") (lambda () (interactive) (with-restriction 20 30 (message "{%s}" (buffer-string))))) RET

C-t (in *scratch*) displays {or text th}, even if the text is narrowed say 
to the second line.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 12:37:02 +0000
Resent-Message-ID: <handler.62333.B62333.168000697129758 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168000697129758
          (code B ref 62333); Tue, 28 Mar 2023 12:37:02 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 12:36:11 +0000
Received: from localhost ([127.0.0.1]:49136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ph8Yd-0007ju-0V
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 08:36:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54322)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1ph8Ya-0007jh-NZ
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 08:36:09 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph8YU-0006E4-HZ; Tue, 28 Mar 2023 08:36:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=c5Of5ttbzDFu5qG9AqVfw7widc0pgKZ0EEldmlhLTa8=; b=J2LAyFrJSxyC
 +Vt36fLKFhwljA5mmn14zFlHwtP5mMVsdZFkmLxNEqE/vVTdLor7lGg75aybqKjbpurqshLMD02rJ
 kNcQWcZIwrcr7VQlNq7wRRBR7q05dD0bWcCsejod8ZVAJg0Ro5Wo3Id7Lmvc126swgLM9h8vywtaV
 mJKCgzIZo6Vuet+cJJFgGnFsKWMDmOvBZYELP2vnUvRSJNMIQMJMgt6FUhbaW9H5ZTUyP1Mjauv0d
 R2kUiY0HDknG+ZGXwxV5KpN9zXNvmugqFklbO3+3F7eqJuqikRqD5iRYduYX4kX6q5EGGmGkD00Ig
 2Je7YAjHiy8QYQMuC8kHMg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1ph8YT-0002Wp-NO; Tue, 28 Mar 2023 08:36:02 -0400
Date: Tue, 28 Mar 2023 15:36:06 +0300
Message-Id: <837cv18349.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <d60cc5d44df333ad8722@HIDDEN> (message from Gregory
 Heytings on Tue, 28 Mar 2023 12:25:03 +0000)
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN>
 <83bkke9uue.fsf@HIDDEN> <728618716b5bdf2ef2da@HIDDEN>
 <83jzz1865h.fsf@HIDDEN> <d60cc5d44da44a1b6130@HIDDEN>
 <838rfh8498.fsf@HIDDEN> <d60cc5d44df333ad8722@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Tue, 28 Mar 2023 12:25:03 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, 
>     dgutov@HIDDEN
> 
> 
> >> Hmmm... no, it will work for any values of [C..D]: (widen) is 
> >> equivalent to (narrow-to-region 1 (1+ (buffer-size))), and in general 
> >> the bounds given to 'narrow-to-region' are not limited by the current 
> >> narrowing.
> >
> > with-restriction signals an error if you call it wit a region that is 
> > outside of the current restriction.  At least it does here.
> >
> 
> Do you have a recipe?  It should not signal an error, and I can't 
> reproduce that.  With this for instance:
> 
> M-: (global-set-key (kbd "C-t") (lambda () (interactive) (with-restriction 20 30 (message "{%s}" (buffer-string))))) RET

Sorry, my bad.  Bad testing.

But regardless, lifting user-defined restriction is a no-no, that's
what the problem is all about.  with-restriction cannot do anything
against this.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 21:10:02 +0000
Resent-Message-ID: <handler.62333.B62333.168003774429896 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168003774429896
          (code B ref 62333); Tue, 28 Mar 2023 21:10:02 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 21:09:04 +0000
Received: from localhost ([127.0.0.1]:50791 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phGYy-0007m8-Bu
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 17:09:04 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:34330)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1phGYw-0007ld-0M
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 17:09:03 -0400
Received: by mail-wr1-f43.google.com with SMTP id v1so13587967wrv.1
 for <62333 <at> debbugs.gnu.org>; Tue, 28 Mar 2023 14:09:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680037736;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=As5PxiKL/s6cd9ZFt7LL0G9HvxEPifsCiyBeFe7NmNU=;
 b=j8O2jisP9rDpslYyYNfa3TXtNitkHxhF4l3iddV6U34PgT0VHwgVx6YYEXwmMoUIIB
 Ap7VeLnxs5uxA7v1chE+DoR5T+WEdR0GqgBdF1GUjiJfrEyKHKLykVGqaJn1wVwUHZ95
 26hg1QB02w5XzMaJHlJfIAmKv/dOGfQqX9AY8djFoPtamPi9sFIKT/Xytzv5dB1SLoER
 K1kTVNRPt0STe5lcN5PDlPcdOlKdr1kA/xh+l3ggw+VsTii3umuPE5oL0+3MxRkg5smN
 rpAVXugvXOk3pwRKD+Ual6dmVmT98dUoEx/3UOIYN5qBgY/HUdLgAZ4PSQnxWuQbR7Cj
 l47Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680037736;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=As5PxiKL/s6cd9ZFt7LL0G9HvxEPifsCiyBeFe7NmNU=;
 b=QkWzItrN5x57UiSf+FZCg9j7V+VysVLf7cyQbWpNSGT/oG4qo+JKdJjMObjGkdmYox
 OL8mM6hNOYoCbtemKQoVdGZ/f2oY7e39N3l03ue8XZflCRgW5PRIRrXh1Uod636EbPoA
 tPKgdgoIxOIQ2PfLevjxSbyWX8w0Mjel/Pw6vG9fLGOYVgVRRpPgMo+7D4w184+VLwdb
 rrRClKdItuzs9wy9I205Z2nHfwXhJbkeQsBYN4CJdTcKmhcB1IepNC6qQllB+K1IOeDt
 W/ERwPAXpm2T+GZjUw0fsyFR71EFR9l8LGqMeffxoDo6fP95GrsTEPCVvDP9O8DKZr6y
 7RSw==
X-Gm-Message-State: AAQBX9c48mxrf27rocyfYiz+uM9figC0OQnGkCqx2LMutFSlLsdRpZ5q
 5qN3fIbZCkyhwb4rWIUMYGk=
X-Google-Smtp-Source: AKy350YSolaoSbSamBX+WLZhWt0K3HW+MkJ1/S8q+wF//2PzgYmneyLPl4ZbSzHIuTX9XmoulXddhA==
X-Received: by 2002:a5d:6411:0:b0:2c7:1e16:57cf with SMTP id
 z17-20020a5d6411000000b002c71e1657cfmr13351206wru.67.1680037735850; 
 Tue, 28 Mar 2023 14:08:55 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 h3-20020a05600c314300b003e1202744f2sm13655409wmo.31.2023.03.28.14.08.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Mar 2023 14:08:55 -0700 (PDT)
Message-ID: <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN>
Date: Wed, 29 Mar 2023 00:08:53 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83ilel861g.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 28/03/2023 14:32, Eli Zaretskii wrote:
>> Date: Tue, 28 Mar 2023 02:06:17 +0300
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>> On 27/03/2023 16:39, Eli Zaretskii wrote:
>>>> Date: Mon, 27 Mar 2023 08:24:42 +0000
>>>> From: Gregory Heytings<gregory@HIDDEN>
>>>> cc: Eli Zaretskii<eliz@HIDDEN>,wkirschbaum@HIDDEN,casouri@HIDDEN,
>>>>       62333 <at> debbugs.gnu.org
>>>>
>>>>>> Which is a fragile, semi-broken means, as we all know.
>>>>> What is a broken mess, is user-level narrowing. And how the downstream
>>>>> code can never guess the purpose the narrowing was applied for.
>>>> Note that this is what labeled narrowings attempts to solve.
>>> Labeled narrowing cannot solve this because it does nothing to
>>> alleviate the problems with user-defined narrowing.  So if the user
>>> narrows the buffer, we cannot do anything to safely widen in the
>>> general case, and labeled narrowing cannot help us.
>>
>> Is that because we don't think the user level narrowing is done purely
>> for visual effect?
> 
> Indeed, it isn't always for visual effect.

When isn't it? Is there a way to determine that from code?

>> judging by regular user requests for make this or that command
>> ignore user-level narrowing, it seems like "purely visual" should be the
>> default interpretation.
> 
> I think you base your judgment on feedback from users who are not used
> to take advantage of narrowing in editing.  I think most young people
> aren't, since this feature is more-or-less unique to Emacs.

Either narrowing should be used to change lexical/grammatical/etc 
context, or it should not. Do we have any documentation that says one or 
the other way? That should affect how Lisp code deals with narrowing -- 
which interactive functions should widen, and so on.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Tue, 28 Mar 2023 21:20:01 +0000
Resent-Message-ID: <handler.62333.B62333.168003839130928 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168003839130928
          (code B ref 62333); Tue, 28 Mar 2023 21:20:01 +0000
Received: (at 62333) by debbugs.gnu.org; 28 Mar 2023 21:19:51 +0000
Received: from localhost ([127.0.0.1]:50795 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phGjO-00082l-KL
	for submit <at> debbugs.gnu.org; Tue, 28 Mar 2023 17:19:50 -0400
Received: from mail-wr1-f42.google.com ([209.85.221.42]:37405)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1phGjM-00082Z-Vi
 for 62333 <at> debbugs.gnu.org; Tue, 28 Mar 2023 17:19:49 -0400
Received: by mail-wr1-f42.google.com with SMTP id y14so13606714wrq.4
 for <62333 <at> debbugs.gnu.org>; Tue, 28 Mar 2023 14:19:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680038383;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=WrzVMGKdr4BWZFwGTLZRQ0N2Xll/AhkkiRF/KfaNBe4=;
 b=L2WBuMEhrHnsbWyREMBgcgHLRfbn27cPKHUTBfNEtsQYtP+1PIO43yztbUmHg8IlFq
 LZf6TEbLT8f753832ftL1GVZsD9Yf7lyfV8cNVJCGgg0B79vYyUtN3iSOLMnnap9ULZR
 wSN9svJSC1T7nKFDs2oHAo0PAkfjYrS8x5h5BosgjYgnDrpA44zZcOmfDyThgsGsaV9Z
 3raaoFvhdtRhizcOQFMHeqwLFsw9VUc09vVKSdJtGMrpLeFPt6QQtbrU8+bzvAXylJZg
 76lzyZMDodx/knCCkO40YPJKkWa/7vPojXaznPbRGXa8GGMHrDlWPRy/o9k5FUtcFJR+
 Lsnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680038383;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=WrzVMGKdr4BWZFwGTLZRQ0N2Xll/AhkkiRF/KfaNBe4=;
 b=DNvWABT1E1sZ2MVdFS4s611OzhiwCvbc7Q++ychrQIVQTeRtz/AWZW7yakzsn76zxf
 L3HbrCzanaWSpcZp3usqoZK8Tqq1O2Pp+N25u5YwA2jMpFSdPscxjiuJ/+hSnOhDfA+F
 SLAn7pbp/w1oSg+A91xQjvoVbQ1lTgO0aEUaBtg1qy4uoEWygFqkWDGvOsTajaNbdvFx
 jqomkgWeWTfH/GS/+8nkETWD79NNOobhciRKS9l1o70NMe0dA9u5jpi+fNNl7OzhOt7w
 4DruXDiM/yh80s+d3zdL/al12t7+xXn0ywlKc54OEB8OW4Hb0gfAKl+/grwO2K9Ab3f1
 ppyg==
X-Gm-Message-State: AAQBX9fk0jluWq4+em2I+3SpDl9xrLQfAjdffO449BdLXkDDw3e65NFI
 K5tnv7sW296L/0XtXunQkPE=
X-Google-Smtp-Source: AKy350Y+od8m3EIXwfTbIb2KV7bCzqSTSdyJ0e3BOy44NOctfZ+x+6ZLtEaOLc2gpgcKkhOu+C2rRQ==
X-Received: by 2002:a5d:550c:0:b0:2d9:5608:ee0 with SMTP id
 b12-20020a5d550c000000b002d956080ee0mr13753564wrv.69.1680038382945; 
 Tue, 28 Mar 2023 14:19:42 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 d9-20020adfe889000000b002d97529b3bbsm18180635wrm.96.2023.03.28.14.19.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 28 Mar 2023 14:19:42 -0700 (PDT)
Message-ID: <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
Date: Wed, 29 Mar 2023 00:19:41 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN> <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
 <83h6u585si.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83h6u585si.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 28/03/2023 14:38, Eli Zaretskii wrote:
>> Date: Tue, 28 Mar 2023 02:33:38 +0300
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>>> With parser-based features, we have an opportunity to do this in a
>>> cleaner manner.
>>
>> parser-based features don't need this at all, if considered in
>> isolation. But if we try to combine them with existing mode, or existing
>> packages, they need to play by the common rules. Which they currently do.
> 
> Sorry, I don't see the relevance of that to what I wrote above.
> 
>>>> If we take indent-for-tab-command, for example, it doesn't have such a
>>>> variable, and doesn't really need to: the top-level command calls
>>>> 'widen', and then indent-line-function (set by major mode and altered by
>>>> e.g. mmm-mode) is free to impose its specific bounds.
>>>
>>> I thought about a lower-level, infrastructure-level, mechanism that
>>> could be used to restrict a parser to a certain region of the buffer.
>>> Then this could be used by every feature based on parsers, instead of
>>> us having to invent a separate solution for each one.
>>
>> Like narrowing, but just for parsers? But parsers obey narrowing
>> already. Sounds a bit like conceptual duplication. How does this solve
>> blink-matching-paren issue anyway?
> 
> We could widen without fearing that a parser will "invade" regions of
> buffer text that we don't want it to wander into.

So any code that wants to restrict a "parser" based buffer, would need 
to use a different primitive to narrow? And vice versa, any code that 
uses a parser, will need to (widen) first, to ensure that the parser is 
not affected by any restriction set up by any code previously?

Anyway, I don't see why we should institute a special category for these 
buffers. Most language modes which define syntax-propertize-function are 
basically "parser-based", in most of the relevant respects. Except the 
accuracy is less, and we write the parsing code ourselves.

>>>> The "grand unified theory of mixed major modes" has been attempted a few
>>>> times in the past, and never reached anything practical.
>>>
>>> But here we have a unique opportunity to maybe find a solution, at
>>> least for stuff based on tree-sitter and similar libraries.  That
>>> maybe not "grand", but certainly "respectable".
>>
>> tree-sitter has its own support for mixed languages.
> 
> So your argument about mmm framework was a red herring, cause that
> problem doesn't exist wrt tree-sitter parsers?

Nope, see the first paragraph of my previous reply (the "no relevance" one).

>>>> My stance here is we shouldn't break it before we create a new one.
>>>
>>> No one broke anything.  We are just discussing ideas.  Please don't
>>> exaggerate.
>>
>> I never said anybody has broken anything already.
> 
> You did say that my ideas break something, see above.  Ideas cannot
> break any code, so this argument shouldn't be brought up if you want a
> calm and rational discussion.

Ideas cannot, but implementing them can. "This or that change will break 
an existing convention" is a rational argument.

Shall we stop quibbling over words?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 29 Mar 2023 11:09:02 +0000
Resent-Message-ID: <handler.62333.B62333.168008811631859 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168008811631859
          (code B ref 62333); Wed, 29 Mar 2023 11:09:02 +0000
Received: (at 62333) by debbugs.gnu.org; 29 Mar 2023 11:08:36 +0000
Received: from localhost ([127.0.0.1]:51391 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phTfQ-0008Hl-72
	for submit <at> debbugs.gnu.org; Wed, 29 Mar 2023 07:08:36 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48700)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1phTfN-0008HY-KM
 for 62333 <at> debbugs.gnu.org; Wed, 29 Mar 2023 07:08:34 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phTfH-00014E-O7; Wed, 29 Mar 2023 07:08:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=OfSZu0hJ+CwSWb81rvyab+4TjL/KpToE9WJIhJeyUpA=; b=onc9TnXBrc+r
 Ivw2aaOf97PIMmuFNUKDFmggxhnaVSG6ND8sjIMlHuYpS7sJJFfjf8FqX4Zn/oC71F6xzNhbpOx9+
 2j2WeKRW1tBi6dHeoqD4/p8OedvhlcLU68R04qAlEfdamTYQF6HOkPo4N14IWk+inIfHpj1roGhYA
 fajU86CJQ219qMuXHTZQKeLXKhDRdvaYEOqyzUCXqQMhOvvx2/nuiwYbPk6AvUQewUF8iN8smoxmF
 Kt1cWiKlGEB/gyv+v4V4jIlHsTc9sHL1aBq2kqLycB/lcdLpXEZpaUx/V6R1xaYouwjx71QwKNpVu
 XlEXirFGp9nQVtsADGVkfQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phTfD-0004SV-KO; Wed, 29 Mar 2023 07:08:27 -0400
Date: Wed, 29 Mar 2023 14:08:31 +0300
Message-Id: <83lejf7r2o.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> (message from
 Dmitry Gutov on Wed, 29 Mar 2023 00:08:53 +0300)
References: <87fs9yur7r.fsf@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Wed, 29 Mar 2023 00:08:53 +0300
> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
>  62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> >> Is that because we don't think the user level narrowing is done purely
> >> for visual effect?
> > 
> > Indeed, it isn't always for visual effect.
> 
> When isn't it? Is there a way to determine that from code?

I'm not sure I understand the question, but if I do, then narrowing to
prevent search functions and commands from finding irrelevant hits is
one example that comes to mind.

> >> judging by regular user requests for make this or that command
> >> ignore user-level narrowing, it seems like "purely visual" should be the
> >> default interpretation.
> > 
> > I think you base your judgment on feedback from users who are not used
> > to take advantage of narrowing in editing.  I think most young people
> > aren't, since this feature is more-or-less unique to Emacs.
> 
> Either narrowing should be used to change lexical/grammatical/etc 
> context, or it should not. Do we have any documentation that says one or 
> the other way? That should affect how Lisp code deals with narrowing -- 
> which interactive functions should widen, and so on.

I was talking about user commands that narrow, so I'm not sure I
understand how documentation could help.  When the user types "C-x n n",
there's nothing Emacs can do except obey.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 29 Mar 2023 11:18:02 +0000
Resent-Message-ID: <handler.62333.B62333.168008867832697 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168008867832697
          (code B ref 62333); Wed, 29 Mar 2023 11:18:02 +0000
Received: (at 62333) by debbugs.gnu.org; 29 Mar 2023 11:17:58 +0000
Received: from localhost ([127.0.0.1]:51397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phToU-0008VJ-AR
	for submit <at> debbugs.gnu.org; Wed, 29 Mar 2023 07:17:58 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51202)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1phToT-0008V4-3s
 for 62333 <at> debbugs.gnu.org; Wed, 29 Mar 2023 07:17:57 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phToN-0002Sv-F4; Wed, 29 Mar 2023 07:17:51 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=t+jIE5/bVGP8fuPasPyZ27JErH38EEjr5iv8LwhiFTM=; b=AL+ZITZ2w6of
 4mR6zuSP0jqgmY/9qjGE04lt4yTLClI3DTkC2XsBITIEFIbKGbyuM9GFLogzsAXq3knJaaNhkQzCQ
 jOcnCUpn6DXFSYP//KHmUEqrbpXPqYyonNJdRKCtIgxD039x3dOJVmxmN49d+TYLvu4/PYlNDR0Wk
 91ZEw2Uu+PThowMbmAMLlL0+7qgHoDZ9KAuSHIMXXVbwEwfoVFvUp5Qq4EExcGumX4qbB3kB1icHG
 8tM/djRmpFVRxrXtDOH/x5mTJfvuUQDdToNaetEAVEqke6Z4ztMYhB/VibJPHfy5Sdl1WLJvxzWeU
 yWAlRZUja+CylxXTVA/aHw==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phToM-0005Px-Kg; Wed, 29 Mar 2023 07:17:50 -0400
Date: Wed, 29 Mar 2023 14:17:57 +0300
Message-Id: <83jzyz7qmy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN> (message from
 Dmitry Gutov on Wed, 29 Mar 2023 00:19:41 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <BB02A1DF-6649-46B9-A677-BAE2C9F8ED3D@HIDDEN> <83sfduelab.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN> <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
 <83h6u585si.fsf@HIDDEN> <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Wed, 29 Mar 2023 00:19:41 +0300
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> >> Like narrowing, but just for parsers? But parsers obey narrowing
> >> already. Sounds a bit like conceptual duplication. How does this solve
> >> blink-matching-paren issue anyway?
> > 
> > We could widen without fearing that a parser will "invade" regions of
> > buffer text that we don't want it to wander into.
> 
> So any code that wants to restrict a "parser" based buffer, would need 
> to use a different primitive to narrow?

No, the idea is to create the parser with these restrictions to begin
with.

> And vice versa, any code that uses a parser, will need to (widen)
> first, to ensure that the parser is not affected by any restriction
> set up by any code previously?

No, if the parser is restricted, there should be no need to "widen"
it, at least not in most cases I could think about where a parser
should be restricted to a part of the buffer.

> Anyway, I don't see why we should institute a special category for these 
> buffers.

Because IMO it's cleaner and simpler than using narrowing, and doesn't
suffer from the problems we see in narrowing.

> >>>> The "grand unified theory of mixed major modes" has been attempted a few
> >>>> times in the past, and never reached anything practical.
> >>>
> >>> But here we have a unique opportunity to maybe find a solution, at
> >>> least for stuff based on tree-sitter and similar libraries.  That
> >>> maybe not "grand", but certainly "respectable".
> >>
> >> tree-sitter has its own support for mixed languages.
> > 
> > So your argument about mmm framework was a red herring, cause that
> > problem doesn't exist wrt tree-sitter parsers?
> 
> Nope, see the first paragraph of my previous reply (the "no relevance" one).

Which first paragraph is that?  In what "previous reply" should I look
and where?  (And why couldn't you simply copy that here, to make
following the discussion easier?)

> >>>> My stance here is we shouldn't break it before we create a new one.
> >>>
> >>> No one broke anything.  We are just discussing ideas.  Please don't
> >>> exaggerate.
> >>
> >> I never said anybody has broken anything already.
> > 
> > You did say that my ideas break something, see above.  Ideas cannot
> > break any code, so this argument shouldn't be brought up if you want a
> > calm and rational discussion.
> 
> Ideas cannot, but implementing them can. "This or that change will break 
> an existing convention" is a rational argument.
> 
> Shall we stop quibbling over words?

I'm "quibbling" over words because your particular selection of words
makes serious discussion nigh impossible.  Not the first time, either.
As soon as there's some disagreement, sooner or later those words
(like "quibbling") come out.  Whether it's because of some attitude or
not, I don't know, but you may wish to reflect on that and perhaps try
to express your disagreements using different words.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 15:51:01 +0000
Resent-Message-ID: <handler.62333.B62333.168019143512550 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168019143512550
          (code B ref 62333); Thu, 30 Mar 2023 15:51:01 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 15:50:35 +0000
Received: from localhost ([127.0.0.1]:59241 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phuXq-0003GL-Mg
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 11:50:34 -0400
Received: from heytings.org ([95.142.160.155]:60488)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1phuXo-0003GC-Ow
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 11:50:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1680191431;
 bh=XqoIhc7zVuPSY3gpIwIQWUOEtTpzud9TPCTuinbPpXM=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=5N+ui36ZUEgMAJDXPgdXDYQcMm05mTDp1Ewsugls7a+6aoG5wjh8YwtXNFW1gdYOt
 3NGuGVaaBFGkD+tgwfPR50rNDow0I6w1gCm4s1L9RZbSrYyyxU8sda5OiusYrAa1qJ
 CFm2oBseFIvwTZEfw1Gs2o3WprsOU5AhoXmPuFNZU8lP5CCnYUijstnoIpzZMJ4DxM
 2ZOwLE374NGp5MRkVCR3LN861E0Ai4+Ch6rmtZSYhVGhUWsD+bsduf2sqblrukjEUK
 CLXc+VaHMkhS+Gfx/zdBYCRsPeSN8BIxSzf2yzbwRm7Tg7MdxSJqdwgT5517L7Cb9R
 hxVC8XB4xrPmg==
Date: Thu, 30 Mar 2023 15:50:31 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <83jzyz7qmy.fsf@HIDDEN>
Message-ID: <e246266e9fed35c79c15@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> <83h6u585si.fsf@HIDDEN>
 <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN> <83jzyz7qmy.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=us-ascii
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>
> No, the idea is to create the parser with these restrictions to begin 
> with.
>

Could you perhaps explain, with some fictitious code, what kind of 
solution you imagine?  I'm not sure I understand (euphemism for: I'm sure 
I don't understand) the problem statement.

In what way would the restrictions you have in mind be different from 
those of a regular narrowing?

Also, would such a parser always/never/sometimes obey the user narrowing?





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 16:05:02 +0000
Resent-Message-ID: <handler.62333.B62333.168019227313989 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168019227313989
          (code B ref 62333); Thu, 30 Mar 2023 16:05:02 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 16:04:33 +0000
Received: from localhost ([127.0.0.1]:59254 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phulN-0003dZ-08
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 12:04:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53738)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1phulK-0003dJ-PS
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 12:04:31 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phulE-0005Zi-Pu; Thu, 30 Mar 2023 12:04:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=di2faOs1/IJRwzBzjQlKbLusiNdnJXbWIvucbZ2N/Mg=; b=ZKEjQorTbbaY
 d7mDSHKVMQcBIqassKtxQFuhYAuj44jWzoY/clV/3CBcNf/NpCy4Hv9aIXOta30sZXomgPjTzewPG
 gM7t9/F95XYDtVBtNp/CGhcAfYzlM9ZSKEfbbp/X1irNm16TEVe5lEupU9GhvHr1kfZDEH9L4PsrK
 9n8XZ105a4+MMQ2JSOjhW/OuBixYR7Yu/UBVA34X5RpQ6w73RNhulooZoBh4jEirwmjnVODTZvShw
 6iA2hD0y0TRbe4aV3Sbq16WfaRSBzUD2o+iHQPGe2yWfThZsrf64XmiWmGU/z6uUACjdLpW2zHlG4
 2JlJvHkGjNXyRsdbTrVZZg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phulA-0006Sc-7r; Thu, 30 Mar 2023 12:04:20 -0400
Date: Thu, 30 Mar 2023 19:04:30 +0300
Message-Id: <83h6u2444x.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <e246266e9fed35c79c15@HIDDEN> (message from Gregory
 Heytings on Thu, 30 Mar 2023 15:50:31 +0000)
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> <83h6u585si.fsf@HIDDEN>
 <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN> <83jzyz7qmy.fsf@HIDDEN>
 <e246266e9fed35c79c15@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 30 Mar 2023 15:50:31 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: Dmitry Gutov <dgutov@HIDDEN>, wkirschbaum@HIDDEN, casouri@HIDDEN, 
>     62333 <at> debbugs.gnu.org
> 
> > No, the idea is to create the parser with these restrictions to begin 
> > with.
> 
> Could you perhaps explain, with some fictitious code, what kind of 
> solution you imagine?  I'm not sure I understand (euphemism for: I'm sure 
> I don't understand) the problem statement.

Something like

  (treesit-make-parser LANGUAGE BUFFER nil START END)

and

  (treesit-parser-set-included-ranges RANGES...)

(the latter already exists).

> In what way would the restrictions you have in mind be different from 
> those of a regular narrowing?

User-defined narrowing will never contradict parser restrictions.

> Also, would such a parser always/never/sometimes obey the user narrowing?

It will always obey narrowing (it must), but we can then widen the
buffer temporarily inside some functions without caring about the
semantics of the narrowing and its source/purpose.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 16:30:03 +0000
Resent-Message-ID: <handler.62333.B62333.168019374216432 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168019374216432
          (code B ref 62333); Thu, 30 Mar 2023 16:30:03 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 16:29:02 +0000
Received: from localhost ([127.0.0.1]:59298 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phv94-0004Gn-5c
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 12:29:02 -0400
Received: from heytings.org ([95.142.160.155]:60550)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1phv92-0004GW-DP
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 12:29:01 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1680193738;
 bh=cMFSGEfEJZ4BxEuM2squRMQBg9k0xOdUl3+1N3BV5Mw=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=PnjI4VhvxBZFDImumDbKJNv2pz6Gri/AdqzwXoxSuUMVHRQ4BRpWYawz5djjkVBKS
 2r0WAKMi+DdMUVhf6oeHMrDOhVwqPjmSfWSp2PAoL1uKISa+9+Qwm0byAWvqZX8PW6
 QnEmiaEO0c4REDxBwgHyLrmTYWHakuFtzp8hwoTTg77HKuF73ipUqfztl1IRpgBp+i
 g65kpIThLPs0j9hi7yBtzl9345dEOQH97gfR+P7CAparrRayL+xxJ8yE4qEaHwQs1v
 ylPUtCy0dRwgHjyie7eVWgXKnZf08bWnrYRtpvXbQeHna+w7Ihikap1RsOmHXc4D15
 zgK9uytj2juFw==
Date: Thu, 30 Mar 2023 16:28:58 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <83h6u2444x.fsf@HIDDEN>
Message-ID: <e246266e9f546282d2b8@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN>
 <83wn34c2qa.fsf@HIDDEN> <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN>
 <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN> <831qlcaysh.fsf@HIDDEN>
 <29679184-7366-0167-9e94-def97048f663@HIDDEN> <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
 <83h6u585si.fsf@HIDDEN> <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
 <83jzyz7qmy.fsf@HIDDEN> <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>> Could you perhaps explain, with some fictitious code, what kind of 
>> solution you imagine?  I'm not sure I understand (euphemism for: I'm 
>> sure I don't understand) the problem statement.
>
> Something like
>
>  (treesit-make-parser LANGUAGE BUFFER nil START END)
>
> and
>
>  (treesit-parser-set-included-ranges RANGES...)
>
> (the latter already exists).
>

Where "RANGES..." are included in [START..END], right?

>> In what way would the restrictions you have in mind be different from 
>> those of a regular narrowing?
>
> User-defined narrowing will never contradict parser restrictions.
>

You mean, they will be independent, right?  In other words, if the user 
sets the narrowing to 1000-1200 in a buffer in which treesit-make-parser 
has been called, say, once with 'php 400 1100' and once with 'js 1100 
1500', the two parsers will continue to have access to these ranges?

>> Also, would such a parser always/never/sometimes obey the user 
>> narrowing?
>
> It will always obey narrowing (it must), but we can then widen the 
> buffer temporarily inside some functions without caring about the 
> semantics of the narrowing and its source/purpose.
>

Here I'm confused, that sentence seems to contradict the previous one. 
"It" in "it will always obey narrowing" is the parser, right, and 
"narrowing" is "the narrowing bounds set by 'treesit-make-parser'", right?





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 16:41:01 +0000
Resent-Message-ID: <handler.62333.B62333.168019441617512 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168019441617512
          (code B ref 62333); Thu, 30 Mar 2023 16:41:01 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 16:40:16 +0000
Received: from localhost ([127.0.0.1]:59304 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phvJw-0004YN-DK
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 12:40:16 -0400
Received: from eggs.gnu.org ([209.51.188.92]:36652)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1phvJu-0004Y6-Eg
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 12:40:15 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phvJo-0005l4-Pw; Thu, 30 Mar 2023 12:40:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=mXqd2QSCeK58ApE4w3ldD0ci1G+7tCiPXGoISnLywh0=; b=BShwrVJCmzWn
 t37jKBgJWCDUuRxbioFTjV8Yi9tgXEYfuCXGc2w1MIKDHh4XQyqvshM1AektGxSjuONT7OJDH7stj
 dpEYnQ/b2ksGtyjpzBa1Q0P76wlwBFUXaj48k5VqkDa19Wr8zFF7aFl1WJSogm1mJeLL2BPX3yJhU
 wTDWeBR7GezfuCvylxjhLIHVGVNJo2cXyQvl/IiNfzYYJ+ufXpLuLZZYjS7xEAzmIJWBPuWn/Z43B
 l8zYiW0ZpbBiGoyDLKJbkd/HAuqXD6kJpgxHpK3w7MCTAYTsw34QHgvzbcrbsLZtNeNlacd/vqWXU
 b54Se8ONq310HIQaY7I93A==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phvJo-0000ZS-98; Thu, 30 Mar 2023 12:40:08 -0400
Date: Thu, 30 Mar 2023 19:40:19 +0300
Message-Id: <83edp642h8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <e246266e9f546282d2b8@HIDDEN> (message from Gregory
 Heytings on Thu, 30 Mar 2023 16:28:58 +0000)
References: <87fs9yur7r.fsf@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN>
 <83wn34c2qa.fsf@HIDDEN> <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN>
 <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN> <831qlcaysh.fsf@HIDDEN>
 <29679184-7366-0167-9e94-def97048f663@HIDDEN> <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
 <83h6u585si.fsf@HIDDEN> <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
 <83jzyz7qmy.fsf@HIDDEN> <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN> <e246266e9f546282d2b8@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 30 Mar 2023 16:28:58 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, 
>     dgutov@HIDDEN
> 
> > Something like
> >
> >  (treesit-make-parser LANGUAGE BUFFER nil START END)
> >
> > and
> >
> >  (treesit-parser-set-included-ranges RANGES...)
> >
> > (the latter already exists).
> >
> 
> Where "RANGES..." are included in [START..END], right?

Probably.  Or maybe instead of START and END we should have RANGES...

> > User-defined narrowing will never contradict parser restrictions.
> 
> You mean, they will be independent, right?  In other words, if the user 
> sets the narrowing to 1000-1200 in a buffer in which treesit-make-parser 
> has been called, say, once with 'php 400 1100' and once with 'js 1100 
> 1500', the two parsers will continue to have access to these ranges?

The parsers _can_ have access to those ranges, if they need it for
some reason.  In general, everything in Emacs should honor the current
restriction, unless there's a good reason to ignore it.  The problem
with ignoring it is that we can never know which code/user defined the
restriction and for what purpose.  I hope that keeping the parser's
restrictions as part of the parser itself will allow us to break free
of that issue when we have to widen.

> >> Also, would such a parser always/never/sometimes obey the user 
> >> narrowing?
> >
> > It will always obey narrowing (it must), but we can then widen the 
> > buffer temporarily inside some functions without caring about the 
> > semantics of the narrowing and its source/purpose.
> >
> 
> Here I'm confused, that sentence seems to contradict the previous one. 
> "It" in "it will always obey narrowing" is the parser, right, and 
> "narrowing" is "the narrowing bounds set by 'treesit-make-parser'", right?

See above.  I hope that explains what I meant.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 17:28:02 +0000
Resent-Message-ID: <handler.62333.B62333.168019723022155 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168019723022155
          (code B ref 62333); Thu, 30 Mar 2023 17:28:02 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 17:27:10 +0000
Received: from localhost ([127.0.0.1]:59353 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phw3J-0005lG-MX
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 13:27:10 -0400
Received: from heytings.org ([95.142.160.155]:60614)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1phw3D-0005l4-SA
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 13:27:08 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1680197222;
 bh=ZTIwf8bN/+lnaiA/qi9XsE6zPapK9BmVmWvYwdN5/dY=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=P5Exg7O0g7+qoujIMrrLX1U+DzQCv0BoCKsG7opWFf8PQ3RP2UL53BzK55wQxHumu
 crUFjiz65CNONCqBe9bRwxPvJZ4uXDmzbzdOACHDIT7jzJOu+7see2/hagBmNrYhWw
 ZwsE/vCaCJnkONEINGj/4kwIJ9URMhXkZwsR3L6CYGVxWE8KY9RRAgi81U9eyazXU9
 V7UzAlWn0uA8G6VxoQpnWuld4klDNyIEpChhp1iGxLrOE2PUiG7CnLHYYOtmLgeBXB
 64cWf78txmbc7sa4C+VbrBtWDr1RuwLw2701SMmqGmdrOpqDiVpzVQzDnIzIRjhavK
 w4l5V4P2UUL6g==
Date: Thu, 30 Mar 2023 17:27:02 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <83edp642h8.fsf@HIDDEN>
Message-ID: <e246266e9f80fbc0271b@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN>
 <29679184-7366-0167-9e94-def97048f663@HIDDEN> <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> <83h6u585si.fsf@HIDDEN>
 <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
 <83jzyz7qmy.fsf@HIDDEN> <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN> <e246266e9f546282d2b8@HIDDEN>
 <83edp642h8.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=us-ascii
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>>> User-defined narrowing will never contradict parser restrictions.
>>
>> You mean, they will be independent, right?  In other words, if the user 
>> sets the narrowing to 1000-1200 in a buffer in which 
>> treesit-make-parser has been called, say, once with 'php 400 1100' and 
>> once with 'js 1100 1500', the two parsers will continue to have access 
>> to these ranges?
>
> The parsers _can_ have access to those ranges, if they need it for some 
> reason.  In general, everything in Emacs should honor the current 
> restriction, unless there's a good reason to ignore it.
>

Okay, so in the above example by default the parsers will only have access 
to 1000-1100 for the first one, and 1100-1200 for the second one until the 
user removes the restrictions.  Unless they need to widen the buffer for 
some (good) reason.

If they do widen, will the parsers get access to [400..1100] and 
[1100..1500], or to the whole buffer?  Or will they have two ways to 
widen, one to get access to the whole region on which they have been 
defined, and another one to get access to the whole buffer?

>
> The problem with ignoring it is that we can never know which code/user 
> defined the restriction and for what purpose.  I hope that keeping the 
> parser's restrictions as part of the parser itself will allow us to 
> break free of that issue when we have to widen.
>

At least it's a possibility that seems worth investigating.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 17:48:01 +0000
Resent-Message-ID: <handler.62333.B62333.168019844924078 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168019844924078
          (code B ref 62333); Thu, 30 Mar 2023 17:48:01 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 17:47:29 +0000
Received: from localhost ([127.0.0.1]:59377 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phwMz-0006GH-A7
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 13:47:29 -0400
Received: from eggs.gnu.org ([209.51.188.92]:50016)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1phwMx-0006G4-MA
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 13:47:28 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phwMr-00070W-MG; Thu, 30 Mar 2023 13:47:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=76KyyaAR10k+uGsuR3wNZ8kmInmtaFDBpev8eWz9xS8=; b=X4iW1je8caJB
 HsOks/hDC3w2gBoJG8uSOUOrpndLyfIVAb99loqEBgbezqebDCszvUaOjXdUUXq4AzRATIzkFIiRh
 oSPZrYCFQaffU3FuJ4tz8Xde3tGBHTqYrFzzysmCO0Z/yBUDwYrtWG59dLE+VdOigfpzBbupxcl3X
 BcZYoVvOUOt4sfmq2TlxalOumD8azuk90/jTwwsM3xx99xEdkDD1tqmlmg3IzeYvBlHIFieGdQGeU
 +sPo5iZeLwYlBPKO8lxtpYeFtL8HXJHaxi1KAOOFl8e8G8Lw+fzknFNVBcEThNMPodO4ktnfCfLx8
 P2rzHn9ke+bC/Yk6uJwWyg==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1phwMq-0006rq-L0; Thu, 30 Mar 2023 13:47:21 -0400
Date: Thu, 30 Mar 2023 20:47:30 +0300
Message-Id: <83bkka3zd9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <e246266e9f80fbc0271b@HIDDEN> (message from Gregory
 Heytings on Thu, 30 Mar 2023 17:27:02 +0000)
References: <87fs9yur7r.fsf@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN>
 <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN>
 <29679184-7366-0167-9e94-def97048f663@HIDDEN> <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> <83h6u585si.fsf@HIDDEN>
 <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
 <83jzyz7qmy.fsf@HIDDEN> <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN> <e246266e9f546282d2b8@HIDDEN>
 <83edp642h8.fsf@HIDDEN> <e246266e9f80fbc0271b@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 30 Mar 2023 17:27:02 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, 
>     dgutov@HIDDEN
> 
> > The parsers _can_ have access to those ranges, if they need it for some 
> > reason.  In general, everything in Emacs should honor the current 
> > restriction, unless there's a good reason to ignore it.
> 
> Okay, so in the above example by default the parsers will only have access 
> to 1000-1100 for the first one, and 1100-1200 for the second one until the 
> user removes the restrictions.  Unless they need to widen the buffer for 
> some (good) reason.
> 
> If they do widen, will the parsers get access to [400..1100] and 
> [1100..1500], or to the whole buffer?

The former.

> > The problem with ignoring it is that we can never know which code/user 
> > defined the restriction and for what purpose.  I hope that keeping the 
> > parser's restrictions as part of the parser itself will allow us to 
> > break free of that issue when we have to widen.
> 
> At least it's a possibility that seems worth investigating.

I think so, yes.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 20:15:02 +0000
Resent-Message-ID: <handler.62333.B62333.168020730015693 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168020730015693
          (code B ref 62333); Thu, 30 Mar 2023 20:15:02 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 20:15:00 +0000
Received: from localhost ([127.0.0.1]:59507 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1phyfj-000453-VU
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 16:15:00 -0400
Received: from heytings.org ([95.142.160.155]:60810)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1phyfi-00044w-HX
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 16:14:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1680207298;
 bh=0DC7VT7uzGKeo4MhNO1ZnMf4U0BtUzN0p69Bw6bgazo=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=cu7ZfB/IVOMfd//3WO4kxA/3GBAsndtFNr5Jax19OuKF6r/RIfM86wE3EWoh9OBVl
 nYjuok2cLOQBwo0SO2QOCCf670edWsdPPRxBQpA+VK6vgbkbu2JHQQWMdnSUchRmf2
 CVwSQZ120kHOOz2X9FbSC04vJdTzeY6Mk8PAN59W0LqRSLrh35lorGrmTrnUAxu8ky
 5uGX7WF7sWasdFnoNv+uRzNNuPzWgSkXGEiVxTCZy3jVN6aPqYIywflYLbmJZPYIfd
 lFrltM3ksD0ecRyZ5dHysIypOSrYFxrVpFsxwmt132p0tcOzWRBlE3XVDh8Qx/YAhT
 3GyP/Z0jDNpEQ==
Date: Thu, 30 Mar 2023 20:14:57 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <83bkka3zd9.fsf@HIDDEN>
Message-ID: <e246266e9f9708470bd5@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> <83h6u585si.fsf@HIDDEN>
 <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN> <83jzyz7qmy.fsf@HIDDEN>
 <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN> <e246266e9f546282d2b8@HIDDEN>
 <83edp642h8.fsf@HIDDEN> <e246266e9f80fbc0271b@HIDDEN>
 <83bkka3zd9.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>>> The parsers _can_ have access to those ranges, if they need it for 
>>> some reason.  In general, everything in Emacs should honor the current 
>>> restriction, unless there's a good reason to ignore it.
>>
>> Okay, so in the above example by default the parsers will only have 
>> access to 1000-1100 for the first one, and 1100-1200 for the second one 
>> until the user removes the restrictions.  Unless they need to widen the 
>> buffer for some (good) reason.
>>
>> If they do widen, will the parsers get access to [400..1100] and 
>> [1100..1500], or to the whole buffer?
>
> The former.
>

Okay, thanks.  Now I think I understand what you want.  I'll think about 
it.





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Gregory Heytings <gregory@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 30 Mar 2023 22:09:01 +0000
Resent-Message-ID: <handler.62333.B62333.16802140965259 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16802140965259
          (code B ref 62333); Thu, 30 Mar 2023 22:09:01 +0000
Received: (at 62333) by debbugs.gnu.org; 30 Mar 2023 22:08:16 +0000
Received: from localhost ([127.0.0.1]:59669 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi0RL-0001Ml-IA
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 18:08:15 -0400
Received: from heytings.org ([95.142.160.155]:60918)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <gregory@HIDDEN>) id 1pi0RJ-0001Mb-Ej
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 18:08:14 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org;
 s=20220101; t=1680214091;
 bh=2iCdGPiySgmHZCNgp2g01YjbVRrtkYuxnkfWV7rHaeA=;
 h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From;
 b=cA3DH/TL5tfwRi5hTTbOEV/zBFXbbwi9BgaTig0xExmFs06gSW/yXvU5AepuWs6Op
 CDVTCJodHW9VdAoskUaWIOiU3FPLS5O5F2QqCFb5KD1l24uW/t48L6qlyq6Gw2F7/o
 8bBhu/GTpIhVPAfu17zsvvy9Kp6jw/lONBcogWHoRQA7Hqo4xOTfCLyXZ1pkI2ROn4
 XNXLATUZC8UNj16i39m7CswJaawPTvQ1w33WG6WDohzamjm3qtM3uJC9YFWOKYkhIU
 Nz65Uzyw5MHzW7tB1xW8QBlUYP4q5udskoTV8QCS9K+sfvnqFweJiL/RBei+0Oiu1n
 qqW2vzZdgvkQA==
Date: Thu, 30 Mar 2023 22:08:10 +0000
From: Gregory Heytings <gregory@HIDDEN>
In-Reply-To: <e246266e9f9708470bd5@HIDDEN>
Message-ID: <e246266e9faba8b9e62c@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> <83h6u585si.fsf@HIDDEN>
 <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN> <83jzyz7qmy.fsf@HIDDEN>
 <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN> <e246266e9f546282d2b8@HIDDEN>
 <83edp642h8.fsf@HIDDEN> <e246266e9f80fbc0271b@HIDDEN>
 <83bkka3zd9.fsf@HIDDEN> <e246266e9f9708470bd5@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=us-ascii
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


>>>> The parsers _can_ have access to those ranges, if they need it for 
>>>> some reason.  In general, everything in Emacs should honor the 
>>>> current restriction, unless there's a good reason to ignore it.
>>> 
>>> Okay, so in the above example by default the parsers will only have 
>>> access to 1000-1100 for the first one, and 1100-1200 for the second 
>>> one until the user removes the restrictions.  Unless they need to 
>>> widen the buffer for some (good) reason.
>>> 
>>> If they do widen, will the parsers get access to [400..1100] and 
>>> [1100..1500], or to the whole buffer?
>> 
>> The former.
>
> Okay, thanks.  Now I think I understand what you want.  I'll think about 
> it.
>

Two other questions:

Should there exist a mechanism to give the parsers access to the whole 
buffer (IOW, to let them ignore both the bounds passed to 
'treesit-make-parser' and the restriction set by the user)?

And of course, the bounds given to 'treesit-make-parser' should become 
markers, right, that is, their position should change whenever the buffer 
contents change, right?





Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 01:12:01 +0000
Resent-Message-ID: <handler.62333.B62333.168022506510576 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168022506510576
          (code B ref 62333); Fri, 31 Mar 2023 01:12:01 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 01:11:05 +0000
Received: from localhost ([127.0.0.1]:59881 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi3IG-0002kV-WD
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:11:05 -0400
Received: from mail-wm1-f52.google.com ([209.85.128.52]:44961)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pi3IE-0002k0-FF
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:11:03 -0400
Received: by mail-wm1-f52.google.com with SMTP id
 u11-20020a05600c19cb00b003edcc414997so12922715wmq.3
 for <62333 <at> debbugs.gnu.org>; Thu, 30 Mar 2023 18:11:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680225056;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=ZRGq1nSSOs7fseaz0nXB+F8SI7Kmf8e6OTnzxJwO7pU=;
 b=aJROPCQTd7Btn6hadlLbtnY4F7H8ISVw7xXkDhmiAnUI/DePIcs9REiB7ii1Z88TK5
 UOJo9N3gdVVtEwICmrKpGwq+eiqA66N1kTmpkxLfg8WB9qjtaNzPKsJvzfYcW+vd9Qco
 xYkRl8xi5OiceWOJwUtY/x5cXiPqYyUtMS8NiRNLREZho0VwnzVw6mXcHS1N0SSFCeKB
 DF/372tb2K3sjLjsZZDmvvtK9xJ7wh+T0Gf7UVmiQhd+h2GGBXdB7w9WErRsDfE3tUy9
 UBYPEZ7IYOroyFcn/mnoJIcZODDFZsKYT9PN1vVOHb/J1DRYiUKlih02y/cNf1qfn8Th
 xCQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680225056;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=ZRGq1nSSOs7fseaz0nXB+F8SI7Kmf8e6OTnzxJwO7pU=;
 b=X1bxz/NvrkD637dAwD6TdfeymAF+BAoRYuK1ttWGGRrm3bEbFcSKIyVVWv50jCiiyX
 HTQlUwfeDlty51x6uLRDiupQHUrkhyIKdXNO8KCk7r9JcxJD775zjr8lidDHeODGzLzk
 bQs/R6mceHoPsXCve3h57HClxELvWq9dvoA+tYMH9c5U2tt+5aot9HaIr3jQ+nWg4rb1
 frbyO7nHabIaWE2vJmjdgVyqef0AcdMWWBGmJWPZFJ+/Klp4agiiJOJFRagqWeiuy7P1
 twgOQ0Jjjxx4pP59ioT+G6F1CC3+EhByuiCIM70W4qOf5LAtB/GYO5f8R1YP75N8p00O
 4LXQ==
X-Gm-Message-State: AO0yUKWwqVzYrBjLn8tnUwRkGi2aD2l7LQVWKY8L6bqHuWsUH/wlFnJk
 wOixXmUze059TQcIWgUnO2I=
X-Google-Smtp-Source: AK7set8Q+2et/XHI9+jDudyLrMHk1iCy4YPCi71qOJknhzLgcKbXLaHRrmPwHx8DS6m0Mv+r3VdtKA==
X-Received: by 2002:a05:600c:d5:b0:3ed:2eb5:c2dd with SMTP id
 u21-20020a05600c00d500b003ed2eb5c2ddmr18698332wmm.39.1680225056578; 
 Thu, 30 Mar 2023 18:10:56 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 q3-20020a05600c46c300b003ebf73acf9asm14844859wmo.3.2023.03.30.18.10.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Mar 2023 18:10:56 -0700 (PDT)
Message-ID: <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN>
Date: Fri, 31 Mar 2023 04:10:54 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83lejf7r2o.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 29/03/2023 14:08, Eli Zaretskii wrote:
>> Date: Wed, 29 Mar 2023 00:08:53 +0300
>> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
>>   62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>>>> Is that because we don't think the user level narrowing is done purely
>>>> for visual effect?
>>>
>>> Indeed, it isn't always for visual effect.
>>
>> When isn't it? Is there a way to determine that from code?
> 
> I'm not sure I understand the question, but if I do, then narrowing to
> prevent search functions

If we're talking about isearch, then that seems like a natural 
consequence of visual effect (hiding the remainder of the buffer): even 
if isearch highlighted those other hits, they would not be visible.

> and commands from finding irrelevant hits is
> one example that comes to mind.

More or less the same, except we have the user option 
widen-automatically, which apparently (?) allows any command to "widen 
when they want to"?

Used by popular demand in e.g. xref--goto-char. And IIUC 'find-tag' just 
always calls 'widen' irrespective of this variable's value.

>>>> judging by regular user requests for make this or that command
>>>> ignore user-level narrowing, it seems like "purely visual" should be the
>>>> default interpretation.
>>>
>>> I think you base your judgment on feedback from users who are not used
>>> to take advantage of narrowing in editing.  I think most young people
>>> aren't, since this feature is more-or-less unique to Emacs.
>>
>> Either narrowing should be used to change lexical/grammatical/etc
>> context, or it should not. Do we have any documentation that says one or
>> the other way? That should affect how Lisp code deals with narrowing --
>> which interactive functions should widen, and so on.
> 
> I was talking about user commands that narrow, so I'm not sure I
> understand how documentation could help.  When the user types "C-x n n",
> there's nothing Emacs can do except obey.

There is really only one main user command that narrows, and that's 
narrow-to-region, bound to 'C-x n n'.

But none of that describes how other Emacs features should react to it.

Simple example: if the beginning of the narrowed region falls inside a 
(let's say multine) string, should the visible remainder of that string 
continue to be highlighted as a string? Or should the buffer contents 
after the string's closer now be highlighted as being inside a string?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 01:18:01 +0000
Resent-Message-ID: <handler.62333.B62333.168022544911152 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168022544911152
          (code B ref 62333); Fri, 31 Mar 2023 01:18:01 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 01:17:29 +0000
Received: from localhost ([127.0.0.1]:59885 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi3OS-0002to-VE
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:17:29 -0400
Received: from mail-wm1-f49.google.com ([209.85.128.49]:41607)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pi3OR-0002tb-57
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:17:27 -0400
Received: by mail-wm1-f49.google.com with SMTP id
 r19-20020a05600c459300b003eb3e2a5e7bso12935579wmo.0
 for <62333 <at> debbugs.gnu.org>; Thu, 30 Mar 2023 18:17:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680225441;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=AC3QnWyfoZENdSas2MGnguqmA8wWeXpW4vN+dDBP+t8=;
 b=SX8oTjZM9Em/dO//5N7ThsxesuI61pWqAYfYmnZZ/yG1Dj2arLVu9rOp686oZo1s04
 9SW2G5QxUBOFEgpzBABilwudG2dcBs7dF77UCNRL9PeZMBhLyRiDpqWhQddoYZ303P9O
 /o+ZoePFznXT/8WV7FmreEkLZ1RxdGj7I2CeBr8WH+JSGRoWlNTJXAdnRO4Mi8+R2H6b
 XTA+c2ZHnSUEObo2IBy1m9miw2xybuXZd8FsQCEc/ZfoTIkT9Z16vOtxlr/fYUmBuF5Y
 ema4rvaxHjP+73nUboc3D+s9GF76XEOkeFH+NzYBR+xf/dM7aNxsj4d5b6niJMKaTRxG
 saMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680225441;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=AC3QnWyfoZENdSas2MGnguqmA8wWeXpW4vN+dDBP+t8=;
 b=MUiUgUrSdS1z5lPK86zj4PAmcbm36qDtyDA9CU+TC3q23aoleGis7bnnT37dKF3Zc2
 Da6Kqr77ZOusUmj97RHjEMVxB1E4hX2msa6ea6awjzrsglVFgslxvn57z+oBLkwbhZ1Z
 4UXMUOPup8shkZ2Bk9aCrU5Ur/mveLXjD/ezKQc+Oz3i/eygY9pr14KjwsBGL0JDMZq1
 NP8Zcn2oEGcg6Hj33bYe8VWiXyM9h0I4UT9uyQppADzWfAFe6c6WQBt+gSn+wsDxKLpn
 yu8rpIsX+d2AIH11xSHvbDgYkKaNNIDRk6TszSjQGV2vbjeoOTlMEIdGGeFAt5D4el9Q
 9x5g==
X-Gm-Message-State: AAQBX9dSKG5esCyf7ff4ZuLQdugFs079Pz6NnyMDGXmnM5IJdhLQoKws
 BEKp0T3nnz9I5D9FoinZ8b0=
X-Google-Smtp-Source: AKy350a1vrQMmgK9x3QSaWQjUG7w/sQWhAweEy5+6XN8ewCHlmVdOyPH4pWGpw1Zia/IhmZFPuFyEg==
X-Received: by 2002:a7b:ce84:0:b0:3ef:6fee:803a with SMTP id
 q4-20020a7bce84000000b003ef6fee803amr11045990wmj.35.1680225441326; 
 Thu, 30 Mar 2023 18:17:21 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 l5-20020a5d5265000000b002e55cc69169sm745544wrc.38.2023.03.30.18.17.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Mar 2023 18:17:20 -0700 (PDT)
Message-ID: <7228ade1-7686-a94a-0744-d77b7f09eb55@HIDDEN>
Date: Fri, 31 Mar 2023 04:17:19 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <8FC25A01-6934-43BB-899C-CA5926BEA3CF@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN> <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
 <83h6u585si.fsf@HIDDEN> <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
 <83jzyz7qmy.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83jzyz7qmy.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 29/03/2023 14:17, Eli Zaretskii wrote:
>> Date: Wed, 29 Mar 2023 00:19:41 +0300
>> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>>>> Like narrowing, but just for parsers? But parsers obey narrowing
>>>> already. Sounds a bit like conceptual duplication. How does this solve
>>>> blink-matching-paren issue anyway?
>>>
>>> We could widen without fearing that a parser will "invade" regions of
>>> buffer text that we don't want it to wander into.
>>
>> So any code that wants to restrict a "parser" based buffer, would need
>> to use a different primitive to narrow?
> 
> No, the idea is to create the parser with these restrictions to begin
> with.
> 
>> And vice versa, any code that uses a parser, will need to (widen)
>> first, to ensure that the parser is not affected by any restriction
>> set up by any code previously?
> 
> No, if the parser is restricted, there should be no need to "widen"
> it, at least not in most cases I could think about where a parser
> should be restricted to a part of the buffer.
> 
>> Anyway, I don't see why we should institute a special category for these
>> buffers.
> 
> Because IMO it's cleaner and simpler than using narrowing, and doesn't
> suffer from the problems we see in narrowing.

You are not describing anything that one couldn't do with a major mode 
before tree-sitter parsers (choose a region, apply font-lock keywords, 
etc), so that should give you an idea that the suggestion is probably 
not novel. And doesn't solve the existing problems in new ways.

Why would we apply that approach to "proper" parsers only?

>>>>>> The "grand unified theory of mixed major modes" has been attempted a few
>>>>>> times in the past, and never reached anything practical.
>>>>>
>>>>> But here we have a unique opportunity to maybe find a solution, at
>>>>> least for stuff based on tree-sitter and similar libraries.  That
>>>>> maybe not "grand", but certainly "respectable".
>>>>
>>>> tree-sitter has its own support for mixed languages.
>>>
>>> So your argument about mmm framework was a red herring, cause that
>>> problem doesn't exist wrt tree-sitter parsers?
>>
>> Nope, see the first paragraph of my previous reply (the "no relevance" one).
> 
> Which first paragraph is that?  In what "previous reply" should I look
> and where?  (And why couldn't you simply copy that here, to make
> following the discussion easier?)

The reply you answered with "I don't see the relevance". There is really 
no good way to continue the explanation after that. Copying it into 
multiple successive emails doesn't sound logical either.

>>>>>> My stance here is we shouldn't break it before we create a new one.
>>>>>
>>>>> No one broke anything.  We are just discussing ideas.  Please don't
>>>>> exaggerate.
>>>>
>>>> I never said anybody has broken anything already.
>>>
>>> You did say that my ideas break something, see above.  Ideas cannot
>>> break any code, so this argument shouldn't be brought up if you want a
>>> calm and rational discussion.
>>
>> Ideas cannot, but implementing them can. "This or that change will break
>> an existing convention" is a rational argument.
>>
>> Shall we stop quibbling over words?
> 
> I'm "quibbling" over words because your particular selection of words
> makes serious discussion nigh impossible.  Not the first time, either.
> As soon as there's some disagreement, sooner or later those words
> (like "quibbling") come out.  Whether it's because of some attitude or
> not, I don't know, but you may wish to reflect on that and perhaps try
> to express your disagreements using different words.

"Breaking a convention" is an industry term.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 01:26:01 +0000
Resent-Message-ID: <handler.62333.B62333.168022595211918 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>, Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168022595211918
          (code B ref 62333); Fri, 31 Mar 2023 01:26:01 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 01:25:52 +0000
Received: from localhost ([127.0.0.1]:59899 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi3WZ-00036A-LP
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:25:52 -0400
Received: from mail-wr1-f52.google.com ([209.85.221.52]:44582)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pi3WW-00035t-Sv
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:25:49 -0400
Received: by mail-wr1-f52.google.com with SMTP id d17so20867336wrb.11
 for <62333 <at> debbugs.gnu.org>; Thu, 30 Mar 2023 18:25:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680225943;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=3RMbmvruHaznWI0NNgeR9cUeSCJNSXeBJO9u95tDNHY=;
 b=eRbccqZjTXqzO8wrvw7uYMcR6jV1/LtXgd6AVj6jMR+hr35i53yqQuuFW3tVVNBv6b
 e9Cef1pyCz8e7exqhRZ1jDhnHcyzJ/rvcp5cLSYeqd9F1OzrsAJlaexghMx++0tmUBkE
 2Kh6/CzK3/uZ8meMJfveN+68iRIrZ1tBqNYDfA2AXE0klYxG/on/gcL5wTHBG7TteAL9
 3ue4pxYEv0vImdQQzh38bRmdQtoxCuV68xM6qo7lyUxqX3ssxdBJvPRoW+b0SPiuywSX
 kgnIQ9JiGZi0Z7bkVXlrjgjnEnXa8DipROdC7nTt7zJs/T6ZzGoV9hRmTzfmFkOsvGSA
 DkPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680225943;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=3RMbmvruHaznWI0NNgeR9cUeSCJNSXeBJO9u95tDNHY=;
 b=418yIFMmXW9YPlVw4kM6Bt4tvpfRGwGcFYtfonNBRC02wm9SKJzJK8lrp/qeNscmNy
 wrSjJjyPR+5w5gGCl/bWU6LPDviTaIoE76ds54Q+pI+/HL2q/3o6vmPjf0xixYr9si47
 jBrHryUHKTEBVZtavYtkqNBujJd39f0GqO/oiP8bYphpuELXHe5ncxAn+xtcow2jh3TU
 7WsNwlElY1oHH1eCALdAfGlNQeTz5Wrn02qswGqj86Q2Hg+WDliXBWV2/XLdA3WqsZhS
 lMyM+u0ABvKEbVELVYxwB8pTBa1QLKfRH1FnKSMG5auLyPrdva1wDrLsyQSN/Dd+hL2u
 lW1w==
X-Gm-Message-State: AAQBX9e8j9DUhUjcVaTgfCtMZQk8FWAvCym6WdXG6/eOdBtps3w9MiyM
 CBTnNA7meGComyRgBzArBBo=
X-Google-Smtp-Source: AKy350b7LX/vgAK1maElZadfHoPgAFN5kEsZbPrP6EjfCovxCiWAbmIOKK1r0w9DNpsWfQ0uumEfmg==
X-Received: by 2002:a5d:62c6:0:b0:2e4:d939:11b9 with SMTP id
 o6-20020a5d62c6000000b002e4d93911b9mr2832926wrv.48.1680225943147; 
 Thu, 30 Mar 2023 18:25:43 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 e38-20020a5d5966000000b002d78a96cf5fsm744298wri.70.2023.03.30.18.25.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Mar 2023 18:25:42 -0700 (PDT)
Message-ID: <a79be0d2-1470-e7c1-165e-9be32a98e5f1@HIDDEN>
Date: Fri, 31 Mar 2023 04:25:41 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN> <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
 <83h6u585si.fsf@HIDDEN> <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
 <83jzyz7qmy.fsf@HIDDEN> <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83h6u2444x.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 30/03/2023 19:04, Eli Zaretskii wrote:
>> Date: Thu, 30 Mar 2023 15:50:31 +0000
>> From: Gregory Heytings <gregory@HIDDEN>
>> cc: Dmitry Gutov <dgutov@HIDDEN>, wkirschbaum@HIDDEN, casouri@HIDDEN,
>>      62333 <at> debbugs.gnu.org
>>
>>> No, the idea is to create the parser with these restrictions to begin
>>> with.
>>
>> Could you perhaps explain, with some fictitious code, what kind of
>> solution you imagine?  I'm not sure I understand (euphemism for: I'm sure
>> I don't understand) the problem statement.
> 
> Something like
> 
>    (treesit-make-parser LANGUAGE BUFFER nil START END)

What kind of code would be calling this?

What happens when the user types a character before START? What happens 
when they delete a character at START or END? Or a whole line?

> and
> 
>    (treesit-parser-set-included-ranges RANGES...)
> 
> (the latter already exists).

Indeed, a way to do this using tree-sitter indeed already exists, 
offloading the parsing of the regions to tree-sitter. OTOH, this way we 
only get tree-sitter features sorted into regions (parse tree, 
indentation, highlighting).

Whatever other Lisp-level features we wanted to behave differently 
between regions, we'd have do implement them the old way.

>> In what way would the restrictions you have in mind be different from
>> those of a regular narrowing?
> 
> User-defined narrowing will never contradict parser restrictions.

IOW, user-defined narrowing should be only for visual purposes, as 
described in another email. And perhaps to restrict movement (which is 
related: you can't move to where you can't see).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 01:28:02 +0000
Resent-Message-ID: <handler.62333.B62333.168022607912105 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168022607912105
          (code B ref 62333); Fri, 31 Mar 2023 01:28:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 01:27:59 +0000
Received: from localhost ([127.0.0.1]:59903 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi3Yd-00039B-9l
	for submit <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:27:59 -0400
Received: from mail-wr1-f47.google.com ([209.85.221.47]:33446)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1pi3Yb-00038z-O5
 for 62333 <at> debbugs.gnu.org; Thu, 30 Mar 2023 21:27:58 -0400
Received: by mail-wr1-f47.google.com with SMTP id j24so20930934wrd.0
 for <62333 <at> debbugs.gnu.org>; Thu, 30 Mar 2023 18:27:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680226072;
 h=content-transfer-encoding:in-reply-to:references:cc:to:from
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=va6stC6ao49y8esAAfX9aBwmO+MHGBlh9J+MiDuby/s=;
 b=pj9dAY8UY4NPiayXM/1ymrseAUk9Y0N6cNvqqdqVmK75hR0oFZXFk8oSswV32ipsij
 AOBSazCWVDQYhZt/5CGSdHdMVgFtSXoi0DmPdEEPAKftjDZd5cAyLTuV4J7c3M0ItnV5
 d9X944L93OwvFJrZhPE0wRSbLdt1kHzRl+lJh3Sy/QIBjcgw8zGzj5LPHv6gwRSUOj3+
 nnIf+y27gtFBLSNKsdqgdxAc7z/dj09FQ8y04e4ruT8OUAXkE0HneBOCtlOo1O/Ze5ro
 YOPaufWR7cSRKaRAR3vzZZWrBY84h10ZKQHuu0ttV6hCPOHaYh++ljM1oKo07MkGreqR
 COAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680226072;
 h=content-transfer-encoding:in-reply-to:references:cc:to:from
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=va6stC6ao49y8esAAfX9aBwmO+MHGBlh9J+MiDuby/s=;
 b=R1/86lO83Wfc0tO0bp+qTtuSy9gLqr108hztSFPHKrFSwjNVLr4xUgH7vm1e0kuaUL
 RRz40kUiQ4FnpfFyt/RJUDHw8EqWO9f/WD3vzxet8fS/MaZqbaO4sfLIU/d2EA1rfEK6
 JOSZntzvo0LvewCKekTrN46NDL5ituZBQmXLzu+2Yu66m3owDmvzJvo+3yG8LYwa/6K8
 MsZstYaxzbT18oTuGAmadxkEnsVrMFwHEiHlLcJ9sWaUNO2uGEJG8skLuMIJ2g/ZuWPR
 PBk4SOMiSdKl0c7byQlj81T65HdUeH7hIBU16DUfdUrhcr0G4ZXrfyiOBiOWCIh0VmCF
 AIGg==
X-Gm-Message-State: AAQBX9d9uoqaO5yy/LT5bXxwVw6MEnZq54B+gAoYR7JWbRXeUPYxGx/i
 lXvqeLDnCzqtqySVU1CRzlc+/ev8uGZ+1g==
X-Google-Smtp-Source: AKy350a7Y73vy3YGVZtNTNxgDOhxBmaIDdaNknLDvpswILTNnXQSxOZaSPm5x0GftVm+mW44rNVh6Q==
X-Received: by 2002:a5d:63cc:0:b0:2d1:14fa:8048 with SMTP id
 c12-20020a5d63cc000000b002d114fa8048mr17888629wrw.39.1680226071916; 
 Thu, 30 Mar 2023 18:27:51 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 y13-20020adfdf0d000000b002d1801018e2sm739836wrl.63.2023.03.30.18.27.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 30 Mar 2023 18:27:51 -0700 (PDT)
Message-ID: <78fc3aee-6978-b842-9c47-0eb080ce1e2d@HIDDEN>
Date: Fri, 31 Mar 2023 04:27:50 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
From: Dmitry Gutov <dgutov@HIDDEN>
References: <87fs9yur7r.fsf@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN>
In-Reply-To: <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

Sorry

On 31/03/2023 04:10, Dmitry Gutov wrote:
> Simple example: if the beginning of the narrowed region falls inside a 
> (let's say multine)
              ^
               multiline




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 06:16:02 +0000
Resent-Message-ID: <handler.62333.B62333.16802433108672 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Gregory Heytings <gregory@HIDDEN>
Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, dgutov@HIDDEN
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16802433108672
          (code B ref 62333); Fri, 31 Mar 2023 06:16:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 06:15:10 +0000
Received: from localhost ([127.0.0.1]:60168 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi82X-0002Fm-RY
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 02:15:10 -0400
Received: from eggs.gnu.org ([209.51.188.92]:43042)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pi82W-0002FV-AX
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 02:15:08 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi82Q-0000E0-KC; Fri, 31 Mar 2023 02:15:02 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=dHiGf0C48SDo0KefXWikfoGeWGxIleqJB5n+QxAKqLY=; b=Joh9WeUL7VKj
 HUwsKGqekwdY/K7LAOyvi1GUTHqzFO95PYUaRiC1PmvmsrC/Pk44GZTGYEBVgbvoz6+GxOAFArkZ+
 LfwRlMr90lB6C6zfpg5rv8OLeuf7iBom4e9MFSyB2Gg2dXTI7/soeQVVOnea/djmPqY6Y2tjq2SQQ
 derLGi9jFGEFUnQt25myzGi/ArXnIiv3czPB8g1FEUWKccexdid9u0Y2lW5+Y1+R3vbEaEfR22ZzZ
 HD9zyuuWyTAQBhX2VsEULw5/5HxyO1r0ozzMuTTwhhqjlRcVN1dDPOyB2j+IwWY4IH6S7lzysXEK1
 FI6QFJyUTUS70YjjgnWn8A==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi82P-0005Nc-Vw; Fri, 31 Mar 2023 02:15:02 -0400
Date: Fri, 31 Mar 2023 09:15:15 +0300
Message-Id: <83y1nd30r0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <e246266e9faba8b9e62c@HIDDEN> (message from Gregory
 Heytings on Thu, 30 Mar 2023 22:08:10 +0000)
References: <87fs9yur7r.fsf@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN>
 <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN> <83fs9q9vak.fsf@HIDDEN>
 <10aa98b6-908b-c467-7c77-767906692088@HIDDEN> <83h6u585si.fsf@HIDDEN>
 <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN> <83jzyz7qmy.fsf@HIDDEN>
 <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN> <e246266e9f546282d2b8@HIDDEN>
 <83edp642h8.fsf@HIDDEN> <e246266e9f80fbc0271b@HIDDEN>
 <83bkka3zd9.fsf@HIDDEN> <e246266e9f9708470bd5@HIDDEN>
 <e246266e9faba8b9e62c@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Thu, 30 Mar 2023 22:08:10 +0000
> From: Gregory Heytings <gregory@HIDDEN>
> cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org, 
>     dgutov@HIDDEN
> 
> Should there exist a mechanism to give the parsers access to the whole 
> buffer (IOW, to let them ignore both the bounds passed to 
> 'treesit-make-parser' and the restriction set by the user)?

We already have that, I think: treesit-parser-set-included-ranges.
Although I wonder when and why would this be a good idea, given that a
parser should have full access to the entire text that is written in
the corresponding language.

> And of course, the bounds given to 'treesit-make-parser' should become 
> markers

Of course.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 06:20:02 +0000
Resent-Message-ID: <handler.62333.B62333.16802435719114 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16802435719114
          (code B ref 62333); Fri, 31 Mar 2023 06:20:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 06:19:31 +0000
Received: from localhost ([127.0.0.1]:60173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi86k-0002Mw-LF
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 02:19:31 -0400
Received: from eggs.gnu.org ([209.51.188.92]:48058)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pi86i-0002Mf-GE
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 02:19:28 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi86d-0001Al-5o; Fri, 31 Mar 2023 02:19:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=1bvwOnAbdfNMsKx6uyVL6aW6jg8zTyQXpDlYiJbNM/Q=; b=Pc1B8lV7WdWV
 p1WDsl+9YYZt1/SlyCBXpWWlSf2ryI4wxhVd8Uce8vtIRlf3iYTL+LU0k02JnP+nR1L9ELw26de+I
 pamUVxyDDyU9BTV1NQKsIrgUENXlhwbELpoxge7whe54fXUJ9FgUgc4uqn+p9hMv/b5iicfwoWg2B
 fkxm26uTrvKejIha0snO5LgmgHRMnFYcO0ANUzlzy/qQP4ojX7qSE5GRTTwi4hzaarJ7olm46bp4K
 fsZkueFhdmniWtQkN9Hf4I3pUMoqSlSoN9XaMxc8jiTM4jqgmGCnBwmHbx9VyIgX6sjUo36Apor6n
 O3xK8vJt3nyE86mUcXxnlA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi86c-0005mz-8n; Fri, 31 Mar 2023 02:19:22 -0400
Date: Fri, 31 Mar 2023 09:19:35 +0300
Message-Id: <83wn2x30js.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN> (message from
 Dmitry Gutov on Fri, 31 Mar 2023 04:10:54 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 31 Mar 2023 04:10:54 +0300
> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
>  62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 29/03/2023 14:08, Eli Zaretskii wrote:
> >> Date: Wed, 29 Mar 2023 00:08:53 +0300
> >> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
> >>   62333 <at> debbugs.gnu.org
> >> From: Dmitry Gutov <dgutov@HIDDEN>
> >>
> >>>> Is that because we don't think the user level narrowing is done purely
> >>>> for visual effect?
> >>>
> >>> Indeed, it isn't always for visual effect.
> >>
> >> When isn't it? Is there a way to determine that from code?
> > 
> > I'm not sure I understand the question, but if I do, then narrowing to
> > prevent search functions
> 
> If we're talking about isearch, then that seems like a natural 
> consequence of visual effect (hiding the remainder of the buffer): even 
> if isearch highlighted those other hits, they would not be visible.

If you consider narrowing in this example to be "for visual effect",
then everything in Emacs is "for visual effect".  After all, Emacs is
a visual editor, showing the results of editing to the user at all
times.  But this POV makes this part of the discussion useless.

> > I was talking about user commands that narrow, so I'm not sure I
> > understand how documentation could help.  When the user types "C-x n n",
> > there's nothing Emacs can do except obey.
> 
> There is really only one main user command that narrows, and that's 
> narrow-to-region, bound to 'C-x n n'.

Any user command can narrow as part of its job.

> Simple example: if the beginning of the narrowed region falls inside a 
> (let's say multine) string, should the visible remainder of that string 
> continue to be highlighted as a string?

No.

> Or should the buffer contents after the string's closer now be
> highlighted as being inside a string?

Yes.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 06:23:02 +0000
Resent-Message-ID: <handler.62333.B62333.16802437729498 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16802437729498
          (code B ref 62333); Fri, 31 Mar 2023 06:23:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 06:22:52 +0000
Received: from localhost ([127.0.0.1]:60182 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi89z-0002T7-SF
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 02:22:52 -0400
Received: from eggs.gnu.org ([209.51.188.92]:46498)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pi89x-0002Su-NU
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 02:22:50 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi89s-00027b-1E; Fri, 31 Mar 2023 02:22:44 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=zFNDrxnzxdQ+NrSMrgcfU5Evq88PHIfZ1mhv4Qnmdw8=; b=MteC0x5B4+Et
 qm7Cx3//j3fPU4o+3HlQY8LiZA6UuPzw5vJthG5RXI5tPSot/z2M7vuHcJ+y7VoU8Bi02Ah9cj0UB
 X5KnKCExKf5XQ7c3NuU52CR8aGg5WrVsDjfCB5lkArRB0DSoHFh2xHU2npzireLg9nPxGPs+yzTT4
 6jDoPir2aE/be2DSWcN+Dau3C7ztCNeoT858neP9Cb58TtL/NGB4ljanyb7g07y20N7GyAWGxPX8l
 omOS2pOF6QxULgyRdhl/zj3E8EGY+vk13X4bBXPXCJHCMpO2iPLMWOoTwX+G2bf7PypJVLEWJN0mV
 HjjWigo0auOYilEx1rpWAA==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi89r-00066h-Ey; Fri, 31 Mar 2023 02:22:43 -0400
Date: Fri, 31 Mar 2023 09:22:55 +0300
Message-Id: <83v8ih30e8.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <a79be0d2-1470-e7c1-165e-9be32a98e5f1@HIDDEN> (message from
 Dmitry Gutov on Fri, 31 Mar 2023 04:25:41 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <83fs9q9vak.fsf@HIDDEN> <10aa98b6-908b-c467-7c77-767906692088@HIDDEN>
 <83h6u585si.fsf@HIDDEN> <5c683b3b-48e8-5099-8ab1-459c348d1f88@HIDDEN>
 <83jzyz7qmy.fsf@HIDDEN> <e246266e9fed35c79c15@HIDDEN>
 <83h6u2444x.fsf@HIDDEN> <a79be0d2-1470-e7c1-165e-9be32a98e5f1@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 31 Mar 2023 04:25:41 +0300
> Cc: wkirschbaum@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 30/03/2023 19:04, Eli Zaretskii wrote:
> >> Date: Thu, 30 Mar 2023 15:50:31 +0000
> >> From: Gregory Heytings <gregory@HIDDEN>
> >> cc: Dmitry Gutov <dgutov@HIDDEN>, wkirschbaum@HIDDEN, casouri@HIDDEN,
> >>      62333 <at> debbugs.gnu.org
> >>
> >>> No, the idea is to create the parser with these restrictions to begin
> >>> with.
> >>
> >> Could you perhaps explain, with some fictitious code, what kind of
> >> solution you imagine?  I'm not sure I understand (euphemism for: I'm sure
> >> I don't understand) the problem statement.
> > 
> > Something like
> > 
> >    (treesit-make-parser LANGUAGE BUFFER nil START END)
> 
> What kind of code would be calling this?
> 
> What happens when the user types a character before START? What happens 
> when they delete a character at START or END? Or a whole line?
> 
> > and
> > 
> >    (treesit-parser-set-included-ranges RANGES...)
> > 
> > (the latter already exists).
> 
> Indeed, a way to do this using tree-sitter indeed already exists, 
> offloading the parsing of the regions to tree-sitter. OTOH, this way we 
> only get tree-sitter features sorted into regions (parse tree, 
> indentation, highlighting).
> 
> Whatever other Lisp-level features we wanted to behave differently 
> between regions, we'd have do implement them the old way.
> 
> >> In what way would the restrictions you have in mind be different from
> >> those of a regular narrowing?
> > 
> > User-defined narrowing will never contradict parser restrictions.
> 
> IOW, user-defined narrowing should be only for visual purposes, as 
> described in another email. And perhaps to restrict movement (which is 
> related: you can't move to where you can't see).

I'm sorry, I cannot afford a discussion where you decided up front you
disagree, and just keep looking for arguments in favor of your
disagreement.  Such discussions are a waste of our time, and I have
very little of it to waste.  So I won't be responding to any further
messages here, unless they ask informative questions where I think I
can contribute something useful.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 07:47:02 +0000
Resent-Message-ID: <handler.62333.B62333.168024878718648 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: dgutov@HIDDEN
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168024878718648
          (code B ref 62333); Fri, 31 Mar 2023 07:47:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 07:46:27 +0000
Received: from localhost ([127.0.0.1]:60290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1pi9St-0004qi-9n
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 03:46:27 -0400
Received: from eggs.gnu.org ([209.51.188.92]:52538)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1pi9Sq-0004qV-TL
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 03:46:25 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi9Sl-00089o-Fv; Fri, 31 Mar 2023 03:46:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=co8LWdT91j0mQWQj1slZmZ/dBt5V6cCTugA6Yy5SgLM=; b=IInxN19iw+Mf
 5iJl+5H2klEWYRGgw0syJTyaO50Vr3MGZCqNc9cxUJrVA+T+dmA40cTcupSVoUvPgok3EvnmvdQ9N
 WdbYNV1TQ/YI1witiQMQpEdhM7UPsPBewA6lxMpfqnl0XnvYO06UQXMJBcpTmTzP5dAivECT/lUWi
 wysLrDB3YHckyqAjafQebzxGYXOfU1epowI6chUyYuByTL4Ji5UigOqvLsuFciTsNudAZNY+JAkOg
 ZUr9DrjsF/1aIgn3VaVJMQIiiT2NfTH6zFVQC4p7K2Ab2741KXD1jZMguRCWkfeYrDKxo2342k+k3
 nZet9rw4hU87Idaz5mpz4w==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1pi9Si-0006GW-Oo; Fri, 31 Mar 2023 03:46:19 -0400
Date: Fri, 31 Mar 2023 10:46:29 +0300
Message-Id: <83jzyx2wiy.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <83wn2x30js.fsf@HIDDEN> (message from Eli Zaretskii on Fri, 31
 Mar 2023 09:19:35 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <a598732b-ef2c-d439-c8d9-c4c0f7d0bce3@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN> <83wn2x30js.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
>  62333 <at> debbugs.gnu.org
> Date: Fri, 31 Mar 2023 09:19:35 +0300
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > Simple example: if the beginning of the narrowed region falls inside a 
> > (let's say multine) string, should the visible remainder of that string 
> > continue to be highlighted as a string?
> 
> No.
> 
> > Or should the buffer contents after the string's closer now be
> > highlighted as being inside a string?
> 
> Yes.

To clarify: these my answers are in the context of the current
handling of narrowing, not in the context of restricting the parser
(which you seem to reject as a useful idea anyway).




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 12:39:02 +0000
Resent-Message-ID: <handler.62333.B62333.168026632331105 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168026632331105
          (code B ref 62333); Fri, 31 Mar 2023 12:39:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 12:38:43 +0000
Received: from localhost ([127.0.0.1]:60648 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1piE1j-00085b-7C
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 08:38:43 -0400
Received: from mail-wr1-f41.google.com ([209.85.221.41]:39784)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1piE1h-00085O-3C
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 08:38:41 -0400
Received: by mail-wr1-f41.google.com with SMTP id m2so22240505wrh.6
 for <62333 <at> debbugs.gnu.org>; Fri, 31 Mar 2023 05:38:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680266315;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=1kpKwiaiudFL5U4wXymkB+0AZoYJuXS6vdX4Kd03jvA=;
 b=TTw9RYKrkn6iVpS/V0yzwnVDoHXTakYBQIDloHYbCdCryc5D7QZ3r+DUMvo0Ye4jR1
 GzsFszjdEomkJD5wi6Jxl/Ibb8PRXXAOkFpnsHkJzSE+iU8/SrTkcDiMLEUq9QEH5I3z
 f2aiu4HZidrCDnKUVr80MVasabK4y6uaSTkmavT/WooO0ScfXTocpuC8SE69sS93L+hk
 2KBx6whlJvNtOzJBPTfYyBJtbL8RYca8ekBWE+wWyF2tnS+lDmmXDkGz9wjJWmW9Z/VD
 qz2M6gALe/kYJrrjIDV2aDPPPIEtnKTn4dx3V3i97a0+j/52yLe2AhBbR0yAiPThOl2R
 pRVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680266315;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=1kpKwiaiudFL5U4wXymkB+0AZoYJuXS6vdX4Kd03jvA=;
 b=mijUXtqCRO9xXpm8XOTv+1gMLcrhCmRhRKPtuY5uMED/jmfIPBg4YQRBCprzB2uFeN
 cQDm0Zu1qcLCC5WQAKbjwYQVSFjsj2ltNE541yfYIuascXzHxq2owE2n1NbhAfscXvUc
 wu/CUcFYf5VurE5khCJWNOYB/0bmvJNSKpOKSp8pgImrOKZYRx+S6tqDOPrU+LMsyZuE
 wfiSUMxJBVJoqSGcwhrtTUv/1QBh/mBAr5EK28UGGR3ZkMLAl4TBCc4tIYKm0hqzX8Cc
 2sYWuRs7X+5Y4Vys07e2pfjQU267z7P0+ATXm5jABjJa73/GbWy/w67vG0MX+RpRN5k9
 aMfA==
X-Gm-Message-State: AAQBX9eTpVWHOBq3qLo4zhT++/NOb8gvjN7bjmaqTpQUUa3bP8s0IAK7
 JA3iKTH5OMCMoz02mDc9jSM=
X-Google-Smtp-Source: AKy350Z8QphwGGjOx2ILEiPL5GZYaw4i8SheE8DIAFl6kkFUvkLXc0umTySOaE84akYqPLhHIBBnXQ==
X-Received: by 2002:a5d:4281:0:b0:2d9:eb77:90da with SMTP id
 k1-20020a5d4281000000b002d9eb7790damr19273059wrq.33.1680266314977; 
 Fri, 31 Mar 2023 05:38:34 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 z17-20020a5d4d11000000b002da75c5e143sm2114753wrt.29.2023.03.31.05.38.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 31 Mar 2023 05:38:34 -0700 (PDT)
Message-ID: <7dfe5826-36c1-6084-ab9b-066651bde17f@HIDDEN>
Date: Fri, 31 Mar 2023 15:38:33 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN> <83wn2x30js.fsf@HIDDEN>
 <83jzyx2wiy.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83jzyx2wiy.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 31/03/2023 10:46, Eli Zaretskii wrote:
>> Cc:wkirschbaum@HIDDEN,gregory@HIDDEN,casouri@HIDDEN,
>>   62333 <at> debbugs.gnu.org
>> Date: Fri, 31 Mar 2023 09:19:35 +0300
>> From: Eli Zaretskii<eliz@HIDDEN>
>>
>>> Simple example: if the beginning of the narrowed region falls inside a
>>> (let's say multine) string, should the visible remainder of that string
>>> continue to be highlighted as a string?
>> No.
>>
>>> Or should the buffer contents after the string's closer now be
>>> highlighted as being inside a string?
>> Yes.
> To clarify: these my answers are in the context of the current
> handling of narrowing, not in the context of restricting the parser
> (which you seem to reject as a useful idea anyway).

Interesting.

You do realize that it doesn't work this way currently, right?




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 12:48:02 +0000
Resent-Message-ID: <handler.62333.B62333.168026682931975 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.168026682931975
          (code B ref 62333); Fri, 31 Mar 2023 12:48:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 12:47:09 +0000
Received: from localhost ([127.0.0.1]:60673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1piE9t-0008Jf-2B
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 08:47:09 -0400
Received: from mail-wm1-f45.google.com ([209.85.128.45]:35527)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1piE9r-0008JC-Di
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 08:47:07 -0400
Received: by mail-wm1-f45.google.com with SMTP id
 bg16-20020a05600c3c9000b003eb34e21bdfso15259948wmb.0
 for <62333 <at> debbugs.gnu.org>; Fri, 31 Mar 2023 05:47:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680266821;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=3loXMAXoTHOW9Vih4kEYS41suKEFn1uQzxpgQILEiqI=;
 b=nqabLKqmLYR/jUCRSRDLm/7CjmEdt95TX1zmTNXAxGkU/tObj9RUD222Ggf6I+323u
 Soazw968kad+Yaub6W1w1Ta7d8vEjPvpZBh0y1WU70g9LchMc40Nbu3bdFpmn3UB/XrS
 OCMgd2AVaA1fIqQfvvzCEBAz7pNA2Pg3c544BNSRFBJJ3N8eMASKGudPXRoIqIF8XzW8
 k6vzmNzekwfnirNos2nM3pPet5TZFRYaE+5dti7bWiUKzxxfIecQ142r+l3pxKe52OW8
 DaswC6Ukl4rDl/TwEhs/ZYv3j7rbG7zmIg5j9yyIYFNacQ+iIZMXI3fGPTmF8H9JwFEt
 AW/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680266821;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=3loXMAXoTHOW9Vih4kEYS41suKEFn1uQzxpgQILEiqI=;
 b=MpiKWQUpU8GkSHo7c5OEzZwmI/U+lQgr2J8LWrHZLZmtdf14Za8UlcX4iWtt8Pinrd
 CUX7PX5sHl3+OKqIcCJBJoitLDoZDtpQGYhsfIaUpqhkQT3ITX9rM5jkfNQ8wFAL4w76
 eehv4doUbQprIzsYl0Hj9K4aDG22t8v3pi+5J62f9YL60NH/RVqtlkCKAyUxfCnh3U5S
 OrXZ63teY8vSoYK/O4WnkCQkfaVzkEG6DPQQy95j3lok2flaMuGwCc0kCtqjvsJ37dDv
 06AEmsNjJzGAd1A3AFsTYbUgkZmpZYIPbtIrg2fEhqb73rQVxKY6T7IQ6RPiOiqlKFRR
 OQuQ==
X-Gm-Message-State: AO0yUKWhNedkZHtIOG5sh4/WQOhD6Gv8ic3nF570vLxD5UuxbREwJO82
 5ts81Q39FGnBnTBFZBeN3mE=
X-Google-Smtp-Source: AK7set/JTGl7nMlnmURDB3t7fxIeTi3Od4X/MbjMAWpaoucg67yk/keSRvh8lzGHQhnzCaWENoYrSw==
X-Received: by 2002:a1c:4c13:0:b0:3ee:a492:e95e with SMTP id
 z19-20020a1c4c13000000b003eea492e95emr19256300wmf.6.1680266820796; 
 Fri, 31 Mar 2023 05:47:00 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 u17-20020a7bcb11000000b003ef5db16176sm2617109wmj.32.2023.03.31.05.46.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 31 Mar 2023 05:47:00 -0700 (PDT)
Message-ID: <7d4c5109-63ec-76a5-cab4-42f35dab9778@HIDDEN>
Date: Fri, 31 Mar 2023 15:46:58 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN> <83wn2x30js.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <83wn2x30js.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.9 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 31/03/2023 09:19, Eli Zaretskii wrote:
>> If we're talking about isearch, then that seems like a natural
>> consequence of visual effect (hiding the remainder of the buffer): even
>> if isearch highlighted those other hits, they would not be visible.
> If you consider narrowing in this example to be "for visual effect",
> then everything in Emacs is "for visual effect".  After all, Emacs is
> a visual editor, showing the results of editing to the user at all
> times.  But this POV makes this part of the discussion useless.

Okay, let's rephrase that: instead of "visual effect", we can say it's 
for "visually hiding" parts of buffers. But not for changing their 
behaviors otherwise (e.g. changing syntax highlighting, etc).

In your other answer regarding the inside of a string, you seemed to 
have a different idea, though. Like, user narrowing would be able to 
affect all that stuff too.

>>> I was talking about user commands that narrow, so I'm not sure I
>>> understand how documentation could help.  When the user types "C-x n n",
>>> there's nothing Emacs can do except obey.
>> There is really only one main user command that narrows, and that's
>> narrow-to-region, bound to 'C-x n n'.
> Any user command can narrow as part of its job.

This subthread goes back to my complaint that commands don't know how to 
*interpret* the current narrowing, thus which effects it should have.

To repeat:

   Either narrowing should be used to change lexical/grammatical/etc
   context, or it should not. Do we have any documentation that says one
   or the other way? That should affect how Lisp code deals with
   narrowing -- which interactive functions should widen, and so on.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 13:04:01 +0000
Resent-Message-ID: <handler.62333.B62333.16802678372113 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16802678372113
          (code B ref 62333); Fri, 31 Mar 2023 13:04:01 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 13:03:57 +0000
Received: from localhost ([127.0.0.1]:60737 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1piEQ9-0000Y1-99
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 09:03:57 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35198)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1piEQ7-0000Xo-Pm
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 09:03:56 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1piEQ2-0000aw-DF; Fri, 31 Mar 2023 09:03:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=MCsfsQisxSljVF1imprVtANTRxqeX6PHif1uKTk0VZ0=; b=p8ZGlhRzLv1h
 1/M8avQevX8s5ISLog2AQZxrK1gPA83LJuG+9CVxMQWL6ev8lqYb4aQZe1I5FoAYPdjnzDYKz90za
 BZMCs/4+cTwedZS2cw3ehgki6JRFaFXyTZlQOBDKuU1bQ3etJxC+c2Z1F2nvyy+lScknq2mDvSHls
 zR7J+pazERFCugfi/K44a7btrV2lMVWc4ihWPL7jmtFJTmav5bwkQF/Az26aDc/uDz8IaQWGkH8sq
 S2iuP+3P1ePID1SmapCImE2Cxi5LUr5dZMjPNDdRKspMFO9lxTxqdNVn2i6XpjrQipxP/GnGIBAFa
 1CLsDNIYogRB0IhUxOtaww==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1piEQ1-0001zA-TN; Fri, 31 Mar 2023 09:03:50 -0400
Date: Fri, 31 Mar 2023 16:03:58 +0300
Message-Id: <834jq12htt.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <7dfe5826-36c1-6084-ab9b-066651bde17f@HIDDEN> (message from
 Dmitry Gutov on Fri, 31 Mar 2023 15:38:33 +0300)
References: <87fs9yur7r.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN> <83wn2x30js.fsf@HIDDEN>
 <83jzyx2wiy.fsf@HIDDEN> <7dfe5826-36c1-6084-ab9b-066651bde17f@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 31 Mar 2023 15:38:33 +0300
> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
>  62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 31/03/2023 10:46, Eli Zaretskii wrote:
> >> Cc:wkirschbaum@HIDDEN,gregory@HIDDEN,casouri@HIDDEN,
> >>   62333 <at> debbugs.gnu.org
> >> Date: Fri, 31 Mar 2023 09:19:35 +0300
> >> From: Eli Zaretskii<eliz@HIDDEN>
> >>
> >>> Simple example: if the beginning of the narrowed region falls inside a
> >>> (let's say multine) string, should the visible remainder of that string
> >>> continue to be highlighted as a string?
> >> No.
> >>
> >>> Or should the buffer contents after the string's closer now be
> >>> highlighted as being inside a string?
> >> Yes.
> > To clarify: these my answers are in the context of the current
> > handling of narrowing, not in the context of restricting the parser
> > (which you seem to reject as a useful idea anyway).
> 
> Interesting.
> 
> You do realize that it doesn't work this way currently, right?

Yes.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 13:07:02 +0000
Resent-Message-ID: <handler.62333.B62333.16802679902384 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Dmitry Gutov <dgutov@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16802679902384
          (code B ref 62333); Fri, 31 Mar 2023 13:07:02 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 13:06:30 +0000
Received: from localhost ([127.0.0.1]:60742 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1piESb-0000cO-RD
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 09:06:30 -0400
Received: from eggs.gnu.org ([209.51.188.92]:35986)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1piESa-0000cB-LD
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 09:06:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1piESV-0001Em-A8; Fri, 31 Mar 2023 09:06:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=zDckG7RvzfdGCWSat+JRdy607PHHcoG7IPAo8FCQX2o=; b=Q7GAmZawb2Em
 +DqUUqXFv1kr63OgzpEp68xgnXiFCeKrY+WY+d0Lh6MTeIH44CNJPKekd5A/JF2JvFzY0GDpxgHTD
 y+14izt7Z69VQGqfNOSxT8rehFyuvXPdgTTJeF5ZtNDb8QmJTZAghAb4PBJnjFN8m1aM65LrJ9NxB
 t+wdI6Py5ETgUXRLM1utFOMl7zTAhqNt1izZxGgSbPjxsUEZ/ajwvgij0pTTMHBOYGqlHUUuU48HY
 FEAh663Gz9gng7zy8OBFlZEwBhEq+7wZwBlrG/ewkc2B55uiaX755kaCJmaQn6HWpAtFKpz7fjaLJ
 VxbKiqv6UcZjNJIwJ2BFlQ==;
Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1piESU-0008Ff-N7; Fri, 31 Mar 2023 09:06:23 -0400
Date: Fri, 31 Mar 2023 16:06:36 +0300
Message-Id: <83355l2hpf.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <7d4c5109-63ec-76a5-cab4-42f35dab9778@HIDDEN> (message from
 Dmitry Gutov on Fri, 31 Mar 2023 15:46:58 +0300)
References: <87fs9yur7r.fsf@HIDDEN> <83jzz5c8ml.fsf@HIDDEN>
 <fe37c8f1-e949-50a3-3959-edb1c8057ac7@HIDDEN> <83edpdc6sn.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN> <83wn2x30js.fsf@HIDDEN>
 <7d4c5109-63ec-76a5-cab4-42f35dab9778@HIDDEN>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 31 Mar 2023 15:46:58 +0300
> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
>  62333 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov@HIDDEN>
> 
> On 31/03/2023 09:19, Eli Zaretskii wrote:
> >> If we're talking about isearch, then that seems like a natural
> >> consequence of visual effect (hiding the remainder of the buffer): even
> >> if isearch highlighted those other hits, they would not be visible.
> > If you consider narrowing in this example to be "for visual effect",
> > then everything in Emacs is "for visual effect".  After all, Emacs is
> > a visual editor, showing the results of editing to the user at all
> > times.  But this POV makes this part of the discussion useless.
> 
> Okay, let's rephrase that: instead of "visual effect", we can say it's 
> for "visually hiding" parts of buffers. But not for changing their 
> behaviors otherwise (e.g. changing syntax highlighting, etc).

I disagree that narrowing for, say, searching should be interpreted
like that.

> >>> I was talking about user commands that narrow, so I'm not sure I
> >>> understand how documentation could help.  When the user types "C-x n n",
> >>> there's nothing Emacs can do except obey.
> >> There is really only one main user command that narrows, and that's
> >> narrow-to-region, bound to 'C-x n n'.
> > Any user command can narrow as part of its job.
> 
> This subthread goes back to my complaint that commands don't know how to 
> *interpret* the current narrowing, thus which effects it should have.

We agree about that, at least.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#62333: 30.0.50; Issue with tree-sitter syntax tree during certain changes
Resent-From: Dmitry Gutov <dgutov@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 31 Mar 2023 13:27:01 +0000
Resent-Message-ID: <handler.62333.B62333.16802692024313 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 62333
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN, 62333 <at> debbugs.gnu.org
Received: via spool by 62333-submit <at> debbugs.gnu.org id=B62333.16802692024313
          (code B ref 62333); Fri, 31 Mar 2023 13:27:01 +0000
Received: (at 62333) by debbugs.gnu.org; 31 Mar 2023 13:26:42 +0000
Received: from localhost ([127.0.0.1]:60766 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1piEm9-00017V-Em
	for submit <at> debbugs.gnu.org; Fri, 31 Mar 2023 09:26:41 -0400
Received: from mail-wr1-f43.google.com ([209.85.221.43]:37810)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1piEm7-00017E-Ak
 for 62333 <at> debbugs.gnu.org; Fri, 31 Mar 2023 09:26:39 -0400
Received: by mail-wr1-f43.google.com with SMTP id y14so22400046wrq.4
 for <62333 <at> debbugs.gnu.org>; Fri, 31 Mar 2023 06:26:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20210112; t=1680269193;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:from:to:cc:subject:date:message-id:reply-to;
 bh=F3Ty+ZNBi7D6Vf8zzINGK044apufCOT65vr+1IqIzsY=;
 b=gmGAHdAhgNjwAi2/yVvgc/ZASppPAQhjNV9JRngFSNzmjxud4konssbR5FW45ZQCQp
 zovXct5SEgLonF31XvJ3KPlZUMxB3hQtdjivAabAX2+s7vXg7rd6KeTMO8p60adm2jAd
 90fvkfwyDrDxsdxeaSBJjzRYi/2TZ2b2n77hfj/q/7eSX47XKMA8mVFG0pLbDhTxtT1W
 kYBl8oP+3UBfO0UlvAC5u9XKncCig6zHozBFq68a46UKDd5x8Ypfsv+KXBb8tQcf4Cfm
 p6bIna8LEvXRCrJkpk0R1we2n71gYu+KUiBdc4ISTrqEfL51gVjVQX74/HFEKjNyQzTk
 Q9dg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112; t=1680269193;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:user-agent:mime-version:date:message-id
 :sender:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=F3Ty+ZNBi7D6Vf8zzINGK044apufCOT65vr+1IqIzsY=;
 b=gzRwSfkhg52vDCgHJKL/jQSdsjs8tt9wBVzU9uavsPWLr4hbv/lwb1+D0KWH9fIDHH
 RnWSnzHjXkQZGhVZhte6qgjYYuarVkSkErc1b4lBhl72T13NvswfGwQOX96KEyJGhg2w
 2RhSN3e3viWFyAHXvXTFCXrMe9bL/YV+DAUQtU3NC4wMl1ZGSmWr/oCSpZghdX2Z+j9E
 oW7D0OOFZREEm4qoWGV7oFi92gzi922gpYWvSQCxQSGla+CCGoDEqRK90pArwrMASB6a
 nhFTR4kWqBqXrMVLFj3pDU8t3DAyI/3m4P3cH/JOArWkbyA4CIuqQFV/LBhVJxhZXLQ4
 PMXQ==
X-Gm-Message-State: AAQBX9eAckkWaA5vdaADf4cuYLq2qcnBPlgixt4s5gxhLGXyE7QVa0Pm
 33KYgc6lBEct29hZvF9hPz3WSQPU4JFTzg==
X-Google-Smtp-Source: AKy350bwXKnMl/VfTT0iK2feIJvaBxK9eBhC86NxtEplgtf7RJdFo/NYswLA68EBkLLt2QDB6t6s6Q==
X-Received: by 2002:adf:f885:0:b0:2cf:e77e:2eef with SMTP id
 u5-20020adff885000000b002cfe77e2eefmr22398098wrp.8.1680269193682; 
 Fri, 31 Mar 2023 06:26:33 -0700 (PDT)
Received: from [192.168.1.2] ([31.216.80.60])
 by smtp.googlemail.com with ESMTPSA id
 o18-20020adfe812000000b002daf0b52598sm2237931wrm.18.2023.03.31.06.26.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 31 Mar 2023 06:26:33 -0700 (PDT)
Message-ID: <54841ad6-2fc3-a300-9fcc-9082f6aee75c@HIDDEN>
Date: Fri, 31 Mar 2023 16:26:31 +0300
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.8.0
Content-Language: en-US
References: <87fs9yur7r.fsf@HIDDEN>
 <1ca302bf-99dc-7f9e-8544-063064a1cb21@HIDDEN> <831qlcdisi.fsf@HIDDEN>
 <398721ad-79b0-3f6d-97b3-4902d9bfbe39@HIDDEN> <83wn34c2qa.fsf@HIDDEN>
 <3b3d82d1-f0f6-a768-a5db-8dc9386a5a34@HIDDEN> <83r0tcbz8g.fsf@HIDDEN>
 <1967361679760225@HIDDEN>
 <83mt40bxzd.fsf@HIDDEN> <fb12be31-d607-07c3-246e-dd3becc4b9a4@HIDDEN>
 <83jzz4bugh.fsf@HIDDEN> <3d64520c-54da-a04a-ed0d-a66b4e753f8a@HIDDEN>
 <831qlcaysh.fsf@HIDDEN> <29679184-7366-0167-9e94-def97048f663@HIDDEN>
 <83v8inal29.fsf@HIDDEN> <9886ffa5-ead2-50d5-a325-f6704b736ada@HIDDEN>
 <728618716b8c5349d27e@HIDDEN> <83bkke9uue.fsf@HIDDEN>
 <a61e8b02-5bd7-088c-56f7-0025d5d12e6a@HIDDEN> <83ilel861g.fsf@HIDDEN>
 <290987e0-821e-a231-c1c4-b40bb9542ffe@HIDDEN> <83lejf7r2o.fsf@HIDDEN>
 <1c4c8b47-e4aa-242a-bb66-1d6b5c879de4@HIDDEN> <83wn2x30js.fsf@HIDDEN>
 <83jzyx2wiy.fsf@HIDDEN> <7dfe5826-36c1-6084-ab9b-066651bde17f@HIDDEN>
 <834jq12htt.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
In-Reply-To: <834jq12htt.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.1 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

On 31/03/2023 16:03, Eli Zaretskii wrote:
>> Date: Fri, 31 Mar 2023 15:38:33 +0300
>> Cc: wkirschbaum@HIDDEN, gregory@HIDDEN, casouri@HIDDEN,
>>   62333 <at> debbugs.gnu.org
>> From: Dmitry Gutov <dgutov@HIDDEN>
>>
>> On 31/03/2023 10:46, Eli Zaretskii wrote:
>>>> Cc:wkirschbaum@HIDDEN,gregory@HIDDEN,casouri@HIDDEN,
>>>>    62333 <at> debbugs.gnu.org
>>>> Date: Fri, 31 Mar 2023 09:19:35 +0300
>>>> From: Eli Zaretskii<eliz@HIDDEN>
>>>>
>>>>> Simple example: if the beginning of the narrowed region falls inside a
>>>>> (let's say multine) string, should the visible remainder of that string
>>>>> continue to be highlighted as a string?
>>>> No.
>>>>
>>>>> Or should the buffer contents after the string's closer now be
>>>>> highlighted as being inside a string?
>>>> Yes.
>>> To clarify: these my answers are in the context of the current
>>> handling of narrowing, not in the context of restricting the parser
>>> (which you seem to reject as a useful idea anyway).
>>
>> Interesting.
>>
>> You do realize that it doesn't work this way currently, right?
> 
> Yes.

So... do you think we should flip font-lock-dont-widen's default to t? 
Then the behavior can be like you answered, and we could alter other 
features (e.g. indentation) too.

Note that that variable goes back to 2002, though.

And regarding indentation: with that kind of the change, narrowing 
region to a fragment of a function definition (cutting out its 
beginning) will usually make indentation shallower, when code outside of 
narrowing is considered absent.





Last modified: Fri, 31 Mar 2023 13:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.