Browse Source

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.
Bastien Guerry 11 years ago
parent
commit
866d7eddd0
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lisp/org-agenda.el

+ 1 - 0
lisp/org-agenda.el

@@ -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)