aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2013-01-21 10:49:43 +0100
committerMichael Albinus2013-01-21 10:49:43 +0100
commita36e2d260d235ab0a6b2f0c6f393b65b41eb8a93 (patch)
tree4f5c78e9cb825a6a7398c2f4f13ab0ace9188ee4 /lisp
parent88c7dfa37000245fa2fdb6cf6fc6b425dd7c7ee3 (diff)
downloademacs-a36e2d260d235ab0a6b2f0c6f393b65b41eb8a93.tar.gz
emacs-a36e2d260d235ab0a6b2f0c6f393b65b41eb8a93.zip
Improve XEmacs compatibility.
* net/tramp.el (tramp-replace-environment-variables): Make it a defun. * net/tramp-adb.el (top): Require `time-date'. (tramp-adb-ls-output-time-less-p): Use `tramp-time-less-p'. (tramp-adb-handle-copy-file, tramp-adb-handle-rename-file): Use `tramp-file-name-handler'. (tramp-adb-maybe-open-connection): Use `tramp-compat-set-process-query-on-exit-flag'. * net/tramp-sh.el (tramp-sh-handle-file-acl): Use `tramp-compat-funcall'. * net/tramp-smb.el (tramp-smb-handle-file-acl): Use `looking-at' and `tramp-compat-funcall'.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog19
-rw-r--r--lisp/net/tramp-adb.el12
-rw-r--r--lisp/net/tramp-sh.el3
-rw-r--r--lisp/net/tramp-smb.el5
-rw-r--r--lisp/net/tramp.el37
5 files changed, 48 insertions, 28 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3700121e5fe..0337982f044 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,22 @@
12013-01-21 Michael Albinus <michael.albinus@gmx.de>
2
3 Improve XEmacs compatibility.
4
5 * net/tramp.el (tramp-replace-environment-variables): Make it a defun.
6
7 * net/tramp-adb.el (top): Require `time-date'.
8 (tramp-adb-ls-output-time-less-p): Use `tramp-time-less-p'.
9 (tramp-adb-handle-copy-file, tramp-adb-handle-rename-file): Use
10 `tramp-file-name-handler'.
11 (tramp-adb-maybe-open-connection): Use
12 `tramp-compat-set-process-query-on-exit-flag'.
13
14 * net/tramp-sh.el (tramp-sh-handle-file-acl): Use
15 `tramp-compat-funcall'.
16
17 * net/tramp-smb.el (tramp-smb-handle-file-acl): Use `looking-at' and
18 `tramp-compat-funcall'.
19
12013-01-21 Jürgen Hötzel <juergen@archlinux.org> 202013-01-21 Jürgen Hötzel <juergen@archlinux.org>
2 21
3 * net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete 22 * net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 6b8d16afc80..17802d39fa4 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -33,6 +33,7 @@
33;;; Code: 33;;; Code:
34 34
35(require 'tramp) 35(require 'tramp)
36(require 'time-date)
36 37
37(defvar dired-move-to-filename-regexp) 38(defvar dired-move-to-filename-regexp)
38 39
@@ -465,7 +466,7 @@ Emacs dired can't find files."
465 (setq time-a (apply 'encode-time (parse-time-string (match-string 0 a)))) 466 (setq time-a (apply 'encode-time (parse-time-string (match-string 0 a))))
466 (string-match tramp-adb-ls-date-regexp b) 467 (string-match tramp-adb-ls-date-regexp b)
467 (setq time-b (apply 'encode-time (parse-time-string (match-string 0 b)))) 468 (setq time-b (apply 'encode-time (parse-time-string (match-string 0 b))))
468 (time-less-p time-b time-a))) 469 (tramp-time-less-p time-b time-a)))
469 470
470(defun tramp-adb-ls-output-name-less-p (a b) 471(defun tramp-adb-ls-output-name-less-p (a b)
471 "Sort \"ls\" output by name, ascending." 472 "Sort \"ls\" output by name, ascending."
@@ -638,7 +639,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
638 newname (expand-file-name newname)) 639 newname (expand-file-name newname))
639 640
640 (if (file-directory-p filename) 641 (if (file-directory-p filename)
641 (copy-directory filename newname keep-date t) 642 (tramp-file-name-handler 'copy-directory filename newname keep-date t)
642 (with-tramp-progress-reporter 643 (with-tramp-progress-reporter
643 (tramp-dissect-file-name (if (file-remote-p filename) filename newname)) 644 (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
644 0 (format "Copying %s to %s" filename newname) 645 0 (format "Copying %s to %s" filename newname)
@@ -698,7 +699,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
698 (tramp-flush-file-property v localname) 699 (tramp-flush-file-property v localname)
699 ;; Short track. 700 ;; Short track.
700 (tramp-adb-barf-unless-okay 701 (tramp-adb-barf-unless-okay
701 v (format "mv %s %s" (file-remote-p filename 'localname) localname) 702 v (format
703 "mv %s %s"
704 (tramp-file-name-handler 'file-remote-p filename 'localname)
705 localname)
702 "Error renaming %s to %s" filename newname)) 706 "Error renaming %s to %s" filename newname))
703 707
704 ;; Rename by copy. 708 ;; Rename by copy.
@@ -1071,7 +1075,7 @@ connection if a previous connection has died for some reason."
1071 (tramp-adb-wait-for-output p) 1075 (tramp-adb-wait-for-output p)
1072 (unless (eq 'run (process-status p)) 1076 (unless (eq 'run (process-status p))
1073 (tramp-error vec 'file-error "Terminated!")) 1077 (tramp-error vec 'file-error "Terminated!"))
1074 (set-process-query-on-exit-flag p nil) 1078 (tramp-compat-set-process-query-on-exit-flag p nil)
1075 1079
1076 ;; Check whether the properties have been changed. If 1080 ;; Check whether the properties have been changed. If
1077 ;; yes, this is a strong indication that we must expire all 1081 ;; yes, this is a strong indication that we must expire all
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index d83599a6662..743c8dbe0f9 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1555,7 +1555,8 @@ be non-negative integers."
1555 (goto-char (point-max)) 1555 (goto-char (point-max))
1556 (delete-blank-lines) 1556 (delete-blank-lines)
1557 (when (> (point-max) (point-min)) 1557 (when (> (point-max) (point-min))
1558 (substring-no-properties (buffer-string)))))))) 1558 (tramp-compat-funcall
1559 'substring-no-properties (buffer-string))))))))
1559 1560
1560(defun tramp-sh-handle-set-file-acl (filename acl-string) 1561(defun tramp-sh-handle-set-file-acl (filename acl-string)
1561 "Like `set-file-acl' for Tramp files." 1562 "Like `set-file-acl' for Tramp files."
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 0f143100906..65c52ae4f3c 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -649,13 +649,14 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
649 v (format "getfacl \"%s\"" (tramp-smb-get-localname v))) 649 v (format "getfacl \"%s\"" (tramp-smb-get-localname v)))
650 (with-current-buffer (tramp-get-connection-buffer v) 650 (with-current-buffer (tramp-get-connection-buffer v)
651 (goto-char (point-min)) 651 (goto-char (point-min))
652 (while (looking-at-p "^#") 652 (while (looking-at "^#")
653 (forward-line) 653 (forward-line)
654 (delete-region (point-min) (point))) 654 (delete-region (point-min) (point)))
655 (goto-char (point-max)) 655 (goto-char (point-max))
656 (delete-blank-lines) 656 (delete-blank-lines)
657 (when (> (point-max) (point-min)) 657 (when (> (point-max) (point-min))
658 (substring-no-properties (buffer-string)))))))) 658 (tramp-compat-funcall
659 'substring-no-properties (buffer-string))))))))
659 660
660(defun tramp-smb-handle-file-attributes (filename &optional id-format) 661(defun tramp-smb-handle-file-attributes (filename &optional id-format)
661 "Like `file-attributes' for Tramp files." 662 "Like `file-attributes' for Tramp files."
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 2c4aac0ac8a..69e82de3f7f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1779,28 +1779,23 @@ value of `default-file-modes', without execute permissions."
1779 (or (file-modes filename) 1779 (or (file-modes filename)
1780 (logand (default-file-modes) (tramp-compat-octal-to-decimal "0666")))) 1780 (logand (default-file-modes) (tramp-compat-octal-to-decimal "0666"))))
1781 1781
1782(defalias 'tramp-replace-environment-variables 1782(defun tramp-replace-environment-variables (filename)
1783 (if (ignore-errors 1783 "Replace environment variables in FILENAME.
1784 (equal "${ tramp?}"
1785 (tramp-compat-funcall
1786 'substitute-env-vars "${ tramp?}" 'only-defined)))
1787 (lambda (filename)
1788 "Like `substitute-env-vars' with `only-defined' non-nil."
1789 (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
1790 (lambda (filename)
1791 "Replace environment variables in FILENAME.
1792Return the string with the replaced variables." 1784Return the string with the replaced variables."
1793 (save-match-data 1785 (or (ignore-errors
1794 (let ((idx (string-match "$\\(\\w+\\)" filename))) 1786 (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
1795 ;; `$' is coded as `$$'. 1787 ;; We need an own implementation.
1796 (when (and idx 1788 (save-match-data
1797 (or (zerop idx) (not (eq ?$ (aref filename (1- idx))))) 1789 (let ((idx (string-match "$\\(\\w+\\)" filename)))
1798 (getenv (match-string 1 filename))) 1790 ;; `$' is coded as `$$'.
1799 (setq filename 1791 (when (and idx
1800 (replace-match 1792 (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
1801 (substitute-in-file-name (match-string 0 filename)) 1793 (getenv (match-string 1 filename)))
1802 t nil filename))) 1794 (setq filename
1803 filename))))) 1795 (replace-match
1796 (substitute-in-file-name (match-string 0 filename))
1797 t nil filename)))
1798 filename))))
1804 1799
1805;; In XEmacs, electricity is implemented via a key map for ?/ and ?~, 1800;; In XEmacs, electricity is implemented via a key map for ?/ and ?~,
1806;; which calls corresponding functions (see minibuf.el). 1801;; which calls corresponding functions (see minibuf.el).