all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Elastic tabstops?
@ 2009-02-26 11:21 egarrulo
  2009-02-26 11:57 ` Tassilo Horn
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: egarrulo @ 2009-02-26 11:21 UTC (permalink / raw
  To: help-gnu-emacs

Hello,

is there an Emacs mode which implements elastic tabstops (tabstops
that expand or shrink to fit their contents)? I've searched the
Internet and it seems there isn't.

Explanation of elastic tabstops with a Java applet demo:

http://nickgravgaard.com/elastictabstops/


Thanks


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

* Re: Elastic tabstops?
  2009-02-26 11:21 Elastic tabstops? egarrulo
@ 2009-02-26 11:57 ` Tassilo Horn
  2009-02-26 15:41 ` Alan Mackenzie
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Tassilo Horn @ 2009-02-26 11:57 UTC (permalink / raw
  To: help-gnu-emacs

egarrulo@gmail.com writes:

Hi!

> is there an Emacs mode which implements elastic tabstops (tabstops
> that expand or shrink to fit their contents)?

Isn't that basically the same which `indent-relative' does?

,----[ C-h f indent-relative RET ]
| indent-relative is an interactive compiled Lisp function in `indent.el'.
| 
| (indent-relative &optional unindented-ok)
| 
| Space out to under next indent point in previous nonblank line.
| An indent point is a non-whitespace character following whitespace.
| The following line shows the indentation points in this line.
|     ^         ^    ^     ^   ^           ^      ^  ^    ^
| If the previous nonblank line has no indent points beyond the
| column point starts at, `tab-to-tab-stop' is done instead, unless
| this command is invoked with a numeric argument, in which case it
| does nothing.
| 
| See also `indent-relative-maybe'.
`----

Bye,
Tassilo





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

* Re: Elastic tabstops?
  2009-02-26 11:21 Elastic tabstops? egarrulo
  2009-02-26 11:57 ` Tassilo Horn
@ 2009-02-26 15:41 ` Alan Mackenzie
       [not found] ` <mailman.1860.1235661582.31690.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Alan Mackenzie @ 2009-02-26 15:41 UTC (permalink / raw
  To: egarrulo; +Cc: help-gnu-emacs

Hi,

On Thu, Feb 26, 2009 at 03:21:55AM -0800, egarrulo@gmail.com wrote:
> Hello,

> is there an Emacs mode which implements elastic tabstops (tabstops
> that expand or shrink to fit their contents)? I've searched the
> Internet and it seems there isn't.

> Explanation of elastic tabstops with a Java applet demo:

> http://nickgravgaard.com/elastictabstops/

I can't fully understand what you're saying in that webpage:

    we should say that a tab character is a delimiter between table
    cells in a manner more reminiscent of how they're used in tab
    separated value (TSV) files.

is rather abstract.  It says how we can think of a tab rather than its
effect on displaying the text on the screen.  What is meant, exactly, by
a "table cell"?  Is it a block of text 1cm wide, or something like that?

The picture on the webpage looks as though it's using tabs to do the
syntactical indentation from column 0, but spaces otherwise (e.g. for
the space between a statement and a line comment).  This isn't difficult
to achieve for CC Mode's languages (e.g. C), being a ~25 line hack.  If
that's what you want, say so, and I'll hunt out the hack.

> Thanks

-- 
Alan Mackenzie (Nuremberg, Germany).




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

* Re: Elastic tabstops?
       [not found] ` <mailman.1860.1235661582.31690.help-gnu-emacs@gnu.org>
@ 2009-02-26 19:13   ` egarrulo
  2009-02-26 20:04     ` egarrulo
  0 siblings, 1 reply; 7+ messages in thread
From: egarrulo @ 2009-02-26 19:13 UTC (permalink / raw
  To: help-gnu-emacs

Thank you very much for your offer, Alan :-)

Basically, he's saying that tab's width should not be based on
counting character, which is a low level concept. Instead, hitting Tab
should create a table cell of a kind, which spans multiple lines. Then
the editor will always keep aligned any text on adjacent lines which
is entered after the nth tab, no matter how long the "cell"'s text
length is and even if the font is not monospaced. Think about what
align-regexp does, but done live and working with proportional fonts
as well. Indeed, the demo Java applet uses a proportional font, and if
you move any end of line comment belonging to a block of lines, all
other comments move to keep perfectly aligned.

I think that is quite tricky to implement, more so if you try to
retrofit an already existing mode. BTW I'm not asking for such an high-
tech solution. I'd be quite happy if indentation would work as I'm
entering lines when I'm using a proportional font, which I find easier
to read.


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

* Re: Elastic tabstops?
       [not found] ` <mailman.1851.1235649463.31690.help-gnu-emacs@gnu.org>
@ 2009-02-26 19:28   ` egarrulo
  0 siblings, 0 replies; 7+ messages in thread
From: egarrulo @ 2009-02-26 19:28 UTC (permalink / raw
  To: help-gnu-emacs

Basically yes, but elastic tabstops are more advanced since they
affect previous lines too and are independent from character width
(they work with proportional fonts, too). The example provided by the
indent-relative documentation looks OK only with a monospaced font.


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

* Re: Elastic tabstops?
  2009-02-26 19:13   ` egarrulo
@ 2009-02-26 20:04     ` egarrulo
  0 siblings, 0 replies; 7+ messages in thread
From: egarrulo @ 2009-02-26 20:04 UTC (permalink / raw
  To: help-gnu-emacs

This video shows that Org Mode offers a similar capability to create
tables, albeit using a monospaced font:

http://www.youtube.com/watch?v=EQAd41VAXWo


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

* Re: Elastic tabstops?
  2009-02-26 11:21 Elastic tabstops? egarrulo
                   ` (3 preceding siblings ...)
       [not found] ` <mailman.1851.1235649463.31690.help-gnu-emacs@gnu.org>
@ 2009-03-06 16:55 ` Elena
  4 siblings, 0 replies; 7+ messages in thread
From: Elena @ 2009-03-06 16:55 UTC (permalink / raw
  To: help-gnu-emacs

I found out that Emacs can't do it, because it's tied to character
width. Aligning text which uses a proportional font is out of reach
for our beloved editor :-(




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

end of thread, other threads:[~2009-03-06 16:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-26 11:21 Elastic tabstops? egarrulo
2009-02-26 11:57 ` Tassilo Horn
2009-02-26 15:41 ` Alan Mackenzie
     [not found] ` <mailman.1860.1235661582.31690.help-gnu-emacs@gnu.org>
2009-02-26 19:13   ` egarrulo
2009-02-26 20:04     ` egarrulo
     [not found] ` <mailman.1851.1235649463.31690.help-gnu-emacs@gnu.org>
2009-02-26 19:28   ` egarrulo
2009-03-06 16:55 ` Elena

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.