From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Beckwith Subject: [PATCH] Columnview: Fix the case of #+ content present Date: Tue, 17 Sep 2013 15:13:30 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VM0iK-0006QB-Tl for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 15:13:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VM0iJ-0007Mh-Tn for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 15:13:32 -0400 Received: from mail-qa0-x233.google.com ([2607:f8b0:400d:c00::233]:49027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VM0iJ-0007Mb-Ph for emacs-orgmode@gnu.org; Tue, 17 Sep 2013 15:13:31 -0400 Received: by mail-qa0-f51.google.com with SMTP id j15so2244074qaq.3 for ; Tue, 17 Sep 2013 12:13:30 -0700 (PDT) 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: emacs-orgmode@gnu.org * lisp/org-colview.el (org-dblock-write:columnview): Change the capture of pos to after inserting the original content The problem is with a block that has content preceding the table. Upon recreating the content, the `pos' gets set to the beginning of this content instead of the table. Later calls to `org-table-recalculate' or `org-table-align' will fail because the point is not at a table. This patch moves the capture of `pos' to right before the insertion of the table. TINYCHANGE --- lisp/org-colview.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index f3b8e42..8790ad4 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -1306,10 +1306,10 @@ PARAMS is a property list of parameters: (if (eq 'hline x) x (cons "" x))) tbl)) (setq tbl (append tbl (list (cons "/" (make-list nfields "<>")))))) - (setq pos (point)) (when content-lines (while (string-match "^#" (car content-lines)) (insert (pop content-lines) "\n"))) + (setq pos (point)) (insert (org-listtable-to-string tbl)) (when (plist-get params :width) (insert "\n|" (mapconcat (lambda (x) (format "<%d>" (max 3 x))) -- 1.8.1.2