GNU bug report logs - #9530
24.0.50; incorrect cursor moving

Previous Next

Package: emacs;

Reported by: Kenichi Handa <handa <at> m17n.org>

Date: Sat, 17 Sep 2011 12:48:01 UTC

Severity: normal

Found in version 24.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9530 in the body.
You can then email your comments to 9530 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#9530; Package emacs. (Sat, 17 Sep 2011 12:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kenichi Handa <handa <at> m17n.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 17 Sep 2011 12:48:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kenichi Handa <handa <at> m17n.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; incorrect cursor moving
Date: Sat, 17 Sep 2011 21:41:31 +0900
With the trunk Emacs, cursor jumps around in the following
testcase.

% emacs -Q
;; Now we are in *scratch* buffer which contains ";; This
bufffer is..." comment at the head.
ESC : (insert (propertize "\t" 'display '(space :align-to 77)) "a "(propertize "\t" 'display '(space :align-to 79)) "b") RET
;; Now the last line fo *scratch* buffer is showing "a" at
;; column 77, and showingg "b" at column 0 of the continuing line.
C-a C-f C-f
;; The cursor is at the right of character "a".  This is normal.
C-f
;; The cursor jumps to the end of the first line;
;; i.e. the right of "for List evaluation."
C-f
;; The cursor moves back to the character "b" of the
;; original line; i.e. the line inserted by the above "ESC : ... RET".

---
handa <at> m17n.org


In GNU Emacs 24.0.50.3 (i686-pc-linux-gnu, X toolkit)
 of 2011-09-15 on ubuntu
