Make pressing `_' twice in agenda remove the effort filter
* lisp/org-agenda.el (org-agenda-filter-by-effort): Pressing `_' again will remove the effort filter. This aligns the command with the tags filter.
This commit is contained in:
parent
8dfe826a0b
commit
8c011126b5
|
@ -7537,9 +7537,13 @@ With two prefix arguments, remove the effort filters."
|
||||||
(mapcar (lambda (n) (mod n 10)) ;turn 10 into 0
|
(mapcar (lambda (n) (mod n 10)) ;turn 10 into 0
|
||||||
(number-sequence 1 (length efforts)))))
|
(number-sequence 1 (length efforts)))))
|
||||||
(op nil))
|
(op nil))
|
||||||
(while (not (memq op '(?< ?> ?=)))
|
(while (not (memq op '(?< ?> ?= ?_)))
|
||||||
(setq op (read-char-exclusive "Effort operator? (> = or <)")))
|
(setq op (read-char-exclusive "Effort operator? (> = or <) or press `_' again to remove filter")))
|
||||||
;; Select appropriate duration. Ignore non-digit characters.
|
;; Select appropriate duration. Ignore non-digit characters.
|
||||||
|
(if (eq op ?_)
|
||||||
|
(progn
|
||||||
|
(org-agenda-filter-show-all-effort)
|
||||||
|
(message "Effort filter removed"))
|
||||||
(let ((prompt
|
(let ((prompt
|
||||||
(apply #'format
|
(apply #'format
|
||||||
(concat "Effort %c "
|
(concat "Effort %c "
|
||||||
|
@ -7557,7 +7561,7 @@ With two prefix arguments, remove the effort filters."
|
||||||
;; Numbering is 1 2 3 ... 9 0, but we want
|
;; Numbering is 1 2 3 ... 9 0, but we want
|
||||||
;; 0 1 2 ... 8 9.
|
;; 0 1 2 ... 8 9.
|
||||||
(nth (mod (1- eff) 10) efforts)))))
|
(nth (mod (1- eff) 10) efforts)))))
|
||||||
(org-agenda-filter-apply org-agenda-effort-filter 'effort)))
|
(org-agenda-filter-apply org-agenda-effort-filter 'effort))))
|
||||||
(t (org-agenda-filter-show-all-effort)
|
(t (org-agenda-filter-show-all-effort)
|
||||||
(message "Effort filter removed"))))
|
(message "Effort filter removed"))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue