From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Abbrevs and Org Tables Date: Tue, 22 Apr 2008 05:32:17 +0200 Message-ID: <981A2882-7550-4DD5-A912-CBC83FCAEF29@science.uva.nl> References: <008b01c8a2cb$2ff9f3f0$6580a8c0@CUBE> Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jo9FO-0005rp-A2 for emacs-orgmode@gnu.org; Mon, 21 Apr 2008 23:32:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jo9FH-0005qO-EB for emacs-orgmode@gnu.org; Mon, 21 Apr 2008 23:32:45 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jo9FH-0005qD-1U for emacs-orgmode@gnu.org; Mon, 21 Apr 2008 23:32:39 -0400 Received: from fk-out-0910.google.com ([209.85.128.184]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jo9FG-00058b-Mq for emacs-orgmode@gnu.org; Mon, 21 Apr 2008 23:32:39 -0400 Received: by fk-out-0910.google.com with SMTP id 26so2828391fkx.10 for ; Mon, 21 Apr 2008 20:32:21 -0700 (PDT) In-Reply-To: <008b01c8a2cb$2ff9f3f0$6580a8c0@CUBE> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Chris Randle , Jose Robins Cc: emacs-orgmode@gnu.org On Apr 20, 2008, at 11:44 AM, Chris Randle wrote: > Hi > > I define an Emacs abbrev of, say, "hnbc" to exapand to "how now brown > cow", and then type "hnbc[space]" inside an org table cell. After it > has > expanded it pushes the trailing cell divider away, even though the > cell > width was adequate. Tabbing out of the cell doesn't re-fit the cell > divider - it stays "stuck" where it was after the expansion. > > It's slightly odd, because if I type lots of leading spaces before the > abbrev and then tab, org happily moves the expanded text back to the > beginning of the cell, but still doesn't move the trailing divider. > > C-c C-c fixes it, and also moving the cursor over to the trailing cell > divider and backspace one char and tab. > > Any other workarounds or suggestions? Hi Chris, Jose, maybe it is useful to explain a bit how the table editor works. Each time you press a character, Org checks if you are doing this inside a table. If yes, Org is checking if it can insert the character into the current field., it it fits in there. If yes it does so. If not, it raises a flag that the next TAB should trigger a re-alignment of the table. Org goes through all this to avoid having the re-align the table always, each time you press TAB, because for large tables this can lead to a significant slowdown. Now, the two things mentioned in this thread, abbrev expansion and hiding of emphasis markers, happen outside the control of normal editing. Both happen by some hook, and the corresponding change in field width is not noticed by Org. It is not easy to fix this without endangering the mechanism that suppresses constant table alignment. It seems to me that these two cases are rare enough that it is not too much to ask to quickly fix things with C-c C-c. I this really bothers you, take a look at the variable `org-enable- table-editor'. The default for this variable is `optimized', which leads to the discussed behavior. If you set it to t, each TAB will re- align the table. HTH - Carsten