emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Automatic formatting of the table as you type
@ 2020-03-27 16:27 ndame
  2020-03-27 18:55 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: ndame @ 2020-03-27 16:27 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]


The other day a code was posted on Reddit which automatically formats
the table as you type:

https://i.imgur.com/lorIDhY.gif


The code looks pretty simple, the actual formatting code is only a few lines
and it might even be possible to rewrite it to simplify it even more:

https://reddit.com/r/emacs/comments/fosdi2/orgtableautoalignmode_minor_mode_for_auto/


Org should provide this feature out of the box as an optional minor
mode like org-indent-mode. It provides a much nicer user experience
than the current behavior where the table falls apart when you type in
it until you press TAB or such.

[-- Attachment #2: Type: text/html, Size: 704 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Automatic formatting of the table as you type
@ 2020-03-29  7:09 ndame
  0 siblings, 0 replies; 6+ messages in thread
From: ndame @ 2020-03-29  7:09 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

> I suggest being very careful with this.  While it's a very nice feature,
> it's bound to be slow with large tables.  And it is very frustrating for
> users when typing becomes laggy.

The feature could be an optional minor mode first and then later made
default if it proves to work well in every situation.

With the techniques I suggested there should be no lag at all, because
for smaller tables emacs can handle automatic formatting instantly and
with bigger tables the code can introduce an automatic idle delay
(sit-for), so the automatic reformat will happen only when the user is
idle for a short while. The idle period length can depend on the size
and complexity of the table.

[-- Attachment #2: Type: text/html, Size: 790 bytes --]

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

end of thread, other threads:[~2020-03-30  8:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 16:27 Automatic formatting of the table as you type ndame
2020-03-27 18:55 ` Nicolas Goaziou
2020-03-27 20:49   ` ndame
2020-03-29  6:18     ` Adam Porter
2020-03-30  8:26       ` Eric S Fraga
  -- strict thread matches above, loose matches on Subject: below --
2020-03-29  7:09 ndame

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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).