Function: dired-do-kill-lines
dired-do-kill-lines is an autoloaded, interactive and byte-compiled
function defined in dired-aux.el.gz.
Signature
(dired-do-kill-lines &optional ARG FMT INIT-COUNT)
Documentation
Remove all marked lines, or the next ARG lines.
The files or directories on those lines are _not_ deleted. Only the
Dired listing is affected. To restore the removals, use M-x revert-buffer (revert-buffer).
With a numeric prefix arg, remove that many lines going forward, starting with the current line. (A negative prefix arg removes lines going backward.)
If you use a prefix arg to remove the line for a subdir whose listing you have inserted into the Dired buffer, then that subdir listing is also removed.
To remove a subdir listing _without_ removing the subdir's line in its parent listing, go to the header line of the subdir listing and use this command with any prefix arg.
When called from Lisp, non-nil INIT-COUNT is added to the number of lines removed by this invocation, for the reporting message.
A FMT of "" will suppress the messaging.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
;;;###autoload
(defun dired-do-kill-lines (&optional arg fmt init-count)
"Remove all marked lines, or the next ARG lines.
The files or directories on those lines are _not_ deleted. Only the
Dired listing is affected. To restore the removals, use \\[revert-buffer].
With a numeric prefix arg, remove that many lines going forward,
starting with the current line. (A negative prefix arg removes lines
going backward.)
If you use a prefix arg to remove the line for a subdir whose listing
you have inserted into the Dired buffer, then that subdir listing is
also removed.
To remove a subdir listing _without_ removing the subdir's line in its
parent listing, go to the header line of the subdir listing and use
this command with any prefix arg.
When called from Lisp, non-nil INIT-COUNT is added to the number of
lines removed by this invocation, for the reporting message.
A FMT of \"\" will suppress the messaging."
;; Returns count of killed lines.
(interactive "P" dired-mode)
(if arg
(if (dired-get-subdir)
(dired-kill-subdir)
(dired-kill-line arg))
(save-excursion
(goto-char (point-min))
(let ((count (or init-count 0))
(regexp (dired-marker-regexp))
(inhibit-read-only t))
(while (and (not (eobp))
(re-search-forward regexp nil t))
(setq count (1+ count))
(delete-region (line-beginning-position)
(progn (forward-line 1) (point))))
(unless (equal "" fmt)
(message (or fmt "Killed %d line%s.") count (dired-plural-s count)))
count))))