From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eArQGw60gmEruQAAgWs5BA (envelope-from ) for ; Wed, 03 Nov 2021 17:08:46 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +GZmFw60gmHGJAAAbx9fmQ (envelope-from ) for ; Wed, 03 Nov 2021 16:08:46 +0000 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 DAEDF1CCC3 for ; Wed, 3 Nov 2021 17:08:45 +0100 (CET) Received: from localhost ([::1]:59402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miIof-00015Q-1v for larch@yhetil.org; Wed, 03 Nov 2021 12:08:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miIni-00013E-VI for emacs-orgmode@gnu.org; Wed, 03 Nov 2021 12:07:48 -0400 Received: from ciao.gmane.io ([116.202.254.214]:44356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miIne-0002iV-MD for emacs-orgmode@gnu.org; Wed, 03 Nov 2021 12:07:46 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1miInc-0004w9-Av for emacs-orgmode@gnu.org; Wed, 03 Nov 2021 17:07:40 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [BUG] Org V 9.5 error when ~/.cache doesn't exist Date: Wed, 3 Nov 2021 23:07:27 +0700 Message-ID: References: <877ddsazc9.fsf@localhost> <87ee7yaksm.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: <87ee7yaksm.fsf@localhost> Content-Language: en-US Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-3.528, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635955725; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=b9KHmkovLZKDNicGGWf+IlI6Hog2MoZLmHis1LH4rNg=; b=Ig6oiQqjefNfA0LqBEGholzdaWnWPBS1iCZs6NdkR2W7DlNGhWe0JYDFOBzc8CwaobpVZw YVQAO8RyIjZ8RvJYiXZLthNf6hR0WMs5fLD6VjOMX7oRDZS3tjeRluxacF+N9+0w4kHFZE 7SQXLvAJXM166S9DpX7Rq3na4VC1aIpyyqIn7hWd2ANR7MqujpEtWBaSU9xmC/a9uRIcPE gmcygVLNoYIBm+lQ3RUNX7c+qf1DrSytmn3SQdg/bs9n9BT19lOUgTYC44Q+Ucyk9t9PvQ ZFfueh3jN245rN/5JObVnAFjI2q7C37Z5VqGbgEyces0+v3bQB0FmY0oYqCj2w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635955725; a=rsa-sha256; cv=none; b=f87tOjmMn5TMyNsyU4GENAMTvvv3oYeQH+F1csbhKvOQYTnOddTxZDKChEdXvuIRrfNzJO 0nTlx/Q8pTYdNRzkTora3/fV1K2eICGrwWENazJEjLxouOlFmRD/nF07KVyZQ8NCbb+meP ZG2X0VFPabAk8WTrYuW5lSHOGmq1CL3qqvzL9y800n1O4jhNhVi2CBU2CafJskamXn0rmP MOUkDMHgtscEmy6YmE7Y1d4yEFkdE1bumjXpE3XJsuofsK/hpYXewud/j7gcY96QOsQSDG NTF41/rqfJyqX/kqFzy878ExU8L0ZlXWx8/8w9Vb4/+URCH6Bhnw3EuZRGDOKQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.82 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: DAEDF1CCC3 X-Spam-Score: -1.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: zlVQ5Gqtnr1V On 02/11/2021 17:55, Ihor Radchenko wrote: > Max Nikulin writes: > >> Ihor, your fix affects linux as well. .cache directory may be missed in >> fresh accounts. E.g. I just have created a new test container (my old >> one has emacs-25): > > After second thought, I am not sure anymore if using XDG is a good idea. > Emacs itself only recently started supporting XDG and the support is > somewhat limited. Similar to the described case with non-existing .cache > directory, Emacs ignores non-existing .config/emacs folder for init.el. > Emacs never creates .config directory. ... > 4. Same as 3, but create $XDG_CACHE_DIR if possible. It is similar to > other XDG-complient software (at least, that's what I saw in > qutebrowser code). I like the idea to put temporary automatically created files to a dedicated directory. Backups are easier when hand-written config files are separated from stuff that can be recreated on demand. Since enough applications follow XDG conventions, I suppose, XDG_CACHE_HOME=~/.cache is a reasonable variant consistent with user expectations. Emacs directory may be a fallback when XDG_CACHE_HOME can not be created. I am against using ~/.cache only if it already exists. It may result in stale cache in the emacs directory populated before another application created ~/.cache, so user would have 2 directories with cache files. I agree that xdg.el lacks some useful features. Even parts of emacs such as startup.el and files.el do not use this package. Similar libraries for other programming languages offer wider support of OSes and create directories on demand, e.g. https://github.com/adrg/xdg for Go. Maybe org-macs.el is a better place for code dealing initialization of cache directory. P.S. `org-open-file' may benefit from using of xdg.el. MIME handlers obtained from .desktop files should be more consistent with expectations of users of desktop environments.