[O] function to duplicate current header and change ID

2016-08-02 Thread Xebar Saram
Hi all

i noticed i use the copy and then paste entire headers (with content) quite
often. the problem i also notice is that creates alot of issues with
duplicate IDS. I wonder if anyone has a function he would like to share or
can help me create a function that will
1. copy current header and contents (org-copy-subtree) at point
2. auto paste it below current header
3. change ID

thx alot!

Z


Re: [O] Best practice for canceled/moved recurring events

2016-08-02 Thread Christoph LANGE
SabreWolfy on 2016-07-22 15:29:
> I have a meeting at 09:00 every Monday:
>
> --8<---cut here---start->8---
> * Diary
> ** TODO Weekly Meeting
>DEADLINE: <2016-07-18 Mon 09:00 +1w>
> --8<---cut here---end--->8---
>
> What is the best way of dealing with scenarios where (1) the meeting "next
> week" is on the Wednesday and (2) the meeting "two weeks" after that (or
> whatever) is canceled?

If you need this to be a TODO, then I can't answer your question.
However, for non-TODO entries like this …

* Meeting
  <2016-07-18 Mon 09:00>
  <2016-07-25 Mon 09:00>
  ...

I often use Lisp functions that work on dates.  Essentially, you convert
the entry to

* Meeting 09:00
  <%% SEXP >

or

* Meeting 09:00-10:00
  <%% SEXP >

When SEXP evaluates to true for a given day, the entry shows up on the
agenda for that day.  The basics of this are documented at
http://orgmode.org/manual/Timestamps.html.

Here are some examples from my diary.  Note that I'm using

