filesets-external-viewers
filesets-external-viewers is a variable defined in `
filesets.el
'.
Its value is shown
below.
- This variable may be risky if used as a file-local variable.
Documentation:
Association list of file patterns and external viewers for use with
`filesets-find-or-display-file'.
Has the form ((FILE-PATTERN VIEWER PROPERTIES) ...), VIEWER being either a
function or a command name as string.
Properties is an association list determining filesets' behavior in
several conditions. Choose one from this list:
:ignore-on-open-all ... Don't open files of this type automatically --
i.e. on open-all-files-events or when running commands
:capture-output ... capture an external viewer output
:constraintp FUNCTION ... use this viewer only if FUNCTION returns non-nil
:constraint-flag SEXP ... use this viewer only if SEXP evaluates to non-nil
:open-hook HOOK ... run hooks after spawning the viewer -- mainly useful
in conjunction with :capture-output
:args (FORMAT-STRING or SYMBOL or FUNCTION) ... a list of arguments
(defaults to (list "%S")) when using shell commands
Avoid modifying this variable and achieve minor speed-ups by setting the
variables my-ps-viewer, my-pdf-viewer, my-dvi-viewer, my-pic-viewer.
In order to view pdf or rtf files in an Emacs buffer, you could use these:
("^.+\\.pdf\\'" "pdftotext"
((:capture-output t)
(:args ("%S - | fmt -w " window-width))
(:ignore-on-read-text t)
(:constraintp (lambda ()
(and (filesets-which-command-p "pdftotext")
(filesets-which-command-p "fmt"))))))
("^.+\\.rtf\\'" "rtf2htm"
((:capture-output t)
(:args ("%S 2> /dev/null | w3m -dump -T text/html"))
(:ignore-on-read-text t)
(:constraintp (lambda ()
(and (filesets-which-command-p "rtf2htm")
(filesets-which-command-p "w3m"))))))
You can customize this variable.
Value:
(("^.+\\..?html?$" browse-url
((:ignore-on-open-all t)))
("^.+\\.pdf$" "xpdf"
((:ignore-on-open-all t)
(:ignore-on-read-text t)
(:constraint-flag "xpdf")))
("^.+\\.e?ps\\(.gz\\)?$" "ggv"
((:ignore-on-open-all t)
(:ignore-on-read-text t)
(:constraint-flag "ggv")))
("^.+\\.dvi$" "xdvi"
((:ignore-on-open-all t)
(:ignore-on-read-text t)
(:constraint-flag "xdvi")))
("^.+\\.doc$" "antiword"
((:capture-output t)
(:ignore-on-read-text t)
(:constraint-flag "antiword")))
("^.+\\.\\(tiff\\|xpm\\|gif\\|pgn\\)$" "gqview"
((:ignore-on-open-all t)
(:ignore-on-read-text t)
(:constraint-flag "gqview"))))