emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: ndame <emacsuser@freemail.hu>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Automatic formatting of the table as you type
Date: Fri, 27 Mar 2020 20:49:59 +0000 (GMT)	[thread overview]
Message-ID: <AyZYyg.oa4i6rUNbkMR.Ca8I2OWCfQP8GwRvCX@freemail.hu> (raw)
In-Reply-To: <87sghtd3vw.fsf@nicolasgoaziou.fr>

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

> The idea is nice, and probably a step in the right direction, but
> `org-at-table-p' and `org-table-align' are not lightweight functions. In
> some common situations, e.g., when the table is a bit large, or when it
> is located away from the start of a section, typing in the table may
> feel sluggish.
>
> Therefore, I wonder if Org should include it unless it is optimized in
> most situations.

Apparently, the code is more like a proof of concept, not a fully
optimized solution. I didn't mean it should be included as is, rather
the concept itself is very promising and provides a better user
experience. As some of the commenters put it on reddit this is how
they expected Org tables to work in the first place and I feel the
same way.

As for org-at-table-p being slow storing the start and end position of
the table could be a solution, so if point is between them then there
is no need to check org-at-table-p again.

org-table-align seemed fast enough for me when I tried the posted
code, but if it's slower for large tables then the code could measure
the time it takes to perform the alignment for the current table and
if it's above a certain threshold then it could introduce a bit of
idle delay for the update, so it doesn't hold back the user from
typing, and if the alignment is fast then it could perform the update
without delay.

Anyway, I think if implemented properly then this feature could be a
worthy addition to org, even as default if it works well, because it's
a much better user experience and a much better first impression for
new users, instead of the current default fragile table which falls
apart during typing and fixed only when TAB is pressed.

 

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

  reply	other threads:[~2020-03-27 20:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AyZYyg.oa4i6rUNbkMR.Ca8I2OWCfQP8GwRvCX@freemail.hu \
    --to=emacsuser@freemail.hu \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).