unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: ishikawa <chiaki.ishikawa@ubin.jp>
To: martin rudalics <rudalics@gmx.at>
Cc: ishikawa <chiaki.ishikawa@ubin.jp>, bug-gnu-emacs@gnu.org
Subject: Re: Strange error caused by post-command-hook.
Date: Wed, 11 Jul 2007 20:53:40 +0900	[thread overview]
Message-ID: <4694C4C4.1070609@ubin.jp> (raw)
In-Reply-To: <4694A32D.3000907@ubin.jp>

Using the suggestion, I tried to
print the value of post-command-hook.

Unfortunately, when the discussed error message is
seen, by the time 'find-file' is invoked, the
value of post-command-hook seems to have been cleared to nil, and
I don't get the print out of post-command-hook.

(I *DO* get the print ouf of post-command-hook occasionally
when I invoked find-file and so the code is correct as far
as the coding goes.)

I am now looking at keyboard.c and pondering to
modify it to print out of the value of post-command-hook using Fmessage()
when run_hook_safely() is called (and the argument is post-command-hook).

If someone has a better idea of tracking down the value in a general manner,
short of modifying the keyboard.c source file, please let me know.

I am going to insert Fmessage() anyway since it won't hurt so much...

Chiaki Ishikawa

PS: Yes, the problem happened again in about 10 minutes time of
real-world editing. I checked my local e-lisp code files and
there was only one instance of post-hook-command mentioned in my code files,
and that file is not used. So the culprit is somewhere else...
Oh, wait, I have a few more code repositories one for Japanese input and
the other for reading a popular BBS.
In any case, by printing out the value, I should be able to
get closer to the cause of the bug.

TIA.




ishikawa wrote:
> Dear Martin Rudalics,
> 
> Thank you for the suggestion.
> 
> 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...)
> 
> Chiaki Ishikawa
> 
> martin rudalics wrote:
>>  > [...] 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)
>>   "..."
>>   (interactive
>>    (progn
>>      (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?
>>
>> Yes.
>>
>>  > <<< 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.
>>
>>
> 
> 

      parent reply	other threads:[~2007-07-11 11:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 12:35 Strange error caused by post-command-hook ishikawa
2007-07-10 13:52 ` martin rudalics
2007-07-11  9:30   ` ishikawa
2007-07-11 11:47     ` martin rudalics
2007-07-11 12:10       ` ishikawa
2007-07-11 12:27         ` ishikawa
2007-07-11 20:40           ` martin rudalics
2007-07-12  8:00             ` ishikawa
2007-07-12  8:54               ` martin rudalics
2007-07-11 14:24         ` martin rudalics
2007-07-11 11:53     ` ishikawa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4694C4C4.1070609@ubin.jp \
    --to=chiaki.ishikawa@ubin.jp \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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