diff options
author | rrt <rrt@sc3d.org> | 2013-07-21 22:27:04 +0100 |
---|---|---|
committer | rrt <rrt@sc3d.org> | 2013-07-21 22:27:04 +0100 |
commit | a6d004f660bb5ffd94116700672805732a6d1a55 (patch) | |
tree | 6f88dcd6d207f25f87dc474c9a0368c33adbc1df /external | |
parent | 1ea0fa53d253eae501f0a48611dd01493240b34d (diff) | |
download | pygments-a6d004f660bb5ffd94116700672805732a6d1a55.tar.gz |
Minor updates to autopygmentize.
Diffstat (limited to 'external')
-rwxr-xr-x | external/autopygmentize | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/external/autopygmentize b/external/autopygmentize index 85c8dfd2..2df6d469 100755 --- a/external/autopygmentize +++ b/external/autopygmentize @@ -9,9 +9,8 @@ # This program can be used as a .lessfilter for the less pager to auto-color less's output lexer=`pygmentize -N "$1"` +file_common_opts="--brief --dereference --uncompress" if [ "$lexer" = "text" ]; then - file_common_opts="--brief --dereference --uncompress" - unset lexer case `file --mime-type $file_common_opts "$1"` in application/xml|image/svg+xml) lexer=xml;; @@ -40,11 +39,13 @@ if [ "$lexer" = "text" ]; then text/x-tcl) lexer=tcl;; text/x-tex|text/x-texinfo) lexer=latex;; # FIXME: texinfo really needs its own lexer - # Types that file outputs which pygmentize didn't support as of file 5.11, pygments 1.6rc1 + # Types that file outputs which pygmentize didn't support as of file 5.14, pygments 1.6 # text/calendar + # text/inf # text/PGP # text/rtf # text/texmacs + # text/vnd.graphviz # text/x-bcpl # text/x-info # text/x-m4 @@ -53,7 +54,7 @@ if [ "$lexer" = "text" ]; then esac fi -encoding=`file --brief --mime-encoding $file_common_opts "$1"` +encoding=`file --mime-encoding $file_common_opts "$1"` if [ -n "$lexer" ]; then # FIXME: Specify input encoding rather than output encoding https://bitbucket.org/birkenfeld/pygments-main/issue/800 |