diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2011-07-06 11:48:20 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2011-07-06 11:48:20 +0200 |
commit | 1cdd2a1b363afb91bfaa397fa04be1bb3e88c9ae (patch) | |
tree | 8c0322644e9626c230fd22e6a6d6131e1364a9f8 /lisp/net/tramp-compat.el | |
parent | 53d21671304e4574d9c9c3e206532a449c1b09b3 (diff) | |
download | emacs-1cdd2a1b363afb91bfaa397fa04be1bb3e88c9ae.tar.gz |
* net/tramp-compat.el (tramp-compat-pop-to-buffer-same-window): New defun.
* net/tramp-cmds.el (tramp-append-tramp-buffers): Use it.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r-- | lisp/net/tramp-compat.el | 29 |
1 files changed, 19 insertions, 10 deletions
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 @@ ;;; Commentary: -;; Tramp's main Emacs version for development is GNU Emacs 24. This -;; package provides compatibility functions for GNU Emacs 22, GNU -;; Emacs 23 and XEmacs 21.4+. +;; Tramp's main Emacs version for development is Emacs 24. This +;; package provides compatibility functions for Emacs 22, Emacs 23, +;; XEmacs 21.4+ and SXEmacs 22. ;;; Code: @@ -286,9 +286,8 @@ Not actually used. Use `(format \"%o\" i)' instead?" (tramp-compat-funcall 'file-attributes filename id-format) (wrong-number-of-arguments (file-attributes filename)))))) -;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not -;; hurt to ignore it for other (X)Emacs versions. -;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24. +;; PRESERVE-UID-GID does not exist in XEmacs. +;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24.1. (defun tramp-compat-copy-file (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid preserve-selinux-context) @@ -484,10 +483,7 @@ exiting if process is running." (tramp-compat-funcall 'set-process-query-on-exit-flag process flag) (tramp-compat-funcall 'process-kill-without-query process flag))) -(add-hook 'tramp-unload-hook - (lambda () - (unload-feature 'tramp-compat 'force))) - +;; There exist different implementations for this function. (defun tramp-compat-coding-system-change-eol-conversion (coding-system eol-type) "Return a coding system like CODING-SYSTEM but with given EOL-TYPE. EOL-TYPE can be one of `dos', `unix', or `mac'." @@ -506,6 +502,19 @@ EOL-TYPE can be one of `dos', `unix', or `mac'." "`dos', `unix', or `mac'"))))) (t (error "Can't change EOL conversion -- is MULE missing?")))) +;; `pop-to-buffer-same-window' has been introduced with Emacs 24.1. +(defun tramp-compat-pop-to-buffer-same-window + (&optional buffer-or-name norecord label) + "Pop to buffer specified by BUFFER-OR-NAME in the selected window." + (if (fboundp 'pop-to-buffer-same-window) + (tramp-compat-funcall + 'pop-to-buffer-same-window buffer-or-name norecord label) + (tramp-compat-funcall 'switch-to-buffer buffer-or-name norecord))) + +(add-hook 'tramp-unload-hook + (lambda () + (unload-feature 'tramp-compat 'force))) + (provide 'tramp-compat) ;;; TODO: |