emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* executing org-table TBLFM form changes (resets) language settings
@ 2018-01-25 13:30 Rainer Stengele
  2018-01-25 19:27 ` Nick Dokos
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Stengele @ 2018-01-25 13:30 UTC (permalink / raw)
  To: emacs-orgmode

All,

My current-language-environment is "German".
Having an Org table with a TBLFM attached:

| IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
|-----------------------+-----------------------+---------+-------------+------|
| [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
|                       |                       |         |             |      |
#+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f

entering a new timestamp correctly inserts German dayname abbrevs: ("Do", German for "Thu", English):

| IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
|-----------------------+-----------------------+---------+-------------+------|
| [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
| [2018-01-25 Do 14:19] |                       |         |             |      |
#+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f

Executing the TBLFM line with C-c C-c changes (resets) the language environment to English.

Now inserting a timestamp inserts "Thu" instead of "Do", that is it uses the English day name abbrevs:

| IM Startzeit          | IM Endezeit           |      Stunden |  delta(x,16) | Anm. |
|-----------------------+-----------------------+--------------+--------------+------|
| [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |        19.00 |         3.00 |      |
| [2018-01-25 Thu 14:21]|                       |              |              |      |
#+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f

Believe me it took me some time to find out what action in Emacs changes the whole lang environment.

Is that a bug or is there a language setting in the TBLFM form?

Thanks for any hint.

Regards,
Rainer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-25 13:30 executing org-table TBLFM form changes (resets) language settings Rainer Stengele
@ 2018-01-25 19:27 ` Nick Dokos
  2018-01-26  9:46   ` Rainer Stengele
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Dokos @ 2018-01-25 19:27 UTC (permalink / raw)
  To: emacs-orgmode

Rainer Stengele <rainer.stengele@online.de> writes:

> All,
>
> My current-language-environment is "German".
> Having an Org table with a TBLFM attached:
>
> | IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
> |-----------------------+-----------------------+---------+-------------+------|
> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
> |                       |                       |         |             |      |
>
> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>
> entering a new timestamp correctly inserts German dayname abbrevs: ("Do", German for "Thu", English):
>
> | IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
> |-----------------------+-----------------------+---------+-------------+------|
> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
> | [2018-01-25 Do 14:19] |                       |         |             |      |
>
> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>
> Executing the TBLFM line with C-c C-c changes (resets) the language environment to English.
>
> Now inserting a timestamp inserts "Thu" instead of "Do", that is it uses the English day name abbrevs:
>
> | IM Startzeit          | IM Endezeit           |      Stunden |  delta(x,16) | Anm. |
> |-----------------------+-----------------------+--------------+--------------+------|
> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |        19.00 |         3.00 |      |
> | [2018-01-25 Thu 14:21]|                       |              |              |      |
>
> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>
> Believe me it took me some time to find out what action in Emacs changes the whole lang environment.
>
> Is that a bug or is there a language setting in the TBLFM form?
>
> Thanks for any hint.
>
> Regards,
> Rainer
>

I can reproduce this if I start emacs like this:

   emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org &

set the language environment inside emacs and then do C-c C-c on the TBLFM line
and try to add another date.

I cannot reproduce it when invoking emacs like this:

   LANG=de_DE.UTF-8 emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org

so it seems you are right that in the first case, something changes the language
environment.

-- 
Nick

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-25 19:27 ` Nick Dokos
@ 2018-01-26  9:46   ` Rainer Stengele
  2018-01-29  7:49     ` Rainer Stengele
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Stengele @ 2018-01-26  9:46 UTC (permalink / raw)
  To: Nick Dokos, emacs-orgmode

