From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: auto-insert help-buffer Date: Thu, 08 Mar 2007 21:06:55 -0500 Message-ID: <874povnpa8.fsf@stupidchicken.com> References: <45D967C4.5060104@easy-emacs.de> <87fy8fu2kv.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173406049 17740 80.91.229.12 (9 Mar 2007 02:07:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2007 02:07:29 +0000 (UTC) Cc: andreas.roehler@easy-emacs.de, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 09 03:07:23 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HPUVu-0003Wm-Sf for ged-emacs-devel@m.gmane.org; Fri, 09 Mar 2007 03:07:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPUWA-0006Mm-Lp for ged-emacs-devel@m.gmane.org; Thu, 08 Mar 2007 21:07:38 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPUVy-0006Mh-Vs for emacs-devel@gnu.org; Thu, 08 Mar 2007 21:07:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPUVx-0006MZ-MF for emacs-devel@gnu.org; Thu, 08 Mar 2007 21:07:25 -0500 Original-Received: from south-station-annex.mit.edu ([18.72.1.2]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPUVg-0003tP-JD; Thu, 08 Mar 2007 21:07:08 -0500 Original-Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id l29274T0026677; Thu, 8 Mar 2007 21:07:04 -0500 (EST) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by central-city-carrier-station.mit.edu (8.13.6/8.9.2) with ESMTP id l2926u8h013017; Thu, 8 Mar 2007 21:06:57 -0500 (EST) Original-Received: from localhost (MAIN-TWELVE-TWO-FIFTY-SIX.MIT.EDU [18.19.6.1]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id l2926tiD013903; Thu, 8 Mar 2007 21:06:55 -0500 (EST) Original-Received: from cyd by localhost with local (Exim 3.36 #1 (Debian)) id 1HPUVT-0002wo-00; Thu, 08 Mar 2007 21:06:55 -0500 In-Reply-To: (Richard Stallman's message of "Thu\, 08 Mar 2007 16\:48\:30 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) X-Scanned-By: MIMEDefang 2.42 X-Spam-Score: 0 X-detected-kernel: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67595 Archived-At: Richard Stallman writes: > If the event that was read is a mouse event, and the buffer it's on is > the help buffer, it should discard the unwind-protect without > restoring the old window config. > > If the event is not a mouse event, it should do what it does now. > > It's not perfectly simple, but it is not very complex either. > > Can you implement that? How bout this (modulo comments)? I cancel the window config unwinding as long as the user clicks anywhere using the mouse, not just the help window---it's too much trouble trying to identify the help window. I think this is an acceptable compromise. *** emacs/src/keyboard.c.~1.892.~ 2007-01-27 13:29:49.000000000 -0500 --- emacs/src/keyboard.c 2007-03-08 21:04:16.000000000 -0500 *************** *** 2450,2455 **** --- 2450,2466 ---- static Lisp_Object kbd_buffer_get_event (); static void record_char (); + static Lisp_Object help_form_saved_window_configs; + static Lisp_Object + read_char_help_form_unwind (arg) + { + Lisp_Object window_config = XCAR (help_form_saved_window_configs); + help_form_saved_window_configs = XCDR (help_form_saved_window_configs); + if (!NILP (window_config)) + Fset_window_configuration (window_config); + return Qnil; + } + #ifdef MULTI_KBOARD static jmp_buf wrong_kboard_jmpbuf; #endif *************** *** 3319,3326 **** Lisp_Object tem0; count = SPECPDL_INDEX (); ! record_unwind_protect (Fset_window_configuration, ! Fcurrent_window_configuration (Qnil)); tem0 = Feval (Vhelp_form); if (STRINGP (tem0)) --- 3330,3339 ---- Lisp_Object tem0; count = SPECPDL_INDEX (); ! record_unwind_protect (read_char_help_form_unwind, Qnil); ! help_form_saved_window_configs ! = Fcons (Fcurrent_window_configuration (Qnil), ! help_form_saved_window_configs); tem0 = Feval (Vhelp_form); if (STRINGP (tem0)) *************** *** 3328,3334 **** cancel_echoing (); do ! c = read_char (0, 0, 0, Qnil, 0, NULL); while (BUFFERP (c)); /* Remove the help from the frame */ unbind_to (count, Qnil); --- 3341,3352 ---- cancel_echoing (); do ! { ! c = read_char (0, 0, 0, Qnil, 0, NULL); ! if (EVENT_HAS_PARAMETERS (c) ! && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_click)) ! XSETCAR (help_form_saved_window_configs, Qnil); ! } while (BUFFERP (c)); /* Remove the help from the frame */ unbind_to (count, Qnil); *************** *** 11335,11340 **** --- 11353,11361 ---- menu_bar_items_vector = Qnil; staticpro (&menu_bar_items_vector); + help_form_saved_window_configs = Qnil; + staticpro (&help_form_saved_window_configs); + defsubr (&Scurrent_idle_time); defsubr (&Sevent_convert_list); defsubr (&Sread_key_sequence);