Re: [O] Advance notice of birthdays in org-mode via org-contacts

2019-05-27 Thread Eric Abrahamsen
Nick Dokos  writes:

> Daryl Manning  writes:
>
>> I'm trying to come up with a better way to give myself advanced
>> notice on some peoples' birthdays coming up. 

And (shameless plug) if you're using EBDB, you can set both
`ebdb-use-diary' and `org-agenda-include-diary' to t, and anniversaries
will show in the agenda.




Re: [O] suppress leading ":" in org-babel output

2019-05-27 Thread Nick Dokos
Jeremie Juste  writes:

> Hello,
>
> I recall seeing this thread on the mailing list but I cannot find it
> back.
>
> I would like to suppress the first line leading ":" in the following output
>
>
> #+NAME:mean_purchase_per_shopping_trip
>
> #+BEGIN_SRC R :var x=6 :results output :session *R*
> a <-sprintf("%.2f",12.234324)
> cat(a,sep="\n")
> #+END_SRC
>
> #+RESULTS: mean_purchase_per_shopping_trip
> : 
>
> : 12.23
>

FWIW, I just get the last line:

#+NAME:mean_purchase_per_shopping_trip

#+BEGIN_SRC R :var x=6 :results output :session *R*
a <-sprintf("%.2f",12.234324)
cat(a,sep="\n")
#+END_SRC

#+RESULTS:
: 12.23

This is with 

   GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32) of 
2019-05-01
   Org mode version 9.2.3 (release_9.2.3-367-gd79e80 @ 
/home/nick/elisp/org-mode/lisp/)
   R version 3.5.3 (2019-03-11) -- "Great Truth"

on Fedora 29.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] Advance notice of birthdays in org-mode via org-contacts

2019-05-27 Thread Nick Dokos
Daryl Manning  writes:

> I'm trying to come up with a better way to give myself advanced notice on 
> some peoples' birthdays coming up. 
>
> Right now, I use the following in a `cal.org` file to give me notice in 
> agenda that birthdays are coming up:
>
> ```
> * BDays                                                                       
>   :bday:
> %%(org-contacts-anniversaries "BIRTHDAY")
> ```
>
> The generally feeds off a `contacts.org` entry of the nature:
>
> ```
> *** John Wick                                                  
> :PROPERTIES:
> :EMAIL: therealj...@notthepuppy.com
> :BIRTHDAY: 1975-06-06
> :END:
> ```
>
> What I'd like is to get, on virtually all birthdays , a week's notice through 
> due soon (which I'll sort out in org-super-agenda in the view). 
> Alternatively, is there a nicer way to tag or
> otherwise note some birthdays in the `contacts.org` so that I could note 
> special people (close friends, family, etc) where I could set a specific 
> advanced notice period so that I have time
> to do something special for them etc?
>
> Would love to hear peoples' approaches to this. In general, if I'm not 
> looking out 2 weeks ahead (I spend most time in the day view), I can get 
> surprised.
>

I use bbdb, not org-contacts, and I have this in one of my agenda files:

* Anniversaries
   :PROPERTIES:
   :CATEGORY: Anniv
   :ID:   409062f6-6cb1-467f-b192-2dfcb7b384ca
   :END:
%%(org-bbdb-anniversaries-future)

That gives me the default 7 days of warning, but you can pass an
argument to it to specify the number of days of warning.

The function is fairly generic, so it should be possible to adapt it
to org-contacts with some modifications.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] Show APPTs every day in Agneda

2019-05-27 Thread Michael Heerdegen
Neil Jerram  writes:

> Hi Michael,

Hi Neil!

> I'm not in front of my computer, to check this, but I think that an
> active date range will have this effect, i.e.
>
> ** Vacation
> --

Hmm, no, AFAICT that's what I used to do, and it only shows the
appointment at start and end date, not between the two dates.  That's
with C-c a a btw.  I wonder why it seems to work for you...

Michael.



Re: [O] Temporarily setting agenda files list, cleaning up

2019-05-27 Thread Thomas Plass


Christoph Groth wrote at 14:04 on May 27, 2019:

: Instead, I imagine a custom Emacs command to launch an agenda with
: org-agenda-files that is temporarily set to a list of files that depends
: on the current context.  For starters, this list could contain all the
: org files under the current directory:

