Subject: bug#2329: 23.0.90; C-p misbehaves near end of visual line when display tables are used

From: Eli Zaretskii <[email-masked]>
Date: Sat, 14 Feb 2009 05:43:33 -0500

To reproduce:

 emacs -Q -nw
 M-x load-library RET latin1-disp RET
 M-: (latin1-display-setup 'cyrillic) RET
 C-h H

Now go to the line that begins with "Unicode charset:", and type C-f
until the cursor is on the last brace `{' before the line continuation
glyph `\'.  If your text-mode terminal is 80-column wide, that would
be the beginning of the glyph string used to display the 4th character
from the end of that line.

Now type C-p: the cursor does not move to the previous line, as
expected.

latin1-disp sets up a desiplay table to display some non-ASCII
characters as strings of ASCII characters.  I'm guessing that the new
visual-line movement feature misbehaves when the last character on a
visual line uses display tables to be displayed.

In GNU Emacs 23.0.90.7 (x86_64-unknown-linux-gnu, X toolkit)
 of 2009-02-14 on fencepost
configured using `configure  '--with-jpeg=no' '--with-png=no' '--with-gif=no' '--with-tiff=no''

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: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  view-mode: t

Recent input:
ESC [ > 0 ; 1 3 6 ; 0 c C-x C-f ~ / . e m a TAB RET 
ESC O B ESC O B ESC O B ESC O B ESC O B ESC O B ESC 
O B ESC O B ESC O B ESC O B C-x b RET ESC x l o a d 
- l i b TAB RET ESC O D ESC O C C-g ESC x ESC O A RET 
l a t i n 1 - d TAB RET ESC O D ESC O C C-g ESC x ESC 
O A RET ESC O A RET ( l a t i n 1 - d i s p l a y - 
s e t u p SPC ' c y r i l l i c ) C-j C-h H C-u C-n 
C-u C-n C-u C-n C-n C-n ESC O C ESC O C C-u C-u C-f 
C-u C-u C-f C-u C-u C-f C-u C-u C-f ESC O D ESC O D 
ESC O D ESC O D ESC O C ESC O A ESC O A ESC O A ESC 
O A ESC O A ESC O A ESC O D ESC O A ESC O B ESC O C 
ESC O C ESC O A ESC O B ESC O A ESC O B ESC O D ESC 
O A ESC O A ESC O A ESC O A ESC x r e p o r t - e m 
a c TAB RET

Recent messages:
("./src/emacs" "-Q")
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-cvs...done
Quit
Loading latin1-disp...done
Quit
Loading latin1-disp...done
View mode: type C-h for help, h for commands, q to quit.