unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to call a function on every directory change (in dired)?
@ 2010-09-28 12:34 Marc Mientki
  2010-09-28 12:37 ` Marc Mientki
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Mientki @ 2010-09-28 12:34 UTC (permalink / raw)
  To: help-gnu-emacs

Hello!

I have some problem which I can't solve myself.

My goal is to run one specified function *each time* I enter
a directory in dired-mode. After some investigation I found
seemingly the right hook: dired-after-readin-hook. I defined the
test function foo:

(defun foo ()
   (message "--> huhu"))

and add it to the above hook:

(add-hook 'dired-after-readin-hook 'foo)

Now when I enter first time a directory everything works fine -
I see in minibuffer '--> huhu'. The problem is when I leave the
directory (I do RET on '..', or press '^' - NOT kill buffer) and
enter this directory once again foo will be not called. I think
the reason is that in case of reenter of a directory - which
has already an existing buffer - dired only switch to this buffer
so the dired-after-readin-hook is not affected. But I can't find
no bufer hook that can solve my problem. Some analysis of lisp
code in dired.el (dired-find-file) and files.el (find-file)
brought no success.

Any ideas?

regards
Marc



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-09-30  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28 12:34 How to call a function on every directory change (in dired)? Marc Mientki
2010-09-28 12:37 ` Marc Mientki
2010-09-28 12:55   ` Marc Mientki
2010-09-28 19:04     ` Xah Lee
2010-09-30  9:01       ` Marc Mientki
2010-09-30  9:15         ` Xah Lee

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).