Skip to content

Commit

Permalink
org-agenda-remove-restriction-lock: Remove 'file restriction
Browse files Browse the repository at this point in the history
* lisp/org-agenda.el (org-agenda-remove-restriction-lock): Remove
agenda restriction set by `org-agenda-set-restriction-lock' called
with prefix argument.  `org-agenda-restrict' may be nil while
`org-agenda-overriding-restriction' is non-nil.

Fixes https://list.orgmode.org/87v8w2qdgp.fsf@gmail.com
  • Loading branch information
yantar92 committed Jul 17, 2022
1 parent 702b0a8 commit df0e96b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lisp/org-agenda.el
Original file line number Diff line number Diff line change
Expand Up @@ -7924,11 +7924,14 @@ subtree."
(defun org-agenda-remove-restriction-lock (&optional noupdate)
"Remove agenda restriction lock."
(interactive "P")
(if (not org-agenda-restrict)
(if (not (or org-agenda-restrict org-agenda-overriding-restriction))
(message "No agenda restriction to remove.")
(delete-overlay org-agenda-restriction-lock-overlay)
(delete-overlay org-speedbar-restriction-lock-overlay)
(setq org-agenda-overriding-restriction nil)
(unless org-agenda-keep-restricted-file-list
;; There is a request to keep the file list in place
(put 'org-agenda-files 'org-restrict nil))
(setq org-agenda-restrict nil)
(put 'org-agenda-files 'org-restrict nil)
(move-marker org-agenda-restrict-begin nil)
Expand Down

0 comments on commit df0e96b

Please sign in to comment.