Re: [O] Arithmetic range error

2019-02-07 Thread Kyle Meyer
Nicolas Goaziou  writes:

> Colin Baxter  writes:
>
>> I can now confirm that if the above commit is reversed then my
>> Arithmetic range error disappears.
>>
>> diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
>> index d9fc8d2..2144aa1 100644
>> --- a/lisp/ox-publish.el
>> +++ b/lisp/ox-publish.el
>> @@ -1366,7 +1366,9 @@ does not exist."
>> (expand-file-name (or (file-symlink-p file) file)
>>   (file-name-directory file)
>>  (if (not attr) (error "No such file: \"%s\"" file)
>> -  (floor (float-time (file-attribute-modification-time attr))
>> +  (+ (ash (car (nth 5 attr)) 16)
>> + (cadr (nth 5 attr))
>> +;;  (floor (float-time (file-attribute-modification-time attr))
>
> I think it is worth reporting it to Emacs devel list, because the
> commented code doesn't look wrong.

And in the report it'd be good to include some of the information asked
for elsewhere in this thread (full backtrace, system details) as well as
a recipe to reproduce.  I haven't had any luck triggering the issue,
but that's unsurprisingly given that the code looks correct and the
number reported in the error isn't extreme:

(floor 1549541220.7500212) ; => 1549541220
(format-time-string
 "%Y-%m-%d %I:%M:%S"
 (seconds-to-time 1549541220.7500212)) ; => "2019-02-07 07:07:00"

-- 
Kyle



Re: [O] [PATCH 1/3] org-habit: Add org-habit-scheduled-past-days

2019-02-07 Thread John Lee
On Wed, 6 Feb 2019, at 21:32, Nicolas Goaziou wrote:
> I applied them in master. Thank you.

Thank you!

> Could you provide an entry for ORG-NEWS file, too?

Will do.



Re: [O] Arithmetic range error

2019-02-07 Thread Nicolas Goaziou
Hello,

Colin Baxter  writes:

> I can now confirm that if the above commit is reversed then my
> Arithmetic range error disappears.
>
> diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
> index d9fc8d2..2144aa1 100644
> --- a/lisp/ox-publish.el
> +++ b/lisp/ox-publish.el
> @@ -1366,7 +1366,9 @@ does not exist."
>  (expand-file-name (or (file-symlink-p file) file)
>(file-name-directory file)
>  (if (not attr) (error "No such file: \"%s\"" file)
> -  (floor (float-time (file-attribute-modification-time attr))
> +  (+ (ash (car (nth 5 attr)) 16)
> +  (cadr (nth 5 attr))
> +;;  (floor (float-time (file-attribute-modification-time attr))

I think it is worth reporting it to Emacs devel list, because the
commented code doesn't look wrong.

Regards,

-- 
Nicolas Goaziou



Re: [O] drawer handling

2019-02-07 Thread Jude DaShiell
Solved!  Two things to do with drawers in tables.  Put the drawer at the
end of a table.  If the table likely will expand, on the last entry in
the current table tab through the entry and tab once more so you leave a
blank line above the drawer that can have another entry added to it.
Drawers were mentioned in the context of notes in the org manual and
perhaps with this hack could also be mentioned in context with tables
too.

On Thu, 7 Feb 2019, Jude DaShiell wrote:

> Date: Thu, 7 Feb 2019 15:42:23
> From: Jude DaShiell 
> To: Nicolas Goaziou 
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] drawer handling
>
> What I haven't tried yet is to put the drawer at the bottom of the
> table.  I'll try that next and see if that clears up my navigating
> problem.
>
> On Thu, 7 Feb 2019, Jude DaShiell wrote:
>
> > Date: Thu, 7 Feb 2019 15:28:17
> > From: Jude DaShiell 
> > To: Nicolas Goaziou 
> > Cc: emacs-orgmode@gnu.org
> > Subject: Re: [O] drawer handling
> >
> > Here's an example org file, when opened in emacs I can get into the
> > drawer but not beyond the drawer.
> >
> > | President   | birth   | age | signature | 
> > key | deathcard   |
> > :notes:
> > See "Kaballah Of Numbers" Chapter 4 by Sephariel for tarot card calculation 
> > method.
> > :END:
> > |-+-+-+---+-+-|
> > | George Washington   | 22february1731  |  68 | 19 sun| 
> >  33 | 14 Temperance   |
> > | John Adams  | 30October1735   |  90 | 19 Sun| 
> >  32 | 22 the Fool |
> > | Thomas Jefferson| 13April1743 |  83 | 19 Sun| 
> >  22 | 21 The world|
> > | James Madison   | 16March1751 |  85 | 19 Sun| 
> >  32 | 1 Magician  |
> > | James Monroe| 28April1758 |  73 | 6 The Lovers  | 
> >  21 | 16 Tower|
> > | John Quincy Adams   | 11July1767  |  80 | 13 Death  | 
> >  37 | 22 The Fool |
> > | Andrew Jackson  | 15March1767 |  78 | 21 The World  | 
> >  30 | 21 The World|
> > | Martin VanBuren | 5December1782   |  79 | 11 Strength   | 
> >  29 | 19 The Sun  |
> > | William Henry Harrison  | 9February1773   |  68 | 15 The Devil  | 
> >  33 | 20 Judgement|
> > | John Tyler  | 29March1790 |  71 | 18 The Moon   | 
> >  28 | 18 The Moon |
> > | James Knox Polk | 2November1795   |  53 | 16 The Tower  | 
> >  30 | 7 The Chariot   |
> > | Zachary Taylor  | 24November1784  |  65 | 15 The Devil  | 
> >  31 | 18 The Moon |
> > | Millard Fillmore| 7January1800|  74 | 13 Death  | 
> >  31 | 15 The Devil|
> > | Franklin Pierce | 23November1804  |  64 | 19 The Sun| 
> >  33 | 12 The Hanged Man   |
> > | James Buchanan  | 23April1791 |  77 | 13 Death  | 
> >  22 | 18 The Moon |
> > | Abraham Lincoln | 12February1809  |  56 | 18 The Moon   | 
> >  27 | 20 Judgement|
> > | Andrew Johnson  | 29December1808  |  66 | 15 The Devil  | 
> >  34 | 19 The Sun  |
> > | Hiram Ulysses Simpson-Grant | 27April1822 |  63 | 18 The Moon   | 
> >  50 | 18 The Moon |
> > | Rutherford Birchard Hayes   | 4October1822|  70 | 22 The Fool   | 
> >  45 | 21 The World|
> > | James Abram Garfield| 19November1831  |  49 | 20 Judgement  | 
> >  34 | 16 The Tower|
> > | Chester Alan Arthur | 5October1829|  57 | 17 The Star   | 
> >  24 | 11 Strength |
> > | Stephen Grover Cleveland| 18March1837 |  71 | 19 The Sun| 
> >  45 | 18 The Moon |
> > | Benjamin Harrison   | 20August1833|  68 | 20 Judgement  | 
> >  32 | 16 The Tower|
> > | William McKinley| 29January1843   |  58 | 16 The Tower  | 
> >  27 | 20 Judgement|
> > | Theodore Roosevelt  | 27October1858   |  60 | 7 The Chariot | 
> >  39 | 1 The Magician  |
> > | William Howard Taft | 15September1857 |  72 | 12 The Hanged Man | 
> >  45 | 22 The Fool |
> > | Thomas Woodrow Wilson   | 29December1856  |  67 | 19 The Sun| 
> >  35 | 6 The Lovers|
> > | Warren Gamaliel Harding | 2November1865   |  58 | 12 The Hanged Man | 
> >  37 | 16 The Tower|
> > | John Calvin Coolidge| 4July1872   |  60 | 13 Death  | 
> >  40 | 20 Judgement|
> > | Herbert Clark Hoover| 10August1874|  90 | 18 The Moon   | 
> >  34 | 9 The Hermit|
> > | Franklin Delano Roosevelt   | 30January1882   |  63 | 11 Strength   | 
> >  28 | 20 Judgement|
> > | Harry S Truman  | 8May1884|  88 | 14 Temperance

Re: [O] drawer handling

2019-02-07 Thread Nicolas Goaziou
Hello,

Jude DaShiell  writes:

> Here's an example org file, when opened in emacs I can get into the
> drawer but not beyond the drawer.
>
> | President   | birth   | age | signature | 
> key | deathcard   |
> :notes:
> See "Kaballah Of Numbers" Chapter 4 by Sephariel for tarot card calculation 
> method.
> :END:
> |-+-+-+---+-+-|
> | George Washington   | 22february1731  |  68 | 19 sun|  
> 33 | 14 Temperance   |

You cannot put a drawer in the middle of a table. You actually have two
distinct tables in this document.

Also, I still don't understand what does mean "get into the drawer but
not beyond", i.e., what commands you use, what you want to do, etc.

Regards,

-- 
Nicolas Goaziou



Re: [O] drawer handling

2019-02-07 Thread Jude DaShiell
What I haven't tried yet is to put the drawer at the bottom of the
table.  I'll try that next and see if that clears up my navigating
problem.

On Thu, 7 Feb 2019, Jude DaShiell wrote:

> Date: Thu, 7 Feb 2019 15:28:17
> From: Jude DaShiell 
> To: Nicolas Goaziou 
> Cc: emacs-orgmode@gnu.org
> Subject: Re: [O] drawer handling
>
> Here's an example org file, when opened in emacs I can get into the
> drawer but not beyond the drawer.
>
> | President   | birth   | age | signature | 
> key | deathcard   |
> :notes:
> See "Kaballah Of Numbers" Chapter 4 by Sephariel for tarot card calculation 
> method.
> :END:
> |-+-+-+---+-+-|
> | George Washington   | 22february1731  |  68 | 19 sun|  
> 33 | 14 Temperance   |
> | John Adams  | 30October1735   |  90 | 19 Sun|  
> 32 | 22 the Fool |
> | Thomas Jefferson| 13April1743 |  83 | 19 Sun|  
> 22 | 21 The world|
> | James Madison   | 16March1751 |  85 | 19 Sun|  
> 32 | 1 Magician  |
> | James Monroe| 28April1758 |  73 | 6 The Lovers  |  
> 21 | 16 Tower|
> | John Quincy Adams   | 11July1767  |  80 | 13 Death  |  
> 37 | 22 The Fool |
> | Andrew Jackson  | 15March1767 |  78 | 21 The World  |  
> 30 | 21 The World|
> | Martin VanBuren | 5December1782   |  79 | 11 Strength   |  
> 29 | 19 The Sun  |
> | William Henry Harrison  | 9February1773   |  68 | 15 The Devil  |  
> 33 | 20 Judgement|
> | John Tyler  | 29March1790 |  71 | 18 The Moon   |  
> 28 | 18 The Moon |
> | James Knox Polk | 2November1795   |  53 | 16 The Tower  |  
> 30 | 7 The Chariot   |
> | Zachary Taylor  | 24November1784  |  65 | 15 The Devil  |  
> 31 | 18 The Moon |
> | Millard Fillmore| 7January1800|  74 | 13 Death  |  
> 31 | 15 The Devil|
> | Franklin Pierce | 23November1804  |  64 | 19 The Sun|  
> 33 | 12 The Hanged Man   |
> | James Buchanan  | 23April1791 |  77 | 13 Death  |  
> 22 | 18 The Moon |
> | Abraham Lincoln | 12February1809  |  56 | 18 The Moon   |  
> 27 | 20 Judgement|
> | Andrew Johnson  | 29December1808  |  66 | 15 The Devil  |  
> 34 | 19 The Sun  |
> | Hiram Ulysses Simpson-Grant | 27April1822 |  63 | 18 The Moon   |  
> 50 | 18 The Moon |
> | Rutherford Birchard Hayes   | 4October1822|  70 | 22 The Fool   |  
> 45 | 21 The World|
> | James Abram Garfield| 19November1831  |  49 | 20 Judgement  |  
> 34 | 16 The Tower|
> | Chester Alan Arthur | 5October1829|  57 | 17 The Star   |  
> 24 | 11 Strength |
> | Stephen Grover Cleveland| 18March1837 |  71 | 19 The Sun|  
> 45 | 18 The Moon |
> | Benjamin Harrison   | 20August1833|  68 | 20 Judgement  |  
> 32 | 16 The Tower|
> | William McKinley| 29January1843   |  58 | 16 The Tower  |  
> 27 | 20 Judgement|
> | Theodore Roosevelt  | 27October1858   |  60 | 7 The Chariot |  
> 39 | 1 The Magician  |
> | William Howard Taft | 15September1857 |  72 | 12 The Hanged Man |  
> 45 | 22 The Fool |
> | Thomas Woodrow Wilson   | 29December1856  |  67 | 19 The Sun|  
> 35 | 6 The Lovers|
> | Warren Gamaliel Harding | 2November1865   |  58 | 12 The Hanged Man |  
> 37 | 16 The Tower|
> | John Calvin Coolidge| 4July1872   |  60 | 13 Death  |  
> 40 | 20 Judgement|
> | Herbert Clark Hoover| 10August1874|  90 | 18 The Moon   |  
> 34 | 9 The Hermit|
> | Franklin Delano Roosevelt   | 30January1882   |  63 | 11 Strength   |  
> 28 | 20 Judgement|
> | Harry S Truman  | 8May1884|  88 | 14 Temperance |  
> 38 | 21 The World|
> | David Dwight Eisenhower | 14October1890   |  78 | 21 The World  |  
> 48 | 10 Wheel of fortune |
> | John Fitzgerald Kennedy | 29May1917   |  46 | 16 The Tower  |  
> 34 | 8 Justice   |
> | Lyndon Baines Johnson   | 27August1908|  65 | 17 The Star   |  
> 44 | 10 Wheel Of Fortune |
> | Richard Milhous Nixon   | 9January1913|  81 | 20 Judgement  |  
> 42 | 11 Strength |
> | Leslie Lynch King   | 14July1913  |  93 | 18 The Moon   |  
> 31 | 12 The Hanged Man   |
> | James Earl Carter   | 1October1924| | 18 The Moon   |  
> 38 | |
> | Ronald Wilson Reagan| 6February1911   |  93 | 5 The Hierophant  |  
> 38 | 8 Justice 

Re: [O] Format of links to Info node and Info index

2019-02-07 Thread Nicolas Goaziou
Hello,

Michael Brand  writes:

> On Sat, Feb 2, 2019 at 11:14 AM Michael Brand
>  wrote:
>
>> [...] Now I am confused about
>> the difference of info:org#Feedback that is documented as a link to an
>> info _node_ in [[info:org#External Links]] but never used in
>> org-manual.org versus info:org::Feedback that is not documented in
>> org-manual.org but used for all Info links there, like for example in
>> the section info:org::Activation for the link to Key Binding
>> Conventions. [...]
>
> Short version: I would just like to know how to fix my Org files. Is
> the rule to use info:org::Feedback or info:org#Feedback ?

I suggest :: since this is the markup Org uses to separate uri from
parameters.

Regards,

-- 
Nicolas Goaziou



Re: [O] drawer handling

2019-02-07 Thread Jude DaShiell
Here's an example org file, when opened in emacs I can get into the
drawer but not beyond the drawer.

| President   | birth   | age | signature | key 
| deathcard   |
:notes:
See "Kaballah Of Numbers" Chapter 4 by Sephariel for tarot card calculation 
method.
:END:
|-+-+-+---+-+-|
| George Washington   | 22february1731  |  68 | 19 sun|  33 
| 14 Temperance   |
| John Adams  | 30October1735   |  90 | 19 Sun|  32 
| 22 the Fool |
| Thomas Jefferson| 13April1743 |  83 | 19 Sun|  22 
| 21 The world|
| James Madison   | 16March1751 |  85 | 19 Sun|  32 
| 1 Magician  |
| James Monroe| 28April1758 |  73 | 6 The Lovers  |  21 
| 16 Tower|
| John Quincy Adams   | 11July1767  |  80 | 13 Death  |  37 
| 22 The Fool |
| Andrew Jackson  | 15March1767 |  78 | 21 The World  |  30 
| 21 The World|
| Martin VanBuren | 5December1782   |  79 | 11 Strength   |  29 
| 19 The Sun  |
| William Henry Harrison  | 9February1773   |  68 | 15 The Devil  |  33 
| 20 Judgement|
| John Tyler  | 29March1790 |  71 | 18 The Moon   |  28 
| 18 The Moon |
| James Knox Polk | 2November1795   |  53 | 16 The Tower  |  30 
| 7 The Chariot   |
| Zachary Taylor  | 24November1784  |  65 | 15 The Devil  |  31 
| 18 The Moon |
| Millard Fillmore| 7January1800|  74 | 13 Death  |  31 
| 15 The Devil|
| Franklin Pierce | 23November1804  |  64 | 19 The Sun|  33 
| 12 The Hanged Man   |
| James Buchanan  | 23April1791 |  77 | 13 Death  |  22 
| 18 The Moon |
| Abraham Lincoln | 12February1809  |  56 | 18 The Moon   |  27 
| 20 Judgement|
| Andrew Johnson  | 29December1808  |  66 | 15 The Devil  |  34 
| 19 The Sun  |
| Hiram Ulysses Simpson-Grant | 27April1822 |  63 | 18 The Moon   |  50 
| 18 The Moon |
| Rutherford Birchard Hayes   | 4October1822|  70 | 22 The Fool   |  45 
| 21 The World|
| James Abram Garfield| 19November1831  |  49 | 20 Judgement  |  34 
| 16 The Tower|
| Chester Alan Arthur | 5October1829|  57 | 17 The Star   |  24 
| 11 Strength |
| Stephen Grover Cleveland| 18March1837 |  71 | 19 The Sun|  45 
| 18 The Moon |
| Benjamin Harrison   | 20August1833|  68 | 20 Judgement  |  32 
| 16 The Tower|
| William McKinley| 29January1843   |  58 | 16 The Tower  |  27 
| 20 Judgement|
| Theodore Roosevelt  | 27October1858   |  60 | 7 The Chariot |  39 
| 1 The Magician  |
| William Howard Taft | 15September1857 |  72 | 12 The Hanged Man |  45 
| 22 The Fool |
| Thomas Woodrow Wilson   | 29December1856  |  67 | 19 The Sun|  35 
| 6 The Lovers|
| Warren Gamaliel Harding | 2November1865   |  58 | 12 The Hanged Man |  37 
| 16 The Tower|
| John Calvin Coolidge| 4July1872   |  60 | 13 Death  |  40 
| 20 Judgement|
| Herbert Clark Hoover| 10August1874|  90 | 18 The Moon   |  34 
| 9 The Hermit|
| Franklin Delano Roosevelt   | 30January1882   |  63 | 11 Strength   |  28 
| 20 Judgement|
| Harry S Truman  | 8May1884|  88 | 14 Temperance |  38 
| 21 The World|
| David Dwight Eisenhower | 14October1890   |  78 | 21 The World  |  48 
| 10 Wheel of fortune |
| John Fitzgerald Kennedy | 29May1917   |  46 | 16 The Tower  |  34 
| 8 Justice   |
| Lyndon Baines Johnson   | 27August1908|  65 | 17 The Star   |  44 
| 10 Wheel Of Fortune |
| Richard Milhous Nixon   | 9January1913|  81 | 20 Judgement  |  42 
| 11 Strength |
| Leslie Lynch King   | 14July1913  |  93 | 18 The Moon   |  31 
| 12 The Hanged Man   |
| James Earl Carter   | 1October1924| | 18 The Moon   |  38 
| |
| Ronald Wilson Reagan| 6February1911   |  93 | 5 The Hierophant  |  38 
| 8 Justice   |
| George Herbert Walker Bush  | 12June1924  |  94 | 5 The Hierophant  |  43 
| 9 The Hermit|
| William Jefferson Blythe| 19August1946| | 8 Justice |  42 
| |
| George Walker Bush  | 6July1946   | | 19 The Sun|  35 
| |
| Barack Hussein Obama| 4August1961 | | 20 Judgement  |  30 
| |
| Donald John Trump   | 14June1946  | | 20 Judgement 

Re: [O] Format of links to Info node and Info index

2019-02-07 Thread Michael Brand
Hi all

On Sat, Feb 2, 2019 at 11:14 AM Michael Brand
 wrote:

> [...] Now I am confused about
> the difference of info:org#Feedback that is documented as a link to an
> info _node_ in [[info:org#External Links]] but never used in
> org-manual.org versus info:org::Feedback that is not documented in
> org-manual.org but used for all Info links there, like for example in
> the section info:org::Activation for the link to Key Binding
> Conventions. [...]

Short version: I would just like to know how to fix my Org files. Is
the rule to use info:org::Feedback or info:org#Feedback ?

Michael



Re: [O] Arithmetic range error

2019-02-07 Thread Colin Baxter
> Kyle Meyer  writes:

> Colin Baxter  writes:
>> Publishing an org file today, the html output looks ok but I get
>> the compilation error:
>> 
>> Arithmetic range error: "floor", 1549541220.7500212
>> 
>> I get the error with org-version 9.2.1
>> (release_9.2.1-200-g18b85a) but not with org-version 8.2.10.
>> 
>> Looking at 'org-publish-cache-ctime-of-src' in the file
>> `ox-publish.el', its not obvious to me where the error is coming
>> from. Ditto after looking in NEWS and the git commit logs.
>> 
>> Can anyone help?

> This looks to be due to the backport of Emacs's 662bee7d7,
> specifically:

> * lisp/ox-publish.el (org-publish-cache-ctime-of-src): Prefer
> float-time to doing time arithmetic by hand.  [...]  @@ -1364,8
> +1366,7 @@ (defun org-publish-cache-ctime-of-src (file)
> (expand-file-name (or (file-symlink-p file) file)
> (file-name-directory file) (if (not attr) (error "No such
> file: \"%s\"" file) - (+ (ash (car (nth 5 attr)) 16) - (cadr (nth
> 5 attr)) + (floor (float-time
> (file-attribute-modification-time attr))

> I won't have a chance to investigate further though until (my EST)
> tonight.

I can now confirm that if the above commit is reversed then my
Arithmetic range error disappears.

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index d9fc8d2..2144aa1 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1366,7 +1366,9 @@ does not exist."
 	   (expand-file-name (or (file-symlink-p file) file)
  (file-name-directory file)
 (if (not attr) (error "No such file: \"%s\"" file)
-  (floor (float-time (file-attribute-modification-time attr))
+  (+ (ash (car (nth 5 attr)) 16)
+	 (cadr (nth 5 attr))
+;;  (floor (float-time (file-attribute-modification-time attr))
 
 
 (provide 'ox-publish)

Best wishes,

Colin Baxter
m43...@yandex.com


Re: [O] Arithmetic range error

2019-02-07 Thread Colin Baxter
> "Colin" == Colin Baxter  writes:

> Kyle Meyer  writes:
>> Colin Baxter  writes:
>>> Publishing an org file today, the html output looks ok but I get
>>> the compilation error:
>>> 
>>> Arithmetic range error: "floor", 1549541220.7500212
>>> 
>>> I get the error with org-version 9.2.1
>>> (release_9.2.1-200-g18b85a) but not with org-version 8.2.10.
>>> 
>>> Looking at 'org-publish-cache-ctime-of-src' in the file
>>> `ox-publish.el', its not obvious to me where the error is coming
>>> from. Ditto after looking in NEWS and the git commit logs.
>>> 
>>> Can anyone help?

>> This looks to be due to the backport of Emacs's 662bee7d7,
>> specifically:

>> * lisp/ox-publish.el (org-publish-cache-ctime-of-src): Prefer
>> float-time to doing time arithmetic by hand.  [...]  @@ -1364,8
>> +1366,7 @@ (defun org-publish-cache-ctime-of-src (file)
>> (expand-file-name (or (file-symlink-p file) file)
>> (file-name-directory file) (if (not attr) (error "No such
>> file: \"%s\"" file) - (+ (ash (car (nth 5 attr)) 16) - (cadr (nth
>> 5 attr)) + (floor (float-time
>> (file-attribute-modification-time attr))

>> I won't have a chance to investigate further though until (my
>> EST) tonight.

Colin> Thank you to everybody for your replies. I can't revert the
Colin> commit myself; there seems to be unmerged files in the work
Colin> tree and this goes beyond my knowledge of git. Interestingly,
Colin> the above additions and subtractions to lisp/ox-publish.el
Colin> actually seem to be missing from my ox-publish.el (lines
Colin> 1361--1368).

Please ignore my last sentence - it's nonsense - sorry.

Best wishes,
 
Colin Baxter
m43...@yandex.com




[O] Completely hide the :PROPERTIES: drawer in org-mode.

2019-02-07 Thread Keith David Bershatsky
A few years ago, I wrote up an answer to my own question on Stackoverflow to 
completely hide the :PROPERTIES: drawer, including the line that says 
:PROPERTIES:.  Since then, it has received nearly 5,000 views, 11 stars, 17 
upvotes on the initial question, and 15 upvotes on the answer.

Today, a forum participant posted a comment underneath my answer asking why not 
send this upstream.  So, here is the link to the answer:

https://stackoverflow.com/a/17492723/2112489

Thanks,

Keith



Re: [O] org-icalendar: Change dates to today in VEVENT export

2019-02-07 Thread Michaël Cadilhac
On Thu, 7 Feb 2019 at 13:30, Nicolas Goaziou  wrote:

> If you think that's a feature Org ought to provide, please consider
> sending a patch about it.

Well, certainly.  I may not have had the best discipline in writing
these, so turning them into patches is a bit painful.  Let me know if
I can make things better.  (I believe my FSF paperwork is still
alright, if need be.)

PATCHES 0001 & 0006

ox-icalendar.el: Enable bumping overdue TODOs and deadline warnings.

* lisp/ox-icalendar.el (org-icalendar-bump-todos, org-icalendar-warn-deadlines):
New customizable variables.
(org-icalendar-today-timestamp, org-icalendar-days-until-timestamp): New
internal functions.
(org-icalendar-entry): Implement behavior.

* doc/org-manual.org (iCalendar Export): Document.


PATCHES 0002 & 0005

ox-icalendar.el: Use tags in summary, if so desired.

* lisp/ox-icalendar.el (org-icalendar-summary-uses-tags): New customizable
variable.
(org-icalendar-entry): Implement behavior.

* doc/org-manual.org (iCalendar Export): Document.


PATCH 0003

ox-icalendar.el: Add a VTIMEZONE block.

* lisp/ox-icalendar.el (org-icalendar--vcalendar): Add a VTIMEZONE block.
From c7c0f17d0902d3d89503d1dc24f248ee9bdfab1f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Cadilhac?= 
Date: Thu, 7 Feb 2019 12:20:51 +
Subject: [PATCH 3/6] Be a bit more compliant with iCalendar standard by having
 a VTIMEZONE block.

---
 lisp/ox-icalendar.el | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 5e7f2804a..a5b586434 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -897,11 +897,15 @@ X-WR-CALNAME:%s
 PRODID:-//%s//Emacs with Org mode//EN
 X-WR-TIMEZONE:%s
 X-WR-CALDESC:%s
-CALSCALE:GREGORIAN\n"
+CALSCALE:GREGORIAN
+BEGIN:VTIMEZONE
+TZID:%s
+END:VTIMEZONE\n"
 		  (org-icalendar-cleanup-string name)
 		  (org-icalendar-cleanup-string owner)
 		  (org-icalendar-cleanup-string tz)
-		  (org-icalendar-cleanup-string description))
+		  (org-icalendar-cleanup-string description)
+		  (org-icalendar-cleanup-string tz))
 	  contents
 	  "END:VCALENDAR\n"))
 
-- 
2.19.2

From 80f013e60b6a0330c5f13402ef46b1b4a68ce6aa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Cadilhac?= 
Date: Thu, 7 Feb 2019 12:19:28 +
Subject: [PATCH 1/6] Introduce ways to bump overdue TODOs today, and warn of
 forthcoming deadlines.

---
 lisp/ox-icalendar.el | 99 +---
 1 file changed, 93 insertions(+), 6 deletions(-)

diff --git a/lisp/ox-icalendar.el b/lisp/ox-icalendar.el
index 3d6d0b263..2bf2cd89a 100644
--- a/lisp/ox-icalendar.el
+++ b/lisp/ox-icalendar.el
@@ -119,6 +119,20 @@ This is a list with possibly several symbols in it.  Valid symbols are:
 	  (const :tag "SCHEDULED in TODO entries become start date"
 		 todo-start)))
 
+(defcustom org-icalendar-bump-todos nil
+  "Non-nil means that pending TODO VEVENTs are bumped to today.
+In addition, if non-nil, the number of late days is indicated in the summary."
+  :group 'org-export-icalendar
+  :type 'boolean)
+
+(defcustom org-icalendar-warn-deadlines nil
+  "Non-nil means that a new VEVENT is created today to warn for deadlines.
+This only applies to TODOs that are not done.  Relies on
+`org-deadline-warning-days' for the number of days during which the warning
+is created."
+  :group 'org-export-icalendar
+  :type 'boolean)
+
 (defcustom org-icalendar-categories '(local-tags category)
   "Items that should be entered into the \"categories\" field.
 
@@ -481,6 +495,28 @@ or subject for the event."
 	(concat folded-line "\r\n " (substring line chunk-start))
 (org-split-string s "\n") "\r\n")))
 
+(defun org-icalendar-today-timestamp ()
+  "Return a TIMESTAMP object for today, at 00:00."
+  (let ((dt (decode-time)))
+(list 'timestamp
+	  (nconc (list :year-start (nth 5 dt)
+		   :year-end (nth 5 dt)
+		   :month-start (nth 4 dt)
+		   :month-end (nth 4 dt)
+		   :day-start (nth 3 dt)
+		   :day-end (nth 3 dt))
+
+(defun org-icalendar-days-until-timestamp (timestamp)
+  "Return the number of days until TIMESTAMP.
+
+If TIMESTAMP occurs today, return 0.
+If TIMESTAMP occurs yesterday, return -1."
+  (floor
+   (/ (float-time
+   (time-subtract (org-timestamp--to-internal-time timestamp)
+		  (apply 'encode-time
+			 (append '(0 0 0) (nthcdr 3 (decode-time))
+  (* 60 60 24
 
 
 ;;; Filters
@@ -567,19 +603,70 @@ inlinetask within the section."
 	  ;; "VEVENT" component from scheduled, deadline, or any
 	  ;; timestamp in the entry.
 	  (let ((deadline (org-element-property :deadline entry)))
-	(and deadline
+	(when (and deadline
 		   (memq (if todo-type 'event-if-todo 'event-if-not-todo)
-		   org-icalendar-use-deadline)
+			 

Re: [O] Arithmetic range error

2019-02-07 Thread Colin Baxter
> Kyle Meyer  writes:

> Colin Baxter  writes:
>> Publishing an org file today, the html output looks ok but I get
>> the compilation error:
>> 
>> Arithmetic range error: "floor", 1549541220.7500212
>> 
>> I get the error with org-version 9.2.1
>> (release_9.2.1-200-g18b85a) but not with org-version 8.2.10.
>> 
>> Looking at 'org-publish-cache-ctime-of-src' in the file
>> `ox-publish.el', its not obvious to me where the error is coming
>> from. Ditto after looking in NEWS and the git commit logs.
>> 
>> Can anyone help?

> This looks to be due to the backport of Emacs's 662bee7d7,
> specifically:

> * lisp/ox-publish.el (org-publish-cache-ctime-of-src): Prefer
> float-time to doing time arithmetic by hand.  [...]  @@ -1364,8
> +1366,7 @@ (defun org-publish-cache-ctime-of-src (file)
> (expand-file-name (or (file-symlink-p file) file)
> (file-name-directory file) (if (not attr) (error "No such
> file: \"%s\"" file) - (+ (ash (car (nth 5 attr)) 16) - (cadr (nth
> 5 attr)) + (floor (float-time
> (file-attribute-modification-time attr))

> I won't have a chance to investigate further though until (my EST)
> tonight.

Thank you to everybody for your replies. I can't revert the commit
myself; there seems to be unmerged files in the work tree and this
goes beyond my knowledge of git. Interestingly, the above additions and
subtractions to lisp/ox-publish.el actually seem to be missing from my
ox-publish.el (lines 1361--1368).

Best wishes,

Colin Baxter
m43...@yandex.com



Re: [O] org-icalendar: Change dates to today in VEVENT export

2019-02-07 Thread Nicolas Goaziou
Hello,

Michaël Cadilhac  writes:

> Alright, so I guess this is indeed not doable out of the box.  I've
> implemented this on my fork of org-mode:
>https://code.orgmode.org/michaelcadilhac/org-mode
> (Also two more things that may be of interest: Include tags in summaries,
> and give a bit more information about the timezone—ical.js does not
> recognize X-WR-TIMEZONE.)
>
> Hopefully this will be useful for someone :-)

If you think that's a feature Org ought to provide, please consider
sending a patch about it.

Regards,

-- 
Nicolas Goaziou



Re: [O] drawer handling

2019-02-07 Thread Nicolas Goaziou
Hello,

Jude DaShiell  writes:

> If a drawer is associated with and below a table entry is it necessary to
> hide the drawer's visibility in order to go below the drawer in the
> original org file and edit entries below that drawer?  I'm using org
> version 8.29 and just using tab doesn't get me below a drawer.

I don't understand your issue. Could you show an example?

Regards,

-- 
Nicolas Goaziou



Re: [O] Arithmetic range error

2019-02-07 Thread Nicolas Goaziou
Hello,

Colin Baxter  writes:

> Publishing an org file today, the html output looks ok but I get the
> compilation error:
>
> Arithmetic range error: "floor", 1549541220.7500212
>
> I get the error with org-version 9.2.1 (release_9.2.1-200-g18b85a)
> but not with org-version 8.2.10.
>
> Looking at 'org-publish-cache-ctime-of-src' in the file `ox-publish.el',
> its not obvious to me where the error is coming from. Ditto after
> looking in NEWS and the git commit logs.
>
> Can anyone help?

It would be nice to get the full backtrace.

Also, does commit d64c9a996b look suspicious?

Regards,

-- 
Nicolas Goaziou



Re: [O] Arithmetic range error

2019-02-07 Thread Robert Pluim
Colin Baxter  writes:

> Hello,
>
> Publishing an org file today, the html output looks ok but I get the
> compilation error:
>
> Arithmetic range error: "floor", 1549541220.7500212
>
> I get the error with org-version 9.2.1 (release_9.2.1-200-g18b85a)
> but not with org-version 8.2.10.
>
> Looking at 'org-publish-cache-ctime-of-src' in the file `ox-publish.el',
> its not obvious to me where the error is coming from. Ditto after
> looking in NEWS and the git commit logs.

Thatʼs emacs signalling that thereʼs an overflow when converting that
float to an integer. It seems much too small for that, though. Which
version of emacs is this, on what platform?

Robert



Re: [O] Arithmetic range error

2019-02-07 Thread Kyle Meyer
Colin Baxter  writes:

> Publishing an org file today, the html output looks ok but I get the
> compilation error:
>
> Arithmetic range error: "floor", 1549541220.7500212
>
> I get the error with org-version 9.2.1 (release_9.2.1-200-g18b85a)
> but not with org-version 8.2.10.
>
> Looking at 'org-publish-cache-ctime-of-src' in the file `ox-publish.el',
> its not obvious to me where the error is coming from. Ditto after
> looking in NEWS and the git commit logs.
>
> Can anyone help?

This looks to be due to the backport of Emacs's 662bee7d7,
specifically:

--8<---cut here---start->8---
* lisp/ox-publish.el (org-publish-cache-ctime-of-src):
Prefer float-time to doing time arithmetic by hand.
[...]
@@ -1364,8 +1366,7 @@ (defun org-publish-cache-ctime-of-src (file)
   (expand-file-name (or (file-symlink-p file) file)
 (file-name-directory file)
 (if (not attr) (error "No such file: \"%s\"" file)
-  (+ (ash (car (nth 5 attr)) 16)
-(cadr (nth 5 attr))
+  (floor (float-time (file-attribute-modification-time attr))
--8<---cut here---end--->8---

I won't have a chance to investigate further though until (my EST)
tonight.



Re: [O] org-icalendar: Change dates to today in VEVENT export

2019-02-07 Thread Michaël Cadilhac
Alright, so I guess this is indeed not doable out of the box.  I've
implemented this on my fork of org-mode:
   https://code.orgmode.org/michaelcadilhac/org-mode
(Also two more things that may be of interest: Include tags in summaries,
and give a bit more information about the timezone—ical.js does not
recognize X-WR-TIMEZONE.)

Hopefully this will be useful for someone :-)

Cheers;
M.

On Fri, 1 Feb 2019 at 12:47, Michaël Cadilhac  wrote:

> Hi there yall;
>
> I use org-icalendar to export my TODOs and events to an ics, that is then
> imported in Google Calendar.  As far as I can see, Google Calendar still
> doesn't support VTODOs, so only the VEVENTs are relevant.  *My goal is to
> have my day on Google Calendar looks like my Org Agenda; *in particular
> this means:
>
> 1.   I want my repeats to appear today.
>
> To do this, I have to artificially bump the timestamp of the VEVENTs that
> correspond to a not-DONE TODO to today (and maybe add the "72x" indicating
> that the TODO was scheduled 72 days ago).  How can I do that?
>
> I believe this is not doable out of the box and that I'll have to
> modify org-icalendar-entry; is that correct?
>
> 2.   I want my DEADLINEs to show up `org-deadline-warning-days` days
> before in the export.
>
> Again this means that I have to artificially change the date of the VEVENT
> (and maybe add the "in 6d.").  How can I do that?
>
> Thanks very much!
>
> Cheers;
> M.
>


[O] Arithmetic range error

2019-02-07 Thread Colin Baxter
Hello,

Publishing an org file today, the html output looks ok but I get the
compilation error:

Arithmetic range error: "floor", 1549541220.7500212

I get the error with org-version 9.2.1 (release_9.2.1-200-g18b85a)
but not with org-version 8.2.10.

Looking at 'org-publish-cache-ctime-of-src' in the file `ox-publish.el',
its not obvious to me where the error is coming from. Ditto after
looking in NEWS and the git commit logs.

Can anyone help?

Best wishes,

Colin Baxter
m43...@yandex.com