Am 25.01.2018 um 20:27 schrieb Nick Dokos:
> Rainer Stengele <rainer.stengele@online.de> writes:
> 
>> All,
>>
>> My current-language-environment is "German".
>> Having an Org table with a TBLFM attached:
>>
>> | IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
>> |-----------------------+-----------------------+---------+-------------+------|
>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
>> |                       |                       |         |             |      |
>>
>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>
>> entering a new timestamp correctly inserts German dayname abbrevs: ("Do", German for "Thu", English):
>>
>> | IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
>> |-----------------------+-----------------------+---------+-------------+------|
>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
>> | [2018-01-25 Do 14:19] |                       |         |             |      |
>>
>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>
>> Executing the TBLFM line with C-c C-c changes (resets) the language environment to English.
>>
>> Now inserting a timestamp inserts "Thu" instead of "Do", that is it uses the English day name abbrevs:
>>
>> | IM Startzeit          | IM Endezeit           |      Stunden |  delta(x,16) | Anm. |
>> |-----------------------+-----------------------+--------------+--------------+------|
>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |        19.00 |         3.00 |      |
>> | [2018-01-25 Thu 14:21]|                       |              |              |      |
>>
>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>
>> Believe me it took me some time to find out what action in Emacs changes the whole lang environment.
>>
>> Is that a bug or is there a language setting in the TBLFM form?
>>
>> Thanks for any hint.
>>
>> Regards,
>> Rainer
>>
> 
> I can reproduce this if I start emacs like this:
> 
>     emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org &
> 
> set the language environment inside emacs and then do C-c C-c on the TBLFM line
> and try to add another date.
> 
> I cannot reproduce it when invoking emacs like this:
> 
>     LANG=de_DE.UTF-8 emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org
> 
> so it seems you are right that in the first case, something changes the language
> environment.
> 
Hi Nick,

thanks for confirming.
I am running under Windows and cannot apply your environment setting like this.

Does anyboday have a chance to correct the misbehaviour in the TBLFM table code that changes the language settings?
I will not be able to do it on my own.

