emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel][bug] \ in detangling
@ 2011-01-13 16:27 Seth Burleigh
  2011-01-13 17:01 ` Eric Schulte
  0 siblings, 1 reply; 5+ messages in thread
From: Seth Burleigh @ 2011-01-13 16:27 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 507 bytes --]

(defun org-babel-update-block-body (new-body)
  "Update the body of the current code block to NEW-BODY."
  (if (not (org-babel-where-is-src-block-head))
      (error "not in source block")
    (save-match-data
      (replace-match (concat (org-babel-trim new-body) "\n") nil t nil 5))
    (indent-rigidly (match-beginning 5) (match-end 5) 2)))

replace-match argument should be t instead of nil (as shown), otherwise \ is
treated as a special character and you cant detangle code with that
character in it.

[-- Attachment #1.2: Type: text/html, Size: 635 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2011-01-13 21:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 16:27 [babel][bug] \ in detangling Seth Burleigh
2011-01-13 17:01 ` Eric Schulte
2011-01-13 17:16   ` Seth Burleigh
2011-01-13 17:54     ` Seth Burleigh
2011-01-13 21:09       ` Eric Schulte

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