* [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)]
@ 2022-03-25 15:05 Visuwesh
2022-03-26 9:04 ` [PATCH] " Ihor Radchenko
0 siblings, 1 reply; 7+ messages in thread
From: Visuwesh @ 2022-03-25 15:05 UTC (permalink / raw)
To: emacs-orgmode
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen. You don't know how to make a good report? See
https://orgmode.org/manual/Feedback.html#Feedback
Your bug report will be posted to the Org mailing list.
------------------------------------------------------------------------
C-u C-c C-x < followed by C-c C-x > does not remove the file restriction
lock.
`org-agenda-remove-restriction-lock' checks for non-nil value of
`org-agenda-restriction' but `org-agenda-set-restriction-lock' explicitly
sets it to nil when TYPE is 'file. Setting `org-agenda-restriction' to
a dummy value like 'dummy gets the job done.
Emacs : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars)
Package: Org mode version 9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)]
2022-03-25 15:05 [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)] Visuwesh
@ 2022-03-26 9:04 ` Ihor Radchenko
2022-07-17 12:09 ` Ihor Radchenko
0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2022-03-26 9:04 UTC (permalink / raw)
To: Visuwesh; +Cc: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 595 bytes --]
Visuwesh <visuweshm@gmail.com> writes:
> C-u C-c C-x < followed by C-c C-x > does not remove the file restriction
> lock.
>
> `org-agenda-remove-restriction-lock' checks for non-nil value of
> `org-agenda-restriction' but `org-agenda-set-restriction-lock' explicitly
> sets it to nil when TYPE is 'file. Setting `org-agenda-restriction' to
> a dummy value like 'dummy gets the job done.
Confirmed.
The fix is attached.
Setting org-agenda-restriction to non-nil appears to be risky since
org-agenda-set-restriction-lock explicitly sets it to nil. So, I use
different approach.
Best,
Ihor
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-remove-restriction-lock-Remove-file-restr.patch --]
[-- Type: text/x-patch, Size: 1670 bytes --]
From 65aa484f15a8ebbd14161978e1e9a881048e0715 Mon Sep 17 00:00:00 2001
Message-Id: <65aa484f15a8ebbd14161978e1e9a881048e0715.1648285356.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Sat, 26 Mar 2022 16:57:05 +0800
Subject: [PATCH] org-agenda-remove-restriction-lock: Remove 'file restriction
* 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
---
lisp/org-agenda.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9f13f0749..6a2eb18e7 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7446,11 +7446,14 @@ (defun org-agenda-set-restriction-lock (&optional type)
(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)
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)]
2022-03-26 9:04 ` [PATCH] " Ihor Radchenko
@ 2022-07-17 12:09 ` Ihor Radchenko
0 siblings, 0 replies; 7+ messages in thread
From: Ihor Radchenko @ 2022-07-17 12:09 UTC (permalink / raw)
To: Visuwesh; +Cc: emacs-orgmode
Ihor Radchenko <yantar92@gmail.com> writes:
> Visuwesh <visuweshm@gmail.com> writes:
>
>> C-u C-c C-x < followed by C-c C-x > does not remove the file restriction
>> lock.
>>
>> `org-agenda-remove-restriction-lock' checks for non-nil value of
>> `org-agenda-restriction' but `org-agenda-set-restriction-lock' explicitly
>> sets it to nil when TYPE is 'file. Setting `org-agenda-restriction' to
>> a dummy value like 'dummy gets the job done.
>
> Confirmed.
>
> The fix is attached.
> Setting org-agenda-restriction to non-nil appears to be risky since
> org-agenda-set-restriction-lock explicitly sets it to nil. So, I use
> different approach.
Fixed.
Applied onto main via df0e96ba4.
Best,
Ihor
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)]
@ 2022-10-09 7:14 Liu Hui
2022-10-11 2:33 ` Ihor Radchenko
0 siblings, 1 reply; 7+ messages in thread
From: Liu Hui @ 2022-10-09 7:14 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode, visuweshm
[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]
Hi Ihor,
> Ihor Radchenko <yantar92@gmail.com> writes:
>
> > Visuwesh <visuweshm@gmail.com> writes:
> >
> >> C-u C-c C-x < followed by C-c C-x > does not remove the file restriction
> >> lock.
> >>
> >> `org-agenda-remove-restriction-lock' checks for non-nil value of
> >> `org-agenda-restriction' but `org-agenda-set-restriction-lock' explicitly
> >> sets it to nil when TYPE is 'file. Setting `org-agenda-restriction' to
> >> a dummy value like 'dummy gets the job done.
> >
> > Confirmed.
> >
> > The fix is attached.
> > Setting org-agenda-restriction to non-nil appears to be risky since
> > org-agenda-set-restriction-lock explicitly sets it to nil. So, I use
> > different approach.
>
> Fixed.
> Applied onto main via df0e96ba4.
File restriction can be also temporarily set by pressing '<' in the
agenda dispatcher, e.g. pressing 'C-c a < a' in an org-mode file.
`org-agenda-remove-restriction-lock' still cannot remove the temporary
file restriction with the fix.
Setting `org-agenda-restrict' to a non-nil value is a straightforward
way to fixing both cases. The variable is only tested in several
places and I don't find any problem with the change. Therefore I
suggest the attached patch, where the value of `org-agenda-restrict'
is changed from nil to t during temporary and extended file
restriction.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-Make-sure-file-restriction-can-be-removed.patch --]
[-- Type: text/x-diff, Size: 4360 bytes --]
From f4e46051fbb13adadbbafeebab343383e1bca35a Mon Sep 17 00:00:00 2001
From: Liu Hui <liuhui1610@gmail.com>
Date: Sun, 9 Oct 2022 15:00:50 +0800
Subject: [PATCH] org-agenda: Make sure file restriction can be removed
* lisp/org-agenda.el: (org-agenda):
(org-agenda-set-restriction-lock): Set `org-agenda-restrict' non-nil
during both temporary and extended file restriction.
(org-agenda-remove-restriction-lock): Revert commit df0e96ba4.
* testing/lisp/test-org-agenda.el (test-org-agenda/file-restriction):
Add a test.
---
lisp/org-agenda.el | 19 ++++++++-----------
testing/lisp/test-org-agenda.el | 28 ++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 11 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 86ed6a5f5..a4f766cd9 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2962,12 +2962,12 @@ Pressing `<' twice means to restrict to the current subtree or region
(move-marker org-agenda-restrict-begin (point))
(move-marker org-agenda-restrict-end
(progn (org-end-of-subtree t)))))
- ((and (eq restriction 'buffer)
- (or (< 1 (point-min))
- (< (point-max) (1+ (buffer-size)))))
- (setq org-agenda-restrict (current-buffer))
- (move-marker org-agenda-restrict-begin (point-min))
- (move-marker org-agenda-restrict-end (point-max)))))
+ ((eq restriction 'buffer)
+ (if (not (buffer-narrowed-p))
+ (setq org-agenda-restrict t)
+ (setq org-agenda-restrict (current-buffer))
+ (move-marker org-agenda-restrict-begin (point-min))
+ (move-marker org-agenda-restrict-end (point-max))))))
;; For example the todo list should not need it (but does...)
(cond
@@ -7958,7 +7958,7 @@ subtree."
(message "Locking agenda restriction to subtree"))
(put 'org-agenda-files 'org-restrict
(list (buffer-file-name (buffer-base-buffer))))
- (setq org-agenda-restrict nil)
+ (setq org-agenda-restrict t)
(setq org-agenda-overriding-restriction 'file)
(move-marker org-agenda-restrict-begin nil)
(move-marker org-agenda-restrict-end nil)
@@ -7969,14 +7969,11 @@ subtree."
(defun org-agenda-remove-restriction-lock (&optional noupdate)
"Remove agenda restriction lock."
(interactive "P")
- (if (not (or org-agenda-restrict org-agenda-overriding-restriction))
+ (if (not org-agenda-restrict)
(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)
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index 256f701df..bd96163e9 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -255,6 +255,34 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
(get-text-property (point) 'day))))
(org-test-agenda--kill-all-agendas)))
+(ert-deftest test-org-agenda/file-restriction ()
+ "Test file restriction for org agenda."
+ (org-test-with-temp-text-in-file "* TODO Foo"
+ (org-agenda-set-restriction-lock t)
+ (org-agenda nil "t")
+ (should (search-forward "Foo"))
+ (should (org-agenda-files))
+ (should-not (org-agenda-files t))
+ (org-agenda-remove-restriction-lock)
+ (goto-char (point-min))
+ (should-not (search-forward "Foo" nil t))
+ (should-not (org-agenda-files)))
+ (org-test-with-temp-text-in-file "* TODO Bar"
+ (org-agenda nil "t" 'buffer)
+ (should (search-forward "Bar"))
+ (should (org-agenda-files))
+ (should-not (org-agenda-files t))
+ (org-agenda-remove-restriction-lock)
+ (goto-char (point-min))
+ (should-not (search-forward "Bar" nil t))
+ (should-not (org-agenda-files)))
+ (org-test-with-temp-text-in-file "* TODO Bar"
+ (org-agenda nil "t" 'buffer)
+ (org-agenda nil "t")
+ (should-not (search-forward "Bar" nil t))
+ (should-not (org-agenda-files)))
+ (org-test-agenda--kill-all-agendas))
+
\f
;; agenda redo
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)]
2022-10-09 7:14 Liu Hui
@ 2022-10-11 2:33 ` Ihor Radchenko
2022-10-12 6:11 ` Liu Hui
0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2022-10-11 2:33 UTC (permalink / raw)
To: 87pmi46ivt.fsf; +Cc: emacs-orgmode, visuweshm
Liu Hui <liuhui1610@gmail.com> writes:
>> >> C-u C-c C-x < followed by C-c C-x > does not remove the file restriction
>> >> lock.
>> >>
>> >> `org-agenda-remove-restriction-lock' checks for non-nil value of
>> >> `org-agenda-restriction' but `org-agenda-set-restriction-lock' explicitly
>> >> sets it to nil when TYPE is 'file. Setting `org-agenda-restriction' to
>> >> a dummy value like 'dummy gets the job done.
>> >
>> > Confirmed.
>> >
>> > The fix is attached.
>> > Setting org-agenda-restriction to non-nil appears to be risky since
>> > org-agenda-set-restriction-lock explicitly sets it to nil. So, I use
>> > different approach.
>>
>> Fixed.
>> Applied onto main via df0e96ba4.
>
> File restriction can be also temporarily set by pressing '<' in the
> agenda dispatcher, e.g. pressing 'C-c a < a' in an org-mode file.
> `org-agenda-remove-restriction-lock' still cannot remove the temporary
> file restriction with the fix.
>
> Setting `org-agenda-restrict' to a non-nil value is a straightforward
> way to fixing both cases. The variable is only tested in several
> places and I don't find any problem with the change. Therefore I
> suggest the attached patch, where the value of `org-agenda-restrict'
> is changed from nil to t during temporary and extended file
> restriction.
Thanks for the patch! The main issue with all this restriction business
is that `org-agenda-restrict' and other variables used to save
restriction are not documented at all. One has to check all the
instances of their usage to figure out how things work.
Could you please add docstrings and possibly code comments for
`org-agenda-restrict', `org-agenda-restrict-begin',
`org-agenda-restrict-end', `org-agenda-last-dispatch-buffer', and
possibly other elated variables?
This will make things easier for future maintenance.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)]
2022-10-11 2:33 ` Ihor Radchenko
@ 2022-10-12 6:11 ` Liu Hui
2022-10-12 7:44 ` Ihor Radchenko
0 siblings, 1 reply; 7+ messages in thread
From: Liu Hui @ 2022-10-12 6:11 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: emacs-orgmode, visuweshm
[-- Attachment #1: Type: text/plain, Size: 451 bytes --]
Hi Ihor,
Ihor Radchenko <yantar92@gmail.com> writes:
> Could you please add docstrings and possibly code comments for
> `org-agenda-restrict', `org-agenda-restrict-begin',
> `org-agenda-restrict-end', `org-agenda-last-dispatch-buffer', and
> possibly other elated variables?
I have added docstrings for related variables except
`org-agenda-last-dispatch-buffer', which is actually not used by any
other org-mode code. Please see the patch below.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-Make-sure-file-restriction-can-be-removed.patch --]
[-- Type: text/x-diff, Size: 6278 bytes --]
From 907499f16769e5a5353170c13f09595584530139 Mon Sep 17 00:00:00 2001
From: Liu Hui <liuhui1610@gmail.com>
Date: Wed, 12 Oct 2022 14:02:05 +0800
Subject: [PATCH] org-agenda: Make sure file restriction can be removed
* lisp/org-agenda.el: (org-agenda-restrict):
(org-agenda-restrict-begin):
(org-agenda-restrict-end):
(org-agenda-overriding-restriction): add docstrings.
(org-agenda):
(org-agenda-set-restriction-lock): Set `org-agenda-restrict' non-nil
during both temporary and extended file restriction.
(org-agenda-remove-restriction-lock): Revert commit df0e96ba4.
* testing/lisp/test-org-agenda.el (test-org-agenda/file-restriction):
Add a test.
---
lisp/org-agenda.el | 43 +++++++++++++++++++++------------
testing/lisp/test-org-agenda.el | 28 +++++++++++++++++++++
2 files changed, 56 insertions(+), 15 deletions(-)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 86ed6a5f5..82ca2913a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2202,7 +2202,17 @@ string that it returns."
(org-remap org-agenda-mode-map 'move-end-of-line 'org-agenda-end-of-line)
(defvar org-agenda-menu) ; defined later in this file.
-(defvar org-agenda-restrict nil)
+(defvar org-agenda-restrict nil
+ "Non-nil means agenda restriction is active.
+This is an internal flag indicating either temporary or extended
+agenda restriction. Specifically, it is set to t if the agenda
+is restricted to an entire file, and is set to the corresponding
+buffer if the agenda is restricted to a part of a file, e.g. a
+region or a substree. In the latter case,
+`org-agenda-restrict-begin' and `org-agenda-restrict-end' are set
+to the beginning and the end of the part.
+
+See also `org-agenda-set-restriction-lock'.")
(defvar org-agenda-follow-mode nil)
(defvar org-agenda-entry-text-mode nil)
(defvar org-agenda-clockreport-mode nil)
@@ -2734,10 +2744,16 @@ that have been changed along."
;;; Agenda dispatch
-(defvar org-agenda-restrict-begin (make-marker))
-(defvar org-agenda-restrict-end (make-marker))
+(defvar org-agenda-restrict-begin (make-marker)
+ "Internal variable used to mark the restriction beginning.
+It is only relevant when `org-agenda-restrict' is a buffer.")
+(defvar org-agenda-restrict-end (make-marker)
+ "Internal variable used to mark the restriction end.
+It is only relevant when `org-agenda-restrict' is a buffer.")
(defvar org-agenda-last-dispatch-buffer nil)
-(defvar org-agenda-overriding-restriction nil)
+(defvar org-agenda-overriding-restriction nil
+ "Non-nil means extended agenda restriction is active.
+This is an internal flag set by `org-agenda-set-restriction-lock'.")
(defcustom org-agenda-custom-commands-contexts nil
"Alist of custom agenda keys and contextual rules.
@@ -2962,12 +2978,12 @@ Pressing `<' twice means to restrict to the current subtree or region
(move-marker org-agenda-restrict-begin (point))
(move-marker org-agenda-restrict-end
(progn (org-end-of-subtree t)))))
- ((and (eq restriction 'buffer)
- (or (< 1 (point-min))
- (< (point-max) (1+ (buffer-size)))))
- (setq org-agenda-restrict (current-buffer))
- (move-marker org-agenda-restrict-begin (point-min))
- (move-marker org-agenda-restrict-end (point-max)))))
+ ((eq restriction 'buffer)
+ (if (not (buffer-narrowed-p))
+ (setq org-agenda-restrict t)
+ (setq org-agenda-restrict (current-buffer))
+ (move-marker org-agenda-restrict-begin (point-min))
+ (move-marker org-agenda-restrict-end (point-max))))))
;; For example the todo list should not need it (but does...)
(cond
@@ -7958,7 +7974,7 @@ subtree."
(message "Locking agenda restriction to subtree"))
(put 'org-agenda-files 'org-restrict
(list (buffer-file-name (buffer-base-buffer))))
- (setq org-agenda-restrict nil)
+ (setq org-agenda-restrict t)
(setq org-agenda-overriding-restriction 'file)
(move-marker org-agenda-restrict-begin nil)
(move-marker org-agenda-restrict-end nil)
@@ -7969,14 +7985,11 @@ subtree."
(defun org-agenda-remove-restriction-lock (&optional noupdate)
"Remove agenda restriction lock."
(interactive "P")
- (if (not (or org-agenda-restrict org-agenda-overriding-restriction))
+ (if (not org-agenda-restrict)
(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)
diff --git a/testing/lisp/test-org-agenda.el b/testing/lisp/test-org-agenda.el
index 256f701df..bd96163e9 100644
--- a/testing/lisp/test-org-agenda.el
+++ b/testing/lisp/test-org-agenda.el
@@ -255,6 +255,34 @@ See https://list.orgmode.org/06d301d83d9e$f8b44340$ea1cc9c0$@tomdavey.com"
(get-text-property (point) 'day))))
(org-test-agenda--kill-all-agendas)))
+(ert-deftest test-org-agenda/file-restriction ()
+ "Test file restriction for org agenda."
+ (org-test-with-temp-text-in-file "* TODO Foo"
+ (org-agenda-set-restriction-lock t)
+ (org-agenda nil "t")
+ (should (search-forward "Foo"))
+ (should (org-agenda-files))
+ (should-not (org-agenda-files t))
+ (org-agenda-remove-restriction-lock)
+ (goto-char (point-min))
+ (should-not (search-forward "Foo" nil t))
+ (should-not (org-agenda-files)))
+ (org-test-with-temp-text-in-file "* TODO Bar"
+ (org-agenda nil "t" 'buffer)
+ (should (search-forward "Bar"))
+ (should (org-agenda-files))
+ (should-not (org-agenda-files t))
+ (org-agenda-remove-restriction-lock)
+ (goto-char (point-min))
+ (should-not (search-forward "Bar" nil t))
+ (should-not (org-agenda-files)))
+ (org-test-with-temp-text-in-file "* TODO Bar"
+ (org-agenda nil "t" 'buffer)
+ (org-agenda nil "t")
+ (should-not (search-forward "Bar" nil t))
+ (should-not (org-agenda-files)))
+ (org-test-agenda--kill-all-agendas))
+
\f
;; agenda redo
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)]
2022-10-12 6:11 ` Liu Hui
@ 2022-10-12 7:44 ` Ihor Radchenko
0 siblings, 0 replies; 7+ messages in thread
From: Ihor Radchenko @ 2022-10-12 7:44 UTC (permalink / raw)
To: Liu Hui; +Cc: emacs-orgmode, visuweshm
Liu Hui <liuhui1610@gmail.com> writes:
> I have added docstrings for related variables except
> `org-agenda-last-dispatch-buffer', which is actually not used by any
> other org-mode code. Please see the patch below.
>
> From 907499f16769e5a5353170c13f09595584530139 Mon Sep 17 00:00:00 2001
> From: Liu Hui <liuhui1610@gmail.com>
> Date: Wed, 12 Oct 2022 14:02:05 +0800
> Subject: [PATCH] org-agenda: Make sure file restriction can be removed
Thanks!
Applied onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=c57b03032380de519bafcf903ca9236668038d4e
I also removed the unused variable
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=416c839c59a6186ca4f6cdd179c628ef49cd6c99
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-10-12 7:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-25 15:05 [BUG] org-agenda-remove-restriction-lock does not remove file lock [9.5.2 (release_9.5.2-17-gea6b74 @ /nix/store/iqqk7iqfwmfc6r78xg2knyq7hww2mhs4-emacs-git-20220225.0/share/emacs/29.0.50/lisp/org/)] Visuwesh
2022-03-26 9:04 ` [PATCH] " Ihor Radchenko
2022-07-17 12:09 ` Ihor Radchenko
-- strict thread matches above, loose matches on Subject: below --
2022-10-09 7:14 Liu Hui
2022-10-11 2:33 ` Ihor Radchenko
2022-10-12 6:11 ` Liu Hui
2022-10-12 7:44 ` Ihor Radchenko
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.