emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113306: * net/tramp-sh.el (tramp-sh-file-gvfs-monit


From: Michael Albinus
Subject: [Emacs-diffs] trunk r113306: * net/tramp-sh.el (tramp-sh-file-gvfs-monitor-dir-process-filter):
Date: Sat, 06 Jul 2013 16:17:45 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113306
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sat 2013-07-06 18:17:16 +0200
message:
  * net/tramp-sh.el (tramp-sh-file-gvfs-monitor-dir-process-filter):
  (tramp-sh-file-inotifywait-process-filter): Handle file names with spaces.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-07-06 14:24:54 +0000
+++ b/lisp/ChangeLog    2013-07-06 16:17:16 +0000
@@ -1,3 +1,9 @@
+2013-07-06  Michael Albinus  <address@hidden>
+
+       * net/tramp-sh.el (tramp-sh-file-gvfs-monitor-dir-process-filter):
+       (tramp-sh-file-inotifywait-process-filter): Handle file names with
+       spaces.
+
 2013-07-06  Martin Rudalics  <address@hidden>
 
        * window.el (window-state-put-stale-windows): New variable.

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2013-07-05 15:17:16 +0000
+++ b/lisp/net/tramp-sh.el      2013-07-06 16:17:16 +0000
@@ -3421,17 +3421,22 @@
   (let ((remote-prefix
         (with-current-buffer (process-buffer proc)
           (file-remote-p default-directory)))
-       (previous-string (tramp-compat-process-get proc 'previous-string)))
-    (when previous-string
-      (tramp-message proc 10 (format "Previous string:\n%s" previous-string)))
+       (rest-string (tramp-compat-process-get proc 'rest-string)))
+    (when rest-string
+      (tramp-message proc 10 (format "Previous string:\n%s" rest-string)))
     (tramp-message proc 6 (format "%S\n%s" proc string))
-    (setq string (concat previous-string string)
+    (setq string (concat rest-string string)
          ;; Attribute change is returned in unused wording.
          string (replace-regexp-in-string
                  "ATTRIB CHANGED" "ATTRIBUTE_CHANGED" string))
 
     (while (string-match
-           "^Directory Monitor Event:[\n\r]+Child = 
\\([^[:blank:]]+\\)[\n\r]+\\(Other = \\([^[:blank:]]+\\)[\n\r]+\\)?Event = 
\\([^[:blank:]]+\\)[\n\r]+$" string)
+           (concat "^[\n\r]*"
+                   "Directory Monitor Event:[\n\r]+"
+                   "Child = \\([^\n\r]+\\)[\n\r]+"
+                   "\\(Other = \\([^\n\r]+\\)[\n\r]+\\)?"
+                   "Event = \\([^[:blank:]]+\\)[\n\r]+")
+           string)
       (let ((object
             (list
              proc
@@ -3443,15 +3448,16 @@
              (concat remote-prefix (match-string 1 string))
              (when (match-string 3 string)
                (concat remote-prefix (match-string 3 string))))))
+       (setq string (replace-match "" nil nil string))
        ;; Usually, we would add an Emacs event now.  Unfortunately,
        ;; `unread-command-events' does not accept several events at
        ;; once.  Therefore, we apply the callback directly.
-       (tramp-compat-funcall 'file-notify-callback object)
-       (setq string (replace-match "" nil nil string)))))
+       (tramp-compat-funcall 'file-notify-callback object)))
 
-  ;; Save rest of the string.
-  (when string (tramp-message proc 10 (format "Rest string:\n%s" string)))
-  (tramp-compat-process-put proc 'previous-string string))
+    ;; Save rest of the string.
+    (when (zerop (length string)) (setq string nil))
+    (when string (tramp-message proc 10 (format "Rest string:\n%s" string)))
+    (tramp-compat-process-put proc 'rest-string string)))
 
 (defun tramp-sh-file-inotifywait-process-filter (proc string)
   "Read output from \"inotifywait\" and add corresponding file-notify events."
@@ -3460,7 +3466,10 @@
     ;; Check, whether there is a problem.
     (unless
        (string-match
-        
"^[^[:blank:]]+[[:blank:]]+\\([^[:blank:]]+\\)+\\([[:blank:]]+\\([^[:blank:]]+\\)\\)?[[:blank:]]*$"
 line)
+        (concat "^[^[:blank:]]+"
+                "[[:blank:]]+\\([^[:blank:]]+\\)+"
+                "\\([[:blank:]]+\\([^\n\r]+\\)\\)?")
+        line)
       (tramp-error proc 'file-notify-error "%s" line))
 
     (let ((object


reply via email to

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