From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: how to force auto-save of buffers not visiting files, right now? Date: Sun, 20 Mar 2022 01:21:03 +0100 Message-ID: <8735jd5v9s.fsf@web.de> References: <019b7e509c29caa462ff1c30079ce9bfb8cdc668.camel@adminart.net> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3056"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Cancel-Lock: sha1:1u7eGVq31ZpqzVj1OPmLW0VF8Po= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 20 01:22:06 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 1nVjKf-0000Zr-FB for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 01:22:05 +0100 Original-Received: from localhost ([::1]:56944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVjKe-0002Xm-Fm for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Mar 2022 20:22:04 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVjJr-0002Xd-8r for help-gnu-emacs@gnu.org; Sat, 19 Mar 2022 20:21:15 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]:43706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVjJp-0007yi-J7 for help-gnu-emacs@gnu.org; Sat, 19 Mar 2022 20:21:15 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nVjJn-000A0n-6O for help-gnu-emacs@gnu.org; Sun, 20 Mar 2022 01:21:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geh-help-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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: 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:136683 Archived-At: hw writes: > 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. I'm was talking about backup files, not about auto save. You can control where these are saved. > Who can remember things like ‘C-u C-u C-u C-x C-s’ just to save a > file? If you want to use that stuff automatically, you can do it otherwise, you already wrote some Elisp code. It's surely not my advice to always save using that keystroke. > How do you make sure that all obsolete backup files are being deleted > without configuring about 20 instances of emacs on different machines > for different users? You could, for example, use directory local variables and configure things so that all backups are located at one centralized place. > Right, I wouldn't want to have obsolete copies cluttering the repos > for every time I press C-x C-s or C-x s. I rather commit only the > version that is working after it was modified, not countless > intermediate versions. With Magit or helm-browse, these saves would not be commits or parts of named branches. They would live under a configurable separate namespace in e.g. ".git/refs/wip/". > Ok so I run perltidy to replace the contents of the buffer visiting > the program I'm working on, save the buffer so I can run the program > and the power goes out, the computer freezes, emacs crashes or > something else goes wrong and it turns out that perltidy messed up my > program. > > How do I undo the changes then? Undo only works when nothing goes > wrong. My advice was to use undo when nothing went wrong, and your backup concept when something went wrong. Sorry if I wasn't clear enough in that regard. What kind of solution d you want to have? I find some of your answers contradicting, e.g. you say you don't want lots of backups because you don't want to delete them manually. But automatic deletion is also not good because, what if the relevant backup was among the deleted files. You do not want to loose anything but OTOH do not want to clobber your repository, etc. How could a solution you _do_ like look like? Michael.