Mercurial > emacs
comparison lisp/dired-x.el @ 83082:108bb5537c12
Merged in changes from CVS HEAD
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-161
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-162
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-163
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-164
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-165
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-166
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-167
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-168
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-169
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-170
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-171
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-172
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-122
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Thu, 25 Mar 2004 22:21:45 +0000 |
parents | 8379dc4bdc83 |
children | d609a0d94db2 |
comparison
equal
deleted
inserted
replaced
83081:32a426d0a0e3 | 83082:108bb5537c12 |
---|---|
5 ;; Maintainer: nobody (want to volunteer?) | 5 ;; Maintainer: nobody (want to volunteer?) |
6 ;; Version: 2.37+ | 6 ;; Version: 2.37+ |
7 ;; Date: 1994/08/18 19:27:42 | 7 ;; Date: 1994/08/18 19:27:42 |
8 ;; Keywords: dired extensions files | 8 ;; Keywords: dired extensions files |
9 | 9 |
10 ;; Copyright (C) 1993, 1994, 1997, 2001, 2003 Free Software Foundation, Inc. | 10 ;; Copyright (C) 1993, 1994, 1997, 2001, 2003, 2004 Free Software Foundation, Inc. |
11 | 11 |
12 ;; This file is part of GNU Emacs. | 12 ;; This file is part of GNU Emacs. |
13 | 13 |
14 ;; GNU Emacs is free software; you can redistribute it and/or modify | 14 ;; GNU Emacs is free software; you can redistribute it and/or modify |
15 ;; it under the terms of the GNU General Public License as published by | 15 ;; it under the terms of the GNU General Public License as published by |
885 ;;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not | 885 ;;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not |
886 ;;; install GNU zip's version of zcat. | 886 ;;; install GNU zip's version of zcat. |
887 | 887 |
888 (defvar dired-guess-shell-alist-default | 888 (defvar dired-guess-shell-alist-default |
889 (list | 889 (list |
890 (list "\\.tar$" '(if dired-guess-shell-gnutar | 890 (list "\\.tar$" |
891 (concat dired-guess-shell-gnutar " xvf") | 891 '(if dired-guess-shell-gnutar |
892 "tar xvf")) | 892 (concat dired-guess-shell-gnutar " xvf") |
893 "tar xvf") | |
894 ;; Extract files into a separate subdirectory | |
895 '(if dired-guess-shell-gnutar | |
896 (concat "mkdir " (file-name-sans-extension file) | |
897 "; " dired-guess-shell-gnutar " -C " | |
898 (file-name-sans-extension file) " -xvf") | |
899 (concat "mkdir " (file-name-sans-extension file) | |
900 "; tar -C " (file-name-sans-extension file) " -xvf"))) | |
893 | 901 |
894 ;; REGEXPS for compressed archives must come before the .Z rule to | 902 ;; REGEXPS for compressed archives must come before the .Z rule to |
895 ;; be recognized: | 903 ;; be recognized: |
896 (list "\\.tar\\.Z$" | 904 (list "\\.tar\\.Z$" |
897 ;; Untar it. | 905 ;; Untar it. |
905 ;; gzip'ed archives | 913 ;; gzip'ed archives |
906 (list "\\.t\\(ar\\.\\)?gz$" | 914 (list "\\.t\\(ar\\.\\)?gz$" |
907 '(if dired-guess-shell-gnutar | 915 '(if dired-guess-shell-gnutar |
908 (concat dired-guess-shell-gnutar " zxvf") | 916 (concat dired-guess-shell-gnutar " zxvf") |
909 (concat "gunzip -qc * | tar xvf -")) | 917 (concat "gunzip -qc * | tar xvf -")) |
918 ;; Extract files into a separate subdirectory | |
919 '(if dired-guess-shell-gnutar | |
920 (concat "mkdir " (file-name-sans-extension file) | |
921 "; " dired-guess-shell-gnutar " -C " | |
922 (file-name-sans-extension file) " -zxvf") | |
923 (concat "mkdir " (file-name-sans-extension file) | |
924 "; gunzip -qc * | tar -C " | |
925 (file-name-sans-extension file) " -xvf -")) | |
910 ;; Optional decompression. | 926 ;; Optional decompression. |
911 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q" ""))) | 927 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q" ""))) |
928 | |
912 ;; bzip2'ed archives | 929 ;; bzip2'ed archives |
913 (list "\\.tar\\.bz2$" | 930 (list "\\.t\\(ar\\.bz2\\|bz\\)$" |
914 "bunzip2 -c * | tar xvf -" | 931 "bunzip2 -c * | tar xvf -" |
932 ;; Extract files into a separate subdirectory | |
933 '(concat "mkdir " (file-name-sans-extension file) | |
934 "; bunzip2 -c * | tar -C " | |
935 (file-name-sans-extension file) " -xvf -") | |
915 ;; Optional decompression. | 936 ;; Optional decompression. |
916 "bunzip2") | 937 "bunzip2") |
917 | 938 |
918 '("\\.shar.Z$" "zcat * | unshar") | 939 '("\\.shar\\.Z$" "zcat * | unshar") |
919 '("\\.shar.g?z$" "gunzip -qc * | unshar") | 940 '("\\.shar\\.g?z$" "gunzip -qc * | unshar") |
920 | 941 |
921 '("\\.e?ps$" "ghostview" "xloadimage" "lpr") | 942 '("\\.e?ps$" "ghostview" "xloadimage" "lpr") |
922 (list "\\.e?ps.g?z$" "gunzip -qc * | ghostview -" | 943 (list "\\.e?ps\\.g?z$" "gunzip -qc * | ghostview -" |
923 ;; Optional decompression. | 944 ;; Optional decompression. |
924 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) | 945 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) |
925 (list "\\.e?ps.Z$" "zcat * | ghostview -" | 946 (list "\\.e?ps\\.Z$" "zcat * | ghostview -" |
926 ;; Optional conversion to gzip format. | 947 ;; Optional conversion to gzip format. |
927 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") | 948 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") |
928 " " dired-guess-shell-znew-switches)) | 949 " " dired-guess-shell-znew-switches)) |
950 | |
929 '("\\.patch$" "cat * | patch") | 951 '("\\.patch$" "cat * | patch") |
930 '("\\.patch.g?z$" "gunzip -qc * | patch") | 952 (list "\\.patch\\.g?z$" "gunzip -qc * | patch" |
931 (list "\\.patch.Z$" "zcat * | patch" | 953 ;; Optional decompression. |
954 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) | |
955 (list "\\.patch\\.Z$" "zcat * | patch" | |
932 ;; Optional conversion to gzip format. | 956 ;; Optional conversion to gzip format. |
933 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") | 957 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") |
934 " " dired-guess-shell-znew-switches)) | 958 " " dired-guess-shell-znew-switches)) |
959 | |
960 ;; The following four extensions are useful with dired-man ("N" key) | |
961 (list "\\.[0-9]$" '(progn (require 'man) | |
962 (if (Man-support-local-filenames) | |
963 "man -l" | |
964 "cat * | tbl | nroff -man -h"))) | |
965 (list "\\.[0-9]\\.g?z$" '(progn (require 'man) | |
966 (if (Man-support-local-filenames) | |
967 "man -l" | |
968 "gunzip -qc * | tbl | nroff -man -h")) | |
969 ;; Optional decompression. | |
970 '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) | |
971 (list "\\.[0-9]\\.Z$" '(progn (require 'man) | |
972 (if (Man-support-local-filenames) | |
973 "man -l" | |
974 "zcat * | tbl | nroff -man -h")) | |
975 ;; Optional conversion to gzip format. | |
976 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") | |
977 " " dired-guess-shell-znew-switches)) | |
978 '("\\.pod$" "perldoc" "pod2man * | nroff -man") | |
935 | 979 |
936 '("\\.dvi$" "xdvi" "dvips") ; preview and printing | 980 '("\\.dvi$" "xdvi" "dvips") ; preview and printing |
937 '("\\.au$" "play") ; play Sun audiofiles | 981 '("\\.au$" "play") ; play Sun audiofiles |
938 '("\\.mpg$" "mpeg_play") | 982 '("\\.mpg$" "mpeg_play") |
939 '("\\.uu$" "uudecode") ; for uudecoded files | 983 '("\\.uu$" "uudecode") ; for uudecoded files |
943 '("\\.gp$" "gnuplot") | 987 '("\\.gp$" "gnuplot") |
944 '("\\.p[bgpn]m$" "xloadimage") | 988 '("\\.p[bgpn]m$" "xloadimage") |
945 '("\\.gif$" "xloadimage") ; view gif pictures | 989 '("\\.gif$" "xloadimage") ; view gif pictures |
946 '("\\.tif$" "xloadimage") | 990 '("\\.tif$" "xloadimage") |
947 '("\\.png$" "display") ; xloadimage 4.1 doesn't grok PNG | 991 '("\\.png$" "display") ; xloadimage 4.1 doesn't grok PNG |
948 '("\\.jpg$" "xloadimage") | 992 '("\\.jpe?g$" "xloadimage") |
949 '("\\.fig$" "xfig") ; edit fig pictures | 993 '("\\.fig$" "xfig") ; edit fig pictures |
950 '("\\.out$" "xgraph") ; for plotting purposes. | 994 '("\\.out$" "xgraph") ; for plotting purposes. |
951 '("\\.tex$" "latex" "tex") | 995 '("\\.tex$" "latex" "tex") |
952 '("\\.texi\\(nfo\\)?$" "makeinfo" "texi2dvi") | 996 '("\\.texi\\(nfo\\)?$" "makeinfo" "texi2dvi") |
953 '("\\.pdf$" "xpdf") ; edit PDF files | 997 '("\\.pdf$" "xpdf") ; edit PDF files |
954 | 998 |
955 ;; Some other popular archivers. | 999 ;; Some other popular archivers. |
1000 (list "\\.zip$" "unzip" | |
1001 ;; Extract files into a separate subdirectory | |
1002 '(concat "unzip" (if dired-guess-shell-gzip-quiet " -q") | |
1003 " -d " (file-name-sans-extension file))) | |
956 '("\\.zoo$" "zoo x//") | 1004 '("\\.zoo$" "zoo x//") |
957 '("\\.zip$" "unzip") | |
958 '("\\.lzh$" "lharc x") | 1005 '("\\.lzh$" "lharc x") |
959 '("\\.arc$" "arc x") | 1006 '("\\.arc$" "arc x") |
960 '("\\.shar$" "unshar") | 1007 '("\\.shar$" "unshar") |
961 | 1008 |
962 ;; Compression. | 1009 ;; Compression. |
963 (list "\\.g?z$" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) | 1010 (list "\\.g?z$" '(concat "gunzip" (if dired-guess-shell-gzip-quiet " -q"))) |
1011 (list "\\.dz$" "dictunzip") | |
964 (list "\\.bz2$" "bunzip2") | 1012 (list "\\.bz2$" "bunzip2") |
965 (list "\\.Z$" "uncompress" | 1013 (list "\\.Z$" "uncompress" |
966 ;; Optional conversion to gzip format. | 1014 ;; Optional conversion to gzip format. |
967 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") | 1015 '(concat "znew" (if dired-guess-shell-gzip-quiet " -q") |
968 " " dired-guess-shell-znew-switches)) | 1016 " " dired-guess-shell-znew-switches)) |
996 \"BAR-COMMAND-1\" | 1044 \"BAR-COMMAND-1\" |
997 \"BAR-COMMAND-2\")))\)" | 1045 \"BAR-COMMAND-2\")))\)" |
998 :group 'dired-x | 1046 :group 'dired-x |
999 :type '(alist :key-type regexp :value-type (repeat sexp))) | 1047 :type '(alist :key-type regexp :value-type (repeat sexp))) |
1000 | 1048 |
1001 (defvar dired-guess-shell-case-fold-search nil | 1049 (defcustom dired-guess-shell-case-fold-search t |
1002 "*If non-nil, `dired-guess-shell-alist-default' and | 1050 "If non-nil, `dired-guess-shell-alist-default' and |
1003 `dired-guess-shell-alist-user' are matched case-insensitively.") | 1051 `dired-guess-shell-alist-user' are matched case-insensitively." |
1052 :group 'dired-x | |
1053 :type 'boolean) | |
1004 | 1054 |
1005 (defun dired-guess-default (files) | 1055 (defun dired-guess-default (files) |
1006 "Guess a shell commands for FILES. Return command or list of commands. | 1056 "Guess a shell commands for FILES. Return command or list of commands. |
1007 See `dired-guess-shell-alist-user'." | 1057 See `dired-guess-shell-alist-user'." |
1008 | 1058 |
1276 (defun dired-man () | 1326 (defun dired-man () |
1277 "Run man on this file. Display old buffer if buffer name matches filename. | 1327 "Run man on this file. Display old buffer if buffer name matches filename. |
1278 Uses ../lisp/man.el of \\[manual-entry] fame." | 1328 Uses ../lisp/man.el of \\[manual-entry] fame." |
1279 (interactive) | 1329 (interactive) |
1280 (require 'man) | 1330 (require 'man) |
1281 (let ((file (dired-get-filename)) | 1331 (let* ((file (dired-get-filename)) |
1282 (manual-program "nroff -man -h")) | 1332 (manual-program (replace-regexp-in-string "\\*" "%s" |
1333 (dired-guess-shell-command | |
1334 "Man command: " (list file))))) | |
1283 (Man-getpage-in-background file))) | 1335 (Man-getpage-in-background file))) |
1284 | 1336 |
1285 ;;; Run Info on files. | 1337 ;;; Run Info on files. |
1286 | 1338 |
1287 (defun dired-info () | 1339 (defun dired-info () |