unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kalman Reti <kalman.reti@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32744@debbugs.gnu.org
Subject: bug#32744: There seems to be a bug in current-column in character mode
Date: Sun, 16 Sep 2018 19:44:33 -0400	[thread overview]
Message-ID: <CAJ7Ts_2dt+-A+RM39OVDLN-=6f0mFD5U8jC5M1_a1eU7J06H0A@mail.gmail.com> (raw)
In-Reply-To: <CAJ7Ts_22HqjfaPO7AGXRw3FS3hiH8SX4BF6DYE+YX5y8Znketg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]

On Sep 16, 2018 1:12 PM, "Eli Zaretskii" <eliz@gnu.org> wrote:

> From: Kalman Reti <kalman.reti@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 (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.

[-- Attachment #2: Type: text/html, Size: 2544 bytes --]

  parent reply	other threads:[~2018-09-16 23:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-16 13:28 bug#32744: There seems to be a bug in current-column in character mode Kalman Reti
2018-09-16 17:11 ` Eli Zaretskii
     [not found]   ` <CAJ7Ts_161=cFRcG7oZAfjLsByzk=L8=iD+WQr-LF4z2-kWhn4w@mail.gmail.com>
     [not found]     ` <CAJ7Ts_22HqjfaPO7AGXRw3FS3hiH8SX4BF6DYE+YX5y8Znketg@mail.gmail.com>
2018-09-16 23:44       ` Kalman Reti [this message]
2018-09-17 14:43         ` Eli Zaretskii
2018-09-17 14:54           ` Kalman Reti
2018-09-17 15:22             ` Eli Zaretskii
2018-09-17 15:34               ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ7Ts_2dt+-A+RM39OVDLN-=6f0mFD5U8jC5M1_a1eU7J06H0A@mail.gmail.com' \
    --to=kalman.reti@gmail.com \
    --cc=32744@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).