;; There is at least one Tramp buffer.
(when buffer-list
- (pop-to-buffer-same-window (list-buffers-noselect nil))
+ (tramp-compat-pop-to-buffer-same-window (list-buffers-noselect nil))
(delete-other-windows)
(setq buffer-read-only nil)
(goto-char (point-min))
;; OK, let's send. First we delete the buffer list.
(progn
(kill-buffer nil)
- (pop-to-buffer-same-window curbuf)
+ (tramp-compat-pop-to-buffer-same-window curbuf)
(goto-char (point-max))
(insert "\n\
This is a special notion of the `gnus/message' package. If you
;;; 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:
(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)
(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'."
"`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: