Subject: bug#15329: saveplace restores dired positions to random places

From: Drew Adams <[email-masked]>
Date: Mon, 16 Dec 2013 13:15:43 -0800 (PST)

> > Is `dired-directory' really the right test here?  I am used to seeing
> > (derived-mode-p 'dired-mode) for that purpose (assuming I understand the
> > purpose here).
> 
> Yes, `dired-directory' is the right test, because `dired-directory'
> is used as a key in `save-place-alist'.

OK.

> > There is, BTW, nothing in the doc string of `dired-directory' that says
> > what a nil value means.
> 
> Thanks for pointing to the doc string of `dired-directory' where I noticed:
> 
>   May be a list, in which case the car is the
>   directory name and the cdr is the list of files to mention.

Yes, I use that use case quite a lot.

> This case should be handled properly that I added to the following patch.

Great.

> > Should code now instead be using `dired-directory' to test whether the
> > mode is (derived from) Dired?
> 
> Yes, code should be using `dired-directory' now.

OK.  Do you happen to know whether that is only the case now or has been the
case all along?

`dired-directory' is old, but I have always seen `derived-mode-p' used for
the test - and I see it still, e.g., for `dired-toggle-read-only'.  Or does
it perhaps not matter at all which we use?  Looking for what is best to use
with multiple Emacs versions.

> > If so, then at the very least the doc string of that variable should
> > describe such a Boolean meaning: nil means not in Dired mode or a mode
> > derived from it (or whatever the completely correct interpretation is).
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> Are you sure that nil means not in Dired mode or a mode derived from it?

I posed a question; I didn't make a statement.  Let's please describe what
nil means here, whatever that might be.

> Anyway, this is a new version:

Thanks for taking the cons case into account.