From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eMdtB/3L3GDZTwEAgWs5BA (envelope-from ) for ; Wed, 30 Jun 2021 21:54:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id MDciA/3L3GBoHAAAB5/wlQ (envelope-from ) for ; Wed, 30 Jun 2021 19:54:37 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6B5E3214B1 for ; Wed, 30 Jun 2021 21:54:36 +0200 (CEST) Received: from localhost ([::1]:55216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lygI5-0004p4-Tz for larch@yhetil.org; Wed, 30 Jun 2021 15:54:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lygHW-0004of-E6 for emacs-orgmode@gnu.org; Wed, 30 Jun 2021 15:53:58 -0400 Received: from mout01.posteo.de ([185.67.36.65]:42911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lygHQ-0007zE-2Z for emacs-orgmode@gnu.org; Wed, 30 Jun 2021 15:53:57 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id DFA4A240026 for ; Wed, 30 Jun 2021 21:53:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1625082827; bh=Wc7uGMe3YKNtvE8hAvYcReVzHNV8QyGpBnRdW7ibPlg=; h=From:To:Subject:Date:From; b=kpn8HhyT41lPOrMrqznfi0mPO9/19ZYmn3Edbc6XC9MKEBu/PQ+0Niyck5zH59NLH +lozdoMi2Hp3IvwDQWVZKqP+y3WpXZSaD40UQY3fcceB9M+/rPTx6WRdg18jBc7tkJ HrzT1kXhXERud4MYPSfdGV4BQF7H8WwBawLr48ZNnBzeh785ao3O4Wwr1SCVRMy9jU jUfkqbCISo/aG58wwjaxCjME1ObEFVY0TzrylUq/cGTvzXUz4g0ozz6JUQKd637sv9 VslDXasPaPdeZSyBw/npeRPaCS9rsMtnXAzsTrmNavSbHGYVlDPecZDe3PAw9k6j3E 91F2Iana9eFtw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GFX8q2FJRz6tmB for ; Wed, 30 Jun 2021 21:53:47 +0200 (CEST) From: Ingo Lohmar To: emacs-orgmode@gnu.org Subject: [PATCH] Fix timestamp agenda setting global agenda name [9.4.6] Date: Wed, 30 Jun 2021 19:53:46 +0000 Message-ID: <87eecjcenp.fsf@kenko.localhost.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=185.67.36.65; envelope-from=ingo.lohmar@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1625082876; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DVRjSltfpEcFCX0CGlxYT6kkRO+6Sfx3MI28ekEOM6M=; b=O+JOfxy52po+R2zZcyFpJ4Ygtytu91ZhZZfGNlTsC0MLAax8x2AN/hbBQfHajjiUXOLE9q 5oR0o+O7lciZdMLkfhXvL4PfNddKM9nqBX4QVwG2Tz39ZPP2/u9V6DTJXQ1WbbAYlHhZrb ZVoDiBw2lPDMZ9Ab4ie7RPs7yLhD1w7ARsmc+2nFPkVtQoth8uqI1eys+chTEa6dK5YQ0J SJVitZWQygyCy3Q85z+z1fuqA5YcKYsfqL9IRmNnI+KQpX99JmyNahD6Vw0MPt1qOBMnI2 EhLyogSjgiuCGZZZYykcvKQTcjEkMpqt4urDlisr9lDOyysWE0fac6+BB0FQAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625082876; a=rsa-sha256; cv=none; b=Gf8EVT4blveUa8YZTQleaV651EBiyzvs1CKOej3jjbZjXcryLcf+PG6eUoZDB4KeDwRHAR OIKEf/xRgld8PqcwMNKR0Pl3QF4Sv4CQNUBpbU5a0dPOyNbx8Y5rBp1JVWVjOVwG/QO/T2 3hvuSA7A0vZYnXeV/l7GI1rQvILtkGnkHNBJZHmNY1vZ2mmYknIGd5zjFuRt8+OQbezV4W Sgbig1taGiefoREiuYWs0U/YZDm21z3o6siNlDbgz1C+PYTC75kzfNyzgpsiNOz7KpwaWw naHw4XPsTz6yorS9+ejxJqRgxjah2U5q5XX1tEhJ1bXjLNXvS72XsDz0ncy+6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kpn8HhyT; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=kpn8HhyT; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 6B5E3214B1 X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: jnJWpy7OdtOL --=-=-= Content-Type: text/plain Dear All, a few weeks ago, I reported the original bug with a minimal complete example in https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00757.html My first patch attempt was wrongly based on the master branch, see https://lists.gnu.org/archive/html/emacs-orgmode/2021-06/msg00378.html Also, I probably messed up the subject, and replying to my first mail did not work as intended, please accept my apologies for any confusion caused by this. Below, I attach a clean patch against the 'maint' branch. Two tests fail, but the same tests fail on maint w/o my commit. 'make compile' does not complain. I have a copyright assignment for Emacs on file with the FSF. Please let me know of anything else I can do to get the fix in. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-timestamp-agenda-setting-global-agenda-name.patch >From 167bda641e70989a5b679b89f3024f47ec68244c Mon Sep 17 00:00:00 2001 From: Ingo Lohmar Date: Sat, 19 Jun 2021 17:04:56 +0200 Subject: [PATCH] Fix timestamp agenda setting global agenda name * lisp/org.el (org-follow-timestamp-link): Do not set global agenda name The tmp value for the agenda buffer name is used in `org-agenda-list' to set `org-agenda-buffer-name'. Wrap the call in a let-binding for this symbol (like the agenda dispatcher does), since otherwise it inadvertently sets the global value. --- lisp/org.el | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a8b584ee4..467485b2c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9098,24 +9098,26 @@ or to another Org file, automatically push the old position onto the ring." (defvar org-agenda-start-on-weekday) (defun org-follow-timestamp-link () "Open an agenda view for the time-stamp date/range at point." - (cond - ((org-at-date-range-p t) - (let ((org-agenda-start-on-weekday) - (t1 (match-string 1)) - (t2 (match-string 2)) tt1 tt2) - (setq tt1 (time-to-days (org-time-string-to-time t1)) - tt2 (time-to-days (org-time-string-to-time t2))) + ;; Avoid changing the global value. + (let ((org-agenda-buffer-name org-agenda-buffer-name)) + (cond + ((org-at-date-range-p t) + (let ((org-agenda-start-on-weekday) + (t1 (match-string 1)) + (t2 (match-string 2)) tt1 tt2) + (setq tt1 (time-to-days (org-time-string-to-time t1)) + tt2 (time-to-days (org-time-string-to-time t2))) + (let ((org-agenda-buffer-tmp-name + (format "*Org Agenda(a:%s)" + (concat (substring t1 0 10) "--" (substring t2 0 10))))) + (org-agenda-list nil tt1 (1+ (- tt2 tt1)))))) + ((org-at-timestamp-p 'lax) (let ((org-agenda-buffer-tmp-name - (format "*Org Agenda(a:%s)" - (concat (substring t1 0 10) "--" (substring t2 0 10))))) - (org-agenda-list nil tt1 (1+ (- tt2 tt1)))))) - ((org-at-timestamp-p 'lax) - (let ((org-agenda-buffer-tmp-name - (format "*Org Agenda(a:%s)" (substring (match-string 1) 0 10)))) - (org-agenda-list nil (time-to-days (org-time-string-to-time - (substring (match-string 1) 0 10))) - 1))) - (t (error "This should not happen")))) + (format "*Org Agenda(a:%s)" (substring (match-string 1) 0 10)))) + (org-agenda-list nil (time-to-days (org-time-string-to-time + (substring (match-string 1) 0 10))) + 1))) + (t (error "This should not happen"))))) ;;; Following file links -- 2.30.2 --=-=-=--