Re: [O] Tasks performed on a certain day

2018-11-07 Thread Samuel Wales
i also call them event.

i have code below that shows them in agenda as "Event:" in their own face.

i think there was a proposal a while back to have them be in the
planning line [the one just after the header] as EVENT: <...> along
with closed, scheduled, and deadline.  i kinda liked that proposal
[great for 3rd party tools, maybe even a bit faster, consistency] but
it never went anywhere.  :]

===

note: i am not signed up with fsf.

commit 33a49662f7b89e9fd52742a59542dfb0f116e715 (HEAD, refs/heads/local)
Author: Your Name 
Date:   2015-08-08 13:10:12 -0700

=== alpha add one space to leaders, add Event:, format state better

Modified   lisp/org-agenda.el
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 234c0da..268aa00 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5593,7 +5593,10 @@ displayed in agenda view."
   (habit? (and (fboundp 'org-is-habit-p) (org-is-habit-p)))
   (item
(org-agenda-format-item
-(and inactive? org-agenda-inactive-leader)
+ (if inactive?
+ org-agenda-inactive-leader
+   ;; alpha this could be an org-agenda-event-leader
+   "Event: ")
 head level category tags time-stamp org-ts-regexp habit?)))
  (org-add-props item props
'priority (if habit?
@@ -5609,7 +5612,7 @@ displayed in agenda view."
'warntime warntime
 ;; =alpha this adds inactive timestamp face
 ;; how i figured this out, i do not know
-'face (if inactivep
+'face (if inactive?
   'org-agenda-inactive
 'org-agenda-calendar-event)
'type "timestamp")
@@ -5814,9 +5817,16 @@ then those holidays will be skipped."
(setq txt (concat txt " - " extra
(setq txt (org-agenda-format-item
   (cond
-   (closedp "Closed:")
-   (statep (concat "State: (" state ")"))
-   (t (concat "Clocked:   (" clocked  ")")))
+ (closedp "Closed:")
+ ;; alpha the only issue here is somehow
+ ;; we have to turn off my inactive,
+ ;; which picks this up redundantly
+ (statep (format "S(%7.7s) " state))
+ ;; ;; alpha adding one space because line up
+ ;; (statep (concat "State:  (" state ")"))
+ ;; (t (format "C(%7.7s) " clocked)))
+ ;; alpha adding one space because line up
+ (t (concat "Clocked:(" clocked  ")")))
   txt level category tags timestr)))
  (setq priority 10)
  (org-add-props txt props

[back]



Re: [O] [BUG][ODT] ODT_STYLES_FILE not read as a list

2018-11-07 Thread L.C. Karssen
Thanks for digging into this Christian.

My lisp skills are quite undeveloped, so I can't really comment on the
code. I had a look at the manual and I think we should go for a solution
that is consistent for #+ keywords that have a filename argument like
#+INCLUDE:, #+SETUPFILE and #+TEXINFO_FILENAME.

Taking the risk that the manual is lagging behind the actual code, I see
the following:

#+ODT_STYLES_FILE:uses quotes
#+INCLUDE:uses quotes
#+TEXINFO_FILENAME:   doesn't use quotes [1]
#+SETUPFILE:  no example in the manual
#+HTML_INCLUDE_STYLE: no example in the manual, not sure if this
requires a file or CSS code

Another point to consider: would requiring quoted filenames make life
easier for people using spaces etc. in their filenames? In that case I'd
vote for quotes.


Best,

Lennart.

[1] https://orgmode.org/org.html#A-Texinfo-example

On 07-11-18 09:28, Christian Moe wrote:
> 
> Nicolas, Lennart, cc: Charles Celerier,
> 
> Below, Lennart points out another issue with ODT_STYLES_FILE, a silent
> change in syntax not reflected in the manual: quotation marks are no
> longer needed around simple file paths.
> 
> I think this change was introduced by the below commit, which stopped
> reading the string as a Lisp expression, and therefore at the same time
> broke the option of providing a list for #+ODT_STYLES_FILE. My patch
> last week fixed the list problem, but left the other change
> intact. (Sorry for not doing the research.)
> 
> We could either update the manual and announce the syntax change, or
> revert ox-odt-template to before the below patch to bring the code back
> in conformity with the manual. I don't have a strong opinion one way or
> the other. I like the change (never liked those quotation marks), but
> it's backwards-incompatible, and the old code looks cleaner than my fix.
> 
> Yours,
> Christian
> 
> 
> commit 30498ef932bc35c26e3e58278f4987a67480b446
> Author: Charles Celerier 
> Date:   Sat Jul 28 17:09:16 2018 -0400
> 
> ox-odt: Fix `org-odt-template' styles file retrieval
> 
> * lisp/ox-odt.el (org-odt-template): Fix `org-odt-template' styles
>   file retrieval.
> 
> TINYCHANGE
> 
> Signed-off-by: Charles Celerier 
> 
> diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
> index a1145a9..74d811d 100644
> --- a/lisp/ox-odt.el
> +++ b/lisp/ox-odt.el
> @@ -1359,11 +1359,10 @@ original parsed data.  INFO is a plist holding export 
> options."
>;; Write styles file.
>(let* ((styles-file (plist-get info :odt-styles-file))
>  (styles-file (and (org-string-nw-p styles-file)
> -  (read (org-trim styles-file
> +  (org-trim styles-file)))
>  ;; Non-availability of styles.xml is not a critical
>  ;; error. For now, throw an error.
>  (styles-file (or styles-file
> - (plist-get info :odt-styles-file)
>   (expand-file-name "OrgOdtStyles.xml"
> org-odt-styles-dir)
>   (error "org-odt: Missing styles file?"
> 
> 
> 
> 
> L.C. Karssen writes:
> 
>> On 06-11-18 16:35, Christian Moe wrote:
>>>
>>> I believe the need to use quotation marks around the style file name was
>>> removed at some point
>>
>> I didn't know that. I had a quick look at the changes to ox-odt.el for
>> the last few months, but it doesn't seem to be mentioned in any of the
>> commit messages. Or was this a more global change?
>>
>> Does this also count for the regular #+INCLUDE: statement? I just tested
>> it and for #+INCLUDE: it seems to work both with and without quotes
>> (although the manual uses quotes).
>>
>>
>> Best,
>>
>> Lennart.
>>
>>> , and the manual is out of date. Instead of
>>>
>>>  #+ODT_STYLES_FILE: "template.ott"
>>>
>>> the manual ought now to read:
>>>
>>>  #+ODT_STYLES_FILE: template.ott
>>>
>>> Yours,
>>> Christian
>>>
>>> L.C. Karssen writes:
>>>
 Hi list,

 Not sure if this is related (or fixed with the aforementioned patch)
 because I'm not using a list for the ODT style file.

 Today, after upgrading from Org 9.1.13 (actually installed from melpa on
 20180625) to melpa version 20181105 exporting to ODT stopped working. In
 my org file the style file name was enclosed in double quotes (as
 specified in the manual [1]):

 #+ODT_STYLES_FILE: "template.ott"

 The error message is:

 OpenDocument export failed: Invalid specification of styles.xml file:
 "\"template.ott\""

 Removing the quotes fixes the export to ODT.


 Best regards,

 Lennart.

 [1] https://orgmode.org/org.html#Applying-custom-styles


 On 05-11-18 09:49, Christian Moe wrote:
>
> Thanks, Nicolas!
>
> I'll test on my end when it shows up in ELPA.
>
> Yours,
> Christian
>
> Nicolas Goaziou writes:
>
>> Hello,
>>
>> Christian Moe  writes:

[O] Solar orbit statistics and your agenda

2018-11-07 Thread Eric S Fraga
Time for a very geeky post...

Recently, on the remind (diary tool I used to use) mailing list,
somebody posted a script for converting solar data (perihelion, equinox,
...) to remind input.  I've done the same for org so if you're
interested in that kind of information and want your agenda to show
this, here is the script:

#+begin_src shell :results output raw
  tmpfile=$(mktemp /tmp/date.XX)
  for year in $(seq 2018 2068)
  do
  links http://aa.usno.navy.mil/seasons?year=${year} -dump | \
  grep -E 'helion|quinox|olstice' > ${tmpfile}
  while read -r line
  do
  item=$(echo $line | awk '{print $1}')
  date="$(echo $line | awk '{print $5 " " $4 " " $3}') ${year}"
  isodate=$(date --date="${date}" +"%Y-%m-%d %H:%M")
  echo "** <${isodate}> $item"
  done < ${tmpfile}
  done
  rm ${tmpfile}
#+end_src

Notes:

1. this is for Linux and assumes bash as the shell.
2. the default is UTC (and this is where I wish org supported time
   zones...).
3. I believe the URL for the US Naval Observatory in the code above
   accepts "?tz=N?dst=M" for different time zones (some index N) and
   daylight savings options (M set to 0 or 1 maybe?) but I haven't
   played with these options.
4. you will need to install "links".

Enjoy but use at own risk etc. ;-)

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.11-620-ga548e4



Re: [O] Tasks performed on a certain day

2018-11-07 Thread Marcin Borkowski


On 2018-11-07, at 12:33, Leo Gaspard  wrote:

> Ken Mankoff  writes:
>
>> What about passive date stamps?
>>
>> TODO Thing
>> 
>>
>> ?
>
> That's exactly what I was looking for! I hadn't seen an example with
> TODO coupled with <> dates, and didn't think it'd have a special
> behavior.
>
> Thank you and Marcin for this solution!

Glad to know that they work!

BTW, AFAIR they are called "plain" timestamps.

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [O] Tasks performed on a certain day

2018-11-07 Thread Leo Gaspard
Ken Mankoff  writes:

> What about passive date stamps?
>
> TODO Thing
> 
>
> ?

That's exactly what I was looking for! I hadn't seen an example with
TODO coupled with <> dates, and didn't think it'd have a special
behavior.

Thank you and Marcin for this solution!

Cheers,
  Leo



Re: [O] [BUG][ODT] ODT_STYLES_FILE not read as a list

2018-11-07 Thread Christian Moe


Nicolas, Lennart, cc: Charles Celerier,

Below, Lennart points out another issue with ODT_STYLES_FILE, a silent
change in syntax not reflected in the manual: quotation marks are no
longer needed around simple file paths.

I think this change was introduced by the below commit, which stopped
reading the string as a Lisp expression, and therefore at the same time
broke the option of providing a list for #+ODT_STYLES_FILE. My patch
last week fixed the list problem, but left the other change
intact. (Sorry for not doing the research.)

We could either update the manual and announce the syntax change, or
revert ox-odt-template to before the below patch to bring the code back
in conformity with the manual. I don't have a strong opinion one way or
the other. I like the change (never liked those quotation marks), but
it's backwards-incompatible, and the old code looks cleaner than my fix.

Yours,
Christian


commit 30498ef932bc35c26e3e58278f4987a67480b446
Author: Charles Celerier 
Date:   Sat Jul 28 17:09:16 2018 -0400

ox-odt: Fix `org-odt-template' styles file retrieval

* lisp/ox-odt.el (org-odt-template): Fix `org-odt-template' styles
  file retrieval.

TINYCHANGE

Signed-off-by: Charles Celerier 

diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index a1145a9..74d811d 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -1359,11 +1359,10 @@ original parsed data.  INFO is a plist holding export 
options."
   ;; Write styles file.
   (let* ((styles-file (plist-get info :odt-styles-file))
 (styles-file (and (org-string-nw-p styles-file)
-  (read (org-trim styles-file
+  (org-trim styles-file)))
 ;; Non-availability of styles.xml is not a critical
 ;; error. For now, throw an error.
 (styles-file (or styles-file
- (plist-get info :odt-styles-file)
  (expand-file-name "OrgOdtStyles.xml"
org-odt-styles-dir)
  (error "org-odt: Missing styles file?"




L.C. Karssen writes:

> On 06-11-18 16:35, Christian Moe wrote:
>>
>> I believe the need to use quotation marks around the style file name was
>> removed at some point
>
> I didn't know that. I had a quick look at the changes to ox-odt.el for
> the last few months, but it doesn't seem to be mentioned in any of the
> commit messages. Or was this a more global change?
>
> Does this also count for the regular #+INCLUDE: statement? I just tested
> it and for #+INCLUDE: it seems to work both with and without quotes
> (although the manual uses quotes).
>
>
> Best,
>
> Lennart.
>
>> , and the manual is out of date. Instead of
>>
>>  #+ODT_STYLES_FILE: "template.ott"
>>
>> the manual ought now to read:
>>
>>  #+ODT_STYLES_FILE: template.ott
>>
>> Yours,
>> Christian
>>
>> L.C. Karssen writes:
>>
>>> Hi list,
>>>
>>> Not sure if this is related (or fixed with the aforementioned patch)
>>> because I'm not using a list for the ODT style file.
>>>
>>> Today, after upgrading from Org 9.1.13 (actually installed from melpa on
>>> 20180625) to melpa version 20181105 exporting to ODT stopped working. In
>>> my org file the style file name was enclosed in double quotes (as
>>> specified in the manual [1]):
>>>
>>> #+ODT_STYLES_FILE: "template.ott"
>>>
>>> The error message is:
>>>
>>> OpenDocument export failed: Invalid specification of styles.xml file:
>>> "\"template.ott\""
>>>
>>> Removing the quotes fixes the export to ODT.
>>>
>>>
>>> Best regards,
>>>
>>> Lennart.
>>>
>>> [1] https://orgmode.org/org.html#Applying-custom-styles
>>>
>>>
>>> On 05-11-18 09:49, Christian Moe wrote:

 Thanks, Nicolas!

 I'll test on my end when it shows up in ELPA.

 Yours,
 Christian

 Nicolas Goaziou writes:

> Hello,
>
> Christian Moe  writes:
>
>> It seems the ODT exporter currently fails to read the ODT_STYLES_FILE
>> option as a list, as in this example from the manual
>> ([[info:org#Applying custom styles]]):
>>
>>   #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png"))
>>
>> This is needed if you want a complex style with e.g. an image in the
>> header.
>>
>> Exporting this causes an "Invalid specification of styles.xml file"
>> error on my recent ELPA version. The problem seems to be that the option
>> is treated as a string and never tested to see if it contains a list.
>>
>> To reproduce the problem, place the attached documents
>> odt-styles-test.org and odt-test-styles.odt in the same directory, then
>> export odt-styles-test.org to ODT. The result should have a unicorn in
>> the letterhead.
>>
>> The below quick-and-dirty patch seems to fix it, but I'm sure there's a
>> better approach.
>
> Thank you. I applied your patch with an additional check: the value should
> be enclosed within round brackets.
>
>

Re: [O] Tasks performed on a certain day

2018-11-07 Thread Marcin Borkowski


On 2018-11-06, at 14:59, Leo Gaspard  wrote:

> Hello world,
>
> I am trying to figure out a way to represent, in org-mode, tasks that
> should be performed exactly on one day of the week. For instance, taking
> out the garbage.
>
> It is a task, so I want to be able to mark it as done and not see it for
> the rest of the day. But at the same time I can't SCHEDULE <> it,
> because otherwise if I don't do it the right day then it still bothers
> me the day after, at which I can't do it any longer any way.
>
> Does anyone have a trick to handle this kind of “on-this-date task” with
> org-mode?

Why don't you just say this?

* TODO <2018-11-14 śro +1w> Take out the trash

Hth,

--
Marcin Borkowski
http://mbork.pl