From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 15:05:38 2025 Received: (at submit) by debbugs.gnu.org; 16 Apr 2025 19:05:38 +0000 Received: from localhost ([127.0.0.1]:42173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u584l-0003d3-OP for submit@debbugs.gnu.org; Wed, 16 Apr 2025 15:05:37 -0400 Received: from lists.gnu.org ([2001:470:142::17]:52638) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u584j-0003br-1E for submit@debbugs.gnu.org; Wed, 16 Apr 2025 15:05:34 -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 ) id 1u584a-0000Go-VI for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2025 15:05:24 -0400 Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u584X-0004VN-VG for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2025 15:05:24 -0400 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9239A1140245 for ; Wed, 16 Apr 2025 15:05:18 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 16 Apr 2025 15:05:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1744830318; x=1744916718; bh=1hHy/IiDlEx9sux1D/T8ATxv3MhhihHF R/i5qPh/8NY=; b=W55cy4EctP+cA99hU6Znqgkr5KPFBj9J933sFweP9+oRjL0q XeGS+fJaTIiItzD+hpMcnioYGrtXm7tRm81n0Koi9VQXoGGXxwzgpwxStLoBwIgA 3Yvo8wTLEIfSaOby8aRjR13u4rCj8kU+990WRqiC84EesyVd31WepvhKCl53pzH/ tbVOXvmIOClYpcJOdjdSq4cGVQSwbvY3o8xQP8byi142rf7KaBrHfIXuo1dxc+3j bfLcejCVYKskG7sZiwcD5uAcey1rktrD5wO39/q1VD93k0ouGIBsCZmbJkpohx6w Ulyg0If/7gDFI1WaqIrfUVwHYY6kd+KIMKskzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744830318; x= 1744916718; bh=1hHy/IiDlEx9sux1D/T8ATxv3MhhihHFR/i5qPh/8NY=; b=i 93kr5zNl1WeEQq9dyMM3sI7y0qM9YqJGYN7AaZ8TGrfl6iou4A4Hj/DB4af+iab+ hPa8aGvD0L92wi2K0BYJbs/ORWhjcu22clL7ic3OmY2qsley1GkgRNqM5vAkGVFn TkBX0zup27n+f5+fRNcbcgXpi9l02Tc5FZG0Cx3rxf8ro5U+IytkgV8dfJi6ZVqt A9g324uRwEZqDtQjBtgFEY2p1nHxCCAsxtojZx9/MX8WLvj8u9mWwFblIh4+vbfP 0s0spjRyVl1dXDfjasx/KCo/Uv+DV4G128O13bMu4NMItnc6ej2TASjUuRJScAQp tVDfWTz5iO1B6CCXvMj/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdejudeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvf fufgffkfggtgesthdtredttdertdenucfhrhhomheptfhomhgrnhcutfhuuggrkhhovhcu oehrrhhuuggrkhhovhesfhgrshhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpe ehffejtddvgfevffevffdvheeijedtffdtgfeugeegheeuueeljeelveekkeehleenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrrhhuuggrkh hovhesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhm thhpohhuthdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i1c714620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 16 Apr 2025 15:05:16 -0400 (EDT) From: Roman Rudakov To: bug-gnu-emacs@gnu.org Subject: 31.0.50; treesit-update-ranges: offset setting is ignored for local parsers User-Agent: mu4e 1.12.9; emacs 31.0.50 X-Debbugs-Cc: Date: Wed, 16 Apr 2025 21:05:13 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; format=flowed Received-SPF: pass client-ip=103.168.172.155; envelope-from=rrudakov@fastmail.com; helo=fhigh-a4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hello, I've noticed that when defining 'treesit-range-settings' using the 'treesit-range-rules helper function, such as: (treesit-range-rules :embed 'markdown-inline :host 'clojure :offset '(1 . -1) :local t (clojure-ts--docstring-query '@capture)) The ':offset' setting doesn't have any effect. After debugging the 'treesit-update-ranges' function, I noticed that it calls 'treesit--update-range-1', which in turn calls 'treesit--update-ranges-local' if ':local t' is specified. 'treesit--update-ranges-local' does not accept offset as an argument, although it is mentioned in its documentation string: > OFFSET is a cons of start and end offsets that are applied to the > range > for the local parser. This discrepancy between the documented behavior and the actual implementation of 'treesit--update-ranges-local' regarding the offset argument might be a bug. In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.4.0, NS appkit-2575.50 Version 15.4 (Build 24E248)) of 2025-04-16 built on macbookpro.home Windowing system distributor 'Apple', version 10.3.2575 System Description: macOS 15.4 Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp --infodir=/opt/homebrew/Cellar/emacs-plus@31/31.0.50/share/info/emacs --prefix=/opt/homebrew/Cellar/emacs-plus@31/31.0.50 --with-native-compilation=aot --with-xml2 --with-gnutls --without-compress-install --without-dbus --without-imagemagick --with-modules --with-rsvg --with-webp --without-pop --with-ns --disable-ns-self-contained 'CFLAGS=-O2 -DFD_SETSIZE=10000 -DDARWIN_UNLIMITED_SELECT -I/opt/homebrew/opt/sqlite/include -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include' 'LDFLAGS=-L/opt/homebrew/opt/sqlite/lib -L/opt/homebrew/lib/gcc/14 -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include'' Configured features: ACL GIF GLIB GMP GNUTLS JPEG LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: global-git-commit-mode: t magit-auto-revert-mode: t idle-highlight-mode: t subword-mode: t yas-minor-mode: t hl-todo-mode: t flymake-mode: t server-mode: t pdf-occur-global-minor-mode: t mu4e-column-faces-mode: t mu4e-modeline-mode: t auto-insert-mode: t electric-pair-mode: t org-roam-db-autosync-mode: t outline-minor-mode: t minions-mode: t repeat-mode: t save-place-mode: t minibuffer-electric-default-mode: t savehist-mode: t recentf-mode: t global-auto-revert-mode: t global-hl-line-mode: t apheleia-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 menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t window-divider-mode: t minibuffer-regexp-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 hs-minor-mode: t Load-path shadows: /Users/rrudakov/.config/emacs/elpa/ef-themes-1.9.0/theme-loaddefs hides /Users/rrudakov/.config/emacs/elpa/modus-themes-4.6.0/theme-loaddefs /Users/rrudakov/.config/emacs/elpa/magit-4.3.2/magit-autorevert hides /Users/rrudakov/.config/emacs/elpa/magit-section-4.3.2/magit-autorevert /Users/rrudakov/.config/emacs/elpa/password-store-20231201.954/password-store hides /opt/homebrew/share/emacs/site-lisp/pass/password-store /Users/rrudakov/.config/emacs/elpa/transient-0.8.7/transient hides /opt/homebrew/Cellar/emacs-plus@31/31.0.50/share/emacs/31.0.50/lisp/transient /Users/rrudakov/.config/emacs/elpa/ef-themes-1.9.0/theme-loaddefs hides /opt/homebrew/Cellar/emacs-plus@31/31.0.50/share/emacs/31.0.50/lisp/theme-loaddefs Features: (shadow emacsbug re-builder descr-text tramp-cache time-stamp shortdoc epa-file network-stream mailalias dabbrev pcmpl-unix pcmpl-gnu misc cal-move magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util magit-extras view alert log4e gntp dired-aux cl-print edebug debug backtrace help-fns radix-tree emacs-everywhere vc-hg vc-svn bug-reference markdown-ts-mode markdown-mode edit-indirect misearch multi-isearch apheleia apheleia-rcs apheleia-dp apheleia-formatters apheleia-utils apheleia-log apheleia-formatter-context face-remap magit-bookmark 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 which-func magit-diff smerge-mode diff git-commit log-edit pcvs-util add-log magit-core magit-autorevert magit-margin magit-transient magit-process with-editor magit-mode benchmark magit-git magit-base vc-git diff-mode track-changes qp sort smiley gnus-cite mm-archive mail-extr textsec uni-scripts idna-mapping uni-confusable textsec-check clojure-ts-mode flymake-kondor clj-refactor hydra lv inflections mc-hide-unmatched-lines-mode mc-mark-more sgml-mode mc-cycle-cursors multiple-cursors-core rect paredit cider tramp-sh cider-debug cider-browse-ns cider-mode cider-xref-backend cider-find cider-completion cider-profile cider-inspector cider-eval cider-jar arc-mode archive-mode cider-repl-history pulse cider-repl cider-resolve cider-test cider-overlays cider-stacktrace cider-doc cider-browse-spec cider-clojuredocs cider-eldoc cider-docstring cider-client cider-common xref cider-completion-context cider-connection cider-popup sesman-browser nrepl-client cider-util tramp trampver tramp-integration tramp-message tramp-compat tramp-loaddefs sesman queue nrepl-dict spinner parseedn parseclj-parser parseclj-lex parseclj-alist clojure-mode align idle-highlight-mode cap-words superword subword hideshow yasnippet ef-maris-dark-theme ef-themes cus-start hl-todo checkdoc lisp-mnt flymake server github org-git ghub-graphql treepy gsexp ghub url-http url-gw nsm url-auth google-translate-smooth-ui google-translate-core-ui facemenu color popup google-translate-core google-translate-backend use-package-ensure pdf-occur tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag semantic/lex semantic/fw mode-local cedet pdf-isearch let-alist pdf-misc pdf-tools pdf-view jka-compr pdf-cache pdf-info tq pdf-util pdf-macs image-mode exif ob-restclient restclient mu4e-column-faces mu4e-icalendar gnus-icalendar icalendar mu4e mu4e-org mu4e-notification notifications mu4e-main smtpmail mu4e-view mu4e-mime-parts mu4e-headers mu4e-thread mu4e-actions mu4e-compose mu4e-draft gnus-msg mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message flow-fill mu4e-contacts mu4e-update mu4e-folders mu4e-context mu4e-query-items mu4e-server mu4e-modeline mu4e-vars mu4e-helpers mu4e-config mu4e-window bookmark ido mu4e-obsolete yaml-ts-mode dockerfile-ts-mode rust-ts-mode typescript-ts-mode js c-ts-common imenu cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs vlf-setup vlf vlf-base vlf-tune autoinsert rg files-x vc vc-dispatcher rg-info-hack rg-menu transient edmacro kmacro rg-ibuffer rg-result wgrep-rg wgrep rg-history rg-header ibuf-ext ibuffer ibuffer-loaddefs grep compile elec-pair emacsql-sqlite-builtin org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node crm org-roam-db org-roam-utils org-roam-compat org-roam org-capture emacsql-sqlite emacsql emacsql-compiler magit-section cursor-sensor llama comp comp-cstr dash async ob-async ob-plantuml ob-ditaa ob-clojure ob-haskell ob-sqlite ob-shell shell ob-sql ob-python python project org-clock appt diary-lib diary-loaddefs org-duration comp-run comp-common flyspell ispell oc-basic bibtex disp-table ol-info ol-gnus nnselect gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr-tag-pre-highlight language-detection shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win gnus nnheader gnus-util text-property-search mail-utils range mm-util mail-prsvr ox-gfm ox-md ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar ox-html table ox-ascii ox-publish ox org-attach org-agenda org-element org-persist org-id org-element-ast inline avl-tree generator org-refile org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src sh-script smie treesit executable ob-comint org-pcomplete pcomplete org-list org-footnote org-faces org-entities time-date noutline outline org-version ob-emacs-lisp ob-core ob-eval org-cycle org-table org-keys oc org-loaddefs thingatpt find-func cal-menu calendar cal-loaddefs ol org-fold org-fold-core org-compat org-macs format-spec exec-path-from-shell minions compat repeat hippie-exp comint ansi-osc ansi-color ring advice saveplace minibuf-eldef savehist recentf tree-widget cl-extra help-mode autorevert filenotify use-package-core hl-line finder-inf add-node-modules-path-autoloads alert-autoloads apheleia-autoloads easy-mmode auctex-autoloads tex-site buttercup-autoloads clj-refactor-autoloads cider-autoloads clojure-mode-autoloads clojure-ts-mode-autoloads csv-mode-autoloads debbugs-autoloads dired-git-info-autoloads dired-subtree-autoloads dired-hacks-utils-autoloads dtrt-indent-autoloads edit-indirect-autoloads ef-themes-autoloads elfeed-autoloads emacs-everywhere-autoloads emmet-mode-autoloads exec-path-from-shell-autoloads expand-region-autoloads flymake-kondor-autoloads flyspell-correct-autoloads ghub-autoloads git-link-autoloads gitignore-templates-autoloads gntp-autoloads google-c-style-autoloads google-translate-autoloads groovy-mode-autoloads haskell-mode-autoloads hl-todo-autoloads hydra-autoloads idle-highlight-mode-autoloads inflections-autoloads log4e-autoloads logview-autoloads datetime-autoloads extmap-autoloads lua-mode-autoloads lv-autoloads magit-autoloads pcase markdown-mode-autoloads minions-autoloads modus-themes-autoloads mu4e-column-faces-autoloads multiple-cursors-autoloads nginx-mode-autoloads nov-autoloads esxml-autoloads kv-autoloads ob-async-autoloads async-autoloads ob-restclient-autoloads org-roam-autoloads magit-section-autoloads llama-autoloads emacsql-autoloads org-tree-slide-autoloads ox-jira-autoloads ox-slack-autoloads ox-gfm-autoloads paredit-autoloads parseedn-autoloads parseclj-autoloads password-store-otp-autoloads password-store-autoloads pdf-tools-autoloads pip-requirements-autoloads pkgbuild-mode-autoloads plantuml-mode-autoloads dash-autoloads popup-autoloads pyvenv-autoloads queue-autoloads rainbow-mode-autoloads restclient-autoloads rg-autoloads s-autoloads sesman-autoloads shr-tag-pre-highlight-autoloads language-detection-autoloads sly-autoloads warnings spinner-autoloads sql-indent-autoloads ssh-config-mode-autoloads rx tablist-autoloads telega-autoloads transient-autoloads treepy-autoloads vimrc-mode-autoloads visual-fill-column-autoloads vlf-autoloads web-mode-autoloads wgrep-autoloads info with-editor-autoloads yasnippet-autoloads package browse-url xdg 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 subr-x map byte-opt gv bytecomp byte-compile url-vars cus-edit pp cus-load icons wid-edit cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win 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 kqueue cocoa ns lcms2 multi-tty make-network-process tty-child-frames native-compile emacs) Memory information: ((conses 16 1254711 512110) (symbols 48 81955 84) (strings 32 417506 9240) (string-bytes 1 11844813) (vectors 16 309427) (vector-slots 8 3125768 209057) (floats 8 92057 1427) (intervals 56 44552 11081) (buffers 992 56)) -- Best regards, Roman From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 02:25:13 2025 Received: (at 77848) by debbugs.gnu.org; 17 Apr 2025 06:25:13 +0000 Received: from localhost ([127.0.0.1]:45510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5IgT-0007qY-0H for submit@debbugs.gnu.org; Thu, 17 Apr 2025 02:25:13 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:43977) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5IgP-0007k8-9a for 77848@debbugs.gnu.org; Thu, 17 Apr 2025 02:25:10 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 389D143A4D; Thu, 17 Apr 2025 06:24:53 +0000 (UTC) From: Juri Linkov To: Roman Rudakov Subject: Re: bug#77848: 31.0.50; treesit-update-ranges: offset setting is ignored for local parsers In-Reply-To: Organization: LINKOV.NET References: Date: Thu, 17 Apr 2025 09:24:04 +0300 Message-ID: <8734e78fwb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdekheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepfedprhgtphhtthhopeejjeekgeekseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomhdprhgtphhtthhopehrrhhuuggrkhhovhesfhgrshhtmhgrihhlrdgtohhm X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77848 Cc: Yuan Fu , 77848@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Cc-ing Yuan for the help. > Hello, I've noticed that when defining 'treesit-range-settings' using the > 'treesit-range-rules helper function, such as: > > (treesit-range-rules > :embed 'markdown-inline > :host 'clojure > :offset '(1 . -1) > :local t > (clojure-ts--docstring-query '@capture)) > > The ':offset' setting doesn't have any effect. > > After debugging the 'treesit-update-ranges' function, I noticed that it > calls 'treesit--update-range-1', which in turn calls > 'treesit--update-ranges-local' if ':local t' is > specified. 'treesit--update-ranges-local' does not accept offset as an > argument, although it is mentioned in its documentation string: > >> OFFSET is a cons of start and end offsets that are applied to the range >> for the local parser. > > This discrepancy between the documented behavior and the actual > implementation of 'treesit--update-ranges-local' regarding the offset > argument might be a bug. From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 19:45:08 2025 Received: (at 77848-done) by debbugs.gnu.org; 17 Apr 2025 23:45:08 +0000 Received: from localhost ([127.0.0.1]:48900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5Yum-000222-LD for submit@debbugs.gnu.org; Thu, 17 Apr 2025 19:45:07 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:53694) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u5Yui-0001zq-2g for 77848-done@debbugs.gnu.org; Thu, 17 Apr 2025 19:45:01 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-224191d92e4so16566535ad.3 for <77848-done@debbugs.gnu.org>; Thu, 17 Apr 2025 16:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744933494; x=1745538294; darn=debbugs.gnu.org; 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=+929W0A00fNGOtT0J64Y5+0mEmKSQmYdJqYsRrRpEkc=; b=YoG/Wya3YJ76+Gi56isKmDSJ1e297AtNH3DaY3fpP3dJOSbopGon55GnivhNQ6XfZN ZezvfZ16ISLFPNa4NOArYR2FuCnBCgb6Gb5U8Tc/8J6k6WfLYO1JFjF9dEIkm/WEj9HX Rl7IibDt+5l5e4P6j7eONvTvZWgTu1PJMllLWHtciXshi0oOyH88L7WPlFFdBP/2Pj0A zedaKkaJ9w3tNzohwrI2vqgcjL+z4dpmcBt2F2fjG1NBvwj2EkyD8dlA7wIXe8L7kJTE wPpReXA7Kg4rZF/JGXDGiUvCiBzC6SG0O5G7j2fCpWYonHHko+nUIyBDHB3H580x3T4j mlHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744933494; x=1745538294; 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=+929W0A00fNGOtT0J64Y5+0mEmKSQmYdJqYsRrRpEkc=; b=wv8fKWuwv0FOzjzeXKuyqWZGs0HLYHHfi0YMqAU3JJmL3GEwUXt9amSpEJln/8WjHD MIgcixLACDxmQ4BvUM3DDrmZNJ5JyBRilseVAXv5rTNH38nSBVfBO2jns7qho5ryflwa 3EuU8LklbRCciYhdFCdU5Vz0JTOB3mKTIdKieed1VRTvU/4j1+r7Fiky3qrZW1+8ahVI MGkbWAIbGfJLb5Ps4ApAq39G/wFw5CHzUArti+MNTywLp+qEqMcpdYqqbUp4sf6wdKyc D8CpHU43A/qVMYk1dIR1dGPYbNICRcwi3D1TsxcNeRdQpqWCvsTKKdh37YLBlp/q8fNP WJqA== X-Forwarded-Encrypted: i=1; AJvYcCXUyli7967kLV52YtQAMCL8IPZPQIOBtc1p+i47sXtWWNieN7XwsdjveakDjP1+DspXacD/YVj+C0yQ@debbugs.gnu.org X-Gm-Message-State: AOJu0YzJrCztJkpk6WB+xvFcUcpNgyYmG+4PJHVcmu164TJX8zJPtn1I H0W6D9xvpCWcw2Kdt35zPHJJrF6eNwkk1MmHu3IZgYxy00E+1Eol X-Gm-Gg: ASbGncvrLnT05b1I7qMExO5bWHJWi7NmFuO0Mph7JCa0qT29CzMG/+zk5SR0nPDeIih IOdzH9QhyozV2RSFBv9yrra/tmqmqOoVPqs3YkQFArU8Fyc+iY+cXNNAbUA/E7gEzuHvq6VdW2v uY0K6EFH/4D57+9gyxYfhF6tVpmcEf1gYlwLpx6oUYIW2n74hPcgG7PTISxji5JyoMvmxuAJodj 08ibyWBj/KEG8KA+ug19VcFZsEWDuyUo3BqkdPm6w2ksb0kI6GuiULtVuesibYWEoxw3JwbmzS8 cLlK5oBybrmObOCGUk2DAeaRKJikEOsgZLvrrXstMcF1tNlOmLhdyi9JQzptumkN X-Google-Smtp-Source: AGHT+IEbc4UV4r+XW9CzY3TsHIxMH9hObNjQGN2F7bACYeC+NPDtXhzNxVuGHJutvW2h4sQSRG42WQ== X-Received: by 2002:a17:902:da88:b0:229:1717:882a with SMTP id d9443c01a7336-22c5337a225mr11580995ad.4.1744933493735; Thu, 17 Apr 2025 16:44:53 -0700 (PDT) Received: from smtpclient.apple ([2601:646:8f81:6120:9c26:1394:9c81:74c2]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22c50bf6595sm6062335ad.101.2025.04.17.16.44.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Apr 2025 16:44:53 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: bug#77848: 31.0.50; treesit-update-ranges: offset setting is ignored for local parsers From: Yuan Fu In-Reply-To: <8734e78fwb.fsf@mail.linkov.net> Date: Thu, 17 Apr 2025 16:44:42 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <8734e78fwb.fsf@mail.linkov.net> To: Juri Linkov X-Mailer: Apple Mail (2.3826.400.131.1.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77848-done Cc: Roman Rudakov , 77848-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Apr 16, 2025, at 11:24=E2=80=AFPM, Juri Linkov = wrote: >=20 > Cc-ing Yuan for the help. >=20 >> Hello, I've noticed that when defining 'treesit-range-settings' using = the >> 'treesit-range-rules helper function, such as: >>=20 >> (treesit-range-rules >> :embed 'markdown-inline >> :host 'clojure >> :offset '(1 . -1) >> :local t >> (clojure-ts--docstring-query '@capture)) >>=20 >> The ':offset' setting doesn't have any effect. >>=20 >> After debugging the 'treesit-update-ranges' function, I noticed that = it >> calls 'treesit--update-range-1', which in turn calls >> 'treesit--update-ranges-local' if ':local t' is >> specified. 'treesit--update-ranges-local' does not accept offset as = an >> argument, although it is mentioned in its documentation string: >>=20 >>> OFFSET is a cons of start and end offsets that are applied to the = range >>> for the local parser. >>=20 >> This discrepancy between the documented behavior and the actual >> implementation of 'treesit--update-ranges-local' regarding the offset >> argument might be a bug. Yes, it=E2=80=99s indeed a bug. I=E2=80=99ve pushed a fix for it. Thanks = to you both! Yuan= From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 18 03:32:16 2025 Received: (at 77848-done) by debbugs.gnu.org; 18 Apr 2025 07:32:16 +0000 Received: from localhost ([127.0.0.1]:49507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5gCt-0003Es-PH for submit@debbugs.gnu.org; Fri, 18 Apr 2025 03:32:16 -0400 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]:48785) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5gCs-0003Di-0B for 77848-done@debbugs.gnu.org; Fri, 18 Apr 2025 03:32:14 -0400 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 9037E13801DE; Fri, 18 Apr 2025 03:32:08 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Fri, 18 Apr 2025 03:32:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1744961528; x=1745047928; bh=pTIr+nMErkvFc6S/DWdF06tjWnzzJeJWateiJSQkCJc=; b= AAIFB/h3i3Ef8qORgPK5pXsgQs695+BIQT0Fme427QfDB7H1ptY5XLqK2AuyBm7U TBYA3m+sUojK/wpb078dD+UH23F1ImPK8mbcqQ5aabeHTKHSzNMn/CLkjtalt88X nB2zysirizWfEwhF+AytR10hggGDfEgVTLiSopwyAwbGkn8g/f/thOtykdFjPy23 9njt6tdQsw2X7lufJubfPkaJYGcfezHGQZIUFFSiEEKtbMcTg/xcod4gXzASoG4V dQBDkvG41L4Az1ltQPHxwJ8D6bMkLEtMpTyZHF5s5GJwPSQjIhVfkWWLqiQTz8T6 QN1doFihl4yeIVo1rcQwmw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744961528; x= 1745047928; bh=pTIr+nMErkvFc6S/DWdF06tjWnzzJeJWateiJSQkCJc=; b=q bM+EZr9FySDPluXrtZDOGjLTsP0X10i7ITO2Dv5Weor7PIQDHw4nvmQpDqOc0lYd 3yVx0Krz7sXE1VtDD0jS+6R/YUJLKxFiOxR6rQFK2xnKb4SgoHFX+8bg+LlGqKNk BWF+1Dzn/kgSV8RyWKoQNHZgU47pn1gez8MGWw3Op4zSv0oypHA7EMg2M03eXhlu VPHjkPac4uAoPA9pXc9HWLM3J0yrrQ1BAannSPSunwQfkAcfzy4u1NGop6Z9JpW2 2eBvCwFn4Q4OCepmZ5IqoE35BnKVeNC8IaxeJnNJIsF8ZFXD0w4AgujYH3ozXp8t ydLizis3VFeihWogZoYZQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeduheegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgfgsehtqhertddt reejnecuhfhrohhmpeftohhmrghnucftuhgurghkohhvuceorhhruhgurghkohhvsehfrg hsthhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepleeiueduhfevleejveeuhfei tdehudffuefftdejveeliedtffekgeeujeegieeinecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprhhruhgurghkohhvsehfrghsthhmrghilhdr tghomhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epjeejkeegkedqughonhgvseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohep jhhurhhisehlihhnkhhovhdrnhgvthdprhgtphhtthhopegtrghsohhurhhisehgmhgrih hlrdgtohhm X-ME-Proxy: Feedback-ID: i1c714620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Apr 2025 03:32:07 -0400 (EDT) From: Roman Rudakov To: Yuan Fu Subject: Re: bug#77848: 31.0.50; treesit-update-ranges: offset setting is ignored for local parsers In-Reply-To: References: <8734e78fwb.fsf@mail.linkov.net> User-Agent: mu4e 1.12.9; emacs 31.0.50 Date: Fri, 18 Apr 2025 09:32:00 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77848-done Cc: 77848-done@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Yuan Fu writes: >> On Apr 16, 2025, at 11:24=E2=80=AFPM, Juri Linkov wrot= e: >> >> Cc-ing Yuan for the help. >> >>> Hello, I've noticed that when defining 'treesit-range-settings'=20 >>> using the >>> 'treesit-range-rules helper function, such as: >>> >>> (treesit-range-rules >>> :embed 'markdown-inline >>> :host 'clojure >>> :offset '(1 . -1) >>> :local t >>> (clojure-ts--docstring-query '@capture)) >>> >>> The ':offset' setting doesn't have any effect. >>> >>> After debugging the 'treesit-update-ranges' function, I noticed=20 >>> that it >>> calls 'treesit--update-range-1', which in turn calls >>> 'treesit--update-ranges-local' if ':local t' is >>> specified. 'treesit--update-ranges-local' does not accept offset=20 >>> as an >>> argument, although it is mentioned in its documentation string: >>> >>>> OFFSET is a cons of start and end offsets that are applied to the=20 >>>> range >>>> for the local parser. >>> >>> This discrepancy between the documented behavior and the actual >>> implementation of 'treesit--update-ranges-local' regarding the=20 >>> offset >>> argument might be a bug. > > Yes, it=E2=80=99s indeed a bug. I=E2=80=99ve pushed a fix for it. Thanks = to you=20 > both! > > Yuan Thank you! Would it be possible to also install the fix on emacs-30 branch? -- Best regards, Roman From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 18 19:35:03 2025 Received: (at 77848-done) by debbugs.gnu.org; 18 Apr 2025 23:35:04 +0000 Received: from localhost ([127.0.0.1]:53256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5vEb-0000oJ-K9 for submit@debbugs.gnu.org; Fri, 18 Apr 2025 19:35:03 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:56380) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u5vEX-0000mz-G0 for 77848-done@debbugs.gnu.org; Fri, 18 Apr 2025 19:34:58 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-736c062b1f5so1894922b3a.0 for <77848-done@debbugs.gnu.org>; Fri, 18 Apr 2025 16:34:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745019291; x=1745624091; darn=debbugs.gnu.org; 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=pL/k1vrzVyaptp0CA1uTfOuUgq4hVabAR2PrAEwjQkA=; b=LKo127dwi8pMeHlTTnOh37dllYIsb8/WO70inyb4qI/Hj+b1uUP1Ikz3aiyt/6dYIT vjgIAIDO+OgB+2dsxuAflrN7FL/klGeeBYQEo0fIlts0ZeED+0oh5spENdH+Pxcp6+o9 mtbxRfQxssar04g1RiejwX3jdPDoS7ysJ9YPscxvB2xbLfOglQRdPiopETGfupgbcZ62 oF6sNM7LbOG+mlzImgZE6qYwPz8UjiNH3x9s5UFZvEbRp6ZCbrxyP1MAvQSzcGLn77uG BwxuwTSh8aV9nB+pyK4PXPyxrpOH7vZR0y/hAIhVkNvfWNYDlwy59L7qi8Fzr2Jmd9TC mh6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745019291; x=1745624091; 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=pL/k1vrzVyaptp0CA1uTfOuUgq4hVabAR2PrAEwjQkA=; b=G2Pwhdx+rO7Ttejc3v3rJVnyzvQ3R+VjmF5mfGaz/T1T4Amjp019C9jjbr5QUpquqI XQ5kzW5QcP9CP32n7ImYpGZozpuMW5g/Zs6HjHdH8uIj4f+T5zjQNKhxLfu1ktZzDsMK hGVSYfnV6NcBUkdG0pMx0V7fI6VDtG2kYt/pHfSnn0ucWsEno/iW9RMHdPxt3AOQ3LD/ c8ZNAaNk/UDYm+qvIpTbppzEpCaMp1MISuy2ELncIznRhlRWkTFz0Kj67M33nQi39ALy eNryeXW4I0eIhGABbiQWWyKChDDDzZALyZHSpZfH32eUHTfpP9hGoWpjVV+YS8q4TV17 eprw== X-Forwarded-Encrypted: i=1; AJvYcCUZvV9DpNiw/l9ObrX1DuHNJJeN9BPZjgnRszeK0T53ZPNlHadJC9O5FjUQGI3v+ueQUwpJQUeBZKx9@debbugs.gnu.org X-Gm-Message-State: AOJu0YwWUia/r6CbBLI5NND15p30yEqgm+iYBaV7p6uzB3mmcIM58mUZ EeEC3CjH+VA9FGHC5tGJrHvfl+pwhQpuXrDixY6bJ+c/rbn7QboR X-Gm-Gg: ASbGncsuZ/2cEEmZHAsOsJWo7L1Szd32paHdv8UcZ0QQ4r5fKdGVUof6rsM3MQgBZo0 awZ9MOIMCQRrq/Marc3xsmaOhBWszRCX2J4uJI/iVjmtEqsz1Cx1O7VvWu+02KYf1kl6EDkLz2e eAB2H5RBggvazyYX7FRm49hmj3nwPh0heTOpqeQJ8bxynDcQ64XkJkVocWVtJg6iTUi/BxrSSnS 6Dr8aAO+ipXqhNCCdn51HODoaYlrggg3RxeoTE/OEMFKpcwvckxvZsQgIo6flpkXl2AQBKGbGpK ckJQ8HJ+WihqorJ6aTPMDJr9Ps0VCfYKJ09xhYao8dH49yPPZjigrEVmjSZewNGtANFECMjNRg= = X-Google-Smtp-Source: AGHT+IEtzYTsUZ/taA1K2hYZ7LtN041FuoWhHot9qi2K9jhaN9ihardZf3jz1/MCPEJeLZ7PA7/lvw== X-Received: by 2002:a05:6a21:99a9:b0:1f5:8748:76cc with SMTP id adf61e73a8af0-203cbd0bd09mr6876320637.31.1745019291079; Fri, 18 Apr 2025 16:34:51 -0700 (PDT) Received: from smtpclient.apple ([2601:646:8f81:6120:fcfe:cddd:f55:38ad]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73dbfaac278sm2146972b3a.128.2025.04.18.16.34.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Apr 2025 16:34:50 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.400.131.1.6\)) Subject: Re: bug#77848: 31.0.50; treesit-update-ranges: offset setting is ignored for local parsers From: Yuan Fu In-Reply-To: Date: Fri, 18 Apr 2025 16:34:39 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <8734e78fwb.fsf@mail.linkov.net> To: Roman Rudakov X-Mailer: Apple Mail (2.3826.400.131.1.6) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77848-done Cc: 77848-done@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Apr 18, 2025, at 12:32=E2=80=AFAM, Roman Rudakov = wrote: >=20 > Yuan Fu writes: >=20 >>> On Apr 16, 2025, at 11:24=E2=80=AFPM, Juri Linkov = wrote: >>>=20 >>> Cc-ing Yuan for the help. >>>=20 >>>> Hello, I've noticed that when defining 'treesit-range-settings' = using the >>>> 'treesit-range-rules helper function, such as: >>>>=20 >>>> (treesit-range-rules >>>> :embed 'markdown-inline >>>> :host 'clojure >>>> :offset '(1 . -1) >>>> :local t >>>> (clojure-ts--docstring-query '@capture)) >>>>=20 >>>> The ':offset' setting doesn't have any effect. >>>>=20 >>>> After debugging the 'treesit-update-ranges' function, I noticed = that it >>>> calls 'treesit--update-range-1', which in turn calls >>>> 'treesit--update-ranges-local' if ':local t' is >>>> specified. 'treesit--update-ranges-local' does not accept offset as = an >>>> argument, although it is mentioned in its documentation string: >>>>=20 >>>>> OFFSET is a cons of start and end offsets that are applied to the = range >>>>> for the local parser. >>>>=20 >>>> This discrepancy between the documented behavior and the actual >>>> implementation of 'treesit--update-ranges-local' regarding the = offset >>>> argument might be a bug. >>=20 >> Yes, it=E2=80=99s indeed a bug. I=E2=80=99ve pushed a fix for it. = Thanks to you both! >>=20 >> Yuan >=20 > Thank you! >=20 > Would it be possible to also install the fix on emacs-30 branch? > -- > Best regards, Roman Ah right, thanks for the reminder. I thought this is a regression = brought by the recent embedded parser change. Indeed, the local parser = range function in Emacs 30 doesn=E2=80=99t handle offset either. I=E2=80=99= ve pushed a separate fix to emacs-30. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 19 16:00:06 2025 Received: (at 77848-done) by debbugs.gnu.org; 19 Apr 2025 20:00:07 +0000 Received: from localhost ([127.0.0.1]:38016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6EM6-00009L-6r for submit@debbugs.gnu.org; Sat, 19 Apr 2025 16:00:06 -0400 Received: from fhigh-a8-smtp.messagingengine.com ([103.168.172.159]:57545) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6EM0-00006r-Ke for 77848-done@debbugs.gnu.org; Sat, 19 Apr 2025 15:59:59 -0400 Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 14357114018E; Sat, 19 Apr 2025 15:59:51 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Sat, 19 Apr 2025 15:59:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1745092791; x=1745179191; bh=tYKlPkx9R3Q7mL4mZ+X3A0YL455zy9kXr52XbpPiKQE=; b= TwQrMa7/I1HITlFUsxU8E+mf4yd5QuuIM105nE/ZTGyp/4wzkbgt5z7fank2Yklm P7XazReQT/rBQHDDLB42upBFAKuTtS2ubvByJlKPJ0oTKexJLLW7dB0mGfuuhYRM /wrrHWh/melVWtdteUF1Fr3SzL6wHBt22b2InNjTF4lmY5ap9MHD/cNwrsqPC/CC hNCizNPPqpnYsI5zYm8oruZ9KykzatxsHBJbl2ZI2uMIPpsEsS5X87gq8ATtPm38 A5/HVz2Nx6nCdR0bvB5bBRtiSu4iFojcUC++wOJdpuPN1T8CjcYW5MQQ6E2EspUj pmD+os/qunpmSs1KM7vY8g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1745092791; x= 1745179191; bh=tYKlPkx9R3Q7mL4mZ+X3A0YL455zy9kXr52XbpPiKQE=; b=Z U74ds9o3pmMOuvamg67lq+0+8p1nUQHbpaq03KbKWWaDpP8lDwQI2LeIX+pLZ02H y3+lxmWOPDj+Jdq2OsqzLLRs15K78smmSlwT9maRV/evfJreap3klSgydESRr7sq 39NCCQejZyodK+BjiVUgaBKcJANKiSWVNcwpeGUo92VgQLCG5VyYsmSrTLXIkgOA aesT9wM4JIYDgO3pduweKT3roSlXNnMzjvUS7VVQQiOYYTOQs9aPv6msW74FCyVv n/s//p8DgO5L/cpDHtlSb2BZT4qH/6X7SEcyBQ0kkHGvtvyz6ZEXr6euXcn3RKsa YSNwrkvP9Bmnxdxqms8+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvfeehleegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephffvvefujghffgffkfggtgfgsehtqhertddt reejnecuhfhrohhmpeftohhmrghnucftuhgurghkohhvuceorhhruhgurghkohhvsehfrg hsthhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepleeiueduhfevleejveeuhfei tdehudffuefftdejveeliedtffekgeeujeegieeinecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomheprhhruhgurghkohhvsehfrghsthhmrghilhdr tghomhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epjeejkeegkedqughonhgvseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohep jhhurhhisehlihhnkhhovhdrnhgvthdprhgtphhtthhopegtrghsohhurhhisehgmhgrih hlrdgtohhm X-ME-Proxy: Feedback-ID: i1c714620:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 19 Apr 2025 15:59:49 -0400 (EDT) From: Roman Rudakov To: Yuan Fu Subject: Re: bug#77848: 31.0.50; treesit-update-ranges: offset setting is ignored for local parsers In-Reply-To: References: <8734e78fwb.fsf@mail.linkov.net> User-Agent: mu4e 1.12.9; emacs 31.0.50 Date: Sat, 19 Apr 2025 21:59:44 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 77848-done Cc: 77848-done@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Yuan Fu writes: >> On Apr 18, 2025, at 12:32=E2=80=AFAM, Roman Rudakov =20 >> wrote: >> >> Yuan Fu writes: >> >>>> On Apr 16, 2025, at 11:24=E2=80=AFPM, Juri Linkov =20 >>>> wrote: >>>> >>>> Cc-ing Yuan for the help. >>>> >>>>> Hello, I've noticed that when defining 'treesit-range-settings'=20 >>>>> using the >>>>> 'treesit-range-rules helper function, such as: >>>>> >>>>> (treesit-range-rules >>>>> :embed 'markdown-inline >>>>> :host 'clojure >>>>> :offset '(1 . -1) >>>>> :local t >>>>> (clojure-ts--docstring-query '@capture)) >>>>> >>>>> The ':offset' setting doesn't have any effect. >>>>> >>>>> After debugging the 'treesit-update-ranges' function, I noticed=20 >>>>> that it >>>>> calls 'treesit--update-range-1', which in turn calls >>>>> 'treesit--update-ranges-local' if ':local t' is >>>>> specified. 'treesit--update-ranges-local' does not accept offset=20 >>>>> as an >>>>> argument, although it is mentioned in its documentation string: >>>>> >>>>>> OFFSET is a cons of start and end offsets that are applied to=20 >>>>>> the range >>>>>> for the local parser. >>>>> >>>>> This discrepancy between the documented behavior and the actual >>>>> implementation of 'treesit--update-ranges-local' regarding the=20 >>>>> offset >>>>> argument might be a bug. >>> >>> Yes, it=E2=80=99s indeed a bug. I=E2=80=99ve pushed a fix for it. Thank= s to you=20 >>> both! >>> >>> Yuan >> >> Thank you! >> >> Would it be possible to also install the fix on emacs-30 branch? >> -- >> Best regards, Roman > > Ah right, thanks for the reminder. I thought this is a regression=20 > brought by the recent embedded parser change. Indeed, the local=20 > parser range function in Emacs 30 doesn=E2=80=99t handle offset either. I= =E2=80=99ve=20 > pushed a separate fix to emacs-30. > > Yuan Thank you! -- Best regards, Roman From unknown Sat Jun 14 18:57:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 May 2025 11:24:12 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator