From mboxrd@z Thu Jan 1 00:00:00 1970 From: Derek Feichtinger Subject: Re: Problem with org-timestamp-up and timezones Date: Fri, 15 Apr 2016 21:56:58 +0000 (UTC) Message-ID: References: <87twj6t4ei.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arBjk-0001VV-8C for emacs-orgmode@gnu.org; Fri, 15 Apr 2016 17:57:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arBjg-0005pL-VE for emacs-orgmode@gnu.org; Fri, 15 Apr 2016 17:57:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:56756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arBjg-0005pC-Oe for emacs-orgmode@gnu.org; Fri, 15 Apr 2016 17:57:08 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1arBjf-00046s-Iy for emacs-orgmode@gnu.org; Fri, 15 Apr 2016 23:57:07 +0200 Received: from 185.32.106.92.dynamic.wline.res.cust.swisscom.ch ([92.106.32.185]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Apr 2016 23:57:07 +0200 Received: from dfeich by 185.32.106.92.dynamic.wline.res.cust.swisscom.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Apr 2016 23:57:07 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org Hi Robert Eckl gmx.de> writes: > > 8.3.4 / 8.3.4-15-gdd9be3-elpaplus). So this must be an incompatibility > > introduced in the emacs core development. > > > The bug seems to be introduced after emacs commit c23c965bb9d0 > Thanks for the pointer. I can see that something with the timezones was changed, but cursorily looking just showed me some changes in the comments. I only had time now to have a closer look. But I decided to try fix it in org mode, since this seemed easier. The problematic statement is in org.el, defun org-timestamp-change, where the argument list to encode time evaluates to something like (encode-time 0 0 0 30 11 2013 '(nil nil nil)) i.e. the 7th argument is a list, while the function would be ok with getting the three nil values not packed into a list. So, just introducing an "apply" in front fixes this for now. So from the following code in org-timestamp-change ... (setq time (encode-time (or (car time0) 0) (+ (if (eq org-ts-what 'minute) n 0) (nth 1 time0)) (+ (if (eq org-ts-what 'hour) n 0) (nth 2 time0)) (+ (if (eq org-ts-what 'day) n 0) (nth 3 time0)) (+ (if (eq org-ts-what 'month) n 0) (nth 4 time0)) (+ (if (eq org-ts-what 'year) n 0) (nth 5 time0)) (nthcdr 6 time0))) ... I just modify to the following ... (setq time (apply 'encode-time (or (car time0) 0) (+ (if (eq org-ts-what 'minute) n 0) (nth 1 time0)) (+ (if (eq org-ts-what 'hour) n 0) (nth 2 time0)) (+ (if (eq org-ts-what 'day) n 0) (nth 3 time0)) (+ (if (eq org-ts-what 'month) n 0) (nth 4 time0)) (+ (if (eq org-ts-what 'year) n 0) (nth 5 time0)) (nthcdr 6 time0))) ... Afterwards the time shifts on the clock lines works fine, again. But I do not know whether this fixes all cases, or what really is the deeper reason that this error surfaced right now. Cheers, Derek