Closed bhrgunatha closed 3 years ago
Thanks for reporting.
Although I have seen something like this happen, I haven't seen it recently and haven't been able to track it down (not being able to reproduce it again).
The extra %25
space seems like a potentially helpful clue -- thanks!
What is the minimal buffer text where you can make it happen?
I can't repro the problem with just
#lang racket/base
for/fold
... can you?
In a buffer where you can make the problem happen, could you please try this:
Move point to the for/fold
and press C-u C-x =. In the resulting *Help*
buffer, where it describes text properties, is there a racket-xp-doc
property and if so what is its value?
(Normally, it would be something like ("/home/greg/racket/7.7/doc/reference/for.html" "(form._((lib._racket/private/base..rkt)._for/fold))")
. This value comes from the drracket/check-syntax
library. If such a value exists, we use it to open the docs directly. If not, we go to the search page -- which seems to be the scenario you're describing.)
I'm sorry. I think it must have been a weird transient issue because I can't reproduce the error myself now. This morning, even after restarting emacs, it was occuring, but now after returning several hours later it's not.
There is a difference though. The earlier error report was using the racket docs in my home directory under /home/bhrgunatha/.racket/7.8, (as was DrRacket!) but now that it's no longer causing an error, it's opening up the system racket docs under /usr/share/doc/racket/reference/
I'll monitor for a day or so and if it repeats I'll check for racket-xp-doc
, if not I'll close the issue.
Thanks for following up.
If it does recur, even if you can't reproduce it consistently, please do let me know.
p.s. It's also interesting that, in the error dialog, the URI at the bottom looks correct -- only the bold, bigger, first one has the URI encoding of the query parameter portion, including the extra %25
. I'm not clear exactly what is issuing that error dialog -- emacs or your browser or XFCE or what -- but whatever it is does seem to know the correct URL... as well as the bad one. Weird.
It's been 4 days now and I haven;t had any repeat. I'll close this report assuming some weird state in either emacs or the buffer in question was causing the problem. Thanks for your quick support though I appreciate it!
I'm having similar issues.
racket-bug-report
:
When opening a file with real code, I get this in the message buffer:
Suspicious state from syntax checker racket: Flycheck checker racket returned 1, but its output contained no errors: open-input-file: cannot open module file
module path: /home/me/other/foo.rkt
path: /home/me/other/foo.rkt
system error: no such file or directory; rktio_err=3
context...:
maybe-raise-missing-module
default-load-handler
standard-module-name-resolver
module-path-index-resolve
perform-require!
for-loop
finish
[repeats 3 more times]
pass-1-and-2-loop
module-begin-k
expand-module
expand-submodule
loop
[repeats 2 more times]
module-begin-k
expand-module
...
Try installing a more recent version of racket, and please open a bug report if the issue persists in the latest release. Thanks!
I have Racket 7.8.
With that for/fold minimal example, when I try to use racket-xp-describe
, I get
racket--cmd/await: describe: broke its own contract
promised: string?
produced: #f
in: the range of
(->
(or/c
(or/c 'namespace path-string?)
(cons/c path-string? string?)
(list/c path-string?))
string?
string?)
contract from: (function describe)
blaming: (function describe)
(assuming the contract is correct)
at: /home/me/.emacs.d/.local/straight/build/racket-mode/racket/commands/describe.rkt:57.18
It's really frustrating, as it breaks randomly and nuking .emacs.d
doesn't help.
EDIT: I'm using pretty much vanilla Doom Emacs, here's the Racket module: https://github.com/hlissner/doom-emacs/tree/develop/modules/lang/racket
The first error message appears to be from flycheck
, not Racket Mode, and AFAIK flycheck
doesn't utilize Racket Mode. So I think that's its own separate problem. Definitely a separate issue, and probably not even one for this repo. Actually one idea here would be simply to disable flycheck
in racket-mode
buffers? AFAIK it doesn't add much beyond the minor mode racket-xp-mode
, which it appears you're using? (Of course if I'm mistaken about it not adding much value, please let me know!)
As for the second error message: I spent more time prodding this. I can reproduce this in one scenario --- when the source file has an error preventing it from expanding (e.g. when the mode-line for the buffer is showing Rkt✗
in red). Presumably whatever problem is causing expansion failure for flycheck
, is causing the same for racket-xp-mode
, and you are seeing this Rkt✗
, too? If you do C-c # N (capital N
) what does it tell you?
I will push a commit to handle this problem by reporting "can't find docs" instead of reflecting a Racket contract error up to Emacs. Thank you for reporting this!
(Although strictly speaking this isn't related to #488 for both our convenience I'll just re-open this issue, and close it with the commit.)
p.s. re 1 it looks like Doom Emacs is already supposed to disable flycheck as of July? https://github.com/hlissner/doom-emacs/pull/3594
emacs: 27.1 racket-mode: 20200810 1513 (installed from MELPA) I'm on Linux using the official Arch kernel 5.8
racket-bug-report
contents:The only configuration for
racket-mode
I have is:While editing a racket file with the point on a
for/fold
I hitC-c C-d
(bound toracket-xp-documentation
) and an error occurs. I'm sorry for this screenshot but I can't copy the text from the dialogue (not sure if that's an emacs issue or my desktop environment - XFCE 4.14).Edit: Screenshot image added to the bug report:
DrRacket successfully open the correct URI:
file:///home/bhrgunatha/.racket/7.8/doc/search/index.html?q=for%2Ffold
The error report seems to indicate a malformed URI - notice it ends with
for%252Ffold
- what's weird is %25 is URI encoding for a space and %2F is a standard '/' so I'm not sure why it's displaying%252F
- that seems wrong.In a REPL, buffer, putting the point on
for/fold
and hittingC-c C-d
(bound toracket-repl-documentation
) opens the following file:file:///usr/share/doc/racket/reference/for.html#(form._((lib._racket/private/base..rkt)._for/fold))
I also have a couple of questions.
for/fold
documentation directly?