unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4334: 23.1.50; truncate-partial-width-windows documentation problem
@ 2009-09-03 16:27 Xah Lee
  2009-09-04  6:36 ` Eli Zaretskii
  2009-09-04 17:42 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Xah Lee @ 2009-09-03 16:27 UTC (permalink / raw)
  To: emacs-pretest-bug

There's this variable truncate-partial-width-windows in emacs 23.1.

I think it's documentation is not very clear. I read the doc carefully, 
together with associated var such as word-wrap and truncate-lines. However, 
i cannot find out what exactly this variable do or its effects, after 
spending about 30 min setting various combination of values to these 
variables and or adjusting my frame width.

following is particular detail on why i didn't find it clear.
--------------------------------
The doc reads this:

> Non-nil means truncate lines in windows with less than the frame width.

this seems to be that this var only has effect when its val is less than 
frame width. So i set it to 30.

> For an integer value, truncate lines in each window with less than the
> full frame width, provided the window width is less than that integer;
> otherwise, respect the value of `truncate-lines'.

I don't see any effect. It is not clear to me what this clause means: 
“truncate lines in each window with less than the full frame width”.  It's 
not clear pratically, and it's ambiguous. Does the “with less than” being a 
codition where this takes effect, or does it mean it is the effect of this 
var? Also, the emacs tradition of using “truncate lines” can probably be 
improved. Usually, i understand it to mean “let long lines run off the right 
frame width”. It does not actually _truncate_ lines. In most of today's 
editors, similar feature is usually called “no word wrap” or “no line wrap”. 
This seems much more clear to me. So, in conjunction with this report on doc 
issue of truncate-partial-width-windows, perhaps emacs doc would consider 
change the wording of “truncate” in related documentation about line 
wrapping.

In any case, i cannot understand what this paragraph means.

> For any other non-nil value, truncate lines in all windows with
> less than the full frame width.

> A value of nil means to respect the value of `truncate-lines'.

> If `word-wrap' is enabled, you might want to reduce this.

In short, i tried to set this to 30 or 150. 30 is less than my frame width, 
and 150 is more. And tried to turn on off or set to other value the other 
mentioned vars, but i can't see the effect.

Thanks.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#4334: 23.1.50; truncate-partial-width-windows documentation problem
  2009-09-03 16:27 bug#4334: 23.1.50; truncate-partial-width-windows documentation problem Xah Lee
@ 2009-09-04  6:36 ` Eli Zaretskii
  2009-09-04 17:42 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2009-09-04  6:36 UTC (permalink / raw)
  To: Xah Lee, 4334

> From: "Xah Lee" <xah@xahlee.org>
> Date: Thu, 3 Sep 2009 09:27:44 -0700
> Cc: 
> 
> The doc reads this:
> 
> > Non-nil means truncate lines in windows with less than the frame width.
> 
> this seems to be that this var only has effect when its val is less than 
> frame width. So i set it to 30.

No, this means the variable only affects windows whose width is less
than the full frame width.  For example, windows you get after "C-x 3".

> > For an integer value, truncate lines in each window with less than the
> > full frame width, provided the window width is less than that integer;
> > otherwise, respect the value of `truncate-lines'.
> 
> I don't see any effect.

I do see the expected effect.

Try this:

  emacs -Q
  C-x 3

You should now see the initial blurb of the *scratch* buffer in both
of the 2 windows, and in both of them each line that is longer than
the window width will be truncated, i.e. its extra characters not
shown and a small right arrow appears in the right fringe indicating
that there are more characters in the line than displayed.

Now type this:

  M-x set-variable RET truncate-partial-width-windows RET 30 RET

You should now see that each long line is continued on the next visual
line, and the fringe shows that by displaying a curved arrow.

Now drag the vertical separator between the two windows to the right,
or use "C-x }" in the left window to make it wider.  At some point,
when the right window's width becomes less than the value of the
variable (30), the right window will again truncate its lines, whereas
the left one will still show continuation lines.

If all this works for you, then please suggest how to improve the doc
string.





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

* bug#4334: 23.1.50; truncate-partial-width-windows documentation problem
  2009-09-03 16:27 bug#4334: 23.1.50; truncate-partial-width-windows documentation problem Xah Lee
  2009-09-04  6:36 ` Eli Zaretskii
@ 2009-09-04 17:42 ` Stefan Monnier
  2009-09-05 14:02   ` Xah Lee
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2009-09-04 17:42 UTC (permalink / raw)
  To: Xah Lee; +Cc: 4334

> There's this variable truncate-partial-width-windows in emacs 23.1.

I agree it's not perfect.
Does the patch below make it more clear for you?


        Stefan


=== modified file 'src/xdisp.c'
--- src/xdisp.c	2009-08-30 01:04:59 +0000
+++ src/xdisp.c	2009-09-04 17:42:00 +0000
@@ -24838,13 +24838,13 @@
 
   DEFVAR_LISP ("truncate-partial-width-windows",
 	       &Vtruncate_partial_width_windows,
-    doc: /* Non-nil means truncate lines in windows with less than the frame width.
-For an integer value, truncate lines in each window with less than the
+    doc: /* Non-nil means truncate lines in windows narrower than the frame.
+For an integer value, truncate lines in each window narrower than the
 full frame width, provided the window width is less than that integer;
 otherwise, respect the value of `truncate-lines'.
 
-For any other non-nil value, truncate lines in all windows with
-less than the full frame width.
+For any other non-nil value, truncate lines in all windows that do
+not span the full frame width.
 
 A value of nil means to respect the value of `truncate-lines'.
 






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

* bug#4334: 23.1.50; truncate-partial-width-windows documentation problem
  2009-09-04 17:42 ` Stefan Monnier
@ 2009-09-05 14:02   ` Xah Lee
  0 siblings, 0 replies; 4+ messages in thread
From: Xah Lee @ 2009-09-05 14:02 UTC (permalink / raw)
  To: Stefan Monnier, Eli Zaretskii; +Cc: 4334

Thanks Eli & Stefan on explaining this.

How about something like the following?

-----------------------
Documentation:
A value n sets the display to show only the first n characters per line.

This variable applies only when you have vertically split windows, and
when window width is less or equal to n.

You can customize this variable.

This variable was introduced, or its default value was changed, in
version 23.1 of Emacs.
-----------------------

Note that i removed the line “If `word-wrap' is enabled, you might
want to reduce this.”.  I don't see that line appropriate, nor as
sensible suggestion. My gut feelings i'd rather want slightly larger
value of n if word-wrap is enabled.

it's not clear to me what happens when the value is something other than 
positive integer and is not nil. The original doc seems to suggest that has 
particular behavior...

Thanks.

  Xah
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-05 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03 16:27 bug#4334: 23.1.50; truncate-partial-width-windows documentation problem Xah Lee
2009-09-04  6:36 ` Eli Zaretskii
2009-09-04 17:42 ` Stefan Monnier
2009-09-05 14:02   ` Xah Lee

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).