emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100165: * net/tramp.el (top, with-pr


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100165: * net/tramp.el (top, with-progress-reporter): Use
Date: Thu, 06 May 2010 10:40:06 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100165
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Thu 2010-05-06 10:40:06 +0200
message:
  * net/tramp.el (top, with-progress-reporter): Use
  `symbol-function' inside `funcall'.
  
  * net/tramp-compat.el (tramp-compat-file-attributes)
  (tramp-compat-delete-file, tramp-compat-delete-directory): Handle
  only `wrong-number-of-arguments' error.
  
  * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Fix typo.
  (tramp-gvfs-handle-file-selinux-context): Use `symbol-function'
  inside `funcall'.
modified:
  lisp/ChangeLog
  lisp/net/tramp-compat.el
  lisp/net/tramp-gvfs.el
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-05-06 02:59:07 +0000
+++ b/lisp/ChangeLog    2010-05-06 08:40:06 +0000
@@ -1,3 +1,16 @@
+2010-05-06  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (top, with-progress-reporter): Use
+       `symbol-function' inside `funcall'.
+
+       * net/tramp-compat.el (tramp-compat-file-attributes)
+       (tramp-compat-delete-file, tramp-compat-delete-directory): Handle
+       only `wrong-number-of-arguments' error.
+
+       * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Fix typo.
+       (tramp-gvfs-handle-file-selinux-context): Use `symbol-function'
+       inside `funcall'.
+
 2010-05-06  Stefan Monnier  <address@hidden>
 
        * minibuffer.el (completion--sreverse, completion--common-suffix):

=== modified file 'lisp/net/tramp-compat.el'
--- a/lisp/net/tramp-compat.el  2010-05-05 10:20:23 +0000
+++ b/lisp/net/tramp-compat.el  2010-05-06 08:40:06 +0000
@@ -262,7 +262,7 @@
     (tramp-file-name-handler 'file-attributes filename id-format))
    (t (condition-case nil
          (funcall (symbol-function 'file-attributes) filename id-format)
-       (error (file-attributes filename))))))
+       (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.
@@ -320,13 +320,20 @@
 ;; FORCE has been introduced with Emacs 24.1.
 (defun tramp-compat-delete-file (filename &optional force)
   "Like `delete-file' for Tramp files (compat function)."
-  (condition-case nil
-      (funcall (symbol-function 'delete-file) filename force)
-    ;; This Emacs version does not support the FORCE flag.  Setting
-    ;; `delete-by-moving-to-trash' shall give us the same effect.
-    (error
-     (let ((delete-by-moving-to-trash (null force)))
-       (delete-file filename)))))
+  (if (null force)
+      (delete-file filename)
+    (condition-case nil
+       (funcall (symbol-function 'delete-file) filename force)
+      ;; This Emacs version does not support the FORCE flag.  Setting
+      ;; `delete-by-moving-to-trash' shall give us the same effect.
+      (wrong-number-of-arguments
+       (let ((delete-by-moving-to-trash
+             (cond
+              ((null force) t)
+              ((boundp 'delete-by-moving-to-trash)
+               (symbol-value 'delete-by-moving-to-trash))
+              (t nil))))
+        (delete-file filename))))))
 
 ;; RECURSIVE has been introduced with Emacs 23.2.
 (defun tramp-compat-delete-directory (directory &optional recursive)
@@ -337,7 +344,7 @@
        (funcall (symbol-function 'delete-directory) directory recursive)
       ;; This Emacs version does not support the RECURSIVE flag.  We
       ;; use the implementation from Emacs 23.2.
-      (error
+      (wrong-number-of-arguments
        (setq directory (directory-file-name (expand-file-name directory)))
        (if (not (file-symlink-p directory))
           (mapc (lambda (file)

=== modified file 'lisp/net/tramp-gvfs.el'
--- a/lisp/net/tramp-gvfs.el    2010-05-05 10:20:23 +0000
+++ b/lisp/net/tramp-gvfs.el    2010-05-06 08:40:06 +0000
@@ -525,7 +525,7 @@
            newname)
          ok-if-already-exists keep-date preserve-uid-gid)))
     (when preserve-selinux-context
-      (setq args (append args (list preserve-uid-gid))))
+      (setq args (append args (list preserve-selinux-context))))
     (apply 'copy-file args)))
 
 (defun tramp-gvfs-handle-delete-directory (directory &optional recursive)
@@ -629,7 +629,8 @@
 
 (defun tramp-gvfs-handle-file-selinux-context (filename)
   "Like `file-selinux-context' for Tramp files."
-  (funcall 'file-selinux-context (tramp-gvfs-fuse-file-name filename)))
+  (funcall (symbol-function 'file-selinux-context)
+          (tramp-gvfs-fuse-file-name filename)))
 
 (defun tramp-gvfs-handle-file-writable-p (filename)
   "Like `file-writable-p' for Tramp files."

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2010-05-05 10:20:23 +0000
+++ b/lisp/net/tramp.el 2010-05-06 08:40:06 +0000
@@ -145,7 +145,8 @@
         ;; this would load dbus.el.
         (when (and (featurep 'dbusbind)
                    (condition-case nil
-                       (funcall 'dbus-get-unique-name :session)
+                       (funcall (symbol-function 'dbus-get-unique-name)
+                                :session)
                      (error nil))
                    (tramp-compat-process-running-p "gvfs-fuse-daemon"))
           'tramp-gvfs)
@@ -2273,7 +2274,7 @@
      ;; introduced in Emacs 24.1.
      (when (<= ,level tramp-verbose)
        (condition-case nil
-          (setq pr (funcall 'make-progress-reporter ,message)
+          (setq pr (funcall (symbol-function 'make-progress-reporter) ,message)
                 tm (run-at-time 3 0.1 'progress-reporter-update pr))
         (error nil)))
      (unwind-protect


reply via email to

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