From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: how to force auto-save of buffers not visiting files, right now? Date: Sun, 20 Mar 2022 08:29:55 +0100 Message-ID: References: <87zglq200a.fsf@web.de> <8fffdb6b532a1fc1805229acfcf9510c3afe18ec.camel@adminart.net> <87wngsmdwp.fsf@web.de> <9f32ac59eb1bc186b015c0b6c5b94822e70d4135.camel@adminart.net> <87y2164u5p.fsf@web.de> <9c3935a33573d50e595f37103434db5e29c21063.camel@adminart.net> <87ilsa61tn.fsf@web.de> <37e890d9c251b30d0caf83aa590bca1ad92ec5d4.camel@adminart.net> <87wngqclgk.fsf@gmx.de> <95f0e96687187c20086bf9f85a031a7271401407.camel@adminart.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M2kM21tXlEwRGBZE" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23655"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 20 08:30:52 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nVq1b-0005wi-0k for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 08:30:51 +0100 Original-Received: from localhost ([::1]:38706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVq1Z-0008Ou-3w for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 03:30:49 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVq0n-0008OC-80 for help-gnu-emacs@gnu.org; Sun, 20 Mar 2022 03:30:01 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:36274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVq0l-0000na-8Z for help-gnu-emacs@gnu.org; Sun, 20 Mar 2022 03:30:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=b78MtPNJUAVdSiY31LzHMEMXnwL6cveaIRyWhuvcUWI=; b=S/6eEoNgJRj4RDQrdk5VHATArO Wja3I8LkgPipeNUcQ3rgNNOJw/oexo13NKwYxhsEctY2j6Cr3mp+yF3zSDvZuGXFm7vVBZCtJqTmU qKKn3MUgitMZQ47PP7bA2W7ibp9qmE1Rhr+6RtNL1cPuU152FTEXXtZJmFOlS76CuLpL8a+2i4h1G e8TAzESc2u5NWP8nFn5AEThPTJJRMC03MDI0Rxcz+rxzHFrhFVJAWRLK33Fj8FdVTfdyNMb9Xs+cs PGi873VwUVrRUXelvl13HH3Ra5AsW5+88xr0yBAo/CvIRbRm8AqxGbOhABJlivLiwDbZowA5/ZbCs dYuSd//g==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1nVq0h-0000MA-Sc for help-gnu-emacs@gnu.org; Sun, 20 Mar 2022 08:29:55 +0100 Content-Disposition: inline In-Reply-To: <95f0e96687187c20086bf9f85a031a7271401407.camel@adminart.net> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:136686 Archived-At: --M2kM21tXlEwRGBZE Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Mar 20, 2022 at 07:36:42AM +0100, hw wrote: > On Sat, 2022-03-19 at 10:58 +0100, Michael Albinus wrote: > > hw writes: > >=20 > > Hi, > >=20 > > > For example, I may edit a file '/usr/local/bin/example.pl' which is > > > owned by foo:foo because I made that so. The directory > > > '/usr/local/bin/' is owned by root. How do you expect emacs to create > > > a backup file there? For remote files, I have set > > > tramp-auto-save-directory to a local directory, and I'm missing an > > > equivalent option for local files. > >=20 > > There is the user option auto-save-file-name-transforms, which gives you > > this feature also for local files. >=20 > Thanks! >=20 > Its value is > (("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" "/tmp/\\2" t)) >=20 > Ah, hm, what is that regexp supposed to match? All files with at > least a ':', a bunch of slashes and some optional brackets? Who puts > bracktes into file names, that shouldn't be allowed. The colon is to match remote files. That's the default. Tramp remote files for Emacs have a prefix with a colon. And the brackets are regexp metacharacters, [^/]* meaning zero or more non-slashes (i.e. one path component) Or do you mean the parentheses ()? Those are for grouping. Due to Emacs's regexp syntax (not ERE) you have to escape them. The extra backslash is for the string syntax. > Apprently that leads to puttting some files into /tmp, and I would > consider it a bug to put auto-save files into /tmp because doing that > totally defeats the auto-saving because /tmp is volatile. One person's bugs are other person's features. That's why you can change it, after all. I don't know why the default is as it is, but knowing Emacs I guess there has been some discussion. I'll leave it to you to *POLITELY* (hint, hint) ask around here if you are interested. > I don't > know who made the utterly stupid decision to make /tmp volatile, Careful. You can change that, too, if you want. Someone thought it to be useful. I'm around for long enough that I remember the time before (for Gnu/Linux, anyway). I got along the change. It has up- and downsides. Throwing "stupid" around won't change those things :) > but > it's the way it is since quite a while now. This default needs to be > changed, or /tmp needs to go back to be a useful directory. That depends on whether you want that auto-save file to persist across operating system sessions or not. Not everybody agrees with you (or me) on what a nice behaviour is. > Why didn't they just make a directory /volatile in addition to /tmp? > Because someone would argue that when something must not be saved, > then don't save it to begin with? >=20 > But then, the auto-save files for buffers not visiting files show up > in the directories the files are in from which the buffers not > visiting these files were created. In a way, yes. It's whatever the value of `default-directory' is, I guess, unless you give it an absolute path. > That is very confusing. That's perhaps because there are not many people auto-saving buffers without an associated file: not many around for testing! Cheers --=20 t --M2kM21tXlEwRGBZE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCYjbX7QAKCRAFyCz1etHa RpmLAJsGnap6d9J4WOAW7NEiuHYvYUSk3ACZAbWKsQ0Ws19h6ZHuZTkQKXu0shk= =ZYbr -----END PGP SIGNATURE----- --M2kM21tXlEwRGBZE--