From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ishikawa Newsgroups: gmane.emacs.bugs Subject: Strange error caused by post-command-hook. Date: Tue, 10 Jul 2007 21:35:39 +0900 Message-ID: <46937D1B.4000501@ubin.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184072514 27176 80.91.229.12 (10 Jul 2007 13:01:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2007 13:01:54 +0000 (UTC) Cc: ishikawa To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jul 10 15:01:51 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 1I8FLj-0000En-Dn for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Jul 2007 15:01:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8FLi-0000nj-R3 for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Jul 2007 09:01:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8Ewd-0005vc-8T for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2007 08:35:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8Ewb-0005v5-Ny for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2007 08:35:54 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8Ewb-0005v2-HP for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2007 08:35:53 -0400 Original-Received: from post.ubin.jp ([202.32.0.84]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I8Ewa-0003vw-6k for bug-gnu-emacs@gnu.org; Tue, 10 Jul 2007 08:35:53 -0400 Original-Received: from localhost (post [127.0.0.1]) by localhost.ubin.jp (Postfix) with SMTP id 2A5B929AC38 for ; Tue, 10 Jul 2007 21:35:44 +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 8B61429AC38; Tue, 10 Jul 2007 21:35:40 +0900 (JST) User-Agent: Thunderbird 1.5.0.12 (X11/20070509) X-detected-kernel: Linux 2.4-2.6 X-Mailman-Approved-At: Tue, 10 Jul 2007 09:01:49 -0400 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:16123 Archived-At: Strange error caused by post-command-hook. I have a problem caused by apparently an incorrect hook installed in post-command-hook and am at a loss about how to track it down. Any helpful tips are appreciated. (I have not seen this in pre-22.1 emacs version all the way back to 18.5x). Version: emacs-version is a variable defined in `/u2/ishikawa/emacs-22.1/lisp/version.el'. Its value is "22.1.1" OS: Linux dell-w2k-note 2.6.20-1.2320.fc5 #1 Tue Jun 12 18:50:38 EDT 2007 i686 i686 i386 GNU/Linux (Fedora Core 5) Symptom: For some reason which I have not figured out completely (but I suspect trying to run M-x man for non-existing command utility such as M-x man foobar tends to cause the following symptom very likely, but not always :-( ), 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.) A good news about this bad news is once I insert a key into the minibuffer, the message disappears and the intended prompt message, which has been obsucred, as well as the key I type is now shown in its complete form. So it is not a fatal bug, but very irritating and as far as user interface is concerned, emacs is very difficult to use after this happens. The first time I notice this problem, I had to exit emacs and start again. 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? ======================================== >>From C-H help message: ---------------------- post-command-hook is a variable defined in `C source code'. Its value is nil Documentation: Normal hook run after each command is executed. If an unhandled error happens in running this hook, the hook value is set to nil, since otherwise the error might happen repeatedly and make Emacs nonfunctional. [back] ======================================== Now I have an additional observation, which seems to suggest that something (but I don't know which library) is trying to install this invalid hook again and again. Very strange observation: I just noticed that a very strange sequence of events. Now I am using an emacs session when the described error message appears. When I hit "C-c C-f" the first time, I get the error message as described above. But if I hit "C-g" to stop the interaction, and hit "C-c c-f" again, the second "C-c C-f" is followed by the correct prompt, i.e., the default directory (for "find-file" that is.). The error message is not shown. However, if I hit "c-g" to stop this correct interaction, and hit "C-c c-f" again, I get the error message described above. And the process repeats forever. ======================================== >>From *Messages* buffer ---------------------------------------- ... Error in post-command-hook: (error Selecting deleted buffer) Mark set [2 times] (New file) Error in post-command-hook: (error Selecting deleted buffer) Mark set <<< Press Return to bury the buffer list >>> ... ======================================== I am using "electric-buffer-list" and it seems that the combination of electric-buffer-list and man against non-existing command name seems to trigger the bug/feature, but not always. Any helpful tips to track down this problem are appreciated.