From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Slass Newsgroups: gmane.emacs.help Subject: Re: Autosave and filename too long Date: Thu, 24 Oct 2002 05:22:16 GMT Organization: AT&T Broadband Sender: help-gnu-emacs-admin@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035437361 32255 80.91.224.249 (24 Oct 2002 05:29:21 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2002 05:29:21 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 184aYY-0008No-00 for ; Thu, 24 Oct 2002 07:29:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 184aVe-0003Wo-00; Thu, 24 Oct 2002 01:26:18 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp-server.caltech.edu!attla2!ip.att.net!attbi_feed3!attbi.com!rwcrnsc52.ops.asp.att.net.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-NNTP-Posting-Host: 12.228.27.239 Original-X-Complaints-To: abuse@attbi.com Original-X-Trace: rwcrnsc52.ops.asp.att.net 1035436936 12.228.27.239 (Thu, 24 Oct 2002 05:22:16 GMT) Original-NNTP-Posting-Date: Thu, 24 Oct 2002 05:22:16 GMT Original-Xref: shelby.stanford.edu gnu.emacs.help:106319 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2869 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2869 "Matt Muggeridge" writes: >Hi, > >My auto-save fails with the error: > > Auto-saving foo.c: Opening output file, file name too long: >/usr/users/muggerid/kingsx/#foo.c# > >That is a filename of just 34 characters. My suspicion is that the '#' >character is causing me problems, since "kingsx" is a mount point, which >mount a VMS filesystem. In lieu of any other suggestions on how to fix >this, I would like to try changing the "#" character to learn if it makes a >difference. > >Thanks, >Matt. (defadvice make-auto-save-file-name (after auto-save-remove-hash-mark ()) "return an autosave file name, replacing \"#\" with \"OCTOTHORPE\"" (setq ad-return-value (replace-regexp-in-string "#" "OCTOTHORPE" ad-return-value))) (ad-activate 'make-auto-save-file-name) (defun auto-save-file-name-p (filename) "Return non-nil if FILENAME can be yielded by `make-auto-save-file-name'. FILENAME should lack slashes. You can redefine this for customization." (string-match "^OCTOTHORPE.*OCTOTHORPE$" filename)) This advice will change "#" to "OCTOTHORPE" in the auto-save-file-name, so you'll get save files like /usr/users/muggerid/kingsx/OCTOTHORPEfoo.cOCTOTHORPE That's much longer than you had, but doesn't contain the "#" character, so you'll know right away if that was the culprit. I've redefined auto-save-file-name-p (which you're allowed to do) so that you can recover these auto-save-files. -- Mike Slass