diff options
| author | Michael Albinus | 2011-07-06 11:48:20 +0200 |
|---|---|---|
| committer | Michael Albinus | 2011-07-06 11:48:20 +0200 |
| commit | 1cdd2a1b363afb91bfaa397fa04be1bb3e88c9ae (patch) | |
| tree | 8c0322644e9626c230fd22e6a6d6131e1364a9f8 | |
| parent | 53d21671304e4574d9c9c3e206532a449c1b09b3 (diff) | |
| download | emacs-1cdd2a1b363afb91bfaa397fa04be1bb3e88c9ae.tar.gz emacs-1cdd2a1b363afb91bfaa397fa04be1bb3e88c9ae.zip | |
* net/tramp-compat.el (tramp-compat-pop-to-buffer-same-window): New defun.
* net/tramp-cmds.el (tramp-append-tramp-buffers): Use it.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/net/tramp-cmds.el | 4 | ||||
| -rw-r--r-- | lisp/net/tramp-compat.el | 29 |
3 files changed, 27 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0558e789da..fb4d94117c6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-07-06 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/tramp-compat.el (tramp-compat-pop-to-buffer-same-window): | ||
| 4 | New defun. | ||
| 5 | * net/tramp-cmds.el (tramp-append-tramp-buffers): Use it. | ||
| 6 | |||
| 1 | 2011-07-06 Michael R. Mauger <mmaug@yahoo.com> | 7 | 2011-07-06 Michael R. Mauger <mmaug@yahoo.com> |
| 2 | 8 | ||
| 3 | * progmodes/sql.el: Version 3.0 | 9 | * progmodes/sql.el: Version 3.0 |
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 307ce5368ce..f20040e8a9a 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el | |||
| @@ -308,7 +308,7 @@ buffer in your bug report. | |||
| 308 | 308 | ||
| 309 | ;; There is at least one Tramp buffer. | 309 | ;; There is at least one Tramp buffer. |
| 310 | (when buffer-list | 310 | (when buffer-list |
| 311 | (pop-to-buffer-same-window (list-buffers-noselect nil)) | 311 | (tramp-compat-pop-to-buffer-same-window (list-buffers-noselect nil)) |
| 312 | (delete-other-windows) | 312 | (delete-other-windows) |
| 313 | (setq buffer-read-only nil) | 313 | (setq buffer-read-only nil) |
| 314 | (goto-char (point-min)) | 314 | (goto-char (point-min)) |
| @@ -343,7 +343,7 @@ the debug buffer(s).") | |||
| 343 | ;; OK, let's send. First we delete the buffer list. | 343 | ;; OK, let's send. First we delete the buffer list. |
| 344 | (progn | 344 | (progn |
| 345 | (kill-buffer nil) | 345 | (kill-buffer nil) |
| 346 | (pop-to-buffer-same-window curbuf) | 346 | (tramp-compat-pop-to-buffer-same-window curbuf) |
| 347 | (goto-char (point-max)) | 347 | (goto-char (point-max)) |
| 348 | (insert "\n\ | 348 | (insert "\n\ |
| 349 | This is a special notion of the `gnus/message' package. If you | 349 | This is a special notion of the `gnus/message' package. If you |
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 3c0642c3c78..e7ea4354b51 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el | |||
| @@ -23,9 +23,9 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Commentary: | 24 | ;;; Commentary: |
| 25 | 25 | ||
| 26 | ;; Tramp's main Emacs version for development is GNU Emacs 24. This | 26 | ;; Tramp's main Emacs version for development is Emacs 24. This |
| 27 | ;; package provides compatibility functions for GNU Emacs 22, GNU | 27 | ;; package provides compatibility functions for Emacs 22, Emacs 23, |
| 28 | ;; Emacs 23 and XEmacs 21.4+. | 28 | ;; XEmacs 21.4+ and SXEmacs 22. |
| 29 | 29 | ||
| 30 | ;;; Code: | 30 | ;;; Code: |
| 31 | 31 | ||
| @@ -286,9 +286,8 @@ Not actually used. Use `(format \"%o\" i)' instead?" | |||
| 286 | (tramp-compat-funcall 'file-attributes filename id-format) | 286 | (tramp-compat-funcall 'file-attributes filename id-format) |
| 287 | (wrong-number-of-arguments (file-attributes filename)))))) | 287 | (wrong-number-of-arguments (file-attributes filename)))))) |
| 288 | 288 | ||
| 289 | ;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not | 289 | ;; PRESERVE-UID-GID does not exist in XEmacs. |
| 290 | ;; hurt to ignore it for other (X)Emacs versions. | 290 | ;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24.1. |
| 291 | ;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24. | ||
| 292 | (defun tramp-compat-copy-file | 291 | (defun tramp-compat-copy-file |
| 293 | (filename newname &optional ok-if-already-exists keep-date | 292 | (filename newname &optional ok-if-already-exists keep-date |
| 294 | preserve-uid-gid preserve-selinux-context) | 293 | preserve-uid-gid preserve-selinux-context) |
| @@ -484,10 +483,7 @@ exiting if process is running." | |||
| 484 | (tramp-compat-funcall 'set-process-query-on-exit-flag process flag) | 483 | (tramp-compat-funcall 'set-process-query-on-exit-flag process flag) |
| 485 | (tramp-compat-funcall 'process-kill-without-query process flag))) | 484 | (tramp-compat-funcall 'process-kill-without-query process flag))) |
| 486 | 485 | ||
| 487 | (add-hook 'tramp-unload-hook | 486 | ;; There exist different implementations for this function. |
| 488 | (lambda () | ||
| 489 | (unload-feature 'tramp-compat 'force))) | ||
| 490 | |||
| 491 | (defun tramp-compat-coding-system-change-eol-conversion (coding-system eol-type) | 487 | (defun tramp-compat-coding-system-change-eol-conversion (coding-system eol-type) |
| 492 | "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. | 488 | "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. |
| 493 | EOL-TYPE can be one of `dos', `unix', or `mac'." | 489 | EOL-TYPE can be one of `dos', `unix', or `mac'." |
| @@ -506,6 +502,19 @@ EOL-TYPE can be one of `dos', `unix', or `mac'." | |||
| 506 | "`dos', `unix', or `mac'"))))) | 502 | "`dos', `unix', or `mac'"))))) |
| 507 | (t (error "Can't change EOL conversion -- is MULE missing?")))) | 503 | (t (error "Can't change EOL conversion -- is MULE missing?")))) |
| 508 | 504 | ||
| 505 | ;; `pop-to-buffer-same-window' has been introduced with Emacs 24.1. | ||
| 506 | (defun tramp-compat-pop-to-buffer-same-window | ||
| 507 | (&optional buffer-or-name norecord label) | ||
| 508 | "Pop to buffer specified by BUFFER-OR-NAME in the selected window." | ||
| 509 | (if (fboundp 'pop-to-buffer-same-window) | ||
| 510 | (tramp-compat-funcall | ||
| 511 | 'pop-to-buffer-same-window buffer-or-name norecord label) | ||
| 512 | (tramp-compat-funcall 'switch-to-buffer buffer-or-name norecord))) | ||
| 513 | |||
| 514 | (add-hook 'tramp-unload-hook | ||
| 515 | (lambda () | ||
| 516 | (unload-feature 'tramp-compat 'force))) | ||
| 517 | |||
| 509 | (provide 'tramp-compat) | 518 | (provide 'tramp-compat) |
| 510 | 519 | ||
| 511 | ;;; TODO: | 520 | ;;; TODO: |