From mboxrd@z Thu Jan 1 00:00:00 1970 From: Seth Burleigh Subject: [babel][bug] \ in detangling Date: Thu, 13 Jan 2011 10:27:37 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0227753790==" Return-path: Received: from [140.186.70.92] (port=37490 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdQ1a-0006rT-92 for emacs-orgmode@gnu.org; Thu, 13 Jan 2011 11:27:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdQ1Y-0005ZW-IL for emacs-orgmode@gnu.org; Thu, 13 Jan 2011 11:27:46 -0500 Received: from mail-iw0-f169.google.com ([209.85.214.169]:64279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdQ1Y-0005ZK-CA for emacs-orgmode@gnu.org; Thu, 13 Jan 2011 11:27:44 -0500 Received: by iwn40 with SMTP id 40so1851124iwn.0 for ; Thu, 13 Jan 2011 08:27:43 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0227753790== Content-Type: multipart/alternative; boundary=00221534d4cfbcd85a0499bccbe9 --00221534d4cfbcd85a0499bccbe9 Content-Type: text/plain; charset=ISO-8859-1 (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. --00221534d4cfbcd85a0499bccbe9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
(defun org-babel-update-block-body (new-body)
=A0=A0"Up= date the body of the current code block to NEW-BODY."
=A0=A0= (if (not (org-babel-where-is-src-block-head))
=A0=A0 =A0 =A0(erro= r "not in source block")
=A0=A0 =A0(save-match-data
=A0=A0 =A0 =A0(replace-match (con= cat (org-babel-trim new-body) "\n") nil t nil 5))
=A0= =A0 =A0(indent-rigidly (match-beginning 5) (match-end 5) 2)))
replace-match argument should be t instead of nil (as shown), o= therwise \ is treated as a special character and you cant detangle code wit= h that character in it.
--00221534d4cfbcd85a0499bccbe9-- --===============0227753790== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0227753790==--