[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r106068: Fix Bug#6019, Bug#9315.
From: |
Michael Albinus |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r106068: Fix Bug#6019, Bug#9315. |
Date: |
Wed, 12 Oct 2011 20:32:35 +0200 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 106068
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Wed 2011-10-12 20:32:35 +0200
message:
Fix Bug#6019, Bug#9315.
* files.el (set-auto-mode): Call `file-name-sans-versions' for the
complete `buffer-file-name', the local file name part could look
remotely (for example on VMS).
* net/ange-ftp.el (ange-ftp-run-real-handler): Make it an alias of
`tramp-run-real-handler'.
(ange-ftp-fix-name-for-vms): Handle the case, where `name' is
already quoted by '"'.
* net/tramp.el (tramp-rfn-eshadow-update-overlay): Ignore errors.
Let `file-name-handler-alist' be nil, the local file name part
could look remotely (for example on VMS).
modified:
lisp/ChangeLog
lisp/files.el
lisp/net/ange-ftp.el
lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2011-10-12 02:48:40 +0000
+++ b/lisp/ChangeLog 2011-10-12 18:32:35 +0000
@@ -1,3 +1,20 @@
+2011-10-12 Michael Albinus <address@hidden>
+
+ Fix Bug#6019, Bug#9315.
+
+ * files.el (set-auto-mode): Call `file-name-sans-versions' for the
+ complete `buffer-file-name', the local file name part could look
+ remotely (for example on VMS).
+
+ * net/ange-ftp.el (ange-ftp-run-real-handler): Make it an alias of
+ `tramp-run-real-handler'.
+ (ange-ftp-fix-name-for-vms): Handle the case, where `name' is
+ already quoted by '"'.
+
+ * net/tramp.el (tramp-rfn-eshadow-update-overlay): Ignore errors.
+ Let `file-name-handler-alist' be nil, the local file name part
+ could look remotely (for example on VMS).
+
2011-10-12 Stefan Monnier <address@hidden>
* textmodes/flyspell.el (flyspell-word): Move with-local-quit
=== modified file 'lisp/files.el'
--- a/lisp/files.el 2011-09-22 10:00:07 +0000
+++ b/lisp/files.el 2011-10-12 18:32:35 +0000
@@ -2629,12 +2629,12 @@
(if buffer-file-name
(let ((name buffer-file-name)
(remote-id (file-remote-p buffer-file-name)))
+ ;; Remove backup-suffixes from file name.
+ (setq name (file-name-sans-versions name))
;; Remove remote file name identification.
(when (and (stringp remote-id)
(string-match (regexp-quote remote-id) name))
(setq name (substring name (match-end 0))))
- ;; Remove backup-suffixes from file name.
- (setq name (file-name-sans-versions name))
(while name
;; Find first matching alist entry.
(setq mode
=== modified file 'lisp/net/ange-ftp.el'
--- a/lisp/net/ange-ftp.el 2011-06-27 21:30:37 +0000
+++ b/lisp/net/ange-ftp.el 2011-10-12 18:32:35 +0000
@@ -4412,14 +4412,16 @@
;;; Define ways of getting at unmodified Emacs primitives,
;;; turning off our handler.
-(defun ange-ftp-run-real-handler (operation args)
- (let ((inhibit-file-name-handlers
- (cons 'ange-ftp-hook-function
- (cons 'ange-ftp-completion-hook-function
- (and (eq inhibit-file-name-operation operation)
- inhibit-file-name-handlers))))
- (inhibit-file-name-operation operation))
- (apply operation args)))
+;(defun ange-ftp-run-real-handler (operation args)
+; (let ((inhibit-file-name-handlers
+; (cons 'ange-ftp-hook-function
+; (cons 'ange-ftp-completion-hook-function
+; (and (eq inhibit-file-name-operation operation)
+; inhibit-file-name-handlers))))
+; (inhibit-file-name-operation operation))
+; (apply operation args)))
+
+(defalias 'ange-ftp-run-real-handler 'tramp-run-real-handler)
(defun ange-ftp-real-file-name-directory (&rest args)
(ange-ftp-run-real-handler 'file-name-directory args))
@@ -5005,7 +5007,11 @@
dir (and dir "/")
file))
(error "name %s didn't match" name))
- (let (drive dir file tmp)
+ (let (drive dir file tmp quote)
+ (if (string-match "\\`\".+\"\\'" name)
+ (setq name (substring name 1 -1)
+ quote "\"")
+ (setq quote ""))
(if (string-match "\\`/[^:]+:/" name)
(setq drive (substring name 1
(1- (match-end 0)))
@@ -5014,9 +5020,9 @@
(if tmp
(setq dir (subst-char-in-string ?/ ?. (substring tmp 0 -1) t)))
(setq file (file-name-nondirectory name))
- (concat drive
+ (concat quote drive
(and dir (concat "[" (if drive nil ".") dir "]"))
- file)))))
+ file quote)))))
;; (ange-ftp-fix-name-for-vms "/PUB$:/ANONYMOUS/SDSCPUB/NEXT/Readme.txt;1")
;; (ange-ftp-fix-name-for-vms "/PUB$:[ANONYMOUS.SDSCPUB.NEXT]Readme.txt;1" t)
=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2011-10-09 09:38:25 +0000
+++ b/lisp/net/tramp.el 2011-10-12 18:32:35 +0000
@@ -1606,24 +1606,28 @@
`file-name-shadow-mode'; the minibuffer should have already
been set up by `rfn-eshadow-setup-minibuffer'."
;; In remote files name, there is a shadowing just for the local part.
- (let ((end (or (tramp-compat-funcall
- 'overlay-end (symbol-value 'rfn-eshadow-overlay))
- (tramp-compat-funcall 'minibuffer-prompt-end))))
- (when
- (file-remote-p
- (tramp-compat-funcall 'buffer-substring-no-properties end (point-max)))
- (save-excursion
- (save-restriction
- (narrow-to-region
- (1+ (or (string-match
- tramp-rfn-eshadow-update-overlay-regexp (buffer-string) end)
- end))
- (point-max))
- (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
- (rfn-eshadow-update-overlay-hook nil))
- (tramp-compat-funcall
- 'move-overlay rfn-eshadow-overlay (point-max) (point-max))
- (tramp-compat-funcall 'rfn-eshadow-update-overlay)))))))
+ (ignore-errors
+ (let ((end (or (tramp-compat-funcall
+ 'overlay-end (symbol-value 'rfn-eshadow-overlay))
+ (tramp-compat-funcall 'minibuffer-prompt-end))))
+ (when
+ (file-remote-p
+ (tramp-compat-funcall
+ 'buffer-substring-no-properties end (point-max)))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region
+ (1+ (or (string-match
+ tramp-rfn-eshadow-update-overlay-regexp
+ (buffer-string) end)
+ end))
+ (point-max))
+ (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
+ (rfn-eshadow-update-overlay-hook nil)
+ file-name-handler-alist)
+ (tramp-compat-funcall
+ 'move-overlay rfn-eshadow-overlay (point-max) (point-max))
+ (tramp-compat-funcall 'rfn-eshadow-update-overlay))))))))
(when (boundp 'rfn-eshadow-update-overlay-hook)
(add-hook 'rfn-eshadow-update-overlay-hook
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r106068: Fix Bug#6019, Bug#9315.,
Michael Albinus <=