emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joost Diepenmaat <joost@zeekat.nl>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix org-indent-region's BEGIN_SRC / END_SRC indentation
Date: Mon, 28 Oct 2013 09:23:36 +0100	[thread overview]
Message-ID: <CAPfy-c1gpggPNENWy2Vv9OT7UTDSCw0rvRrt+2kCYauHXdsaxA@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 402 bytes --]

Hello,

Attached is a 2 character patch that makes org-indent-region indent
#+BEGIN_SRC and #+END_SRC lines according to org document rules instead of
the indentation rules of the language /inside/ the source block.

This is my first patch proposal for org-mode, so please let me know if I
need to modify things. In any case, feedback is welcome!

Cheers,
Joost Diepenmaat
Zeekat Software Ontwikkeling

[-- Attachment #1.2: Type: text/html, Size: 497 bytes --]

[-- Attachment #2: 0001-Correctly-indent-BEGIN_SRC-and-END_SRC-lines.patch --]
[-- Type: application/octet-stream, Size: 950 bytes --]

From 659a071cc519ebdaabd586132f1d4d3159475c8d Mon Sep 17 00:00:00 2001
From: Joost Diepenmaat <joost@zeekat.nl>
Date: Fri, 25 Oct 2013 11:08:46 +0200
Subject: [PATCH] Correctly indent BEGIN_SRC and END_SRC lines

BEGIN_SRC and END_SRC lines should not be considered part of the
source block for the purposes of indentation.

TINYCHANGE
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 8c4b5e7..cbf7b87 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -22151,7 +22151,7 @@ hierarchy of headlines by UP levels before marking the subtree."
     (let ((line-end (org-current-line end)))
       (goto-char start)
       (while (< (org-current-line) line-end)
-	(cond ((org-in-src-block-p) (org-src-native-tab-command-maybe))
+	(cond ((org-in-src-block-p t) (org-src-native-tab-command-maybe))
 	      (t (call-interactively 'org-indent-line)))
 	(move-beginning-of-line 2)))))
 
-- 
1.8.4


             reply	other threads:[~2013-10-28  8:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-28  8:23 Joost Diepenmaat [this message]
2013-10-28  8:57 ` [PATCH] Fix org-indent-region's BEGIN_SRC / END_SRC indentation Nicolas Goaziou
2013-10-28  9:51   ` Joost Diepenmaat

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=CAPfy-c1gpggPNENWy2Vv9OT7UTDSCw0rvRrt+2kCYauHXdsaxA@mail.gmail.com \
    --to=joost@zeekat.nl \
    --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).