emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: emacs-orgmode@gnu.org
Subject: Re: org-class and headers
Date: Thu, 23 Oct 2014 12:10:09 +0200	[thread overview]
Message-ID: <87y4s79jwe.fsf@gmx.us> (raw)
In-Reply-To: m2oat36dyd.fsf@lapis.home

Joseph Le Roux <joseph.le.roux@gmail.com> writes:

> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> On Tuesday, 21 Oct 2014 at 16:47, Joseph Le Roux wrote:
>>> Rasmus <rasmus@gmx.us> writes:
>>
>> [...]
>>
>>>> Will `org-clone-subtree-with-time-shift' do what you want?
>>>>
>>>
>>> Thanks for the pointer, it could be very handy in my use-case, but this
>>> function copies the org-class as is for all clones. I would like to
>>
>> The idea is to use the clone function and not the org-class
>> expression.  Combining the two simply confuses things!
>>
>> What I do every start of term is define an entry for each lecture slot
>> in a week including the actual time information, lecture theatre,
>> etc.  I then clone each individual entry using +1w for the number of
>> weeks in the term.  I remove any subtrees generated that correspond to
>> lectures that do not actually exist, e.g. they fall on a holiday or
>> during our study week.
>>
>> Later, if an individual lecture gets cancelled, I simply remove the
>> corresponding subtree as I do for holidays etc.
>
> Thank you Eric, I'll follow the advice. As Rasmus showed,
> 'org-clone-subtree-with-time-shift' works with a timestamp, but it does
> not with (the result of) an org-class call. Ideally, what I would like
> to do is to specify a set of classes using org-class syntax and, as a
> result, get a set of headers. 'org-class' is a powerful tool, but just
> not powerful enough yet...

I have used to use classes in the past, but I now use a setup close to
Eric's.  One reasons is for good org-caldav support.  Here's how I
schedule my Spanish classes this term:

(with-temp-buffer
  (insert "* Spanish course
** Spanish class
<2014-10-07 Tue 18:30-20:30>")
  (goto-line 2)
  (org-clone-subtree-with-time-shift 8 "+1w")
  (save-excursion (insert "** Spanish class
<2014-10-09 Thu 18:30-20:30>\n"))
  (org-clone-subtree-with-time-shift 7 "+1w")
  (goto-char (point-min)) (org-sort-entries nil ?t)
  ;; like C-c ^ t
(buffer-substring-no-properties (point-min) (point-max)))

Of course in practice, this is easier to "interactively", but it's
hard to describe briefly.

Is there anything you miss about `org-clone-subtree-with-time-shift'¹?
Would you be happy if it asked if you want to skip some weeks
initially?  Or do you not like the extra space it takes?

—Rasmus

Footnotes: 
¹   note the "`" in the beginning, not "'"

-- 
Bang bang

  reply	other threads:[~2014-10-23 10:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-21 12:04 org-class and headers Joseph Le Roux
2014-10-21 12:57 ` Rasmus
2014-10-21 14:47   ` Joseph Le Roux
2014-10-21 20:15     ` Rasmus
2014-10-22 14:30     ` Eric S Fraga
2014-10-22 20:34       ` Joseph Le Roux
2014-10-23 10:10         ` Rasmus [this message]
2014-10-23 18:20           ` Joseph Le Roux

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=87y4s79jwe.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --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).