emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Patch] -- small bug fix in org-exp-blocks


From: Eric Schulte
Subject: [Patch] -- small bug fix in org-exp-blocks
Date: Sat, 19 May 2012 12:22:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

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,

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]