Hello,

To reproduce the bug:

1. emacs -Q --eval "(require 'org-habit)"
2. Open the following org file:

---------------begin----------------------
* TODO foo
SCHEDULED: <2023-02-01 Wed .+2d/4d>
:PROPERTIES:
:STYLE:    habit
:CATEGORY: foo
:END:

* TODO bar
SCHEDULED: <2023-02-01 Wed>
------------- end ----------------------

3. M-x org-agenda, then press < a to create an agenda buffer
4. Go to the line containing foo, press <

Expected result: the agenda buffer shows only foo

Actual result:
org-agenda-filter-by-category: No category at point
From 2ac07aeb64d0b12708b54ec8ef26265c64af630e Mon Sep 17 00:00:00 2001
From: Liu Hui <liuhui1...@gmail.com>
Date: Wed, 1 Feb 2023 13:35:49 +0800
Subject: [PATCH] org-agenda: Fix `org-agenda-filter-by-category'

* lisp/org-agenda.el (org-agenda-filter-by-category): Use
`org-agenda-get-category' to get the category at current line.
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 4396efe81..1d1f2271b 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -8210,7 +8210,7 @@ (defun org-agenda-filter-by-category (strip)
   (if (and org-agenda-filtered-by-category
 	   org-agenda-category-filter)
       (org-agenda-filter-show-all-cat)
-    (let ((cat (org-no-properties (org-get-at-eol 'org-category 1))))
+    (let ((cat (org-no-properties (org-agenda-get-category))))
       (cond
        ((and cat strip)
         (org-agenda-filter-apply
-- 
2.25.1

Reply via email to