* [PATCH] fix org-insert-todo-heading-respect-content in plain list item
@ 2013-10-27 16:48 Ingo Lohmar
2013-10-28 8:43 ` Nicolas Goaziou
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Lohmar @ 2013-10-27 16:48 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 131 bytes --]
Hi guys,
please find attached a 1-4-char patch fixing the behavior of the above
function when inside a plain list.
Best,
Ingo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-really-always-insert-heading.patch --]
[-- Type: text/x-diff, Size: 1246 bytes --]
From e22f9ffe3f6af69cde2397f56a7efebaaa7710e0 Mon Sep 17 00:00:00 2001
From: Ingo Lohmar <i.lohmar@gmail.com>
Date: Sun, 27 Oct 2013 17:34:22 +0100
Subject: [PATCH] fix org-insert-todo-heading-respect-content in plain list item
* lisp/org.el (org-insert-todo-heading-respect-content): pass correct
prefix arg to always insert heading
TINYCHANGE
This function used a second argument t, which is eventually passed to
org-insert-heading, adding a list item when inside a plain list. Use
the proper argument '(4) now, to always create a heading, just like
the function's name and documentation imply.
---
lisp/org.el | 4 ++-- 1 file changed, 2
insertions(+), 2 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 0fd531d..275f480 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7770,7 +7770,7 @@ This is a list with the following elements:
"Insert TODO heading with `org-insert-heading-respect-content' set to t."
(interactive "P")
(let ((org-insert-heading-respect-content t))
- (org-insert-todo-heading force-state t)))
+ (org-insert-todo-heading force-state '(4))))
(defun org-insert-todo-heading (arg &optional force-heading)
"Insert a new heading with the same level and TODO state as current heading.
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] fix org-insert-todo-heading-respect-content in plain list item
2013-10-27 16:48 [PATCH] fix org-insert-todo-heading-respect-content in plain list item Ingo Lohmar
@ 2013-10-28 8:43 ` Nicolas Goaziou
2013-10-28 19:35 ` Ingo Lohmar
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2013-10-28 8:43 UTC (permalink / raw)
To: Ingo Lohmar; +Cc: emacs-orgmode
Hello,
Ingo Lohmar <i.lohmar@gmail.com> writes:
> please find attached a 1-4-char patch fixing the behavior of the above
> function when inside a plain list.
[...]
> Subject: [PATCH] fix org-insert-todo-heading-respect-content in plain list item
>
> * lisp/org.el (org-insert-todo-heading-respect-content): pass correct
> prefix arg to always insert heading
>
> TINYCHANGE
>
> This function used a second argument t, which is eventually passed to
> org-insert-heading, adding a list item when inside a plain list. Use
> the proper argument '(4) now, to always create a heading, just like
> the function's name and documentation imply.
Thank you for your patch.
Could you provide a test case, because, after a quick test, I do not see
any difference before and after applying your patch.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix org-insert-todo-heading-respect-content in plain list item
2013-10-28 8:43 ` Nicolas Goaziou
@ 2013-10-28 19:35 ` Ingo Lohmar
2013-10-29 8:58 ` Nicolas Goaziou
0 siblings, 1 reply; 4+ messages in thread
From: Ingo Lohmar @ 2013-10-28 19:35 UTC (permalink / raw)
To: Nicolas Goaziou; +Cc: emacs-orgmode
Hi Nicolas,
sure: emacs -q -nw, and in the scratch buffer
(add-to-list 'load-path "~/src/org-mode/lisp/") ;refer to HEAD as of yesterday
(org-mode)
;and enter/paste:
* test
- an -!- item
- another one
Then, with the cursor at -!- (for example), hitting <C-S-return> breaks
the line, while it /should/ create a todo heading after the subtree.
Replacing the t with '(4) (which is what org-todo-heading comapres with)
fixes this.
HTH, regards,
Ingo
On Mon, Oct 28 2013 09:43 (+0100), Nicolas Goaziou wrote:
> Hello,
>
> Ingo Lohmar <i.lohmar@gmail.com> writes:
>
>> please find attached a 1-4-char patch fixing the behavior of the above
>> function when inside a plain list.
>
> [...]
>
>> Subject: [PATCH] fix org-insert-todo-heading-respect-content in plain list item
>>
>> * lisp/org.el (org-insert-todo-heading-respect-content): pass correct
>> prefix arg to always insert heading
>>
>> TINYCHANGE
>>
>> This function used a second argument t, which is eventually passed to
>> org-insert-heading, adding a list item when inside a plain list. Use
>> the proper argument '(4) now, to always create a heading, just like
>> the function's name and documentation imply.
>
> Thank you for your patch.
>
> Could you provide a test case, because, after a quick test, I do not see
> any difference before and after applying your patch.
>
>
> Regards,
>
> --
> Nicolas Goaziou
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] fix org-insert-todo-heading-respect-content in plain list item
2013-10-28 19:35 ` Ingo Lohmar
@ 2013-10-29 8:58 ` Nicolas Goaziou
0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2013-10-29 8:58 UTC (permalink / raw)
To: Ingo Lohmar; +Cc: emacs-orgmode
Hello,
Ingo Lohmar <i.lohmar@gmail.com> writes:
> Hi Nicolas,
>
> sure: emacs -q -nw, and in the scratch buffer
>
> (add-to-list 'load-path "~/src/org-mode/lisp/") ;refer to HEAD as of yesterday
> (org-mode)
>
> ;and enter/paste:
>
> * test
> - an -!- item
> - another one
>
> Then, with the cursor at -!- (for example), hitting <C-S-return> breaks
> the line, while it /should/ create a todo heading after the subtree.
> Replacing the t with '(4) (which is what org-todo-heading comapres with)
> fixes this.
Thank you. I applied your patch.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-29 8:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-27 16:48 [PATCH] fix org-insert-todo-heading-respect-content in plain list item Ingo Lohmar
2013-10-28 8:43 ` Nicolas Goaziou
2013-10-28 19:35 ` Ingo Lohmar
2013-10-29 8:58 ` Nicolas Goaziou
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).