From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oAFIJRIMJ1/VFQAA0tVLHw (envelope-from ) for ; Sun, 02 Aug 2020 18:55:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UCoPIRIMJ1+tFAAAB5/wlQ (envelope-from ) for ; Sun, 02 Aug 2020 18:55:14 +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 443309402C2 for ; Sun, 2 Aug 2020 18:55:14 +0000 (UTC) Received: from localhost ([::1]:34792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2J8b-00042e-5k for larch@yhetil.org; Sun, 02 Aug 2020 14:55:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2J83-00042V-3X for emacs-orgmode@gnu.org; Sun, 02 Aug 2020 14:54:39 -0400 Received: from mail-qv1-xf34.google.com ([2607:f8b0:4864:20::f34]:44336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k2J81-000690-CF for emacs-orgmode@gnu.org; Sun, 02 Aug 2020 14:54:38 -0400 Received: by mail-qv1-xf34.google.com with SMTP id r19so7919913qvw.11 for ; Sun, 02 Aug 2020 11:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=mr69th1acM9LcciVWm97yAUMj57UbSyqrUWJYzzJIHs=; b=BNW4jehjk2+I7OOK+RLwKfKbG+IX8QIF1WPjYDJ9FzaClR++YNTQFNAKrkIOVB00Uj WeDVCKBLh63nnn0b4V7ZLjvXiSx0bOod3hcOrxOuoOfhQCTA2IthnEy/HIcdD7vP48NU GcS3ftMuw8d336kG9nZEQtzgOp1/WAmBGOfNw0rizMwnD146oN+lk2dORYsQGCZ6j35f fivNn/mLtt2mD9syIjFu8in9u/MIWzJRl35A0cNC0AIGQp69nY+UECUeU0ElGDbSeMXR yYrt4VZf+MA2NWyMbqGx4tBAJZyL6b/yUP7Juc8UJ6PYNDr6CxlDNneZ4A2iDDXiN/K0 h4+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=mr69th1acM9LcciVWm97yAUMj57UbSyqrUWJYzzJIHs=; b=cKoJ0bwiC0vCUnJLRI04us4OF7VBvEhmpukXwQ8VfPTo9dFmp/NFEk6Cw9qb84TUzB 7643DG4l28A+wbUOasRveV/uolhhcZ6kWRu4V8SPp9t/PkdhzUcw1gR0pgDdTrcDY+BQ A9FVcG8y+lejH/+e4pk6FwrfbmiHPCMsC9/m/Fd0lackLLL72MHLMX5wAmEnY3/UA7pf +xhcgprZGAI1Dy8a3uua9RjgqwvcHj12EN1cF2eWk2PKzKkhsHRoZlaBjyvmgcF/xO0H ge7XLQAXcIJWfymHW930v4ycAtd89+QT7Q/+GkcIHnLA7A6er3/iHxFZdq29l8Dgw0/p JCLw== X-Gm-Message-State: AOAM531HGi9p2Zpiz/TYAj0McA3jVLfAUEVIuNHdXiKdCp9pg6GrlMh+ tWC3kw+0QFKq9BrPMFqTrZo= X-Google-Smtp-Source: ABdhPJzDC3yyMFHL+y8ZoUMjdEQ/56xbNwTamHu8f0EBGXDL6Z5roQRK82Wuo0LCfMHO7fd7VJpsFw== X-Received: by 2002:a0c:e102:: with SMTP id w2mr13512281qvk.51.1596394475928; Sun, 02 Aug 2020 11:54:35 -0700 (PDT) Received: from arch ([2601:8b:c300:1024:1266:d0ff:1635:f964]) by smtp.gmail.com with ESMTPSA id r48sm20718612qtr.17.2020.08.02.11.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 11:54:35 -0700 (PDT) User-agent: mu4e 1.5.5; emacs 28.0.50 From: No Wayman To: emacs-orgmode@gnu.org, No Wayman Subject: [PATCH] org-get-cursor-date regexp patch Date: Sun, 02 Aug 2020 14:54:34 -0400 Message-ID: <87tuxkc1zp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::f34; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qv1-xf34.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=BNW4jehj; dmarc=pass (policy=none) header.from=gmail.com; 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-Spam-Score: -1.71 X-TUID: puonPXeZ+U/s --=-=-= Content-Type: text/plain; format=flowed The regular expression in `org-get-cursor-date' assumes the time grid string will have two digits in the hour portion of the time strng. However, the grid time string does not always have two digits. For example: " 8:00......" The attached patch accounts for this and uses the rx macro to communicate the intent of the regular expression more clearly. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org.el-org-get-cursor-date-Fix-regular-expression.patch Content-Description: org-get-cursor-date-regexp-fix >From 4724b4cc5e9600da60b465c4c2f1968b75c7c31d Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Sun, 2 Aug 2020 14:42:34 -0400 Subject: [PATCH] org.el: (org-get-cursor-date): Fix regular expression * lisp/org.el Fix regular expression. --- lisp/org.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index ee8be256d..37136cc48 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -18728,10 +18728,11 @@ If WITH-TIME is non-nil, returns the time of the event at point (in the agenda) or the current time of the day; otherwise returns the earliest time on the cursor date that Org treats as that date (bearing in mind `org-extend-today-until')." - (let (date day defd tp hod mod) + (let ((hhmm-regexp (rx (seq (group (** 1 2 digit)) ":" (group (= 2 digit))))) + date day defd tp hod mod) (when with-time (setq tp (get-text-property (point) 'time)) - (when (and tp (string-match "\\([0-9][0-9]\\):\\([0-9][0-9]\\)" tp)) + (when (and tp (string-match hhmm-regexp tp)) (setq hod (string-to-number (match-string 1 tp)) mod (string-to-number (match-string 2 tp)))) (or tp (let ((now (decode-time))) -- 2.27.0 --=-=-=--