From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: [PATCH] fix bug in org-exp-blocks, removing src code indentation Date: Mon, 17 Aug 2009 14:49:41 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Md99k-0001OJ-PO for emacs-orgmode@gnu.org; Mon, 17 Aug 2009 16:50:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Md99g-0001K1-5I for emacs-orgmode@gnu.org; Mon, 17 Aug 2009 16:50:16 -0400 Received: from [199.232.76.173] (port=60382 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Md99f-0001Jw-Th for emacs-orgmode@gnu.org; Mon, 17 Aug 2009 16:50:12 -0400 Received: from mail-px0-f193.google.com ([209.85.216.193]:54186) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Md99f-0006mo-Fi for emacs-orgmode@gnu.org; Mon, 17 Aug 2009 16:50:11 -0400 Received: by pxi31 with SMTP id 31so1601149pxi.24 for ; Mon, 17 Aug 2009 13:50:10 -0700 (PDT) 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: Org Mode Hi, Please apply the attached patch which replaces `indent-region' with `indent-code-rigidly' in org-exp-blocks. This fixes the problem of indentation being removed from source-code blocks. Thanks -- Eric diff --git a/lisp/org-exp-blocks.el b/lisp/org-exp-blocks.el index 6025ce7..8df0ac1 100644 --- a/lisp/org-exp-blocks.el +++ b/lisp/org-exp-blocks.el @@ -203,9 +203,8 @@ specified in BLOCKS which default to the value of "" (apply func (save-match-data (org-remove-indentation (match-stri (split-string (match-string 3) " ")))) t t) - ;; indent the replaced match - (indent-region (match-beginning 0) (match-end 0) indentation) - )) + ;; indent block + (indent-code-rigidly (match-beginning 0) (match-end 0) indentation))) (setf start (save-match-data (match-end 0)))) (mapcar (lambda (type) (interblock start (point-max) type))