Windowing system distributor `The X.Org Foundation', version 11.0.10706000
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ja_JP.utf8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Shell

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
d SPC d C-p u n d d d C-e M-b M-b M-b M-b M-b M-b M-b 
M-b M-b M-b M-b M-b M-b M-b M-b M-b M-b M-f M-b C-s 
C-w C-w C-r C-r C-a C-a a <return> C-l SPC n d d SPC 
d a <return> n d d SPC d d d d d d d d d d d d d d 
d d d SPC a <return> n d d d d d d d d d d d d d d 
d d d d d d n d p a m u s t r e <tab> a <tab> <return> 
n p n d d d d d d n d d d d d d d d d d d d d d d d 
d d d d d d SPC d d d d d d d d d d d d d d d d d d 
d d d C-x o C-h c C-h H SPC C-x o n d d d d d d SPC 
d d d d d d d d SPC d d d d d d d d d d d d d d d d 
d d d d d d d d d SPC C-x o C-n C-n C-n C-n C-n C-n 
C-e M-b M-b M-b M-b M-b M-b <return> C-x 1 C-l j C-g 
x C-x C-a C-g h <escape> > C-r m u s t r e C-a C-n 
C-n n n n C-n d d d d d d d d d d d d d d d d d s y 
SPC p C-x o C-x k <return> C-x b R M <tab> C-g C-x 
m C-x k <return> M-x r e p o r t <tab> <return>

Recent messages:
Quit [2 times]
Computing summary lines...done
Mark set
Mark saved where search started
Erase deleted messages from Rmail file? (y or n)  y
Expunging deleted messages...done
Computing summary lines...done
Saving file /home/handa/RMAIL...
Wrote /home/handa/RMAIL [2 times]
Computing summary lines...done
Quit

Load-path shadows:
None found.

Features:
(shadow emacsbug cc-mode cc-fonts cc-guess cc-menus cc-cmds
cc-styles cc-align cc-engine cc-vars cc-defs compile
goto-addr thingatpt noutline outline easy-mmode mule-diag
iso-transl rmailout debug qp rmailkwd rmailmm help-fns
vc-bzr edmacro kmacro pp wid-edit descr-text ind-util
tar-mode dabbrev pcmpl-gnu image-mode multi-isearch
pcmpl-unix ansi-color shell pcomplete comint ring newcomment
ja-dic mule-util kkc ja-dic-utl quail sgml-mode
network-stream starttls tls mailalias smtpmail auth-source
eieio byte-opt bytecomp byte-compile cconv macroexp assoc
password-cache jka-compr mail-extr sort mailcap help-mode
view gnus-util message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader time sendmail regexp-opt
rmail-spam-filter easymenu rmailsum rmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils time-date
japan-util tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image fringe
lisp-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew
greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer loaddefs button faces cus-face
files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable
backquote make-network-process dynamic-setting
font-render-setting x-toolkit x multi-tty emacs)




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 17 Sep 2011 18:38:03 GMT) Full text and rfc822 format available.

Notification sent to Kenichi Handa <handa <at> m17n.org>:
bug acknowledged by developer. (Sat, 17 Sep 2011 18:38:03 GMT) Full text and rfc822 format available.

Message #10 received at 9530-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kenichi Handa <handa <at> m17n.org>
Cc: 9530-done <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Sat, 17 Sep 2011 21:31:43 +0300
> From: Kenichi Handa <handa <at> m17n.org>
> Date: Sat, 17 Sep 2011 21:41:31 +0900
> 
> % emacs -Q
> ;; Now we are in *scratch* buffer which contains ";; This
> bufffer is..." comment at the head.
> ESC : (insert (propertize "\t" 'display '(space :align-to 77)) "a "(propertize "\t" 'display '(space :align-to 79)) "b") RET
> ;; Now the last line fo *scratch* buffer is showing "a" at
> ;; column 77, and showingg "b" at column 0 of the continuing line.
> C-a C-f C-f
> ;; The cursor is at the right of character "a".  This is normal.
> C-f
> ;; The cursor jumps to the end of the first line;
> ;; i.e. the right of "for List evaluation."
> C-f
> ;; The cursor moves back to the character "b" of the
> ;; original line; i.e. the line inserted by the above "ESC : ... RET".

Fixed in revision 105808 on the trunk.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9530; Package emacs. (Sun, 18 Sep 2011 03:06:04 GMT) Full text and rfc822 format available.

Message #13 received at 9530 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kenichi Handa <handa <at> m17n.org>
Cc: 9530 <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Sun, 18 Sep 2011 05:59:47 +0300
> Date: Sat, 17 Sep 2011 21:31:43 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 9530-done <at> debbugs.gnu.org
> 
> Fixed in revision 105808 on the trunk.

I see there's still a problem on a TTY, so I will be committing a
separate fix for that.




Message #14 received at 9530-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: handa <at> m17n.org
Cc: 9530-done <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Sun, 18 Sep 2011 18:51:56 +0300
> Date: Sun, 18 Sep 2011 05:59:47 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 9530 <at> debbugs.gnu.org
> 
> > Date: Sat, 17 Sep 2011 21:31:43 +0300
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > Cc: 9530-done <at> debbugs.gnu.org
> > 
> > Fixed in revision 105808 on the trunk.
> 
> I see there's still a problem on a TTY, so I will be committing a
> separate fix for that.

Done (revno 105822 on the trunk).




Message #15 received at 9530-done <at> debbugs.gnu.org (full text, mbox):

From: Kenichi Handa <handa <at> m17n.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9530-done <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Mon, 19 Sep 2011 22:07:58 +0900
In article <83litlu9ur.fsf <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org> writes:

> > Date: Sun, 18 Sep 2011 05:59:47 +0300
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > Cc: 9530 <at> debbugs.gnu.org
> > 
> > > Date: Sat, 17 Sep 2011 21:31:43 +0300
> > > From: Eli Zaretskii <eliz <at> gnu.org>
> > > Cc: 9530-done <at> debbugs.gnu.org
> > > 
> > > Fixed in revision 105808 on the trunk.
> > 
> > I see there's still a problem on a TTY, so I will be committing a
> > separate fix for that.

> Done (revno 105822 on the trunk).

Thank you.  With the latest code, the reported testcase:

> % emacs -Q
> ESC : (insert (propertize "\t" 'display '(space :align-to 77)) "a "(propertize "\t" 'display '(space :align-to 79)) "b") RET
> ;; Now the last line fo *scratch* buffer is showing "a" at
> ;; column 77, and showingg "b" at column 0 of the continuing line.

is not reproduced.  Now "b" is shown at the column 79 of the
same (physical) line as "a".  It seems to be a correct
display.  And the cursor movement has no problem now.

But, to confirrm the cursor movement with continuing line, I
tried this instead;

ESC : (insert (propertize "\t" 'display '(space :align-to 78)) "a "(propertize "\t" 'display '(space :align-to 80)) "b") RET

Then the display becomes like this ('+' indicating
continuing arrow at left and right fringe), which shows
a superfluous line between "a" and "b":

   |                          |
   |                        a +
   +                          +
   +b                         |
   |                          |

In addtion:

ESC : (insert (propertize "\t" 'display '(space :align-to 78)) "a "(propertize "\t" 'display '(space :align-to 80)) "b") RET
C-b C-b C-p C-p C-p C-p ....

doesn't move cursor.

---
handa <at> m17n.org




Message #16 received at 9530-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kenichi Handa <handa <at> m17n.org>
Cc: 9530-done <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Mon, 19 Sep 2011 19:17:36 +0300
> From: Kenichi Handa <handa <at> m17n.org>
> Cc: 9530-done <at> debbugs.gnu.org
> Date: Mon, 19 Sep 2011 22:07:58 +0900
> 
> But, to confirrm the cursor movement with continuing line, I
> tried this instead;
> 
> ESC : (insert (propertize "\t" 'display '(space :align-to 78)) "a "(propertize "\t" 'display '(space :align-to 80)) "b") RET
> 
> Then the display becomes like this ('+' indicating
> continuing arrow at left and right fringe), which shows
> a superfluous line between "a" and "b":
> 
>    |                          |
>    |                        a +
>    +                          +
>    +b                         |
>    |                          |
> 
> In addtion:
> 
> ESC : (insert (propertize "\t" 'display '(space :align-to 78)) "a "(propertize "\t" 'display '(space :align-to 80)) "b") RET
> C-b C-b C-p C-p C-p C-p ....
> 
> doesn't move cursor.

Right, and Emacs 23 behaves identically with this use case.

I saw that while working on the bug, but decided not to try to fix
this for the time being, for two reasons.

First, because it's not a regression wrt Emacs 23.

And second, it is not at all clear what should be displayed for this
use case, because what you ask Emacs to do cannot be done.  You cannot
possibly align to column 80 on an 80-column display, because such a
column does not exist; the last column is 79.  So Emacs tries to do
something reasonable, because throwing an error in the middle of
redisplay is not a good idea.  But all bets are off wrt the result.

IOW, "if it hurts, don't do that".




Message #17 received at 9530-done <at> debbugs.gnu.org (full text, mbox):

From: Kenichi Handa <handa <at> m17n.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9530-done <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Tue, 20 Sep 2011 11:00:50 +0900
In article <83d3ewtskf.fsf <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org> writes:

> And second, it is not at all clear what should be displayed for this
> use case, because what you ask Emacs to do cannot be done.  You cannot
> possibly align to column 80 on an 80-column display, because such a
> column does not exist; the last column is 79.  So Emacs tries to do
> something reasonable, because throwing an error in the middle of
> redisplay is not a good idea.  But all bets are off wrt the result.

Ah, I've thought that the argument of :align-to is a logical
column, not a physical column.  So, for instance, (space
:align-to 90) on 80-column display is to display the next
character where (eq (current-column) 90) ; i.e. the 10th
column in the continuing line.  But, if it's a physical
column, I agree it is not clear what Emacs should do.
Though, I don't think the current way is reasonable.

Anyway, I agree with not fixing that bug at the moment.

---
Kenichi Handa
handa <at> m17n.org




Message #18 received at 9530-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Kenichi Handa <handa <at> m17n.org>
Cc: 9530-done <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Tue, 20 Sep 2011 05:55:45 +0300
> From: Kenichi Handa <handa <at> m17n.org>
> Cc: 9530-done <at> debbugs.gnu.org
> Date: Tue, 20 Sep 2011 11:00:50 +0900
> 
> Though, I don't think the current way is reasonable.

What would be reasonable, in your opinion?




Message #19 received at 9530-done <at> debbugs.gnu.org (full text, mbox):

From: Kenichi Handa <handa <at> m17n.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9530-done <at> debbugs.gnu.org
Subject: Re: bug#9530: 24.0.50; incorrect cursor moving
Date: Tue, 20 Sep 2011 14:42:10 +0900
In article <8362knudla.fsf <at> gnu.org>, Eli Zaretskii <eliz <at> gnu.org> writes:

> > From: Kenichi Handa <handa <at> m17n.org>
> > Cc: 9530-done <at> debbugs.gnu.org
> > Date: Tue, 20 Sep 2011 11:00:50 +0900
> > 
> > Though, I don't think the current way is reasonable.

> What would be reasonable, in your opinion?

Don't display the intermediate empty line.  For instance,

ESC : (insert "abc"(propertize "\t" 'display '(space :align-to 2)) "d") RET

shows the TAB before "d" by zero-width; not showing "d" in
the column 2 of a continuing line.

---
Kenichi Handa
handa <at> m17n.org




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 Oct 2011 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.