emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer Stengele <rainer.stengele@online.de>
To: emacs-orgmode@gnu.org
Subject: Re: executing org-table TBLFM form changes (resets) language settings
Date: Tue, 30 Jan 2018 20:45:43 +0100	[thread overview]
Message-ID: <c8c8b50e-8b04-babb-bb2f-bea588081dd4@online.de> (raw)
In-Reply-To: <45d4aef9-5e98-6153-0316-eaec502f5530@online.de>

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

  reply	other threads:[~2018-01-30 19:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8c8b50e-8b04-babb-bb2f-bea588081dd4@online.de \
    --to=rainer.stengele@online.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).