unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Reitter <david.reitter@gmail.com>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: emacs-devel@gnu.org
Subject: Re: [Stephen.Berman@gmx.net: Re: redisplay]
Date: Mon, 16 Mar 2009 08:16:04 -0400	[thread overview]
Message-ID: <C6018F7B-E375-4D7D-A758-7831E406FE60@gmail.com> (raw)
In-Reply-To: <wlskle6yeo.wl%mituharu@math.s.chiba-u.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 2816 bytes --]

On Mar 15, 2009, at 9:37 PM, YAMAMOTO Mitsuharu wrote:

> [Revisiting an old change]
>
>>>>>> On Wed, 25 Apr 2007 20:30:08 +0200, Jan Djärv  
>>>>>> <jan.h.d@swipnet.se> said:
>
>> After some experimenting it seems that this patch fixes it.  Note
>> that a call to redisplay() does not fix the bug.  I don't know why.
>> But a full redisplay before every dialog maybe is too much?
>
>> diff -w -c src/xmenu.c.~1.317.~ src/xmenu.c
>> Index: src/xmenu.c
>> *** src/xmenu.c.~1.317.~        2007-01-21 11:33:57.000000000 +0100
>> --- src/xmenu.c 2007-04-25 20:27:02.000000000 +0200
>> ***************
>> *** 3333,3338 ****
>> --- 3333,3340 ----
>>     /* No selection has been chosen yet.  */
>>     menu_item_selection = 0;
>
>> +   Fredisplay (Qt);
>> +
>>     /* Actually create and show the dialog.  */
>>     create_and_show_dialog (f, first_wv);
>
> Fredisplay runs timers and may cause string data relocation by GC.
> Just before the call to Fredisplay, a widget value is created and it
> points to some string data, which are to be used as button labels
> after the Fredisplay call.  So this may cause corruption of dialog
> button labels.  I've never seen such corruption actually, but I think
> that may happen in principle unless I'm missing something.


I absolutely see such corruption in the Carbon port, which creates the  
dialog in a similar fashion.  This was in connection with a header  
line that uses an :eval expression, and a modified map-y-or-n-p that  
switches buffers to show the right one.  As you say, the strings get  
destroyed, but that was relatively easy to fix by doing the redisplay  
a bit earlier.



*** src/macmenu.c	30 Aug 2008 00:10:18 -0400	1.56.2.7
--- src/macmenu.c	09 Feb 2009 13:21:20 -0500	
***************
*** 1882,1888 ****
         return Qnil;
       }

!   /* Create a tree of widget_value objects
        representing the text label and buttons.  */
     {
       Lisp_Object pane_name, prefix;
--- 1882,1893 ----
         return Qnil;
       }

!   /* Force a redisplay before showing the dialog.  If a frame is  
created
!      just before showing the dialog, its contents may not have been  
fully
!      drawn.  */
!   Fredisplay (Qt);
!
!  /* Create a tree of widget_value objects
        representing the text label and buttons.  */
     {
       Lisp_Object pane_name, prefix;
***************
*** 1985,1994 ****
     /* No selection has been chosen yet.  */
     menu_item_selection = 0;

-   /* Force a redisplay before showing the dialog.  If a frame is  
created
-      just before showing the dialog, its contents may not have been  
fully
-      drawn.  */
-   Fredisplay (Qt);

     /* Actually create the dialog.  */
   #if TARGET_API_MAC_CARBON
--- 1990,1995 ----


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

  reply	other threads:[~2009-03-16 12:16 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-23  3:48 [Stephen.Berman@gmx.net: Re: redisplay] Richard Stallman
2007-04-23 15:07 ` Chong Yidong
2007-04-23 19:14   ` Jan Djärv
2007-04-23 22:12     ` Stephen Berman
2007-04-23 22:50       ` YAMAMOTO Mitsuharu
2007-04-24  1:10         ` YAMAMOTO Mitsuharu
2007-04-26 20:58           ` Stephen Berman
2007-04-27  8:57             ` YAMAMOTO Mitsuharu
2007-04-28  4:06               ` Richard Stallman
2007-04-29  7:35                 ` YAMAMOTO Mitsuharu
2007-04-29 21:41                   ` Richard Stallman
2007-05-01  8:30                     ` YAMAMOTO Mitsuharu
2007-05-02  0:12                       ` Richard Stallman
2007-04-29  7:51                 ` David Kastrup
2007-04-29  9:25                   ` Nick Roberts
2007-04-29 21:41                   ` Richard Stallman
2007-04-29 22:14                     ` David Kastrup
2007-05-01  0:23                       ` YAMAMOTO Mitsuharu
2007-04-24 14:08     ` Stefan Monnier
2007-04-24 14:49       ` Jan Djärv
2007-04-24 18:27       ` Glenn Morris
2007-04-25  8:47         ` Jan Djärv
2007-04-25 14:36           ` Stefan Monnier
2007-04-25 14:50             ` Jan Djärv
2007-04-25 18:30               ` Jan Djärv
2007-04-25 19:34                 ` Stefan Monnier
2007-04-25 19:44                 ` YAMAMOTO Mitsuharu
2007-04-26  5:58                   ` Jan Djärv
2007-04-26  8:35                     ` YAMAMOTO Mitsuharu
2007-04-26  3:08                 ` Glenn Morris
2007-04-26 20:59                 ` Stephen Berman
2007-04-27  5:58                   ` Jan Djärv
2009-03-16  1:37                 ` YAMAMOTO Mitsuharu
2009-03-16 12:16                   ` David Reitter [this message]
2009-03-16 15:18                     ` Chong Yidong
2009-03-17  2:43                       ` YAMAMOTO Mitsuharu
2009-03-17  3:59                         ` Chong Yidong
2009-03-17  4:13                           ` YAMAMOTO Mitsuharu
2009-03-17  9:06                             ` YAMAMOTO Mitsuharu
2009-03-17 15:13                               ` Chong Yidong
2009-03-18  8:56                                 ` YAMAMOTO Mitsuharu

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=C6018F7B-E375-4D7D-A758-7831E406FE60@gmail.com \
    --to=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /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).