(setq calendar-date-style 'iso)

<%%(org-class 2016 02 17 2016 04 30 3 8 12 14 16 18 20)>

Every Wednesday (3rd day of the week, starting with 0 = Sunday) in the
given date range, except ISO calendar weeks 12, 14, etc.

<%%(and (not (diary-block 2016 07 22 2016 08 31)) (org-class 2016 01 07
2016 12 31 4 1 3 5 7 9 11 13 15 17 18 20 21 22 24 26 27 28 30 32 34 36
38 40 42 44 46 48 50 52))>

Like above, but not if the date is between 2016-07-22 and 2016-08-31.

<%%(and (diary-float t 5 1) (diary-block 2016 03 01 2018 12 31) (not
(diary-date 2016 06 03)))>

First (1) Friday (day 5) of every month (t) in the given range
(diary-block), but not on 2016-06-03.

Hope this helps,

Christoph

-- 
Dr. Christoph Lange, Enterprise Information Systems Department
Applied Computer Science @ University of Bonn; Fraunhofer IAIS
http://langec.wordpress.com/about, Skype duke4701

→ Please note: I will be on parental leave from 29 July to 28 October.
  Colleagues will stand in for me by project.



[O] Marking an item DONE using the most recently logged timestamp

2016-08-02 Thread Christoph LANGE
Dear Org-mode community,

as an extension to
https://lists.gnu.org/archive/html/emacs-orgmode/2016-07/msg00183.html
(Useful interactive functions for clock logs […]) I implemented another
function you may find useful:

org-todo-mark-done-from-log
https://github.com/clange/emacs/blob/master/.emacs.d/init/org-clock.el#L18
(stable link to current revision:
https://github.com/clange/emacs/blob/d6356d9b90bf02108bfbe226d06911ab4a8bb430/.emacs.d/init/org-clock.el#L18)

This function marks the current item done.  Instead of the current time,
it reports the most recent time logged (clocked) for this item as
closing time.

Use case: you finished a TODO task and logged time on it but forgot to
mark it DONE.

Cheers,

Christoph

-- 
Dr. Christoph Lange, Enterprise Information Systems Department
Applied Computer Science @ University of Bonn; Fraunhofer IAIS
http://langec.wordpress.com/about, Skype duke4701

→ Please note: I will be on parental leave from 29 July to 28 October.
  Colleagues will stand in for me by project.



Re: [O] mobileorg agendas.org has no entries [8.3.4 (8.3.4-elpa @ c:/Users/Michael/AppData/Roaming/.emacs.d/elpa/org-20160222/)]

2016-08-02 Thread Michael Ziems

Hello Nicolas,

the result is:

Result: (("C:\\Users\\Michael\\Documents\\org\\work.org" . "work.org") 
("C:\\Users\\Michael\\Documents\\org\\dienst.org" . "dienst.org") 
("C:\\Users\\Michael\\Documents\\org\\info-work.org" . "info-work.org") 
("C:\\Users\\Michael\\Documents\\org\\info-privat.org" . 
"info-privat.org") ("C:\\Users\\Michael\\Documents\\org\\privat.org" . 
"privat.org"))


Which looks correct.

My setup is:
(setq org-mobile-directory 
"C:\\Users\\Michael\\Documents\\org\\MobileOrg\\")
(setq org-mobile-inbox-for-pull 
"C:\\Users\\Michael\\Documents\\org\\MobileOrg\\inbox.org")


(defcustom org-mobile-checksum-binary (or
 (executable-find 
"C:\\Users\\Michael\\Documents\\md5sum.exe")

 )
 "Executable used for computing checksums of agenda files."
 :group 'org-mobile
 :type 'string)

The agendas.org output looks like this (example for one agenda:

* 80 days-agenda (W31-W42):KEYS=x TITLE: Nur Kalender ohne 
Aufgaben

** Dienstag2 August 2016
** Mittwoch3 August 2016
** Donnerstag  4 August 2016
** Freitag 5 August 2016
** Samstag 6 August 2016
** Sonntag 7 August 2016
** Montag  8 August 2016 W32
** Dienstag9 August 2016
** Mittwoch   10 August 2016
** Donnerstag 11 August 2016
** Freitag12 August 2016
** Samstag13 August 2016
** Sonntag14 August 2016
** Montag 15 August 2016 W33
** Dienstag   16 August 2016
** Mittwoch   17 August 2016
** Donnerstag 18 August 2016
** Freitag19 August 2016
** Samstag20 August 2016
** Sonntag21 August 2016
** Montag 22 August 2016 W34
** Dienstag   23 August 2016
** Mittwoch   24 August 2016
** Donnerstag 25 August 2016
** Freitag26 August 2016
** Samstag27 August 2016
** Sonntag28 August 2016
** Montag 29 August 2016 W35
** Dienstag   30 August 2016
** Mittwoch   31 August 2016
** Donnerstag  1 September 2016
** Freitag 2 September 2016
** Samstag 3 September 2016
** Sonntag 4 September 2016
** Montag  5 September 2016 W36
  Diary:  Labor Day
** Dienstag6 September 2016
** Mittwoch7 September 2016
** Donnerstag  8 September 2016
** Freitag 9 September 2016
** Samstag10 September 2016
** Sonntag11 September 2016
** Montag 12 September 2016 W37
** Dienstag   13 September 2016
** Mittwoch   14 September 2016
** Donnerstag 15 September 2016
** Freitag16 September 2016
** Samstag17 September 2016
** Sonntag18 September 2016
** Montag 19 September 2016 W38
** Dienstag   20 September 2016
** Mittwoch   21 September 2016
** Donnerstag 22 September 2016
  Diary:  16:20.. Autumnal Equinox (Mitteleuropäische Sommerzeit)
** Freitag23 September 2016
** Samstag24 September 2016
** Sonntag25 September 2016
** Montag 26 September 2016 W39
** Dienstag   27 September 2016
** Mittwoch   28 September 2016
** Donnerstag 29 September 2016
** Freitag30 September 2016
** Samstag 1 Oktober 2016
** Sonntag 2 Oktober 2016
** Montag  3 Oktober 2016 W40
  Diary:  Islamic New Year 1438
  Diary:  Rosh HaShanah 5777
** Dienstag4 Oktober 2016
** Mittwoch5 Oktober 2016
** Donnerstag  6 Oktober 2016
** Freitag 7 Oktober 2016
** Samstag 8 Oktober 2016
** Sonntag 9 Oktober 2016
** Montag 10 Oktober 2016 W41
  Diary:  Columbus Day
** Dienstag   11 Oktober 2016
** Mittwoch   12 Oktober 2016
  Diary:  Yom Kippur
** Donnerstag 13 Oktober 2016
** Freitag14 Oktober 2016
** Samstag15 Oktober 2016
** Sonntag16 Oktober 2016
** Montag 17 Oktober 2016 W42
  Diary:  Sukkot
** Dienstag   18 Oktober 2016
** Mittwoch   19 Oktober 2016
** Donnerstag 20 Oktober 2016
  Diary:  Birth of the Báb

Whereas the normal output in emacs is having a lot of my headlines with 
dates in there.


I will continue to understand edebug and try to check, what is wrong.

Do you have any idea, what i might be missing?

Thanks,

Michael

Am 25.07.2016 um 14:03 schrieb Nicolas Goaziou:

Hello,

Michael Ziems  writes:


Hello Philip,

thanks for the answer, but that did not help me, i believe.
I went trough the org-mobile-push with the edebug, but i believe that
i have to understand how another function that is in there works,
maybe these:

 (let ((inhibit-redisplay t)
   (org-agenda-files (mapcar 'car org-mobile-files-alist)))
   (org-mobile-create-sumo-agenda))

and i cannot start the debugger in the same way on them, as they are
not startable via M-x.


Does anybody have a clue, what could be the reason, why my agenda is
normally created but the agendas.org is containing all my agenda view
but without any headline (todo) in it?

What is the return value for `org-mobile-files-alist'?

What is your setup related to "org-mobile"?


Regards,






smime.p7s
Description: S/MIME Cryptographic Signature


Re: [O] Can one tangle only the current blocks under header ?

2016-08-02 Thread Joon Ro



> Joon: thx this is great. 
You're welcome. 
> one last question. suppose i have multiple code blocks under  header like 
> this:> >  main i3 conf>  :PROPERTIES:>  :ID:   
> f17b5518-2695-4484-a958-2fc7b8aa2479>  :tangle:   
> /home/zeltak/.i3/config>  :END:>> > > is there a way to issue a 
> tangle just for all below the header blocks?
Again if you read the help: 
When two universal prefix arguments, only tangle blocks for the tangle file 
of the block at point.
So if you give two universal prefix arguments and issue org-babel-tangle while 
you are at a code block with the tangle file /home/zeltak/.i3/config, it will 
only tangle code blocks with that particular code block. I think that is what 
you want. I'm sure you can modify the code I showed you to implement this.
Another way to do this is just `org-narrow-to-subtree` to narrow down to that 
subtree and and then just tangle the whole thing.
-Joon



On Sun, Jul 31, 2016 at 5:34 PM, Grant Rettke  wrote:
You can `:tangle no' on the source block to exclude it from tangling.



You can even tangle one source block to a different or as many files

as you like during tangling.

Sincerely,



Grant Rettke





On Sat, Jul 30, 2016 at 1:38 PM, Joon Ro  wrote:

> can one tangle only the current blocks under header or  can you only tangle

> the whole file?

> the issue is again for dotfiles managed by org that these files are not

> proper org babel languages and look like this:

>

> #+BEGIN_SRC conf :mkdirp yes :tangle ~/.config/mpv/mpv.conf

> softvol-max=600

> #+END_SRC

>

> the manual (http://orgmode.org/manual/Extracting-source-code.html) only

> shows how to tangle the whole file

>

> any ideas?

>

>

> If you read the help for org-babel-tangle:

>

> With one universal prefix argument, only tangle the block at point.

> When two universal prefix arguments, only tangle blocks for the

> tangle file of the block at point.

>

>

> So if you do c-u first before org-babel-tangle, it will only tangle the code

> block at point.

> I use this a lot so I have the following in my init file:

>

> (defun org-babel-tangle-block()

>   (interactive)

>   (let ((current-prefix-arg '(4)))

>  (call-interactively 'org-babel-tangle)))

>

> (eval-after-load "org"

>   '(progn

>  (define-key org-mode-map (kbd "C-c b") 'org-babel-tangle-block)))

>

>

> So I can just do C-c b and it will just tangle the code block at point.

>

> And I agree with you I with the manual

> (http://orgmode.org/manual/Extracting-source-code.html) has this

> information.

>

> Hope this helps,

> Joon

>



  

Re: [O] Can one tangle only the current blocks under header ?

2016-08-02 Thread Xebar Saram
thx so much

Joon: thx this is great. one last question. suppose i have multiple code
blocks under  header like this:

 main i3 conf
 :PROPERTIES:
 :ID:   f17b5518-2695-4484-a958-2fc7b8aa2479
 :tangle:   /home/zeltak/.i3/config
 :END:



is there a way to issue a tangle just for all below the header blocks?

best

Z

On Sun, Jul 31, 2016 at 5:34 PM, Grant Rettke 
wrote:

> You can `:tangle no' on the source block to exclude it from tangling.
>
> You can even tangle one source block to a different or as many files
> as you like during tangling.
> Sincerely,
>
> Grant Rettke
>
>
> On Sat, Jul 30, 2016 at 1:38 PM, Joon Ro  wrote:
> > can one tangle only the current blocks under header or  can you only
> tangle
> > the whole file?
> > the issue is again for dotfiles managed by org that these files are not
> > proper org babel languages and look like this:
> >
> > #+BEGIN_SRC conf :mkdirp yes :tangle ~/.config/mpv/mpv.conf
> > softvol-max=600
> > #+END_SRC
> >
> > the manual (http://orgmode.org/manual/Extracting-source-code.html) only
> > shows how to tangle the whole file
> >
> > any ideas?
> >
> >
> > If you read the help for org-babel-tangle:
> >
> > With one universal prefix argument, only tangle the block at point.
> > When two universal prefix arguments, only tangle blocks for the
> > tangle file of the block at point.
> >
> >
> > So if you do c-u first before org-babel-tangle, it will only tangle the
> code
> > block at point.
> > I use this a lot so I have the following in my init file:
> >
> > (defun org-babel-tangle-block()
> >   (interactive)
> >   (let ((current-prefix-arg '(4)))
> >  (call-interactively 'org-babel-tangle)))
> >
> > (eval-after-load "org"
> >   '(progn
> >  (define-key org-mode-map (kbd "C-c b") 'org-babel-tangle-block)))
> >
> >
> > So I can just do C-c b and it will just tangle the code block at point.
> >
> > And I agree with you I with the manual
> > (http://orgmode.org/manual/Extracting-source-code.html) has this
> > information.
> >
> > Hope this helps,
> > Joon
> >
>


Re: [O] [ANN] thi.ng/org-spec template for tech specs & HTML export theme

2016-08-02 Thread Adam Porter
That looks really nice, thanks for sharing.  The automatic changelog
from last git tag is nifty.