From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Porter Subject: Re: Automatic formatting of the table as you type Date: Sun, 29 Mar 2020 01:18:54 -0500 Message-ID: <87tv27smy9.fsf@alphapapa.net> References: <87sghtd3vw.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:51357) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jIRHj-0001vT-B3 for emacs-orgmode@gnu.org; Sun, 29 Mar 2020 02:19:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jIRHi-0007BL-82 for emacs-orgmode@gnu.org; Sun, 29 Mar 2020 02:19:03 -0400 Received: from ciao.gmane.io ([159.69.161.202]:35644) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jIRHi-00079w-2I for emacs-orgmode@gnu.org; Sun, 29 Mar 2020 02:19:02 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jIRHf-0001Fr-8U for emacs-orgmode@gnu.org; Sun, 29 Mar 2020 08:18:59 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org ndame writes: > 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. 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. Most users who encounter it would probably not know if there's a way to fix the problem, e.g. by disabling a feature, because they probably wouldn't even know what to look for. Most would probably think it a bug, and it could harm Org's and Emacs's reputation, making people think they're inherently slow or laggy when typing. Pressing TAB (or any other key that moves to the next field) to realign a table is not a significant burden. A feature like this should probably remain an add-on package, or at least disabled by default.