org-agenda.el (org-agenda-set-restriction-lock): Remove restriction lock before setting it

* org-agenda.el (org-agenda-set-restriction-lock): Remove
restriction lock before setting it.

This fixes a small bug: when restriction lock is active on a subtree
and C-c C-x < before the first headline, the new restriction is set to
the entire file, but the old one was still present.
This commit is contained in:
Bastien Guerry 2014-05-25 07:16:15 +02:00
parent 56b47fb71d
commit 866d7eddd0
1 changed files with 1 additions and 0 deletions

View File

@ -7054,6 +7054,7 @@ Restriction will be the file if TYPE is `file', or if type is the
universal prefix '(4), or if the cursor is before the first headline
in the file. Otherwise, restriction will be to the current subtree."
(interactive "P")
(org-agenda-remove-restriction-lock 'noupdate)
(and (equal type '(4)) (setq type 'file))
(setq type (cond
(type type)