From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vegard Vesterheim Subject: orgtbl-mode and markdown Date: Tue, 18 Dec 2012 09:33:12 +0100 Message-ID: <1ssj73bvzr.fsf@voll.uninett.no> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkscE-0006Nj-2Y for emacs-orgmode@gnu.org; Tue, 18 Dec 2012 03:33:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkscA-0004WH-FX for emacs-orgmode@gnu.org; Tue, 18 Dec 2012 03:33:29 -0500 Received: from epost.uninett.no ([158.38.180.100]:44342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkscA-0004Ut-90 for emacs-orgmode@gnu.org; Tue, 18 Dec 2012 03:33:26 -0500 Received: from voll.uninett.no (unknown [IPv6:2001:700:1:22:862b:2bff:feab:becb]) by epost.uninett.no (Postfix) with ESMTPSA id D641A3363E4 for ; Tue, 18 Dec 2012 09:33:12 +0100 (CET) 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 I had problems editing tables (using the minor mode orgtbl-mode) in markdown files. To reproduce: - visit an empty buffer in markdown mode - M-x orgtbl-mode - create a new table (C-c |) - try to edit a cell - observe that the edited text is misplaced at the end of the line The following patch against 709bf92950fb3e9dd7425e01eb53eedad43c7262 seems to fix the problem diff --git a/lisp/org-table.el b/lisp/org-table.el index acad0bb..188a825 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -4233,10 +4233,10 @@ overwritten, and the table is not marked as requiring realignment." t) (eq N 1) (looking-at "[^|\n]* +|")) - (let (org-table-may-need-update) - (goto-char (1- (match-end 0))) - (backward-delete-char 1) - (goto-char (match-beginning 0)) + (let ((org-table-may-need-update) (mb (match-beginning 0)) (me (match-end 0))) + (goto-char (1- me)) + (delete-backward-char 1) + (goto-char mb) (self-insert-command N)) (setq org-table-may-need-update t) (let* (orgtbl-mode