From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:700:3204::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mMfpM+I9h2WBMAAAkFu2QA (envelope-from ) for ; Sat, 23 Dec 2023 21:06:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id wHZWLOI9h2VsQQEAe85BDQ (envelope-from ) for ; Sat, 23 Dec 2023 21:06:58 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=EPx7OC40; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703362018; 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: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=1pasTGtbBQwYdoS27EdFhrJJ83GeZm2Owzkh70oxUbM=; b=Fx3j8GSVF9fw2meQkmEzEbjL30Bc8Yt66rDhNnZn4Bfl+Z9nY0fT/cRX72ZzbM7A75h9RL FRUHbkyiFWSX9Jfv+ZWtz/IKsvz6eJlYMlX1FNgxm7+73/6fK6Ygt/kWDp8s90mbVjSnyP XoDWFOsBqUo3GILObIVP+Wpf/A+gu/eiy811Z6xDX9X7GDi/C4xFN3pZZXVEnu8ql1p0Qa skc7xSLqKjbqN6WeqSoGx5PWvNi2p2JvbuuTlg0lAaSa6Jg/AoSTPXD2rXSTVI5avIwovo UqZ6rV5wCG/BiyPsquhdz2q+wY98+BvFgoJyAbc2HleWIyEXVaGmB7L0djUFAA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=outlook.com header.s=selector1 header.b=EPx7OC40; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=outlook.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1703362018; a=rsa-sha256; cv=pass; b=PnImP7ykXJ6fAPrF4mpn7LxUlgxt0KAsCO9wq2waWJsLFzyXpLJKVB/eMxG47rJqzL5Hbh qzpuzTmLqhirvWjDm/j4lnSDVOOmrk/t5peC+Vnv6M5KNmCY8MMWFPsjP/aY2CKF8ugbvX zNCVLt+Rg7tn/+BV5oRxl2Xox1S0NBkw7+jR13uqXnnQJt7JyEac5bmK6M7URqtvT9EqG7 8jn0WUyfKhffbfvTzqtAcT6hxG3alZN8iAipe72vddClBydKwQl2J97kM6GtDhHoXGtqZH KSdZ8gVnDiQo2J/N1iU91IrEqH0At6FEpF2PpY4TgGPiD9EP5NxAsVQIGXtY/w== 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 6EFA25C58C for ; Sat, 23 Dec 2023 21:06:58 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rH8Fy-00044m-K2; Sat, 23 Dec 2023 15:05:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rH8Fw-00044X-OU for emacs-orgmode@gnu.org; Sat, 23 Dec 2023 15:05:56 -0500 Received: from mail-bn7nam10olkn20800.outbound.protection.outlook.com ([2a01:111:f403:2804::800] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rH8Fu-0004Jz-U4 for emacs-orgmode@gnu.org; Sat, 23 Dec 2023 15:05:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7TPIYJISsqDHVAGjh+POqROl5Us7BlK6imEzT5zC/vaPYENE/NBMSeBjaUZTVgDrQJHofQnDTNr0HQxL+W7euKeDyFdaLA7xdCEemOtUrfOKk8rOGSEujxlLtevP691i0G88AfI/myS0R393MleD0fy0F2iJA/7IwyCw6DM1obqpQEG0sPcFspY6/CF3MczsompUG1xyZ9rlfWcyAE4O3rvLQTQPZZHivVM1nQop28DBn1WNKTTf7hgOpuizdTAvY+XvVSAmbjkAoV5ufTg5RKwrQ4zTwPAkWpd9D1guRf14JHEfPWYfNwBDcQ5pfU9+yZ4/2WnLzTSbeNgKxUfLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1pasTGtbBQwYdoS27EdFhrJJ83GeZm2Owzkh70oxUbM=; b=aap4vvdJ9WZ3qjrMuZuJYAqjOnmrceWNlpP7DU4vRnPRCzkY6C/1NaxMvZ8RHcGaYA2BPXKJYEKt1LVCmYop3d8MathMbn+VjD5fz0zdmO9/zegAWhej30Ud6UYjDDrb7dvxu5AWLo3d746O3SXardBrc0hPIgr6XJtZteI0FFZnQjmT9NhGw7Moay+80XjYUlfNz4Pm03Jl6Ekbwhjhsf2xIJw+oFs8w3ouixmRQfmPMUUaS+i80nhwJ5IeaY2F8tnAL3hIIlwkumOVYT+K46+zuP9JQj5i9OlOFDtmY27DZNiyVnQPvpzQXlTflPLB55PkaJ0+Kbwc+mlwgXUqlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1pasTGtbBQwYdoS27EdFhrJJ83GeZm2Owzkh70oxUbM=; b=EPx7OC40UIaMDjk4oZW0SJpkba37bKkmE7zXFjnRPTMG/SwoQSfDY3pdyi/Yw6dUuy9HF+cBwbCEQJggT+Ps0sxgACZaSmLUvEoJ7nM57+8L8UeHtxMAtVywPJcguS4XSmnTDDNHUO1ZX+imoleOTwHTSKci7bCtWMdRw9BmFfG6Hmu5jKRtsHqgU5KlcZxxUooLK/pOTj9P4gZ/89yJrrReDeSSwqRyz15taZgV+xXGAamCXlhOFxjGf5cLZG6C2nyO9rgq9ZZj0ZAWA25ZidqU5rkoo/XQWgfEcltar1WlPr8QtgkZRkjTkKIiDdmutVi8uexFLk0cRVQ0PBZTwA== Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) by LV3PR84MB3377.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:408:1d1::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.24; Sat, 23 Dec 2023 20:00:52 +0000 Received: from CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d3da:3eb4:4e7d:440c]) by CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM ([fe80::d3da:3eb4:4e7d:440c%5]) with mapi id 15.20.7113.023; Sat, 23 Dec 2023 20:00:52 +0000 From: Morgan Smith To: emacs-orgmode@gnu.org Subject: [PATCH] lisp/org-agenda.el: Check agenda type earlier Date: Sat, 23 Dec 2023 14:58:53 -0500 Message-ID: X-Mailer: git-send-email 2.41.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [mdA063FYgze1EMLEXArB/kv++3UVn42t4x607wk75ec=] X-ClientProxiedBy: YQBPR0101CA0351.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:6b::10) To CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM (2603:10b6:610:1c4::17) X-Microsoft-Original-Message-ID: <20231223195852.14201-2-Morgan.J.Smith@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR84MB3424:EE_|LV3PR84MB3377:EE_ X-MS-Office365-Filtering-Correlation-Id: c1be404b-c424-4fc6-e6f9-08dc03f1ddf9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AXEwDAd8j1KuSrITu/ZTrR53DSNRjHbf23emNLw+oCd8/BduBv9U/QQx1vDsLLtIE4sEJPGLvabRI54ymZCIOsnCK7rfWafSFDK7cdrPhmEcVhgabV3a/zrtREWaupZ6p/uEg2tk41r83sKrJhGOWJ8+DCACHpnxj8Pl7hi/+EZbinI9FGbUsvg3fyY/nwjX43bDK9bFN4DJGqG5MpIhdNfP2Z4SJPuqObS1Vc6P2Iou0lpFIALnc5+nmsySAmnWDJWQrCltos+r0mApZ7ZskxCfEqjXfgY6bdbQFBItxzOJqdM8B9TXOhR8rSilfJ+DFJOqGtbYMJB0wsyzseDbb2BX2xAUw690u36+rR2EH4K5Ce1Lr4k1tYGt9qL2Yv03F+/r44cJuIRc2ihniYkUdQd2d2K1zZ+4a+DmvXY83k+6xDilNHifHqjBMbpIU2Nc4dlC8aS5NPakAran2KpqoFsm5eQABdCc+IuOuqVZeDygKavv5dr5qrJJzf8kAISoTD7RCJlJ3JHm1vXrWcTOgEv92rbXNInQ8EUg9FXG7fpmI+IDH9w7gbS8zkIPio3t X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YYUjRW8P2LyYJD8vABbF3QKfWfFzWCkYe4a0mPdDnPUAAcF2lrvsaQ9llBON?= =?us-ascii?Q?J0VrMMoMVFiVYkritEJQpltJD7WnpMlt7BYYVL3nOLztJ+WXa0ZPfA/M0NHx?= =?us-ascii?Q?dKpcdD42qjR6+RYphSZ1FzvtDO6QKXqnPaxfLNKyupN5djuAYqP64+dY66SV?= =?us-ascii?Q?GT3/+yP6gCuvmVfgFwyKo8WJjGZTa/OiemNWiQK9B0r3D5C1vFVLTvvrgPEG?= =?us-ascii?Q?zn8aZ89v5ina6c100YnNiH/0vGoUQz57scKyfXt2BE8+XZdhg0PUbRc9HjYA?= =?us-ascii?Q?zf9Cp5mY9QAInKVmF+sMYMgEVPcDgyVjQ1xkwhk0Fd0vl5w9MiNvEuRk5siD?= =?us-ascii?Q?Tdwa1h4+JrdvcPEvljtsO5J6K8AF59uUKxdK45y3VCO8Z8J7c/dPoRbksNeb?= =?us-ascii?Q?cnRcmYVw5YNG4kZKR/s3jeTRmzQkqO+Z1x0RumEMmAu2ChCZOu5/OSkqgrAt?= =?us-ascii?Q?DrmgPc4zjgXcIl2K30OluF+Ej5nCA5SGEkOewKt5MzzHkzSxKsERgcyq9/4y?= =?us-ascii?Q?NH6N2oV6mrnnGh44k7j6nR/gnwiQu1BuSx0qULHfK7W/i3qQ0vm7FZwJwYFg?= =?us-ascii?Q?KP/AGxxXSfUenewarLgKBiNhYRZTY47NWZVQhXYCsAo/caoKYzG+RK7q7XJE?= =?us-ascii?Q?XWkr926BydpHRrlMEZffjEsnLkkh1F5pVc2KTRl6P2QILvwQl6JLsxmUI+7e?= =?us-ascii?Q?NFoe/94r+PMrONs+Uzubhcv5nbscCZmEUc8tFZ/AzQWkQkMuEm5RDG8xpt8c?= =?us-ascii?Q?yyulfmoN097jgBHLvg7A/klSEm+htIkoLDtCA1PCZvRsz3UdeJJIqErIExaF?= =?us-ascii?Q?wu6IEi+biZb8oETmDiV5QuaJC+GmpnJHNL37Zph/GUOUq3y6euxePlnzfs1/?= =?us-ascii?Q?37ONKlcGe8ytpyPsQVRw4JcmHN2gztXzalDJMMiAvCMuvNBaiNzKUQd3H7co?= =?us-ascii?Q?IT9rywszFUN3OXKDfldyS7prRsee+mWYc5wCATyyXwQXHAukc11TO/PVdHWQ?= =?us-ascii?Q?GgmwaSBtWFeMTkNpDmgVKNTZvZ4A/52UiEVB2Y1QWaGjNFQKzChPBkR6NYsu?= =?us-ascii?Q?F5Qt3bo/QopaoH249m+KTMZgOjsyFkMmG2zxCKuZKwvyg0FiLLYTnpAIU2Tm?= =?us-ascii?Q?xtqlMXnbjBqNWtWM8PWndRsvsZB6mMgHk4UPEeGiPisMglvCARySfNHcpGVh?= =?us-ascii?Q?UobWuxGf+hVRcTYu0e8VsHNsoIULb497H6DqQReCG4+U8prvtDd5xMbfLU4?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1be404b-c424-4fc6-e6f9-08dc03f1ddf9 X-MS-Exchange-CrossTenant-AuthSource: CH3PR84MB3424.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Dec 2023 20:00:52.8098 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR84MB3377 Received-SPF: pass client-ip=2a01:111:f403:2804::800; envelope-from=Morgan.J.Smith@outlook.com; helo=NAM10-BN7-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -9.09 X-Spam-Score: -9.09 X-Migadu-Queue-Id: 6EFA25C58C X-Migadu-Scanner: mx10.migadu.com X-TUID: wVRYI2rrWEI3 lisp/org-agenda.el (org-agenda-goto-date): Check agenda type earlier. Also remove redundant error. When this function is run on a todo agenda the user is given the undescriptive error "(wrong-type-argument listp "todo")" because we attempt to parse the 'org-last-args text-property prematurely. With this change users will get the much better error "Not allowed in 'todo'-type agenda buffer or component". --- lisp/org-agenda.el | 48 +++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index d4dd6d823..9b75ee943 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8598,31 +8598,31 @@ See also: (list (let ((org-read-date-prefer-future org-agenda-jump-prefer-future)) (org-read-date)))) + (org-agenda-check-type t 'agenda) (let* ((day (time-to-days (org-time-string-to-time date))) - (org-agenda-sticky-orig org-agenda-sticky) - (org-agenda-buffer-tmp-name (buffer-name)) - (args (get-text-property (min (1- (point-max)) (point)) 'org-last-args)) - (0-arg (or current-prefix-arg (car args))) - (2-arg (nth 2 args)) - (with-hour-p (nth 4 org-agenda-redo-command)) - (newcmd (list 'org-agenda-list 0-arg date - (org-agenda-span-to-ndays - 2-arg (org-time-string-to-absolute date)) - with-hour-p)) - (newargs (cdr newcmd)) - (inhibit-read-only t) - org-agenda-sticky) - (if (not (org-agenda-check-type t 'agenda)) - (error "Not available in non-agenda views") - (add-text-properties (point-min) (point-max) - `(org-redo-cmd ,newcmd org-last-args ,newargs)) - (org-agenda-redo) - (goto-char (point-min)) - (while (not (or (= (or (get-text-property (point) 'day) 0) day) - (save-excursion (move-beginning-of-line 2) (eobp)))) - (move-beginning-of-line 2)) - (setq org-agenda-sticky org-agenda-sticky-orig - org-agenda-this-buffer-is-sticky org-agenda-sticky)))) + (org-agenda-sticky-orig org-agenda-sticky) + (org-agenda-buffer-tmp-name (buffer-name)) + (args (get-text-property (min (1- (point-max)) (point)) + 'org-last-args)) + (0-arg (or current-prefix-arg (car args))) + (2-arg (nth 2 args)) + (with-hour-p (nth 4 org-agenda-redo-command)) + (newcmd (list 'org-agenda-list 0-arg date + (org-agenda-span-to-ndays + 2-arg (org-time-string-to-absolute date)) + with-hour-p)) + (newargs (cdr newcmd)) + (inhibit-read-only t) + org-agenda-sticky) + (add-text-properties (point-min) (point-max) + `(org-redo-cmd ,newcmd org-last-args ,newargs)) + (org-agenda-redo) + (goto-char (point-min)) + (while (not (or (= (or (get-text-property (point) 'day) 0) day) + (save-excursion (move-beginning-of-line 2) (eobp)))) + (move-beginning-of-line 2)) + (setq org-agenda-sticky org-agenda-sticky-orig + org-agenda-this-buffer-is-sticky org-agenda-sticky))) (defun org-agenda-goto-today () "Go to today's date in the agenda buffer. -- 2.41.0