[Top][All Lists]

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

Re: Strange error caused by post-command-hook.

From: martin rudalics
Subject: Re: Strange error caused by post-command-hook.
Date: Tue, 10 Jul 2007 15:52:30 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> [...] once the following message begins to appear in the
> minibuffer whenever a minibuffer interaction is attemped,
>   Error in post-command-hook: (error Selecting deleted buffer)
> this message seems to re-appear (almost) always in the mini-buffer.
> This message obscures the prompt message which should have been shown
> in the first place.  For example, if I type C-c C-f, the default
> directory usually shown is obscured with overlapping message (above).
> (Funny if I type C-c C-v, the error message doesn't show up.)

Do you intend the commands `find-file' and `find-alternate-file' here?
You could try to add ...

(defun find-file (filename &optional wildcards)
     (when post-command-hook
       (message "... %s" post-command-hook) (sit-for 1))
     (find-file-read-args "Find file: " nil)))        
  (let ((value (find-file-noselect filename nil nil wildcards)))
    (if (listp value)
        (mapcar 'switch-to-buffer (nreverse value))
      (switch-to-buffer value))))

... to your .emacs.  As soon as `find-file' triggers the message _and_
the error please tell us the value for `post-command-hook' printed by
the message (although your observations indicate that the error is
triggered _before_ the command gets executed).

> Now, from reading the "C-H v" help message for 'post-command-hook', if
> an error occurs when the hook is run from post-command-hook,
> the hook is set to nil.  But if this is set to "nil" permanently, I
> should not see this repetition of the same error message over and over
> again. (Correct?)
> Does this mean that whatever is causing the incorrect hook to be installed
> is trying to install this invalid hook again and again?


> <<< Press Return to bury the buffer list >>>

This seems to come from `electric-buffer-list' which I don't know.
AFAICT it doesn't install a `post-command-hook' though.

reply via email to

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