From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Schulte Newsgroups: gmane.emacs.devel Subject: [Patch] -- small bug fix in org-exp-blocks Date: Sat, 19 May 2012 12:22:16 -0400 Message-ID: <87y5oob0p3.fsf@gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1337451762 1362 80.91.229.3 (19 May 2012 18:22:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 19 May 2012 18:22:42 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 19 20:22:39 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SVoIY-0007fc-SM for ged-emacs-devel@m.gmane.org; Sat, 19 May 2012 20:22:38 +0200 Original-Received: from localhost ([::1]:36956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVoIY-0001KJ-4a for ged-emacs-devel@m.gmane.org; Sat, 19 May 2012 14:22:38 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVoIV-0001KC-Af for emacs-devel@gnu.org; Sat, 19 May 2012 14:22:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVoIT-0003lL-HP for emacs-devel@gnu.org; Sat, 19 May 2012 14:22:34 -0400 Original-Received: from mailout-us.gmx.com ([74.208.5.67]:48928 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SVoIT-0003l9-9j for emacs-devel@gnu.org; Sat, 19 May 2012 14:22:33 -0400 Original-Received: (qmail invoked by alias); 19 May 2012 18:22:30 -0000 Original-Received: from c-174-56-50-60.hsd1.nm.comcast.net (EHLO bagel) [174.56.50.60] by mail.gmx.com (mp-us007) with SMTP; 19 May 2012 14:22:30 -0400 X-Authenticated: #67821228 X-Provags-ID: V01U2FsdGVkX19vHO4OfeZv1JFIgs3v/rJAVzrur2L2m/FKzDw3tb FnGdEXkGo+kMY+ User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.208.5.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150564 Archived-At: --=-=-= Content-Type: text/plain 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, --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=indent-block-boundaries-when-body-is-no-indent.patch === 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) --=-=-= Content-Type: text/plain -- Eric Schulte http://cs.unm.edu/~eschulte --=-=-=--