From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id mOqHMXHMBl92CAAA0tVLHw (envelope-from ) for ; Thu, 09 Jul 2020 07:51:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2MEuLXHMBl8WGwAAbx9fmQ (envelope-from ) for ; Thu, 09 Jul 2020 07:51:13 +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 C87519400C5 for ; Thu, 9 Jul 2020 07:51:12 +0000 (UTC) Received: from localhost ([::1]:37554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtRKp-0000mJ-QC for larch@yhetil.org; Thu, 09 Jul 2020 03:51:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44446) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtRKV-0000m9-9G for emacs-orgmode@gnu.org; Thu, 09 Jul 2020 03:50:51 -0400 Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:59692 helo=ciao.gmane.io) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtRKT-0002XQ-QU for emacs-orgmode@gnu.org; Thu, 09 Jul 2020 03:50:50 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1jtRKQ-0003SM-J4 for emacs-orgmode@gnu.org; Thu, 09 Jul 2020 09:50:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Nick Dokos Subject: Re: [PATCH] agenda: Fold case when retrieving user-configured effort values Date: Thu, 09 Jul 2020 03:50:39 -0400 Message-ID: <87a709ktyo.fsf@pierrot.dokosmarshall.org> References: <87eepmkn1j.fsf@pierrot.dokosmarshall.org> <87d0555mpw.fsf@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:bdBT1olUM5euqb4hhAfjt5AHSGs= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/09 03:31:50 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 30 X-Spam_score: 3.0 X-Spam_bar: +++ X-Spam_report: (3.0 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, FUZZY_DR_OZ=1, HEADER_FROM_DIFFERENT_DOMAINS=1, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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: -0.41 X-TUID: 3y3qVEheKcG3 Kyle Meyer writes: > Nick Dokos writes: > >> BTW, I just thought of a possible problem: the manual says that property >> keys are case-insensitive (although all the examples I can find spell >> "_ALL" in upper case, but if I write >> >> :PROPERTIES: >> :foo_all: bar baz >> :END: >> >> I don't think that the code is going to handle it correctly. There >> are other places that also use "_ALL" without a let of case-fold-search >> (at least AFAICT). >> >> Am I paranoid or is this a problem? > > case-fold-search is let-bound to t at the beginning of > org-buffer-property-keys, so the added string-match is covered. > Wow - not only paranoid but blind as well. > When collecting keys, there's no attempt to normalize to upper or lower, > so the delete-dups call won't take care of any keys that are present in > various case styles. I don't think that's something worth worrying > about (and perhaps it's even preferable, since we can't know which > variant the caller would want to complete). > > As for other spots in the code base: looking through grep hits for > "_ALL", it seems like most should be okay because they go through > org-entry-get. Two places in org-agenda are case-sensitive, though. > > -- >8 -- > Subject: [PATCH] agenda: Fold case when retrieving user-configured effort > values > > * lisp/org-agenda.el (org-agenda-filter-by-effort): > (org-agenda-filter-completion-function): Ignore case when querying > effort property key in org-global-properties since property keys are > documented as case-insensitive. > --- > lisp/org-agenda.el | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 90129b23e..5c2933b0a 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -7611,8 +7611,9 @@ (defun org-agenda-filter-by-effort (strip-or-accumulate) > consistency with the other filter commands." > (interactive "P") > (let* ((efforts (split-string > - (or (cdr (assoc (concat org-effort-property "_ALL") > - org-global-properties)) > + (or (cdr (assoc-string (concat org-effort-property "_ALL") > + org-global-properties > + t)) > "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00"))) > ;; XXX: the following handles only up to 10 different > ;; effort values. > @@ -7777,8 +7778,9 @@ (defun org-agenda-filter-completion-function (string _predicate &optional flag) > (org-agenda-get-represented-tags)))) > ((member operator '("<" ">" "=")) > (setq table (split-string > - (or (cdr (assoc (concat org-effort-property "_ALL") > - org-global-properties)) > + (or (cdr (assoc-string (concat org-effort-property "_ALL") > + org-global-properties > + t)) > "0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00") > " +"))) > (t (setq table nil))) > > base-commit: eac255d911e0793513b2e2f14b06b94194a04daf Thanks! LGTM. -- Nick