unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Luc Teirlinck <teirllm@dms.auburn.edu>
Subject: `k' in Dired with inserted subdirectories.
Date: Sun, 6 Jun 2004 21:06:34 -0500 (CDT)	[thread overview]
Message-ID: <200406070206.i5726YA11411@raven.dms.auburn.edu> (raw)

There are inconsistencies regarding the behavior of `k' for subdirectories.
Also, `dired-do-kill-lines' contains several lines of code that can
_never_ be executed.

First problem:

Doc string:

  To kill an entire subdirectory, go to its directory header line and
  use this command with a prefix argument (the value does not matter).

No other way to kill a subdirectory is mentioned.

Emacs manual:

     If you kill the line for a file that is a directory, the directory's
  contents are also deleted from the buffer.  Typing `C-u k' on the
  header line for a subdirectory is another way to delete a subdirectory
  from the Dired buffer.

The fact that C-u k on a subdirectory header line kills that
subdirectory is uncontested.  But what for `k' on a line for a file
that is a directory (but _not_ a directory header line)?

Actual behavior:

If a numeric prefix argument is used and if the directory is inserted in
the buffer, it _is_ removed.  But if marks are used, it is _not_ removed.
What _should_ the behavior be?  Or is the current behavior for some
reason OK, but just not correctly documented?

Second problem with `dired-do-kill-lines':

There is some code in `dired-do-kill-lines' that attempts to delete
all lines that are _not_ marked if a numeric prefix argument is given.
This conflicts with the standard meaning of a numeric prefix argument
in Dired, which `dired-do-kill-lines' _also_ implements.  As a result the
`delete-if-not-marked' with numeric prefix argument code will _never_ be
executed.  So why is it there?  It will never cause bugs, but it is
confusing:

  (if arg
      (if (dired-get-subdir)
        (dired-kill-subdir)
	(dired-kill-line arg))
    ;; Pesonal remark: arg is nil now.
    (save-excursion
      (goto-char (point-min))
      (let (buffer-read-only (count 0))
      ;; Personal remark:  This is equivalent with:
      ;; (if t                          ; kill marked lies
      (if (not arg)			; kill marked lines
 

   ;; else kill unmarked lines
   ;; Personal remark: who cares, `else' _never_ happens.
     (while (not (eobp))         

Sincerely,

Luc.

             reply	other threads:[~2004-06-07  2:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-07  2:06 Luc Teirlinck [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-07-13 19:55 `k' in Dired with inserted subdirectories Luc Teirlinck
2004-07-13 20:19 ` Luc Teirlinck
2004-07-13 20:43 ` Luc Teirlinck
2004-07-14 18:26 ` Richard Stallman
2004-07-15 21:16   ` Luc Teirlinck
2004-07-16 16:08     ` Richard Stallman
2004-07-16 16:57       ` Luc Teirlinck
2004-07-18  7:18         ` Richard Stallman
2004-07-15 21:19   ` Luc Teirlinck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200406070206.i5726YA11411@raven.dms.auburn.edu \
    --to=teirllm@dms.auburn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).