emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117568: * net/tramp-cache.el (tramp-flush-file-func


From: Michael Albinus
Subject: [Emacs-diffs] trunk r117568: * net/tramp-cache.el (tramp-flush-file-function): Wrap the code
Date: Thu, 24 Jul 2014 07:31:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117568
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/18095
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Thu 2014-07-24 09:30:36 +0200
message:
  * net/tramp-cache.el (tramp-flush-file-function): Wrap the code
  with `save-match-data'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/net/tramp-cache.el        
trampcache.el-20091113204419-o5vbwnq5f7feedwu-5065
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-07-21 17:53:38 +0000
+++ b/lisp/ChangeLog    2014-07-24 07:30:36 +0000
@@ -1,3 +1,8 @@
+2014-07-24  Michael Albinus  <address@hidden>
+
+       * net/tramp-cache.el (tramp-flush-file-function): Wrap the code
+       with `save-match-data'.  (Bug#18095)
+
 2014-07-21  Vincent Belaïche  <address@hidden>
 
        * ses.el (ses-truncate-cell): Use cl-progv instead of eval in

=== modified file 'lisp/net/tramp-cache.el'
--- a/lisp/net/tramp-cache.el   2014-06-15 15:47:35 +0000
+++ b/lisp/net/tramp-cache.el   2014-07-24 07:30:36 +0000
@@ -201,17 +201,19 @@
 ;; Reverting or killing a buffer should also flush file properties.
 ;; They could have been changed outside Tramp.  In eshell, "ls" would
 ;; not show proper directory contents when a file has been copied or
-;; deleted before.
+;; deleted before.  We must apply `save-match-data', because it would
+;; corrupt other packages otherwise (reported from org).
 (defun tramp-flush-file-function ()
   "Flush all Tramp cache properties from `buffer-file-name'.
 This is suppressed for temporary buffers."
-  (unless (string-match "^ \\*temp\\*" (or (buffer-name) ""))
-    (let ((bfn (if (stringp (buffer-file-name))
-                  (buffer-file-name)
-                default-directory)))
-      (when (tramp-tramp-file-p bfn)
-       (with-parsed-tramp-file-name bfn nil
-         (tramp-flush-file-property v localname))))))
+  (save-match-data
+    (unless (string-match "^ \\*temp\\*" (or (buffer-name) ""))
+      (let ((bfn (if (stringp (buffer-file-name))
+                    (buffer-file-name)
+                  default-directory)))
+       (when (tramp-tramp-file-p bfn)
+         (with-parsed-tramp-file-name bfn nil
+           (tramp-flush-file-property v localname)))))))
 
 (add-hook 'before-revert-hook 'tramp-flush-file-function)
 (add-hook 'eshell-pre-command-hook 'tramp-flush-file-function)


reply via email to

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