Merge remote-tracking branch 'origin/master' into sheet
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 13 Aug 2016 06:30:07 +0000 (08:30 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 13 Aug 2016 06:30:07 +0000 (08:30 +0200)
NEWS
src/language/stats/autorecode.c
src/ui/gui/main.c
tests/language/stats/autorecode.at

diff --git a/NEWS b/NEWS
index 0b87edb31adaa07305e23c546e3cad692182d690..883590541ee61c5a4af4af84d6865a5b95053409 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,9 @@ Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
 
 Changes from 0.10.2 to 0.10.4:
 
- * Updated to Gtk+3.14.5
+ *  Gtk+3.14.5 or later must now be used when building.
+
+ *  The AUTORECODE command now accepts an optional / before INTO.
 
 Changes from 0.10.1 to 0.10.2:
 
index dc357f7c4482496be6182c8698c53e820da24503..d3c5864c2221a6f79ff5ffada2b88c887de069fe 100644 (file)
@@ -153,6 +153,7 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds)
   if (!parse_variables_const (lexer, dict, &src_vars, &n_srcs,
                               PV_NO_DUPLICATE | PV_NO_SCRATCH))
     goto error;
+  lex_match (lexer, T_SLASH);
   if (!lex_force_match_id (lexer, "INTO"))
     goto error;
   lex_match (lexer, T_EQUALS);
index 4716b1fa4da6af353e060fa6b22423dc5ae6a11b..6b908e0fe7a293b7a5bdfcbbfe35d47ac614b8bc 100644 (file)
@@ -57,8 +57,8 @@ show_version_and_exit ()
 
   return TRUE;
 }
-\f
 
+\f
 
 gboolean
 init_prepare (GSource * source, gint * timeout_)
@@ -139,20 +139,29 @@ static gint
 on_local_options (GApplication * application,
                   GVariantDict * options, gpointer user_data)
 {
-  GVariant *b;
-
-  b =
-    g_variant_dict_lookup_value (options, "no-splash",
-                                 G_VARIANT_TYPE_BOOLEAN);
-  if (b)
-    {
+  {
+    GVariant *b =
+      g_variant_dict_lookup_value (options, "no-unique",
+                                  G_VARIANT_TYPE_BOOLEAN);
+    if (b)
+      {
+       GApplicationFlags flags =  g_application_get_flags (application);
+       flags |= G_APPLICATION_NON_UNIQUE;
+       g_application_set_flags (application, flags);
+       g_variant_unref (b);
+      }
+  }
+  {
+    GVariant *b =
+      g_variant_dict_lookup_value (options, "no-splash",
+                                  G_VARIANT_TYPE_BOOLEAN);
+    if (b)
       g_variant_unref (b);
-    }
-  else
-    {
+    else
       start_time = g_get_monotonic_time ();
-    }
+  }
 
+  
   return -1;
 }
 
@@ -248,7 +257,7 @@ process_pre_start_arguments (int *argc, char ***argv)
 {
   GOptionEntry oe[] = {
     {"version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK,
-     show_version_and_exit, "Show version information and exit", 0},
+     show_version_and_exit, N_("Show version information and exit"), 0},
     {NULL}
   };
 
@@ -270,7 +279,9 @@ main (int argc, char *argv[])
 
   GOptionEntry oe[] = {
     {"no-splash", 'q', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL,
-     "Do not display the splash screen", 0},
+      N_("Do not display the splash screen"), 0},
+    {"no-unique", 'n', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL,
+      N_("Do not attempt single instance negotiation"), 0},
     {NULL}
   };
 
index 6a8ff8e7316c224b478e8fa6ac5eb9c457be42c5..52c56a8582ae2336bf9618cc14b116bc48d3be7c 100644 (file)
@@ -272,3 +272,36 @@ asdfk,0,2.00,.  @&t@
 asdfk,1,2.00,.  @&t@
 ])
 AT_CLEANUP
+
+
+dnl For compatibility, make sure that /INTO (with leading slash) is accepted
+dnl (bug #48762)
+AT_SETUP([AUTORECODE with /INTO])
+AT_DATA([autorecode.sps],
+  [data list list notable /x .
+begin data.
+1
+8
+-901
+4
+1
+99
+8
+end data.
+
+autorecode x  /into y.
+
+list.
+])
+AT_CHECK([pspp -O format=csv autorecode.sps], [0],
+[Table: Data List
+x,y
+1.00,2.00
+8.00,4.00
+-901.00,1.00
+4.00,3.00
+1.00,2.00
+99.00,5.00
+8.00,4.00
+])
+AT_CLEANUP