From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kalman Reti Newsgroups: gmane.emacs.bugs Subject: bug#32744: There seems to be a bug in current-column in character mode Date: Sun, 16 Sep 2018 19:44:33 -0400 Message-ID: References: <83y3c1gyer.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000824a31057605a3a5" X-Trace: blaine.gmane.org 1537141390 14685 195.159.176.226 (16 Sep 2018 23:43:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Sep 2018 23:43:10 +0000 (UTC) Cc: 32744@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 17 01:43:06 2018 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 1g1ggz-0003hB-MX for geb-bug-gnu-emacs@m.gmane.org; Mon, 17 Sep 2018 01:43:05 +0200 Original-Received: from localhost ([::1]:33032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1gj6-00036w-9R for geb-bug-gnu-emacs@m.gmane.org; Sun, 16 Sep 2018 19:45:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g1giz-00034j-Uc for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2018 19:45:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g1giu-0005a5-6P for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2018 19:45:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g1gis-0005Wr-Ko for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2018 19:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g1gis-0000aN-F2 for bug-gnu-emacs@gnu.org; Sun, 16 Sep 2018 19:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Kalman Reti Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 16 Sep 2018 23:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32744 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32744-submit@debbugs.gnu.org id=B32744.15371414812203 (code B ref 32744); Sun, 16 Sep 2018 23:45:02 +0000 Original-Received: (at 32744) by debbugs.gnu.org; 16 Sep 2018 23:44:41 +0000 Original-Received: from localhost ([127.0.0.1]:42447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1giX-0000ZT-9c for submit@debbugs.gnu.org; Sun, 16 Sep 2018 19:44:41 -0400 Original-Received: from mail-oi0-f53.google.com ([209.85.218.53]:39385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g1giV-0000ZG-HT for 32744@debbugs.gnu.org; Sun, 16 Sep 2018 19:44:39 -0400 Original-Received: by mail-oi0-f53.google.com with SMTP id c190-v6so17365913oig.6 for <32744@debbugs.gnu.org>; Sun, 16 Sep 2018 16:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2OPDV7Pi/51MdE8pikSub0eYTrJLxY2thWIG5ECPbYo=; b=RGVNUzpz1ZbhmXvJYuVTn1D2yUvTnqJP3GdyCebtV+lCSSZ7yMOvWsG+se9BYS6jEh iBGQmYnZ8LPep3VNrgXw2HZrahRexWu1SymHiUJNkrNOIaNlBpW4O6j1ZHObLJLyHbXo wpA+Rb6bthC4jz7fBcWaY3w5iRMQm+XVjTS79JHZk8M/cwDMljm02DwQOZzzldpc8FBC s53mTAQhuR9mZdwE5OQa6Z+rKZLmkL3euAw6NmoKSEOEgR1/MyjSpT4NTM7OLZzLvwJw MCWiW1PWZJm/hL1EMIjmp+D1CbA/DqdJlaQwtVlvoERA2CzOkkktItPM4FsAmJuLSooy f9iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2OPDV7Pi/51MdE8pikSub0eYTrJLxY2thWIG5ECPbYo=; b=byvEHC6DrIBs8ECgU5OWJrt8EfDrHsGneqQk4tqTBlcQw5uHLoHlvFJn5XX4krY5JL oNFc756r1ttnZ7+y/v3Nsq8Kv/HXpBs5e1JfmMQeOA32o71v1KeikoDjzZSRv81QYyWd CHwJIQhB2jIIO3n2pVmdIbUGcPpOtPOuTWhZfKMkZ625nv2SnhWHJt8UCzb6F7Rh5xUF TS3sbHMOgihOdpd8QYpubLuYQ8DCv9G/hgh7NFO4aMy0uZZSKD/ld5JckY/J3YkVIW06 lip29ZzLInQqcdhPBWa+PnY6aZ8N1J0jXNrT4IZSQD2xhH82b2Ln4r/r2ZEr1XG6r6Bv 9K2w== X-Gm-Message-State: APzg51AVfprI5OQKpf1Df8n2tAtna7Y0Ccq7QjOP/72qpVUIvNzRzJ59 6hMRtOfe0rYfk30fwNTrsSjEeytmagAboBd8ER0= X-Google-Smtp-Source: ANB0VdZbra2unPPDz7esHajDjWZNWo7dnb2XE0Ka6uatHT7SEWmnPWacF66T91dJlWlxty094GY32KFa90v1D7KoQBA= X-Received: by 2002:aca:b844:: with SMTP id i65-v6mr16524358oif.177.1537141473690; Sun, 16 Sep 2018 16:44:33 -0700 (PDT) Original-Received: by 2002:ac9:604c:0:0:0:0:0 with HTTP; Sun, 16 Sep 2018 16:44:33 -0700 (PDT) Original-Received: by 2002:ac9:604c:0:0:0:0:0 with HTTP; Sun, 16 Sep 2018 16:44:33 -0700 (PDT) In-Reply-To: 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:150359 Archived-At: --000000000000824a31057605a3a5 Content-Type: text/plain; charset="UTF-8" On Sep 16, 2018 1:12 PM, "Eli Zaretskii" wrote: > From: Kalman Reti > Date: Sun, 16 Sep 2018 09:28:47 -0400 > > In an empty buffer, m-: of > > (let ((p (point))) (insert " ") (add-text-properties p (point) `(display (space :width 7))) (insert ".") > (current-column)) > > returns 2 in gui mode but 8 in character mode of emacsen more recent than emacs 22. (I tried it in several > emacs versions including the most recent 27.0.50 snapshot.) I get 8 in GUI frames as well. The display spec (space :width 7) means 7 times the width of the default face's font. So if your default GUI font is monospaced, you should get 8 in both GUI and text-mode frames. So I'm unsure how come you get 2 in GUI mode. Maybe you've omitted some important detail in the reproducer. I apologize; you are correct, it gets 8 in gui mode as well. I must have been confused about which window was running which version of emacs while I was experimenting. But is that the correct value? The bubbles game code clearly wants it to mean 'the number of forward-chars I have to do from the beginning of the line to get here' not 'what column does it visually look like I'm on'. The doc string for the function doesn't clarify the intended meaning. If you do m-x bubbles immediately followed by m-: (current-column) it returns 1 in the gui case but a number larger than one (which depends upon the :width keyword of the wide-displaying space), but for the game to work in the character case it needs to return 1. Thanks. --000000000000824a31057605a3a5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sep 16, 2018 1:12 PM, "Eli Zaretskii" <eliz@gnu.org> wrote:
> From: Kalman R= eti <kalman.r= eti@gmail.com>
> Date: Sun, 16 Sep 2018 09:28:47 -0400
>
> In an empty buffer, m-: of
>
> (let ((p (point))) (insert " ") (add-text-properties p (poin= t) `(display (space :width 7))) (insert ".")
> (current-column))
>
> returns 2 in gui mode but 8 in character mode of emacsen more recent t= han emacs 22.=C2=A0 (I tried it in several
> emacs versions including the most recent 27.0.50 snapshot.)

I get 8 in GUI frames as well.

The display spec (space :width 7) means 7 times the width of the
default face's font.=C2=A0 So if your default GUI font is monospaced, y= ou
should get 8 in both GUI and text-mode frames.

So I'm unsure how come you get 2 in GUI mode.=C2=A0 Maybe you've om= itted
some important detail in the reproducer.
=

I apologize; you are correct,= it gets 8 in gui mode as well. I must have been confused about which windo= w was running which version of emacs while I was experimenting.

But is that the correct value? The = bubbles game code clearly wants it to mean 'the number of forward-chars= I have to do from the beginning of the line to get here' not 'what= column does it visually look like I'm on'.
=
The doc string for the function doesn't cla= rify the intended meaning.

If you do m-x bubbles immediately followed by m-: (current-column) it re= turns 1 in the gui case but a number larger than one (which depends upon th= e :width keyword of the wide-displaying space), but for the game to work in= the character case it needs to return 1.

=

Thanks.

--000000000000824a31057605a3a5--