From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dick.r.chiang@gmail.com Newsgroups: gmane.emacs.bugs Subject: bug#56372: 29.0.50; [PATCH] Avoid BadMatch X11 error Date: Sun, 03 Jul 2022 10:45:07 -0400 Message-ID: <87czemtfv0.fsf@dick> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37326"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/29.0.50 (gnu/linux) To: 56372@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 04 00:04:24 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o87hX-0009PP-Lb for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 04 Jul 2022 00:04:23 +0200 Original-Received: from localhost ([::1]:43966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o87hW-0001MW-ED for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 03 Jul 2022 18:04:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o87hC-0001M3-QE for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 18:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o87hC-0002h9-E6 for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 18:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o87hC-0000LB-9B for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 18:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dick.r.chiang@gmail.com Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 03 Jul 2022 22:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56372 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.16568857891218 (code B ref -1); Sun, 03 Jul 2022 22:04:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Jul 2022 22:03:09 +0000 Original-Received: from localhost ([127.0.0.1]:45587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o87gJ-0000JW-EF for submit@debbugs.gnu.org; Sun, 03 Jul 2022 18:03:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:37056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o80qc-0003l7-Ec for submit@debbugs.gnu.org; Sun, 03 Jul 2022 10:45:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o80qY-0000pC-5x for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 10:45:18 -0400 Original-Received: from mail-qk1-x72d.google.com ([2607:f8b0:4864:20::72d]:46789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o80qT-0005Xl-Pz for bug-gnu-emacs@gnu.org; Sun, 03 Jul 2022 10:45:13 -0400 Original-Received: by mail-qk1-x72d.google.com with SMTP id r138so5135020qke.13 for ; Sun, 03 Jul 2022 07:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:user-agent:mime-version; bh=B2y+8z5UTYu5H2KeVO7ZPMkywHmWZm7tDRlAzhDNONs=; b=kRvwFl8o1i+blcOOQWenFbvTvC5BRuf+/+z/wz91lJKbu7R4Esf/uDq1IsrB/oc3Ne hYryUOCICeoTgT6CuURC6kJtRRCio9NZwpEt4dR04LS5OMzy+UuDMFOv8uvW8v9WCDqM Wo1CMdwp3v3yXQqfL0C6QNX+PQAmmP1dIVR3mw81lmls//dPNiLhHcBLI4/oh7icA5lu x7t10GihbTV4+cYUcrqfQG4Q0MBziKLXJlcl9K4ljgeCft7pfyS4X6MWssjhVvJDmBkc gNZE3f3b1JtR0P51rVnRLzwo+L5qPfEw/1qXUW5s7j0sPNleU9GLt+xakvlhMUQHeaJ1 arXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=B2y+8z5UTYu5H2KeVO7ZPMkywHmWZm7tDRlAzhDNONs=; b=Zn71N+GjCTMm6DKlNlHkcXb25TnwQd6a+6Zx+enX9h11WMYHQ3mW8mblgIS0ot0qy4 9BujZZQr5BT+rQONFGnuDQM+SHAX9nORc3E0Cxtykn7LyXC1cJOT0Njuxokg01iZrKpS RviiB0By8QC/JAfy0PIOWRzmNfbzXz4IJlssF0QaMjcxzXTx8Sq1UVMBFxZ9R5iisKMV g/V7wNHcuRrGCk5CF+hS6JUykW/pOItq8B/jjw9G2hcZN7dDujwE2WEHra0d6ao4xS7Z p04qX1gfriZfzh+bWTvWl2XMKxALSA7auhsBSh8Ruzj+aW8fgB1LBv8YgN92k8WAs9Z7 gjpQ== X-Gm-Message-State: AJIora9iWzmHRJNLXj6n9feja1zlgy8fbIwsD1FZTTCvS/ou7+OyrgYz 2E9+lRigy27yCbU5WlMy7u0YaAv7pL8= X-Google-Smtp-Source: AGRyM1tan6sxUY1RVQKbDVwDjUrBVX0PXHYKAUForMX3CKKMNw33FsLaFxmPaMYoqKU8vhDDSo+CCA== X-Received: by 2002:a05:620a:3196:b0:6af:c5c:ca95 with SMTP id bi22-20020a05620a319600b006af0c5cca95mr16948612qkb.648.1656859508244; Sun, 03 Jul 2022 07:45:08 -0700 (PDT) Original-Received: from localhost (ool-457830b3.dyn.optonline.net. [69.120.48.179]) by smtp.gmail.com with ESMTPSA id x13-20020a05620a258d00b006a69f6793c5sm23221816qko.14.2022.07.03.07.45.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 07:45:07 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::72d; envelope-from=dick.r.chiang@gmail.com; helo=mail-qk1-x72d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 03 Jul 2022 18:03:06 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:236023 Archived-At: --=-=-= Content-Type: text/plain With my particular font sizing, I get an X11 BadMatch (invalid parameter attributes) error one out of every 10 starts or so. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Avoid-a-BadMatch-X11-error.patch >From 95911e85c12e91123ebc4448700f67877b4109cc Mon Sep 17 00:00:00 2001 From: dickmao Date: Sun, 3 Jul 2022 10:34:20 -0400 Subject: [PATCH] Avoid a BadMatch X11 error x_uncatch_errors() might do a sync that x_ignore_errors_for_next_request() doesn't? The details are unclear. * src/xfaces.c (unregister_colors, compare_fonts_by_sort_order, get_lface_attributes, lface_fully_specified_p, merge_face_vectors, merge_named_face, merge_face_ref, Finternal_make_lisp_face, Finternal_merge_in_global_face, lface_equal_p, Finternal_lisp_face_empty_p, clear_face_gcs, free_realized_faces, cache_face, lookup_named_face, lookup_derived_face, gui_supports_face_attributes_p, Fdisplay_supports_face_attributes_p, Finternal_set_font_selection_order, realize_named_face, face_at_buffer_position, merge_faces, Fdump_face): C89. * src/xterm.c (x_frame_highlight): Revert 2c4922d76b7. (x_frame_unhighlight): Revert 2c4922d76b7. --- src/xfaces.c | 112 +++++++++++++++++++++------------------------------ src/xterm.c | 18 ++------- 2 files changed, 51 insertions(+), 79 deletions(-) diff --git a/src/xfaces.c b/src/xfaces.c index 8ae922578ec..c0d8e2e740c 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -440,8 +440,7 @@ unregister_color (unsigned long pixel) void unregister_colors (unsigned long *pixels, int n) { - int i; - for (i = 0; i < n; ++i) + for (int i = 0; i < n; ++i) unregister_color (pixels[i]); } @@ -1471,9 +1470,8 @@ compare_fonts_by_sort_order (const void *v1, const void *v2) Lisp_Object const *p2 = v2; Lisp_Object font1 = *p1; Lisp_Object font2 = *p2; - int i; - for (i = 0; i < FONT_SIZE_INDEX; i++) + for (int i = 0; i < FONT_SIZE_INDEX; i++) { enum font_property_index idx = font_props_for_sorting[i]; Lisp_Object val1 = AREF (font1, idx), val2 = AREF (font2, idx); @@ -2069,9 +2067,7 @@ get_lface_attributes (struct window *w, face_name, NAMED_MERGE_POINT_REMAP, &named_merge_points)) { - int i; - - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE; ++i) attrs[i] = Qunspecified; return merge_face_ref (w, f, XCDR (face_remapping), attrs, @@ -2091,15 +2087,12 @@ get_lface_attributes (struct window *w, static bool lface_fully_specified_p (Lisp_Object attrs[LFACE_VECTOR_SIZE]) { - int i; - - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE; ++i) if (i != LFACE_FONT_INDEX && i != LFACE_INHERIT_INDEX - && i != LFACE_DISTANT_FOREGROUND_INDEX) - if ((UNSPECIFIEDP (attrs[i]) || IGNORE_DEFFACE_P (attrs[i]))) - break; - - return i == LFACE_VECTOR_SIZE; + && i != LFACE_DISTANT_FOREGROUND_INDEX + && (UNSPECIFIEDP (attrs[i]) || IGNORE_DEFFACE_P (attrs[i]))) + return false; + return true; } #ifdef HAVE_WINDOW_SYSTEM @@ -2220,7 +2213,6 @@ merge_face_vectors (struct window *w, struct frame *f, const Lisp_Object *from, Lisp_Object *to, struct named_merge_point *named_merge_points) { - int i; Lisp_Object font = Qnil; /* If FROM inherits from some other faces, merge their attributes into @@ -2243,7 +2235,7 @@ merge_face_vectors (struct window *w, to[LFACE_FONT_INDEX] = font; } - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE; ++i) if (!UNSPECIFIEDP (from[i])) { if (i == LFACE_HEIGHT_INDEX && !FIXNUMP (from[i])) @@ -2364,8 +2356,7 @@ merge_named_face (struct window *w, if (ok && !EQ (face_name, Qdefault)) { struct face *deflt = FACE_FROM_ID (f, DEFAULT_FACE_ID); - int i; - for (i = 1; i < LFACE_VECTOR_SIZE; i++) + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) if (EQ (from[i], Qreset)) from[i] = deflt->lface[i]; } @@ -2628,10 +2619,8 @@ merge_face_ref (struct window *w, return true; Lisp_Object scratch_attrs[LFACE_VECTOR_SIZE]; - int i; - scratch_attrs[0] = Qface; - for (i = 1; i < LFACE_VECTOR_SIZE; i++) + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) scratch_attrs[i] = Qunspecified; if (!merge_face_ref (w, f, parent_face, scratch_attrs, err_msgs, named_merge_points, 0)) @@ -2884,7 +2873,6 @@ DEFUN ("internal-make-lisp-face", Finternal_make_lisp_face, { Lisp_Object global_lface, lface; struct frame *f; - int i; CHECK_SYMBOL (face); global_lface = lface_from_face_name (NULL, face, false); @@ -2920,7 +2908,7 @@ DEFUN ("internal-make-lisp-face", Finternal_make_lisp_face, Fputhash (face, Fcons (face_id, global_lface), Vface_new_frame_defaults); } else if (f == NULL) - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE; ++i) ASET (global_lface, i, Qunspecified); /* Add a frame-local definition. */ @@ -2933,7 +2921,7 @@ DEFUN ("internal-make-lisp-face", Finternal_make_lisp_face, Fputhash (face, lface, f->face_hash_table); } else - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE; ++i) ASET (lface, i, Qunspecified); } else @@ -4152,7 +4140,6 @@ DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face, Default face attributes override any local face attributes. */) (Lisp_Object face, Lisp_Object frame) { - int i; Lisp_Object global_lface, local_lface, *gvec, *lvec; struct frame *f = XFRAME (frame); @@ -4169,7 +4156,7 @@ DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face, "global before local" priority. */ lvec = XVECTOR (local_lface)->contents; gvec = XVECTOR (global_lface)->contents; - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE; ++i) if (IGNORE_DEFFACE_P (gvec[i])) ASET (local_lface, i, Qunspecified); else if (! UNSPECIFIEDP (gvec[i])) @@ -4190,6 +4177,11 @@ DEFUN ("internal-merge-in-global-face", Finternal_merge_in_global_face, the previously-cached vector. */ memcpy (attrs, oldface->lface, sizeof attrs); + /* Make explicit any attributes whose value is 'reset'. */ + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) + if (EQ (lvec[i], Qreset)) + lvec[i] = attrs[i]; + merge_face_vectors (NULL, f, lvec, attrs, 0); vcopy (local_lface, 0, attrs, LFACE_VECTOR_SIZE); newface = realize_face (c, lvec, DEFAULT_FACE_ID); @@ -4328,10 +4320,9 @@ face_attr_equal_p (Lisp_Object v1, Lisp_Object v2) static bool lface_equal_p (Lisp_Object *v1, Lisp_Object *v2) { - int i; bool equal_p = true; - for (i = 1; i < LFACE_VECTOR_SIZE && equal_p; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE && equal_p; ++i) equal_p = face_attr_equal_p (v1[i], v2[i]); return equal_p; @@ -4374,13 +4365,11 @@ DEFUN ("internal-lisp-face-empty-p", Finternal_lisp_face_empty_p, { struct frame *f = EQ (frame, Qt) ? NULL : decode_live_frame (frame); Lisp_Object lface = lface_from_face_name (f, face, true); - int i; - for (i = 1; i < LFACE_VECTOR_SIZE; ++i) + for (int i = 1; i < LFACE_VECTOR_SIZE; ++i) if (!UNSPECIFIEDP (AREF (lface, i))) - break; - - return i == LFACE_VECTOR_SIZE ? Qt : Qnil; + return Qnil; + return Qt; } DEFUN ("frame--face-hash-table", Fframe_face_hash_table, Sframe_face_hash_table, @@ -4657,8 +4646,7 @@ clear_face_gcs (struct face_cache *c) { if (c && FRAME_WINDOW_P (c->f)) { - int i; - for (i = BASIC_FACE_ID_SENTINEL; i < c->used; ++i) + for (int i = BASIC_FACE_ID_SENTINEL; i < c->used; ++i) { struct face *face = c->faces_by_id[i]; if (face && face->gc) @@ -4686,7 +4674,7 @@ free_realized_faces (struct face_cache *c) { if (c && c->used) { - int i, size; + int size; struct frame *f = c->f; /* We must block input here because we can't process X events @@ -4694,7 +4682,7 @@ free_realized_faces (struct face_cache *c) current matrix still references freed faces. */ block_input (); - for (i = 0; i < c->used; ++i) + for (int i = 0; i < c->used; ++i) { free_realized_face (f, c->faces_by_id[i]); c->faces_by_id[i] = NULL; @@ -4797,10 +4785,13 @@ cache_face (struct face_cache *c, struct face *face, uintptr_t hash) /* Find a free slot in C->faces_by_id and use the index of the free slot as FACE->id. */ + face->id = c->used; for (i = 0; i < c->used; ++i) if (c->faces_by_id[i] == NULL) - break; - face->id = i; + { + face->id = i; + break; + } #ifdef GLYPH_DEBUG /* Check that FACE got a unique id. */ @@ -4818,7 +4809,7 @@ cache_face (struct face_cache *c, struct face *face, uintptr_t hash) #endif /* GLYPH_DEBUG */ /* Maybe enlarge C->faces_by_id. */ - if (i == c->used) + if (face->id == c->used) { if (c->used == c->size) c->faces_by_id = xpalloc (c->faces_by_id, &c->size, 1, MAX_FACE_ID, @@ -4826,7 +4817,7 @@ cache_face (struct face_cache *c, struct face *face, uintptr_t hash) c->used++; } - c->faces_by_id[i] = face; + c->faces_by_id[face->id] = face; } @@ -4958,8 +4949,7 @@ lookup_named_face (struct window *w, struct frame *f, memcpy (attrs, default_face->lface, sizeof attrs); /* Make explicit any attributes whose value is 'reset'. */ - int i; - for (i = 1; i < LFACE_VECTOR_SIZE; i++) + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) if (EQ (symbol_attrs[i], Qreset)) symbol_attrs[i] = attrs[i]; @@ -5135,8 +5125,7 @@ lookup_derived_face (struct window *w, memcpy (attrs, default_face->lface, sizeof attrs); /* Make explicit any attributes whose value is 'reset'. */ - int i; - for (i = 1; i < LFACE_VECTOR_SIZE; i++) + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) if (EQ (symbol_attrs[i], Qreset)) symbol_attrs[i] = attrs[i]; @@ -5190,8 +5179,7 @@ gui_supports_face_attributes_p (struct frame *f, Lisp_Object lattrs[LFACE_VECTOR_SIZE]; /* Make explicit any attributes whose value is 'reset'. */ - int i; - for (i = 1; i < LFACE_VECTOR_SIZE; i++) + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) { if (EQ (attrs[i], Qreset)) lattrs[i] = def_attrs[i]; @@ -5245,7 +5233,6 @@ gui_supports_face_attributes_p (struct frame *f, int face_id; struct face *face; Lisp_Object merged_attrs[LFACE_VECTOR_SIZE]; - int i; memcpy (merged_attrs, def_attrs, sizeof merged_attrs); @@ -5262,7 +5249,7 @@ gui_supports_face_attributes_p (struct frame *f, if (face->font == def_face->font || ! face->font) return false; - for (i = FONT_TYPE_INDEX; i <= FONT_SIZE_INDEX; i++) + for (int i = FONT_TYPE_INDEX; i <= FONT_SIZE_INDEX; i++) if (! EQ (face->font->props[i], def_face->font->props[i])) { Lisp_Object s1, s2; @@ -5499,7 +5486,6 @@ Point (2) implies that a `:weight black' attribute will be satisfied by (Lisp_Object attributes, Lisp_Object display) { bool supports = false; - int i; Lisp_Object frame; struct frame *f; struct face *def_face; @@ -5531,7 +5517,7 @@ Point (2) implies that a `:weight black' attribute will be satisfied by CHECK_LIVE_FRAME (frame); f = XFRAME (frame); - for (i = 0; i < LFACE_VECTOR_SIZE; i++) + for (int i = 0; i < LFACE_VECTOR_SIZE; i++) attrs[i] = Qunspecified; merge_face_ref (NULL, f, attributes, attrs, true, NULL, 0); @@ -5572,12 +5558,11 @@ DEFUN ("internal-set-font-selection-order", (Lisp_Object order) { Lisp_Object list; - int i; + int i = 0; int indices[ARRAYELTS (font_sort_order)]; CHECK_LIST (order); memset (indices, 0, sizeof indices); - i = 0; for (list = order; CONSP (list) && i < ARRAYELTS (indices); @@ -5911,8 +5896,7 @@ realize_named_face (struct frame *f, Lisp_Object symbol, int id) /* Handle the 'reset' pseudo-value of any attribute by replacing it with the corresponding value of the default face. */ - int i; - for (i = 1; i < LFACE_VECTOR_SIZE; i++) + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) if (EQ (symbol_attrs[i], Qreset)) symbol_attrs[i] = attrs[i]; /* Merge SYMBOL's face with the default face. */ @@ -6531,7 +6515,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, struct frame *f = XFRAME (w->frame); Lisp_Object attrs[LFACE_VECTOR_SIZE]; Lisp_Object prop, position; - ptrdiff_t i, noverlays; + ptrdiff_t noverlays; Lisp_Object *overlay_vec; ptrdiff_t endpos; Lisp_Object propname = mouse ? Qmouse_face : Qface; @@ -6610,7 +6594,8 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, from the overlays, if any. */ if (mouse) { - for (prop = Qnil, i = noverlays - 1; i >= 0 && NILP (prop); --i) + prop = Qnil; + for (ptrdiff_t i = noverlays - 1; i >= 0 && NILP (prop); --i) { Lisp_Object oend; ptrdiff_t oendpos; @@ -6633,7 +6618,7 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos, } else { - for (i = 0; i < noverlays; i++) + for (ptrdiff_t i = 0; i < noverlays; i++) { Lisp_Object oend; ptrdiff_t oendpos; @@ -6857,11 +6842,10 @@ merge_faces (struct window *w, Lisp_Object face_name, int face_id, { struct face *deflt = FACE_FROM_ID (f, DEFAULT_FACE_ID); Lisp_Object lface_attrs[LFACE_VECTOR_SIZE]; - int i; memcpy (lface_attrs, face->lface, LFACE_VECTOR_SIZE); /* Make explicit any attributes whose value is 'reset'. */ - for (i = 1; i < LFACE_VECTOR_SIZE; i++) + for (int i = 1; i < LFACE_VECTOR_SIZE; i++) if (EQ (lface_attrs[i], Qreset)) lface_attrs[i] = deflt->lface[i]; merge_face_vectors (w, f, lface_attrs, attrs, 0); @@ -6965,10 +6949,8 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, doc: /* */) { if (NILP (n)) { - int i; - fputs ("font selection order: ", stderr); - for (i = 0; i < ARRAYELTS (font_sort_order); ++i) + for (int i = 0; i < ARRAYELTS (font_sort_order); ++i) fprintf (stderr, "%d ", font_sort_order[i]); putc ('\n', stderr); @@ -6976,7 +6958,7 @@ DEFUN ("dump-face", Fdump_face, Sdump_face, 0, 1, 0, doc: /* */) debug_print (Vface_alternative_font_family_alist); putc ('\n', stderr); - for (i = 0; i < FRAME_FACE_CACHE (SELECTED_FRAME ())->used; ++i) + for (int i = 0; i < FRAME_FACE_CACHE (SELECTED_FRAME ())->used; ++i) Fdump_face (make_fixnum (i)); } else diff --git a/src/xterm.c b/src/xterm.c index dc7e3283a5c..d70e78b6b34 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10633,10 +10633,6 @@ x_scroll_run (struct window *w, struct run *run) static void x_frame_highlight (struct frame *f) { - struct x_display_info *dpyinfo; - - dpyinfo = FRAME_DISPLAY_INFO (f); - /* We used to only do this if Vx_no_window_manager was non-nil, but the ICCCM (section 4.1.6) says that the window's border pixmap and border pixel are window attributes which are "private to the @@ -10646,10 +10642,10 @@ x_frame_highlight (struct frame *f) the window-manager in use, tho something more is at play since I've been using that same window-manager binary for ever. Let's not crash just because of this (bug#9310). */ - x_ignore_errors_for_next_request (dpyinfo); + x_catch_errors (FRAME_X_DISPLAY (f)); XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), f->output_data.x->border_pixel); - x_stop_ignoring_errors (dpyinfo); + x_uncatch_errors (); unblock_input (); gui_update_cursor (f, true); x_set_frame_alpha (f); @@ -10658,23 +10654,17 @@ x_frame_highlight (struct frame *f) static void x_frame_unhighlight (struct frame *f) { - struct x_display_info *dpyinfo; - - dpyinfo = FRAME_DISPLAY_INFO (f); - /* We used to only do this if Vx_no_window_manager was non-nil, but the ICCCM (section 4.1.6) says that the window's border pixmap and border pixel are window attributes which are "private to the client", so we can always change it to whatever we want. */ - block_input (); /* Same as above for XSetWindowBorder (bug#9310). */ - x_ignore_errors_for_next_request (dpyinfo); + x_catch_errors (FRAME_X_DISPLAY (f)); XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), f->output_data.x->border_tile); - x_stop_ignoring_errors (dpyinfo); + x_uncatch_errors (); unblock_input (); - gui_update_cursor (f, true); x_set_frame_alpha (f); } -- 2.36.1 --=-=-= Content-Type: text/plain In Commercial Emacs 0.3.1snapshot 98cf0cf in dev (upstream 29.0.50, x86_64-pc-linux-gnu) built on dick Repository revision: 98cf0cfd887f1cfe5567d0c048f88a70d939e8f9 Repository branch: dev Windowing system distributor 'The X.Org Foundation', version 11.0.12013000 System Description: Ubuntu 20.04.4 LTS Configured using: 'configure --prefix=/home/dick/.local --with-tree-sitter' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON TREE_SITTER LCMS2 LIBSELINUX LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Magit Log Minor modes in effect: global-git-commit-mode: t shell-dirtrack-mode: t projectile-mode: t flx-ido-mode: t override-global-mode: t global-hl-line-mode: t hl-line-mode: t winner-mode: t tooltip-mode: t show-paren-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/dick/gomacro-mode/gomacro-mode hides /home/dick/.emacs.d/elpa/gomacro-mode-20200326.1103/gomacro-mode /home/dick/.emacs.d/elpa/go-rename-20190805.2101/go-rename hides /home/dick/.emacs.d/elpa/go-mode-1.6.0/go-rename /home/dick/.emacs.d/elpa/go-guru-20181012.330/go-guru hides /home/dick/.emacs.d/elpa/go-mode-1.6.0/go-guru /home/dick/org-gcal.el/org-gcal hides /home/dick/.emacs.d/elpa/org-gcal-0.3/org-gcal /home/dick/.emacs.d/elpa/request-deferred-0.2.0/request-deferred hides /home/dick/.emacs.d/elpa/request-0.3.3/request-deferred /home/dick/.emacs.d/elpa/chess-2.0.5/_pkg hides /home/dick/.local/share/emacs/site-lisp/_pkg /home/dick/.emacs.d/elpa/chess-2.0.5/chess-pos hides /home/dick/.local/share/emacs/site-lisp/chess-pos /home/dick/.emacs.d/elpa/chess-2.0.5/chess-module hides /home/dick/.local/share/emacs/site-lisp/chess-module /home/dick/.emacs.d/elpa/chess-2.0.5/chess-ucb hides /home/dick/.local/share/emacs/site-lisp/chess-ucb /home/dick/.emacs.d/elpa/chess-2.0.5/chess-scid hides /home/dick/.local/share/emacs/site-lisp/chess-scid /home/dick/.emacs.d/elpa/chess-2.0.5/chess-puzzle hides /home/dick/.local/share/emacs/site-lisp/chess-puzzle /home/dick/.emacs.d/elpa/chess-2.0.5/chess-irc hides /home/dick/.local/share/emacs/site-lisp/chess-irc /home/dick/.emacs.d/elpa/chess-2.0.5/chess-network hides /home/dick/.local/share/emacs/site-lisp/chess-network /home/dick/.emacs.d/elpa/chess-2.0.5/chess-autosave hides /home/dick/.local/share/emacs/site-lisp/chess-autosave /home/dick/.emacs.d/elpa/chess-2.0.5/chess-engine hides /home/dick/.local/share/emacs/site-lisp/chess-engine /home/dick/.emacs.d/elpa/chess-2.0.5/chess-tutorial hides /home/dick/.local/share/emacs/site-lisp/chess-tutorial /home/dick/.emacs.d/elpa/chess-2.0.5/chess-german hides /home/dick/.local/share/emacs/site-lisp/chess-german /home/dick/.emacs.d/elpa/chess-2.0.5/chess-file hides /home/dick/.local/share/emacs/site-lisp/chess-file /home/dick/.emacs.d/elpa/chess-2.0.5/chess-random hides /home/dick/.local/share/emacs/site-lisp/chess-random /home/dick/.emacs.d/elpa/chess-2.0.5/chess-stockfish hides /home/dick/.local/share/emacs/site-lisp/chess-stockfish /home/dick/.emacs.d/elpa/chess-2.0.5/chess-pgn hides /home/dick/.local/share/emacs/site-lisp/chess-pgn /home/dick/.emacs.d/elpa/chess-2.0.5/chess-kibitz hides /home/dick/.local/share/emacs/site-lisp/chess-kibitz /home/dick/.emacs.d/elpa/chess-2.0.5/chess-eco hides /home/dick/.local/share/emacs/site-lisp/chess-eco /home/dick/.emacs.d/elpa/chess-2.0.5/chess-display hides /home/dick/.local/share/emacs/site-lisp/chess-display /home/dick/.emacs.d/elpa/chess-2.0.5/chess-var hides /home/dick/.local/share/emacs/site-lisp/chess-var /home/dick/.emacs.d/elpa/chess-2.0.5/chess-test hides /home/dick/.local/share/emacs/site-lisp/chess-test /home/dick/.emacs.d/elpa/chess-2.0.5/chess-ply hides /home/dick/.local/share/emacs/site-lisp/chess-ply /home/dick/.emacs.d/elpa/chess-2.0.5/chess-message hides /home/dick/.local/share/emacs/site-lisp/chess-message /home/dick/.emacs.d/elpa/chess-2.0.5/chess-ics1 hides /home/dick/.local/share/emacs/site-lisp/chess-ics1 /home/dick/.emacs.d/elpa/chess-2.0.5/chess-phalanx hides /home/dick/.local/share/emacs/site-lisp/chess-phalanx /home/dick/.emacs.d/elpa/chess-2.0.5/chess-game hides /home/dick/.local/share/emacs/site-lisp/chess-game /home/dick/.emacs.d/elpa/chess-2.0.5/chess-log hides /home/dick/.local/share/emacs/site-lisp/chess-log /home/dick/.emacs.d/elpa/chess-2.0.5/chess-plain hides /home/dick/.local/share/emacs/site-lisp/chess-plain /home/dick/.emacs.d/elpa/chess-2.0.5/chess-perft hides /home/dick/.local/share/emacs/site-lisp/chess-perft /home/dick/.emacs.d/elpa/chess-2.0.5/chess-glaurung hides /home/dick/.local/share/emacs/site-lisp/chess-glaurung /home/dick/.emacs.d/elpa/chess-2.0.5/chess-ai hides /home/dick/.local/share/emacs/site-lisp/chess-ai /home/dick/.emacs.d/elpa/chess-2.0.5/chess-fruit hides /home/dick/.local/share/emacs/site-lisp/chess-fruit /home/dick/.emacs.d/elpa/chess-2.0.5/chess-uci hides /home/dick/.local/share/emacs/site-lisp/chess-uci /home/dick/.emacs.d/elpa/chess-2.0.5/chess-epd hides /home/dick/.local/share/emacs/site-lisp/chess-epd /home/dick/.emacs.d/elpa/chess-2.0.5/chess-database hides /home/dick/.local/share/emacs/site-lisp/chess-database /home/dick/.emacs.d/elpa/chess-2.0.5/chess-link hides /home/dick/.local/share/emacs/site-lisp/chess-link /home/dick/.emacs.d/elpa/chess-2.0.5/chess-transport hides /home/dick/.local/share/emacs/site-lisp/chess-transport /home/dick/.emacs.d/elpa/chess-2.0.5/chess-none hides /home/dick/.local/share/emacs/site-lisp/chess-none /home/dick/.emacs.d/elpa/chess-2.0.5/chess-polyglot hides /home/dick/.local/share/emacs/site-lisp/chess-polyglot /home/dick/.emacs.d/elpa/chess-2.0.5/chess-crafty hides /home/dick/.local/share/emacs/site-lisp/chess-crafty /home/dick/.emacs.d/elpa/chess-2.0.5/chess-chat hides /home/dick/.local/share/emacs/site-lisp/chess-chat /home/dick/.emacs.d/elpa/chess-2.0.5/chess hides /home/dick/.local/share/emacs/site-lisp/chess /home/dick/.emacs.d/elpa/chess-2.0.5/chess-images hides /home/dick/.local/share/emacs/site-lisp/chess-images /home/dick/.emacs.d/elpa/chess-2.0.5/chess-gnuchess hides /home/dick/.local/share/emacs/site-lisp/chess-gnuchess /home/dick/.emacs.d/elpa/chess-2.0.5/chess-fen hides /home/dick/.local/share/emacs/site-lisp/chess-fen /home/dick/.emacs.d/elpa/chess-2.0.5/chess-ics hides /home/dick/.local/share/emacs/site-lisp/chess-ics /home/dick/.emacs.d/elpa/chess-2.0.5/chess-ics2 hides /home/dick/.local/share/emacs/site-lisp/chess-ics2 /home/dick/.emacs.d/elpa/chess-2.0.5/chess-common hides /home/dick/.local/share/emacs/site-lisp/chess-common /home/dick/.emacs.d/elpa/chess-2.0.5/chess-input hides /home/dick/.local/share/emacs/site-lisp/chess-input /home/dick/.emacs.d/elpa/chess-2.0.5/chess-announce hides /home/dick/.local/share/emacs/site-lisp/chess-announce /home/dick/.emacs.d/elpa/chess-2.0.5/chess-clock hides /home/dick/.local/share/emacs/site-lisp/chess-clock /home/dick/.emacs.d/elpa/chess-2.0.5/chess-sound hides /home/dick/.local/share/emacs/site-lisp/chess-sound /home/dick/.emacs.d/elpa/chess-2.0.5/chess-sjeng hides /home/dick/.local/share/emacs/site-lisp/chess-sjeng /home/dick/.emacs.d/elpa/chess-2.0.5/chess-algebraic hides /home/dick/.local/share/emacs/site-lisp/chess-algebraic /home/dick/.emacs.d/elpa/transient-0.3.7snapshot/transient hides /home/dick/.local/share/emacs/0.3.1/lisp/transient Features: (shadow emacsbug goto-addr shortdoc ivy delsel colir ivy-overlay ffap pulse dumb-jump bbdb-message footnote gnus-html gravatar dns sh-script executable org-element avl-tree ol-eww eww xdg ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect ol-docview doc-view image-mode exif ol-bibtex ol-bbdb ol-w3m ol-doi org-link-doi org-tempo tempo org org-macro org-footnote org-pcomplete org-list org-faces org-entities org-version ob-R ob-emacs-lisp ob-ein ein-cell ein-shared-output ein-output-area ein-kernel ein-ipdb ein-query ein-events ein-websocket websocket bindat ein-node ewoc ein-log ein-classes ein-core ein ein-utils deferred ob ob-tangle org-src ob-ref ob-lob ob-table ob-exp ob-comint ob-core ob-eval org-table oc-basic bibtex ol org-keys oc org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs help-fns radix-tree cl-print debug backtrace vc bug-reference cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs tramp-archive tramp-gvfs tramp-cache zeroconf jka-compr nndoc display-line-numbers debbugs-gnu debbugs-compat debbugs soap-client rng-xsd rng-dt rng-util xsd-regexp poly-rst rst polymode poly-lock polymode-base polymode-weave polymode-export polymode-compat polymode-methods polymode-core polymode-classes eieio-custom eieio-base vc-git vc-dispatcher ag vc-svn find-dired misearch multi-isearch elpaso elpaso-admin elpaso-milky elpaso-defs magit-extras mule-util face-remap magit-patch-changelog magit-patch magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff diff-mode git-commit log-edit pcvs-util add-log magit-core magit-margin magit-transient magit-process with-editor server magit-mode transient shr-color url-queue qp mm-archive sort smiley mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check gnus-async gnus-ml gnus-notifications gnus-fun notifications gnus-kill gnus-dup disp-table utf-7 blamer a tramp tramp-loaddefs trampver tramp-integration cus-start files-x tramp-compat shell pcomplete ls-lisp url-cache benchmark nnrss nnfolder nndiscourse rbenv nnhackernews nntwitter nntwitter-api bbdb-gnus gnus-demon nntp nnmairix nnml nnreddit gnus-topic url-http url-auth url-gw network-stream nsm request virtualenvwrapper gud s json-rpc python gnus-score score-mode gnus-bcklg gnus-srvr gnus-cite anaphora bbdb-mua bbdb-com bbdb bbdb-site timezone gnus-delay gnus-draft gnus-cache gnus-agent gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file url-dired svg dom nndraft nnmh gnus-group mm-url gnus-undo use-package use-package-delight use-package-diminish gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message sendmail yank-media puny dired-x dired dired-loaddefs rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win paredit-ext paredit inf-ruby ruby-mode smie company pcase haskell-interactive-mode haskell-presentation-mode haskell-process haskell-session haskell-compile haskell-mode haskell-cabal haskell-utils haskell-font-lock haskell-indentation haskell-string haskell-sort-imports haskell-lexeme haskell-align-imports haskell-complete-module haskell-ghc-support noutline outline flymake-proc flymake warnings etags fileloop generator dabbrev haskell-customize hydra lv use-package-ensure solarized-theme solarized-definitions projectile lisp-mnt ibuf-ext ibuffer ibuffer-loaddefs thingatpt magit-autorevert autorevert filenotify magit-git magit-base magit-section format-spec crm dash rx compat-27 compat-26 compat grep compile comint ansi-color gnus nnheader range mail-utils mm-util mail-prsvr gnus-util text-property-search time-date flx-ido flx google-translate-default-ui google-translate-core-ui facemenu color ido google-translate-core google-translate-tk google-translate-backend use-package-bind-key bind-key auto-complete easy-mmode advice edmacro kmacro popup cus-edit pp cus-load wid-edit emms-player-mplayer emms-player-simple emms emms-compat cl-extra help-mode xref project use-package-core derived hl-line winner ring debbugs-autoloads eglot-autoloads elpaso-disc-autoloads elpaso-autoloads find-func finder-inf go-mode-autoloads json-reformat-autoloads json-snatcher-autoloads projectile-autoloads sml-mode-autoloads epl-autoloads tornado-template-mode-autoloads typescript-mode-autoloads request-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map byte-opt gv bytecomp byte-compile cconv cldefs url-vars cl-loaddefs cl-lib rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tree-sitter tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 2425183 261237) (symbols 48 57246 64) (strings 32 380879 102783) (string-bytes 1 14283720) (vectors 16 166398) (vector-slots 8 4365510 220301) (floats 8 4040 4208) (intervals 56 126065 5375) (buffers 1000 58)) --=-=-=--