unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53843: 27.2; unknown function used in flymake
@ 2022-02-07 12:54 Nicolas Martyanoff
  2022-02-07 14:25 ` Robert Pluim
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Martyanoff @ 2022-02-07 12:54 UTC (permalink / raw)
  To: 53843


Hi,

Using eglot with python-mode (with pyright) causes regular errors
involving flymake caused by calls to an unknown "string-replace"
function:

Debugger entered--Lisp error: (void-function string-replace)
  string-replace("%" "%%" "resource.py")
  flymake--log-1(:warning flymake "Invalid region line=%s col=%s" 35 40)
  flymake-diag-region(#<buffer resource.py> 35 40)
  #f(compiled-function (arg1 arg2 &rest rest) "Handle notification publishDiagnostics." #<bytecode 0x157aa550be09>)(#<eglot-lsp-server eglot-lsp-server-157aa616aea0> textDocument/publishDiagnostics :uri "[REMOVED]" :version 227 :diagnostics [(:range (:start (:line 16 :character 5) :end (:line 16 :character 25)) :message "Import \"eventline.api_object\" could not be resolve..." :severity 1 :code "reportMissingImports" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc...")) (:range (:start (:line 34 :character 40) :end (:line 34 :character 52)) :message "\"ResourceSpec\" is not defined" :severity 1 :code "reportUndefinedVariable" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc..."))])
  apply(#f(compiled-function (arg1 arg2 &rest rest) "Handle notification publishDiagnostics." #<bytecode 0x157aa550be09>) #<eglot-lsp-server eglot-lsp-server-157aa616aea0> textDocument/publishDiagnostics (:uri "[REMOVED]" :version 227 :diagnostics [(:range (:start (:line 16 :character 5) :end (:line 16 :character 25)) :message "Import \"eventline.api_object\" could not be resolve..." :severity 1 :code "reportMissingImports" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc...")) (:range (:start (:line 34 :character 40) :end (:line 34 :character 52)) :message "\"ResourceSpec\" is not defined" :severity 1 :code "reportUndefinedVariable" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc..."))]))
  eglot-handle-notification(#<eglot-lsp-server eglot-lsp-server-157aa616aea0> textDocument/publishDiagnostics :uri "[REMOVED]" :version 227 :diagnostics [(:range (:start (:line 16 :character 5) :end (:line 16 :character 25)) :message "Import \"eventline.api_object\" could not be resolve..." :severity 1 :code "reportMissingImports" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc...")) (:range (:start (:line 34 :character 40) :end (:line 34 :character 52)) :message "\"ResourceSpec\" is not defined" :severity 1 :code "reportUndefinedVariable" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc..."))])
  apply(eglot-handle-notification #<eglot-lsp-server eglot-lsp-server-157aa616aea0> textDocument/publishDiagnostics (:uri "[REMOVED]" :version 227 :diagnostics [(:range (:start (:line 16 :character 5) :end (:line 16 :character 25)) :message "Import \"eventline.api_object\" could not be resolve..." :severity 1 :code "reportMissingImports" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc...")) (:range (:start (:line 34 :character 40) :end (:line 34 :character 52)) :message "\"ResourceSpec\" is not defined" :severity 1 :code "reportUndefinedVariable" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc..."))]))
  #f(compiled-function (server method params) #<bytecode 0x157aa616ae7d>)(#<eglot-lsp-server eglot-lsp-server-157aa616aea0> textDocument/publishDiagnostics (:uri "[REMOVED]" :version 227 :diagnostics [(:range (:start (:line 16 :character 5) :end (:line 16 :character 25)) :message "Import \"eventline.api_object\" could not be resolve..." :severity 1 :code "reportMissingImports" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc...")) (:range (:start (:line 34 :character 40) :end (:line 34 :character 52)) :message "\"ResourceSpec\" is not defined" :severity 1 :code "reportUndefinedVariable" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc..."))]))
  jsonrpc-connection-receive(#<eglot-lsp-server eglot-lsp-server-157aa616aea0> (:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params (:uri "[REMOVED]" :version 227 :diagnostics [(:range (:start (:line 16 :character 5) :end (:line 16 :character 25)) :message "Import \"eventline.api_object\" could not be resolve..." :severity 1 :code "reportMissingImports" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc...")) (:range (:start (:line 34 :character 40) :end (:line 34 :character 52)) :message "\"ResourceSpec\" is not defined" :severity 1 :code "reportUndefinedVariable" :source "Pyright" :codeDescription (:href "https://github.com/microsoft/pyright/blob/main/doc..."))])))
  jsonrpc--process-filter(#<process EGLOT (eventline/python-mode)<1>> "Content-Length: 477\15\n\15\n{\"jsonrpc\":\"2.0\",\"method\":\"...")

I cannot find any mention to a string-replace elisp function, is that an
error in flymake or is there a missing dependency?

Regards,

-- 
Nicolas Martyanoff
http://snowsyn.net
khaelin@gmail.com





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53843: 27.2; unknown function used in flymake
  2022-02-07 12:54 bug#53843: 27.2; unknown function used in flymake Nicolas Martyanoff
@ 2022-02-07 14:25 ` Robert Pluim
  2022-02-07 14:50   ` Nicolas Martyanoff
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Pluim @ 2022-02-07 14:25 UTC (permalink / raw)
  To: Nicolas Martyanoff; +Cc: 53843

>>>>> On Mon, 07 Feb 2022 13:54:23 +0100, Nicolas Martyanoff <khaelin@gmail.com> said:

    Nicolas> Hi,

    Nicolas> Using eglot with python-mode (with pyright) causes regular errors
    Nicolas> involving flymake caused by calls to an unknown "string-replace"
    Nicolas> function:

`string-replace' was added in emacs-28, so it looks like your flymake
package needs adjusting. (the version shipped with emacs-28 has ;;
Package-Requires: ((emacs "28.1") (eldoc "1.1.0") (project "0.7.1")))

