emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: [PATCH] fix bug in org-exp-blocks, removing src code indentation
Date: Mon, 17 Aug 2009 14:49:41 -0600	[thread overview]
Message-ID: <m2r5va88sl.fsf@gmail.com> (raw)

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

             reply	other threads:[~2009-08-17 20:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-17 20:49 Eric Schulte [this message]
2009-08-18  5:36 ` [PATCH] fix bug in org-exp-blocks, removing src code indentation Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2r5va88sl.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).