This will use a private set of 'org-agenda-files and kill their
buffers after executing `org-agenda-list':

(defun Groth/agenda-list ( dir)
  (interactive)
  (let* ((project-dir (or dir default-directory))
 (org-agenda-files (directory-files-recursively project-dir "\\.org$"))
 tmp-agenda-buffer)
(unwind-protect
;; FIXME: set org-agenda-list args as necessary:  ARG 
START-DAY SPAN WITH-HOUR) 
(org-agenda-list)
  (mapc
   (lambda (f)
 (and (setq tmp-agenda-buffer (find-buffer-visiting f))
  (kill-buffer tmp-agenda-buffer)))
   org-agenda-files

Call it like this:

  M-x Groth/agenda-list

or eval 

  (Groth/agenda-list "/path/to/dir")

I just whipped this up and it might need improvements such as optional
prompting for a search directory and a set of arguments to
`org-agenda-list' that fit your needs (refer to its docstring).  Note
that buffers for files on the old value of 'org-agenda-files that are
already open will be killed, too.

Regards

Thomas




Re: [O] Advance notice of birthdays in org-mode via org-contacts

2019-05-27 Thread Marcin Borkowski


On 2019-05-27, at 13:25, Neil Jerram  wrote:

> On Sun, 26 May 2019, 16:12 Daryl Manning,  wrote:
>
>> I'm trying to come up with a better way to give myself advanced notice on
>> some peoples' birthdays coming up.
>>
>> Right now, I use the following in a `cal.org` file to give me notice in
>> agenda that birthdays are coming up:
>>
>> ```
>> * BDays
>>   :bday:
>> %%(org-contacts-anniversaries "BIRTHDAY")
>> ```
>>
>> The generally feeds off a `contacts.org` entry of the nature:
>>
>> ```
>> *** John Wick
>> :PROPERTIES:
>> :EMAIL: therealj...@notthepuppy.com
>> :BIRTHDAY: 1975-06-06
>> :END:
>> ```
>>
>> What I'd like is to get, on virtually all birthdays , a week's notice
>> through due soon (which I'll sort out in org-super-agenda in the view).
>> Alternatively, is there a nicer way to tag or otherwise note some birthdays
>> in the `contacts.org` so that I could note special people (close friends,
>> family, etc) where I could set a specific advanced notice period so that I
>> have time to do something special for them etc?
>>
>> Would love to hear peoples' approaches to this. In general, if I'm not
>> looking out 2 weeks ahead (I spend most time in the day view), I can get
>> surprised.
>>
>> thanks!
>> Daryl.
>>
>
> Hi Daryl,
>
> I have a TODO item for each of my family's birthdays, with a deadline for
> the birthday day and a repeater of +1y. Then Org Agenda automatically gives
> me about two weeks' notice of that approaching.
>
> There's no integration here with another contacts system, but I find that
> this works well for me.

Almost same here, only that I don't mark those "TODO", but just make
a headline with an (active) timestamp.

Hth,

-- 
Marcin Borkowski
http://mbork.pl



[O] Problems with inline source blocks

2019-05-27 Thread Christian Heinrich
Hi everyone,

several issues with inline source blocks:

1) https://orgmode.org/manual/Exporting-code-blocks.html states:

> The :exports header arguments control exporting code blocks only and
> not inline code:

but 
https://orgmode.org/manual/Using-Header-Arguments.html#Using-Header-Arguments 
gives as example:

> src_haskell[:exports both]{fac 5}

Which one is true?

2) I cannot get the results of inline blocks to be exported.

When I have a file that contains:

> Test: src_R[:exports results]{4*4} {{{results(=16=)}}}

then the code is always exported but the results are only exported up to
623cc4625950f84442d4cde0faa9cc3ea0233283

but starting from 65ebb128bc380fe4795dedd655d6f7b685249842
the results macro is ignored and the result never appears.

Looking at online documentation (other projects) like 
https://org-babel.readthedocs.io/en/latest/eval/#inline-code-blocks I realize 
that this may be a
problem in general (look at the Example sections, such as "The answer to 2 + 3 
is .")


3) The source block never gets evaluated. I tried 
src_sh{touch /tmp/test21.txt}

but this file doesn't get created, only when I execute it directly.

Can anyone point out what I'm doing wrong, or is this actually a bug? I can't 
even get a basic
source block like

#+begin_src R :results output :session *R* :exports none
5*5
#+end_src