Thank you.
Regards, Rainer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-26  9:46   ` Rainer Stengele
@ 2018-01-29  7:49     ` Rainer Stengele
  2018-01-30 19:45       ` Rainer Stengele
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Stengele @ 2018-01-29  7:49 UTC (permalink / raw)
  To: emacs-orgmode

Am 26.01.2018 um 10:46 schrieb Rainer Stengele:
> Am 25.01.2018 um 20:27 schrieb Nick Dokos:
>> Rainer Stengele <rainer.stengele@online.de> writes:
>>
>>> All,
>>>
>>> My current-language-environment is "German".
>>> Having an Org table with a TBLFM attached:
>>>
>>> | IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
>>> |-----------------------+-----------------------+---------+-------------+------|
>>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
>>> |                       |                       |         |             |      |
>>>
>>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>>
>>> entering a new timestamp correctly inserts German dayname abbrevs: ("Do", German for "Thu", English):
>>>
>>> | IM Startzeit          | IM Endezeit           | Stunden | delta(x,16) | Anm. |
>>> |-----------------------+-----------------------+---------+-------------+------|
>>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        3.00 |      |
>>> | [2018-01-25 Do 14:19] |                       |         |             |      |
>>>
>>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>>
>>> Executing the TBLFM line with C-c C-c changes (resets) the language environment to English.
>>>
>>> Now inserting a timestamp inserts "Thu" instead of "Do", that is it uses the English day name abbrevs:
>>>
>>> | IM Startzeit          | IM Endezeit           |      Stunden |  delta(x,16) | Anm. |
>>> |-----------------------+-----------------------+--------------+--------------+------|
>>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |        19.00 |         3.00 |      |
>>> | [2018-01-25 Thu 14:21]|                       |              |              |      |
>>>
>>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>>
>>> Believe me it took me some time to find out what action in Emacs changes the whole lang environment.
>>>
>>> Is that a bug or is there a language setting in the TBLFM form?
>>>
>>> Thanks for any hint.
>>>
>>> Regards,
>>> Rainer
>>>
>>
>> I can reproduce this if I start emacs like this:
>>
>>     emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org &
>>
>> set the language environment inside emacs and then do C-c C-c on the TBLFM line
>> and try to add another date.
>>
>> I cannot reproduce it when invoking emacs like this:
>>
>>     LANG=de_DE.UTF-8 emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org
>>
>> so it seems you are right that in the first case, something changes the language
>> environment.
>>
> Hi Nick,
> 
> thanks for confirming.
> I am running under Windows and cannot apply your environment setting like this.
> 
> Does anyboday have a chance to correct the misbehaviour in the TBLFM table code that changes the language settings?
> I will not be able to do it on my own.
> 
> Thank you.
> Regards, Rainer
> 
> 

Hi again,

I found out that it is the "date" function that changes the language settings. TBLFM lines without date calc don't change the behaviour.
May I please ask a calc expert to look into that function and investigate the unwanted behaviour.
I am also not sure how to easily reset the language setting manually to the correct one.
Can someone give me a hint please.

Thank you.
Regards, Rainer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-29  7:49     ` Rainer Stengele
@ 2018-01-30 19:45       ` Rainer Stengele
  2018-01-30 21:07         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Stengele @ 2018-01-30 19:45 UTC (permalink / raw)
  To: emacs-orgmode

Am 29.01.2018 um 08:49 schrieb Rainer Stengele:
> Am 26.01.2018 um 10:46 schrieb Rainer Stengele:
>> Am 25.01.2018 um 20:27 schrieb Nick Dokos:
>>> Rainer Stengele <rainer.stengele@online.de> writes:
>>>
>>>> All,
>>>>
>>>> My current-language-environment is "German".
>>>> Having an Org table with a TBLFM attached:
>>>>
>>>> | IM Startzeit          | IM Endezeit           | Stunden | 
>>>> delta(x,16) | Anm. |
>>>> |-----------------------+-----------------------+---------+-------------+------| 
>>>>
>>>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        
>>>> 3.00 |      |
>>>> |                       |                       |         
>>>> |             |      |
>>>>
>>>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>>>
>>>> entering a new timestamp correctly inserts German dayname abbrevs: 
>>>> ("Do", German for "Thu", English):
>>>>
>>>> | IM Startzeit          | IM Endezeit           | Stunden | 
>>>> delta(x,16) | Anm. |
>>>> |-----------------------+-----------------------+---------+-------------+------| 
>>>>
>>>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |   19.00 |        
>>>> 3.00 |      |
>>>> | [2018-01-25 Do 14:19] |                       |         
>>>> |             |      |
>>>>
>>>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>>>
>>>> Executing the TBLFM line with C-c C-c changes (resets) the language 
>>>> environment to English.
>>>>
>>>> Now inserting a timestamp inserts "Thu" instead of "Do", that is it 
>>>> uses the English day name abbrevs:
>>>>
>>>> | IM Startzeit          | IM Endezeit           |      Stunden |  
>>>> delta(x,16) | Anm. |
>>>> |-----------------------+-----------------------+--------------+--------------+------| 
>>>>
>>>> | [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |        19.00 
>>>> |         3.00 |      |
>>>> | [2018-01-25 Thu 14:21]|                       |              
>>>> |              |      |
>>>>
>>>> #+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f
>>>>
>>>> Believe me it took me some time to find out what action in Emacs 
>>>> changes the whole lang environment.
>>>>
>>>> Is that a bug or is there a language setting in the TBLFM form?
>>>>
>>>> Thanks for any hint.
>>>>
>>>> Regards,
>>>> Rainer
>>>>
>>>
>>> I can reproduce this if I start emacs like this:
>>>
>>>     emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org &
>>>
>>> set the language environment inside emacs and then do C-c C-c on the 
>>> TBLFM line
>>> and try to add another date.
>>>
>>> I cannot reproduce it when invoking emacs like this:
>>>
>>>     LANG=de_DE.UTF-8 emacs -q -l ~/src/minimal/min.org.el /tmp/dates.org
>>>
>>> so it seems you are right that in the first case, something changes 
>>> the language
>>> environment.
>>>
>> Hi Nick,
>>
>> thanks for confirming.
>> I am running under Windows and cannot apply your environment setting 
>> like this.
>>
>> Does anyboday have a chance to correct the misbehaviour in the TBLFM 
>> table code that changes the language settings?
>> I will not be able to do it on my own.
>>
>> Thank you.
>> Regards, Rainer
>>
>>
> 
> Hi again,
> 
> I found out that it is the "date" function that changes the language 
> settings. TBLFM lines without date calc don't change the behaviour.
> May I please ask a calc expert to look into that function and 
> investigate the unwanted behaviour.
> I am also not sure how to easily reset the language setting manually to 
> the correct one.
> Can someone give me a hint please.
> 
> Thank you.
> Regards, Rainer
> 
> 
> 
Hi again,

has anybody an idea? Each time I calculate a time diff in an Org table I 
trigger the wrong creation of any org timestamp as the date language has 
changed. Full restart of Emacs needed right now :(.

Regards, Rainer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-30 19:45       ` Rainer Stengele
@ 2018-01-30 21:07         ` Nicolas Goaziou
  2018-01-31  9:45           ` Rainer Stengele
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2018-01-30 21:07 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Hello,

