unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Enabling truncate-lines on a per-line basis
@ 2009-12-03  3:03 Matthew Dempsky
  2009-12-03 23:22 ` Matthew Dempsky
  2009-12-04  6:11 ` tomas
  0 siblings, 2 replies; 9+ messages in thread
From: Matthew Dempsky @ 2009-12-03  3:03 UTC (permalink / raw)
  To: help-gnu-emacs

I've been hacking up org-indent.el into a new minor-mode that smartly
wraps lists and outline headers (by appropriately setting
`wrap-prefix') so it can play nicely with visual-line-mode.  However,
I'd still like large tables to be truncated rather than wrapped.

Is there currently a way to selectively enable truncation on certain
lines, but leave it disabled on others?




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

* Re: Enabling truncate-lines on a per-line basis
  2009-12-03  3:03 Enabling truncate-lines on a per-line basis Matthew Dempsky
@ 2009-12-03 23:22 ` Matthew Dempsky
  2009-12-04  4:23   ` Kevin Rodgers
  2009-12-04  6:11 ` tomas
  1 sibling, 1 reply; 9+ messages in thread
From: Matthew Dempsky @ 2009-12-03 23:22 UTC (permalink / raw)
  To: help-gnu-emacs

On Wed, Dec 2, 2009 at 7:03 PM, Matthew Dempsky <matthew@dempsky.org> wrote:
> Is there currently a way to selectively enable truncation on certain
> lines, but leave it disabled on others?

Looking at xdisp.c, it looks like there's no elisp solution to setting
line_wrap == TRUNCATION on a per-line basis, and even if there was, it
looks like more of the display algorithm would need reworking to
support it.

Oh well.




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

* Re: Enabling truncate-lines on a per-line basis
  2009-12-03 23:22 ` Matthew Dempsky
@ 2009-12-04  4:23   ` Kevin Rodgers
  2009-12-04  5:51     ` Matthew Dempsky
  0 siblings, 1 reply; 9+ messages in thread
From: Kevin Rodgers @ 2009-12-04  4:23 UTC (permalink / raw)
  To: help-gnu-emacs

Matthew Dempsky wrote:
> On Wed, Dec 2, 2009 at 7:03 PM, Matthew Dempsky <matthew@dempsky.org> wrote:
>> Is there currently a way to selectively enable truncation on certain
>> lines, but leave it disabled on others?
> 
> Looking at xdisp.c, it looks like there's no elisp solution to setting
> line_wrap == TRUNCATION on a per-line basis, and even if there was, it
> looks like more of the display algorithm would need reworking to
> support it.

Maybe you could set the display text property on each line (starting
just before the right margin), to emulate truncate-lines.

If that works, you might be able to set the property via font-lock.

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: Enabling truncate-lines on a per-line basis
  2009-12-04  4:23   ` Kevin Rodgers
@ 2009-12-04  5:51     ` Matthew Dempsky
  2009-12-04  9:55       ` Eli Zaretskii
                         ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Matthew Dempsky @ 2009-12-04  5:51 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, Dec 3, 2009 at 8:23 PM, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
> Maybe you could set the display text property on each line (starting
> just before the right margin), to emulate truncate-lines.

Nope, text from the 'display' property text still wraps. Also, you
can't navigate through it with the point. :(




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

* Re: Enabling truncate-lines on a per-line basis
  2009-12-03  3:03 Enabling truncate-lines on a per-line basis Matthew Dempsky
  2009-12-03 23:22 ` Matthew Dempsky
@ 2009-12-04  6:11 ` tomas
  1 sibling, 0 replies; 9+ messages in thread
From: tomas @ 2009-12-04  6:11 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Dec 02, 2009 at 07:03:29PM -0800, Matthew Dempsky wrote:
> I've been hacking up org-indent.el into a new minor-mode that smartly
> wraps lists and outline headers (by appropriately setting
> `wrap-prefix') so it can play nicely with visual-line-mode.  However,
> I'd still like large tables to be truncated rather than wrapped.
> 
> Is there currently a way to selectively enable truncation on certain
> lines, but leave it disabled on others?

There is a feature request "in-flight" for that:

  http://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%2Bmessage-id%3A<EC0D6A96-5F85-4083-BCF8-F005CEF950DF%40gmail.com>&submit=Search!&idxname=emacs-devel&max=20&result=normal&sort=score

(sorry for the long URL).

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFLGKgeBcgs9XrR2kYRAn+EAJ9u/nXf8rBkLojwjm3wXBbC2+TE4wCfQnw5
H49qYZAHtZrI0pbhFa9rM+w=
=yX0v
-----END PGP SIGNATURE-----




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

* Re: Enabling truncate-lines on a per-line basis
  2009-12-04  5:51     ` Matthew Dempsky
@ 2009-12-04  9:55       ` Eli Zaretskii
  2009-12-05  8:16       ` Kevin Rodgers
       [not found]       ` <mailman.12260.1260000999.2239.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2009-12-04  9:55 UTC (permalink / raw)
  To: Matthew Dempsky; +Cc: help-gnu-emacs

> Date: Thu, 3 Dec 2009 21:51:25 -0800
> From: Matthew Dempsky <matthew@dempsky.org>
> 
> you can't navigate through [`display' text property] with the point. :(

Yes, you can, although not easily (and perhaps it won't do exactly
what you want).  See the description of the `cursor' property in the
ELisp manual.




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

* Re: Enabling truncate-lines on a per-line basis
  2009-12-04  5:51     ` Matthew Dempsky
  2009-12-04  9:55       ` Eli Zaretskii
@ 2009-12-05  8:16       ` Kevin Rodgers
  2009-12-05  8:24         ` Matthew Dempsky
       [not found]       ` <mailman.12260.1260000999.2239.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 9+ messages in thread
From: Kevin Rodgers @ 2009-12-05  8:16 UTC (permalink / raw)
  To: help-gnu-emacs

Matthew Dempsky wrote:
> On Thu, Dec 3, 2009 at 8:23 PM, Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
>> Maybe you could set the display text property on each line (starting
>> just before the right margin), to emulate truncate-lines.
> 
> Nope, text from the 'display' property text still wraps. Also, you
> can't navigate through it with the point. :(

I meant, if you want the buffer text truncated at column N, set the display
property at column N - 1 through the rest of the line to a single character
(e.g. U+2026 HORIZONTAL ELLIPSIS or U+22EF MIDLINE HORIZONTAL ELLIPSIS) to
indicate truncation.

-- 
Kevin Rodgers
Denver, Colorado, USA





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

* Re: Enabling truncate-lines on a per-line basis
  2009-12-05  8:16       ` Kevin Rodgers
@ 2009-12-05  8:24         ` Matthew Dempsky
  0 siblings, 0 replies; 9+ messages in thread
From: Matthew Dempsky @ 2009-12-05  8:24 UTC (permalink / raw)
  To: help-gnu-emacs

On Sat, Dec 5, 2009 at 12:16 AM, Kevin Rodgers
<kevin.d.rodgers@gmail.com> wrote:
> I meant, if you want the buffer text truncated at column N, set the display
> property at column N - 1 through the rest of the line to a single character
> (e.g. U+2026 HORIZONTAL ELLIPSIS or U+22EF MIDLINE HORIZONTAL ELLIPSIS) to
> indicate truncation.

Ohh, I see...  interesting idea!  I'll have to try this. :)

Thanks!




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

* Re: Enabling truncate-lines on a per-line basis
       [not found]       ` <mailman.12260.1260000999.2239.help-gnu-emacs@gnu.org>
@ 2009-12-05 19:05         ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2009-12-05 19:05 UTC (permalink / raw)
  To: help-gnu-emacs

>>> Maybe you could set the display text property on each line (starting
>>> just before the right margin), to emulate truncate-lines.
>> Nope, text from the 'display' property text still wraps. Also, you
>> can't navigate through it with the point. :(
> I meant, if you want the buffer text truncated at column N, set the display
> property at column N - 1 through the rest of the line to a single character
> (e.g. U+2026 HORIZONTAL ELLIPSIS or U+22EF MIDLINE HORIZONTAL ELLIPSIS) to
> indicate truncation.

That can sadly be a lot more tricky that you'd like (even without
getting into proportional fonts, you have the problem of fixed-width
fonts but with varying facs giving varying font-sizes, or TABs, or \NNN
escape sequences, or images, or ...).


        Stefan


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

end of thread, other threads:[~2009-12-05 19:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03  3:03 Enabling truncate-lines on a per-line basis Matthew Dempsky
2009-12-03 23:22 ` Matthew Dempsky
2009-12-04  4:23   ` Kevin Rodgers
2009-12-04  5:51     ` Matthew Dempsky
2009-12-04  9:55       ` Eli Zaretskii
2009-12-05  8:16       ` Kevin Rodgers
2009-12-05  8:24         ` Matthew Dempsky
     [not found]       ` <mailman.12260.1260000999.2239.help-gnu-emacs@gnu.org>
2009-12-05 19:05         ` Stefan Monnier
2009-12-04  6:11 ` tomas

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).