You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed the preview doesn't work in windows. The reason is related to running 'dot' with the output to stdout, and loading stdout as a png.
But in windows the buffer contents file will be invalid and so not displayed as an image - its possibly because of line endings.
I hacked it to output to a tmp file by using -O when running "dot" and then manually loaded the temp file in emacs.
I'm on Windows using the latest version as well as using the cygwin "dot" package. I can confirm that previews display as raw bytes and emacs complains that it can't recognize the image type.
When I manually run (toggle-enable-multibyte-characters) in the new buffer and then manually run (image-mode) the image does display. I am trying to figure out why.
EDIT:
I found the issue. The 'binary coding is NOT being applied to the newly created buffer for some reason.
Modifying the graphviz--display-preview-buffer function to this fixes it:
(defungraphviz--display-preview-buffer (stdout-buffer)
"Display STDOUT-BUFFER as the dot preview."
(with-current-buffer stdout-buffer
(set-buffer-file-coding-system'binary)
(goto-char (point-min))
(image-mode))
(display-buffer stdout-buffer))
Activity
ppareit commentedon Jun 28, 2025
Fixed with PR #78 ? Is merged in, so could you test on windows?
granitrocky commentedon Sep 3, 2025
I'm on Windows using the latest version as well as using the cygwin "dot" package. I can confirm that previews display as raw bytes and emacs complains that it can't recognize the image type.
When I manually run
(toggle-enable-multibyte-characters)in the new buffer and then manually run(image-mode)the image does display. I am trying to figure out why.EDIT:
I found the issue. The 'binary coding is NOT being applied to the newly created buffer for some reason.
Modifying the
graphviz--display-preview-bufferfunction to this fixes it:ppareit commentedon Sep 4, 2025
Great! Please send pull request, will pull.