From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#62416: 30.0.50; Symbols skipped in the navigation in ruby-ts-mode Date: Mon, 27 Mar 2023 20:28:32 +0300 Message-ID: <385443e1-4d17-317b-decf-36a3cf50111e@yandex.ru> References: <9cfb677e-2c3b-94f3-e09f-8b231dd9b8f5@yandex.ru> <86v8iomzk3.fsf@mail.linkov.net> <7f03efd3-b3d8-2a93-3414-63a7a2604943@yandex.ru> <86v8imfrbt.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12503"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Cc: =?UTF-8?Q?Bo=C5=A1ko_?= =?UTF-8?Q?Ivani=C5=A1evi=C4=87?= , 62416@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 27 19:29:28 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pgqet-0002zh-5O for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 27 Mar 2023 19:29:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgqeW-0004K9-Ow; Mon, 27 Mar 2023 13:29:04 -0400 Original-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 1pgqeU-0004JT-Ul for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2023 13:29:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pgqeU-0006Ao-NZ for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2023 13:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pgqeU-0005ry-Fx for bug-gnu-emacs@gnu.org; Mon, 27 Mar 2023 13:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Mar 2023 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62416 X-GNU-PR-Package: emacs Original-Received: via spool by 62416-submit@debbugs.gnu.org id=B62416.167993812322533 (code B ref 62416); Mon, 27 Mar 2023 17:29:02 +0000 Original-Received: (at 62416) by debbugs.gnu.org; 27 Mar 2023 17:28:43 +0000 Original-Received: from localhost ([127.0.0.1]:48375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgqeB-0005rL-DY for submit@debbugs.gnu.org; Mon, 27 Mar 2023 13:28:43 -0400 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:54229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgqe8-0005r4-Q9 for 62416@debbugs.gnu.org; Mon, 27 Mar 2023 13:28:41 -0400 Original-Received: by mail-wm1-f51.google.com with SMTP id p34so5479721wms.3 for <62416@debbugs.gnu.org>; Mon, 27 Mar 2023 10:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679938115; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=LGeGYeOulshTQEs4/4F2YIk/a29JLyYm5K1dfD7Do44=; b=mW4Zi8l7Iwz6wMrpeH4TLkrkTSCOi+yyGbxtjmJAVJQOi4pDC3wqgIuZnmBUgQQlsl iaSkUawVL6w2oi5AHvvDJtyRYzwv2Sb8c/86lJFreDWIkBKoUpc4e7hl5aunPIXF7u+C wsw1JFtQroeyH7n/j7/e+6yVwwRutoJd8Ad8J0Tm/RLuiMMbm5LHWSiMV68YwQltwFLB 0jb/8E3eNlF7sotlv0sVQN0tBSM2M+4d9e+ZZjZHD6eIiR7VlTejjmTmyP46+3jZ1MgX xXXpbFYNTkwDIe9uBzwIuGd0k9PoF98+rorfABsYF9Hg6ls5+KhQ79rv3kcbvlsXDmZK cl1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679938115; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LGeGYeOulshTQEs4/4F2YIk/a29JLyYm5K1dfD7Do44=; b=uXJTIZGjhVSwMbNY5BLl2Z93J03eX54SVERueO+HPW5Nvvmt+HCyA1/vU3mgQX09Sm HobzhQ/xKb9emGRRLLRibP5brspixOsZ+1Ie2/eM0Jlwe+q/jYe9ubhZuASloXUgPCfq xkKGcYf1Ikv3zGvVGG8a+dG35Rhq7+/nN+wh40KO2u6jjzCBwh7P3fuRceozK0lrf+R7 HnW0BodYs0CyK4uXrLi0m9ehZBwyAKF3NruduSUcfibHLcFde6w8RMIs4JB029CBrJTS XXpYareyXJ02ESjMqDeNfsEvGHTb1SUetEWKM6D8opZVCEpuuhXP2U6QqqJWYXkGz72X 0nzA== X-Gm-Message-State: AO0yUKXpdDvNDd0SmJju2Rw9hBkbTR01DwaejqepiCY3/uZf7Y9tylEh spt7GmdS9PcSubyjbTJLu5U= X-Google-Smtp-Source: AK7set/lmy9w/RRuYfrwiVzfr2llAvzKfnfAmZAxw6KX7PyaxA/T733Xd2Pc8/NvrNx7vQkR05NXtQ== X-Received: by 2002:a05:600c:2049:b0:3df:e6bb:768 with SMTP id p9-20020a05600c204900b003dfe6bb0768mr9588073wmg.24.1679938114719; Mon, 27 Mar 2023 10:28:34 -0700 (PDT) Original-Received: from [192.168.1.2] ([31.216.80.60]) by smtp.googlemail.com with ESMTPSA id j36-20020a05600c1c2400b003ebf73acf9asm23617225wms.3.2023.03.27.10.28.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Mar 2023 10:28:34 -0700 (PDT) Content-Language: en-US In-Reply-To: <86v8imfrbt.fsf@mail.linkov.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:258765 Archived-At: On 27/03/2023 19:29, Juri Linkov wrote: >>> But anyway I think in its current state >>> treesit-sexp-type-regexp is underdesigned as noted in >>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62238#59 >>> so no tweaking could fix its design flaws. For example, >>> foo = { >>> a: b >>> } >>> when point is on the left curly bracket, 'C-M-f C-M-b' doesn't >>> move back to the original position, etc. >> >> Hm, yeah, it's a little unexpected that not only it doesn't move back >> exactly, it skips the full assignment expression in both directions. >> >> What is the downside of dropping "binary" and "assignment" from >> treesit-sexp-type-regexp, added there not too long ago? Without >> "assignment" there, your example becomes a round-trip. > > This will break other cases, e.g. > > b = %Q{This is a "string"} > c = %w!foo > bar > baz! > d = %(hello (nested) world) > > when point is after "b", 'C-M-f' will move to "c" instead of the end of line. That is because the string literals aren't recognized as sexps yet. Try this: diff --git a/lisp/progmodes/ruby-ts-mode.el b/lisp/progmodes/ruby-ts-mode.el index d1034d467ab..c46247c747a 100644 --- a/lisp/progmodes/ruby-ts-mode.el +++ b/lisp/progmodes/ruby-ts-mode.el @@ -1129,8 +1129,11 @@ ruby-ts-mode "block" "do_block" "begin" - "binary" - "assignment"))) + "integer" + "simple_symbol" + "string" + "string_array" + ))) ;; AFAIK, Ruby can not nest methods (setq-local treesit-defun-prefer-top-level nil)