emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111573: Improve XEmacs compatibility


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111573: Improve XEmacs compatibility.
Date: Mon, 21 Jan 2013 10:49:43 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111573
committer: Michael Albinus <address@hidden
branch nick: trunk
timestamp: Mon 2013-01-21 10:49:43 +0100
message:
  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'.
modified:
  lisp/ChangeLog
  lisp/net/tramp-adb.el
  lisp/net/tramp-sh.el
  lisp/net/tramp-smb.el
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-01-21 09:40:51 +0000
+++ b/lisp/ChangeLog    2013-01-21 09:49:43 +0000
@@ -1,3 +1,22 @@
+2013-01-21  Michael Albinus  <address@hidden>
+
+       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'.
+
 2013-01-21  Jürgen Hötzel  <address@hidden>
 
        * net/tramp-adb.el (tramp-adb-handle-start-file-process): Complete

=== modified file 'lisp/net/tramp-adb.el'
--- a/lisp/net/tramp-adb.el     2013-01-21 09:40:51 +0000
+++ b/lisp/net/tramp-adb.el     2013-01-21 09:49:43 +0000
@@ -33,6 +33,7 @@
 ;;; Code:
 
 (require 'tramp)
+(require 'time-date)
 
 (defvar dired-move-to-filename-regexp)
 
@@ -465,7 +466,7 @@
     (setq time-a (apply 'encode-time (parse-time-string (match-string 0 a))))
     (string-match tramp-adb-ls-date-regexp b)
     (setq time-b (apply 'encode-time (parse-time-string (match-string 0 b))))
-    (time-less-p time-b time-a)))
+    (tramp-time-less-p time-b time-a)))
 
 (defun tramp-adb-ls-output-name-less-p (a b)
   "Sort \"ls\" output by name, ascending."
@@ -638,7 +639,7 @@
        newname (expand-file-name newname))
 
   (if (file-directory-p filename)
-      (copy-directory filename newname keep-date t)
+      (tramp-file-name-handler 'copy-directory filename newname keep-date t)
     (with-tramp-progress-reporter
        (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
        0 (format "Copying %s to %s" filename newname)
@@ -698,7 +699,10 @@
            (tramp-flush-file-property v localname)
            ;; Short track.
            (tramp-adb-barf-unless-okay
-            v (format "mv %s %s" (file-remote-p filename 'localname) localname)
+            v (format
+               "mv %s %s"
+               (tramp-file-name-handler 'file-remote-p filename 'localname)
+               localname)
             "Error renaming %s to %s" filename newname))
 
        ;; Rename by copy.
@@ -1071,7 +1075,7 @@
            (tramp-adb-wait-for-output p)
            (unless (eq 'run (process-status p))
              (tramp-error  vec 'file-error "Terminated!"))
-           (set-process-query-on-exit-flag p nil)
+           (tramp-compat-set-process-query-on-exit-flag p nil)
 
            ;; Check whether the properties have been changed.  If
            ;; yes, this is a strong indication that we must expire all

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2013-01-07 09:25:34 +0000
+++ b/lisp/net/tramp-sh.el      2013-01-21 09:49:43 +0000
@@ -1555,7 +1555,8 @@
          (goto-char (point-max))
          (delete-blank-lines)
          (when (> (point-max) (point-min))
-           (substring-no-properties (buffer-string))))))))
+           (tramp-compat-funcall
+            'substring-no-properties (buffer-string))))))))
 
 (defun tramp-sh-handle-set-file-acl (filename acl-string)
   "Like `set-file-acl' for Tramp files."

=== modified file 'lisp/net/tramp-smb.el'
--- a/lisp/net/tramp-smb.el     2013-01-02 16:13:04 +0000
+++ b/lisp/net/tramp-smb.el     2013-01-21 09:49:43 +0000
@@ -649,13 +649,14 @@
             v (format "getfacl \"%s\"" (tramp-smb-get-localname v)))
        (with-current-buffer (tramp-get-connection-buffer v)
          (goto-char (point-min))
-         (while (looking-at-p "^#")
+         (while (looking-at "^#")
            (forward-line)
            (delete-region (point-min) (point)))
          (goto-char (point-max))
          (delete-blank-lines)
          (when (> (point-max) (point-min))
-           (substring-no-properties (buffer-string))))))))
+           (tramp-compat-funcall
+            'substring-no-properties (buffer-string))))))))
 
 (defun tramp-smb-handle-file-attributes (filename &optional id-format)
   "Like `file-attributes' for Tramp files."

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2013-01-09 09:49:27 +0000
+++ b/lisp/net/tramp.el 2013-01-21 09:49:43 +0000
@@ -1779,28 +1779,23 @@
   (or (file-modes filename)
       (logand (default-file-modes) (tramp-compat-octal-to-decimal "0666"))))
 
-(defalias 'tramp-replace-environment-variables
-  (if (ignore-errors
-        (equal "${ tramp?}"
-              (tramp-compat-funcall
-               'substitute-env-vars "${ tramp?}" 'only-defined)))
-      (lambda (filename)
-        "Like `substitute-env-vars' with `only-defined' non-nil."
-        (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
-    (lambda (filename)
-      "Replace environment variables in FILENAME.
+(defun tramp-replace-environment-variables (filename)
+ "Replace environment variables in FILENAME.
 Return the string with the replaced variables."
-      (save-match-data
-        (let ((idx (string-match "$\\(\\w+\\)" filename)))
-          ;; `$' is coded as `$$'.
-          (when (and idx
-                     (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
-                     (getenv (match-string 1 filename)))
-            (setq filename
-                  (replace-match
-                   (substitute-in-file-name (match-string 0 filename))
-                   t nil filename)))
-          filename)))))
+ (or (ignore-errors
+       (tramp-compat-funcall 'substitute-env-vars filename 'only-defined))
+     ;; We need an own implementation.
+     (save-match-data
+       (let ((idx (string-match "$\\(\\w+\\)" filename)))
+        ;; `$' is coded as `$$'.
+        (when (and idx
+                   (or (zerop idx) (not (eq ?$ (aref filename (1- idx)))))
+                   (getenv (match-string 1 filename)))
+          (setq filename
+                (replace-match
+                 (substitute-in-file-name (match-string 0 filename))
+                 t nil filename)))
+        filename))))
 
 ;; In XEmacs, electricity is implemented via a key map for ?/ and ?~,
 ;; which calls corresponding functions (see minibuf.el).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]