From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Phil Sainty Newsgroups: gmane.emacs.bugs Subject: bug#21533: 24.5; current-column result varies between specified spaces using :width and :relative-width Date: Wed, 23 Sep 2015 02:29:25 +1200 Message-ID: <560165C5.2020904@orcon.net.nz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1442933270 12678 80.91.229.3 (22 Sep 2015 14:47:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Sep 2015 14:47:50 +0000 (UTC) To: 21533@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 22 16:47:37 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZeOr1-00043Y-6g for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Sep 2015 16:47:36 +0200 Original-Received: from localhost ([::1]:40436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeOr0-0004oq-E5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 22 Sep 2015 10:47:34 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeOpZ-0002XY-Hn for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 10:46:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeOpW-0007oW-OS for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 10:46:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeOpW-0007o6-L2 for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 10:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZeOpW-0003Rh-9d for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 10:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Phil Sainty Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Sep 2015 14:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21533 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144293313213206 (code B ref -1); Tue, 22 Sep 2015 14:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 22 Sep 2015 14:45:32 +0000 Original-Received: from localhost ([127.0.0.1]:41812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZeOp1-0003Qv-TQ for submit@debbugs.gnu.org; Tue, 22 Sep 2015 10:45:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48116) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZeOoz-0003Qn-UP for submit@debbugs.gnu.org; Tue, 22 Sep 2015 10:45:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeOow-00073m-R9 for submit@debbugs.gnu.org; Tue, 22 Sep 2015 10:45:29 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:33121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeOow-00073a-P6 for submit@debbugs.gnu.org; Tue, 22 Sep 2015 10:45:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeOor-0001YG-0N for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 10:45:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeOoo-0006wV-0d for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 10:45:20 -0400 Original-Received: from [219.88.242.59] (port=44443 helo=mail.orcon.net.nz) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeOon-0006uy-GH for bug-gnu-emacs@gnu.org; Tue, 22 Sep 2015 10:45:17 -0400 Original-Received: from [10.1.1.2] (202-150-97-63.bng1.avl.orcon.net.nz [202.150.97.63] (may be forged)) (authenticated bits=0) by mail.orcon.net.nz (8.14.3/8.14.3/Debian-9.4) with ESMTP id t8METPIO039962 for ; Wed, 23 Sep 2015 02:29:26 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 X-Bayes-Prob: 0.0001 (Score 0: No Bayes scoring rules defined, tokens from: outbound) X-CanIt-Geo: ip=202.150.97.63; country=NZ; latitude=-41; longitude=174.0000; http://maps.google.com/maps?q=-41,174.0000&z=6 X-CanItPRO-Stream: base:outbound X-Canit-Stats-ID: 02PketqS2 - 8a87615179a4 - 20150923 X-Scanned-By: CanIt (www . roaringpenguin . com) X-MIME-Autoconverted: from 8bit to quoted-printable by mail.orcon.net.nz id t8METPIO039962 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106809 Archived-At: I can't tell whether this is expected behaviour or not? Starting from emacs -Q, in the *scratch* buffer, I get the following results from evaluating these forms with C-j: (progn (insert (propertize " " 'display '(space :width 2))) (current-column)) 2 (progn (insert (propertize " " 'display '(space :relative-width 2))) (current-column)) 1 Which is to say that a specified space of :width 2 occupies 2 columns, while a specified space of :relative-width 2 occupies only 1 column. This behaviour seems to be consistent, such that with :width the current-column result comes from the (rounded) number of real columns over which the specified space(s) stretch; whereas with :relative-width the current-column is the same as it would have been without the text property. I'm confused because the manual doesn't seem to suggest that there should be a difference between the two specifications, other than which character is used as the basis for the visual appearance of the space: (elisp) Specified Space: =E2=80=98:width WIDTH=E2=80=99 If WIDTH is a number, it specifies that the space width should be WIDTH times the normal character width. WIDTH can also be a "pixel width" specification (*note Pixel Specification::). =E2=80=98:relative-width FACTOR=E2=80=99 Specifies that the width of the stretch should be computed from the first character in the group of consecutive characters that have the same =E2=80=98display=E2=80=99 property. The space width is th= e width of that character, multiplied by FACTOR. What I was hoping for was the control of being able to specify a precise :width (because the resulting width of tabs when using :relative-width gets rather tricky in practice when it comes to tabs which are not tab-width wide), but with the (current-column) behaviour of :relative-width. (What I'm actually *doing* is scaling indentation, and so if the column numbers vary with the scaling, then re-indenting the buffer causes changes; and I want the effect to be purely visual.) -Phil