emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@altern.org>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: small bug in table alignment
Date: Thu, 14 Mar 2013 12:23:01 +0100	[thread overview]
Message-ID: <87r4ji1azu.fsf@bzg.ath.cx> (raw)
In-Reply-To: <87620u74o8.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 14 Mar 2013 16:43:03 +0800")

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

Hi Eric,

Eric Abrahamsen <eric@ericabrahamsen.net> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-element.el-org-element-context-Prevent-an-error-.patch --]
[-- Type: text/x-patch, Size: 1032 bytes --]

From 5046137401779d6be0d68631b448644a868e03fb Mon Sep 17 00:00:00 2001
From: Bastien Guerry <bzg@altern.org>
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


[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

      reply	other threads:[~2013-03-14 11:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14  8:43 small bug in table alignment Eric Abrahamsen
2013-03-14 11:23 ` Bastien [this message]

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=87r4ji1azu.fsf@bzg.ath.cx \
    --to=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=eric@ericabrahamsen.net \
    /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).