From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WHwCOJLBumViPwEAe85BDQ:P1 (envelope-from ) for ; Wed, 31 Jan 2024 22:54:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WHwCOJLBumViPwEAe85BDQ (envelope-from ) for ; Wed, 31 Jan 2024 22:54:27 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b="OE/2PKkM"; 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"; dmarc=pass (policy=quarantine) header.from=breatheoutbreathe.in ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1706738066; 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=XvETSDUmSEfNUXawKiBLuvax0jD3xW6kUpcXEfsfX6M=; b=r1eux7jmDurZSHPtpXXSNmPeD//GaH6bId36FvR1a9YSmzX3XCuicz781qO9yNQIFi72Bw QwGW/ao4CEUV/UBuPSpdaueQ8KH2KXNMBIqzGp+kY8t/6JzBNBgoMKkfMzXox9aS91sfe2 SKHYJ5lqA9FYndHTFPzVG7r+D+M96d4Xm2M6bqrZXfRMsMyJUwvrjj1M7Xpbu13288GlYS sNKvh7sKPuHiVtrsrzWMC6ZZalDN7+9tNrDsW7gYyYp4QRDJ+KzD6R2tq3ZhwuaHXBZkUP 4MyymJ6y7AKmyCYFSKNdVl6c+08AnEDuMbs4LcS81VDovxVUayR28Nj+tfcLgQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b="OE/2PKkM"; 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"; dmarc=pass (policy=quarantine) header.from=breatheoutbreathe.in ARC-Seal: i=1; s=key1; d=yhetil.org; t=1706738066; a=rsa-sha256; cv=none; b=R4SpEuPh7zqNQaohEJonxgRw5A4nhWCbo2jzj0OrmNLsviKluSn29HB9wb9vFuizz+x6CF PoivNvTkmGTVUNtre3y1TmWd2v7dqKq+h52vRooD2ypCQWhFeo7R1CsnZt3JXBsQYCa8DM VVL8PZUzedsbnN6YSXJai2AmFR3e6xWk4oxl0KHNvvDsrzUG76z8X2OorpiHkiE4Z8YDAp cCofHnrfPD83JprPuW4gyCMedkcy6YtMYB4kS4Fs/llbGtEtIu5M3KCNc6DLJ7TQyVgiU5 w/q8OcR9Xpv2pgacMeTmz4vmFgHNtgSrxWoZMMhKYbTsuDcrvrEnss+trhPsRA== 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 3999440807 for ; Wed, 31 Jan 2024 22:54:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rVIWR-00069V-CZ; Wed, 31 Jan 2024 16:53:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rVIWP-00067l-Tf for emacs-orgmode@gnu.org; Wed, 31 Jan 2024 16:53:29 -0500 Received: from out-173.mta0.migadu.com ([2001:41d0:1004:224b::ad]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rVIWO-0000OF-8l for emacs-orgmode@gnu.org; Wed, 31 Jan 2024 16:53:29 -0500 References: <87wms5stho.fsf@breatheoutbreathe.in> <87y1clo3yy.fsf@localhost> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1706738005; h=from:from: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; bh=XvETSDUmSEfNUXawKiBLuvax0jD3xW6kUpcXEfsfX6M=; b=OE/2PKkMDim/LHvygZka0c5B+UmrHjcXuMoIAeN7n4+3yO27wUoVCzP7S2GGddkFSfjFwY cFPcX/O5CJLOgcO2QcPH0R2/oKNbbMdwlt8Pir+TiegDFQ7pWhQ3E1xWr89vL65Ko+LwZ8 Cx9VYnZ2eqVySOnyszQGZFHzHVtKkCQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Joseph Turner To: Ihor Radchenko Cc: Org Mode Mailing List Subject: Re: [PATCH] Silently remove lockfiles from org-agenda-files Date: Wed, 31 Jan 2024 13:51:18 -0800 In-reply-to: <87y1clo3yy.fsf@localhost> Message-ID: <87wmrp6ugg.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:41d0:1004:224b::ad; envelope-from=joseph@breatheoutbreathe.in; helo=out-173.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.86 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -7.86 X-Migadu-Queue-Id: 3999440807 X-TUID: 7mEYaeKbOD+X Hi Ihor, Ihor Radchenko writes: > Joseph Turner writes: > >> My Emacs setup broke today due to the presence of a lockfile inside >> "~/.local/share/org/todo". I use EXWM, and I show org-agenda on startup: >> >> (add-hook 'after-init-hook >> (lambda () (org-agenda nil "t"))) >> (setq initial-buffer-choice (lambda () (get-buffer "*Org Agenda*"))) >> >> org-agenda-files contained a non-existent file, so org-check-agenda-file >> attempted to prompt me. For some reason (maybe EXWM didn't fully load), >> Emacs simply hung without prompting, leaving me with a black screen. > > You may consider reporting the hang to Emacs or EXWM bug tracker. >> My configuration contains the equivalent of >> >> (setopt org-agenda-files >> (directory-files-recursively "~/.local/share/org/todo" ".org$")) > > I'd recommend using a different approach - use org-agenda-file-regexp > instead of ".org$"; or use #'file-directory-p as predicate - Org mode > then select Org files inside all the listed directories by itself. Good to know about org-agenda-file-regexp. >> The attached patch silently removes lockfiles from org-agenda-files. > >> - "Make sure FILE exists. If not, ask user what to do." >> + "Make sure FILE exists. If not, ask user what to do. >> +Automatically exclude lockfiles." >> (unless (file-exists-p file) >> + (when (string-match-p (rx bos ".#") file) ; Exclude lockfiles >> + (org-remove-file file) >> + (throw 'nextfile t)) > > I feel slightly reluctant about this patch: > > 1. You are only working around the actual problem with agenda file being > deleted from disk while Emacs is loading. So, the patch is not > solving a real Org mode problem - Org mode prompting about > non-existing file is not wrong; your bug has nothing to do with Org > mode itself. > > 2. In theory, there might be users with actual Org files starting from > ".#" for whatever reason. The probability is not high, but if users > choose to set org-agenda-files directly, file-by-file, that's a > choice we should better respect in order to not create a blocker. Yes, I think you're right. Thanks for your caution :) Joseph