From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.devel Subject: Re: How to walk a Lisp_String? Date: Fri, 02 Sep 2022 13:40:53 +0200 Message-ID: <87mtbi57i2.fsf@elite.giraud> References: <87a67jw1kw.fsf@elite.giraud> <83o7vzqey8.fsf@gnu.org> <83mtbjqemd.fsf@gnu.org> <87ler2963r.fsf@elite.giraud> <838rn2qnsf.fsf@gnu.org> <87wnam6y70.fsf@elite.giraud> <831qsuqllo.fsf@gnu.org> <87bkry6tnr.fsf@elite.giraud> <83tu5qoxol.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38995"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (berkeley-unix) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 02 13:44:38 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oU56E-000A0S-2U for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Sep 2022 13:44:38 +0200 Original-Received: from localhost ([::1]:48794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oU56C-0002Ad-TY for ged-emacs-devel@m.gmane-mx.org; Fri, 02 Sep 2022 07:44:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU52k-0000Zf-6f for emacs-devel@gnu.org; Fri, 02 Sep 2022 07:41:11 -0400 Original-Received: from ledu-giraud.fr ([51.159.28.247]:14300) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oU52g-0002a5-W8; Fri, 02 Sep 2022 07:41:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=76RoUAMAGQz9yywS XLxFOB8kPUMJOcQkirlLCSNcz4U=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=t3On5l1A+r9aWt3BjInuEF8ytjgXRQXp1cFiTW K8ylkRR6+h4Ea4mGr8iJLfUXLVs0i77Sus26iOxXxwoQsIIvqLcTRGUfoBB+B3BOm9pcPA I8Gl+jS8nut1ANCjBXNr1AJklysW3Glse6kPMhifxEgQ6JFd111iu7cVz2hTV2fKmQP9wS imRn1EQMPUX3j54uJ8HiE9rm+oavcV7h7COCRSUJsjOEPPud2gH5VH/rzubxGLUzkKXMSr fEp/v/PenrR74LXmrY5gUDCjfnkOWQPy2BoIGKQ9FlSVP/8M9AYolFYzQWPmlP7O8d3K6Q B7F0EkQBgyw4zZChC3o/Rs6Q== Original-Received: from elite.giraud ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id a2c200bc (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 2 Sep 2022 13:40:54 +0200 (CEST) In-Reply-To: <83tu5qoxol.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 02 Sep 2022 13:52:42 +0300") Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:294535 Archived-At: Eli Zaretskii writes: >> From: Manuel Giraud >> Cc: emacs-devel@gnu.org >> Date: Fri, 02 Sep 2022 10:56:56 +0200 >>=20 >> > 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? >>=20 >> Because it was written by Emacs' hackers=E2=80=A6 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 =F0=9F= =98=89 [...] > 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. --=20 Manuel Giraud