From 633cee46837bd9f8b6b1288f8951ad6e0f2cbd23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Spiegel?= Date: Fri, 12 Jun 1998 11:13:37 +0000 Subject: [PATCH] (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. --- lisp/vc.el | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lisp/vc.el b/lisp/vc.el index 9759fc99bc3..c5d8db981c9 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -5,7 +5,7 @@ ;; Author: Eric S. Raymond ;; Maintainer: Andre Spiegel -;; $Id: vc.el,v 1.229 1998/06/05 12:46:29 spiegel Exp spiegel $ +;; $Id: vc.el,v 1.230 1998/06/11 15:33:13 spiegel Exp spiegel $ ;; This file is part of GNU Emacs. @@ -1761,7 +1761,11 @@ There is a special command, `*l', to mark all files currently locked." (goto-char pos) (dired-kill-line))) (vc-dired-terse-mode - (dired-kill-line)) + ;; Don't show directories in terse mode. Don't use + ;; dired-kill-line to remove it, because in recursive listings, + ;; that would remove the directory contents as well. + (delete-region (progn (beginning-of-line) (point)) + (progn (forward-line 1) (point)))) ((string-match "\\`\\.\\.?\\'" (file-name-nondirectory filename)) (dired-kill-line)) (t @@ -1785,8 +1789,9 @@ There is a special command, `*l', to mark all files currently locked." (message "Getting version information... done") (save-restriction (widen) - (if (eq (count-lines (point-min) (point-max)) 2) - (message "No files locked under %s" default-directory)))) + (cond ((eq (count-lines (point-min) (point-max)) 1) + (goto-char (point-min)) + (message "No files locked under %s" default-directory))))) (defun vc-dired-purge () ;; Remove empty subdirs @@ -1800,6 +1805,10 @@ There is a special command, `*l', to mark all files currently locked." (forward-line -2) (if (not (string= (dired-current-directory) default-directory)) (dired-do-kill-lines t "") + ;; We cannot remove the top level directory. + ;; Just make it look a little nicer. + (forward-line 1) + (kill-line) (if (not (dired-next-subdir 1 t)) (goto-char (point-max)))))) (goto-char (point-min)))) -- 2.39.5