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

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

(current-column) produces unexpected results with tabs when overlays hav


From: Michael Schierl
Subject: (current-column) produces unexpected results with tabs when overlays have before-strings
Date: Sat, 25 Oct 2003 22:26:00 +0200

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing
list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (i386-msvc-windows98.3000)
 of 2003-03-28 on buffy
configured using `configure --with-msvc (12.00)'
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: deu
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Execute this example code:

(let ((buf (get-buffer-create "*new*"))
      ovl
      (str "*"))
  (set-buffer buf)
  (setq tab-width 8)
  (erase-buffer)
  (insert "1234567\t89012\n1234567        89012")
  (put-text-property 0 1 'face 'bold str)
  (setq ovl (make-overlay 0 0))
  (overlay-put ovl 'before-string str)
  (setq ovl (make-overlay 15 15))
  (overlay-put ovl 'before-string str)
  (switch-to-buffer buf))

You will see 2 lines that look the same. Each one has an 1 character
wide overlay at the beginning. So from the documentation of
current-column one expects that when point is on (before) 8, the
column number should be the same in both lines (first line has a tab,
but that one should be counted as 8 spaces as it is 8 chars wide).

However, the tab is counted as only one space (column-number will
return 8 in first line, 15 in last line). When there are no
overlays with before-string before the tab, it works as expected.

This also affects cursor movement when the cursor is right of the
tab. Set cursor before upper 8 and move up -> cursor moves left a
bit.

Recent input:
M-x r e p o r t - e m a c s - b u g <return>

Recent messages:
Loading c:/eigenes/michael/homedir/.emacs21...done
For information about the GNU Project and its goals, type C-h C-p.
Loading cl-seq...done
Loading emacsbug...done




reply via email to

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