Skip to content

preview doesn't work in windows #83

Open

Description

@aachrisg

Hi. Enjoying the package.

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.

Activity

  1. ppareit commented on Jun 28, 2025

    @ppareit
    Owner

    Fixed with PR #78 ? Is merged in, so could you test on windows?

  2. granitrocky commented on Sep 3, 2025

    @granitrocky

    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:

    (defun graphviz--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))
  3. ppareit commented on Sep 4, 2025

    @ppareit
    Owner

    Great! Please send pull request, will pull.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions