From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#28771: 26.0.60; A couple space display property feature requests Date: Mon, 09 Oct 2017 20:02:23 -0600 Message-ID: <87bmlfbw0g.fsf@gmail.com> References: <87fuarc0px.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1507600992 7107 195.159.176.226 (10 Oct 2017 02:03:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 10 Oct 2017 02:03:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) To: 28771@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 10 04:03:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1jsx-0000x0-7N for geb-bug-gnu-emacs@m.gmane.org; Tue, 10 Oct 2017 04:03:07 +0200 Original-Received: from localhost ([::1]:60692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1jt2-00041j-Dc for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Oct 2017 22:03:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e1jsw-00041e-Kg for bug-gnu-emacs@gnu.org; Mon, 09 Oct 2017 22:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e1jss-0008Ua-Ms for bug-gnu-emacs@gnu.org; Mon, 09 Oct 2017 22:03:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50221) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e1jss-0008UD-IO for bug-gnu-emacs@gnu.org; Mon, 09 Oct 2017 22:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e1jss-0005RQ-1u for bug-gnu-emacs@gnu.org; Mon, 09 Oct 2017 22:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Oct 2017 02:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28771 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 28771-submit@debbugs.gnu.org id=B28771.150760095520874 (code B ref 28771); Tue, 10 Oct 2017 02:03:02 +0000 Original-Received: (at 28771) by debbugs.gnu.org; 10 Oct 2017 02:02:35 +0000 Original-Received: from localhost ([127.0.0.1]:58902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1jsQ-0005Qc-Jd for submit@debbugs.gnu.org; Mon, 09 Oct 2017 22:02:34 -0400 Original-Received: from mail-io0-f181.google.com ([209.85.223.181]:50804) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1jsO-0005QO-Tm for 28771@debbugs.gnu.org; Mon, 09 Oct 2017 22:02:33 -0400 Original-Received: by mail-io0-f181.google.com with SMTP id 97so10321981iok.7 for <28771@debbugs.gnu.org>; Mon, 09 Oct 2017 19:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=AEwc/X3vNMlGgiEhhPU+P/hFolaf0zdBqdJ0WrTz7X0=; b=OnJ4PsyvASdw5JMvCZmeaq0Ypqx9o7K/5ZP4L4orPUsV3pmBQHL1c2JxDlWXyJzXF6 S3s0rN8o19K7rHbigXir9heByM4o+gq9F6iSXEBru4aYBdti9m/SM1tmNXxgwokPg2ec gRHkEg0GoOk6TCOYhcEC8uH0KIr30kXBl+VlT/+AlPQ68Ah9qXW+8EvUdb4j9rxallru mDWxARFD7tNDGjJKD8CFWfZN8cxUpAFh9WDuPAZbcjynTaDkj8RoL3tbB0znYE/+6/TO lQ06oaCBdui2S4Mw32NC7ERnv/z7U6k2GMGs1QQuJl5+EUFepnWrT58annH5vwek94vI +7jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=AEwc/X3vNMlGgiEhhPU+P/hFolaf0zdBqdJ0WrTz7X0=; b=EZg99FX0UOYclDASTtlbegL0CNHcKkaUM5ypvKMb7HmfHw+qYvHO6iI663S+ay5qhm 2sR/ewrq1Hx5LpdwXxhne7mHJcBcuFEXW1fdlYgGtYJvoBs4ZfH2HjquO+lqeiIuOCnS fMl5SJ92kWQmfz9X9aYnjsBGaQDZ2qIheJkjhOKG6KnBotzURI6Ykf8K2B+jZh+b0BMr s5lUVx6xusNuZGt3SD0VxqEKXII39zeeb2zzXM1BnsUOtNO1MYWd6eSMAZfT5Octb+cV UTfaitxIFvAsq/oD8pMHz1NjqnXpNaXZh0YfulsUiSi5nXY7Ig0jAkjORqSYr8tVey/a 6deA== X-Gm-Message-State: AMCzsaWwvwU1oyKZKt8JGv+s4wyYFWE+tfa5DfN5GyZmR5/S02sjvATf PWpr/i9rJrfujTvIA2Pc5ATr7w== X-Google-Smtp-Source: AOwi7QBzuMYemXNDqeOt/wXjzqnZpIpwJ+oXrHU458RHjVivvvG5vutuMe5urhuwaW0i+IEhjPnjLQ== X-Received: by 10.107.17.209 with SMTP id 78mr14482500ior.247.1507600946822; Mon, 09 Oct 2017 19:02:26 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id d143sm4695098itd.8.2017.10.09.19.02.25 for <28771@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Oct 2017 19:02:25 -0700 (PDT) In-Reply-To: <87fuarc0px.fsf@gmail.com> (Alex's message of "Mon, 09 Oct 2017 18:20:42 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138145 Archived-At: --=-=-= Content-Type: text/plain Alex writes: > 1. Specifying the pixel width to the left/center/right of the text area. > This is helpful (I believe it's necessary if I want it to be robust) > when one wants to pad either side of a string with the same number of > pixels and the left side uses (:align-to 0). > > I could use (:width (+ left-fringe left-margin)) for the right > padding, but this doesn't take into account line-number display, as > well as the scroll-bar width (if it's on the left). > > 2. Specifying the pixel position relative to the left or right edge of > the window. The right edge of the window currently may be the right > edge of the right fringe or the scroll bar, depending on what side it > is on. Also, just in the case that in the future the > fringe/scroll-bar may not be the outermost elements, there should be > a way to explicitly specify one of the edges. Here's a diff that implements both #1 and #2: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=space.diff Content-Description: space diff --git a/src/xdisp.c b/src/xdisp.c index b14b7daf2b..d5fa3a1cfe 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25210,6 +25210,10 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, + (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (it->w) ? WINDOW_RIGHT_FRINGE_WIDTH (it->w) : 0))); + if (EQ (prop, Qleft_edge)) + return OK_ALIGN_TO (WINDOW_LEFT_PIXEL_EDGE (it->w)); + if (EQ (prop, Qright_edge)) + return OK_ALIGN_TO (WINDOW_RIGHT_PIXEL_EDGE (it->w)); } else { @@ -25223,6 +25227,13 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, return OK_PIXELS (WINDOW_RIGHT_MARGIN_WIDTH (it->w)); if (EQ (prop, Qscroll_bar)) return OK_PIXELS (WINDOW_SCROLL_BAR_AREA_WIDTH (it->w)); + if (EQ (prop, Qleft)) + return OK_PIXELS (window_box_left_offset (it->w, TEXT_AREA)); + if (EQ (prop, Qright)) + return OK_PIXELS (window_box_right_offset (it->w, TEXT_AREA)); + if (EQ (prop, Qcenter)) + return OK_PIXELS (window_box_left_offset (it->w, TEXT_AREA) + + window_box_width (it->w, TEXT_AREA) / 2); } prop = buffer_local_value (prop, it->w->contents); @@ -32207,6 +32218,8 @@ They are still logged to the *Messages* buffer. */); DEFSYM (Qspace, "space"); DEFSYM (Qmargin, "margin"); DEFSYM (Qpointer, "pointer"); + DEFSYM (Qleft_edge, "left-edge"); + DEFSYM (Qright_edge, "right-edge"); DEFSYM (Qleft_margin, "left-margin"); DEFSYM (Qright_margin, "right-margin"); DEFSYM (Qcenter, "center"); --=-=-=--