all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Schulte <eric.schulte@gmx.com>
To: emacs-devel@gnu.org
Subject: [Patch] -- small bug fix in org-exp-blocks
Date: Sat, 19 May 2012 12:22:16 -0400	[thread overview]
Message-ID: <87y5oob0p3.fsf@gmx.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 237 bytes --]

Hi,

I'm attaching a small bug fix patch.  It is not a serious bug (covering
an uncommon edge case) but it is a simple patch and shouldn't do any
harm.  Would it be possible to apply this to the next iteration of the
pre-test?

Thanks,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: indent-block-boundaries-when-body-is-no-indent.patch --]
[-- Type: text/x-patch, Size: 860 bytes --]

=== modified file 'lisp/org/org-exp-blocks.el'
--- lisp/org/org-exp-blocks.el	2012-04-03 12:02:21 +0000
+++ lisp/org/org-exp-blocks.el	2012-05-19 16:00:27 +0000
@@ -211,8 +211,14 @@
 		  (when replacement
 		    (delete-region match-start match-end)
 		    (goto-char match-start) (insert replacement)
-		    (unless preserve-indent
-		      (indent-code-rigidly match-start (point) indentation)))))
+		    (if preserve-indent
+			;; indent only the code block markers
+			(save-excursion
+			  (indent-line-to indentation) ; indent end_block
+			  (goto-char match-start)
+			  (indent-line-to indentation))	; indent begin_block
+                        ;; indent everything
+                        (indent-code-rigidly match-start (point) indentation)))))
 	      ;; cleanup markers
 	      (set-marker match-start nil)
 	      (set-marker body-start nil)


[-- Attachment #3: Type: text/plain, Size: 46 bytes --]


-- 
Eric Schulte
http://cs.unm.edu/~eschulte

             reply	other threads:[~2012-05-19 16:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-19 16:22 Eric Schulte [this message]
2012-05-21 13:02 ` [Patch] -- small bug fix in org-exp-blocks Bastien

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

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

  git send-email \
    --in-reply-to=87y5oob0p3.fsf@gmx.com \
    --to=eric.schulte@gmx.com \
    --cc=emacs-devel@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.