mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-23 07:18:53 +00:00
org-agenda.el (org-agenda-remove-filter): Use `save-excursion'
* org-agenda.el (org-agenda-remove-filter): Use `save-excursion'.
This commit is contained in:
parent
fe0057556b
commit
1d57e1ac9a
@ -7655,17 +7655,18 @@ When NO-OPERATOR is non-nil, do not add the + operator to returned tags."
|
||||
(defun org-agenda-remove-filter (type)
|
||||
(interactive)
|
||||
"Remove filter of type TYPE from the agenda buffer."
|
||||
(goto-char (point-min))
|
||||
(let ((inhibit-read-only t) pos)
|
||||
(while (setq pos (text-property-any (point) (point-max) 'org-filter-type type))
|
||||
(goto-char pos)
|
||||
(remove-text-properties
|
||||
(point) (next-single-property-change (point) 'org-filter-type)
|
||||
`(invisible t org-filter-type ,type))))
|
||||
(set (intern (format "org-agenda-%s-filter" (intern-soft type))) nil)
|
||||
(setq org-agenda-filter-form nil)
|
||||
(org-agenda-set-mode-name)
|
||||
(org-agenda-finalize))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(let ((inhibit-read-only t) pos)
|
||||
(while (setq pos (text-property-any (point) (point-max) 'org-filter-type type))
|
||||
(goto-char pos)
|
||||
(remove-text-properties
|
||||
(point) (next-single-property-change (point) 'org-filter-type)
|
||||
`(invisible t org-filter-type ,type))))
|
||||
(set (intern (format "org-agenda-%s-filter" (intern-soft type))) nil)
|
||||
(setq org-agenda-filter-form nil)
|
||||
(org-agenda-set-mode-name)
|
||||
(org-agenda-finalize)))
|
||||
|
||||
(defun org-agenda-filter-show-all-tag nil
|
||||
(org-agenda-remove-filter 'tag))
|
||||
|
Loading…
Reference in New Issue
Block a user