From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: Re: appointment display during isearch replaces buffer contents with history-element Date: Wed, 02 Jan 2008 09:36:06 -0500 Message-ID: <87bq84cn1l.fsf@stupidchicken.com> References: <30sl3899pd.fsf@web.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1199284854 31622 80.91.229.12 (2 Jan 2008 14:40:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Jan 2008 14:40:54 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 02 15:41:14 2008 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 1JA4mQ-00037U-5G for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Jan 2008 15:41:14 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JA4m3-0005XW-Ul for geb-bug-gnu-emacs@m.gmane.org; Wed, 02 Jan 2008 09:40:51 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JA4lQ-0004zU-P4 for bug-gnu-emacs@gnu.org; Wed, 02 Jan 2008 09:40:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JA4lO-0004x0-Gq for bug-gnu-emacs@gnu.org; Wed, 02 Jan 2008 09:40:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JA4lO-0004wp-Bu for bug-gnu-emacs@gnu.org; Wed, 02 Jan 2008 09:40:10 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JA4lN-0000JD-V9 for bug-gnu-emacs@gnu.org; Wed, 02 Jan 2008 09:40:10 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JA4lJ-0006ek-Ps for bug-gnu-emacs@gnu.org; Wed, 02 Jan 2008 14:40:05 +0000 Original-Received: from cyd.mit.edu ([18.115.2.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Jan 2008 14:40:05 +0000 Original-Received: from cyd by cyd.mit.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Jan 2008 14:40:05 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 55 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cyd.mit.edu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:rZSvyqs+DASUnCNRA0yWAQHjkK8= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:17281 Archived-At: bojohan+news@dd.chalmers.se (Johan Bockgård) writes: > $ emacs -Q > > (defun foo () > (save-excursion > (other-window 1))) > > (push "foo" extended-command-history) > > (run-with-timer 5 nil 'foo) > > M-x > Wait 5 seconds > Press > > The contents of the *scratch* buffer are replaced with "foo"; that is, > the key binding is looked up in the minibuffer's keymap but executed > in *scratch*. > > So the problem is when a timer changes the selected window, but not > the current buffer. The following patch fixes this problem. Any objections? *** emacs/src/process.c.~1.512.2.9.~ 2008-01-02 08:51:29.000000000 -0500 --- emacs/src/process.c 2008-01-02 09:37:38.000000000 -0500 *************** *** 4697,4702 **** --- 4697,4703 ---- { int old_timers_run = timers_run; struct buffer *old_buffer = current_buffer; + Lisp_Object old_window = selected_window; int leave = 0; if (detect_input_pending_run_timers (do_display)) *************** *** 4710,4716 **** an alike. Make read_key_sequence aware of that. */ if (timers_run != old_timers_run && waiting_for_user_input_p == -1 ! && old_buffer != current_buffer) record_asynch_buffer_change (); if (leave) --- 4711,4718 ---- an alike. Make read_key_sequence aware of that. */ if (timers_run != old_timers_run && waiting_for_user_input_p == -1 ! && (old_buffer != current_buffer ! || !EQ (old_window, selected_window))) record_asynch_buffer_change (); if (leave)