From 299b190a6b54ae6df5a5d38205c3137b6578689d Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 17 Jan 2017 17:35:23 +0100 Subject: Fix auto-save-file-name problem in Tramp on MS Windows * lisp/files.el (make-auto-save-file-name): Use `file-remote-p' rather than an ange-ftp regexp. * lisp/net/tramp.el (tramp-handle-make-auto-save-file-name): Fix a problem when running on MS Windows. * test/lisp/net/tramp-tests.el (tramp-test31-make-auto-save-file-name): Adapt test. --- lisp/files.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index b57e35b9a0a..f60282b775a 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -6074,8 +6074,8 @@ See also `auto-save-file-name-p'." ;; 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)))) @@ -6112,8 +6112,8 @@ See also `auto-save-file-name-p'." ((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 -- cgit v1.2.3 From 82b6b3cf8ff2544be4aab5157c3df05e98d77ab6 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 25 Jan 2017 17:43:44 +0100 Subject: Fix problem with auto-mode and dir-locals-collect-variables * lisp/files.el (dir-locals-collect-variables): When run from auto-mode, the file in question may not be an absolute path name (bug#24016). Example backtrace: Debugger entered--Lisp error: (args-out-of-range "compile-1st-in-loa dir-locals-collect-variables(((emacs-lisp-mode (indent-tabs-mode)) hack-dir-local-variables() hack-local-variables(no-mode) run-mode-hooks(diff-mode-hook) diff-mode() mm-display-inline-fontify((# ("text/x-diff" ( --- lisp/files.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/files.el') diff --git a/lisp/files.el b/lisp/files.el index f60282b775a..25392fdcc71 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3723,7 +3723,8 @@ Return the new variables list." (let* ((file-name (or (buffer-file-name) ;; Handle non-file buffers, too. (expand-file-name default-directory))) - (sub-file-name (if file-name + (sub-file-name (if (and file-name + (file-name-absolute-p file-name)) ;; FIXME: Why not use file-relative-name? (substring file-name (length root))))) (condition-case err -- cgit v1.2.3