emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104475: * lisp/net/tramp.el (tramp-w


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104475: * lisp/net/tramp.el (tramp-with-progress-reporter): Rename from
Date: Thu, 02 Jun 2011 00:48:23 -0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104475
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Thu 2011-06-02 00:48:23 -0300
message:
  * lisp/net/tramp.el (tramp-with-progress-reporter): Rename from
  with-progress-reporter.  Use `declare'.
  * lisp/net/tramp-smb.el:
  * lisp/net/tramp-sh.el:
  * lisp/net/tramp-gvfs.el: Update all uses.
modified:
  lisp/ChangeLog
  lisp/net/tramp-gvfs.el
  lisp/net/tramp-sh.el
  lisp/net/tramp-smb.el
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-02 00:09:42 +0000
+++ b/lisp/ChangeLog    2011-06-02 03:48:23 +0000
@@ -1,3 +1,11 @@
+2011-06-02  Stefan Monnier  <address@hidden>
+
+       * net/tramp.el (tramp-with-progress-reporter): Rename from
+       with-progress-reporter.  Use `declare'.
+       * net/tramp-smb.el:
+       * net/tramp-sh.el:
+       * net/tramp-gvfs.el: Update all uses.
+
 2011-06-02  Jay Belanger  <address@hidden>
 
        * calc/calc.el (calc-kill-stack-buffer): Make sure that the trail

=== modified file 'lisp/net/tramp-gvfs.el'
--- a/lisp/net/tramp-gvfs.el    2011-02-28 01:07:29 +0000
+++ b/lisp/net/tramp-gvfs.el    2011-06-02 03:48:23 +0000
@@ -541,7 +541,7 @@
   "Like `copy-file' for Tramp files."
   (with-parsed-tramp-file-name
       (if (tramp-tramp-file-p filename) filename newname) nil
-    (with-progress-reporter
+    (tramp-with-progress-reporter
        v 0 (format "Copying %s to %s" filename newname)
       (condition-case err
          (let ((args
@@ -745,7 +745,7 @@
   "Like `rename-file' for Tramp files."
   (with-parsed-tramp-file-name
       (if (tramp-tramp-file-p filename) filename newname) nil
-    (with-progress-reporter
+    (tramp-with-progress-reporter
        v 0 (format "Renaming %s to %s" filename newname)
       (condition-case err
          (rename-file
@@ -1203,7 +1203,7 @@
            (tramp-gvfs-object-path
             (tramp-make-tramp-file-name method user host ""))))
 
-      (with-progress-reporter
+      (tramp-with-progress-reporter
          vec 3
          (if (zerop (length user))
              (format "Opening connection for %s using %s" host method)

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2011-05-05 09:48:43 +0000
+++ b/lisp/net/tramp-sh.el      2011-06-02 03:48:23 +0000
@@ -1945,7 +1945,7 @@
        (tramp-error
         v 'file-already-exists "File %s already exists" newname))
 
-      (with-progress-reporter
+      (tramp-with-progress-reporter
          v 0 (format "%s %s to %s"
                      (if (eq op 'copy) "Copying" "Renaming")
                      filename newname)
@@ -2454,7 +2454,8 @@
               nil)
              ((and suffix (nth 2 suffix))
               ;; We found an uncompression rule.
-              (with-progress-reporter v 0 (format "Uncompressing %s" file)
+              (tramp-with-progress-reporter
+                   v 0 (format "Uncompressing %s" file)
                 (when (tramp-send-command-and-check
                        v (concat (nth 2 suffix) " "
                                  (tramp-shell-quote-argument localname)))
@@ -2465,7 +2466,7 @@
              (t
               ;; We don't recognize the file as compressed, so compress it.
               ;; Try gzip.
-              (with-progress-reporter v 0 (format "Compressing %s" file)
+              (tramp-with-progress-reporter v 0 (format "Compressing %s" file)
                 (when (tramp-send-command-and-check
                        v (concat "gzip -f "
                                  (tramp-shell-quote-argument localname)))
@@ -2948,7 +2949,7 @@
           ;; Use inline encoding for file transfer.
           (rem-enc
            (save-excursion
-             (with-progress-reporter
+             (tramp-with-progress-reporter
               v 3 (format "Encoding remote file %s" filename)
               (tramp-barf-unless-okay
                v (format rem-enc (tramp-shell-quote-argument localname))
@@ -2962,7 +2963,7 @@
                  (with-temp-buffer
                    (set-buffer-multibyte nil)
                    (insert-buffer-substring (tramp-get-buffer v))
-                   (with-progress-reporter
+                   (tramp-with-progress-reporter
                        v 3 (format "Decoding remote file %s with function %s"
                                    filename loc-dec)
                      (funcall loc-dec (point-min) (point-max))
@@ -2980,7 +2981,7 @@
                  (let (file-name-handler-alist
                        (coding-system-for-write 'binary))
                    (write-region (point-min) (point-max) tmpfile2))
-                 (with-progress-reporter
+                 (tramp-with-progress-reporter
                      v 3 (format "Decoding remote file %s with command %s"
                                  filename loc-dec)
                    (unwind-protect
@@ -3205,7 +3206,7 @@
                    (set-buffer-multibyte nil)
                    ;; Use encoding function or command.
                    (if (functionp loc-enc)
-                       (with-progress-reporter
+                       (tramp-with-progress-reporter
                            v 3 (format "Encoding region using function `%s'"
                                        loc-enc)
                          (let ((coding-system-for-read 'binary))
@@ -3223,7 +3224,7 @@
                                  (tramp-compat-temporary-file-directory)))
                            (funcall loc-enc (point-min) (point-max))))
 
-                     (with-progress-reporter
+                     (tramp-with-progress-reporter
                          v 3 (format "Encoding region using command `%s'"
                                      loc-enc)
                        (unless (zerop (tramp-call-local-coding-command
@@ -3237,7 +3238,7 @@
                    ;; Send buffer into remote decoding command which
                    ;; writes to remote file.  Because this happens on
                    ;; the remote host, we cannot use the function.
-                   (with-progress-reporter
+                   (tramp-with-progress-reporter
                        v 3
                        (format "Decoding region into remote file %s" filename)
                      (goto-char (point-max))
@@ -3337,7 +3338,7 @@
   "Like `vc-registered' for Tramp files."
   (tramp-compat-with-temp-message ""
     (with-parsed-tramp-file-name file nil
-      (with-progress-reporter
+      (tramp-with-progress-reporter
          v 3 (format "Checking `vc-registered' for %s" file)
 
        ;; There could be new files, created by the vc backend.  We
@@ -3431,7 +3432,7 @@
   (let* ((p (tramp-get-connection-process vec))
         (scripts (tramp-get-connection-property p "scripts" nil)))
     (unless (member name scripts)
-      (with-progress-reporter vec 5 (format "Sending script `%s'" name)
+      (tramp-with-progress-reporter vec 5 (format "Sending script `%s'" name)
        ;; The script could contain a call of Perl.  This is masked with `%s'.
        (tramp-barf-unless-okay
         vec
@@ -3595,7 +3596,8 @@
 
 (defun tramp-open-shell (vec shell)
   "Opens shell SHELL."
-  (with-progress-reporter vec 5 (format "Opening remote shell `%s'" shell)
+  (tramp-with-progress-reporter
+      vec 5 (format "Opening remote shell `%s'" shell)
     ;; Find arguments for this shell.
     (let ((tramp-end-of-output tramp-initial-end-of-output)
          (alist tramp-sh-extra-args)
@@ -4247,7 +4249,7 @@
        ;; We call `tramp-get-buffer' in order to get a debug buffer for
        ;; messages from the beginning.
        (tramp-get-buffer vec)
-       (with-progress-reporter
+       (tramp-with-progress-reporter
            vec 3
            (if (zerop (length (tramp-file-name-user vec)))
                (format "Opening connection for %s using %s"

=== modified file 'lisp/net/tramp-smb.el'
--- a/lisp/net/tramp-smb.el     2011-05-05 04:00:38 +0000
+++ b/lisp/net/tramp-smb.el     2011-06-02 03:48:23 +0000
@@ -342,7 +342,7 @@
 PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
   (setq filename (expand-file-name filename)
        newname (expand-file-name newname))
-  (with-progress-reporter
+  (tramp-with-progress-reporter
       (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
       0 (format "Copying %s to %s" filename newname)
 
@@ -600,7 +600,7 @@
        v 'file-error
        "Cannot make local copy of non-existing file `%s'" filename))
     (let ((tmpfile (tramp-compat-make-temp-file filename)))
-      (with-progress-reporter
+      (tramp-with-progress-reporter
          v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
        (unless (tramp-smb-send-command
                 v (format "get \"%s\" \"%s\""
@@ -837,7 +837,7 @@
   "Like `rename-file' for Tramp files."
   (setq filename (expand-file-name filename)
        newname (expand-file-name newname))
-  (with-progress-reporter
+  (tramp-with-progress-reporter
       (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
       0 (format "Renaming %s to %s" filename newname)
 
@@ -926,7 +926,7 @@
           (list start end tmpfile append 'no-message lockname confirm)
         (list start end tmpfile append 'no-message lockname)))
 
-      (with-progress-reporter
+      (tramp-with-progress-reporter
          v 3 (format "Moving tmp file %s to %s" tmpfile filename)
        (unwind-protect
            (unless (tramp-smb-send-command
@@ -1289,7 +1289,7 @@
            (setq args (append args (list "-s" tramp-smb-conf))))
 
          ;; OK, let's go.
-         (with-progress-reporter
+         (tramp-with-progress-reporter
              vec 3
              (format "Opening connection for //%s%s/%s"
                      (if (not (zerop (length user))) (concat user "@") "")

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2011-05-18 12:59:25 +0000
+++ b/lisp/net/tramp.el 2011-06-02 03:48:23 +0000
@@ -1452,11 +1452,12 @@
     (when (string-match message (or (current-message) ""))
       (tramp-compat-funcall 'progress-reporter-update reporter value))))
 
-(defmacro with-progress-reporter (vec level message &rest body)
+(defmacro tramp-with-progress-reporter (vec level message &rest body)
   "Executes BODY, spinning a progress reporter with MESSAGE.
 If LEVEL does not fit for visible messages, or if this is a
 nested call of the macro, there are only traces without a visible
 progress reporter."
+  (declare (indent 3) (debug t))
   `(let (pr tm)
      (tramp-message ,vec ,level "%s..." ,message)
      ;; We start a pulsing progress reporter after 3 seconds.  Feature
@@ -1479,10 +1480,8 @@
        (if tm (tramp-compat-funcall 'cancel-timer tm))
        (tramp-message ,vec ,level "%s...done" ,message))))
 
-(put 'with-progress-reporter 'lisp-indent-function 3)
-(put 'with-progress-reporter 'edebug-form-spec t)
 (tramp-compat-font-lock-add-keywords
- 'emacs-lisp-mode '("\\<with-progress-reporter\\>"))
+ 'emacs-lisp-mode '("\\<tramp-with-progress-reporter\\>"))
 
 (eval-and-compile                      ;; Silence compiler.
   (if (memq system-type '(cygwin windows-nt))
@@ -2881,7 +2880,7 @@
                ;; useful for "rsync".
                (setq tramp-temp-buffer-file-name local-copy))
 
-             (with-progress-reporter
+             (tramp-with-progress-reporter
                  v 3 (format "Inserting local temp file `%s'" local-copy)
                ;; We must ensure that `file-coding-system-alist'
                ;; matches `local-copy'.
@@ -2932,7 +2931,7 @@
     (if (not (file-exists-p file))
        nil
       (let ((tramp-message-show-message (not nomessage)))
-       (with-progress-reporter v 0 (format "Loading %s" file)
+       (tramp-with-progress-reporter v 0 (format "Loading %s" file)
          (let ((local-copy (file-local-copy file)))
            ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
            (unwind-protect


reply via email to

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