From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: small bug in table alignment Date: Thu, 14 Mar 2013 12:23:01 +0100 Message-ID: <87r4ji1azu.fsf@bzg.ath.cx> References: <87620u74o8.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG6Fd-0006X7-3i for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 07:23:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UG6FY-0007IQ-50 for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 07:23:13 -0400 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:40815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UG6FX-0007IB-UE for emacs-orgmode@gnu.org; Thu, 14 Mar 2013 07:23:08 -0400 Received: by mail-wi0-f179.google.com with SMTP id ez12so1657998wid.6 for ; Thu, 14 Mar 2013 04:23:07 -0700 (PDT) In-Reply-To: <87620u74o8.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 14 Mar 2013 16:43:03 +0800") 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.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Abrahamsen Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Eric, Eric Abrahamsen writes: > If you call "C-c C-c" within a table to align it, and point happens to > be on a horizontal rule, it throws an error that originates in > org-element-context. This is now fixed with the attached patch, thanks for reporting this bug. If think `org-element-table-row-parser' is doing the right thing by not assigning a :contents-begin and a :contents-end to table rules, as they have no content. So the fix should go directly in `org-element-context'. Just stating this in case Nicolas wants to double-check. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-element.el-org-element-context-Prevent-an-error-.patch >From 5046137401779d6be0d68631b448644a868e03fb Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Thu, 14 Mar 2013 12:19:41 +0100 Subject: [PATCH] org-element.el (org-element-context): Prevent an error when getting the context of a table rule * org-element.el (org-element-context): Prevent an error when getting the context of a table rule. Thanks to Eric Abrahamsen for reporting this bug. --- lisp/org-element.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-element.el b/lisp/org-element.el index 6810b98..ba2461a 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -4751,7 +4751,8 @@ Providing it allows for quicker computation." :contents-begin element)) (cend (org-element-property :contents-end element))) - (and (>= origin cbeg) + (and cbeg cend ; cbeg is nil for table rules + (>= origin cbeg) (<= origin cend) (progn (goto-char cbeg) (setq end cend))))) (and (eq type 'keyword) -- 1.8.1.4 --=-=-= Content-Type: text/plain -- Bastien --=-=-=--