comparison lisp/dired.el @ 834:2e0cd4e83c2e

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Tue, 21 Jul 1992 22:40:10 +0000
parents cd00bdacc17b
children 5b1c5b4286e7
comparison
equal deleted inserted replaced
833:14748faa4f17 834:2e0cd4e83c2e
1 ;; DIRED commands for Emacs. $Revision: 5.234 $ 1 ;; dired.el --- directory-browsing commands
2
3 ;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>.
4 ;; Version: 5.234
5 ;; Last-Modified: 14 Jul 1992
6
2 ;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. 7 ;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
3 8
4 ;; This file is part of GNU Emacs. 9 ;; This file is part of GNU Emacs.
5 10
6 ;; GNU Emacs is free software; you can redistribute it and/or modify 11 ;; GNU Emacs is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by 12 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation; either version 1, or (at your option) 13 ;; the Free Software Foundation; either version 2, or (at your option)
9 ;; any later version. 14 ;; any later version.
10 15
11 ;; GNU Emacs is distributed in the hope that it will be useful, 16 ;; GNU Emacs is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 20
16 ;; You should have received a copy of the GNU General Public License 21 ;; You should have received a copy of the GNU General Public License
17 ;; along with GNU Emacs; see the file COPYING. If not, write to 22 ;; along with GNU Emacs; see the file COPYING. If not, write to
18 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 24
25 ;;; Commentary:
26
20 ;; Rewritten in 1990/1991 to add tree features, file marking and 27 ;; Rewritten in 1990/1991 to add tree features, file marking and
21 ;; sorting by Sebastian Kremer <sk@thp.uni-koeln.de>. 28 ;; sorting by Sebastian Kremer <sk@thp.uni-koeln.de>.
22 ;; Finished up by rms in 1992. 29 ;; Finished up by rms in 1992.
23 30
24 (provide 'dired) 31 ;;; Code:
25 32
26 ;; compatibility package when using Emacs 18.55 33 ;; compatibility package when using Emacs 18.55
27 (defvar dired-emacs-19-p (equal (substring emacs-version 0 2) "19")) 34 (defvar dired-emacs-19-p (equal (substring emacs-version 0 2) "19"))
28 ;;;>>> install (is there a better way to test for Emacs 19?) 35 ;;;>>> install (is there a better way to test for Emacs 19?)
29 (or dired-emacs-19-p 36 (or dired-emacs-19-p
354 "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it. 361 "\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.
355 Optional second argument SWITCHES specifies the `ls' options used. 362 Optional second argument SWITCHES specifies the `ls' options used.
356 \(Interactively, use a prefix argument to be able to specify SWITCHES.) 363 \(Interactively, use a prefix argument to be able to specify SWITCHES.)
357 Dired displays a list of files in DIRNAME (which may also have 364 Dired displays a list of files in DIRNAME (which may also have
358 shell wildcards appended to select certain files). 365 shell wildcards appended to select certain files).
366 \\<dired-mode-map>\
359 You can move around in it with the usual commands. 367 You can move around in it with the usual commands.
360 You can flag files for deletion with \\<dired-mode-map>\\[dired-flag-file-deletion] and then delete them by 368 You can flag files for deletion with \\[dired-flag-file-deletion] and then delete them by
361 typing \\[dired-do-flagged-delete]. 369 typing \\[dired-do-flagged-delete].
362 Type \\[describe-mode] after entering dired for more info. 370 Type \\[describe-mode] after entering dired for more info.
363 371
364 If DIRNAME is already in a dired buffer, that buffer is used without refresh." 372 If DIRNAME is already in a dired buffer, that buffer is used without refresh."
365 ;; Cannot use (interactive "D") because of wildcards. 373 ;; Cannot use (interactive "D") because of wildcards.
587 (setq dir (car (car l)) 595 (setq dir (car (car l))
588 pos (cdr (car l)) 596 pos (cdr (car l))
589 l (cdr l)) 597 l (cdr l))
590 (goto-char pos) 598 (goto-char pos)
591 (skip-chars-forward "^\r\n") 599 (skip-chars-forward "^\r\n")
592 (if (eq (following-character) ?\r) 600 (if (eq (following-char) ?\r)
593 (setq result (cons dir result)))) 601 (setq result (cons dir result))))
594 result)) 602 result))
595 603
596 ;; Try to insert all subdirs that were displayed before, 604 ;; Try to insert all subdirs that were displayed before,
597 ;; according to the former subdir alist OLD-SUBDIR-ALIST. 605 ;; according to the former subdir alist OLD-SUBDIR-ALIST.
944 (defun dired-make-relative (file &optional dir no-error) 952 (defun dired-make-relative (file &optional dir no-error)
945 ;;"Convert FILE (an absolute pathname) to a pathname relative to DIR. 953 ;;"Convert FILE (an absolute pathname) to a pathname relative to DIR.
946 ;; Else error (unless NO-ERROR is non-nil, then FILE is returned unchanged) 954 ;; Else error (unless NO-ERROR is non-nil, then FILE is returned unchanged)
947 ;;DIR defaults to default-directory." 955 ;;DIR defaults to default-directory."
948 ;; DIR must be file-name-as-directory, as with all directory args in 956 ;; DIR must be file-name-as-directory, as with all directory args in
949 ;; elisp code. 957 ;; Emacs Lisp code.
950 (or dir (setq dir default-directory)) 958 (or dir (setq dir default-directory))
951 (if (string-match (concat "^" (regexp-quote dir)) file) 959 (if (string-match (concat "^" (regexp-quote dir)) file)
952 (substring file (match-end 0)) 960 (substring file (match-end 0))
953 (if no-error 961 (if no-error
954 file 962 file
1557 (interactive "P") 1565 (interactive "P")
1558 (if (and dired-subdir-alist (dired-get-subdir)) 1566 (if (and dired-subdir-alist (dired-get-subdir))
1559 (save-excursion (dired-mark-subdir-files)) 1567 (save-excursion (dired-mark-subdir-files))
1560 (let (buffer-read-only) 1568 (let (buffer-read-only)
1561 (dired-repeat-over-lines 1569 (dired-repeat-over-lines
1562 arg 1570 (prefix-numeric-value arg)
1563 (function (lambda () (delete-char 1) (insert dired-marker-char))))))) 1571 (function (lambda () (delete-char 1) (insert dired-marker-char)))))))
1564 1572
1565 (defun dired-unmark (arg) 1573 (defun dired-unmark (arg)
1566 "Unmark the current (or next ARG) files. 1574 "Unmark the current (or next ARG) files.
1567 If looking at a subdir, unmark all its files except `.' and `..'." 1575 If looking at a subdir, unmark all its files except `.' and `..'."
2124 (if (eq system-type 'vax-vms) 2132 (if (eq system-type 'vax-vms)
2125 (load "dired-vms")) 2133 (load "dired-vms"))
2126 2134
2127 (run-hooks 'dired-load-hook) ; for your customizations 2135 (run-hooks 'dired-load-hook) ; for your customizations
2128 2136
2137 (provide 'dired)
2138
2139 ;;; dired.el ends here