[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region
From: |
João Távora |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Lars Ingebrigtsen <larsi@gnus.org> writes:
> OK, adding João 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 'symbol))))
(end (or (and sexp-end
(not (= 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ão
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Lars Ingebrigtsen, 2020/12/12
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Dmitry Gutov, 2020/12/12
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Lars Ingebrigtsen, 2020/12/13
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal,
João Távora <=
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Dmitry Gutov, 2020/12/13
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, João Távora, 2020/12/14
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Dmitry Gutov, 2020/12/15
- Message not available
- Message not available
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Glenn Morris, 2020/12/17
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Dmitry Gutov, 2020/12/17
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, João Távora, 2020/12/18
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Dmitry Gutov, 2020/12/18
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, João Távora, 2020/12/18
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, Dmitry Gutov, 2020/12/18
- bug#29193: 26.0.90; Using (thing-at-point 'sexp) in flymake-diag-region might be suboptimal, João Távora, 2020/12/18