emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Allow tags containing capital letters in org-agenda-filter
@ 2021-02-11  4:12 Ihor Radchenko
  2021-02-15  5:57 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Ihor Radchenko @ 2021-02-11  4:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

Hi,

I recently noticed that org-agenda-filter does not match tags with
capital letters because all the stored tags in agenda are downcased. The
attached patch is fixing the issue. Though, ideally, it would be better
if agenda filter were case-sensitive for tags.

Best,
Ihor

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-tags-containing-capital-letters-in-org-agenda-.patch --]
[-- Type: text/x-diff, Size: 1434 bytes --]

From 9d7a966497458bdb0ab5e5171d2bab1fa8612bc5 Mon Sep 17 00:00:00 2001
From: Ihor Radchenko <yantar92@gmail.com>
Date: Thu, 11 Feb 2021 12:03:15 +0800
Subject: [PATCH] Allow tags containing capital letters in org-agenda-filter

* lisp/org-agenda.el (org-agenda-filter): Downcase tags in the search
string provided by user.  This is needed because all the tags stored
in 'tags text property are downcased.

Example when old code did not work is a tag like COMMON.  The user
would not expect a need to input +|-common in the agenda filter
instead of +|-COMMON.  The latter would only result in
"COMMON filter ignored because tag/category is not represented".
---
 lisp/org-agenda.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 90920ef41..0845d0ca6 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7767,8 +7767,8 @@ the variable `org-agenda-auto-exclude-function'."
 	  (setq s (replace-regexp-in-string ; Remove the temporary special string.
 		   "~~~" "-" (match-string 3 f-string)))
 	  (cond
-	   ((member s tag-list)
-	    (add-to-list 'ft (concat pm s) 'append 'equal))
+	   ((member (downcase s) tag-list)
+	    (add-to-list 'ft (concat pm (downcase s)) 'append 'equal))
 	   ((member s category-list)
 	    (add-to-list 'fc (concat pm ; Remove temporary double quotes.
 				     (replace-regexp-in-string "\"\\(.*\\)\"" "\\1" s))
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Allow tags containing capital letters in org-agenda-filter
  2021-02-11  4:12 [PATCH] Allow tags containing capital letters in org-agenda-filter Ihor Radchenko
@ 2021-02-15  5:57 ` Kyle Meyer
  0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2021-02-15  5:57 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Ihor Radchenko writes:

> Hi,
>
> I recently noticed that org-agenda-filter does not match tags with
> capital letters because all the stored tags in agenda are downcased.
> The attached patch is fixing the issue. Though, ideally, it would be
> better if agenda filter were case-sensitive for tags.

I agree, though I also agree that you're patch is an improvement.
Pushed (75ccb9719).

Thanks.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-15  5:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11  4:12 [PATCH] Allow tags containing capital letters in org-agenda-filter Ihor Radchenko
2021-02-15  5:57 ` Kyle Meyer

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).