Rainer Stengele <rainer.stengele@online.de> writes:

> has anybody an idea? Each time I calculate a time diff in an Org table
> I trigger the wrong creation of any org timestamp as the date language
> has changed. Full restart of Emacs needed right now :(.

Would setting `math-short-weekday-names' help?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-30 21:07         ` Nicolas Goaziou
@ 2018-01-31  9:45           ` Rainer Stengele
  2018-01-31 11:08             ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Rainer Stengele @ 2018-01-31  9:45 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Am 30.01.2018 um 22:07 schrieb Nicolas Goaziou:
> Hello,
> 
> Rainer Stengele <rainer.stengele@online.de> writes:
> 
>> has anybody an idea? Each time I calculate a time diff in an Org table
>> I trigger the wrong creation of any org timestamp as the date language
>> has changed. Full restart of Emacs needed right now :(.
> 
> Would setting `math-short-weekday-names' help?
> 
> Regards,
> 
Hello,

I set the variables in my .emacs:

(defvar math-short-weekday-names '( "So" "Mo" "Di" "Mi" "Do" "Fr" "Sa" ))

Now the TBLFMT line creates #ERROR entries!
Very strange, no clue why that happens.

Regards,
Rainer

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-31  9:45           ` Rainer Stengele
@ 2018-01-31 11:08             ` Nicolas Goaziou
  2018-03-05 14:39               ` Rainer Stengele
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2018-01-31 11:08 UTC (permalink / raw)
  To: Rainer Stengele; +Cc: emacs-orgmode

Hello,

Rainer Stengele <rainer.stengele@online.de> writes:

> I set the variables in my .emacs:
>
> (defvar math-short-weekday-names '( "So" "Mo" "Di" "Mi" "Do" "Fr" "Sa" ))

Shouldn't it be (setq math-short-weekday-names '("So" ...)) 

> Very strange, no clue why that happens.

No clue either. Calc is pretty foreign to me. You may want to ask Emacs
devel ML.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: executing org-table TBLFM form changes (resets) language settings
  2018-01-31 11:08             ` Nicolas Goaziou
@ 2018-03-05 14:39               ` Rainer Stengele
  0 siblings, 0 replies; 9+ messages in thread
From: Rainer Stengele @ 2018-03-05 14:39 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

Am 31.01.2018 um 12:08 schrieb Nicolas Goaziou:
> Hello,
> 
> Rainer Stengele <rainer.stengele@online.de> writes:
> 
>> I set the variables in my .emacs:
>>
>> (defvar math-short-weekday-names '( "So" "Mo" "Di" "Mi" "Do" "Fr" "Sa" ))
> 
> Shouldn't it be (setq math-short-weekday-names '("So" ...))
> 
>> Very strange, no clue why that happens.
> 
> No clue either. Calc is pretty foreign to me. You may want to ask Emacs
> devel ML.
> 
> Regards,
> 
Hi,

as nobody answered my calc question neither here nor in the emacs user group I am now using a work around.
I rearranged my timestamp table from

| IM Startzeit          | IM Endezeit           |      Stunden |  delta(x,16) | Anm. |
|-----------------------+-----------------------+--------------+--------------+------|
| [2018-01-22 Mo 19:30] | [2018-01-23 Di 14:30] |        19.00 |         3.00 |      |
#+TBLFM: $3=24*(date(<$2>)-date(<$1>)); %.2f::$4=$3-16.0; %.2f

to

| IM Startzeit -- IM Endezeit                  | Stunden - Min String |  Delta | Anm.                                     |
|----------------------------------------------+----------------------+--------+------------------------------------------|
| [2018-01-22 Mo 19:30]--[2018-01-23 Di 14:30] |                19.00 |   3.00 |                                          |
#+TBLFM: $2='(rst/org-evaluate-time-range)::$3=$2-16.0; %.2f

I copied org-evaluate-time-range to rst/org-evaluate-time-range and modified the output slightly to give me a %2.2f hours based time range 
delta. Brutal, but works.

Thank you.
Regards, Rainer


(defun rst/org-evaluate-time-range (&optional to-buffer)
   "Evaluate a time range by computing the difference between start and end.
Normally the result is just printed in the echo area, but with prefix arg
TO-BUFFER, the result is inserted just after the date stamp into the buffer.
If the time range is actually in a table, the result is inserted into the
next column.
For time difference computation, a year is assumed to be exactly 365
days in order to avoid rounding problems."
   (interactive "P")
   (or
    (org-clock-update-time-maybe)
    (save-excursion
      (unless (org-at-date-range-p t)
        (goto-char (point-at-bol))
        (re-search-forward org-tr-regexp-both (point-at-eol) t))
      (unless (org-at-date-range-p t)
        (user-error "Not at a time-stamp range, and none found in current line")))
    (let* ((ts1 (match-string 1))
	  (ts2 (match-string 2))
	  (havetime (or (> (length ts1) 15) (> (length ts2) 15)))
	  (match-end (match-end 0))
	  (time1 (org-time-string-to-time ts1))
	  (time2 (org-time-string-to-time ts2))
	  (t1 (float-time time1))
	  (t2 (float-time time2))
	  (diff (abs (- t2 t1)))
	  (negative (< (- t2 t1) 0))
	  ;; (ys (floor (* 365 24 60 60)))
	  (ds (* 24 60 60))
	  (hs (* 60 60))
	  (fy "%dy %dd %02d:%02d")
	  (fy1 "%dy %dd")
	  (fd "%dd %02d:%02d")
	  (fd1 "%dd")
	  (fh "%02d:%02d")
	  y d h m align)
      (if havetime
	 (setq ; y (floor (/ diff ys))  diff (mod diff ys)
	  y 0
	  d (floor (/ diff ds))  diff (mod diff ds)
	  h (floor (/ diff hs))  diff (mod diff hs)
	  m (floor (/ diff 60)))
        (setq ; y (floor (/ diff ys))  diff (mod diff ys)
	y 0
	d (floor (+ (/ diff ds) 0.5))
	h 0 m 0))
      (if (not to-buffer)
	 ;; RST changes here:
	 ;; (message "%s" (org-make-tdiff-string y d h m))
	 (message "%2.2f" (+ (* 24 d) h (/ m 60.0)))
        (if (org-at-table-p)
	   (progn
	     (goto-char match-end)
	     (setq align t)
	     (and (looking-at " *|") (goto-char (match-end 0))))
	 (goto-char match-end))
        (when (looking-at
	      "\\( *-? *[0-9]+y\\)?\\( *[0-9]+d\\)? *[0-9][0-9]:[0-9][0-9]")
	 (replace-match ""))
        (when negative (insert " -"))
        (if (> y 0) (insert " " (format (if havetime fy fy1) y d h m))
	 (if (> d 0) (insert " " (format (if havetime fd fd1) d h m))
	   (insert " " (format fh h m))))
        (when align (org-table-align))
        (message "Time difference inserted")))))

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-03-05 14:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25 13:30 executing org-table TBLFM form changes (resets) language settings Rainer Stengele
2018-01-25 19:27 ` Nick Dokos
2018-01-26  9:46   ` Rainer Stengele
2018-01-29  7:49     ` Rainer Stengele
2018-01-30 19:45       ` Rainer Stengele
2018-01-30 21:07         ` Nicolas Goaziou
2018-01-31  9:45           ` Rainer Stengele
2018-01-31 11:08             ` Nicolas Goaziou
2018-03-05 14:39               ` Rainer Stengele

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).