bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32744: There seems to be a bug in current-column in character mode


From: Kalman Reti
Subject: bug#32744: There seems to be a bug in current-column in character mode
Date: Sun, 16 Sep 2018 19:44:33 -0400

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]