all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Schierl <schierlm@gmx.de>
Subject: (current-column) produces unexpected results with tabs when overlays have before-strings
Date: Sat, 25 Oct 2003 22:26:00 +0200	[thread overview]
Message-ID: <3F9ADC58.1D41DD41@gmx.de> (raw)

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	other threads:[~2003-10-25 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-25 20:26 Michael Schierl [this message]
2003-10-27 23:44 ` (current-column) produces unexpected results with tabs when overlays have before-strings Richard Stallman

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

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

  git send-email \
    --in-reply-to=3F9ADC58.1D41DD41@gmx.de \
    --to=schierlm@gmx.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.