Skip to content

Instantly share code, notes, and snippets.

@cvmat
Created October 6, 2012 14:23
Show Gist options
  • Save cvmat/3845049 to your computer and use it in GitHub Desktop.
Save cvmat/3845049 to your computer and use it in GitHub Desktop.
Open PDF and DVI files with external program
(defadvice find-file (around disable-doc-view (filename &optional wildcards) activate)
(cond
((string-match "\\.\\(?:PDF\\|DVI\\|pdf\\|dvi\\)\\'" filename)
(let ((process-connection-type nil))
(start-process "" nil "/usr/bin/xdg-open" filename)))
(t
ad-do-it)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment