From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Tick Reduction Date: Fri, 26 Nov 2021 14:56:42 +0200 Message-ID: <83fsrj2hyt.fsf@gnu.org> References: <87bl2hyzca.fsf@gnus.org> <87k0gzyy8k.fsf@gnus.org> <835ysjoupv.fsf@gnu.org> <8735nnyob1.fsf@gnus.org> <83y25fneeh.fsf@gnu.org> <87pmqrx7rh.fsf@gnus.org> <83tug3ndaj.fsf@gnu.org> <874k81vmlf.fsf@gnus.org> <83sfvl8wjw.fsf@gnu.org> <87o869y0v2.fsf@gnus.org> <83fsrl8owz.fsf@gnu.org> <87o869wkcx.fsf@gnus.org> <83bl298n9b.fsf@gnu.org> <87pmqpv1jm.fsf@gnus.org> <834k818jwm.fsf@gnu.org> <874k80fkpm.fsf@gnus.org> <83bl285o6b.fsf@gnu.org> <87o868cor3.fsf@gnus.org> <835ysg5no7.fsf@gnu.org> <87k0gwcoce.fsf@gnus.org> <8335nk5lag.fsf@gnu.org> <87r1b39kza.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6033"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, stefankangas@gmail.com, dgutov@yandex.ru To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 26 13:57:40 2021 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 1mqanL-0001N6-3B for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 13:57:39 +0100 Original-Received: from localhost ([::1]:37730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqanJ-00081D-LM for ged-emacs-devel@m.gmane-mx.org; Fri, 26 Nov 2021 07:57:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqamN-0007Ei-Of for emacs-devel@gnu.org; Fri, 26 Nov 2021 07:56:39 -0500 Original-Received: from [2001:470:142:3::e] (port=47580 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqamN-00024P-D4; Fri, 26 Nov 2021 07:56:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=dO8n+Ik5vTMroiFrHtiBtr7LC6MyWu0z49VRqapg47Q=; b=SEPspu8WaBTw KpYM2Qxg+syh6m5RC+3ObLxEhP5e/9dJy9gEZDayihQCcXhGnoqmTfQdKNTfnHx9edjJ4DAEnq+Mo m0RbD9/H/1PEMjlaTmR0ynZwlx9/bZvTBXNvP6t9Z0WxWUeGmSk68bVcbV9v3MJqLGzaqasg6Kmyo HfNwh/pY5pXHG9AQa14DzRhR2R6TucDNqvfHx/ZvXCGXonPOB+hSbW+I3Hlfs2sRU6VB7ildiFaM6 JEOKnnqj29n3bwJKH5JmzZTrMWdUe3tTy/qVIJcnBRmvVIKcP5+F50+WkEzg6Mah/9PVj9dzAMObu eAxXOPmRmy/D9RFQwG86yA==; Original-Received: from [87.69.77.57] (port=2968 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqamN-00046o-3x; Fri, 26 Nov 2021 07:56:39 -0500 In-Reply-To: <87r1b39kza.fsf@gnus.org> (message from Lars Ingebrigtsen on Fri, 26 Nov 2021 13:09:45 +0100) 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:280239 Archived-At: > From: Lars Ingebrigtsen > Cc: dgutov@yandex.ru, stefankangas@gmail.com, emacs-devel@gnu.org > Date: Fri, 26 Nov 2021 13:09:45 +0100 > > Eli Zaretskii writes: > > > Given this description, what exactly do you mean when you say you > > don't understand "how the display (resulting from those C strings) > > does have text properties"? How do you see that "the display does > > have text properties"? > > When hovering over "10%", Emacs displays the `help-echo' text property. Ah, that. It's an illusion which we create in this fragment from display_mode_element: case MODE_LINE_DISPLAY: { int nglyphs_before, nwritten; nglyphs_before = it->glyph_row->used[TEXT_AREA]; nwritten = display_string (spec, string, elt, charpos, 0, it, field, prec, 0, multibyte); /* Assign to the glyphs written above the string where the `%x' came from, position of the `%'. */ if (nwritten > 0) { struct glyph *glyph = (it->glyph_row->glyphs[TEXT_AREA] + nglyphs_before); int i; for (i = 0; i < nwritten; ++i) { glyph[i].object = elt; glyph[i].charpos = charpos; } n += nwritten; } As you see, after display_string (where any 'display' properties can be consulted and acted upon) does its job and produces some glyphs for display on the mode line, we manually assign to each produced glyph the original object from which those glyphs came. In this case, that object is the Lisp string whose text is "%p" and whose text properties include help-echo etc. Then, when the mouse hovers over that part of the mode line, the code in note_mode_line_or_margin_highlight examines the object recorded in the glyph below the mouse pointer, and extracts the help-echo stuff.