From: João Távora Date: Thu, 3 May 2018 14:46:27 +0000 (+0100) Subject: Fix flymake diagnostic positions X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~660 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f706000c89019e646cf55a417b3b87035ed32794;p=emacs.git Fix flymake diagnostic positions It's better not to use flymake-diag-region here. * eglot.el (eglot--textDocument/publishDiagnostics): Calculate position by hand. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 86c0a4c05fa..bb0427aca73 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -637,10 +637,13 @@ running. INTERACTIVE is t if called interactively." (with-current-buffer buffer (cl-flet ((pos-at (pos-plist) - (car (flymake-diag-region - (current-buffer) - (plist-get pos-plist :line) - (plist-get pos-plist :character))))) + (save-excursion + (goto-char (point-min)) + (forward-line (plist-get pos-plist :line)) + (forward-char + (min (plist-get pos-plist :character) + (- (line-end-position) + (line-beginning-position))))))) (cl-loop for diag-spec across diagnostics collect (cl-destructuring-bind (&key range severity _code _source message)