bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: list-directory's current directory different than that it displays


From: Kevin Rodgers
Subject: Re: list-directory's current directory different than that it displays
Date: Wed, 19 Jun 2002 11:30:42 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Dan Jacobson wrote:

I still don't get why the (little used, by me at least) list-directory
command doesn't change the current directory of its buffer to the
directory that it is displaying.  I mean what more relevant current
directory do you want for that buffer?


This has been in list-directory since at least 19.34:

    (with-output-to-temp-buffer "*Directory*"
      (buffer-disable-undo standard-output)
      (princ "Directory ")
      (princ dirname)
      (terpri)
      (save-excursion
        (set-buffer "*Directory*")
        (setq default-directory
              (if (file-directory-p dirname)
                  (file-name-as-directory dirname)
                (file-name-directory dirname)))
        (let ((wildcard (not (file-directory-p dirname))))
          (insert-directory dirname switches wildcard (not wildcard)))))


At least then C-x C-d / t m p <return> C-x o C-x d <return>
would get us where we wanted when we realize we typed C-x C-d instead
of C-x d.


Works for me.


--
Kevin Rodgers <kevinr@ihs.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]