diff options
| author | Michael Albinus | 2008-03-17 22:57:15 +0000 |
|---|---|---|
| committer | Michael Albinus | 2008-03-17 22:57:15 +0000 |
| commit | 57671b7218249e42f7c84d2c202a1d56966f233b (patch) | |
| tree | 768acd5a7d98055a0f1582850305952164931ce2 | |
| parent | a67622356324849b04f33e5d1f9824140f05c6e1 (diff) | |
| download | emacs-57671b7218249e42f7c84d2c202a1d56966f233b.tar.gz emacs-57671b7218249e42f7c84d2c202a1d56966f233b.zip | |
* net/tramp.el (tramp-root-regexp): Simplify.
(tramp-completion-file-name-regexp-separate): Don't insist on
leading "[". This prevents method or user or host completion.
(tramp-let-maybe): Autoload it.
(tramp-drop-volume-letter): Don't autoload. When not on W32, it is
an alias for `identity'.
(tramp-handle-write-region): Protect `last-coding-system-used'
over the trailing statements.
(tramp-completion-file-name-handler-post-function): Removed.
(tramp-completion-file-name-handler): Let-bind
`directory-sep-char' instead of calling
`tramp-drop-volume-letter'.
(top): Move coding cookie at the end.
| -rw-r--r-- | lisp/ChangeLog | 21 | ||||
| -rw-r--r-- | lisp/net/tramp.el | 92 |
2 files changed, 61 insertions, 52 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ecd9395ad63..7da2e61e36d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,22 @@ | |||
| 1 | 2008-03-17 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp.el (tramp-root-regexp): Simplify. | ||
| 4 | (tramp-completion-file-name-regexp-separate): Don't insist on | ||
| 5 | leading "[". This prevents method or user or host completion. | ||
| 6 | (tramp-let-maybe): Autoload it. | ||
| 7 | (tramp-drop-volume-letter): Don't autoload. When not on W32, it | ||
| 8 | is an alias for `identity'. | ||
| 9 | (tramp-handle-write-region): Protect `last-coding-system-used' | ||
| 10 | over the trailing statements. | ||
| 11 | (tramp-completion-file-name-handler-post-function): Removed. | ||
| 12 | (tramp-completion-file-name-handler): Let-bind | ||
| 13 | `directory-sep-char' instead of calling | ||
| 14 | `tramp-drop-volume-letter'. | ||
| 15 | |||
| 16 | * net/tramp.el (top): | ||
| 17 | * net/tramp-uu.el (top): | ||
| 18 | * net/trampver.el (top): Move coding cookie at the end. | ||
| 19 | |||
| 1 | 2008-03-17 Stefan Monnier <monnier@iro.umontreal.ca> | 20 | 2008-03-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 21 | ||
| 3 | * net/tramp.el (tramp-completion-mode-p): Don't use char-equal for | 22 | * net/tramp.el (tramp-completion-mode-p): Don't use char-equal for |
| @@ -167,7 +186,7 @@ | |||
| 167 | 186 | ||
| 168 | 2008-03-15 Michael Albinus <michael.albinus@gmx.de> | 187 | 2008-03-15 Michael Albinus <michael.albinus@gmx.de> |
| 169 | 188 | ||
| 170 | * tramp.el (tramp-root-regexp): New defconst. | 189 | * net/tramp.el (tramp-root-regexp): New defconst. |
| 171 | (tramp-completion-file-name-regexp-unified) | 190 | (tramp-completion-file-name-regexp-unified) |
| 172 | (tramp-completion-file-name-regexp-separate) | 191 | (tramp-completion-file-name-regexp-separate) |
| 173 | (tramp-completion-file-name-regexp-url): Use it. | 192 | (tramp-completion-file-name-regexp-url): Use it. |
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 90b9a1bbaee..f4e11aecd55 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1,12 +1,11 @@ | |||
| 1 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol | 1 | ;;; tramp.el --- Transparent Remote Access, Multiple Protocol |
| 2 | ;;; -*- mode: Emacs-Lisp; coding: utf-8; -*- | ||
| 3 | 2 | ||
| 4 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, | 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
| 5 | ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 4 | ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
| 6 | 5 | ||
| 7 | ;; (copyright statements below in code to be updated with the above notice) | 6 | ;; (copyright statements below in code to be updated with the above notice) |
| 8 | 7 | ||
| 9 | ;; Author: Kai Großjohann <kai.grossjohann@gmx.net> | 8 | ;; Author: Kai Großjohann <kai.grossjohann@gmx.net> |
| 10 | ;; Michael Albinus <michael.albinus@gmx.de> | 9 | ;; Michael Albinus <michael.albinus@gmx.de> |
| 11 | ;; Keywords: comm, processes | 10 | ;; Keywords: comm, processes |
| 12 | 11 | ||
| @@ -1267,12 +1266,11 @@ Also see `tramp-file-name-structure'.") | |||
| 1267 | ;;;###autoload | 1266 | ;;;###autoload |
| 1268 | (defconst tramp-root-regexp | 1267 | (defconst tramp-root-regexp |
| 1269 | (if (memq system-type '(cygwin windows-nt)) | 1268 | (if (memq system-type '(cygwin windows-nt)) |
| 1270 | "^/$\\|^\\([a-zA-Z]:\\)?\\(/\\|\\\\\\(\\\\\\)?\\)" | 1269 | "^\\([a-zA-Z]:\\)?/" |
| 1271 | "^/$\\|^/") | 1270 | "^/") |
| 1272 | "Beginning of an incomplete Tramp file name. | 1271 | "Beginning of an incomplete Tramp file name. |
| 1273 | Usually, it is just \"^/\". On W32 systems, there might be a | 1272 | Usually, it is just \"^/\". On W32 systems, there might be a |
| 1274 | volume letter, which will be removed by `tramp-drop-volume-letter'. | 1273 | volume letter, which will be removed by `tramp-drop-volume-letter'.") |
| 1275 | It could be either \"^x:/\", either \"^x:\\\\\".") | ||
| 1276 | 1274 | ||
| 1277 | ;;;###autoload | 1275 | ;;;###autoload |
| 1278 | (defconst tramp-completion-file-name-regexp-unified | 1276 | (defconst tramp-completion-file-name-regexp-unified |
| @@ -1283,7 +1281,7 @@ See `tramp-file-name-structure' for more explanations.") | |||
| 1283 | 1281 | ||
| 1284 | ;;;###autoload | 1282 | ;;;###autoload |
| 1285 | (defconst tramp-completion-file-name-regexp-separate | 1283 | (defconst tramp-completion-file-name-regexp-separate |
| 1286 | (concat tramp-root-regexp "[[][^]]*$") | 1284 | (concat tramp-root-regexp "\\([[][^]]*\\)?$") |
| 1287 | "Value for `tramp-completion-file-name-regexp' for separate remoting. | 1285 | "Value for `tramp-completion-file-name-regexp' for separate remoting. |
| 1288 | XEmacs uses a separate filename syntax for Tramp and EFS. | 1286 | XEmacs uses a separate filename syntax for Tramp and EFS. |
| 1289 | See `tramp-file-name-structure' for more explanations.") | 1287 | See `tramp-file-name-structure' for more explanations.") |
| @@ -1959,6 +1957,7 @@ FILE must be a local file name on a connection identified via VEC." | |||
| 1959 | (put 'with-connection-property 'edebug-form-spec t) | 1957 | (put 'with-connection-property 'edebug-form-spec t) |
| 1960 | (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>")) | 1958 | (font-lock-add-keywords 'emacs-lisp-mode '("\\<with-connection-property\\>")) |
| 1961 | 1959 | ||
| 1960 | ;;;###autoload | ||
| 1962 | (defmacro tramp-let-maybe (variable value &rest body) | 1961 | (defmacro tramp-let-maybe (variable value &rest body) |
| 1963 | "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. | 1962 | "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. |
| 1964 | BODY is executed whether or not the variable is obsolete. | 1963 | BODY is executed whether or not the variable is obsolete. |
| @@ -3498,19 +3497,16 @@ This is like `dired-recursive-delete-directory' for Tramp files." | |||
| 3498 | 3497 | ||
| 3499 | ;; Canonicalization of file names. | 3498 | ;; Canonicalization of file names. |
| 3500 | 3499 | ||
| 3501 | ;;;###autoload | 3500 | (if (memq system-type '(cygwin windows-nt)) |
| 3502 | (defun tramp-drop-volume-letter (name) | 3501 | (defun tramp-drop-volume-letter (name) |
| 3503 | "Cut off unnecessary drive letter from file NAME. | 3502 | "Cut off unnecessary drive letter from file NAME. |
| 3504 | The function `tramp-handle-expand-file-name' calls `expand-file-name' | 3503 | The function `tramp-handle-expand-file-name' calls `expand-file-name' |
| 3505 | locally on a remote file name. When the local system is a W32 system | 3504 | locally on a remote file name. When the local system is a W32 system |
| 3506 | but the remote system is Unix, this introduces a superfluous drive | 3505 | but the remote system is Unix, this introduces a superfluous drive |
| 3507 | letter into the file name. This function removes it. | 3506 | letter into the file name. This function removes it." |
| 3507 | (save-match-data (replace-regexp-in-string tramp-root-regexp "/" name))) | ||
| 3508 | 3508 | ||
| 3509 | Doesn't do anything if the NAME does not start with a drive letter." | 3509 | (defalias 'tramp-drop-volume-letter 'identity)) |
| 3510 | (save-match-data | ||
| 3511 | (if (and (stringp name) (string-match tramp-root-regexp name)) | ||
| 3512 | (replace-match "/" nil nil name) | ||
| 3513 | name))) | ||
| 3514 | 3510 | ||
| 3515 | (defun tramp-handle-expand-file-name (name &optional dir) | 3511 | (defun tramp-handle-expand-file-name (name &optional dir) |
| 3516 | "Like `expand-file-name' for Tramp files. | 3512 | "Like `expand-file-name' for Tramp files. |
| @@ -4274,19 +4270,22 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file." | |||
| 4274 | (when coding-system-used | 4270 | (when coding-system-used |
| 4275 | (set 'last-coding-system-used coding-system-used)))) | 4271 | (set 'last-coding-system-used coding-system-used)))) |
| 4276 | 4272 | ||
| 4277 | ;; Set file modification time. | 4273 | ;; We must protect `last-coding-system-used', now we have set it |
| 4278 | (when (or (eq visit t) (stringp visit)) | 4274 | ;; to its correct value. |
| 4279 | (set-visited-file-modtime | 4275 | (let (last-coding-system-used) |
| 4280 | ;; We must pass modtime explicitely, because filename can | 4276 | ;; Set file modification time. |
| 4281 | ;; be different from (buffer-file-name), f.e. if | 4277 | (when (or (eq visit t) (stringp visit)) |
| 4282 | ;; `file-precious-flag' is set. | 4278 | (set-visited-file-modtime |
| 4283 | (nth 5 (file-attributes filename)))) | 4279 | ;; We must pass modtime explicitely, because filename can |
| 4284 | 4280 | ;; be different from (buffer-file-name), f.e. if | |
| 4285 | ;; Set the ownership. | 4281 | ;; `file-precious-flag' is set. |
| 4286 | (tramp-set-file-uid-gid filename uid gid) | 4282 | (nth 5 (file-attributes filename)))) |
| 4287 | (when (or (eq visit t) (null visit) (stringp visit)) | 4283 | |
| 4288 | (tramp-message v 0 "Wrote %s" filename)) | 4284 | ;; Set the ownership. |
| 4289 | (run-hooks 'tramp-handle-write-region-hook)))) | 4285 | (tramp-set-file-uid-gid filename uid gid) |
| 4286 | (when (or (eq visit t) (null visit) (stringp visit)) | ||
| 4287 | (tramp-message v 0 "Wrote %s" filename)) | ||
| 4288 | (run-hooks 'tramp-handle-write-region-hook))))) | ||
| 4290 | 4289 | ||
| 4291 | ;;;###autoload | 4290 | ;;;###autoload |
| 4292 | (progn (defun tramp-run-real-handler (operation args) | 4291 | (progn (defun tramp-run-real-handler (operation args) |
| @@ -4493,25 +4492,16 @@ Fall back to normal file name handler if no Tramp handler exists." | |||
| 4493 | (setq tramp-locked tl)))) | 4492 | (setq tramp-locked tl)))) |
| 4494 | 4493 | ||
| 4495 | ;;;###autoload | 4494 | ;;;###autoload |
| 4496 | (defconst tramp-completion-file-name-handler-post-function | ||
| 4497 | (if (and (featurep 'xemacs) (memq system-type '(cygwin windows-nt))) | ||
| 4498 | 'tramp-drop-volume-letter | ||
| 4499 | 'identity) | ||
| 4500 | "Function to be called on the result of `tramp-completion-file-name-handler'. | ||
| 4501 | For GNU Emacs, handling of `file-name-all-completions' and | ||
| 4502 | `file-name-completion' is sufficient. In the XEmacs case, there | ||
| 4503 | are more disturbing drive letters.") | ||
| 4504 | |||
| 4505 | ;;;###autoload | ||
| 4506 | (progn (defun tramp-completion-file-name-handler (operation &rest args) | 4495 | (progn (defun tramp-completion-file-name-handler (operation &rest args) |
| 4507 | "Invoke Tramp file name completion handler. | 4496 | "Invoke Tramp file name completion handler. |
| 4508 | Falls back to normal file name handler if no Tramp file name handler exists." | 4497 | Falls back to normal file name handler if no Tramp file name handler exists." |
| 4509 | (funcall | 4498 | ;; We bind `directory-sep-char' here for XEmacs on Windows, which |
| 4510 | tramp-completion-file-name-handler-post-function | 4499 | ;; would otherwise use backslash. |
| 4511 | (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) | 4500 | (tramp-let-maybe directory-sep-char ?/ |
| 4512 | (if fn | 4501 | (let ((fn (assoc operation tramp-completion-file-name-handler-alist))) |
| 4513 | (save-match-data (apply (cdr fn) args)) | 4502 | (if fn |
| 4514 | (tramp-completion-run-real-handler operation args)))))) | 4503 | (save-match-data (apply (cdr fn) args)) |
| 4504 | (tramp-completion-run-real-handler operation args)))))) | ||
| 4515 | 4505 | ||
| 4516 | ;;;###autoload | 4506 | ;;;###autoload |
| 4517 | (defsubst tramp-register-file-name-handler () | 4507 | (defsubst tramp-register-file-name-handler () |
| @@ -7353,7 +7343,6 @@ Only works for Bourne-like shells." | |||
| 7353 | ;; * Autodetect if remote `ls' groks the "--dired" switch. | 7343 | ;; * Autodetect if remote `ls' groks the "--dired" switch. |
| 7354 | ;; * Rewrite `tramp-shell-quote-argument' to abstain from using | 7344 | ;; * Rewrite `tramp-shell-quote-argument' to abstain from using |
| 7355 | ;; `shell-quote-argument'. | 7345 | ;; `shell-quote-argument'. |
| 7356 | ;; * Completion gets confused when you leave out the method name. | ||
| 7357 | ;; * In Emacs 21, `insert-directory' shows total number of bytes used | 7346 | ;; * In Emacs 21, `insert-directory' shows total number of bytes used |
| 7358 | ;; by the files in that directory. Add this here. | 7347 | ;; by the files in that directory. Add this here. |
| 7359 | ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) | 7348 | ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) |
| @@ -7361,10 +7350,6 @@ Only works for Bourne-like shells." | |||
| 7361 | ;; * When logging in, keep looking for questions according to an alist | 7350 | ;; * When logging in, keep looking for questions according to an alist |
| 7362 | ;; and then invoke the right function. | 7351 | ;; and then invoke the right function. |
| 7363 | ;; * Case-insensitive filename completion. (Norbert Goevert.) | 7352 | ;; * Case-insensitive filename completion. (Norbert Goevert.) |
| 7364 | ;; * Running CVS remotely doesn't appear to work right. It thinks | ||
| 7365 | ;; files are locked by somebody else even if I'm the locking user. | ||
| 7366 | ;; Sometimes, one gets `No CVSROOT specified' errors from CVS. | ||
| 7367 | ;; (Skip Montanaro) | ||
| 7368 | ;; * Don't use globbing for directories with many files, as this is | 7353 | ;; * Don't use globbing for directories with many files, as this is |
| 7369 | ;; likely to produce long command lines, and some shells choke on | 7354 | ;; likely to produce long command lines, and some shells choke on |
| 7370 | ;; long command lines. | 7355 | ;; long command lines. |
| @@ -7383,7 +7368,7 @@ Only works for Bourne-like shells." | |||
| 7383 | ;; transfer method to use. (Greg Stark) | 7368 | ;; transfer method to use. (Greg Stark) |
| 7384 | ;; * Remove unneeded parameters from methods. | 7369 | ;; * Remove unneeded parameters from methods. |
| 7385 | ;; * Invoke rsync once for copying a whole directory hierarchy. | 7370 | ;; * Invoke rsync once for copying a whole directory hierarchy. |
| 7386 | ;; (Francesco Potortì) | 7371 | ;; (Francesco Potortì) |
| 7387 | ;; * Make it work for different encodings, and for different file name | 7372 | ;; * Make it work for different encodings, and for different file name |
| 7388 | ;; encodings, too. (Daniel Pittman) | 7373 | ;; encodings, too. (Daniel Pittman) |
| 7389 | ;; * Progress reports while copying files. (Michael Kifer) | 7374 | ;; * Progress reports while copying files. (Michael Kifer) |
| @@ -7438,3 +7423,8 @@ Only works for Bourne-like shells." | |||
| 7438 | 7423 | ||
| 7439 | ;;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a | 7424 | ;;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a |
| 7440 | ;;; tramp.el ends here | 7425 | ;;; tramp.el ends here |
| 7426 | |||
| 7427 | ;; Local Variables: | ||
| 7428 | ;; mode: Emacs-Lisp | ||
| 7429 | ;; coding: utf-8 | ||
| 7430 | ;; End: | ||