emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastian Rose <sebastian_rose@gmx.de>
To: Bernt Hansen <bernt@norang.ca>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>,
	Ali Tofigh <alix.tofigh@gmail.com>,
	carsten.dominik@gmail.com
Subject: Re: Bug in org-inlinetask - was: Re: Feature suggestion: highlights
Date: Fri, 16 Apr 2010 23:47:20 +0200	[thread overview]
Message-ID: <87eiifxe6v.fsf@gmx.de> (raw)
In-Reply-To: <87mxx3m69y.fsf@gollum.intra.norang.ca> (Bernt Hansen's message of "Fri, 16 Apr 2010 17:33:45 -0400")

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

This patch fixes the odd odd/even behaviour. I.e., it makes
`org-inlinetask-insert-task' regard `org-odd-levels-only'.


Diffed against `origin/master':



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-diff, Size: 759 bytes --]

diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el
index aac338b..46a7a7e 100644
--- a/lisp/org-inlinetask.el
+++ b/lisp/org-inlinetask.el
@@ -109,9 +109,13 @@ When nil, they will not be exported."
   "Insert an inline task."
   (interactive)
   (or (bolp) (newline))
-  (insert (make-string org-inlinetask-min-level ?*) " \n"
-         (make-string org-inlinetask-min-level ?*) " END\n")
+  (let ((indent org-inlinetask-min-level))
+    (if org-odd-levels-only
+        (setq indent (- (* 2 indent) 1)))
+    (insert (make-string indent ?*) " \n"
+            (make-string indent ?*) " END\n"))
   (end-of-line -1))
+
 (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
 
 (defvar htmlp)  ; dynamically scoped into the next function

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



Diffed against branch `remove-compatibility-code':


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: Diffed against branch `remove-compatibility-code' --]
[-- Type: text/x-diff, Size: 690 bytes --]

diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el
index aac338b..6c4e397 100644
--- a/lisp/org-inlinetask.el
+++ b/lisp/org-inlinetask.el
@@ -109,8 +109,11 @@ When nil, they will not be exported."
   "Insert an inline task."
   (interactive)
   (or (bolp) (newline))
-  (insert (make-string org-inlinetask-min-level ?*) " \n"
-	  (make-string org-inlinetask-min-level ?*) " END\n")
+  (let ((indent org-inlinetask-min-level))
+    (if org-odd-levels-only
+        (setq indent (- (* 2 indent) 1)))
+    (insert (make-string indent ?*) " \n"
+            (make-string indent ?*) " END\n"))
   (end-of-line -1))
 (define-key org-mode-map "\C-c\C-xt" 'org-inlinetask-insert-task)
 

[-- Attachment #5: Type: text/plain, Size: 16 bytes --]




   Sebastian

[-- Attachment #6: Type: text/plain, Size: 201 bytes --]

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

  reply	other threads:[~2010-04-16 21:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-15 20:15 Feature suggestion: highlights Ali Tofigh
2010-04-15 23:21 ` Sebastian Rose
2010-04-16 15:55   ` Ali Tofigh
2010-04-16 19:29     ` Sebastian Rose
2010-04-16 19:54       ` Bernt Hansen
2010-04-16 21:06         ` Bug in org-inlinetask - was: " Sebastian Rose
2010-04-16 21:32           ` Sebastian Rose
2010-04-16 21:33           ` Bernt Hansen
2010-04-16 21:47             ` Sebastian Rose [this message]
2010-04-17  1:17         ` Ali Tofigh
2010-04-17  1:29           ` Bernt Hansen
2010-04-16  0:44 ` Bernt Hansen
2010-04-16 16:00   ` Ali Tofigh

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=87eiifxe6v.fsf@gmx.de \
    --to=sebastian_rose@gmx.de \
    --cc=alix.tofigh@gmail.com \
    --cc=bernt@norang.ca \
    --cc=carsten.dominik@gmail.com \
    --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).