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

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

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


From: ishikawa
Subject: Re: Strange error caused by post-command-hook.
Date: Wed, 11 Jul 2007 21:27:28 +0900
User-agent: Thunderbird 1.5.0.12 (X11/20070509)

Hi,

I tried the following mods to record what is inside post-command-hook.
But this is too verbose and I wonder if there is a way to
record the output of Fmessage() only to *Message* file
instead of showing it to the minibuffer.
My mailer may input line-break inside the format string of Fmessage().


From keyboard.c:

/* If we get an error while running the hook, cause the hook variable
   to be nil.  Also inhibit quits, so that C-g won't cause the hook
   to mysteriously evaporate.  */

void
safe_run_hooks (hook)
     Lisp_Object hook;
{
  int count = SPECPDL_INDEX ();

#if 0
  /* Local mods.
   * Tring to locate what erratic hook is set to post-command-hook.
   * Too verbose. I wonder if this could be only saved to Fmessage.
   */
  if(hook == Qpost_command_hook && ! NILP(Vpost_command_hook))
    {
      Lisp_Object args[3];
      args[0] = build_string ("Value of post-command hook in safe_run_hooks: 
%s");
      args[1] = Vpost_command_hook;
      Fmessage (2, args);
    }
#endif

  specbind (Qinhibit_quit, hook);

  internal_condition_case (safe_run_hooks_1, Qt, safe_run_hooks_error);

  unbind_to (count, Qnil);
}


Oh, maybe I can "copy" the value of post-command-hook and
re-print it after the error was detected...


ishikawa wrote:
ishikawa wrote:
Dear Martin Rudalics,

Thank you the suggestion. Before reading the following suggestion, I began
modifying the keyboard.c.

But I will try the following suggested tip first before compiling the
modified keyboard.c source file.

Chiaki Ishikawa

PS: Things get really strange. I tried the following tip, and found that
this doesn't really print anything of importance. It seems that the processing
that leads to the
"<< Press Return to bury the buffer list >>"
and probably the code that gets executed shortly after that is the candidate for the culprit.

Oh, wait, after a close look, I wonder what this 'tooltip-hide' is...

To wit: This is the *Mesasges* buffer after I added the
following hook:


((lambda nil (when post-command-hook (message "... %s" post-command-hook))) tooltip-hide)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer) [3 times]
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
Mark set
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
Mark set
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
((lambda nil (when post-command-hook (message "... %s" post-command-hook))) tooltip-hide)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
Mark set
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
Mark set
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
Mark saved where search started [2 times]
Auto-saving...
Mark saved where search started [2 times]
Saving file /home/ishikawa/emacs-22.1/src/keyboard.c...
Wrote /home/ishikawa/emacs-22.1/src/keyboard.c
(No changes need to be saved)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
Wrote /home/ishikawa/.emacs
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
<<< Press Return to bury the buffer list >>>
Error in post-command-hook: (error Selecting deleted buffer)
Mark set
Mark activated
Transient-mark-mode temporarily enabled
Saved text from "((lambda nil (when post-command-hook (me"
Mark set [2 times]



martin rudalics wrote:
 > I have inserted the re-defined find-file in my .emacs file.
 > Once the problem returns, I will report the value of
 > post-command-hook.
> (Aha, I see that the problem may happen before find-file gets executed.
 > How complicated...)

I expected that.  Try the following (more intrusive):

(add-hook 'pre-command-hook
      (lambda ()
        (when post-command-hook
          (message "... %s" post-command-hook))))











reply via email to

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