diff options
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/net/tramp-smb.el | 1 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 45 | ||||
| -rw-r--r-- | lisp/rfn-eshadow.el | 14 |
4 files changed, 72 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f238531667a..2b0e3ad42e3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2007-09-21 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * rfn-eshadow.el (rfn-eshadow-setup-minibuffer-hook) | ||
| 4 | (rfn-eshadow-update-overlay-hook): New defvars. | ||
| 5 | (rfn-eshadow-setup-minibuffer, rfn-eshadow-update-overlay): Run | ||
| 6 | the hooks. | ||
| 7 | |||
| 8 | * net/tramp.el (tramp-rfn-eshadow-overlay): New defvar. | ||
| 9 | (tramp-rfn-eshadow-setup-minibuffer) | ||
| 10 | (tramp-rfn-eshadow-update-overlay): New defuns. Hook into | ||
| 11 | rfn-eshadow.el. | ||
| 12 | |||
| 13 | * net/tramp-smb.el (tramp-smb-errors): Add error message for call | ||
| 14 | timeout. | ||
| 15 | |||
| 1 | 2007-09-21 Markus Triska <markus.triska@gmx.at> | 16 | 2007-09-21 Markus Triska <markus.triska@gmx.at> |
| 2 | 17 | ||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-normal-call): Warn when | 18 | * emacs-lisp/bytecomp.el (byte-compile-normal-call): Warn when |
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index 5dbf12955d7..c7ea3a12163 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el | |||
| @@ -79,6 +79,7 @@ | |||
| 79 | '(;; Connection error / timeout | 79 | '(;; Connection error / timeout |
| 80 | "Connection to \\S-+ failed" | 80 | "Connection to \\S-+ failed" |
| 81 | "Read from server failed, maybe it closed the connection" | 81 | "Read from server failed, maybe it closed the connection" |
| 82 | "Call timed out: server did not respond" | ||
| 82 | ;; Samba | 83 | ;; Samba |
| 83 | "ERRDOS" | 84 | "ERRDOS" |
| 84 | "ERRSRV" | 85 | "ERRSRV" |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index bcab2b9cf52..a102a9f19c0 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -2087,6 +2087,49 @@ For definition of that list see `tramp-set-completion-function'." | |||
| 2087 | ;; The method related defaults. | 2087 | ;; The method related defaults. |
| 2088 | (cdr (assoc method tramp-completion-function-alist)))) | 2088 | (cdr (assoc method tramp-completion-function-alist)))) |
| 2089 | 2089 | ||
| 2090 | |||
| 2091 | ;;; Fontification of `read-file-name'. | ||
| 2092 | |||
| 2093 | ;; rfn-eshadow.el is part of Emacs 22. Its is autoloaded. | ||
| 2094 | (defvar tramp-rfn-eshadow-overlay) | ||
| 2095 | (make-variable-buffer-local 'tramp-rfn-eshadow-overlay) | ||
| 2096 | |||
| 2097 | (defun tramp-rfn-eshadow-setup-minibuffer () | ||
| 2098 | "Set up a minibuffer for `file-name-shadow-mode'. | ||
| 2099 | Adds another overlay hiding filename parts according to Tramp's | ||
| 2100 | special handling of `substitute-in-file-name'." | ||
| 2101 | (when minibuffer-completing-file-name | ||
| 2102 | (setq tramp-rfn-eshadow-overlay | ||
| 2103 | (make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end))) | ||
| 2104 | ;; Copy rfn-eshadow-overlay properties. | ||
| 2105 | (let ((props (overlay-properties rfn-eshadow-overlay))) | ||
| 2106 | (while props | ||
| 2107 | (overlay-put tramp-rfn-eshadow-overlay (pop props) (pop props)))))) | ||
| 2108 | |||
| 2109 | (when (boundp 'rfn-eshadow-setup-minibuffer-hook) | ||
| 2110 | (add-hook 'rfn-eshadow-setup-minibuffer-hook | ||
| 2111 | 'tramp-rfn-eshadow-setup-minibuffer)) | ||
| 2112 | |||
| 2113 | (defun tramp-rfn-eshadow-update-overlay () | ||
| 2114 | "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. | ||
| 2115 | This is intended to be used as a minibuffer `post-command-hook' for | ||
| 2116 | `file-name-shadow-mode'; the minibuffer should have already | ||
| 2117 | been set up by `rfn-eshadow-setup-minibuffer'." | ||
| 2118 | ;; In remote files name, there is a shadowing just for the local part. | ||
| 2119 | (let ((end (or (overlay-end rfn-eshadow-overlay) (minibuffer-prompt-end)))) | ||
| 2120 | (when (file-remote-p (buffer-substring-no-properties end (point-max))) | ||
| 2121 | (narrow-to-region | ||
| 2122 | (1+ (or (string-match "/" (buffer-string) end) end)) (point-max)) | ||
| 2123 | (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) | ||
| 2124 | (rfn-eshadow-update-overlay-hook nil)) | ||
| 2125 | (rfn-eshadow-update-overlay)) | ||
| 2126 | (widen)))) | ||
| 2127 | |||
| 2128 | (when (boundp 'rfn-eshadow-update-overlay-hook) | ||
| 2129 | (add-hook 'rfn-eshadow-update-overlay-hook | ||
| 2130 | 'tramp-rfn-eshadow-update-overlay)) | ||
| 2131 | |||
| 2132 | |||
| 2090 | ;;; File Name Handler Functions: | 2133 | ;;; File Name Handler Functions: |
| 2091 | 2134 | ||
| 2092 | (defun tramp-handle-make-symbolic-link | 2135 | (defun tramp-handle-make-symbolic-link |
| @@ -7467,7 +7510,7 @@ please ensure that the buffers are attached to your email.\n\n") | |||
| 7467 | ;; indefinitely blocking piece of code. In this case it would be | 7510 | ;; indefinitely blocking piece of code. In this case it would be |
| 7468 | ;; within Tramp around one of its calls to accept-process-output (or | 7511 | ;; within Tramp around one of its calls to accept-process-output (or |
| 7469 | ;; around one of the loops that calls accept-process-output) | 7512 | ;; around one of the loops that calls accept-process-output) |
| 7470 | ;; (Stefann Monnier). | 7513 | ;; (Stefan Monnier). |
| 7471 | ;; * Autodetect if remote `ls' groks the "--dired" switch. | 7514 | ;; * Autodetect if remote `ls' groks the "--dired" switch. |
| 7472 | ;; * Add fallback for inline encodings. This should be used | 7515 | ;; * Add fallback for inline encodings. This should be used |
| 7473 | ;; if the remote end doesn't support mimencode or a similar program. | 7516 | ;; if the remote end doesn't support mimencode or a similar program. |
diff --git a/lisp/rfn-eshadow.el b/lisp/rfn-eshadow.el index daa66118b38..ced5ed3f368 100644 --- a/lisp/rfn-eshadow.el +++ b/lisp/rfn-eshadow.el | |||
| @@ -119,6 +119,12 @@ system, `file-name-shadow-properties' is used instead." | |||
| 119 | :group 'minibuffer | 119 | :group 'minibuffer |
| 120 | :version "22.1") | 120 | :version "22.1") |
| 121 | 121 | ||
| 122 | (defvar rfn-eshadow-setup-minibuffer-hook nil | ||
| 123 | "Minibuffer setup functions from other packages.") | ||
| 124 | |||
| 125 | (defvar rfn-eshadow-update-overlay-hook nil | ||
| 126 | "Customer overlay functions from other packages") | ||
| 127 | |||
| 122 | 128 | ||
| 123 | ;;; Internal variables | 129 | ;;; Internal variables |
| 124 | 130 | ||
| @@ -153,7 +159,9 @@ The prompt and initial input should already have been inserted." | |||
| 153 | (overlay-put rfn-eshadow-overlay 'evaporate t) | 159 | (overlay-put rfn-eshadow-overlay 'evaporate t) |
| 154 | ;; Add our post-command hook, and make sure can remove it later. | 160 | ;; Add our post-command hook, and make sure can remove it later. |
| 155 | (add-to-list 'rfn-eshadow-frobbed-minibufs (current-buffer)) | 161 | (add-to-list 'rfn-eshadow-frobbed-minibufs (current-buffer)) |
| 156 | (add-hook 'post-command-hook #'rfn-eshadow-update-overlay nil t))) | 162 | (add-hook 'post-command-hook #'rfn-eshadow-update-overlay nil t) |
| 163 | ;; Run custom hook | ||
| 164 | (run-hooks 'rfn-eshadow-setup-minibuffer-hook))) | ||
| 157 | 165 | ||
| 158 | (defsubst rfn-eshadow-sifn-equal (goal pos) | 166 | (defsubst rfn-eshadow-sifn-equal (goal pos) |
| 159 | (equal goal (condition-case nil | 167 | (equal goal (condition-case nil |
| @@ -193,7 +201,9 @@ been set up by `rfn-eshadow-setup-minibuffer'." | |||
| 193 | (if (rfn-eshadow-sifn-equal goal mid) | 201 | (if (rfn-eshadow-sifn-equal goal mid) |
| 194 | (setq start mid) | 202 | (setq start mid) |
| 195 | (setq end mid))) | 203 | (setq end mid))) |
| 196 | (move-overlay rfn-eshadow-overlay (minibuffer-prompt-end) start))) | 204 | (move-overlay rfn-eshadow-overlay (minibuffer-prompt-end) start)) |
| 205 | ;; Run custom hook | ||
| 206 | (run-hooks 'rfn-eshadow-update-overlay-hook)) | ||
| 197 | ;; `substitute-in-file-name' can fail on partial input. | 207 | ;; `substitute-in-file-name' can fail on partial input. |
| 198 | (error nil))) | 208 | (error nil))) |
| 199 | 209 | ||