Function: dired-kill-line

dired-kill-line is an interactive and byte-compiled function defined in dired-aux.el.gz.

Signature

(dired-kill-line &optional ARG)

Documentation

Kill the current line (not the files).

With a prefix argument, kill that many lines starting with the current line.
(A negative argument kills backward.)

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
;;; Commands that delete or redisplay part of the dired buffer

(defun dired-kill-line (&optional arg)
  "Kill the current line (not the files).
With a prefix argument, kill that many lines starting with the current line.
(A negative argument kills backward.)"
  (interactive "P" dired-mode)
  (setq arg (prefix-numeric-value arg))
  (let (buffer-read-only file)
    (while (/= 0 arg)
      (setq file (dired-get-filename nil t))
      (if (not file)
	  (error "Can only kill file lines")
	(save-excursion (and file
			     (dired-goto-subdir file)
			     (dired-kill-subdir)))
	(delete-region (line-beginning-position)
		       (progn (forward-line 1) (point)))
	(if (> arg 0)
	    (setq arg (1- arg))
	  (setq arg (1+ arg))
	  (forward-line -1))))
    (dired-move-to-filename)))