Robert
-- 





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53843: 27.2; unknown function used in flymake
  2022-02-07 14:25 ` Robert Pluim
@ 2022-02-07 14:50   ` Nicolas Martyanoff
  2022-02-07 15:05     ` Robert Pluim
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Martyanoff @ 2022-02-07 14:50 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Nicolas Martyanoff, 53843

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Mon, 07 Feb 2022 13:54:23 +0100, Nicolas Martyanoff <khaelin@gmail.com> said:
>
>     Nicolas> Hi,
>
>     Nicolas> Using eglot with python-mode (with pyright) causes regular errors
>     Nicolas> involving flymake caused by calls to an unknown "string-replace"
>     Nicolas> function:
>
> `string-replace' was added in emacs-28, so it looks like your flymake
> package needs adjusting. (the version shipped with emacs-28 has ;;
> Package-Requires: ((emacs "28.1") (eldoc "1.1.0") (project "0.7.1")))

I am using eglot which references a flymake copy from
https://github.com/emacs-straight/flymake.

The author of eglot told me to report the bug here, but I guess the
problem comes from eglot (which requires 26.1+) using a copy of flymake
which requires (28.1+).

I do not understand why emacs loads this copy of flymake without
signaling an error given the constraint in Package-Requires, or why is
eglot using a copy of flymake altogether, but these problems are
unrelated to string-replace.

Thank you for the information anyway!

Regards,

-- 
Nicolas Martyanoff
http://snowsyn.net
khaelin@gmail.com





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53843: 27.2; unknown function used in flymake
  2022-02-07 14:50   ` Nicolas Martyanoff
@ 2022-02-07 15:05     ` Robert Pluim
  2022-02-07 15:28       ` Nicolas Martyanoff
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Pluim @ 2022-02-07 15:05 UTC (permalink / raw)
  To: Nicolas Martyanoff; +Cc: 53843

>>>>> On Mon, 07 Feb 2022 15:50:03 +0100, Nicolas Martyanoff <khaelin@gmail.com> said:

    Nicolas> Robert Pluim <rpluim@gmail.com> writes:
    >>>>>>> On Mon, 07 Feb 2022 13:54:23 +0100, Nicolas Martyanoff <khaelin@gmail.com> said:
    >> 
    Nicolas> Hi,
    >> 
    Nicolas> Using eglot with python-mode (with pyright) causes regular errors
    Nicolas> involving flymake caused by calls to an unknown "string-replace"
    Nicolas> function:
    >> 
    >> `string-replace' was added in emacs-28, so it looks like your flymake
    >> package needs adjusting. (the version shipped with emacs-28 has ;;
    >> Package-Requires: ((emacs "28.1") (eldoc "1.1.0") (project "0.7.1")))

    Nicolas> I am using eglot which references a flymake copy from
    Nicolas> https://github.com/emacs-straight/flymake.

