comparison lisp/efs/dired.el @ 114:8619ce7e4c50 r20-1b9

Import from CVS: tag r20-1b9
author cvs
date Mon, 13 Aug 2007 09:21:54 +0200
parents 4be1180a9e89
children 9f59509498e1
comparison
equal deleted inserted replaced
113:2ec2fe4a4c89 114:8619ce7e4c50
3 ;; Copyright (C) 1985, 1986, 1991 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985, 1986, 1991 Free Software Foundation, Inc.
4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5 ;; 5 ;;
6 ;; File: dired.el 6 ;; File: dired.el
7 ;; RCS: 7 ;; RCS:
8 ;; Dired Version: $Revision: 1.3 $ 8 ;; Dired Version: $Revision: 1.4 $
9 ;; Description: The DIRectory EDitor is for manipulating, and running 9 ;; Description: The DIRectory EDitor is for manipulating, and running
10 ;; commands on files in a directory. 10 ;; commands on files in a directory.
11 ;; Authors: FSF, 11 ;; Authors: FSF,
12 ;; Sebastian Kremer <sk@thp.uni-koeln.de>, 12 ;; Sebastian Kremer <sk@thp.uni-koeln.de>,
13 ;; Sandy Rutherford <sandy@ibm550.sissa.it> 13 ;; Sandy Rutherford <sandy@ibm550.sissa.it>
34 ;; 7-1993: Added special features for efs interaction and upgraded to Emacs 19. 34 ;; 7-1993: Added special features for efs interaction and upgraded to Emacs 19.
35 ;; Sandy Rutherford <sandy@ibm550.sissa.it> 35 ;; Sandy Rutherford <sandy@ibm550.sissa.it>
36 36
37 ;;; Dired Version 37 ;;; Dired Version
38 38
39 (defconst dired-version (substring "$Revision: 1.3 $" 11 -2) 39 (defconst dired-version (substring "$Revision: 1.4 $" 11 -2)
40 "The revision number of Tree Dired (as a string). 40 "The revision number of Tree Dired (as a string).
41 41
42 Don't forget to mention this when reporting bugs to: 42 Don't forget to mention this when reporting bugs to:
43 43
44 efs-bugs@cuckoo.hpl.hp.com") 44 efs-bugs@cuckoo.hpl.hp.com")
90 ((and (= ver 19) (if lucid-p (< subver 10) (< subver 23))) 90 ((and (= ver 19) (if lucid-p (< subver 10) (< subver 23)))
91 (require 'fn-handler)) 91 (require 'fn-handler))
92 ((< ver 18) 92 ((< ver 18)
93 (error "dired does not work with emacs version %s" emacs-version)))) 93 (error "dired does not work with emacs version %s" emacs-version))))
94 94
95 ;; Load default-dir last, because we want its interactive specs. 95 ;; We duplicate default-dir stuff to avoid its overwrites unless
96 (require 'default-dir) 96 ;; they are explicitly requested.
97 97
98 (defvar default-directory-function nil
99 "A function to call to compute the default-directory for the current buffer.
100 If this is nil, the function default-directory will return the value of the
101 variable default-directory.
102 Buffer local.")
103 (make-variable-buffer-local 'default-directory-function)
104
105 (defun default-directory ()
106 " Returns the default-directory for the current buffer.
107 Will use the variable default-directory-function if it non-nil."
108 (if default-directory-function
109 (funcall default-directory-function)
110 (if (string-match "Lucid" emacs-version)
111 (abbreviate-file-name default-directory t)
112 (abbreviate-file-name default-directory))))
98 113
99 ;;;;---------------------------------------------------------------- 114 ;;;;----------------------------------------------------------------
100 ;;;; Customizable variables 115 ;;;; Customizable variables
101 ;;;;---------------------------------------------------------------- 116 ;;;;----------------------------------------------------------------
102 ;; 117 ;;
141 `force-flag' is the switch to pass to the command to force overwriting 156 `force-flag' is the switch to pass to the command to force overwriting
142 of existing files. 157 of existing files.
143 158
144 For example: 159 For example:
145 160
146 \(setq dired-compresssion-method-alist 161 \(setq dired-compression-method-alist
147 \(cons '\(frobnicate \".frob\" \(\"frob\"\) \(\"frob\" \"-d\"\) \"-f\"\) 162 \(cons '\(frobnicate \".frob\" \(\"frob\"\) \(\"frob\" \"-d\"\) \"-f\"\)
148 dired-compression-method-alist\)\) 163 dired-compression-method-alist\)\)
149 => \(\(frobnicate \".frob\" \(\"frob\"\) \(\"frob\" \"-d\"\)\) 164 => \(\(frobnicate \".frob\" \(\"frob\"\) \(\"frob\" \"-d\"\)\)
150 \(gzip \".gz\" \(\"gzip\"\) \(\"gunzip\"\)\) 165 \(gzip \".gz\" \(\"gzip\"\) \(\"gunzip\"\)\)
151 ...\) 166 ...\)
205 ;; an exception as it is not always in the PATH. 220 ;; an exception as it is not always in the PATH.
206 221
207 ;;;###autoload 222 ;;;###autoload
208 (defvar dired-chown-program 223 (defvar dired-chown-program
209 (if (memq system-type '(hpux dgux usg-unix-v)) "chown" "/etc/chown") 224 (if (memq system-type '(hpux dgux usg-unix-v)) "chown" "/etc/chown")
210 "*Name of chown command (usully `chown' or `/etc/chown').") 225 "*Name of chown command (usually `chown' or `/etc/chown').")
211 226
212 ;;;###autoload 227 ;;;###autoload
213 (defvar dired-gnutar-program nil 228 (defvar dired-gnutar-program nil
214 "*If non-nil, name of the GNU tar executable (e.g. \"tar\" or \"gnutar\"). 229 "*If non-nil, name of the GNU tar executable (e.g. \"tar\" or \"gnutar\").
215 GNU tar's `z' switch is used for compressed tar files. 230 GNU tar's `z' switch is used for compressed tar files.
3774 (defun dired-mark-file (arg &optional char) 3789 (defun dired-mark-file (arg &optional char)
3775 "Mark ARG files starting from the current file line. 3790 "Mark ARG files starting from the current file line.
3776 Optional CHAR indicates a marker character to use." 3791 Optional CHAR indicates a marker character to use."
3777 (let (buffer-read-only) 3792 (let (buffer-read-only)
3778 (if (memq (or char dired-marker-char) '(?\ ?\n ?\r)) 3793 (if (memq (or char dired-marker-char) '(?\ ?\n ?\r))
3779 (error "Invalid marker charcter %c" dired-marker-char)) 3794 (error "Invalid marker character %c" dired-marker-char))
3780 (or char (setq char dired-marker-char)) 3795 (or char (setq char dired-marker-char))
3781 (dired-repeat-over-lines 3796 (dired-repeat-over-lines
3782 arg 3797 arg
3783 (function 3798 (function
3784 (lambda () 3799 (lambda ()