unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: gerd.moellmann@t-online.de (Gerd Moellmann)
Cc: rms@gnu.org, emacs-devel@gnu.org, spiegel@gnu.org
Subject: Re: [spiegel@gnu.org: Re: [Fwd: vc-annotate causes Emacs to die]]
Date: 27 Aug 2002 00:02:02 +0200	[thread overview]
Message-ID: <868z2te0th.fsf@gerd.free-bsd.org> (raw)
In-Reply-To: <86u1lhe5az.fsf@gerd.free-bsd.org>

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

Gerd Moellmann <gerd.moellmann@t-online.de> writes:

> Until I find time to debug this further, it might be worth using this
> quich workaround:

[...]

I think the real fix could be what's in the attached patch (please
install when tested).

P.S.

Can I now have the 21.2 cursor shapes back, as I requested a couple of
times?  The new cursor shapes for the off-state of the blinking cursor
and in non-selected windows drive me up the wall.  Why was that change
made, for heaven's sake?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: d.diff --]
[-- Type: text/x-patch, Size: 4796 bytes --]

2002-08-26  Gerd Moellmann  <gerd.moellmann@t-online.de>

	* xdisp.c (redisplay_updating_p): Variable removed.
	(inhibit_free_realized_faces, Qinhibit_free_realized_faces): New
	variables.
	(init_iterator): Don't free realized faces if
	inhibit_free_realized_faces is set.
	(redisplay_internal): Bind Qinhibit_free_realized_faces to nil.
	(syms_of_xdisp): DEFVAR_BOOL inhibit-free-realized-faces,
	initialize Qinhibit_free_realized_faces.

	* dispextern.h (PRODUCE_GLYPHS): Set inhibit_free_realized_faces
	when iterator is adding glyphs to a glyph matrix.

Index: dispextern.h
===================================================================
RCS file: /cvsroot/emacs/emacs/src/dispextern.h,v
retrieving revision 1.137
diff -c -u -r1.137 dispextern.h
cvs server: conflicting specifications of output style
--- dispextern.h	16 Jul 2002 19:48:08 -0000	1.137
+++ dispextern.h	26 Aug 2002 21:43:53 -0000
@@ -1852,10 +1852,16 @@
 /* Call produce_glyphs or produce_glyphs_hook, if set.  Shortcut to
    avoid the function call overhead.  */
 
-#define PRODUCE_GLYPHS(IT)			\
-     (rif					\
-      ? rif->produce_glyphs ((IT))		\
-      : produce_glyphs ((IT)))
+#define PRODUCE_GLYPHS(IT) 			\
+     do {					\
+       extern int inhibit_free_realized_faces;	\
+       if (rif != NULL)				\
+	 rif->produce_glyphs ((IT));		\
+       else					\
+	 produce_glyphs ((IT));			\
+       if ((IT)->glyph_row != NULL)		\
+	 inhibit_free_realized_faces = 1;	\
+     } while (0)
 
 /* Bit-flags indicating what operation move_it_to should perform.  */
 
Index: xdisp.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/xdisp.c,v
retrieving revision 1.777
diff -c -u -r1.777 xdisp.c
cvs server: conflicting specifications of output style
--- xdisp.c	22 Aug 2002 16:52:56 -0000	1.777
+++ xdisp.c	26 Aug 2002 21:45:10 -0000
@@ -706,9 +706,12 @@
 
 int redisplaying_p;
 
-/* Non-zero while redisplay is updating the display.  */
+/* Non-zero means don't free realized faces.  Bound while freeing
+   realized faces is dangerous because glyph matrices might still
+   reference them.  */
 
-int redisplay_updating_p;
+int inhibit_free_realized_faces;
+Lisp_Object Qinhibit_free_realized_faces;
 
 \f
 /* Function prototypes.  */
@@ -1524,7 +1527,7 @@
      free realized faces now because they depend on face definitions
      that might have changed.  Don't free faces while there might be 
      desired matrices pending which reference these faces.  */
