Closed jgarte closed 1 year ago
Hello,
Thanks for reporting this problem.
with-emacs.sh
and test it.Thanks.
- GNU Emacs 29.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0)
Do you have a version of Emacs 28 or 27 to test with? Emacs 29 is not yet released, so it would be helpful to know whether we're looking at a change in Emacs 29 or something else.
2. [ 0.8.3](https://toys.whereis.%E3%81%BF%E3%82%93%E3%81%AA/?search=emacs-ement)
Is that the same as this? https://packages.guix.gnu.org/packages/emacs-ement/
3. I'll get back you on this one as I'll have to find the time to read the setup for `with-emacs.sh` and test it.
Basically you would run it like this:
$ with-emacs.sh -i ement
Then try to connect and use the client as you normally do.
Do you have a version of Emacs 28 or 27 to test with?
Yep.
Is that the same as this? https://packages.guix.gnu.org/packages/emacs-ement/
Yep.
Basically you would run it like this:
Thanks for the TLDR. Much appreciated!
Give me a few days to do more testing and I'll get back here.
Then try to connect and use the client as you normally do.
By try to connect you mean to call emacsclient
with some flag to connect to the frame?
BTW,
This error still occurs on emacs 28
error in process sentinel: Wrong type argument: consp, nil
GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0)
I got the above 28.2 with Guix and ement is same version as before.
Then try to connect and use the client as you normally do.
By try to connect you mean to call
emacsclient
with some flag to connect to the frame?
No, I mean to use Ement ("the [Matrix] client") as you normally do. :)
Please try running this commit: https://github.com/alphapapa/ement.el/commit/c55bc0b362eab1d4d2db495c1ed285ea264295a6 When encountering one of the rooms whose avatar is unexpectedly nil, it should display a warning with the room struct. With that information, we should be able to dig further and find out why the image is ending up nil. Depending on the room, the struct could be a large amount of data. Likely, we'll just need to get the room ID, and then add more debugging code to show what goes wrong with that room's avatar event.
Thanks for your help.
Also, for future reference, this should have been solved in https://github.com/alphapapa/ement.el/issues/45, but...
I ran this in a terminal:
$ guix shell emacs-next emacs-ement --with-commit=emacs-ement=c55bc0b362eab1d4d2db495c1ed285ea264295a6
The above command install emacs 29 and emacs-ement
from commit c55bc0b362eab1d4d2db495c1ed285ea264295a6
in a shell environment.
I then, launched Emacs and executed ement-connect
and voilĂ , it runs smoothly.
The error completely went away and ement not runs as smooth as butter which I hadn't experienced yet :)
I do have this new warning in *Messages*
but maybe ignore or we should investigate?
PNG warning: iCCP: known incorrect sRGB profile [2 times]
I'll make sure to update the Guix package once this fix is in master
.
Well, that commit isn't a fix, rather it adds debugging code that should allow us to locate the problem and then fix it in the right place. As you can see in the patch, it should display a warning like Ement room avatar has no image...
that should have more information about the room with the problematic avatar. Do you not see a *Warnings*
buffer with a message like that?
ement no[w] runs as smooth as butter which I hadn't experienced yet :)
Yes, that's because the error is ultimately signaled from the process sentinel, which Emacs handles by pausing for 2 seconds. I've recently learned that signaling errors from sentinels is bad, so a future version of plz
should solve that (i.e. those errors wouldn't cause Emacs to pause). But this error relating to a corrupt room avatar still needs to be fixed in and of itself.
Oh yeah, looking at the *Warnings*
buffer now. It has a ton of info. Looks like some of it might be sensitive information...
Do you need any info from it?
Here's a snippet of the first couple of characters in the *Warnings*
buffer:
â Warning (emacs): Ement room avatar has no image
The plan would be for you to give me the room ID (a string like !raNdOmLetteRs11234:matrix.org
), then I could add another check for that ID elsewhere in the code, and then get a URL to the avatar image, and then download it and see if it is corrupt or if Emacs can't handle it, etc.
I saw a room ID like that in *Warnings*
. I'll get back to you on that one by this Weekend. Heading out for the night now.
Thanks. I pushed another commit to the branch wip/147
that moves the warning to where the avatar is downloaded rather than each time the room list is updated. It also prints only the room ID and the URL to the avatar. Please try that branch when you have time again.
Here ya go:
â Warning (comp): /gnu/store/y2kz3l34b4dm0ygjz8gk3fhx4fbb3nhr-emacs-feature-loader-1.0.0/share/emacs/site-lisp/feature-loader-1.0.0/feature-loader.el: Error: Symbol's function definition is void all-the-icons-faicon
â Warning (comp): ement-lib.el:99:2: Warning: defconst `ement--color-luminance-dark-limit' docstring has wrong usage of unescaped single quotes (use \= or different quoting)
â Warning (comp): ement-lib.el:130:14: Warning: reference to free variable âement--color-luminance-dark-limitâ
â Warning (comp): ement-lib.el:927:40: Warning: avoid `lsh'; use `ash' instead
â Warning (comp): ement-lib.el:928:40: Warning: avoid `lsh'; use `ash' instead
â Warning (comp): ement-lib.el:1142:7: Warning: âbutton-buttonizeâ is an obsolete function (as of 29.1); use âbuttonizeâ instead.
â Warning (comp): ement-room.el:2512:4: Warning: docstring wider than 80 characters
â Warning (comp): ement-room.el:2653:14: Warning: âpointâ is an obsolete generalized variable; use âgoto-charâ instead.
â Warning (comp): ement-room.el:3533:40: Warning: avoid `lsh'; use `ash' instead
â Warning (comp): ement-room.el:3534:40: Warning: avoid `lsh'; use `ash' instead
â Warning (ement): Room avatar seems unreadable: ROOM-ID:"!yAXokUArOJxHEACeib:pussthecat.org" AVATAR-URL:"https://matrix-client.matrix.org/_matrix/media/r0/download/snopyta.org/rnKrxCoRJcAiGXfZVaDEfUUS"
â Warning (comp): ement-room-list.el:161:2: Warning: defvar `ement-room-list-keys' docstring wider than 80 characters
or screenshot on a different run:
WDYT
The above was tested in a guix shell
on the latest commit from wip/147
:
> guix shell emacs-next emacs-ement --with-branch=emacs-ement=wip/147 --check
updating checkout of 'https://github.com/alphapapa/ement.el'...
retrieved commit a31cbeefca53bc065c8e637849caa2c90012a43f
guix shell: checking the environment variables visible from shell '/gnu/store/qvj03fib58k6ldcv3pas3523mz3baiic-zsh-5.8.1/bin/zsh'...
guix shell: All is good! The shell gets correct environment variables.
Ok, I think I see the problem: When I open https://matrix-client.matrix.org/_matrix/media/r0/download/snopyta.org/rnKrxCoRJcAiGXfZVaDEfUUS
in Firefox, or download it with wget, the server says it's invidious.png
, but Firefox and the file
command identify it as MS Windows icon resource - 3 icons, 48x48, 32 bits/pixel, 32x32, 32 bits/pixel
. And when I feed that file data into Emacs's create-image
, it returns nil. And the code in ement-room-list.el
expects that if the avatar image was downloaded by the avatar event handler, it will be non-nil.
And apparently Emacs does not support ICO files at all, as (image-type-from-file-name "image.ico")
returns nil.
So the "fix" in Ement will be basically what that branch does now, to show a warning when the avatar is downloaded and found unreadable, and to leave the room's avatar slot properly nil.
In the meantime, you might want to advise the room's admin that they should replace the avatar with a real PNG image.
Thanks for your help with this error. I'll release the fix in v0.9, since it's basically ready to tag anyway, I think.
Hi,
I'm not sure what I should call this error but ement keeps complaining about the below.
I turned on
toggle-debug-on-error
and this is what I got.WDYT
Feel free to rename this issue to something more pertinent.