emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Properly indent clock drawer upon creation
@ 2009-02-28  0:41 Peter Jones
  2009-03-01 16:19 ` Carsten Dominik
  2009-03-02  5:44 ` Carsten Dominik
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Jones @ 2009-02-28  0:41 UTC (permalink / raw)
  To: emacs-orgmode

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

Properly indent clock drawer upon creation.

Patch also available from:

 git://pmade.com/org-mode
 branch: pjones-clock-end-indent


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: clock.patch --]
[-- Type: text/x-patch, Size: 933 bytes --]

From ced66c53109a0f34e280853f02deb6bbdeabdaaa Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@pmade.com>
Date: Fri, 27 Feb 2009 17:37:22 -0700
Subject: [PATCH] Properly indent clock drawer upon creation

---
 lisp/org-clock.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 3f302a9..02f6b18 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -444,12 +444,12 @@ the clocking selection, associated with the letter `d'."
 		(stringp org-clock-into-drawer)
 		(and (integerp org-clock-into-drawer)
 		     (< org-clock-into-drawer 2)))
+	(org-indent-line-function)
 	(insert ":" drawer ":\n:END:\n")
 	(beginning-of-line 0)
 	(org-indent-line-function)
 	(beginning-of-line 0)
 	(org-flag-drawer t)
-	(org-indent-line-function)
 	(beginning-of-line 2)
 	(or org-log-states-order-reversed
 	    (and (re-search-forward org-property-end-re nil t)
-- 
1.6.0


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


-- 
Peter Jones, http://pmade.com
pmade inc.  Louisville, CO US

[-- Attachment #4: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [PATCH] Properly indent clock drawer upon creation
  2009-02-28  0:41 [PATCH] Properly indent clock drawer upon creation Peter Jones
@ 2009-03-01 16:19 ` Carsten Dominik
  2009-03-02  0:32   ` Peter Jones
  2009-03-02  5:44 ` Carsten Dominik
  1 sibling, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2009-03-01 16:19 UTC (permalink / raw)
  To: Peter Jones; +Cc: emacs-orgmode

Hi Peter,

can you please describe a test case where the code without your patch  
fails?

Thanks.

- Carsten

On Feb 28, 2009, at 1:41 AM, Peter Jones wrote:

> Properly indent clock drawer upon creation.
>
> Patch also available from:
>
> git://pmade.com/org-mode
> branch: pjones-clock-end-indent
>
> From ced66c53109a0f34e280853f02deb6bbdeabdaaa Mon Sep 17 00:00:00 2001
> From: Peter Jones <pjones@pmade.com>
> Date: Fri, 27 Feb 2009 17:37:22 -0700
> Subject: [PATCH] Properly indent clock drawer upon creation
>
> ---
> lisp/org-clock.el |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index 3f302a9..02f6b18 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -444,12 +444,12 @@ the clocking selection, associated with the  
> letter `d'."
> 		(stringp org-clock-into-drawer)
> 		(and (integerp org-clock-into-drawer)
> 		     (< org-clock-into-drawer 2)))
> +	(org-indent-line-function)
> 	(insert ":" drawer ":\n:END:\n")
> 	(beginning-of-line 0)
> 	(org-indent-line-function)
> 	(beginning-of-line 0)
> 	(org-flag-drawer t)
> -	(org-indent-line-function)
> 	(beginning-of-line 2)
> 	(or org-log-states-order-reversed
> 	    (and (re-search-forward org-property-end-re nil t)
> -- 
> 1.6.0
>
>
> -- 
> Peter Jones, http://pmade.com
> pmade inc.  Louisville, CO US
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: [PATCH] Properly indent clock drawer upon creation
  2009-03-01 16:19 ` Carsten Dominik
@ 2009-03-02  0:32   ` Peter Jones
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Jones @ 2009-03-02  0:32 UTC (permalink / raw)
  To: emacs-orgmode

Carsten Dominik <dominik@science.uva.nl> writes:
> can you please describe a test case where the code without your patch
> fails?

The code doesn't fail, this is just a "nice to have".

When a clock/logbook drawer is created, the :END: isn't indented
correctly.  This causes a problem for my function that automatically
creates a plain list under a heading.  My function uses
org-indent-line-function to properly indent the plain list, but because
of the bad :END: indentation, the plain list is indented incorrectly
too.

Example before my patch:

* Foo Bar
  :CLOCK:
:END:
- Item One


Example after my patch:

* Foo Bar
  :CLOCK:
  :END:
  - Item One

-- 
Peter Jones, http://pmade.com
pmade inc.  Louisville, CO US

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

* Re: [PATCH] Properly indent clock drawer upon creation
  2009-02-28  0:41 [PATCH] Properly indent clock drawer upon creation Peter Jones
  2009-03-01 16:19 ` Carsten Dominik
@ 2009-03-02  5:44 ` Carsten Dominik
  1 sibling, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2009-03-02  5:44 UTC (permalink / raw)
  To: Peter Jones; +Cc: emacs-orgmode

OK, I am accepting this patch, thanks.

- Carsten

On Feb 28, 2009, at 1:41 AM, Peter Jones wrote:

> Properly indent clock drawer upon creation.
>
> Patch also available from:
>
> git://pmade.com/org-mode
> branch: pjones-clock-end-indent
>
> From ced66c53109a0f34e280853f02deb6bbdeabdaaa Mon Sep 17 00:00:00 2001
> From: Peter Jones <pjones@pmade.com>
> Date: Fri, 27 Feb 2009 17:37:22 -0700
> Subject: [PATCH] Properly indent clock drawer upon creation
>
> ---
> lisp/org-clock.el |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/lisp/org-clock.el b/lisp/org-clock.el
> index 3f302a9..02f6b18 100644
> --- a/lisp/org-clock.el
> +++ b/lisp/org-clock.el
> @@ -444,12 +444,12 @@ the clocking selection, associated with the  
> letter `d'."
> 		(stringp org-clock-into-drawer)
> 		(and (integerp org-clock-into-drawer)
> 		     (< org-clock-into-drawer 2)))
> +	(org-indent-line-function)
> 	(insert ":" drawer ":\n:END:\n")
> 	(beginning-of-line 0)
> 	(org-indent-line-function)
> 	(beginning-of-line 0)
> 	(org-flag-drawer t)
> -	(org-indent-line-function)
> 	(beginning-of-line 2)
> 	(or org-log-states-order-reversed
> 	    (and (re-search-forward org-property-end-re nil t)
> -- 
> 1.6.0
>
>
> -- 
> Peter Jones, http://pmade.com
> pmade inc.  Louisville, CO US
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

end of thread, other threads:[~2009-03-02  6:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-28  0:41 [PATCH] Properly indent clock drawer upon creation Peter Jones
2009-03-01 16:19 ` Carsten Dominik
2009-03-02  0:32   ` Peter Jones
2009-03-02  5:44 ` Carsten Dominik

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