-  if (face_change_count && !redisplay_updating_p)
+  if (face_change_count && !inhibit_free_realized_faces)
     {
       face_change_count = 0;
       free_all_realized_faces (Qnil);
@@ -8514,11 +8517,11 @@
   count = SPECPDL_INDEX ();
   record_unwind_protect (unwind_redisplay, make_number (redisplaying_p));
   ++redisplaying_p;
+  specbind (Qinhibit_free_realized_faces, Qnil);
 
  retry:
   pause = 0;
   reconsider_clip_changes (w, current_buffer);
-  redisplay_updating_p = 0;
 
   /* If new fonts have been loaded that make a glyph matrix adjustment
      necessary, do it.  */
@@ -9006,9 +9009,8 @@
 				 redisplay_window_error);
 
       /* Compare desired and current matrices, perform output.  */
-    update:
-      redisplay_updating_p = 1;
       
+    update:
       /* If fonts changed, display again.  */
       if (fonts_changed_p)
 	goto retry;
@@ -9134,7 +9136,6 @@
     goto retry;
 
  end_of_redisplay:
-  redisplay_updating_p = 0;
   unbind_to (count, Qnil);
 }
 
@@ -9172,14 +9173,13 @@
 /* Function registered with record_unwind_protect in
    redisplay_internal.  Reset redisplaying_p to the value it had
    before redisplay_internal was called, and clear
-   redisplay_updating_p.  */
+   prevent_freeing_realized_faces_p.  */
 
 static Lisp_Object
 unwind_redisplay (old_redisplaying_p)
      Lisp_Object old_redisplaying_p;
 {
   redisplaying_p = XFASTINT (old_redisplaying_p);
-  redisplay_updating_p = 0;
   return Qnil;
 }
 
@@ -15299,6 +15299,8 @@
   staticpro (&Qobject);
   Qrisky_local_variable = intern ("risky-local-variable");
   staticpro (&Qrisky_local_variable);
+  Qinhibit_free_realized_faces = intern ("inhibit-free-realized-faces");
+  staticpro (&Qinhibit_free_realized_faces);
 
   list_of_error = Fcons (intern ("error"), Qnil);
   staticpro (&list_of_error);
@@ -15560,6 +15562,10 @@
   DEFVAR_BOOL ("inhibit-eval-during-redisplay", &inhibit_eval_during_redisplay,
     doc: /* Non-nil means don't eval Lisp during redisplay.  */);
   inhibit_eval_during_redisplay = 0;
+
+  DEFVAR_BOOL ("inhibit-free-realized-faces", &inhibit_free_realized_faces,
+    doc: /* Non-nil means don't free realized faces.  Internal use only.  */);
+  inhibit_free_realized_faces = 0;
 
 #if GLYPH_DEBUG
   DEFVAR_BOOL ("inhibit-try-window-id", &inhibit_try_window_id,

  reply	other threads:[~2002-08-26 22:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-26  0:36 [spiegel@gnu.org: Re: [Fwd: vc-annotate causes Emacs to die]] Richard Stallman
2002-08-26 13:33 ` Gerd Moellmann
2002-08-26 18:26   ` vc-annotate causes Emacs to die Andre Spiegel
2002-08-26 18:35   ` [spiegel@gnu.org: Re: [Fwd: vc-annotate causes Emacs to die]] Alan Shutko
2002-08-26 20:25     ` Gerd Moellmann
2002-08-26 22:02       ` Gerd Moellmann [this message]
2002-08-27  1:59         ` Miles Bader
2002-08-27 10:31           ` Gerd Moellmann
2002-08-28  1:15             ` Miles Bader
2002-08-28 10:07               ` Gerd Moellmann
2002-08-27 15:56         ` Kim F. Storm
2002-08-27 15:50           ` Gerd Moellmann
2002-08-27 19:05         ` Richard Stallman
2002-08-27 23:35           ` Alan Shutko
2002-08-28 23:32             ` Richard Stallman
2002-08-29  6:27               ` Juanma Barranquero
2002-08-29  7:36                 ` Miles Bader
2002-08-28 10:12           ` Gerd Moellmann
2002-08-28 23:33             ` Richard Stallman
2002-08-30 13:15               ` Kim F. Storm
2002-08-27 19:05   ` Richard Stallman
2002-08-28 10:32     ` Gerd Moellmann
2002-08-28 23:33       ` Richard Stallman
2002-08-29  9:51         ` Gerd Moellmann

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=868z2te0th.fsf@gerd.free-bsd.org \
    --to=gerd.moellmann@t-online.de \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=spiegel@gnu.org \
    /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).