This is an archive of the discontinued LLVM Phabricator instance.

[GraphWriter] Attempt to open .dot files with xdg-open/open first
ClosedPublic

Authored by MatzeB on Dec 4 2014, 11:00 AM.

Details

Summary

Most desktop environments let the users specify his preferred application per
file type. On mac/linux we can use open/xdg-open for that and should try this
first before starting a heuristic search for various programs.

I hope this is not going to be too much of a bikesched discussion, but I really
prefer it when I can configure the applications myself instead of having a
hardcoded default list, though after seeing r210148 which tries 'gv' before
'xdg-open' I wonder if there is a problem with that approach for some people?
Can you explain why you did this alp? Couldn't people just set their system to open all postscript files gv?

Diff Detail

Event Timeline

MatzeB updated this revision to Diff 16939.Dec 4 2014, 11:00 AM
MatzeB retitled this revision from to [GraphWriter] Attempt to open .dot files with xdg-open/open first.
MatzeB updated this object.
MatzeB added a reviewer: chandlerc.
MatzeB added a subscriber: Unknown Object (MLST).
chandlerc accepted this revision.Mar 29 2015, 2:16 PM
chandlerc edited edge metadata.

I don't see how this could be worse than our previous, completely arbitrary behavior.

This revision is now accepted and ready to land.Mar 29 2015, 2:16 PM
This revision was automatically updated to reflect the committed changes.

Just to note:
If you have word/libreoffice installed on a mac, this will now open
the .dot files in that instead of say, preview (which supports it) or
graphviz :(

(Yeah, i know, i can reset the defaults for .dot files, but it
arbitrarily worked before)

anemet added a subscriber: anemet.Apr 14 2015, 2:13 PM

Just to note:
If you have word/libreoffice installed on a mac, this will now open
the .dot files in that instead of say, preview (which supports it) or
graphviz :(

(Yeah, i know, i can reset the defaults for .dot files, but it
arbitrarily worked before)

I just ran into this too. Danny, what did you have to do make this work?

I gave up, and set the default opener to graphviz

On OS/X you right click the file->"get information" and change the "open with:" for all files of that type.

Anyway I don't feel strongly about the patch, feel free to revert it if this causes more trouble than it helps.

What do you set the viewer to? dotty? I think that before the patch this was using dot to generate the PS and then open to view. Which is probably better than using an X11 program.

I have it set to /Applications/GraphViz.app (from a macos "development snapshot" from graphviz.org http://graphviz.org/ download area). The generated .ps files tended to look very strange for me (lots of whitespace so I had to zoom in before I could really see the graph).

OK, works now, thanks. I didn't know about the separate GUI package for graphviz.