From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: hw Newsgroups: gmane.emacs.help Subject: Re: auto-save directory? Date: Sun, 20 Mar 2022 10:27:52 +0100 Message-ID: References: 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="24002"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.42.4 (3.42.4-1.fc35) 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 10:29:03 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 1nVrry-0005zp-D9 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 10:29:02 +0100 Original-Received: from localhost ([::1]:57486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nVrrw-0001va-Tn for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 20 Mar 2022 05:29:00 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVrqv-0001vQ-Rh for help-gnu-emacs@gnu.org; Sun, 20 Mar 2022 05:27:57 -0400 Original-Received: from mo4-p00-ob.smtp.rzone.de ([85.215.255.21]:44607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nVrqt-00060U-PV for help-gnu-emacs@gnu.org; Sun, 20 Mar 2022 05:27:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1647768473; s=strato-dkim-0002; d=adminart.net; h=References:In-Reply-To:Date:To:From:Subject:Message-ID:Cc:Date:From: Subject:Sender; bh=v5NX+sEgFPGAtV97jUkGs4CkfMslUzbdlKZ+gVhQ5Ag=; b=be21QTnw+fR2WjEksdgvrK8sttQf9cQbASo2RQUypFNQmTj/6W3WjQeyHgDM0O6SRL 0XfxJQAh0ojnJ+/wo/rdVZWBNAy5MC1yfLgCjBTSlie2G/KUDpWxly6ReZ7/3T/hua3v 9Rzi+pYKlZsT3MahXCRgdaNR4FbXU4GI1i2oWOFFuziQbewUJhu8cAVEJKYON4oBUBAX Om6ErpXuI7/SUcU37alJhlgEzD54sgnnxrnSdZa90gb3d0UbD3e9Szxg7zHM44ARIVO4 XPWleUi7cq0OvZpibKfZqFzeBT6r59WWpeiO7DpTJW552LBXtjMOPykgxJGnTmr3Wwm2 Vwdg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JHskdESlcvGJlcww5P8kEdDfB60eDdbwg2z1BLI60U5wCzf09BLZZsSKYxPQaavhGO/kap91D/OoCoP2QrxBY8ct0jBjyQ6QTgS1" X-RZG-CLASS-ID: mo00 Original-Received: from [IPv6:2a09:8e40:1b4d:a200:156a:299a:44c4:5337] by smtp.strato.de (RZmta 47.41.1 AUTH) with ESMTPSA id U40bf1y2K9RrAhM (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Sun, 20 Mar 2022 10:27:53 +0100 (CET) In-Reply-To: Received-SPF: none client-ip=85.215.255.21; envelope-from=hw@adminart.net; helo=mo4-p00-ob.smtp.rzone.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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=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:136689 Archived-At: On Sat, 2022-03-19 at 08:30 +0300, Jean Louis wrote: > * hw [2022-03-19 07:07]: > > > > Hi, > > > > I'm wondering if there is a way to have emacs put all auto-save files > > into a configurable directory. We can set `tramp-auto-save-directory`, > > but there doesn't seem an equivalent option for files that are not > > remote. I couldn't find one in either the documentation, nor the source. > > > > I'd find it nicer to have all auto-save files in one place instead of > > all over the place. Is there such an option, and if there isn't, would > > that be worth making a feature request? > > ‘auto-save-file-name-transforms’ > > > > Evaluate this below to get into Info file: > > (info "(emacs) Auto Save Files") > > The variable ‘auto-save-file-name-transforms’ allows a degree of > control over the auto-save file name. It lets you specify a series of > regular expressions and replacements to transform the auto save file > name. The default value puts the auto-save files for remote files > (*note Remote Files::) into the temporary file directory on the local > machine. > > On my side the variable ‘auto-save-file-name-transforms’ looks as > this: > > [INS] [DEL] List: > Regexp: \`/[^/]*:\([^/]*/\)*\([^/]*\)\' > Replacement: /home/data1/protected/tmp/\2 > Uniquify: [Toggle] on (non-nil) > > > or as this: > > auto-save-file-name-transforms ⇒ (("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" "/home/data1/protected/tmp/\\2" t)) Thanks! When I let emacs evaluate above expression, it takes me to the info node '18.6.1 Auto-Save Files' and doesn't tell me what might be replaced by what. Now the problem is that the regexp is kinda impossible to read and to reasonably alter ... It seems to match only file specifications containing a colon and maybe other characters I would never intentionally put into file names ... Is there a stable database library like perls DBI for emacs, or can I directly integrate perl into emacs? If I save all auto-save files in the same place, all information where they were originally edited gets lost. It might be nice if I could store some meta-information along with the file in a database.