aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-05-06 10:40:06 +0200
committerMichael Albinus2010-05-06 10:40:06 +0200
commit9566840faf0378750569f1228ead9488bc1bf64d (patch)
treee2f7d427f87e9dc19cefad0762075a18e340dc0c
parent380884c6f03d40278f28944e449424e50f596ff1 (diff)
downloademacs-9566840faf0378750569f1228ead9488bc1bf64d.tar.gz
emacs-9566840faf0378750569f1228ead9488bc1bf64d.zip
* 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'.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/net/tramp-compat.el25
-rw-r--r--lisp/net/tramp-gvfs.el5
-rw-r--r--lisp/net/tramp.el5
4 files changed, 35 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 97a0f8c5b41..5c7db67dfc3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12010-05-06 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (top, with-progress-reporter): Use
4 `symbol-function' inside `funcall'.
5
6 * net/tramp-compat.el (tramp-compat-file-attributes)
7 (tramp-compat-delete-file, tramp-compat-delete-directory): Handle
8 only `wrong-number-of-arguments' error.
9
10 * net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Fix typo.
11 (tramp-gvfs-handle-file-selinux-context): Use `symbol-function'
12 inside `funcall'.
13
12010-05-06 Stefan Monnier <monnier@iro.umontreal.ca> 142010-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
2 15
3 * minibuffer.el (completion--sreverse, completion--common-suffix): 16 * minibuffer.el (completion--sreverse, completion--common-suffix):
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index fe4b3d4146a..27a308d8572 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -262,7 +262,7 @@ Add the extension of FILENAME, if existing."
262 (tramp-file-name-handler 'file-attributes filename id-format)) 262 (tramp-file-name-handler 'file-attributes filename id-format))
263 (t (condition-case nil 263 (t (condition-case nil
264 (funcall (symbol-function 'file-attributes) filename id-format) 264 (funcall (symbol-function 'file-attributes) filename id-format)
265 (error (file-attributes filename)))))) 265 (wrong-number-of-arguments (file-attributes filename))))))
266 266
267;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not 267;; PRESERVE-UID-GID has been introduced with Emacs 23. It does not
268;; hurt to ignore it for other (X)Emacs versions. 268;; hurt to ignore it for other (X)Emacs versions.
@@ -320,13 +320,20 @@ Add the extension of FILENAME, if existing."
320;; FORCE has been introduced with Emacs 24.1. 320;; FORCE has been introduced with Emacs 24.1.
321(defun tramp-compat-delete-file (filename &optional force) 321(defun tramp-compat-delete-file (filename &optional force)
322 "Like `delete-file' for Tramp files (compat function)." 322 "Like `delete-file' for Tramp files (compat function)."
323 (condition-case nil 323 (if (null force)
324 (funcall (symbol-function 'delete-file) filename force) 324 (delete-file filename)
325 ;; This Emacs version does not support the FORCE flag. Setting 325 (condition-case nil
326 ;; `delete-by-moving-to-trash' shall give us the same effect. 326 (funcall (symbol-function 'delete-file) filename force)
327 (error 327 ;; This Emacs version does not support the FORCE flag. Setting
328 (let ((delete-by-moving-to-trash (null force))) 328 ;; `delete-by-moving-to-trash' shall give us the same effect.
329 (delete-file filename))))) 329 (wrong-number-of-arguments
330 (let ((delete-by-moving-to-trash
331 (cond
332 ((null force) t)
333 ((boundp 'delete-by-moving-to-trash)
334 (symbol-value 'delete-by-moving-to-trash))
335 (t nil))))
336 (delete-file filename))))))
330 337
331;; RECURSIVE has been introduced with Emacs 23.2. 338;; RECURSIVE has been introduced with Emacs 23.2.
332(defun tramp-compat-delete-directory (directory &optional recursive) 339(defun tramp-compat-delete-directory (directory &optional recursive)
@@ -337,7 +344,7 @@ Add the extension of FILENAME, if existing."
337 (funcall (symbol-function 'delete-directory) directory recursive) 344 (funcall (symbol-function 'delete-directory) directory recursive)
338 ;; This Emacs version does not support the RECURSIVE flag. We 345 ;; This Emacs version does not support the RECURSIVE flag. We
339 ;; use the implementation from Emacs 23.2. 346 ;; use the implementation from Emacs 23.2.
340 (error 347 (wrong-number-of-arguments
341 (setq directory (directory-file-name (expand-file-name directory))) 348 (setq directory (directory-file-name (expand-file-name directory)))
342 (if (not (file-symlink-p directory)) 349 (if (not (file-symlink-p directory))
343 (mapc (lambda (file) 350 (mapc (lambda (file)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 569fca3fe31..f045589a27c 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -525,7 +525,7 @@ is no information where to trace the message.")
525 newname) 525 newname)
526 ok-if-already-exists keep-date preserve-uid-gid))) 526 ok-if-already-exists keep-date preserve-uid-gid)))
527 (when preserve-selinux-context 527 (when preserve-selinux-context
528 (setq args (append args (list preserve-uid-gid)))) 528 (setq args (append args (list preserve-selinux-context))))
529 (apply 'copy-file args))) 529 (apply 'copy-file args)))
530 530
531(defun tramp-gvfs-handle-delete-directory (directory &optional recursive) 531(defun tramp-gvfs-handle-delete-directory (directory &optional recursive)
@@ -629,7 +629,8 @@ is no information where to trace the message.")
629 629
630(defun tramp-gvfs-handle-file-selinux-context (filename) 630(defun tramp-gvfs-handle-file-selinux-context (filename)
631 "Like `file-selinux-context' for Tramp files." 631 "Like `file-selinux-context' for Tramp files."
632 (funcall 'file-selinux-context (tramp-gvfs-fuse-file-name filename))) 632 (funcall (symbol-function 'file-selinux-context)
633 (tramp-gvfs-fuse-file-name filename)))
633 634
634(defun tramp-gvfs-handle-file-writable-p (filename) 635(defun tramp-gvfs-handle-file-writable-p (filename)
635 "Like `file-writable-p' for Tramp files." 636 "Like `file-writable-p' for Tramp files."
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 26ef72c6ffc..7f0c2f2d783 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -145,7 +145,8 @@
145 ;; this would load dbus.el. 145 ;; this would load dbus.el.
146 (when (and (featurep 'dbusbind) 146 (when (and (featurep 'dbusbind)
147 (condition-case nil 147 (condition-case nil
148 (funcall 'dbus-get-unique-name :session) 148 (funcall (symbol-function 'dbus-get-unique-name)
149 :session)
149 (error nil)) 150 (error nil))
150 (tramp-compat-process-running-p "gvfs-fuse-daemon")) 151 (tramp-compat-process-running-p "gvfs-fuse-daemon"))
151 'tramp-gvfs) 152 'tramp-gvfs)
@@ -2273,7 +2274,7 @@ FILE must be a local file name on a connection identified via VEC."
2273 ;; introduced in Emacs 24.1. 2274 ;; introduced in Emacs 24.1.
2274 (when (<= ,level tramp-verbose) 2275 (when (<= ,level tramp-verbose)
2275 (condition-case nil 2276 (condition-case nil
2276 (setq pr (funcall 'make-progress-reporter ,message) 2277 (setq pr (funcall (symbol-function 'make-progress-reporter) ,message)
2277 tm (run-at-time 3 0.1 'progress-reporter-update pr)) 2278 tm (run-at-time 3 0.1 'progress-reporter-update pr))
2278 (error nil))) 2279 (error nil)))
2279 (unwind-protect 2280 (unwind-protect