From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Patch for Emacs 25.2 Date: Mon, 16 Jan 2017 10:44:45 +0100 Message-ID: <87o9z7s5iq.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1484559945 7698 195.159.176.226 (16 Jan 2017 09:45:45 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2017 09:45:45 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 16 10:45:40 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cT3qX-0007FX-9w for ged-emacs-devel@m.gmane.org; Mon, 16 Jan 2017 10:45:01 +0100 Original-Received: from localhost ([::1]:55396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cT3qb-0007Ki-Tu for ged-emacs-devel@m.gmane.org; Mon, 16 Jan 2017 04:45:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cT3qS-0007JN-W6 for emacs-devel@gnu.org; Mon, 16 Jan 2017 04:44:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cT3qP-0007nn-1X for emacs-devel@gnu.org; Mon, 16 Jan 2017 04:44:57 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:61309) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cT3qO-0007ml-Nj for emacs-devel@gnu.org; Mon, 16 Jan 2017 04:44:52 -0500 Original-Received: from detlef.gmx.de ([93.197.214.201]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Mcxtm-1cC4xI2Kri-00IF5C for ; Mon, 16 Jan 2017 10:44:46 +0100 X-Provags-ID: V03:K0:pUsPbwc9o/14aj/SnBDpzaq7SxZX71QW+dOfWhhUYXgRA/oBlZd +GamNNnDEKJL1NzTQBKgeleVurOMd0dnG3be7lugoP6iO6I7VHzwFRM15LXT+K0YbxYKQcB OghzvGYaL7gCf4iZJokZNa6DAFps7PJCfcV+uGiW7FOjY2ZVsrjE63/uq9rd/cqeZkE9zmF k6pERTPmsVMvmZ2wWVmbA== X-UI-Out-Filterresults: notjunk:1;V01:K0:RLixx3lNC4Q=:oe1NQbl5SmL1pXiW9ycae5 pTPl+TUmNQ0VPZV6UgHY4Pnre7WQEo72oPVbLtko1TA1NuVVIgC236tw812iXIWAIEM/0c8pL A8QX8JyXxf6cP1n5bLdOX+AJA9E3ajv+UzDlDJNoHKXkggCLKDXLhDREZ2SUAI712kzUOOMna t/Gg8FMFiVUtyYZE1onsURMdAV0OgbqCMZ27TMpyJ9+hXlI2LHDjwZog8JrLAqA8nhK5OAGwM /MOFL53uqQHKmqJrqk3uVohjUQ6YQlbGcyJFH3K1SHEcP4uqHupJuKtSUOY3QV0gdUFEfNg3t DiBZ7jl6+pQLEL4XrA7uR766NcFV/NPZG6/AwBV3Yh/fA1PrH6LvuXAcdd1943fghIohEnXyF ki9rUSdVrEasluPZaLCHKGrARKr4gfuLus+f6ktQud9L/Vy/ZrI1jvzynOkDrkDXhwpFXwMMp TgkAHzRBLcz9lQwPeJ3lN1MdVuwAQgZkRJPlMnl48OgmrhxIjwZwtD3dm0INI4L2fWPyNygtX 07UZLZl5zTFckvMRda8jxUJcsP32l01C3OZLmvdA6rfurlreFi4vdvDLdCrD6He6xlWfZbsGd DUeivyilY1Nq9L4sepmGOk2t1cR2lIz+V2mKah2Qf7byuVsiK9NBKZ7YvxPgs0m4iTHdqr0M6 ehN2YKZ6O+GnVKeEd/PHpcHD+W94zWZGik8E3vmr/7Fub7OSKYkVasNOSczmLeufh/OUlold6 GP5ajnPj8kAGqqvbKY6i8duEPojraKmto4dMsnifw19zpqThwu+2fMnJhfTcwSeXkWWiaOEd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:211320 Archived-At: --=-=-= Content-Type: text/plain Hi, enclosed is a patch of tramp.el, which fixes a bug introduced by Emacs 25.1, commit e3a0f3daf12e208e88d712b09ef82096849b9431. Working on this, I found a related bug in files.el, which would be solved by the appended patch as well. Both changes are simple, so I'm asking whether they could be applied to Emacs 25.2. I've adapted also tramp-tests.el, and all tests pass for both GNU/Linux and MS Windows. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment diff --git a/lisp/files.el b/lisp/files.el index a6fe381..0d0d6e2 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5940,8 +5940,8 @@ make-auto-save-file-name ;; Make sure auto-save file names don't contain characters ;; invalid for the underlying filesystem. (if (and (memq system-type '(ms-dos windows-nt cygwin)) - ;; Don't modify remote (ange-ftp) filenames - (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" result))) + ;; Don't modify remote filenames. + (not (file-remote-p result))) (convert-standard-filename result) result)))) @@ -5978,8 +5978,8 @@ make-auto-save-file-name ((file-writable-p "/var/tmp/") "/var/tmp/") ("~/"))))) (if (and (memq system-type '(ms-dos windows-nt cygwin)) - ;; Don't modify remote (ange-ftp) filenames - (not (string-match "^/\\w+@[-A-Za-z0-9._]+:" fname))) + ;; Don't modify remote filenames. + (not (file-remote-p fname))) ;; The call to convert-standard-filename is in case ;; buffer-name includes characters not allowed by the ;; DOS/Windows filesystems. make-temp-file writes to the diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index b4242c0..f350f2a 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -4102,7 +4102,11 @@ tramp-handle-make-auto-save-file-name (file-exists-p tramp-auto-save-directory)) (make-directory tramp-auto-save-directory t)) - (let ((system-type 'not-windows) + (let ((system-type + (if (and (stringp tramp-auto-save-directory) + (file-remote-p tramp-auto-save-directory)) + 'not-windows + system-type)) (auto-save-file-name-transforms (if (and (null tramp-auto-save-directory) (boundp 'auto-save-file-name-transforms)) diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index 83a780d..2c59591 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -1775,13 +1775,17 @@ tramp-test--shell-command-to-string-asynchronously (should (string-equal (make-auto-save-file-name) - ;; This is taken from original `make-auto-save-file-name'. - (expand-file-name - (format - "#%s#" - (subst-char-in-string - ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1))) - temporary-file-directory))))) + ;; This is taken from original `make-auto-save-file-name'. + ;; We call `convert-standard-filename', because on + ;; MS Windows the (local) colons must be replaced by + ;; exclamation marks. + (convert-standard-filename + (expand-file-name + (format + "#%s#" + (subst-char-in-string + ?/ ?! (replace-regexp-in-string "!" "!!" tmp-name1))) + temporary-file-directory)))))) ;; No mapping. (let (tramp-auto-save-directory auto-save-file-name-transforms) --=-=-=--