emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix org-indent-region's BEGIN_SRC / END_SRC indentation
@ 2013-10-28  8:23 Joost Diepenmaat
  2013-10-28  8:57 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Joost Diepenmaat @ 2013-10-28  8:23 UTC (permalink / raw)
  To: emacs-orgmode


[-- 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


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

* Re: [PATCH] Fix org-indent-region's BEGIN_SRC / END_SRC indentation
  2013-10-28  8:23 [PATCH] Fix org-indent-region's BEGIN_SRC / END_SRC indentation Joost Diepenmaat
@ 2013-10-28  8:57 ` Nicolas Goaziou
  2013-10-28  9:51   ` Joost Diepenmaat
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Goaziou @ 2013-10-28  8:57 UTC (permalink / raw)
  To: Joost Diepenmaat; +Cc: emacs-orgmode

Hello,

Joost Diepenmaat <joost@zeekat.nl> writes:

> 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!

[...]

> 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

Here, you need to specifying what functions and variables are modified
by your patch and how. Something like the following should do:

* lisp/org.el (org-indent-region): BEGIN_SRC and END_SRC lines should
  not be considered part of the source block for the purposes of
  indentation.

> TINYCHANGE

Otherwise, the patch looks good. So I applied it with said
modifications.

Thank you.


Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] Fix org-indent-region's BEGIN_SRC / END_SRC indentation
  2013-10-28  8:57 ` Nicolas Goaziou
@ 2013-10-28  9:51   ` Joost Diepenmaat
  0 siblings, 0 replies; 3+ messages in thread
From: Joost Diepenmaat @ 2013-10-28  9:51 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

On Mon, Oct 28, 2013 at 9:57 AM, Nicolas Goaziou <n.goaziou@gmail.com>wrote:

>
> Here, you need to specifying what functions and variables are modified
> by your patch and how. Something like the following should do


Oh yes. I'll keep that in mind next time.


>
> Otherwise, the patch looks good. So I applied it with said
> modifications.
>

Great, thanks!

Joost.

[-- Attachment #2: Type: text/html, Size: 881 bytes --]

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

end of thread, other threads:[~2013-10-28  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-28  8:23 [PATCH] Fix org-indent-region's BEGIN_SRC / END_SRC indentation Joost Diepenmaat
2013-10-28  8:57 ` Nicolas Goaziou
2013-10-28  9:51   ` Joost Diepenmaat

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