From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal Date: Sun, 13 Dec 2020 13:19:08 +0000 Message-ID: <87r1ntzvw3.fsf@gmail.com> References: <87sg8b5k4b.fsf@gnus.org> <49481d0c-b101-8527-b468-ff295105c028@yandex.ru> <87wnxl50nn.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30653"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 29193@debbugs.gnu.org, Dmitry Gutov To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 13 14:20:46 2020 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 1koRIs-0007sC-KH for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Dec 2020 14:20:46 +0100 Original-Received: from localhost ([::1]:35650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1koRIn-0004sb-JV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 13 Dec 2020 08:20:43 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1koRIA-0004sO-DH for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2020 08:20:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1koRIA-0005NC-5G for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2020 08:20:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1koRIA-0008G9-0a for bug-gnu-emacs@gnu.org; Sun, 13 Dec 2020 08:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Dec 2020 13:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29193 X-GNU-PR-Package: emacs Original-Received: via spool by 29193-submit@debbugs.gnu.org id=B29193.160786556631620 (code B ref 29193); Sun, 13 Dec 2020 13:20:01 +0000 Original-Received: (at 29193) by debbugs.gnu.org; 13 Dec 2020 13:19:26 +0000 Original-Received: from localhost ([127.0.0.1]:47733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koRHa-0008Dv-0Y for submit@debbugs.gnu.org; Sun, 13 Dec 2020 08:19:26 -0500 Original-Received: from mail-wm1-f52.google.com ([209.85.128.52]:54752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1koRHX-0008DW-9B for 29193@debbugs.gnu.org; Sun, 13 Dec 2020 08:19:24 -0500 Original-Received: by mail-wm1-f52.google.com with SMTP id d3so11394477wmb.4 for <29193@debbugs.gnu.org>; Sun, 13 Dec 2020 05:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=1VAKQ0Fp3Y2BJEZk74zRHR6MycB3qWUEjwpJPhZlWQ8=; b=UrNtfaRNjKA3+l8+mm6BxhMTRGhQ6ANXhCPyE9t4FRszb7fe/nYBf9dzhbbJmszvR1 AFaHFShZpp/RtcVdNyh7xGzp6MFA7gPulqBHc9y8khtjg4y2PfQzFXfl0c4ZHEYJM1uE TpTQOYUuwXK5h4Aq69hJitz6isw1JJrEfAX7PmuaD77K8wZOY2JBZrRRNG5ZWl3JQ9Xv SaVLj5xVI/VIjrEG8PnjVyLpo10d+KthdyNXyazGOqN+BIa98F+BhXtbSKcWntLtomgu Ux3IhtN3ra9wNnHp2TuM8MZnSILPR3m4kwL2gfoYtT9ct6tECN+MPhASvh1JOMmguLIb vaag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=1VAKQ0Fp3Y2BJEZk74zRHR6MycB3qWUEjwpJPhZlWQ8=; b=SGYOre1xEuuXN8G+p1xP0xtEdzd+tT6uX3TXlcG4DzZEh4BtVkmq+THrgsbuieygR+ ch2VzekBjoDShVM1Xf33/xCo53ZDaK9rmEbJV+XqEusUwtpMB2PoCdht91meh+4M8p1K jaBELIebBV5ZP0/sC8kzQmORgDfzZ8YU2Qh63NBsDyf4TQBrtx78VjdAs1XxVr6iAT12 Q5u2D3uNsFlZEKtfX6gjLazGW5mK6RVh8DMFPtU5bcntERhnJ9JN7Uhm5PK2G5sEbsmd K2DiVJ9iyy2k+punVWq6YGbaiTs2QBGZc6s09gtQFdPjYiOueO4Xigo3JrPNSPWHpW06 XPKA== X-Gm-Message-State: AOAM531uFe1JzmRYD0ihh4v9LXJj0zH9YI3H/jsNwnXGGJbIbWCS0sPw R4rO6+bLYPXJxQCRNZoCL+6YukuJ3Lk= X-Google-Smtp-Source: ABdhPJwk6y9l/U2lZ8pdI436kVKDRDf1VGd1vuJkvnKXc7nls+JaTi65hrPgNI3cIDCEeX3ia+6alw== X-Received: by 2002:a1c:4c14:: with SMTP id z20mr23324655wmf.149.1607865552027; Sun, 13 Dec 2020 05:19:12 -0800 (PST) Original-Received: from krug (a94-133-30-26.cpe.netcabo.pt. [94.133.30.26]) by smtp.gmail.com with ESMTPSA id w18sm6868836wrn.2.2020.12.13.05.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 05:19:11 -0800 (PST) In-Reply-To: <87wnxl50nn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 13 Dec 2020 13:51:56 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:195956 Archived-At: Lars Ingebrigtsen writes: > OK, adding Jo=C3=A3o to the Cc's. Not sure why 'symbol and 'sexp don't reference the same "thing", or at least stuff consistent in terms of nesting. In my testing (thing-at-point 'sexp) at the "e" got me nothing, but at the "n" or "d" got me the whole sexp. Similar strange situation with "begin". "b" sees the whole sexp, any of "egin" doesn't. This seems to resist different indentations. In the end flymake-diag-region tries its best to guess a region from limited line/col stuff and asks thingatpt.el for help, which in turn will probably ask the major-mode for syntactic navigation. So I wouldn't say the problem is in flymake.el, but in whom is untimately providing the (broken) goods. Then again maybe this untested patch would work and not break much stuff for other backends... diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index efa7b2ffbf..6c3e0a1981 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -437,7 +437,8 @@ flymake-diag-region (if (and col (cl-plusp col)) (let* ((beg (progn (forward-char (1- col)) (point))) - (sexp-end (ignore-errors (end-of-thing 'sexp))) + (sexp-end (or (ignore-errors (end-of-thing 'sexp)) + (ignore-errors (end-of-thing 'symbo= l)))) (end (or (and sexp-end (not (=3D sexp-end beg)) sexp-end) Other than that, I don't have much to add. I don't have the resources to debug ruby-mode and/or install rubocop right now. Good luck. Jo=C3=A3o