]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix initialization of minibuffer history variable, bug #17430.
authorJarek Czekalski <jarekczek@poczta.onet.pl>
Wed, 7 May 2014 15:03:47 +0000 (17:03 +0200)
committerJarek Czekalski <jarekczek@poczta.onet.pl>
Wed, 7 May 2014 15:03:47 +0000 (17:03 +0200)
* minibuf.c (read_minibuf): Initialize histval to Qnil if unbound.
Move the initialization up to prevent any "value void" message.

src/ChangeLog
src/minibuf.c

index c1d45f1df40250654513acf7f818c16b1b1c6c2d..027d0fc0d25e02541fcacbf91732d3a1c73b295c 100644 (file)
@@ -1,3 +1,9 @@
+2014-05-07  Jarek Czekalski  <jarekczek@poczta.onet.pl>
+
+       Fix initialization of minibuffer history variable (Bug#17430).
+       * minibuf.c (read_minibuf): Initialize histval to Qnil if unbound.
+       Move the initialization up to prevent any "value void" message.
+
 2014-05-06  Samuel Bronson  <naesten@gmail.com>
 
        * keyboard.c (Frecursive_edit): Ensure inc&dec of command_loop_level
index f325381d1ca77c19e2841acbe944469b77acb906..03d6104f226ae227b7ceeb7f09bf11be7db5397a 100644 (file)
@@ -535,6 +535,13 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
   if (!NILP (Vminibuffer_completing_file_name))
     Vminibuffer_completing_file_name = Qlambda;
 
+  /* If variable is unbound, make it nil.  */
+  Lisp_Object histval = find_symbol_value (Vminibuffer_history_variable);
+  if (EQ (histval, Qunbound)) {
+    Fset (Vminibuffer_history_variable, Qnil);
+    histval = Qnil;
+  }
+
   if (inherit_input_method)
     {
       /* `current-input-method' is buffer local.  So, remember it in
@@ -703,13 +710,6 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
     {
       /* If the caller wanted to save the value read on a history list,
         then do so if the value is not already the front of the list.  */
-      Lisp_Object histval;
-
-      /* If variable is unbound, make it nil.  */
-
-      histval = find_symbol_value (Vminibuffer_history_variable);
-      if (EQ (histval, Qunbound))
-       Fset (Vminibuffer_history_variable, Qnil);
 
       /* The value of the history variable must be a cons or nil.  Other
         values are unacceptable.  We silently ignore these values.  */