to ignore the code when exporting (but it's not evaluated).


Thanks!
Christian


signature.asc
Description: This is a digitally signed message part


Re: [O] Temporarily setting agenda files list, cleaning up

2019-05-27 Thread John Kitchin
For running code that should close all buffers that were opened, I use a
macro like this:

(defmacro with-no-new-buffers ( body)
  "Run BODY, and kill any new buffers created.
Returns whatever BODY would return."
  (let ((current-buffers (buffer-list)))
`(prog1
(progn
  ,@body)
   (mapc (lambda (buf)
  (unless (-contains? ',current-buffers buf)
(kill-buffer buf)))
(buffer-list)

For the other kinds of things you listed, check out
https://github.com/jkitchin/scimax/blob/master/scimax-notebook.org,
especially the nb-agenda function. It is more than you want, you can choose
a project, and then get an agenda for the org-files in that project.

Another example is at
https://github.com/jkitchin/scimax/blob/master/scimax-journal.el#L284 where
I get an agenda for journal entries in a date range. You can use this idea
generally, you let-bind the org-agenda-files variable to be the list you
want, and then call org-agenda.

These are a work in progress, but I use them pretty often.

You can restrict the agenda to a file, and even select search with
something like this:

(org-agenda nil "s" "<")




John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Mon, May 27, 2019 at 8:11 AM Christoph Groth 
wrote:

> Hello,
>
> I would like to expand my use of Org for notes, and to this end spread
> project-specific org files across my home directory (currently I'm using
> a central directory with one agenda file per year).  For obvious
> reasons, I can't possibly include all these org files in
> org-agenda-files permanently and have them open in Emacs all the time.
>
> Instead, I'm thinking of a setup as follows: I'll reserve
> org-agenda-files for active projects only.  But there will be many other
> org files (for projects that are finished or dormant, general notes,
> etc.), that I would like to be able to search as well.
>
> I saw that some people have solved this problem with a custom search
> solution, even using a database [1], but I think that for my purposes a
> simpler solution mostly using Org's built-in functionality will do.  I'm
> also aware of org-agenda-text-search-extra-files, keeping all my extra
> files there is not satisfactory, because the search possibilities are
> limited (and otherwise it poses the same questions that I will ask
> further below).
>
> Instead, I imagine a custom Emacs command to launch an agenda with
> org-agenda-files that is temporarily set to a list of files that depends
> on the current context.  For starters, this list could contain all the
> org files under the current directory:
>
> (split-string (shell-command-to-string "find `pwd`/* -name '*.org' -type
> f") "\n" t)
>
> This way, I could easily explore the org files that belong to specific
> subsets of my activities and interests.  I could also search *all* my
> notes, when needed (for now the time this takes should not be a
> problem).
>
> I wonder if anyone has tried a similar setup and would be willing to
> share his experience and ideas.  Specifically, I wonder about the
> following points:
>
> * Do you see any obvious problems with the above idea?
>
> * In Elisp, what is the best way to temporarily set org-agenda-files and
>   later reset it back to the standard value?
>
> * How to automatically close unneeded org buffers that were opened for
>   the temporarily agenda?  The command org-agenda-exit is not
>   satisfactory, because it also kills the buffers that one has just
>   found due to the search, and also it's not automatic.  Perhaps one
>   could close the buffers immediately once the agenda view has been
>   created?
>
> Thanks
> Christoph
>
> [1]
> https://kitchingroup.cheme.cmu.edu/blog/2017/01/03/Find-stuff-in-org-mode-anywhere/
>


[O] Temporarily setting agenda files list, cleaning up

2019-05-27 Thread Christoph Groth
Hello,

I would like to expand my use of Org for notes, and to this end spread
project-specific org files across my home directory (currently I'm using
a central directory with one agenda file per year).  For obvious
reasons, I can't possibly include all these org files in
org-agenda-files permanently and have them open in Emacs all the time.

Instead, I'm thinking of a setup as follows: I'll reserve
org-agenda-files for active projects only.  But there will be many other
org files (for projects that are finished or dormant, general notes,
etc.), that I would like to be able to search as well.

I saw that some people have solved this problem with a custom search
solution, even using a database [1], but I think that for my purposes a
simpler solution mostly using Org's built-in functionality will do.  I'm
also aware of org-agenda-text-search-extra-files, keeping all my extra
files there is not satisfactory, because the search possibilities are
limited (and otherwise it poses the same questions that I will ask
further below).

Instead, I imagine a custom Emacs command to launch an agenda with
org-agenda-files that is temporarily set to a list of files that depends
on the current context.  For starters, this list could contain all the
org files under the current directory:

(split-string (shell-command-to-string "find `pwd`/* -name '*.org' -type f") 
"\n" t)

This way, I could easily explore the org files that belong to specific
subsets of my activities and interests.  I could also search *all* my
notes, when needed (for now the time this takes should not be a
problem).

I wonder if anyone has tried a similar setup and would be willing to
share his experience and ideas.  Specifically, I wonder about the
following points:

* Do you see any obvious problems with the above idea?

* In Elisp, what is the best way to temporarily set org-agenda-files and
  later reset it back to the standard value?

* How to automatically close unneeded org buffers that were opened for
  the temporarily agenda?  The command org-agenda-exit is not
  satisfactory, because it also kills the buffers that one has just
  found due to the search, and also it's not automatic.  Perhaps one
  could close the buffers immediately once the agenda view has been
  created?

Thanks
Christoph

[1] 
https://kitchingroup.cheme.cmu.edu/blog/2017/01/03/Find-stuff-in-org-mode-anywhere/


signature.asc
Description: PGP signature


Re: [O] Show APPTs every day in Agneda

2019-05-27 Thread Neil Jerram
On Sun, 26 May 2019, 18:38 Michael Heerdegen, 
wrote:

> Hi,
>
> I've APPTs like "Vacation" that last 14 days or so.  Is there an
> option/way to show such an APPT for every concerned day, and not only
> for the border days, so that when I for example want to make a doctor's
> appointment I see for the respective day that I'm on vacation on that
> day?
>
> TIA,
>
> Michael.
>

Hi Michael,

I'm not in front of my computer, to check this, but I think that an active
date range will have this effect, i.e.

** Vacation
--

You can use C-c . to enter and edit the dates.

Best wishes,
 Neil


Re: [O] Advance notice of birthdays in org-mode via org-contacts

2019-05-27 Thread Neil Jerram
On Sun, 26 May 2019, 16:12 Daryl Manning,  wrote:

> I'm trying to come up with a better way to give myself advanced notice on
> some peoples' birthdays coming up.
>
> Right now, I use the following in a `cal.org` file to give me notice in
> agenda that birthdays are coming up:
>
> ```
> * BDays
>   :bday:
> %%(org-contacts-anniversaries "BIRTHDAY")
> ```
>
> The generally feeds off a `contacts.org` entry of the nature:
>
> ```
> *** John Wick
> :PROPERTIES:
> :EMAIL: therealj...@notthepuppy.com
> :BIRTHDAY: 1975-06-06
> :END:
> ```
>
> What I'd like is to get, on virtually all birthdays , a week's notice
> through due soon (which I'll sort out in org-super-agenda in the view).
> Alternatively, is there a nicer way to tag or otherwise note some birthdays
> in the `contacts.org` so that I could note special people (close friends,
> family, etc) where I could set a specific advanced notice period so that I
> have time to do something special for them etc?
>
> Would love to hear peoples' approaches to this. In general, if I'm not
> looking out 2 weeks ahead (I spend most time in the day view), I can get
> surprised.
>
> thanks!
> Daryl.
>

Hi Daryl,

I have a TODO item for each of my family's birthdays, with a deadline for
the birthday day and a repeater of +1y. Then Org Agenda automatically gives
me about two weeks' notice of that approaching.

There's no integration here with another contacts system, but I find that
this works well for me.

Best wishes,
Neil


[O] suppress leading ":" in org-babel output

2019-05-27 Thread Jeremie Juste
Hello,

I recall seeing this thread on the mailing list but I cannot find it
back.

I would like to suppress the first line leading ":" in the following output


#+NAME:mean_purchase_per_shopping_trip
#+BEGIN_SRC R :var x=6 :results output :session *R*
a <-sprintf("%.2f",12.234324)
cat(a,sep="\n")
#+END_SRC

#+RESULTS: mean_purchase_per_shopping_trip
: 
: 12.23


Best regards,
Jeremie

Org mode version 9.2.1 (9.2.1-8-g1b1797-elpaplus @
/home/djj/.emacs.d/elpa/org-plus-contrib-20190211/)
GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 
2019-05-16