From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Automatic formatting of the table as you type Date: Fri, 27 Mar 2020 19:55:15 +0100 Message-ID: <87sghtd3vw.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47710) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jHu8b-0003jL-4K for emacs-orgmode@gnu.org; Fri, 27 Mar 2020 14:55:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jHu8Z-0004Mi-81 for emacs-orgmode@gnu.org; Fri, 27 Mar 2020 14:55:24 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:8059) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jHu8X-0003v5-M8 for emacs-orgmode@gnu.org; Fri, 27 Mar 2020 14:55:23 -0400 In-Reply-To: (ndame's message of "Fri, 27 Mar 2020 16:27:08 +0000 (GMT)") 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: ndame Cc: "emacs-orgmode@gnu.org" Hello, ndame writes: > 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 li= nes > and=C2=A0it might even be possible to rewrite it to simplify it even more: > > https://reddit.com/r/emacs/comments/fosdi2/orgtableautoalignmode_minor_mo= de_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. 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. As a side note, the table doesn't realign when you add a space in a cell. Regards, --=20 Nicolas Goaziou