Package: emacs;
Reported by: Brian Leung <leungbk <at> posteo.net>
Date: Tue, 6 Dec 2022 06:22:02 UTC
Severity: normal
Found in version 30.0.50
Fixed in version 29.1
Done: Yuan Fu <casouri <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 59853 in the body.
You can then email your comments to 59853 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Tue, 06 Dec 2022 06:22:02 GMT) Full text and rfc822 format available.Brian Leung <leungbk <at> posteo.net>
:bug-gnu-emacs <at> gnu.org
.
(Tue, 06 Dec 2022 06:22:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Brian Leung <leungbk <at> posteo.net> To: bug-gnu-emacs <at> gnu.org Subject: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Tue, 06 Dec 2022 06:21:18 +0000
Given the following Java file: public abstract class Class { public static interface Interface { void someMethod(); void [o]therMethod(); } } If point is at the "o" in otherMethod, pressing C-M-a in java-ts-mode moves point to the beginning of that line. However, in java-mode, point moves to the beginning of Interface's declaration. In the following Python file: def outer(): def inner(i): return i [r]eturn 42 If point is at the "r" in the outer return statement, pressing C-M-a in python-ts-mode moves point to the beginning of the line where the function "inner" is declared. However, in python-mode, point moves to the beginning of the line where "outer" is declared. This discrepancy in behavior makes it harder to use narrow-to-defun effectively. In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) Repository revision: c1a3e8830bb2fa8c3e8056bb42360f3504c434e9 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12014000 System Description: NixOS 23.05 (Stoat) Configured using: 'configure --prefix=/nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0 --disable-build-details --with-modules --with-x-toolkit=lucid --with-xft --with-cairo --with-native-compilation' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XPM LUCID ZLIB Important settings: value of $EMACSLOADPATH: value of $EMACSNATIVELOADPATH: /nix/store/b05qvhh9dgsx4ixhbj6r9j55w9qzywwy-emacs-packages-deps/share/emacs/native-lisp:: value of $LANG: en_US.UTF8 locale-coding-system: utf-8-unix Major mode: Py Minor modes in effect: pdf-occur-global-minor-mode: t eval-sexp-fu-flash-mode: t radian-universal-keyboard-quit-mode: t eglot--managed-mode: t flymake-mode: t highlight-indentation-mode: t global-git-commit-mode: t magit-auto-revert-mode: t emms-mode-line-mode: t emms-playing-time-display-mode: t emms-playing-time-mode: t bug-reference-prog-mode: t global-auto-revert-mode: t winner-mode: t desktop-environment-mode: t beginend-global-mode: t beginend-prog-mode: t editorconfig-mode: t marginalia-mode: t company-prescient-mode: t prescient-persist-mode: t global-company-mode: t company-mode: t nix-modeline-mode: t org-roam-db-autosync-mode: t mu4e-column-faces-mode: t hl-line-mode: t global-hl-todo-mode: t hl-todo-mode: t global-whitespace-cleanup-mode: t whitespace-cleanup-mode: t global-subword-mode: t subword-mode: t global-origami-mode: t origami-mode: t pdfgrep-mode: t global-git-gutter-mode: t git-gutter-mode: t evil-owl-mode: t global-evil-fringe-mark-mode: t global-evil-surround-mode: t evil-surround-mode: t global-evil-matchit-mode: t evil-matchit-mode: t evil-lion-mode: t evil-traces-mode: t global-evil-mc-mode: t evil-mc-mode: t evil-escape-mode: t evil-goggles-mode: t global-evil-collection-unimpaired-mode: t evil-collection-unimpaired-mode: t evil-mode: t evil-local-mode: t windmove-mode: t yas-global-mode: t yas-minor-mode: t global-page-break-lines-mode: t doom-modeline-mode: t display-time-mode: t npm-global-mode: t npm-mode: t repeat-mode: t envrc-global-mode: t envrc-mode: t goto-address-prog-mode: t dired-async-mode: t helm-adaptive-mode: t async-bytecomp-package-mode: t recentf-mode: t vertico-indexed-mode: t vertico-mode: t minibuffer-electric-default-mode: t eshell-vterm-mode: t eshell-syntax-highlighting-global-mode: t save-place-mode: t global-undo-fu-session-mode: t undo-fu-session-mode: t global-dash-fontify-mode: t shell-dirtrack-mode: t server-mode: t savehist-mode: t minibuffer-depth-indicate-mode: t el-patch-use-package-mode: t global-display-line-numbers-mode: t display-line-numbers-mode: t general-override-mode: t straight-use-package-mode: t straight-package-neutering-mode: t straight-live-modifications-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-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 abbrev-mode: t Load-path shadows: /home/brian/.config/emacs/straight/build/ivy/elpa hides /home/brian/.config/emacs/straight/build/lispy/elpa /home/brian/.config/emacs/straight/build/cmake-mode/cmake-mode hides /etc/profiles/per-user/brian/share/emacs/site-lisp/cmake-mode /home/brian/.config/emacs/straight/build/password-store/password-store hides /etc/profiles/per-user/brian/share/emacs/site-lisp/password-store /home/brian/.config/emacs/straight/build/lv/lv hides /home/brian/.config/emacs/elpa/lv-20200507.1518/lv /home/brian/.config/emacs/straight/build/lv/lv-autoloads hides /home/brian/.config/emacs/elpa/lv-20200507.1518/lv-autoloads /home/brian/.config/emacs/straight/build/spinner/spinner-autoloads hides /home/brian/.config/emacs/elpa/spinner-1.7.3/spinner-autoloads /home/brian/.config/emacs/straight/build/spinner/spinner hides /home/brian/.config/emacs/elpa/spinner-1.7.3/spinner /home/brian/.config/emacs/straight/build/package-lint/package-lint hides /home/brian/.config/emacs/elpa/package-lint-20200616.2257/package-lint /home/brian/.config/emacs/straight/build/package-lint/package-lint-autoloads hides /home/brian/.config/emacs/elpa/package-lint-20200616.2257/package-lint-autoloads /home/brian/.config/emacs/straight/build/company/company-capf hides /home/brian/.config/emacs/elpa/company-0.9.13/company-capf /home/brian/.config/emacs/straight/build/company/company-yasnippet hides /home/brian/.config/emacs/elpa/company-0.9.13/company-yasnippet /home/brian/.config/emacs/straight/build/company/company-elisp hides /home/brian/.config/emacs/elpa/company-0.9.13/company-elisp /home/brian/.config/emacs/straight/build/company/company-tng hides /home/brian/.config/emacs/elpa/company-0.9.13/company-tng /home/brian/.config/emacs/straight/build/company/company-semantic hides /home/brian/.config/emacs/elpa/company-0.9.13/company-semantic /home/brian/.config/emacs/straight/build/company/company-dabbrev-code hides /home/brian/.config/emacs/elpa/company-0.9.13/company-dabbrev-code /home/brian/.config/emacs/straight/build/company/company-clang hides /home/brian/.config/emacs/elpa/company-0.9.13/company-clang /home/brian/.config/emacs/straight/build/company/company-css hides /home/brian/.config/emacs/elpa/company-0.9.13/company-css /home/brian/.config/emacs/straight/build/company/company-dabbrev hides /home/brian/.config/emacs/elpa/company-0.9.13/company-dabbrev /home/brian/.config/emacs/straight/build/company/company-keywords hides /home/brian/.config/emacs/elpa/company-0.9.13/company-keywords /home/brian/.config/emacs/straight/build/company/company-oddmuse hides /home/brian/.config/emacs/elpa/company-0.9.13/company-oddmuse /home/brian/.config/emacs/straight/build/company/company-tempo hides /home/brian/.config/emacs/elpa/company-0.9.13/company-tempo /home/brian/.config/emacs/straight/build/company/company-cmake hides /home/brian/.config/emacs/elpa/company-0.9.13/company-cmake /home/brian/.config/emacs/straight/build/company/company hides /home/brian/.config/emacs/elpa/company-0.9.13/company /home/brian/.config/emacs/straight/build/company/company-abbrev hides /home/brian/.config/emacs/elpa/company-0.9.13/company-abbrev /home/brian/.config/emacs/straight/build/company/company-ispell hides /home/brian/.config/emacs/elpa/company-0.9.13/company-ispell /home/brian/.config/emacs/straight/build/company/company-nxml hides /home/brian/.config/emacs/elpa/company-0.9.13/company-nxml /home/brian/.config/emacs/straight/build/company/company-etags hides /home/brian/.config/emacs/elpa/company-0.9.13/company-etags /home/brian/.config/emacs/straight/build/company/company-template hides /home/brian/.config/emacs/elpa/company-0.9.13/company-template /home/brian/.config/emacs/straight/build/company/company-files hides /home/brian/.config/emacs/elpa/company-0.9.13/company-files /home/brian/.config/emacs/straight/build/company/company-bbdb hides /home/brian/.config/emacs/elpa/company-0.9.13/company-bbdb /home/brian/.config/emacs/straight/build/company/company-gtags hides /home/brian/.config/emacs/elpa/company-0.9.13/company-gtags /home/brian/.config/emacs/straight/build/company/company-autoloads hides /home/brian/.config/emacs/elpa/company-0.9.13/company-autoloads /home/brian/.config/emacs/straight/build/markdown-mode/markdown-mode hides /home/brian/.config/emacs/elpa/markdown-mode-20200804.538/markdown-mode /home/brian/.config/emacs/straight/build/markdown-mode/markdown-mode-autoloads hides /home/brian/.config/emacs/elpa/markdown-mode-20200804.538/markdown-mode-autoloads /home/brian/.config/emacs/straight/build/yasnippet/yasnippet hides /home/brian/.config/emacs/elpa/yasnippet-0.14.0/yasnippet /home/brian/.config/emacs/straight/build/yasnippet/yasnippet-autoloads hides /home/brian/.config/emacs/elpa/yasnippet-0.14.0/yasnippet-autoloads /home/brian/.config/emacs/straight/build/project/project-autoloads hides /home/brian/.config/emacs/elpa/project-0.8.1/project-autoloads /home/brian/.config/emacs/straight/build/project/project hides /home/brian/.config/emacs/elpa/project-0.8.1/project /home/brian/.config/emacs/straight/build/xref/xref hides /home/brian/.config/emacs/elpa/xref-1.3.2/xref /home/brian/.config/emacs/straight/build/xref/xref-autoloads hides /home/brian/.config/emacs/elpa/xref-1.3.2/xref-autoloads /home/brian/.config/emacs/straight/build/vterm/vterm-autoloads hides /nix/store/b05qvhh9dgsx4ixhbj6r9j55w9qzywwy-emacs-packages-deps/share/emacs/site-lisp/elpa/vterm-20221118.1354/vterm-autoloads /home/brian/.config/emacs/straight/build/vterm/vterm hides /nix/store/b05qvhh9dgsx4ixhbj6r9j55w9qzywwy-emacs-packages-deps/share/emacs/site-lisp/elpa/vterm-20221118.1354/vterm /etc/profiles/per-user/brian/share/emacs/site-lisp/site-start hides /nix/store/b05qvhh9dgsx4ixhbj6r9j55w9qzywwy-emacs-packages-deps/share/emacs/site-lisp/site-start /etc/profiles/per-user/brian/share/emacs/site-lisp/site-start hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/site-lisp/site-start /home/brian/.config/emacs/straight/build/transient/transient hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/transient /home/brian/.config/emacs/elpa/jsonrpc-1.0.14/jsonrpc hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/jsonrpc /home/brian/.config/emacs/straight/build/xref/xref hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/progmodes/xref /home/brian/.config/emacs/elpa/flymake-1.2.1/flymake hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/progmodes/flymake /home/brian/.config/emacs/straight/build/project/project hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/progmodes/project /home/brian/.config/emacs/straight/build/soap-client/soap-client hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/net/soap-client /home/brian/.config/emacs/straight/build/soap-client/soap-inspect hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/net/soap-inspect /home/brian/.config/emacs/straight/build/map/map hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/emacs-lisp/map /home/brian/.config/emacs/elpa/eldoc-1.11.0/eldoc hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/emacs-lisp/eldoc /home/brian/.config/emacs/straight/build/let-alist/let-alist hides /nix/store/6fdp3wvxfdgrq2bd2p4a4ph3s6vyjsm9-emacs-git-20221205.0/share/emacs/30.0.50/lisp/emacs-lisp/let-alist Features: (shadow emacsbug consult-yasnippet gitignore-mode conf-mode pcmpl-git evil-nerd-commenter evil-nerd-commenter-operator evil-nerd-commenter-sdk sgml-mode java-ts-mode auto-yasnippet pdf-view-restore pdf-loader pdf-virtual pdf-sync pdf-outline pdf-occur ibuf-ext ibuffer ibuffer-loaddefs pdf-links pdf-isearch pdf-history pdf-dev pdf-annot evil-collection-tablist tablist tablist-filter semantic/wisent/comp semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util semantic semantic/tag cedet facemenu pdf-misc pdf-tools pdf-view pdf-cache pdf-info pdf-util pdf-macs tabify cl-print json-ts-mode misearch multi-isearch deadgrep spinner qp evil-collection-sh-script sh-script evil-collection-view view magit-patch magit-subtree magit-gitignore goto-chg evil-collection-eval-sexp-fu eval-sexp-fu executable evil-matchit-simple evil-matchit-prog c-ts-mode evil-collection-helpful elisp-demos helpful cc-langs trace info-look evil-collection-elisp-refs elisp-refs evil-collection-eglot eglot array jsonrpc evil-collection-ert ert ewoc evil-collection-flymake flymake-proc flymake highlight-indentation nix-mode smie nix-shell nix-store nix-log nix-instantiate nix-shebang nix-format pandoc-mode pandoc-mode-utils em-smart em-tramp em-script em-prompt em-glob em-basic eshell-toggle jka-compr crux multi-vterm evil-collection-magit orgit evil-collection-forge 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 forge-notify forge-revnote forge-pullreq forge-issue forge-topic yaml forge-post evil-collection-markdown-mode markdown-preview-mode web-server web-server-status-codes websocket evil-markdown markdown-mode forge-repo forge forge-core forge-db closql magit-tbdiff magit-extras vdiff-magit magit-ediff evil-collection-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util magit-bookmark magit-submodule magit-obsolete 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 git-commit log-edit pcvs-util add-log magit-core magit-autorevert magit-margin magit-transient magit-process magit-mode magit-git magit-base crm gnus-cite smiley shr-color mm-archive mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check tramp-cmds evil-collection-emms emms-librefm-stream emms-librefm-scrobbler emms-playlist-limit emms-i18n emms-history emms-score emms-stream-info emms-metaplaylist-mode emms-bookmarks emms-cue emms-mode-line-icon emms-browser sort emms-volume emms-volume-sndioctl emms-volume-mixerctl emms-volume-pulse emms-volume-amixer emms-playlist-sort emms-last-played emms-player-xine emms-player-mpd tq emms-lyrics emms-url emms-streams emms-show-all emms-tag-editor emms-tag-tracktag emms-mark emms-mode-line emms-cache emms-info-native bindat emms-info-exiftool emms-info-tinytag emms-info-metaflac emms-info-opusinfo emms-info-ogginfo emms-info-mp3info emms-playlist-mode emms-player-vlc emms-player-mpv emms-playing-time emms-info emms-later-do emms-player-mplayer emms-player-simple emms-source-playlist emms-source-file locate emms-setup emms emms-compat helm-exwm vertico-directory citre citre-global citre-tags citre-ctags citre-readtags citre-readtags-tables citre-backend-interface citre-ui-peek citre-ui-jump citre-common-tag citre-common-util cursor-sensor tramp-archive tramp-gvfs helm-linux-disks linux-disk company-elisp evil-collection-flycheck flycheck-guile flycheck bug-reference pinentry autorevert winner desktop-environment evil-collection-beginend beginend editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch marginalia company-keywords company-dabbrev-code company-dabbrev company-files company-capf company-restclient know-your-http-well http-status-codes http-relations http-methods http-headers company-prescient prescient char-fold company nix-modeline evil-collection-org-roam org-roam-migrate org-roam-log org-roam-mode org-roam-capture org-roam-id org-roam-node org-roam-db org-roam-utils org-roam-compat org-roam org-capture org-attach evil-collection-magit-section magit-section compat-27 compat-26 org-rich-yank mu4e-alert ht alert log4e notifications gntp evil-collection-mu4e mu4e-column-faces mu4e mu4e-org mu4e-main mu4e-view gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls 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 evil-collection-gnus gnus nnheader range mu4e-headers mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message shr pixel-fill kinsoku url-file svg xml dom flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-server mu4e-context mu4e-vars mu4e-helpers mu4e-config message sendmail yank-media puny rfc822 mml mml-sec evil-collection-epa epa epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader hl-todo whitespace-cleanup-mode whitespace cap-words superword subword origami origami-parsers cl pdfgrep evil-collection-wgrep wgrep grep git-gutter yasnippet lispyville evil-owl evil-fringe-mark evil-fringe-mark-overlays fringe-helper evil-visual-replace evil-surround evil-matchit evil-matchit-evil-setup evil-matchit-sdk semantic/lex semantic/fw evil-lion evil-textobj-syntax evil-indent-plus evil-replace-with-register evil-traces evil-args evil-exchange evil-collection-evil-mc evil-mc evil-mc-command-execute evil-mc-command-record evil-mc-cursor-make evil-mc-region evil-mc-cursor-state evil-mc-undo evil-mc-vars evil-mc-known-commands evil-mc-common evil-escape evil-mark-replace evil-goggles pulse evil-collection-unimpaired evil-collection-xref evil-collection-vterm evil-collection-vertico evil-collection-vdiff evil-collection-vc-git evil-collection-term evil-collection-tabulated-list evil-collection-shortdoc evil-collection-restclient evil-collection-python evil-collection-pass evil-collection-org evil-collection-man evil-collection-help evil-collection-helm evil-collection-git-timemachine evil-collection-elisp-mode evil-collection-eldoc evil-collection-edebug evil-collection-embark evil-collection-debug evil-collection-consult evil-collection-compile evil-collection-comint calc-ext evil-collection-calc evil-collection annalist evil-string-inflection string-inflection evil evil-integration evil-maps evil-commands reveal flyspell ispell evil-jumps evil-command-window evil-search evil-ex evil-types evil-macros evil-repeat evil-states evil-core evil-common windmove calc calc-loaddefs calc-macs rect evil-digraphs evil-vars page-break-lines doom-modeline doom-modeline-segments doom-modeline-env doom-modeline-core all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons shrink-path doom-modeline-autoloads shrink-path-autoloads doom-themes-ext-org doom-themes-ext-treemacs doom-themes-ext-visual-bell doom-one-light-theme time doom-themes doom-themes-base doom-themes-autoloads bundler-autoloads rspec-mode-autoloads robe-autoloads inf-ruby-autoloads go-mode-autoloads clojure-mode-autoloads utop-autoloads dune-autoloads tuareg-autoloads caml-autoloads z3-mode-autoloads haskell-mode-autoloads bison-mode-autoloads lua-mode-autoloads scribble-mode-autoloads racket-mode-autoloads macrostep-geiser-autoloads flycheck-guile-autoloads geiser-racket-autoloads geiser-mit-autoloads geiser-guile-autoloads geiser-autoloads ess-autoloads jupyter-autoloads zmq-autoloads simple-httpd-autoloads highlight-indentation-autoloads pip-requirements-autoloads elixir-autoloads company-restclient-autoloads know-your-http-well-autoloads php-mode-autoloads jq-mode-autoloads json-snatcher-autoloads nodejs-repl-autoloads npm-mode npm-mode-autoloads dotenv-mode-autoloads ts-comint-autoloads emmet-mode-autoloads zig-mode-autoloads nasm-mode-autoloads x86-lookup-autoloads cmake-font-lock-autoloads cmake-mode-autoloads rustic-autoloads xterm-color-autoloads rust-mode-autoloads repl-toggle fullframe repl-toggle-autoloads fullframe-autoloads make-it-so make-mode make-it-so-autoloads sx-autoloads gif-screencast-autoloads elfeed-org-autoloads elfeed-autoloads hackernews-autoloads company-reftex-autoloads evil-tex-autoloads company-auctex-autoloads auctex-autoloads tex-site unfill-autoloads symbol-overlay symbol-overlay-autoloads rainbow-delimiters rainbow-delimiters-autoloads page-break-lines-autoloads auto-yasnippet-autoloads consult-yasnippet-autoloads yasnippet-autoloads csv-mode-autoloads prodigy-autoloads erc-hl-nicks-autoloads flyspell-correct-autoloads edbi-autoloads epc-autoloads ctable-autoloads concurrent-autoloads sql-indent-autoloads emms-autoloads dockerfile-mode-autoloads docker-compose-mode-autoloads yaml-mode-autoloads docker-autoloads aio-autoloads browse-at-remote-autoloads git-modes-autoloads orgit-forge-autoloads orgit-autoloads magit-imerge-autoloads code-review-autoloads emojify-autoloads deferred-autoloads uuidgen-autoloads a-autoloads forge-autoloads yaml-autoloads ghub-autoloads treepy-autoloads closql-autoloads emacsql-sqlite emacsql emacsql-compiler git-timemachine transient vc-git git-timemachine-autoloads git-link-autoloads git-gutter-autoloads gitpatch-autoloads magit-tbdiff-autoloads pdfgrep-autoloads pdf-view-restore-autoloads pdf-tools-autoloads tablist-autoloads nov-autoloads esxml-autoloads kv-autoloads vimrc-mode-autoloads macrostep-autoloads el-mock-autoloads ert-runner-autoloads shut-up-autoloads ansi-autoloads commander-autoloads elisp-demos-autoloads helpful-autoloads elisp-refs-autoloads eval-sexp-fu-autoloads highlight-stages-autoloads lispyville-autoloads lispy lispy-inline avy etags fileloop help-fns lispy-tags mode-local zoutline lispy-autoloads zoutline-autoloads swiper-autoloads ivy-autoloads lisp-extra-font-lock lisp-extra-font-lock-autoloads origami-autoloads repeat link-hint-autoloads all-the-icons-autoloads treemacs-icons-dired-autoloads treemacs-magit-autoloads treemacs-evil-autoloads treemacs-perspective-autoloads treemacs-autoloads cfrs-autoloads pfuture-autoloads ace-window-autoloads avy-autoloads harpoon-autoloads nswbuff-autoloads perspective-autoloads sesman-autoloads skeletor-autoloads envrc inheritenv envrc-autoloads inheritenv-autoloads crux-autoloads whitespace-cleanup-mode-autoloads apheleia apheleia-autoloads hl-todo-autoloads debpaste-autoloads xml-rpc-autoloads mu4e-column-faces-autoloads mu4e-alert-autoloads mbsync-autoloads w3m-load w3m-autoloads gnuplot-autoloads zotero-autoloads oauth-autoloads pandoc-mode-autoloads markdown-preview-mode-autoloads web-server-autoloads websocket-autoloads evil-markdown-autoloads markdown-mode-autoloads adoc-mode-autoloads markup-faces-autoloads deft deft-autoloads org-download-autoloads org-pomodoro-autoloads alert-autoloads log4e-autoloads gntp-autoloads org-fancy-priorities-autoloads org-modern-autoloads org-recur-autoloads org-sidebar-autoloads org-ql-autoloads peg-autoloads ov-autoloads org-super-agenda-autoloads ts-autoloads ht-autoloads org-rich-yank-autoloads ob-sql ob-shell ob-scheme ob-ruby ob-restclient restclient ob-python python treesit ob-org ob-ocaml ob-haskell ob-js ob-gnuplot ob-eshell ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs consult-org org-indent embark-org org-element org-persist org-id org-refile avl-tree 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 noutline outline 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 ob-restclient-autoloads restclient-autoloads evil-org-autoloads goto-addr loaddefs-gen lisp-mnt radix-tree org-appear-autoloads org-roam-autoloads emacsql-sqlite-autoloads emacsql-autoloads org-pandoc-import-autoloads org-tree-slide-autoloads org-contrib-autoloads wgrep-autoloads deadgrep-autoloads spinner-autoloads ssh-config-mode-autoloads helm-wikipedia-autoloads helm-linux-disks-autoloads helm-comint helm-elisp helm-files image-dired image-dired-tags image-dired-external image-dired-util xdg image-mode dired-open dired-filter dired-narrow delsel dired-subtree dired-ranger dired-hacks-utils dired-rsync dired-async dired-aux dired-x dired dired-loaddefs exif filenotify helm-buffers helm-occur helm-tags helm-locate helm-grep helm-regexp helm-eval edebug debug backtrace helm-info helm-utils helm-types helm-help helm-adaptive helm helm-global-bindings helm-easymenu edmacro helm-core async-bytecomp helm-source helm-multi-match helm-lib async helm-config nix-update-autoloads nix-modeline-autoloads helm-nixos-options-autoloads nixos-options-autoloads nix-repl nix nix-mode-autoloads cape-autoloads corfu-autoloads consult-dash-autoloads dash-docs-autoloads citre-autoloads relint-autoloads ample-regexps-autoloads xr-autoloads run-command-autoloads consult-git-log-grep-autoloads consult-ls-git vc vc-dispatcher consult-ls-git-autoloads consult-dir-autoloads consult-recoll-autoloads consult-flycheck-autoloads flycheck-autoloads pkg-info-autoloads epl-autoloads consult-imenu consult-xref xref project embark-consult consult-vertico consult compat-28 recentf tree-widget marginalia-autoloads orderless orderless-autoloads vertico-repeat vertico-indexed vertico vertico-autoloads company-prescient-autoloads company-autoloads prescient-autoloads embark-consult-autoloads consult-autoloads embark ffap thingatpt embark-autoloads minibuf-eldef exec-path-from-shell exec-path-from-shell-autoloads editorconfig-autoloads posframe-autoloads evil-owl-autoloads evil-fringe-mark-autoloads fringe-helper-autoloads evil-visual-replace-autoloads evil-visualstar-autoloads evil-surround-autoloads evil-nerd-commenter-autoloads evil-expat-autoloads evil-matchit-autoloads evil-lion-autoloads evil-textobj-syntax-autoloads names-autoloads evil-indent-plus-autoloads evil-replace-with-register-autoloads evil-traces-autoloads evil-args-autoloads evil-exchange-autoloads evil-numbers-autoloads evil-multiedit-autoloads iedit-autoloads evil-mc-autoloads evil-escape-autoloads evil-mark-replace-autoloads evil-goggles-autoloads evil-collection-autoloads annalist-autoloads evil-string-inflection-autoloads string-inflection-autoloads evil-autoloads goto-chg-autoloads pcase beginend-autoloads desktop-environment-autoloads daemons-autoloads burly-autoloads map-autoloads windower-autoloads popper-autoloads shackle-autoloads exwm-edit exwm-edit-autoloads helm-exwm-autoloads helm-autoloads popup-autoloads helm-core-autoloads exwm-config ido exwm-randr xcb-randr exwm-systemtray xcb-systemtray xcb-xembed exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types xcb-debug kmacro exwm-autoloads xelb-autoloads bluetooth-autoloads debbugs-autoloads soap-client-autoloads vdiff-magit-autoloads magit-autoloads magit-section-autoloads git-commit-autoloads transient-autoloads vdiff smerge-mode diff two-column hydra advice lv diff-mode vdiff-autoloads hydra-autoloads lv-autoloads dired-open-autoloads dired-filter-autoloads dired-narrow-autoloads dired-subtree-autoloads dired-ranger-autoloads dired-hacks-utils-autoloads dired-rsync-autoloads async-autoloads fd-dired-autoloads dired-toggle-sudo-autoloads detached-autoloads eshell-toggle-autoloads eshell-autojump eshell-autojump-autoloads eshell-up eshell-up-autoloads eshell-prompt-extras eshell-prompt-extras-autoloads eshell-vterm easy-mmode vterm bookmark tramp tramp-loaddefs trampver tramp-integration tramp-compat parse-time iso8601 time-date ls-lisp format-spec face-remap compile color find-func vterm-module term/xterm xterm eshell-vterm-autoloads eshell-syntax-highlighting em-alias eshell-syntax-highlighting-autoloads esh-help man em-unix esh-help-autoloads em-hist em-pred em-ls em-cmpl em-dirs esh-var esh-mode em-term term disp-table ehelp eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util cus-edit pp cus-load wid-edit files-x multi-vterm-autoloads project-autoloads xref-autoloads saveplace vundo-autoloads undo-fu-session undo-fu-session-autoloads pinentry-autoloads pass f f-shortdoc shortdoc text-property-search dash s imenu pass-autoloads f-autoloads dash-autoloads password-store-otp-autoloads password-store with-editor comp comp-cstr warnings icons rx shell pcomplete comint ansi-osc ansi-color ring server password-store-autoloads with-editor-autoloads s-autoloads auth-source-pass init-misc-settings savehist mb-depth package-lint-autoloads let-alist-autoloads el-patch-autoloads el-patch el-patch-stub display-line-numbers compdef derived compdef-autoloads blackout blackout-autoloads general general-autoloads inline no-littering compat compat-macs no-littering-autoloads compat-autoloads use-package-ensure use-package-core use-package-autoloads info bind-key-autoloads straight-autoloads cl-extra help-mode straight finder-inf vterm-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 subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-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 x-toolkit x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 2304499 2810090) (symbols 48 88758 125) (strings 32 481399 671863) (string-bytes 1 20562054) (vectors 16 306884) (vector-slots 8 5696951 4972697) (floats 8 3600 21931) (intervals 56 87390 59863) (buffers 992 169))
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Tue, 06 Dec 2022 08:32:02 GMT) Full text and rfc822 format available.Message #8 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Theodor Thornhill <theo <at> thornhill.no> To: Brian Leung <leungbk <at> posteo.net> Cc: 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Tue, 06 Dec 2022 09:31:38 +0100
Hi Brian and thanks for the report! Brian Leung <leungbk <at> posteo.net> writes: > Given the following Java file: > > public abstract class Class { > public static interface Interface { > void someMethod(); > > void [o]therMethod(); > } > } > > If point is at the "o" in otherMethod, pressing C-M-a in java-ts-mode > moves point to the beginning of that line. However, in java-mode, point > moves to the beginning of Interface's declaration. > I see. To me this looks like java-ts-mode is "correct", in that the next step "outwards" is to the method start itself. The point is in fact inside the method still, IIUC. > In the following Python file: > > def outer(): > def inner(i): > return i > > [r]eturn 42 > > If point is at the "r" in the outer return statement, pressing C-M-a in > python-ts-mode moves point to the beginning of the line where the > function "inner" is declared. However, in python-mode, point moves to > the beginning of the line where "outer" is declared. > In this case I think python-mode is correct, becase the 'inner' function is a sibling to the return statement, and it would make sense to go directly to outer. > This discrepancy in behavior makes it harder to use narrow-to-defun effectively. > Yeah, I understand. Do you agree on my points above? I just want to make the problem clear to me :-) Theo
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Tue, 06 Dec 2022 09:12:01 GMT) Full text and rfc822 format available.Message #11 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Brian Leung <leungbk <at> posteo.net> To: Theodor Thornhill <theo <at> thornhill.no> Cc: 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Tue, 06 Dec 2022 08:41:40 +0000
Thanks for your response! Theodor Thornhill <theo <at> thornhill.no> writes: >> public abstract class Class { >> public static interface Interface { >> void someMethod(); >> >> void [o]therMethod(); >> } >> } >> >> If point is at the "o" in otherMethod, pressing C-M-a in >> java-ts-mode >> moves point to the beginning of that line. However, in >> java-mode, point >> moves to the beginning of Interface's declaration. >> > > I see. To me this looks like java-ts-mode is "correct", in that > the > next step "outwards" is to the method start itself. The point > is in > fact inside the method still, IIUC. I don't actually know Java, so my expectations/intuition for what is "right" may be off. But from what I've read about, interfaces should be used to group methods with empty bodies. Body-less forms don't particularly feel like defuns to me, which is why I bring this up. Additionally, interactively using narrow-to-defun in java-ts-mode when point is inside the interface body produces unusual results: > public abstract class Class { > public static interface Interface { > void someMethod(); > * * > void otherMethod(); > *}* > } If you narrow-to-defun with point inside the interface body and not touching either brace (such as between the two methods), you won't be able to capture the entire interface, and instead get just a single-line method. Meanwhile, if point touches the right brace, then narrow-to-defun yields > void otherMethod(); > } > } when capturing the entire interface might make more sense. >> def outer(): >> def inner(i): >> return i >> >> [r]eturn 42 >> >> If point is at the "r" in the outer return statement, pressing >> C-M-a in >> python-ts-mode moves point to the beginning of the line where >> the >> function "inner" is declared. However, in python-mode, point >> moves to >> the beginning of the line where "outer" is declared. >> > > In this case I think python-mode is correct, becase the 'inner' > function > is a sibling to the return statement, and it would make sense to > go > directly to outer. Yeah, I agree here.
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Tue, 06 Dec 2022 10:37:01 GMT) Full text and rfc822 format available.Message #14 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Theodor Thornhill <theo <at> thornhill.no> To: Brian Leung <leungbk <at> posteo.net> Cc: casouri <at> gmail.com, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Tue, 06 Dec 2022 11:36:31 +0100
Brian Leung <leungbk <at> posteo.net> writes: > Thanks for your response! > > Theodor Thornhill <theo <at> thornhill.no> writes: > >>> public abstract class Class { >>> public static interface Interface { >>> void someMethod(); >>> >>> void [o]therMethod(); >>> } >>> } >>> >>> If point is at the "o" in otherMethod, pressing C-M-a in >>> java-ts-mode >>> moves point to the beginning of that line. However, in >>> java-mode, point >>> moves to the beginning of Interface's declaration. >>> >> >> I see. To me this looks like java-ts-mode is "correct", in that >> the >> next step "outwards" is to the method start itself. The point >> is in >> fact inside the method still, IIUC. > > I don't actually know Java, so my expectations/intuition for what > is "right" may be off. But from what I've read about, interfaces > should be used to group methods with empty bodies. Body-less forms > don't particularly feel like defuns to me, which is why I bring > this up. Additionally, interactively using narrow-to-defun in > java-ts-mode when point is inside the interface body produces > unusual results: > >> public abstract class Class { >> public static interface Interface { >> void someMethod(); >> * * >> void otherMethod(); >> *}* >> } Not sure I can reproduce this. I made two files: ``` package Foo; import some.thing; interface Foo { void foo(); } ```` ``` package Foo; import some.thing; public abstract class Fooo { public static interface Foo { void foo(); } } ``` In the first one, when point is on the 'f' of 'foo()' I get narrowed to that line. If I'm at column 0 of the same line, I see the whole interface, but not the package declaration or import statement. That seems correct to me. Also I see similar results on the other file. What am I missing? >>> def outer(): >>> def inner(i): >>> return i >>> >>> [r]eturn 42 >>> >>> If point is at the "r" in the outer return statement, pressing >>> C-M-a in >>> python-ts-mode moves point to the beginning of the line where >>> the >>> function "inner" is declared. However, in python-mode, point >>> moves to >>> the beginning of the line where "outer" is declared. >>> >> >> In this case I think python-mode is correct, becase the 'inner' >> function >> is a sibling to the return statement, and it would make sense to >> go >> directly to outer. > > Yeah, I agree here. Great! This sounds like a different bug report though. Theo
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Wed, 07 Dec 2022 10:13:01 GMT) Full text and rfc822 format available.Message #17 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Brian Leung <leungbk <at> posteo.net> To: Theodor Thornhill <theo <at> thornhill.no> Cc: casouri <at> gmail.com, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Wed, 07 Dec 2022 09:51:35 +0000
Theodor Thornhill <theo <at> thornhill.no> writes: > Not sure I can reproduce this. Sorry, I made a mistake in my description. I additionally noticed additional odd results in java-ts-mode. Let me try again: > p[u]blic abstract class Class { > public static interface Interface { > void someMethod(); > [*] > void otherMethod(); > [}] > } 1. When point is at the "u" in "public", narrow-to-defun cuts off "pu" and moves point to "b". 2. When point is anywhere in the first line of the class declaration, mark-defun highlights "void otherMethod()", instead of the entire class declaration. 3a. When point is at the [*] in between someMethod and otherMethod, narrow-to-defun captures "void otherMethod()". I feel that since the methods inside the interface declaration have no bodies, it makes more sense to capture the entire interface definition if point is at [*]. 3b. Arguably, even if point were on the method declarations, we might still want to (as plain java-mode does) capture the entire interface definition, since body-less method declarations don't feel especially defun-like. 4. When point is on the closing bracket of the interface definition, narrow-to-defun captures > void otherMethod(); > } > } which looks quite unusual to me.
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Wed, 07 Dec 2022 11:34:01 GMT) Full text and rfc822 format available.Message #20 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Theodor Thornhill <theo <at> thornhill.no> To: Brian Leung <leungbk <at> posteo.net> Cc: casouri <at> gmail.com, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Wed, 07 Dec 2022 12:33:32 +0100
[Message part 1 (text/plain, inline)]
Brian Leung <leungbk <at> posteo.net> writes: > Theodor Thornhill <theo <at> thornhill.no> writes: > >> Not sure I can reproduce this. > > Sorry, I made a mistake in my description. I additionally noticed > additional odd results in java-ts-mode. Let me try again: > >> p[u]blic abstract class Class { >> public static interface Interface { >> void someMethod(); >> [*] >> void otherMethod(); >> [}] >> } Right - thanks! Now I understand what you describe. I'll try to answer them case by case. > > 1. When point is at the "u" in "public", narrow-to-defun cuts off > "pu" and moves point to "b". Yes, this definitely looks like a bug. This is probably because the whole 'public' keyword maps to the declaration, and we don't move to the actual beginning. I can look into this. > 2. When point is anywhere in the first line of the class > declaration, mark-defun highlights "void otherMethod()", instead > of the entire class declaration. Yeah, I think I've fixed this in a patch I just submitted. > 3a. When point is at the [*] in between someMethod and > otherMethod, narrow-to-defun captures "void otherMethod()". I feel > that since the methods inside the interface declaration have no > bodies, it makes more sense to capture the entire interface > definition if point is at [*]. Maybe, but I don't believe this is wrong either. > 3b. Arguably, even if point were on the method declarations, we > might still want to (as plain java-mode does) capture the entire > interface definition, since body-less method declarations don't > feel especially defun-like. Maybe. Can you try applying the below patch and see if this changes anything for you? > 4. When point is on the closing bracket of the interface > definition, narrow-to-defun captures > >> void otherMethod(); >> } >> } > > which looks quite unusual to me. Yes, I agree with this one. My guess is that this is the same as number one. What do you think? Theo
[0001-Make-more-granular-defun-type-regexp.patch (text/x-diff, attachment)]
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Wed, 07 Dec 2022 19:35:02 GMT) Full text and rfc822 format available.Message #23 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Yuan Fu <casouri <at> gmail.com> To: Theodor Thornhill <theo <at> thornhill.no> Cc: Brian Leung <leungbk <at> posteo.net>, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Wed, 7 Dec 2022 11:34:05 -0800
Theodor Thornhill <theo <at> thornhill.no> writes: > Brian Leung <leungbk <at> posteo.net> writes: > >> Theodor Thornhill <theo <at> thornhill.no> writes: >> >>> Not sure I can reproduce this. >> >> Sorry, I made a mistake in my description. I additionally noticed >> additional odd results in java-ts-mode. Let me try again: >> >>> p[u]blic abstract class Class { >>> public static interface Interface { >>> void someMethod(); >>> [*] >>> void otherMethod(); >>> [}] >>> } > > Right - thanks! Now I understand what you describe. I'll try to answer > them case by case. > >> >> 1. When point is at the "u" in "public", narrow-to-defun cuts off >> "pu" and moves point to "b". > > Yes, this definitely looks like a bug. This is probably because the > whole 'public' keyword maps to the declaration, and we don't move to the > actual beginning. I can look into this. > >> 2. When point is anywhere in the first line of the class >> declaration, mark-defun highlights "void otherMethod()", instead >> of the entire class declaration. > > Yeah, I think I've fixed this in a patch I just submitted. > >> 3a. When point is at the [*] in between someMethod and >> otherMethod, narrow-to-defun captures "void otherMethod()". I feel >> that since the methods inside the interface declaration have no >> bodies, it makes more sense to capture the entire interface >> definition if point is at [*]. > > Maybe, but I don't believe this is wrong either. > >> 3b. Arguably, even if point were on the method declarations, we >> might still want to (as plain java-mode does) capture the entire >> interface definition, since body-less method declarations don't >> feel especially defun-like. > > Maybe. Can you try applying the below patch and see if this changes > anything for you? > >> 4. When point is on the closing bracket of the interface >> definition, narrow-to-defun captures >> >>> void otherMethod(); >>> } >>> } >> >> which looks quite unusual to me. > > Yes, I agree with this one. My guess is that this is the same as number > one. > > What do you think? > > Theo There’s a discussion semi-related to this on emacs-devel, where Alan mentioned this: In CC Mode, it has been configurable via the user option c-defun-tactic for somewhere between ten and fifteen years. When c-defun-tactic is t, C-M-a/e go to the start/end of the top level defuns. When it is the symbol go-outward, C-M-a/e move to the next start/end of defun, if any, at the current level of class/namespace nesting, and move outwards to the next level of class/namespace nesting when a class/namespace boundary is reached. If we add this option to tree-sitter, user could decide what bahavior they want. I’m planning to work on that. Though there is already something that can more-or-less do this: treesit-defun-prefer-top-level. Yuan
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Fri, 09 Dec 2022 03:52:02 GMT) Full text and rfc822 format available.Message #26 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Brian Leung <leungbk <at> posteo.net> To: Theodor Thornhill <theo <at> thornhill.no> Cc: casouri <at> gmail.com, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Fri, 09 Dec 2022 03:35:21 +0000
Theodor Thornhill <theo <at> thornhill.no> writes: >> 2. When point is anywhere in the first line of the class >> declaration, mark-defun highlights "void otherMethod()", >> instead >> of the entire class declaration. > > Yeah, I think I've fixed this in a patch I just submitted. Which commit are you referring to? >> 3a. When point is at the [*] in between someMethod and >> otherMethod, narrow-to-defun captures "void otherMethod()". I >> feel >> that since the methods inside the interface declaration have no >> bodies, it makes more sense to capture the entire interface >> definition if point is at [*]. > > Maybe, but I don't believe this is wrong either. Let me rephrase my request. Consider the following example: > class Cow implements Animal { > public void animalSound() { > // The body of animalSound() is provided here > System.out.println("The cow says: moo"); > } > > [*] > > public void sleep() { > // The body of sleep() is provided here > System.out.println("Zzz"); > } > } Both the methods have bodies. If point is at the [*], I would like for narrow-to-defun to capture the entire class declaration, since point is not really contained in either method. (For this particular example, java-mode presently agrees with java-ts-mode.) Is there a clean way of ensuring that, when point lies between (and is not contained in) those two methods, point is not treated as if it were in one of those methods' tree-sitter nodes? >> 3b. Arguably, even if point were on the method declarations, we >> might still want to (as plain java-mode does) capture the >> entire >> interface definition, since body-less method declarations don't >> feel especially defun-like. > > Maybe. Can you try applying the below patch and see if this > changes > anything for you? It captures the entire interface definition only when I remove "method_declaration" (which we probably want to keep) from the regexp.
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Fri, 09 Dec 2022 16:00:02 GMT) Full text and rfc822 format available.Message #29 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Theodor Thornhill <theo <at> thornhill.no> To: Brian Leung <leungbk <at> posteo.net> Cc: casouri <at> gmail.com, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Fri, 09 Dec 2022 16:59:25 +0100
Brian Leung <leungbk <at> posteo.net> writes: > Theodor Thornhill <theo <at> thornhill.no> writes: > >>> 2. When point is anywhere in the first line of the class >>> declaration, mark-defun highlights "void otherMethod()", >>> instead >>> of the entire class declaration. >> >> Yeah, I think I've fixed this in a patch I just submitted. > > Which commit are you referring to? > I believe it was the one I included as a patch here. >>> 3a. When point is at the [*] in between someMethod and >>> otherMethod, narrow-to-defun captures "void otherMethod()". I >>> feel >>> that since the methods inside the interface declaration have no >>> bodies, it makes more sense to capture the entire interface >>> definition if point is at [*]. >> >> Maybe, but I don't believe this is wrong either. > > Let me rephrase my request. Consider the following example: > >> class Cow implements Animal { >> public void animalSound() { >> // The body of animalSound() is provided here >> System.out.println("The cow says: moo"); >> } >> >> [*] >> >> public void sleep() { >> // The body of sleep() is provided here >> System.out.println("Zzz"); >> } >> } > > Both the methods have bodies. If point is at the [*], I would like > for narrow-to-defun to capture the entire class declaration, since > point is not really contained in either method. (For this > particular example, java-mode presently agrees with java-ts-mode.) > > Is there a clean way of ensuring that, when point lies between > (and is not contained in) those two methods, point is not treated > as if it were in one of those methods' tree-sitter nodes? > I understand. I think that either we need to tweak the treesit-defun-type-regexp or make use of something like: (treesit-node-on (point) (point)) in the code that searches for beginning/end-of-defun. That code should return what you want, right? >>> 3b. Arguably, even if point were on the method declarations, we >>> might still want to (as plain java-mode does) capture the >>> entire >>> interface definition, since body-less method declarations don't >>> feel especially defun-like. >> >> Maybe. Can you try applying the below patch and see if this >> changes >> anything for you? > > It captures the entire interface definition only when I remove > "method_declaration" (which we probably want to keep) from the > regexp. Yeah. But I believe Yuan is cooking on some code wrt beginning/end-of-defun, so maybe we should just wait and see what he comes up with. Theo
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Wed, 21 Dec 2022 05:25:02 GMT) Full text and rfc822 format available.Message #32 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Yuan Fu <casouri <at> gmail.com> To: Theodor Thornhill <theo <at> thornhill.no> Cc: leungbk <at> posteo.net, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Tue, 20 Dec 2022 21:24:32 -0800
Theodor Thornhill <theo <at> thornhill.no> writes: > Brian Leung <leungbk <at> posteo.net> writes: > >> Theodor Thornhill <theo <at> thornhill.no> writes: >> >>>> 2. When point is anywhere in the first line of the class >>>> declaration, mark-defun highlights "void otherMethod()", >>>> instead >>>> of the entire class declaration. >>> >>> Yeah, I think I've fixed this in a patch I just submitted. >> >> Which commit are you referring to? >> > > I believe it was the one I included as a patch here. > >>>> 3a. When point is at the [*] in between someMethod and >>>> otherMethod, narrow-to-defun captures "void otherMethod()". I >>>> feel >>>> that since the methods inside the interface declaration have no >>>> bodies, it makes more sense to capture the entire interface >>>> definition if point is at [*]. >>> >>> Maybe, but I don't believe this is wrong either. >> >> Let me rephrase my request. Consider the following example: >> >>> class Cow implements Animal { >>> public void animalSound() { >>> // The body of animalSound() is provided here >>> System.out.println("The cow says: moo"); >>> } >>> >>> [*] >>> >>> public void sleep() { >>> // The body of sleep() is provided here >>> System.out.println("Zzz"); >>> } >>> } >> >> Both the methods have bodies. If point is at the [*], I would like >> for narrow-to-defun to capture the entire class declaration, since >> point is not really contained in either method. (For this >> particular example, java-mode presently agrees with java-ts-mode.) >> >> Is there a clean way of ensuring that, when point lies between >> (and is not contained in) those two methods, point is not treated >> as if it were in one of those methods' tree-sitter nodes? >> > > I understand. I think that either we need to tweak the > treesit-defun-type-regexp or make use of something like: > > (treesit-node-on (point) (point)) in the code that searches for > beginning/end-of-defun. > > That code should return what you want, right? > >>>> 3b. Arguably, even if point were on the method declarations, we >>>> might still want to (as plain java-mode does) capture the >>>> entire >>>> interface definition, since body-less method declarations don't >>>> feel especially defun-like. >>> >>> Maybe. Can you try applying the below patch and see if this >>> changes >>> anything for you? >> >> It captures the entire interface definition only when I remove >> "method_declaration" (which we probably want to keep) from the >> regexp. > > Yeah. But I believe Yuan is cooking on some code wrt > beginning/end-of-defun, so maybe we should just wait and see what he > comes up with. I’ve cooked and served said code. Now beginning/end-of-defun should work reliably, and you can configure its behavior with treesit-defun-tactic. I also fixed c-ts-mode-indent-defun with the new defun functions. Yuan
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Wed, 21 Dec 2022 05:29:01 GMT) Full text and rfc822 format available.Message #35 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Yuan Fu <casouri <at> gmail.com> To: Theodor Thornhill <theo <at> thornhill.no> Cc: leungbk <at> posteo.net, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Tue, 20 Dec 2022 21:28:38 -0800
Theodor Thornhill <theo <at> thornhill.no> writes: > Brian Leung <leungbk <at> posteo.net> writes: > >> Theodor Thornhill <theo <at> thornhill.no> writes: >> >>>> 2. When point is anywhere in the first line of the class >>>> declaration, mark-defun highlights "void otherMethod()", >>>> instead >>>> of the entire class declaration. >>> >>> Yeah, I think I've fixed this in a patch I just submitted. >> >> Which commit are you referring to? >> > > I believe it was the one I included as a patch here. > >>>> 3a. When point is at the [*] in between someMethod and >>>> otherMethod, narrow-to-defun captures "void otherMethod()". I >>>> feel >>>> that since the methods inside the interface declaration have no >>>> bodies, it makes more sense to capture the entire interface >>>> definition if point is at [*]. >>> >>> Maybe, but I don't believe this is wrong either. >> >> Let me rephrase my request. Consider the following example: >> >>> class Cow implements Animal { >>> public void animalSound() { >>> // The body of animalSound() is provided here >>> System.out.println("The cow says: moo"); >>> } >>> >>> [*] >>> >>> public void sleep() { >>> // The body of sleep() is provided here >>> System.out.println("Zzz"); >>> } >>> } >> >> Both the methods have bodies. If point is at the [*], I would like >> for narrow-to-defun to capture the entire class declaration, since >> point is not really contained in either method. (For this >> particular example, java-mode presently agrees with java-ts-mode.) >> >> Is there a clean way of ensuring that, when point lies between >> (and is not contained in) those two methods, point is not treated >> as if it were in one of those methods' tree-sitter nodes? >> > > I understand. I think that either we need to tweak the > treesit-defun-type-regexp or make use of something like: > > (treesit-node-on (point) (point)) in the code that searches for > beginning/end-of-defun. > > That code should return what you want, right? > >>>> 3b. Arguably, even if point were on the method declarations, we >>>> might still want to (as plain java-mode does) capture the >>>> entire >>>> interface definition, since body-less method declarations don't >>>> feel especially defun-like. >>> >>> Maybe. Can you try applying the below patch and see if this >>> changes >>> anything for you? >> >> It captures the entire interface definition only when I remove >> "method_declaration" (which we probably want to keep) from the >> regexp. > > Yeah. But I believe Yuan is cooking on some code wrt > beginning/end-of-defun, so maybe we should just wait and see what he > comes up with. Oh wait, this report is about narrow-to-defun rather than c-ts-mode-indent-defun, err that’s not fixed yet, because beginning/end-of-defun doens’t use tree-sitter anymore (headache). I’ll try to address this soon. Yuan
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Thu, 22 Dec 2022 09:00:02 GMT) Full text and rfc822 format available.Message #38 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Yuan Fu <casouri <at> gmail.com> To: Theodor Thornhill <theo <at> thornhill.no> Cc: leungbk <at> posteo.net, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Thu, 22 Dec 2022 00:59:15 -0800
Yuan Fu <casouri <at> gmail.com> writes: > Theodor Thornhill <theo <at> thornhill.no> writes: > >> Brian Leung <leungbk <at> posteo.net> writes: >> >>> Theodor Thornhill <theo <at> thornhill.no> writes: >>> >>>>> 2. When point is anywhere in the first line of the class >>>>> declaration, mark-defun highlights "void otherMethod()", >>>>> instead >>>>> of the entire class declaration. >>>> >>>> Yeah, I think I've fixed this in a patch I just submitted. >>> >>> Which commit are you referring to? >>> >> >> I believe it was the one I included as a patch here. >> >>>>> 3a. When point is at the [*] in between someMethod and >>>>> otherMethod, narrow-to-defun captures "void otherMethod()". I >>>>> feel >>>>> that since the methods inside the interface declaration have no >>>>> bodies, it makes more sense to capture the entire interface >>>>> definition if point is at [*]. >>>> >>>> Maybe, but I don't believe this is wrong either. >>> >>> Let me rephrase my request. Consider the following example: >>> >>>> class Cow implements Animal { >>>> public void animalSound() { >>>> // The body of animalSound() is provided here >>>> System.out.println("The cow says: moo"); >>>> } >>>> >>>> [*] >>>> >>>> public void sleep() { >>>> // The body of sleep() is provided here >>>> System.out.println("Zzz"); >>>> } >>>> } >>> >>> Both the methods have bodies. If point is at the [*], I would like >>> for narrow-to-defun to capture the entire class declaration, since >>> point is not really contained in either method. (For this >>> particular example, java-mode presently agrees with java-ts-mode.) >>> >>> Is there a clean way of ensuring that, when point lies between >>> (and is not contained in) those two methods, point is not treated >>> as if it were in one of those methods' tree-sitter nodes? That’s hard to do with the current narrow-to-defun, we can add a new version that is aware of nested defuns and remap narrow-to-defun to it in tree-sitter modes. In the future we can improve stock narrow-to-defun to support nested defuns. Yuan
bug-gnu-emacs <at> gnu.org
:bug#59853
; Package emacs
.
(Sat, 07 Jan 2023 23:13:02 GMT) Full text and rfc822 format available.Message #41 received at 59853 <at> debbugs.gnu.org (full text, mbox):
From: Yuan Fu <casouri <at> gmail.com> To: Theodor Thornhill <theo <at> thornhill.no> Cc: leungbk <at> posteo.net, 59853 <at> debbugs.gnu.org Subject: Re: bug#59853: 30.0.50; tree-sitter modes have unexpected beginning-of-defun behavior Date: Sat, 7 Jan 2023 15:12:13 -0800
Yuan Fu <casouri <at> gmail.com> writes: > Yuan Fu <casouri <at> gmail.com> writes: > >> Theodor Thornhill <theo <at> thornhill.no> writes: >> >>> Brian Leung <leungbk <at> posteo.net> writes: >>> >>>> Theodor Thornhill <theo <at> thornhill.no> writes: >>>> >>>>>> 2. When point is anywhere in the first line of the class >>>>>> declaration, mark-defun highlights "void otherMethod()", >>>>>> instead >>>>>> of the entire class declaration. >>>>> >>>>> Yeah, I think I've fixed this in a patch I just submitted. >>>> >>>> Which commit are you referring to? >>>> >>> >>> I believe it was the one I included as a patch here. >>> >>>>>> 3a. When point is at the [*] in between someMethod and >>>>>> otherMethod, narrow-to-defun captures "void otherMethod()". I >>>>>> feel >>>>>> that since the methods inside the interface declaration have no >>>>>> bodies, it makes more sense to capture the entire interface >>>>>> definition if point is at [*]. >>>>> >>>>> Maybe, but I don't believe this is wrong either. >>>> >>>> Let me rephrase my request. Consider the following example: >>>> >>>>> class Cow implements Animal { >>>>> public void animalSound() { >>>>> // The body of animalSound() is provided here >>>>> System.out.println("The cow says: moo"); >>>>> } >>>>> >>>>> [*] >>>>> >>>>> public void sleep() { >>>>> // The body of sleep() is provided here >>>>> System.out.println("Zzz"); >>>>> } >>>>> } >>>> >>>> Both the methods have bodies. If point is at the [*], I would like >>>> for narrow-to-defun to capture the entire class declaration, since >>>> point is not really contained in either method. (For this >>>> particular example, java-mode presently agrees with java-ts-mode.) >>>> >>>> Is there a clean way of ensuring that, when point lies between >>>> (and is not contained in) those two methods, point is not treated >>>> as if it were in one of those methods' tree-sitter nodes? > > That’s hard to do with the current narrow-to-defun, we can add a > new version that is aware of nested defuns and remap narrow-to-defun to > it in tree-sitter modes. In the future we can improve stock > narrow-to-defun to support nested defuns. > > Yuan Defun navigatio is largely fixed now, so I’m closing this. For narrow-to-defun to completely work we need to improve beginning/end-of-defun to support nested defuns. Yuan
Yuan Fu <casouri <at> gmail.com>
to control <at> debbugs.gnu.org
.
(Sat, 07 Jan 2023 23:13:02 GMT) Full text and rfc822 format available.Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Sun, 05 Feb 2023 12:24:05 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.