163 |
(unless (let ((list list2)) |
(unless (let ((list list2)) |
164 |
(while (and list |
(while (and list |
165 |
(not (let* ((file2 (car list)) |
(not (let* ((file2 (car list)) |
166 |
(fa1 (caddr file1)) |
(fa1 (car (cddr file1))) |
167 |
(fa2 (caddr file2)) |
(fa2 (car (cddr file2))) |
168 |
(size1 (nth 7 fa1)) |
(size1 (nth 7 fa1)) |
169 |
(size2 (nth 7 fa2)) |
(size2 (nth 7 fa2)) |
170 |
(mtime1 (float-time (nth 5 fa1))) |
(mtime1 (float-time (nth 5 fa1))) |
627 |
(defun dired-do-kill-lines (&optional arg fmt) |
(defun dired-do-kill-lines (&optional arg fmt) |
628 |
"Kill all marked lines (not the files). |
"Kill all marked lines (not the files). |
629 |
With a prefix argument, kill that many lines starting with the current line. |
With a prefix argument, kill that many lines starting with the current line. |
630 |
\(A negative argument kills lines before the current line.) |
\(A negative argument kills backward.) |
631 |
To kill an entire subdirectory, go to its directory header line |
If you use this command with a prefix argument to kill the line |
632 |
and use this command with a prefix argument (the value does not matter)." |
for a file that is a directory, which you have inserted in the |
633 |
|
Dired buffer as a subdirectory, then it deletes that subdirectory |
634 |
|
from the buffer as well. |
635 |
|
To kill an entire subdirectory \(without killing its line in the |
636 |
|
parent directory), go to its directory header line and use this |
637 |
|
command with a prefix argument (the value does not matter)." |
638 |
;; Returns count of killed lines. FMT="" suppresses message. |
;; Returns count of killed lines. FMT="" suppresses message. |
639 |
(interactive "P") |
(interactive "P") |
640 |
(if arg |
(if arg |
643 |
(dired-kill-line arg)) |
(dired-kill-line arg)) |
644 |
(save-excursion |
(save-excursion |
645 |
(goto-char (point-min)) |
(goto-char (point-min)) |
646 |
(let (buffer-read-only (count 0)) |
(let (buffer-read-only |
647 |
(if (not arg) ; kill marked lines |
(count 0) |
648 |
(let ((regexp (dired-marker-regexp))) |
(regexp (dired-marker-regexp))) |
649 |
(while (and (not (eobp)) |
(while (and (not (eobp)) |
650 |
(re-search-forward regexp nil t)) |
(re-search-forward regexp nil t)) |
651 |
(setq count (1+ count)) |
(setq count (1+ count)) |
652 |
(delete-region (progn (beginning-of-line) (point)) |
(delete-region (progn (beginning-of-line) (point)) |
653 |
(progn (forward-line 1) (point))))) |
(progn (forward-line 1) (point)))) |
|
;; else kill unmarked lines |
|
|
(while (not (eobp)) |
|
|
(if (or (dired-between-files) |
|
|
(not (looking-at "^ "))) |
|
|
(forward-line 1) |
|
|
(setq count (1+ count)) |
|
|
(delete-region (point) (save-excursion |
|
|
(forward-line 1) |
|
|
(point)))))) |
|
654 |
(or (equal "" fmt) |
(or (equal "" fmt) |
655 |
(message (or fmt "Killed %d line%s.") count (dired-plural-s count))) |
(message (or fmt "Killed %d line%s.") count (dired-plural-s count))) |
656 |
count)))) |
count)))) |