From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: [gmane.emacs.bugs] Emacs fails to start properly if the current working directory is on a vfat or ntfs filesystem Date: Mon, 25 Feb 2008 23:58:12 +0000 Message-ID: <47C35614.6020407@gnu.org> References: <877igvl4dn.fsf@stupidchicken.com> <47C180F9.2060901@gnu.org> <47C2014A.4090702@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040605010902040104090902" X-Trace: ger.gmane.org 1203983922 27564 80.91.229.12 (25 Feb 2008 23:58:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Feb 2008 23:58:42 +0000 (UTC) Cc: cyd@stupidchicken.com, eliz@gnu.org, monnier@IRO.UMontreal.CA, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 26 00:59:07 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JTnDq-0007P1-Lf for ged-emacs-devel@m.gmane.org; Tue, 26 Feb 2008 00:59:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTnDK-0000K1-Ow for ged-emacs-devel@m.gmane.org; Mon, 25 Feb 2008 18:58:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTnDF-0000Iw-Te for emacs-devel@gnu.org; Mon, 25 Feb 2008 18:58:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTnDE-0000HP-EN for emacs-devel@gnu.org; Mon, 25 Feb 2008 18:58:25 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTnDE-0000HD-BL for emacs-devel@gnu.org; Mon, 25 Feb 2008 18:58:24 -0500 Original-Received: from mk-outboundfilter-3.mail.uk.tiscali.com ([212.74.114.23]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTnD7-0001Pe-3P; Mon, 25 Feb 2008 18:58:17 -0500 Original-X-Trace: 48509694/mk-outboundfilter-1.mail.uk.tiscali.com/F2S/$ACCEPTED/freedom2Surf-customers/83.67.23.108 X-SBRS: None X-RemoteIP: 83.67.23.108 X-IP-MAIL-FROM: jasonr@gnu.org X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGnlwkdTQxds/2dsb2JhbAAIq2A X-IP-Direction: OUT Original-Received: from i-83-67-23-108.freedom2surf.net (HELO [127.0.0.1]) ([83.67.23.108]) by smtp.f2s.tiscali.co.uk with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Feb 2008 23:58:15 +0000 User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90445 Archived-At: This is a multi-part message in MIME format. --------------040605010902040104090902 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Richard Stallman wrote: > # is not the problem, at least for vfat and ntfs filesystems. The > problem that was reported was with the *s in #*scratch*#12345xyz#. > > I see. So it is a matter of changing certain chars when they appear > in buffer names. That seems harmless; make-auto-save-file-name > already does some such transformations. There's no harm adding more. > Here is a patch against EMACS_22_BASE. Chong, Stefan, is it OK to check this in now, or do you want to leave the branch until after 22.2 is released and only fix it in the trunk now. --------------040605010902040104090902 Content-Type: text/plain; name="files.el.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="files.el.patch" *** files.el.~1.896.2.38.~ 2008-02-24 16:51:32.796875000 +0000 --- files.el 2008-02-25 23:54:34.618303900 +0000 *************** *** 4561,4575 **** (let ((buffer-name (buffer-name)) (limit 0) file-name) ! ;; Eliminate all slashes and backslashes by ! ;; replacing them with sequences that start with %. ;; Quote % also, to keep distinct names distinct. ! (while (string-match "[/\\%]" buffer-name limit) (let* ((character (aref buffer-name (match-beginning 0))) (replacement (cond ((eq character ?%) "%%") ((eq character ?/) "%+") ! ((eq character ?\\) "%-")))) (setq buffer-name (replace-match replacement t t buffer-name)) (setq limit (1+ (match-end 0))))) ;; Generate the file name. --- 4561,4593 ---- (let ((buffer-name (buffer-name)) (limit 0) file-name) ! ;; Eliminate all slashes, backslashes, wildcards and other ! ;; characters that are not valid in VFAT/NTFS filesystems. ;; Quote % also, to keep distinct names distinct. ! ;; We do this on all platforms, because even if we are not ! ;; running on DOS/Windows, the current directory may be on a ! ;; mounted VFAT filesystem, such as a USB memory stick. ! (while (string-match "[/\\%?*:<>|\"\000-\037]" buffer-name limit) (let* ((character (aref buffer-name (match-beginning 0))) (replacement (cond ((eq character ?%) "%%") ((eq character ?/) "%+") ! ((eq character ?\\) "%-") ! ((eq character ??) "%!") ! ((eq character ?*) "%#") ! ((eq character ?\") "%'") ! ((eq character ?<) "%(") ! ((eq character ?>) "%)") ! ((eq character ?|) "%_") ! ((eq character ?:) "%;") ! ;; Control characters. ^@ to ^Z match their standard ! ;; mappings (ie ^A is represented as %A) ! ((< character 27) (concat "%" (+ character ?@))) ! ;; The last few are a bit arbitrary, since the standard ! ;; notation uses invalid characters and characters we ! ;; have already used above. ! ((< character 32) ! (concat "%" (+ (- character 27) ?0)))))) (setq buffer-name (replace-match replacement t t buffer-name)) (setq limit (1+ (match-end 0))))) ;; Generate the file name. --------------040605010902040104090902--