]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #17986 with infloop in redisplay when default-directory is nil.
authorEli Zaretskii <eliz@gnu.org>
Sun, 13 Jul 2014 14:49:59 +0000 (17:49 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 13 Jul 2014 14:49:59 +0000 (17:49 +0300)
 src/xdisp.c (decode_mode_spec): Call file-remote-p on the current
 buffer's default-directory only if it is a string.

 lisp/bindings.el (mode-line-remote): If default-directory is not a
 string, don't call file-remote-p on it; instead state in the
 help-echo that it is nil.

lisp/ChangeLog
lisp/bindings.el
src/ChangeLog
src/xdisp.c

index e77058569d2b4e3331f3eca9bea56de2261db222..5f4c02c0670951282f0044456ba554e7b7d8d5de 100644 (file)
@@ -1,3 +1,9 @@
+2014-07-13  Eli Zaretskii  <eliz@gnu.org>
+
+       * bindings.el (mode-line-remote): If default-directory is not a
+       string, don't call file-remote-p on it; instead state in the
+       help-echo that it is nil.  (Bug#17986)
+
 2014-07-12  Paul Eggert  <eggert@cs.ucla.edu>
 
        Fix bug: C-x v v discarded existing log message (Bug#17884).
index 59aa3dfb3d3c9cf1e825607759769608d51e8cb6..911ab63e8d05fa45b0c2fd276173619dfa4d0b4f 100644 (file)
@@ -229,11 +229,13 @@ mnemonics of the following coding systems:
         'help-echo (purecopy (lambda (window _object _point)
                                (format "%s"
                                        (with-selected-window window
-                                         (concat
-                                          (if (file-remote-p default-directory)
-                                              "Current directory is remote: "
-                                            "Current directory is local: ")
-                                          default-directory)))))))
+                                         (if (stringp default-directory)
+                                             (concat
+                                              (if (file-remote-p default-directory)
+                                                  "Current directory is remote: "
+                                                "Current directory is local: ")
+                                              default-directory)
+                                           "Current directory is nil")))))))
   "Mode line construct to indicate a remote buffer.")
 ;;;###autoload
 (put 'mode-line-remote 'risky-local-variable t)
index 9051d37fcefa66e8a2f087c16ec6e07c99e6ed64..ca31b10fb6ade4bd4814faf357253d73c19950e0 100644 (file)
@@ -1,3 +1,8 @@
+2014-07-13  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (decode_mode_spec): Call file-remote-p on the current
+       buffer's default-directory only if it is a string.  (Bug#17986)
+
 2014-07-12  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (display_line): Don't call FETCH_BYTE with argument less
index 6918c4360d41481d9eddcd0806e0fa0a6aa79008..2f0683294faf091b2a356b60e5052428c3f3686b 100644 (file)
@@ -22907,8 +22907,12 @@ decode_mode_spec (struct window *w, register int c, int field_width,
     case '@':
       {
        ptrdiff_t count = inhibit_garbage_collection ();
-       Lisp_Object val = call1 (intern ("file-remote-p"),
-                                BVAR (current_buffer, directory));
+       Lisp_Object curdir = BVAR (current_buffer, directory);
+       Lisp_Object val = Qnil;
+
+       if (STRINGP (curdir))
+         val = call1 (intern ("file-remote-p"), curdir);
+
        unbind_to (count, Qnil);
 
        if (NILP (val))