comparison lisp/vc.el @ 22453:9d9df85eb7fb

(vc-dired-hook): Don't use dired-kill-line to remove directory lines in terse mode. (vc-dired-purge): If the top level dir is empty, make it look a little nicer.
author André Spiegel <spiegel@gnu.org>
date Fri, 12 Jun 1998 11:13:37 +0000
parents 982bf2f2c1de
children 115ca3d4f9c4
comparison
equal deleted inserted replaced
22452:337f283a8035 22453:9d9df85eb7fb
3 ;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. 3 ;; Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
4 4
5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com> 5 ;; Author: Eric S. Raymond <esr@snark.thyrsus.com>
6 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de> 6 ;; Maintainer: Andre Spiegel <spiegel@inf.fu-berlin.de>
7 7
8 ;; $Id: vc.el,v 1.229 1998/06/05 12:46:29 spiegel Exp spiegel $ 8 ;; $Id: vc.el,v 1.230 1998/06/11 15:33:13 spiegel Exp spiegel $
9 9
10 ;; This file is part of GNU Emacs. 10 ;; This file is part of GNU Emacs.
11 11
12 ;; GNU Emacs is free software; you can redistribute it and/or modify 12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by 13 ;; it under the terms of the GNU General Public License as published by
1759 (let ((pos (point))) 1759 (let ((pos (point)))
1760 (dired-kill-tree filename) 1760 (dired-kill-tree filename)
1761 (goto-char pos) 1761 (goto-char pos)
1762 (dired-kill-line))) 1762 (dired-kill-line)))
1763 (vc-dired-terse-mode 1763 (vc-dired-terse-mode
1764 (dired-kill-line)) 1764 ;; Don't show directories in terse mode. Don't use
1765 ;; dired-kill-line to remove it, because in recursive listings,
1766 ;; that would remove the directory contents as well.
1767 (delete-region (progn (beginning-of-line) (point))
1768 (progn (forward-line 1) (point))))
1765 ((string-match "\\`\\.\\.?\\'" (file-name-nondirectory filename)) 1769 ((string-match "\\`\\.\\.?\\'" (file-name-nondirectory filename))
1766 (dired-kill-line)) 1770 (dired-kill-line))
1767 (t 1771 (t
1768 (vc-dired-reformat-line nil) 1772 (vc-dired-reformat-line nil)
1769 (forward-line 1)))) 1773 (forward-line 1))))
1783 (t (forward-line 1)))) 1787 (t (forward-line 1))))
1784 (vc-dired-purge)) 1788 (vc-dired-purge))
1785 (message "Getting version information... done") 1789 (message "Getting version information... done")
1786 (save-restriction 1790 (save-restriction
1787 (widen) 1791 (widen)
1788 (if (eq (count-lines (point-min) (point-max)) 2) 1792 (cond ((eq (count-lines (point-min) (point-max)) 1)
1789 (message "No files locked under %s" default-directory)))) 1793 (goto-char (point-min))
1794 (message "No files locked under %s" default-directory)))))
1790 1795
1791 (defun vc-dired-purge () 1796 (defun vc-dired-purge ()
1792 ;; Remove empty subdirs 1797 ;; Remove empty subdirs
1793 (let (subdir) 1798 (let (subdir)
1794 (goto-char (point-min)) 1799 (goto-char (point-min))
1798 (if (not (dired-next-subdir 1 t)) 1803 (if (not (dired-next-subdir 1 t))
1799 (goto-char (point-max))) 1804 (goto-char (point-max)))
1800 (forward-line -2) 1805 (forward-line -2)
1801 (if (not (string= (dired-current-directory) default-directory)) 1806 (if (not (string= (dired-current-directory) default-directory))
1802 (dired-do-kill-lines t "") 1807 (dired-do-kill-lines t "")
1808 ;; We cannot remove the top level directory.
1809 ;; Just make it look a little nicer.
1810 (forward-line 1)
1811 (kill-line)
1803 (if (not (dired-next-subdir 1 t)) 1812 (if (not (dired-next-subdir 1 t))
1804 (goto-char (point-max)))))) 1813 (goto-char (point-max))))))
1805 (goto-char (point-min)))) 1814 (goto-char (point-min))))
1806 1815
1807 ;;;###autoload 1816 ;;;###autoload