From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sCNfCevVRGNHWwAAbAwnHQ (envelope-from ) for ; Tue, 11 Oct 2022 04:33:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id uDh+CevVRGMvBAEA9RJhRA (envelope-from ) for ; Tue, 11 Oct 2022 04:33:15 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C46062690F for ; Tue, 11 Oct 2022 04:33:14 +0200 (CEST) Received: from localhost ([::1]:56846 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oi54z-0004r5-Bp for larch@yhetil.org; Mon, 10 Oct 2022 22:33:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oi54a-0004qh-9B for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 22:32:48 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]:47002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oi54Y-0003TM-II for emacs-orgmode@gnu.org; Mon, 10 Oct 2022 22:32:47 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-1326637be6eso14399419fac.13 for ; Mon, 10 Oct 2022 19:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=jQmbwtHsIY0CegKZwh0na42MMFiqQTp9I+Sc8DS9NQs=; b=b87NV62ouA73bT4R22Nw/klPLMQqJidccqTOLYt2OYgWxG6AIlAP5T+w0r7ieh2u+A pcHnCqcyv5tAWTO6wrEsfdlKSWJ9fO6dmgLKQoertnuxcX2yWSpm5/nECOHaNxaa4rxz YHyrD4TGuErATGiv7RoZh/hjvTQosq3Qf+4B6aKp9c90R+YoGoV/WR7BQpT/4iJ1pzEw 83bfC9p5+oCNQukP5eZKptMzdpNOtqpIWV97k/JaV1PR7Z14g1k99oOKdRr9FxnIeRPf Zp83vsL6211S1lee/VU+UUn1zgaUsyYqBgOE30nwtSU5SqYFWyWyAT9XP/KxBa7pzAxL cSGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jQmbwtHsIY0CegKZwh0na42MMFiqQTp9I+Sc8DS9NQs=; b=x1YhMsMSzQnfh9YgQ5/77T/SU66gJcWwGQ4+EtTdl+G5bcjBMkH3lGAo3G7IQJSWzr v9tYHLEtDLObRl4CQ/3NkFFIJymiYcy3vdTuwLbGqkWAfl/BTDyDaDUfTK6hBk68K9R+ USsF3kjGg03zNRLmJn8vuO5v51Vp9uc8FnFIUNU8MVnMBlsTgmmuwdHx69DGOuaKh+eo tuTNzW0POZbyGmC1dvse3fZkVQzMFHTexI0RKr9mOyhNKnStn+kB8UVpIpBS+IZhfSBn XxoH+2RxfnAM5jYFNhXmliGRDFOkSLtb/Q47b6k97EEpMsBowH7C/0J9zj0DMgUD+BjR gNKQ== X-Gm-Message-State: ACrzQf0RqYI7ABeu6K87vqyBpNQXKK52y3rD3dD83CLei50gLOj5Kc/i g21udRA7wjnPPBUGimTsQPFqejkUY1+r8Q== X-Google-Smtp-Source: AMsMyM5TKWEQDZ/c7WHdTi+ZdnJ+iYrAm5YJzLrDGTmW5ZxZwJA2n2WhhIeSPeICNWSHWg3ENeqJ4w== X-Received: by 2002:a17:90a:e60d:b0:20a:f035:176b with SMTP id j13-20020a17090ae60d00b0020af035176bmr24521465pjy.127.1665455554252; Mon, 10 Oct 2022 19:32:34 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id t1-20020a170902e84100b001782398648dsm7075401plg.8.2022.10.10.19.32.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 19:32:33 -0700 (PDT) From: Ihor Radchenko To: 87pmi46ivt.fsf@localhost Cc: emacs-orgmode@gnu.org, visuweshm@gmail.com 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/)] In-Reply-To: <87czb1qxim.fsf@gmail.com> References: <87czb1qxim.fsf@gmail.com> Date: Tue, 11 Oct 2022 10:33:26 +0800 Message-ID: <87wn97um15.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4860:4864:20::35; envelope-from=yantar92@gmail.com; helo=mail-oa1-x35.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TO_MALFORMED=0.1 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1665455595; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jQmbwtHsIY0CegKZwh0na42MMFiqQTp9I+Sc8DS9NQs=; b=PQSl+9AaG8t0xXeWGSIhdQchTXT+8A677hjY1hVds+ho6zOGibj0xnyDfZMxFwj/9eXXsn Vr0knW1RiWaPcs3BGC6s4nJLSzPPj9sx3HxEO67PSCrLqL/EaWjBhO1BF/AUJBuwn6dY3D o/dzj8ACeFPjp1PcY0Xoah4cpeamrEAPMLPizrM6l15Q3+K75op4g946q7xY50E09Z79kb gcctBJ8ewnMXGtakny6KPQvgxhECbwWiCCirKgQILbIqcksTk7kr2MEK9V3ulj3XFzgScp 0aq57rqbZm49D5eLd0vXn2evR8vbUge6EoQkbC6V/NaRwjdrEDDxyeF+Wq1Meg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1665455595; a=rsa-sha256; cv=none; b=OH13ZIFbCS23a4qKtO/xuM5vxE12wCU9Q0bhXsGvekSdy6Wu1TP6uG0r+b2MLyeLG9sS2Y 4E7Ulfa1G6rIU6uLKmidEYLLrhHDnYnOk6n3QX6V4tWY4hXkOka4m51KfaeDOmcp5rx9/1 DBotMA3aM7gYQhr3QH9URxWAtXLBshdCk2PzQNuC5dzAb+WlWMNNiz8kGqmOdb/crW8V0k hRDm2+j/HHvNKzj2kRgjMCRTaqV8rCsIIowJXy2oAgPU1lchrE/n2pPf4MJytuwrUJigtF 5yZCrakHkr2Gaxenk+7OVdKaHz7jharAiEACBWWNWJd2TyL9s2PUWmWLRPZUWA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=b87NV62o; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -0.82 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=b87NV62o; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C46062690F X-Spam-Score: -0.82 X-Migadu-Scanner: scn1.migadu.com X-TUID: Gq/D0M2JZK3b Liu Hui 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 . Support Org development at , or support my work at