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 0JteCOqeBl8RbgAA0tVLHw (envelope-from ) for ; Thu, 09 Jul 2020 04:36:58 +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 kCAyBOqeBl8qNQAAB5/wlQ (envelope-from ) for ; Thu, 09 Jul 2020 04:36:58 +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 33C199408E6 for ; Thu, 9 Jul 2020 04:36:57 +0000 (UTC) Received: from localhost ([::1]:51930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtOIo-0007QA-1j for larch@yhetil.org; Thu, 09 Jul 2020 00:36:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33984) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtOII-0007Po-MN for emacs-orgmode@gnu.org; Thu, 09 Jul 2020 00:36:22 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:60869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtOIF-0003xg-Rw for emacs-orgmode@gnu.org; Thu, 09 Jul 2020 00:36:21 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 7382E7BC65; Thu, 9 Jul 2020 00:36:13 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:date:message-id:mime-version:content-type; s=sasl; bh=S57AI/EOwoYU3N7PGo7oh3VSZDY=; b=jyAgA4eXqorP36+KuIPy x8yAftsMdJnhMX2IgABFEj4gDI6V5VsAzC2h5ii4aDPa2mU7LuBnYoVPPPGay6zJ 5W2NeY8HpqAxe72gNgSa759pfidk3C67L0jF3A56e6fFZsT1W2SnybGnB8zWEt7b FFLVbbvnMkTP19jomPCSj9g= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 6B5A97BC64; Thu, 9 Jul 2020 00:36:13 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:date:message-id:mime-version:content-type; s=mesmtp; bh=red849vh9hi1jhzmzsZ7m2oRyh9R9S3pgkOLuaSfD2o=; b=ik1XewUjzWypGr0NMxc4tpprGsHM612k2Ha1WV8f9PqKk2HyLoPnuTbqIz4hvFj9/YNguyaS5oyNBPKvSeZgThSfT7G6VNghFNkcVjF8ShP4ui8Bd2qrTF/H+5Uxs3SFiSQzVfjNNAI9gg+87UHf1OcYzPcyJLV48mi3WuunOdk= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id D5A5F7BC63; Thu, 9 Jul 2020 00:36:12 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: Nick Dokos Subject: [PATCH] agenda: Fold case when retrieving user-configured effort values In-Reply-To: <87eepmkn1j.fsf@pierrot.dokosmarshall.org> Date: Thu, 09 Jul 2020 00:36:11 -0400 Message-ID: <87d0555mpw.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: B7FA6AEC-C19D-11EA-8A62-01D9BED8090B-24757444!pb-smtp1.pobox.com Received-SPF: pass client-ip=64.147.108.70; envelope-from=kyle@kyleam.com; helo=pb-smtp1.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/09 00:36:13 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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: , Cc: emacs-orgmode@gnu.org 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=pobox.com header.s=sasl header.b=jyAgA4eX; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=ik1XewUj; dmarc=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: -1.21 X-TUID: Xf6lW3rOajqA 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. 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 -- 2.26.2