emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* orgtbl-mode and markdown
@ 2012-12-18  8:33 Vegard Vesterheim
  2012-12-18 13:07 ` Carsten Dominik
  0 siblings, 1 reply; 8+ messages in thread
From: Vegard Vesterheim @ 2012-12-18  8:33 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-23 16:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18  8:33 orgtbl-mode and markdown Vegard Vesterheim
2012-12-18 13:07 ` Carsten Dominik
2012-12-18 13:39   ` Vegard Vesterheim
2012-12-18 14:50     ` Carsten Dominik
2012-12-18 17:56       ` Achim Gratz
2012-12-20  8:01         ` Carsten Dominik
2012-12-21 10:53           ` Carsten Dominik
2012-12-23 16:33             ` Bastien

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).