Hmm, is that the canonical upstream? I donʼt think so.

    Nicolas> The author of eglot told me to report the bug here, but I guess the
    Nicolas> problem comes from eglot (which requires 26.1+) using a copy of flymake
    Nicolas> which requires (28.1+).

    Nicolas> I do not understand why emacs loads this copy of flymake without
    Nicolas> signaling an error given the constraint in Package-Requires, or why is
    Nicolas> eglot using a copy of flymake altogether, but these problems are
    Nicolas> unrelated to string-replace.

I think Package-Requires is used by package.el to prevent you
*installing* incompatible versions of packages, not running them.

As a workaround you could copy the definition of `string-replace' from
emacs-28's subr.el.

Robert
-- 





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53843: 27.2; unknown function used in flymake
  2022-02-07 15:05     ` Robert Pluim
@ 2022-02-07 15:28       ` Nicolas Martyanoff
  2022-02-07 15:44         ` Robert Pluim
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Martyanoff @ 2022-02-07 15:28 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Nicolas Martyanoff, 53843

Robert Pluim <rpluim@gmail.com> writes:

>>>>>> On Mon, 07 Feb 2022 15:50:03 +0100, Nicolas Martyanoff <khaelin@gmail.com> said:
>
>     Nicolas> Robert Pluim <rpluim@gmail.com> writes:
>     >>>>>>> On Mon, 07 Feb 2022 13:54:23 +0100, Nicolas Martyanoff <khaelin@gmail.com> said:
>     >> 
>     Nicolas> Hi,
>     >> 
>     Nicolas> Using eglot with python-mode (with pyright) causes regular errors
>     Nicolas> involving flymake caused by calls to an unknown "string-replace"
>     Nicolas> function:
>     >> 
>     >> `string-replace' was added in emacs-28, so it looks like your flymake
>     >> package needs adjusting. (the version shipped with emacs-28 has ;;
>     >> Package-Requires: ((emacs "28.1") (eldoc "1.1.0") (project "0.7.1")))
>
>     Nicolas> I am using eglot which references a flymake copy from
>     Nicolas> https://github.com/emacs-straight/flymake.
>
> Hmm, is that the canonical upstream? I donʼt think so.
Yes, I finally found out that the problem comes from eglot: it requires
a very recent version of flymake; this causes straight.el to install
flymake from this exterior repository, and this version requires Emacs
28.1.

Sorry for the noise on the bug tracker, the problems does not come from Emacs.

> As a workaround you could copy the definition of `string-replace' from
> emacs-28's subr.el.

I did not think about that, good idea! Thank you so much.

Regards,

-- 
Nicolas Martyanoff
http://snowsyn.net
khaelin@gmail.com





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#53843: 27.2; unknown function used in flymake
  2022-02-07 15:28       ` Nicolas Martyanoff
@ 2022-02-07 15:44         ` Robert Pluim
  0 siblings, 0 replies; 6+ messages in thread
From: Robert Pluim @ 2022-02-07 15:44 UTC (permalink / raw)
  To: Nicolas Martyanoff; +Cc: 53843-done

>>>>> On Mon, 07 Feb 2022 16:28:36 +0100, Nicolas Martyanoff <khaelin@gmail.com> said:

    Nicolas> Sorry for the noise on the bug tracker, the problems does not come from Emacs.

No worries, closing.

Robert
-- 





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-02-07 15:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 12:54 bug#53843: 27.2; unknown function used in flymake Nicolas Martyanoff
2022-02-07 14:25 ` Robert Pluim
2022-02-07 14:50   ` Nicolas Martyanoff
2022-02-07 15:05     ` Robert Pluim
2022-02-07 15:28       ` Nicolas Martyanoff
2022-02-07 15:44         ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).