From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#43405: Tool bar item doesn't align to the right edge Date: Mon, 21 Sep 2020 20:30:53 +0200 Message-ID: References: <83pn6shjni.fsf@gnu.org> <20200911074445.GB5194@tuxteam.de> <87zh5uqdqm.fsf@mail.linkov.net> <834ko1da33.fsf@gnu.org> <87sgbloe5z.fsf@mail.linkov.net> <83een5bkja.fsf@gnu.org> <87v9ghlc5c.fsf@mail.linkov.net> <83d02pbhny.fsf@gnu.org> <87een4qi9i.fsf_-_@mail.linkov.net> <837dsw9mpu.fsf@gnu.org> <87r1r3ncwq.fsf@mail.linkov.net> <83a6xq995x.fsf@gnu.org> <831rj07c0j.fsf@gnu.org> <83v9gc5u94.fsf@gnu.org> <83sgbg5sg2.fsf@gnu.org> <83v9gb4g2a.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="14799"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43405@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 21 20:36:24 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kKQfn-0003kh-Ld for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 20:36:23 +0200 Original-Received: from localhost ([::1]:47392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kKQfm-0004NR-O9 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 21 Sep 2020 14:36:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kKQbb-0002Ak-Os for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 14:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kKQbZ-0006Ro-WA for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 14:32:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kKQbZ-0004j5-Rm for bug-gnu-emacs@gnu.org; Mon, 21 Sep 2020 14:32:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87een4qi9i.fsf_-_@mail.linkov.net> Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 21 Sep 2020 18:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43405 X-GNU-PR-Package: emacs Original-Received: via spool by 43405-submit@debbugs.gnu.org id=B43405.160071306718102 (code B ref 43405); Mon, 21 Sep 2020 18:32:01 +0000 Original-Received: (at 43405) by debbugs.gnu.org; 21 Sep 2020 18:31:07 +0000 Original-Received: from localhost ([127.0.0.1]:56165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKQah-0004hu-3C for submit@debbugs.gnu.org; Mon, 21 Sep 2020 14:31:07 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:40465) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kKQad-0004hN-5s for 43405@debbugs.gnu.org; Mon, 21 Sep 2020 14:31:05 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id j2so13851518wrx.7 for <43405@debbugs.gnu.org>; Mon, 21 Sep 2020 11:31:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:message-id:mime-version :content-transfer-encoding; bh=dKivQwyIoDm5ZAOn2ck/M610if8BmSQ1xDrewDPPwOM=; b=ul0ZY1P5+0YIU9rGW4utaOpIPL0OANn8d7/Rwy9MN14N+Ft8Mg5j0Zh5daAWxbLkdO D2BnDOQz+GF97PVNzTOsb+if4Ef0zmp/JEystBBUyUGqn7oOg++PBoJDDOmsfg+mxn7Y RmYfgXQuhQYnoCORO4F4hrqIWaM+V357++FZ5feaLUp9lzXOQs3evhoSl8tQHUUyiG+P V1Tr7tUIxJOCjBlSSo9evsBkgiEgMoZAZ9hXiB14J8RoX//OokB970RGgYsh7PH4sl43 hhqKbIvlp/MSnrXD4RTOdgbgsfknSKlX6TGGXnK8n26dw24LJLrayEEyumKd2k0DADxV 4gJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:message-id :mime-version:content-transfer-encoding; bh=dKivQwyIoDm5ZAOn2ck/M610if8BmSQ1xDrewDPPwOM=; b=iS3W0NIvMpqxefd3JBbc7Zaw9xHxgvc6NS7VxJX1NC2pZkK3UfQKDfCdkylGt6UBlf M8IwYrKxMfa5Dgc4YI22mJ1p0hJuhdupIrEDRkuI3YKmbVkl727o0o83us3NGHPjCYgS mLcVZc71CZMzkHjaeJldUdTFqkcpvrk8Bc8PE6UDGIv/bcRASdGCFyNzeeUnEAcbPv/1 ZN/Y0xlS5cn40UybjYe4M2LJu/txciNE1sFoIqTPMx56D3QLNXWb7/RYNJeUVlQR2O6z N6Kc8KcWVBGmMaNwu2NFGESaXBrnPSVhii5Ir59s/qoeeLWhInePm3FgbT7OqegaTULJ WgtA== X-Gm-Message-State: AOAM5334nZ4mQFHhAN4mrdUPiKOrXWm2xygZOM37v94kw+3fP8DLB+3y G9iWw+Yv2Fj3YfhlfVzSK64= X-Google-Smtp-Source: ABdhPJwte1ThvikqJ1dKO4+upHQ0dgG6UB/sN/FrTv3EUnOTcUbTdGTNqoxa5ewFmXRNzZBErWifqQ== X-Received: by 2002:adf:9124:: with SMTP id j33mr1107627wrj.272.1600713057106; Mon, 21 Sep 2020 11:30:57 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:90b8:9745:bf3d:1ff5]) by smtp.gmail.com with ESMTPSA id 9sm589471wmf.7.2020.09.21.11.30.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Sep 2020 11:30:55 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188633 Archived-At: >>>>> On Fri, 18 Sep 2020 11:58:21 +0300, Eli Zaretskii said: >> OK, so I took a look, and I=CA=BCm not sure it=CA=BCs possible with = the native >> tool bar. We have '(space :align-to right)', but that just inserts >> space up to a specified location, everything subsequent is >> appended. In order to calculate the correct location, I=CA=BCd need = to know >> the width of everything that came after the space, which only >> redisplay can tell us, unless there=CA=BCs a function I=CA=BCve miss= ed? Eli> The support for doing this with the native tool bar must be in C, = and Eli> should indeed be part of the display engine. So everything redisp= lay Eli> knows should be at your fingertips. Your fingertips maybe, not mine :-) So let's assume we do this by exending the display spec to allow '(:right-justify t) which would mean to move everything on this line as far to the right in the window as possible. At some point we=CA=BCd end up in 'gui_produce_glyphs' with a 'struct iter' pointing at the char with that property set. Then: remember it->current_x loop over the iters until we hit eol or max_x, calling PRODUCE_GLPYHS The final it->current_x minus the remembered one is the width of the remain= ing glyphs on the line. Now set it->current_x to the window right edge minus the width. Does that sound like it would work? Is there a more direct way of calculating that width? (I got lost in all the various move_to functions). Robert