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: Manuel Giraud
Subject: Re: How to walk a Lisp_String?
Date: Fri, 02 Sep 2022 13:40:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Manuel Giraud <manuel@ledu-giraud.fr>
>> Cc: emacs-devel@gnu.org
>> Date: Fri, 02 Sep 2022 10:56:56 +0200
>> 
>> > Why would you need to create a unibyte string?  More importantly, why
>> > would you trust make_string to make the decision that is right for
>> > your purposes?
>> 
>> Because it was written by Emacs' hackers… more seriously, for the
>> purpose of menu entries, I think that most strings will be unibyte ASCII
>> strings.
>
> ASCII strings can be unibyte or multibyte, Emacs does TRT with both.
> So you don't need to worry about that.

Duly noted.

>> But I thought I needed a Lisp_String in order to use some
>> other emacs interfaces.
>
> Depends on the interface.

For instance, face_at_string_position or fetch_string_char_advance 😉

[...]

> You probably modified display_menu_item, because I see no Lisp_String
> objects there no or Lisp_Object frame.

Yes obviously.  Because I was trying to discuss the design (as you
suggested) but also, with informations from you, Po and Stefan, trying
to *do* something about it.

> So I still don't understand how you intend to put face information on
> your Lisp strings,

I'm still clueless about this.  You said that I have to propertize them
so I think there is a C interface for this too.

> nor even how you produce those Lisp strings in a function that
> currently manipulates only C data types, without any Emacs-specific
> Lisp data types.

But I'm using Emacs-specific Lisp data types (and Emacs interfaces)!  To
produce the Lisp strings from char *, I've used make_string.

[...]

> At least, yes.  And then I'd expect the currently active
> (a.k.a. "selected") menu item to have a different face from the other
> items, so that the active menu item stands out on display and provides
> a visual feedback for the user moving the mouse to select menu items.

You're right.  I guess that I'd have to introduce a menu-selected face.
But from where I am now, it will at a final stage.
-- 
Manuel Giraud



reply via email to

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