emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 71a9151: * src/character.c (char_width): Support


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 71a9151: * src/character.c (char_width): Support glyphs with faces. (Bug#32276)
Date: Fri, 27 Jul 2018 05:34:05 -0400 (EDT)

branch: emacs-26
commit 71a915153a5b4818f0a3cdebb7a1afb4fe6de374
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    * src/character.c (char_width): Support glyphs with faces.  (Bug#32276)
---
 src/character.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/character.c b/src/character.c
index deac1fa..48268e0 100644
--- a/src/character.c
+++ b/src/character.c
@@ -34,6 +34,7 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
 #include "lisp.h"
 #include "character.h"
 #include "buffer.h"
+#include "dispextern.h"
 #include "composite.h"
 #include "disptab.h"
 
@@ -288,13 +289,15 @@ char_width (int c, struct Lisp_Char_Table *dp)
       if (VECTORP (disp))
        for (i = 0, width = 0; i < ASIZE (disp); i++)
          {
+           int c;
            ch = AREF (disp, i);
-           if (CHARACTERP (ch))
-             {
-               int w = CHARACTER_WIDTH (XFASTINT (ch));
-               if (INT_ADD_WRAPV (width, w, &width))
-                 string_overflow ();
-             }
+           if (GLYPH_CODE_P (ch))
+             c = GLYPH_CODE_CHAR (ch);
+           else if (CHARACTERP (ch))
+             c = XFASTINT (ch);
+           int w = CHARACTER_WIDTH (c);
+           if (INT_ADD_WRAPV (width, w, &width))
+             string_overflow ();
          }
     }
   return width;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]