emacs-devel
[Top][All Lists]
Advanced

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

Re: How to walk a Lisp_String?


From: Eli Zaretskii
Subject: Re: How to walk a Lisp_String?
Date: Fri, 02 Sep 2022 09:43:28 +0300

> From: Manuel Giraud <manuel@ledu-giraud.fr>
> Cc: emacs-devel@gnu.org
> Date: Thu, 01 Sep 2022 22:45:12 +0200
> 
> I'm working into lwlib only.  So I've made a function to get the frame
> of the menu widget (mw).  I'm also converting the char* display_string
> of each menu entry to a Lisp_String with make_string (note: I don't know
> if I should have done that but it seems the way to get a proper
> multi-byte string from a char*).

make_multibyte_string is better, I think.

And I don't think I understand how you get the Lisp string to have the
face information.  The original C char* string cannot have that
information as part of the string's data, so where will the face data
for the Lisp string come from?

> Finally, I'd like to walk this Lisp_String and call FACE_FOR_CHAR for
> each charater of this frame.  And then be able to call XftDrawStringUtf8
> (or XmbDrawString) on each substring/font pair.  WDYT?

Po Lu answered about the XftDrawStringUtf8 part.

For the faces part, I think face_at_string_position is a better
interface.  It returns a face ID, from which you can get to the
corresponding 'struct face' via FACE_FROM_ID.



reply via email to

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