all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* compute-motion inconsistency
@ 2004-07-23  8:54 Kim F. Storm
  2004-07-23  9:46 ` David Kastrup
  0 siblings, 1 reply; 11+ messages in thread
From: Kim F. Storm @ 2004-07-23  8:54 UTC (permalink / raw)



The interface to compute-motion is inconsistent, and the
implementation is inconsistent too.

Problem is the "width" arg, quoting from the doc string:

| width is the number of columns available to display text;
| this affects handling of continuation lines.
| This is usually the value returned by `window-width', less one (to allow
| for the continuation glyph).

But on window based display, there is no continuation glyph, so
typically the value provided for the width arg is one too small.
I checked the caller of compute-motion (and compute_motion
at the C level), and the calls are not consistent either.

Some calls subtract 1 unconditionally,
some subtract 1 on non-window systems,
and some do not subtract 1 at all.

IIRC, the ones which does this correctly (the second category) I have
fixed myself while working on redisplay over the past years.

I will take care of fixing the remaining cases at the C level.

It is more tricky to fix it at the lisp level (I will do it for the
packages delivered with emacs, but we cannot fix it for external
packages).

For backwards compatibility, I suggest the following change
to compute-motion:

If "width" equals (1- (window-width)) on a window system,
automatically use (window-width) instead.

If "width" equals (window-width) on a non-window system,
automatically subtract 1 (for the continuation glyph).

Then we should change the doc string to read:

| width is the number of columns available to display text;
| this affects handling of continuation lines.
| This is usually the value returned by `window-width',
| or that value minus 1 (for backwards compatibility).


WDYT?

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-08-03  9:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-23  8:54 compute-motion inconsistency Kim F. Storm
2004-07-23  9:46 ` David Kastrup
2004-07-23 12:56   ` Kim F. Storm
2004-07-23 18:44     ` Stefan Monnier
2004-07-23 19:04       ` David Kastrup
2004-07-24 19:44       ` Richard Stallman
2004-07-25 22:24         ` Kim F. Storm
2004-08-02 15:28           ` Kim F. Storm
2004-08-02 21:17             ` Andreas Schwab
2004-08-02 23:45               ` Kim F. Storm
2004-08-03  9:48                 ` Andreas Schwab

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.