From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id UJrGMOkcqmXQtwAAe85BDQ:P1 (envelope-from ) for ; Fri, 19 Jan 2024 07:55:38 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id UJrGMOkcqmXQtwAAe85BDQ (envelope-from ) for ; Fri, 19 Jan 2024 07:55:37 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b=D1Mf5UDc; dmarc=pass (policy=quarantine) header.from=breatheoutbreathe.in; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705647337; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=jJel4B6NywRNjtyl68rfhr95pK+NyadpqbHbncKkbwA=; b=RVXovAhIIkhWJg7hHjK99wY6VNrVHCH1Eh49s4mpAvfZRGyNmZ1v4UmczoqejEWH3M1Hc9 e2E12ruXQZN7tM76RQv+NLvX5AltEWW22eP/Z/oFUpQknnARwbG8pb4YNTeyUKRQSkYvIC xhzoIb/hSvYu0s6QYJGrIhXDMv4nj0OwhrRf1HW8LrYtYpk7AlPbGQBx7aF3LzjrLuZB1g iDdKFL8EYOpttIg1njHkNV7JukrMYkIxWVeEfZ1+weNnwrcavSCWaynZNeSR52oVv061ho Z+VTSn7NjzKAWK3bAdsRR14nlUxChXT4dj+EXy4atLUn83ilI+xqVzOqq5ca9w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705647337; a=rsa-sha256; cv=none; b=H5CIUJeM4BXFNF7HIL+XkxS1NWJHZS8hr99Uxs2RpihE35/LN3c3XTp+QTm3NxjiibijBt OSGwTRds1Q2jq3lbnuJ5hatuFWh6Toa+AFM0jsZUjqlC4b3uc6vq4WKwOwUN1Zy+VNJK8W yT9VEc3qhKHAaKxGdH3vX0jWVl1SaG0jkCkGMpxeLV+RNUctHq1Tw198NaQM/ujv0Xj51q vt5VOMflTn0vQvthDeMB2C2zkgPH6vvax+4poVsA98l8ZoAq556JxjhiydaJdxX9oPCfwq N75mQEOFHizWmfzzNsZMmuRLgirKh1ZFov+0rhO0uu7lwZtRQ1HxvbMfwud+sg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=breatheoutbreathe.in header.s=key1 header.b=D1Mf5UDc; dmarc=pass (policy=quarantine) header.from=breatheoutbreathe.in; 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" 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 2D4B8BA68 for ; Fri, 19 Jan 2024 07:55:37 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQimG-0004QI-JF; Fri, 19 Jan 2024 01:54:58 -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 1rQimE-0004Px-7q for emacs-orgmode@gnu.org; Fri, 19 Jan 2024 01:54:54 -0500 Received: from out-180.mta1.migadu.com ([95.215.58.180]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rQimA-00039w-Gt for emacs-orgmode@gnu.org; Fri, 19 Jan 2024 01:54:52 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1705647287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=jJel4B6NywRNjtyl68rfhr95pK+NyadpqbHbncKkbwA=; b=D1Mf5UDcIa1seGKBE7Q3GKT/SU6w+Zk79R6nK4sTewGsOs/pAZhuRsxLn9zmrGmfDwa+WZ YURnTyR0MYzrQErbQek4s5JI0V93DDPobOXPt+mGHZ+V6eEsXbFs8/jZL8d9qncE56/FF8 QdyGB2KmRQSNfaRQI9DtEExiWn4IfnI= From: Joseph Turner To: Org Mode Mailing List Subject: [PATCH] Silently remove lockfiles from org-agenda-files Date: Thu, 18 Jan 2024 22:27:42 -0800 Message-ID: <87wms5stho.fsf@breatheoutbreathe.in> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=95.215.58.180; envelope-from=joseph@breatheoutbreathe.in; helo=out-180.mta1.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-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -7.89 X-Spam-Score: -7.89 X-Migadu-Queue-Id: 2D4B8BA68 X-TUID: Hv97wTd0y2PM --=-=-= Content-Type: text/plain My configuration contains the equivalent of (setopt org-agenda-files (directory-files-recursively "~/.local/share/org/todo" ".org$")) 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. The attached patch silently removes lockfiles from org-agenda-files. Thanks! Joseph P.S. I'm not sure how the lockfile ended up there. Maybe I killed Emacs with SIGKILL while one of my agenda files was open and modified in a buffer, and so the lockfile was not deleted? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-lisp-org.el-org-check-agenda-file-Silently-exclude-l.patch >From e69e69a03c215704d83f8388370f0db2bc93891d Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Thu, 18 Jan 2024 22:24:10 -0800 Subject: [PATCH] * lisp/org.el (org-check-agenda-file): Silently exclude lockfiles --- lisp/org.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 8929a7217..f48a8ff46 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15563,8 +15563,12 @@ (defun org-file-menu-entry (file) (vector file (list 'find-file file) t)) (defun org-check-agenda-file (file) - "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)) (message "Non-existent agenda file %s. [R]emove from list or [A]bort?" (abbreviate-file-name file)) (let ((r (downcase (read-char-exclusive)))) -- 2.41.0 --=-=-=--