From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ishikawa Newsgroups: gmane.emacs.bugs Subject: Re: Strange error caused by post-command-hook. Date: Wed, 11 Jul 2007 21:27:28 +0900 Message-ID: <4694CCB0.1040907@ubin.jp> References: <46937D1B.4000501@ubin.jp> <46938F1E.8000103@gmx.at> <4694A32D.3000907@ubin.jp> <4694C363.7070900@gmx.at> <4694C89C.5000402@ubin.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184156884 9122 80.91.229.12 (11 Jul 2007 12:28:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2007 12:28:04 +0000 (UTC) Cc: ishikawa To: martin rudalics , bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jul 11 14:28:02 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I8bIU-0000S0-00 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 14:27:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8bIS-0008PG-JL for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jul 2007 08:27:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8bIC-00086D-9h for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2007 08:27:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8bIB-00085i-3O for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2007 08:27:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8bIA-00085Z-Ox for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2007 08:27:38 -0400 Original-Received: from post.ubin.jp ([202.32.0.84]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I8bI9-0007Ri-Di for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2007 08:27:38 -0400 Original-Received: from localhost (post [127.0.0.1]) by localhost.ubin.jp (Postfix) with SMTP id 2F91C29AC39; Wed, 11 Jul 2007 21:27:35 +0900 (JST) Original-Received: from [10.254.248.233] (dell-w2k-note.ddns.member.ubin.jp [10.254.248.233]) by post.ubin.jp (Postfix) with ESMTP id 5AEB229AC39; Wed, 11 Jul 2007 21:27:29 +0900 (JST) User-Agent: Thunderbird 1.5.0.12 (X11/20070509) In-Reply-To: <4694C89C.5000402@ubin.jp> X-detected-kernel: Linux 2.4-2.6 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16138 Archived-At: 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)))) >> >> > > >