emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] fix bug in org-exp-blocks, removing src code indentation
@ 2009-08-17 20:49 Eric Schulte
  2009-08-18  5:36 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Schulte @ 2009-08-17 20:49 UTC (permalink / raw)
  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))

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

* Re: [PATCH] fix bug in org-exp-blocks, removing src code indentation
  2009-08-17 20:49 [PATCH] fix bug in org-exp-blocks, removing src code indentation Eric Schulte
@ 2009-08-18  5:36 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2009-08-18  5:36 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode

Applied, thanks.

- Carsten

On Aug 17, 2009, at 9:49 PM, Eric Schulte wrote:

> 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))
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: 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] 2+ messages in thread

end of thread, other threads:[~2009-08-18  5:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-17 20:49 [PATCH] fix bug in org-exp-blocks, removing src code indentation Eric Schulte
2009-08-18  5:36 ` Carsten Dominik

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