all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Patch for Emacs 25.2
@ 2017-01-16  9:44 Michael Albinus
       [not found] ` <jwvlgubruup.fsf-monnier+gmane.emacs.devel@gnu.org>
  2017-01-16 16:11 ` Patch for Emacs 25.2 Eli Zaretskii
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Albinus @ 2017-01-16  9:44 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2952 bytes --]

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)

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-17 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-16  9:44 Patch for Emacs 25.2 Michael Albinus
     [not found] ` <jwvlgubruup.fsf-monnier+gmane.emacs.devel@gnu.org>
2017-01-16 14:01   ` Tramp as ELPA package (was: Patch for Emacs 25.2) Michael Albinus
2017-01-16 16:11 ` Patch for Emacs 25.2 Eli Zaretskii
2017-01-16 21:49   ` Michael Albinus
2017-01-17 15:58     ` Eli Zaretskii
2017-01-17 16:16       ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.