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 ms0.migadu.com with LMTPS id cAenManYPmL9XQEAgWs5BA (envelope-from ) for ; Sat, 26 Mar 2022 10:11:05 +0100 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 YB4CL6nYPmJRdAEA9RJhRA (envelope-from ) for ; Sat, 26 Mar 2022 10:11:05 +0100 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 66B8E3AC8F for ; Sat, 26 Mar 2022 10:11:05 +0100 (CET) Received: from localhost ([::1]:39156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nY2Rr-0006Cr-Mi for larch@yhetil.org; Sat, 26 Mar 2022 05:11:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nY2Qa-0006Cc-JR for emacs-orgmode@gnu.org; Sat, 26 Mar 2022 05:09:44 -0400 Received: from [2607:f8b0:4864:20::229] (port=42507 helo=mail-oi1-x229.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nY2QY-0007Q9-S3 for emacs-orgmode@gnu.org; Sat, 26 Mar 2022 05:09:44 -0400 Received: by mail-oi1-x229.google.com with SMTP id q189so10675344oia.9 for ; Sat, 26 Mar 2022 02:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=P/pHDiStreY9KD7BYgZaDsNjrrHX+Y9JnXRE538QxHQ=; b=UH82Ri8yqNvX3ZVcXBJI9IjTu9eAKG0J5Mgc7HmI/oJyugQYWYg0a03/lx6z5CijTF cx1SX2pQ/CLDndXJ3SWEp5Lh5usCMflw+Xndsar1lMkfWv1PWItQgmHMe4LXtAzfgasG ucus93I9sc4hKBArO5+sLyCqHysh7tnAQxjwe/ryj7Fhdo0cQRL7CeqBmFHfFFW3L5Dt 6Wzwon81LD6O7ahBT2zulsr8x4VNaJWNW1F8qYJEC6YO9W2GzC10SWwfwWKOyJqIfI2/ sB9fknc2Feokk4ISW+zadTffYzUYXfmuSGDLgSEiolzb+2+jj8MPe9VfachXDDveI8pI 58hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=P/pHDiStreY9KD7BYgZaDsNjrrHX+Y9JnXRE538QxHQ=; b=ctMsoMd/u41+f/+ASAHyUrpfxXHo4qQp/U3wgF9r1lgz4Bj0unYjUE0eVOVMHlpsJa A3ZqIaHV3MSFlJY+NahXsVJN1vgf5ycTk6dd1h5MRH9Tx2L43Bn4XOMbv8tWoojylFfz nDsB+r9rvfHKkTFvZJY5pWjGCBEaFRFnN2AnnXdLw5Hi3NiUbi8k5lk07J370x93L/55 5N9svp4fbxtmo4HtAfzSx9+bW9QNDzpYhiCXfNZ1/fBAetB2Tm6GBvIZW3mVw3nhgDAv sKhX7WuMXjIOaur4c6iBiVwrLEbPKnc5cX1FbKJ9AsQlACfOwppM8zAPhQ4iBdQQdR1E mywA== X-Gm-Message-State: AOAM533EM+Ph8tgP97yXL/Dm1O4JyLL6P/TWEuBXJpf/u7E3AaNteFIq cwfP4fRsNqccIEQu0ZqsLyvf3f/kK+dpHjwT X-Google-Smtp-Source: ABdhPJyRc+TpF6qUCUhawA3b/vgLXOT6leov/K+B/cvT1S4mroPv7AvrmNLSHhFniWynGeGL+Rt6mA== X-Received: by 2002:a05:6870:15c5:b0:dd:a304:dc20 with SMTP id k5-20020a05687015c500b000dda304dc20mr10735783oad.74.1648285466037; Sat, 26 Mar 2022 02:04:26 -0700 (PDT) Received: from localhost ([23.227.186.130]) by smtp.gmail.com with ESMTPSA id l12-20020a056870d3cc00b000ddeb925982sm3558232oag.38.2022.03.26.02.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Mar 2022 02:04:25 -0700 (PDT) From: Ihor Radchenko To: Visuwesh Subject: [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: <87v8w2qdgp.fsf@gmail.com> References: <87v8w2qdgp.fsf@gmail.com> X-Woof-Bug: confirmed Date: Sat, 26 Mar 2022 17:04:50 +0800 Message-ID: <87ee2pythp.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::229 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::229; envelope-from=yantar92@gmail.com; helo=mail-oi1-x229.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648285865; 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=P/pHDiStreY9KD7BYgZaDsNjrrHX+Y9JnXRE538QxHQ=; b=Uzq1IJM5du8AhlRfzb8NwZxPS8Ih7eR8yfmHhMmRv9AN14obQWbbALlPBERteeDC912dVG 0+iRRC1Fh4wiYpbN3fHWdtlDKyjKBd1s1exsxhErS6W/I+qQhHBeymo4iH6ft0gUSkCxPD bDtF5604DJdUtdB5pKAxosIrWldr6f40UcOiD5gbMFVgjQmM0Ph7JTF1KXFrNnUas7NlKE ImHaVns86b3TzpZ8rgiSBGRIa3xiWIqIOWHr2fXw+0UZ87aE6nLjGHSWPAyqDGMJpu1Oxl QeRKNHG34pDOI7Vq3+vBi97rE3Yp/k628PAi9fj+TTGFjS+SyD14i/tpZf+9YA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648285865; a=rsa-sha256; cv=none; b=luINZhnegzAr1vVDfBBw5qvFbno88/iBTbJ2kgYJudbdG1381sA9vgXljROu04rkrZEuOf O3d1fUtM+jkv6oU3P702C6GxgWFgh7k5o/97pKvGxWdHE305UHaJaa9GrigHlxJzbXrH25 tVgfsd3dq0lK54H9msbH0jfqk9PvoxFdfdmr7G2LPJK+ZJHKB0mz9vVh4wCLujvGqzrTDL 1EfFq5qwntBWrDbP0NVul4pyXofF2HNm7zLw34n0xzM/fpFmqyC+JidDlwjBHO6ToVfQjg TWxw+OmtkevcJgtEuFjvZgUpNXZ9cVSUEaSho/gyb5eHg+ZlZLhzXmX5qRIFuw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UH82Ri8y; 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: -7.50 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UH82Ri8y; 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: 66B8E3AC8F X-Spam-Score: -7.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8/e3KBlM4kUM --=-=-= Content-Type: text/plain Visuwesh 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-org-agenda-remove-restriction-lock-Remove-file-restr.patch >From 65aa484f15a8ebbd14161978e1e9a881048e0715 Mon Sep 17 00:00:00 2001 Message-Id: <65aa484f15a8ebbd14161978e1e9a881048e0715.1648285356.git.yantar92@gmail.com> From: Ihor Radchenko 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 --=-=-=--