GNU bug report logs - #75521
scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Sun, 12 Jan 2025 17:56:02 UTC

Severity: wishlist

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #121 received at 75521 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: pipcet <at> protonmail.com, stefankangas <at> gmail.com
Cc: 75521 <at> debbugs.gnu.org
Subject: Re: bug#75521: scratch/igc: Delete unused macro DEFVAR_LISP_NOPROX
Date: Tue, 14 Jan 2025 17:59:37 +0200
> Cc: 75521 <at> debbugs.gnu.org, stefankangas <at> gmail.com
> Date: Mon, 13 Jan 2025 22:07:21 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> 
> Anyway, please don't install anything yet.  I want to take a closer
> look at this code and its usage, and I've ran out of time for today.

WDYT about the patch below?  It's supposed to keep the 3 variables in
sync with the corresponding slots in font_style_table, if the slots
are ever modified.

diff --git a/src/font.c b/src/font.c
index 8638226..77fc74b 100644
--- a/src/font.c
+++ b/src/font.c
@@ -418,8 +418,23 @@ font_style_to_value (enum font_property_index prop, Lisp_Object val,
       eassert (len < 255);
       elt = make_vector (2, make_fixnum (100));
       ASET (elt, 1, val);
-      ASET (font_style_table, prop - FONT_WEIGHT_INDEX,
-	    CALLN (Fvconcat, table, make_vector (1, elt)));
+      Lisp_Object new_table = CALLN (Fvconcat, table, make_vector (1, elt));
+      /* Update the corresponding variable with the new value.  */
+      switch (prop)
+	{
+	case FONT_WEIGHT_INDEX:
+	  Vfont_weight_table = new_table;
+	  break;
+	case FONT_SLANT_INDEX:
+	  Vfont_slant_table = new_table;
+	  break;
+	case FONT_WIDTH_INDEX:
+	  Vfont_width_table = new_table;
+	  break;
+	default:
+	  break;
+	}
+      ASET (font_style_table, prop - FONT_WEIGHT_INDEX, new_table);
       return (100 << 8) | (i << 4);
     }
   else




This bug report was last modified 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.