Variable: gnus-uu-default-view-rules

gnus-uu-default-view-rules is a customizable variable defined in gnus-uu.el.gz.

Value

(("\\.te?xt$\\|\\.doc$\\|read.*me\\|\\.c?$\\|\\.h$\\|\\.bat$\\|\\.asm$\\|makefile"
  "cat %s | sed 's/
$//'")
 ("\\.pas$" "cat %s | sed 's/
$//'")
 ("\\.[1-9]$" "groff -mandoc -Tascii %s | sed s/.//g")
 ("\\.\\(jpe?g\\|gif\\|tiff?\\|p[pgb]m\\|xwd\\|xbm\\|pcx\\)$"
  "display")
 ("\\.tga$" "tgatoppm %s | ee -")
 ("\\.\\(wav\\|aiff\\|hcom\\|u[blw]\\|s[bfw]\\|voc\\|smp\\)$"
  "sox -v .5 %s -t .au -u - > /dev/audio")
 ("\\.au$" "cat %s > /dev/audio") ("\\.midi?$" "playmidi -f")
 ("\\.mod$" "str32") ("\\.ps$" "ghostview") ("\\.dvi$" "xdvi")
 ("\\.html$" "xmosaic") ("\\.mpe?g$" "mpeg_play")
 ("\\.\\(flc\\|fli\\|rle\\|iff\\|pfx\\|avi\\|sme\\|rpza\\|dl\\|qt\\|rsrc\\|mov\\)$"
  "xanim")
 ("\\.\\(tar\\|arj\\|zip\\|zoo\\|arc\\|gz\\|Z\\|lzh\\|ar\\|lha\\)$"
  "gnus-uu-archive"))

Documentation

Default actions to be taken when the user asks to view a file.

To change the behavior, you can either edit this variable or set gnus-uu-user-view-rules to something useful.

For example:

To make gnus-uu use xli to display JPEG and GIF files, put the following in your .emacs file:

  (setq gnus-uu-user-view-rules '(("jpg$\\\\|gif$" "xli")))

Both these variables are lists of lists with two string elements. The first string is a regular expression. If the file name matches this regular expression, the command in the second string is executed with the file as an argument.

If the command string contains "%s", the file name will be inserted at that point in the command string. If there's no "%s" in the command string, the file name will be appended to the command string before executing.

There are several user variables to tailor the behavior of gnus-uu to your needs. First we have gnus-uu-user-view-rules, which is the variable gnus-uu first consults when trying to decide how to view a file. If this variable contains no matches, gnus-uu examines the default rule variable provided in this package. If gnus-uu finds no match here, it uses gnus-uu-user-view-rules-end to try to make a match.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-uu.el.gz
;; Default viewing action rules

(defcustom gnus-uu-default-view-rules
  '(("\\.te?xt$\\|\\.doc$\\|read.*me\\|\\.c?$\\|\\.h$\\|\\.bat$\\|\\.asm$\\|makefile" "cat %s | sed 's/\r$//'")
    ("\\.pas$" "cat %s | sed 's/\r$//'")
    ("\\.[1-9]$" "groff -mandoc -Tascii %s | sed s/\b.//g")
    ("\\.\\(jpe?g\\|gif\\|tiff?\\|p[pgb]m\\|xwd\\|xbm\\|pcx\\)$" "display")
    ("\\.tga$" "tgatoppm %s | ee -")
    ("\\.\\(wav\\|aiff\\|hcom\\|u[blw]\\|s[bfw]\\|voc\\|smp\\)$"
     "sox -v .5 %s -t .au -u - > /dev/audio")
    ("\\.au$" "cat %s > /dev/audio")
    ("\\.midi?$" "playmidi -f")
    ("\\.mod$" "str32")
    ("\\.ps$" "ghostview")
    ("\\.dvi$" "xdvi")
    ("\\.html$" "xmosaic")
    ("\\.mpe?g$" "mpeg_play")
    ("\\.\\(flc\\|fli\\|rle\\|iff\\|pfx\\|avi\\|sme\\|rpza\\|dl\\|qt\\|rsrc\\|mov\\)$" "xanim")
    ("\\.\\(tar\\|arj\\|zip\\|zoo\\|arc\\|gz\\|Z\\|lzh\\|ar\\|lha\\)$"
     "gnus-uu-archive"))
  "Default actions to be taken when the user asks to view a file.
To change the behavior, you can either edit this variable or set
`gnus-uu-user-view-rules' to something useful.

For example:

To make gnus-uu use `xli' to display JPEG and GIF files, put the
following in your .emacs file:

  (setq gnus-uu-user-view-rules \\='((\"jpg$\\\\|gif$\" \"xli\")))

Both these variables are lists of lists with two string elements.  The
first string is a regular expression.  If the file name matches this
regular expression, the command in the second string is executed with
the file as an argument.

If the command string contains \"%s\", the file name will be inserted
at that point in the command string.  If there's no \"%s\" in the
command string, the file name will be appended to the command string
before executing.

There are several user variables to tailor the behavior of gnus-uu to
your needs.  First we have `gnus-uu-user-view-rules', which is the
variable gnus-uu first consults when trying to decide how to view a
file.  If this variable contains no matches, gnus-uu examines the
default rule variable provided in this package.  If gnus-uu finds no
match here, it uses `gnus-uu-user-view-rules-end' to try to make a
match."
  :group 'gnus-extract-view
  :type '(repeat (group regexp (string :tag "Command"))))