unhammer / org-upcoming-modeline

📅 Show upcoming org event in modeline
https://www.reddit.com/r/emacs/comments/k1e4eu/show_next_orgappointment_in_modeline/
GNU General Public License v2.0
31 stars 6 forks source link

filter out some tags like DONE #11

Closed fuyu0425 closed 1 year ago

fuyu0425 commented 1 year ago

Hi, first thanks for this package!

It will be good to support filtering out some TODO states like DONE because sometimes the timestamp might be properly closed. Like if I create a timestamp without SCHEDULED beforehand; sometimes I manually mark items as DONE without closing the timestamp.

I know the above issues can be solved by closing the timestamp, but it would be good if we can have this feature.

I have manually modified org-upcoming-modeline--find-event like the following and it works fine.

(org-ql-select (org-agenda-files)
                  `(and (ts-upcoming :from ,start-time
                                :to ,end-time)
                        (not (todo "DONE")))

I think we can have a variable to specify TODO states we want to filter.

Thanks!

unhammer commented 1 year ago

That sounds like a good idea :-) Would you like to make a PR?

fuyu0425 commented 1 year ago

I have made a PR. default value for org-upcoming-modeline-ignored-keywords is nil. Not sure whether make it to '("DONE") instead.

morgandavidson commented 1 year ago

Might be useful to mention that feature in the documentation/README.org.

unhammer commented 1 year ago

https://github.com/unhammer/org-upcoming-modeline/#usage does mention that there are Customize options, but PR's welcome :)

morgandavidson commented 1 year ago

remote: Permission to unhammer/org-upcoming-modeline.git denied to morgandavidson.

Replacement of Usage section by:

* Configuration
** Basic
#+begin_src emacs-lisp
  (use-package org-upcoming-modeline
    :after org                               ; if you don't want it to start until org has been loaded
    :load-path "~/src/org-upcoming-modeline" ; if you installed manually
    :config
    (org-upcoming-modeline-mode))
#+end_src
** Advanced
- =org-upcoming-modeline-ignored-keywords=  allows you to exclude TODO states. Example excluding "BACKLOG" and "NEXT" states:
  #+begin_src emacs-lisp 
    (setq org-upcoming-modeline-ignored-keywords '("BACKLOG" "NEXT")
  #+end_src
- =org-upcoming-modeline-format= allows you to modify the displaying format. Example removing the alarm clock icon:
  #+begin_src emacs-lisp 
    (setq org-upcoming-modeline-format (lambda (title header) (format "%s: %s" title header)))
  #+end_src
- =org-upcoming-modeline-days-ahead= allows you to fix the number of days to look into the future (1 by default). Example looking for 15 days ahead:
#+begin_src emacs-lisp 
    (setq org-upcoming-modeline-days-ahead 15)
#+end_src
- See =M-x customize-group RET org-upcoming-modeline= for additional functionalities.
unhammer commented 1 year ago

You need to click the big Fork button and push to your own copy, then when you open your repo it'll have a "make a PR" link

morgandavidson commented 1 year ago

Ok, I tried to send you my branch. I'll then fork your repo instead of cloning it.