emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Re: [BUG] org-agenda-remove-restriction-lock does not remove


From: Ihor Radchenko
Subject: 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/)]
Date: Tue, 11 Oct 2022 10:33:26 +0800

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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]