emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r117994: Use AUTO_CONS instead of SCOPED_CONS, etc.


From: Paul Eggert
Subject: [Emacs-diffs] trunk r117994: Use AUTO_CONS instead of SCOPED_CONS, etc.
Date: Wed, 01 Oct 2014 03:28:26 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117994
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Tue 2014-09-30 20:28:16 -0700
message:
  Use AUTO_CONS instead of SCOPED_CONS, etc.
  
  * doc/lispref/internals.texi (Stack-allocated Objects):
  Adjust to match the revised, less error-prone macros.
  * src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER.
  * src/lisp.h (AUTO_CONS): Rename from scoped_cons.
  (AUTO_LIST1): Rename from scoped_list1.
  (AUTO_LIST2): Rename from scoped_list2.
  (AUTO_LIST3): Rename from scoped_list3.
  (AUTO_LIST4): Rename from scoped_list4.
  (AUTO_STRING): Rename from SCOPED_STRING.
  * src/frame.h (AUTO_FRAME_ARG):
  * src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3)
  (AUTO_LIST4, AUTO_STRING):
  Prepend a new argument 'name'.
  Declare a variable instead of yielding a value.
  All uses changed.
  * src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
modified:
  doc/lispref/ChangeLog          changelog-20091113204419-o5vbwnq5f7feedwu-6155
  doc/lispref/internals.texi     
internals.texi-20091113204419-o5vbwnq5f7feedwu-6188
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/buffer.c                   buffer.c-20091113204419-o5vbwnq5f7feedwu-264
  src/charset.c                  charset.c-20091113204419-o5vbwnq5f7feedwu-1075
  src/chartab.c                  chartab.c-20091113204419-o5vbwnq5f7feedwu-8539
  src/data.c                     data.c-20091113204419-o5vbwnq5f7feedwu-251
  src/dispnew.c                  dispnew.c-20091113204419-o5vbwnq5f7feedwu-258
  src/doc.c                      doc.c-20091113204419-o5vbwnq5f7feedwu-250
  src/editfns.c                  editfns.c-20091113204419-o5vbwnq5f7feedwu-255
  src/emacs.c                    emacs.c-20091113204419-o5vbwnq5f7feedwu-241
  src/fileio.c                   fileio.c-20091113204419-o5vbwnq5f7feedwu-210
  src/fns.c                      fns.c-20091113204419-o5vbwnq5f7feedwu-203
  src/font.c                     font.c-20091113204419-o5vbwnq5f7feedwu-8540
  src/fontset.c                  fontset.c-20091113204419-o5vbwnq5f7feedwu-1079
  src/frame.c                    frame.c-20091113204419-o5vbwnq5f7feedwu-243
  src/frame.h                    frame.h-20091113204419-o5vbwnq5f7feedwu-229
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
  src/keymap.c                   keymap.c-20091113204419-o5vbwnq5f7feedwu-219
  src/lisp.h                     lisp.h-20091113204419-o5vbwnq5f7feedwu-253
  src/lread.c                    lread.c-20091113204419-o5vbwnq5f7feedwu-266
  src/menu.c                     menu.c-20091113204419-o5vbwnq5f7feedwu-8676
  src/minibuf.c                  minibuf.c-20091113204419-o5vbwnq5f7feedwu-242
  src/process.c                  process.c-20091113204419-o5vbwnq5f7feedwu-462
  src/textprop.c                 textprop.c-20091113204419-o5vbwnq5f7feedwu-512
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
  src/xfaces.c                   xfaces.c-20091113204419-o5vbwnq5f7feedwu-560
  src/xfns.c                     xfns.c-20091113204419-o5vbwnq5f7feedwu-274
  src/xselect.c                  xselect.c-20091113204419-o5vbwnq5f7feedwu-543
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2014-09-30 19:10:37 +0000
+++ b/doc/lispref/ChangeLog     2014-10-01 03:28:16 +0000
@@ -1,3 +1,9 @@
+2014-10-01  Paul Eggert  <address@hidden>
+
+       Use AUTO_CONS instead of SCOPED_CONS, etc.
+       * internals.texi (Stack-allocated Objects):
+       Adjust to match the revised, less error-prone macros.
+
 2014-09-30  Paul Eggert  <address@hidden>
 
        * internals.texi (Stack-allocated Objects): Further improvements.

=== modified file 'doc/lispref/internals.texi'
--- a/doc/lispref/internals.texi        2014-09-30 19:10:37 +0000
+++ b/doc/lispref/internals.texi        2014-10-01 03:28:16 +0000
@@ -548,35 +548,12 @@
 never be made visible to user Lisp code.
 
   Currently, cons cells and strings can be allocated this way.  This
-is implemented by C macros like @code{scoped_cons} and
address@hidden that return a @code{Lisp_Object} with block
+is implemented by C macros like @code{AUTO_CONS} and
address@hidden that define a named @code{Lisp_Object} with block
 lifetime.  These objects are not freed by the garbage collector;
 instead, they have automatic storage duration, i.e., they are
 allocated like local variables and are automatically freed at the end
-of execution of the C block where the object was allocated.  C blocks
-include compound statements (i.e., inside @address@hidden and @address@hidden),
-along with selection and iteration statements and their immediate
-substatements.  For example:
-
address@hidden
-/* Erroneous code.  */
-Lisp_Object x;
-if (foo)
-  x = SCOPED_STRING ("prefix");
-else
-  x = bar;
-return concat2 (x, baz);
address@hidden example
-
address@hidden
-This has undefined behavior because the @code{if} statement is a
-block, so @code{x} is used after the corresponding object has been
-freed.  Better would be:
-
address@hidden
-Lisp_Object x = foo ? SCOPED_STRING ("prefix") : bar;
-return concat2 (x, baz);
address@hidden example
+of execution of the C block that defined the object.
 
   For performance reasons, stack-allocated strings are limited to
 @acronym{ASCII} characters, and many of these strings are immutable,

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-10-01 02:25:40 +0000
+++ b/src/ChangeLog     2014-10-01 03:28:16 +0000
@@ -1,5 +1,21 @@
 2014-10-01  Paul Eggert  <address@hidden>
 
+       Use AUTO_CONS instead of SCOPED_CONS, etc.
+       * frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER.
+       * lisp.h (AUTO_CONS): Rename from scoped_cons.
+       (AUTO_LIST1): Rename from scoped_list1.
+       (AUTO_LIST2): Rename from scoped_list2.
+       (AUTO_LIST3): Rename from scoped_list3.
+       (AUTO_LIST4): Rename from scoped_list4.
+       (AUTO_STRING): Rename from SCOPED_STRING.
+       * frame.h (AUTO_FRAME_ARG):
+       * lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3)
+       (AUTO_LIST4, AUTO_STRING):
+       Prepend a new argument 'name'.
+       Declare a variable instead of yielding a value.
+       All uses changed.
+       * lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
+
        * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t
        to ssize_t since we're not using ssize_t-related syscalls here.
 

=== modified file 'src/buffer.c'
--- a/src/buffer.c      2014-09-30 02:43:23 +0000
+++ b/src/buffer.c      2014-10-01 03:28:16 +0000
@@ -1552,10 +1552,11 @@
     return notsogood;
   else
     {
-      buf = Fget_buffer (SCOPED_STRING ("*scratch*"));
+      AUTO_STRING (scratch, "*scratch*");
+      buf = Fget_buffer (scratch);
       if (NILP (buf))
        {
-         buf = Fget_buffer_create (SCOPED_STRING ("*scratch*"));
+         buf = Fget_buffer_create (scratch);
          Fset_buffer_major_mode (buf);
        }
       return buf;
@@ -1575,10 +1576,11 @@
     if (candidate_buffer (buf, buffer))
       return buf;
 
-  buf = Fget_buffer (SCOPED_STRING ("*scratch*"));
+  AUTO_STRING (scratch, "*scratch*");
+  buf = Fget_buffer (scratch);
   if (NILP (buf))
     {
-      buf = Fget_buffer_create (SCOPED_STRING ("*scratch*"));
+      buf = Fget_buffer_create (scratch);
       Fset_buffer_major_mode (buf);
     }
 
@@ -5289,7 +5291,8 @@
   (void) initialized;
 #endif /* USE_MMAP_FOR_BUFFERS */
 
-  Fset_buffer (Fget_buffer_create (SCOPED_STRING ("*scratch*")));
+  AUTO_STRING (scratch, "*scratch*");
+  Fset_buffer (Fget_buffer_create (scratch));
   if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters)))
     Fset_buffer_multibyte (Qnil);
 
@@ -5326,9 +5329,12 @@
         However, it is not necessary to turn / into /:/.
         So avoid doing that.  */
       && strcmp ("/", SSDATA (BVAR (current_buffer, directory))))
-    bset_directory
-      (current_buffer,
-       concat2 (SCOPED_STRING ("/:"), BVAR (current_buffer, directory)));
+    {
+      AUTO_STRING (slash_colon, "/:");
+      bset_directory (current_buffer,
+                     concat2 (slash_colon,
+                              BVAR (current_buffer, directory)));
+    }
 
   temp = get_minibuffer (0);
   bset_directory (XBUFFER (temp), BVAR (current_buffer, directory));

=== modified file 'src/charset.c'
--- a/src/charset.c     2014-09-30 02:43:23 +0000
+++ b/src/charset.c     2014-10-01 03:28:16 +0000
@@ -485,14 +485,12 @@
   unsigned max_code = CHARSET_MAX_CODE (charset);
   int fd;
   FILE *fp;
-  Lisp_Object suffixes;
   struct charset_map_entries *head, *entries;
   int n_entries;
-  ptrdiff_t count;
-
-  suffixes = scoped_list2 (SCOPED_STRING (".map"), SCOPED_STRING (".TXT"));
-
-  count = SPECPDL_INDEX ();
+  AUTO_STRING (map, ".map");
+  AUTO_STRING (txt, ".txt");
+  AUTO_LIST2 (suffixes, map, txt);
+  ptrdiff_t count = SPECPDL_INDEX ();
   record_unwind_protect_nothing ();
   specbind (Qfile_name_handler_alist, Qnil);
   fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false);

=== modified file 'src/chartab.c'
--- a/src/chartab.c     2014-09-30 02:43:23 +0000
+++ b/src/chartab.c     2014-10-01 03:28:16 +0000
@@ -1302,8 +1302,8 @@
     {
       struct gcpro gcpro1;
       GCPRO1 (val);
-      result = Fload (concat2 (SCOPED_STRING ("international/"), table),
-                     Qt, Qt, Qt, Qt);
+      AUTO_STRING (intl, "international/");
+      result = Fload (concat2 (intl, table), Qt, Qt, Qt, Qt);
       UNGCPRO;
       if (NILP (result))
        return Qnil;

=== modified file 'src/data.c'
--- a/src/data.c        2014-09-30 02:43:23 +0000
+++ b/src/data.c        2014-10-01 03:28:16 +0000
@@ -979,14 +979,15 @@
 {
   ptrdiff_t i = 0, len = XINT (Flength (choice));
   Lisp_Object obj, *args;
-  Lisp_Object should_be_specified = SCOPED_STRING (" should be specified");
-  Lisp_Object or = SCOPED_STRING (" or ");
-  Lisp_Object comma = SCOPED_STRING (", ");
+  AUTO_STRING (one_of, "One of ");
+  AUTO_STRING (comma, ", ");
+  AUTO_STRING (or, " or ");
+  AUTO_STRING (should_be_specified, " should be specified");
 
   USE_SAFE_ALLOCA;
   SAFE_ALLOCA_LISP (args, len * 2 + 1);
 
-  args[i++] = SCOPED_STRING ("One of ");
+  args[i++] = one_of;
 
   for (obj = choice; !NILP (obj); obj = XCDR (obj))
     {
@@ -1006,11 +1007,13 @@
 static void
 wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong)
 {
-  xsignal2 (Qerror, Fconcat (4, ((Lisp_Object [])
-    { SCOPED_STRING ("Value should be from "),
-      Fnumber_to_string (min),
-      SCOPED_STRING (" to "),
-      Fnumber_to_string (max) })), wrong);
+  AUTO_STRING (value_should_be_from, "Value should be from ");
+  AUTO_STRING (to, " to ");
+  xsignal2 (Qerror,
+           Fconcat (4, ((Lisp_Object [])
+                        {value_should_be_from, Fnumber_to_string (min),
+                         to, Fnumber_to_string (max)})),
+           wrong);
 }
 
 /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell

=== modified file 'src/dispnew.c'
--- a/src/dispnew.c     2014-10-01 02:25:40 +0000
+++ b/src/dispnew.c     2014-10-01 03:28:16 +0000
@@ -6100,15 +6100,12 @@
       (*initial_terminal->delete_terminal_hook) (initial_terminal);
 
     /* Update frame parameters to reflect the new type. */
-    Fmodify_frame_parameters
-      (selected_frame, FRAME_PARAMETER (Qtty_type,
-                                       Ftty_type (selected_frame)));
-    if (t->display_info.tty->name)
-      Fmodify_frame_parameters
-       (selected_frame,
-        FRAME_PARAMETER (Qtty, build_string (t->display_info.tty->name)));
-    else
-      Fmodify_frame_parameters (selected_frame, FRAME_PARAMETER (Qtty, Qnil));
+    AUTO_FRAME_ARG (tty_type_arg, Qtty_type, Ftty_type (selected_frame));
+    Fmodify_frame_parameters (selected_frame, tty_type_arg);
+    AUTO_FRAME_ARG (tty_arg, Qtty, (t->display_info.tty->name
+                                   ? build_string (t->display_info.tty->name)
+                                   : Qnil));
+    Fmodify_frame_parameters (selected_frame, tty_arg);
   }
 
   {

=== modified file 'src/doc.c'
--- a/src/doc.c 2014-09-30 02:43:23 +0000
+++ b/src/doc.c 2014-10-01 03:28:16 +0000
@@ -146,8 +146,9 @@
       if (fd < 0)
        {
          SAFE_FREE ();
-         return concat3 (SCOPED_STRING ("Cannot open doc string file \""),
-                         file, SCOPED_STRING ("\"\n"));
+         AUTO_STRING (cannot_open, "Cannot open doc string file \"");
+         AUTO_STRING (quote_nl, "\"\n");
+         return concat3 (cannot_open, file, quote_nl);
        }
     }
   count = SPECPDL_INDEX ();

=== modified file 'src/editfns.c'
--- a/src/editfns.c     2014-09-30 02:43:23 +0000
+++ b/src/editfns.c     2014-10-01 03:28:16 +0000
@@ -4362,7 +4362,8 @@
 Lisp_Object
 format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1)
 {
-  return Fformat (3, (Lisp_Object []) { SCOPED_STRING (string1), arg0, arg1 });
+  AUTO_STRING (format, string1);
+  return Fformat (3, (Lisp_Object []) {format, arg0, arg1});
 }
 
 DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0,

=== modified file 'src/emacs.c'
--- a/src/emacs.c       2014-09-30 02:43:23 +0000
+++ b/src/emacs.c       2014-10-01 03:28:16 +0000
@@ -400,6 +400,7 @@
   Lisp_Object name, dir, handler;
   ptrdiff_t count = SPECPDL_INDEX ();
   Lisp_Object raw_name;
+  AUTO_STRING (slash_colon, "/:");
 
   initial_argv = argv;
   initial_argc = argc;
@@ -423,7 +424,7 @@
      if it would otherwise be treated as magic.  */
   handler = Ffind_file_name_handler (raw_name, Qt);
   if (! NILP (handler))
-    raw_name = concat2 (SCOPED_STRING ("/:"), raw_name);
+    raw_name = concat2 (slash_colon, raw_name);
 
   Vinvocation_name = Ffile_name_nondirectory (raw_name);
   Vinvocation_directory = Ffile_name_directory (raw_name);
@@ -441,7 +442,7 @@
             if it would otherwise be treated as magic.  */
          handler = Ffind_file_name_handler (found, Qt);
          if (! NILP (handler))
-           found = concat2 (SCOPED_STRING ("/:"), found);
+           found = concat2 (slash_colon, found);
          Vinvocation_directory = Ffile_name_directory (found);
        }
     }
@@ -2323,7 +2324,10 @@
             }
 
           if (! NILP (tem))
-            element = concat2 (SCOPED_STRING ("/:"), element);
+           {
+             AUTO_STRING (slash_colon, "/:");
+             element = concat2 (slash_colon, element);
+           }
         } /* !NILP (element) */
 
       lpath = Fcons (element, lpath);

=== modified file 'src/fileio.c'
--- a/src/fileio.c      2014-09-30 02:43:23 +0000
+++ b/src/fileio.c      2014-10-01 03:28:16 +0000
@@ -1111,7 +1111,8 @@
 
              name = make_specified_string (nm, -1, p - nm, multibyte);
              temp[0] = DRIVE_LETTER (drive);
-             name = concat2 (SCOPED_STRING (temp), name);
+             AUTO_STRING (drive_prefix, temp);
+             name = concat2 (drive_prefix, name);
            }
 #ifdef WINDOWSNT
          if (!NILP (Vw32_downcase_file_names))
@@ -5419,10 +5420,10 @@
 
   ring_bell (XFRAME (selected_frame));
 
+  AUTO_STRING (format, "Auto-saving %s: %s");
   msg = Fformat (3, ((Lisp_Object [])
-    { SCOPED_STRING ("Auto-saving %s: %s"),
-      BVAR (current_buffer, name),
-      Ferror_message_string (error_val) }));
+                    {format, BVAR (current_buffer, name),
+                     Ferror_message_string (error_val)}));
   GCPRO1 (msg);
 
   for (i = 0; i < 3; ++i)

=== modified file 'src/fns.c'
--- a/src/fns.c 2014-09-30 02:43:23 +0000
+++ b/src/fns.c 2014-10-01 03:28:16 +0000
@@ -2725,8 +2725,8 @@
       return obj;
     }
 
-  prompt = Fconcat (2, ((Lisp_Object [])
-    { prompt, SCOPED_STRING ("(yes or no) ") }));
+  AUTO_STRING (yes_or_no, "(yes or no) ");
+  prompt = Fconcat (2, (Lisp_Object []) {prompt, yes_or_no});
   GCPRO1 (prompt);
 
   while (1)

=== modified file 'src/font.c'
--- a/src/font.c        2014-09-30 02:43:23 +0000
+++ b/src/font.c        2014-10-01 03:28:16 +0000
@@ -1187,13 +1187,22 @@
        {
          val = prop[XLFD_ENCODING_INDEX];
          if (! NILP (val))
-           val = concat2 (SCOPED_STRING ("*-"), SYMBOL_NAME (val));
+           {
+             AUTO_STRING (stardash, "*-");
+             val = concat2 (stardash, SYMBOL_NAME (val));
+           }
        }
       else if (NILP (prop[XLFD_ENCODING_INDEX]))
-       val = concat2 (SYMBOL_NAME (val), SCOPED_STRING ("-*"));
+       {
+         AUTO_STRING (dashstar, "-*");
+         val = concat2 (SYMBOL_NAME (val), dashstar);
+       }
       else
-       val = concat3 (SYMBOL_NAME (val), SCOPED_STRING ("-"),
-                      SYMBOL_NAME (prop[XLFD_ENCODING_INDEX]));
+       {
+         AUTO_STRING (dash, "-");
+         val = concat3 (SYMBOL_NAME (val), dash,
+                        SYMBOL_NAME (prop[XLFD_ENCODING_INDEX]));
+       }
       if (! NILP (val))
        ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil));
 
@@ -1789,10 +1798,8 @@
       p1 = strchr (p0, '-');
       if (! p1)
        {
-         if (SDATA (registry)[len - 1] == '*')
-           registry = concat2 (registry, SCOPED_STRING ("-*"));
-         else
-           registry = concat2 (registry, SCOPED_STRING ("*-*"));
+         AUTO_STRING (extra, ("*-*" + (len && p0[len - 1] == '*')));
+         registry = concat2 (registry, extra);
        }
       registry = Fdowncase (registry);
       ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil));
@@ -5019,7 +5026,7 @@
   if (FONTP (arg))
     {
       Lisp_Object tail, elt;
-      Lisp_Object equalstr = SCOPED_STRING ("=");
+      AUTO_STRING (equalstr, "=");
 
       val = Ffont_xlfd_name (arg, Qt);
       for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail);
@@ -5052,8 +5059,11 @@
     {
       val = Ffont_xlfd_name (result, Qt);
       if (! FONT_SPEC_P (result))
-       val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)),
-                      SCOPED_STRING (":"), val);
+       {
+         AUTO_STRING (colon, ":");
+         val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)),
+                        colon, val);
+       }
       result = val;
     }
   else if (CONSP (result))

=== modified file 'src/fontset.c'
--- a/src/fontset.c     2014-09-30 02:43:23 +0000
+++ b/src/fontset.c     2014-10-01 03:28:16 +0000
@@ -1462,8 +1462,8 @@
       registry = AREF (font_spec, FONT_REGISTRY_INDEX);
       if (! NILP (registry))
        registry = Fdowncase (SYMBOL_NAME (registry));
-      encoding = find_font_encoding (concat3 (family, SCOPED_STRING ("-"),
-                                             registry));
+      AUTO_STRING (dash, "-");
+      encoding = find_font_encoding (concat3 (family, dash, registry));
       if (NILP (encoding))
        encoding = Qascii;
 
@@ -1575,7 +1575,7 @@
 
   if (ascii_changed)
     {
-      Lisp_Object tail, fr, alist;
+      Lisp_Object tail, fr;
       int fontset_id = XINT (FONTSET_ID (fontset));
 
       set_fontset_ascii (fontset, fontname);
@@ -1598,8 +1598,8 @@
          if (! NILP (font_object))
            {
              update_auto_fontset_alist (font_object, fontset);
-             alist = FRAME_PARAMETER (Qfont, Fcons (name, font_object));
-             Fmodify_frame_parameters (fr, alist);
+             AUTO_FRAME_ARG (arg, Qfont, Fcons (name, font_object));
+             Fmodify_frame_parameters (fr, arg);
            }
        }
     }

=== modified file 'src/frame.c'
--- a/src/frame.c       2014-09-30 15:20:03 +0000
+++ b/src/frame.c       2014-10-01 03:28:16 +0000
@@ -4148,9 +4148,9 @@
     {
       if (attribute && dpyinfo)
        {
-         tem = display_x_get_resource
-           (dpyinfo, SCOPED_STRING (attribute),
-            SCOPED_STRING (class), Qnil, Qnil);
+         AUTO_STRING (at, attribute);
+         AUTO_STRING (cl, class);
+         tem = display_x_get_resource (dpyinfo, at, cl, Qnil, Qnil);
 
          if (NILP (tem))
            return Qunbound;
@@ -4260,7 +4260,8 @@
   tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type);
   if (EQ (tem, Qunbound))
     tem = deflt;
-  x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem));
+  AUTO_FRAME_ARG (arg, prop, tem);
+  x_set_frame_parameters (f, arg);
   return tem;
 }
 

=== modified file 'src/frame.h'
--- a/src/frame.h       2014-09-21 22:49:24 +0000
+++ b/src/frame.h       2014-10-01 03:28:16 +0000
@@ -1062,8 +1062,8 @@
 
 /* Handy macro to construct an argument to Fmodify_frame_parameters.  */
 
-#define FRAME_PARAMETER(parameter, value)      \
-  scoped_list1 (scoped_cons (parameter, value))
+#define AUTO_FRAME_ARG(name, parameter, value) \
+  AUTO_LIST1 (name, AUTO_CONS_EXPR (parameter, value))
 
 /* False means there are no visible garbaged frames.  */
 extern bool frame_garbaged;

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2014-09-30 02:43:23 +0000
+++ b/src/keyboard.c    2014-10-01 03:28:16 +0000
@@ -551,6 +551,7 @@
 
   /* Replace a dash from echo_dash with a space, otherwise add a space
      at the end as a separator between keys.  */
+  AUTO_STRING (space, " ");
   if (STRINGP (echo_string) && SCHARS (echo_string) > 1)
     {
       Lisp_Object last_char, prev_char, idx;
@@ -566,10 +567,10 @@
       if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
        Faset (echo_string, idx, make_number (' '));
       else
-       echo_string = concat2 (echo_string, SCOPED_STRING (" "));
+       echo_string = concat2 (echo_string, space);
     }
   else if (STRINGP (echo_string) && SCHARS (echo_string) > 0)
-    echo_string = concat2 (echo_string, SCOPED_STRING (" "));
+    echo_string = concat2 (echo_string, space);
 
   kset_echo_string
     (current_kboard,
@@ -630,9 +631,9 @@
 
   /* Put a dash at the end of the buffer temporarily,
      but make it go away when the next character is added.  */
-  kset_echo_string
-    (current_kboard,
-     concat2 (KVAR (current_kboard, echo_string), SCOPED_STRING ("-")));
+  AUTO_STRING (dash, "-");
+  kset_echo_string (current_kboard,
+                   concat2 (KVAR (current_kboard, echo_string), dash));
   echo_now ();
 }
 
@@ -1890,13 +1891,11 @@
 static Lisp_Object
 safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args)
 {
-  Lisp_Object hook, fun;
-
   eassert (nargs == 2);
-  hook = args[0];
-  fun = args[1];
-  Fmessage (4, ((Lisp_Object [])
-    { SCOPED_STRING ("Error in %s (%S): %S"), hook, fun, error }));
+  AUTO_STRING (format, "Error in %s (%S): %S");
+  Lisp_Object hook = args[0];
+  Lisp_Object fun = args[1];
+  Fmessage (4, (Lisp_Object []) {format, hook, fun, error});
 
   if (SYMBOLP (hook))
     {
@@ -7885,12 +7884,12 @@
 
   { /* This is a command.  See if there is an equivalent key binding.  */
     Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ);
+    AUTO_STRING (space_space, "  ");
 
     /* The previous code preferred :key-sequence to :keys, so we
        preserve this behavior.  */
     if (STRINGP (keyeq) && !CONSP (keyhint))
-      keyeq = concat2 (SCOPED_STRING ("  "),
-                      Fsubstitute_command_keys (keyeq));
+      keyeq = concat2 (space_space, Fsubstitute_command_keys (keyeq));
     else
       {
        Lisp_Object prefix = keyeq;
@@ -7933,7 +7932,7 @@
                if (STRINGP (XCDR (prefix)))
                  tem = concat2 (tem, XCDR (prefix));
              }
-           keyeq = concat2 (SCOPED_STRING ("  "), tem);
+           keyeq = concat2 (space_space, tem);
          }
        else
          keyeq = Qnil;
@@ -8637,10 +8636,14 @@
                      /* Insert button prefix.  */
                      Lisp_Object selected
                        = AREF (item_properties, ITEM_PROPERTY_SELECTED);
+                     AUTO_STRING (radio_yes, "(*) ");
+                     AUTO_STRING (radio_no , "( ) ");
+                     AUTO_STRING (check_yes, "[X] ");
+                     AUTO_STRING (check_no , "[ ] ");
                      if (EQ (tem, QCradio))
-                       tem = SCOPED_STRING (NILP (selected) ? "(*) " : "( ) ");
+                       tem = NILP (selected) ? radio_yes : radio_no;
                      else
-                       tem = SCOPED_STRING (NILP (selected) ? "[X] " : "[ ] ");
+                       tem = NILP (selected) ? check_yes : check_no;
                      s = concat2 (tem, s);
                    }
 

=== modified file 'src/keymap.c'
--- a/src/keymap.c      2014-09-30 02:43:23 +0000
+++ b/src/keymap.c      2014-10-01 03:28:16 +0000
@@ -1299,7 +1299,8 @@
 static Lisp_Object
 append_key (Lisp_Object key_sequence, Lisp_Object key)
 {
-  return Fvconcat (2, ((Lisp_Object []) { key_sequence, scoped_list1 (key) }));
+  AUTO_LIST1 (key_list, key);
+  return Fvconcat (2, ((Lisp_Object []) { key_sequence, key_list }));
 }
 
 /* Given a event type C which is a symbol,
@@ -1338,7 +1339,8 @@
       *p = 0;
 
       c = reorder_modifiers (c);
-      keystring = concat2 (SCOPED_STRING (new_mods), XCDR (assoc));
+      AUTO_STRING (new_modstring, new_mods);
+      keystring = concat2 (new_modstring, XCDR (assoc));
 
       error ("To bind the key %s, use [?%s], not [%s]",
             SDATA (SYMBOL_NAME (c)), SDATA (keystring),
@@ -2242,9 +2244,12 @@
 
   if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key)))
     /* An interval from a map-char-table.  */
-    return concat3 (Fsingle_key_description (XCAR (key), no_angles),
-                   SCOPED_STRING (".."),
-                   Fsingle_key_description (XCDR (key), no_angles));
+    {
+      AUTO_STRING (dotdot, "..");
+      return concat3 (Fsingle_key_description (XCAR (key), no_angles),
+                     dotdot,
+                     Fsingle_key_description (XCDR (key), no_angles));
+    }
 
   key = EVENT_HEAD (key);
 
@@ -3439,9 +3444,9 @@
       /* Call Fkey_description first, to avoid GC bug for the other string.  */
       if (!NILP (prefix) && XFASTINT (Flength (prefix)) > 0)
        {
-         Lisp_Object tem;
-         tem = Fkey_description (prefix, Qnil);
-         elt_prefix = concat2 (tem, SCOPED_STRING (" "));
+         Lisp_Object tem = Fkey_description (prefix, Qnil);
+         AUTO_STRING (space, " ");
+         elt_prefix = concat2 (tem, space);
        }
       prefix = Qnil;
     }

=== modified file 'src/lisp.h'
--- a/src/lisp.h        2014-09-30 02:43:23 +0000
+++ b/src/lisp.h        2014-10-01 03:28:16 +0000
@@ -4625,24 +4625,36 @@
                        && alignof (union Aligned_String) % GCALIGNMENT == 0)
   };
 
-/* Build a stack-based Lisp cons or short list if possible, a GC-based
-   one otherwise.  The resulting object should not be modified or made
-   visible to user code.  */
-
-#define scoped_cons(a, b)                      \
-  (USE_STACK_CONS                              \
-   ? make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) \
-   : Fcons (a, b))
-#define scoped_list1(a)                                \
-  (USE_STACK_CONS ? scoped_cons (a, Qnil) : list1 (a))
-#define scoped_list2(a, b)                     \
-  (USE_STACK_CONS ? scoped_cons (a, scoped_list1 (b)) : list2 (a,b))
-#define scoped_list3(a, b, c)                  \
-  (USE_STACK_CONS ? scoped_cons (a, scoped_list2 (b, c)) : list3 (a, b, c))
-#define scoped_list4(a, b, c, d)               \
-  (USE_STACK_CONS                              \
-   ? scoped_cons (a, scoped_list3 (b, c, d)) : \
-   list4 (a, b, c, d))
+/* Auxiliary macros used for auto allocation of Lisp objects.  Please
+   use these only in macros like AUTO_CONS that declare a local
+   variable whose lifetime will be clear to the programmer.  */
+#define STACK_CONS(a, b) \
+  make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons)
+#define AUTO_CONS_EXPR(a, b) \
+  (USE_STACK_CONS ? STACK_CONS (a, b) : Fcons (a, b))
+
+/* Declare NAME as an auto Lisp cons or short list if possible, a
+   GC-based one otherwise.  This is in the sense of the C keyword
+   'auto'; i.e., the object has the lifetime of the containing block.
+   The resulting object should not be made visible to user Lisp code.  */
+
+#define AUTO_CONS(name, a, b) Lisp_Object name = AUTO_CONS_EXPR (a, b)
+#define AUTO_LIST1(name, a)                                            \
+  Lisp_Object name = (USE_STACK_CONS ? STACK_CONS (a, Qnil) : list1 (a))
+#define AUTO_LIST2(name, a, b)                                         \
+  Lisp_Object name = (USE_STACK_CONS                                   \
+                     ? STACK_CONS (a, STACK_CONS (b, Qnil))            \
+                     : list2 (a, b))
+#define AUTO_LIST3(name, a, b, c)                                      \
+  Lisp_Object name = (USE_STACK_CONS                                   \
+                     ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c, Qnil))) \
+                     : list3 (a, b, c))
+#define AUTO_LIST4(name, a, b, c, d)                                   \
+    Lisp_Object name                                                   \
+      = (USE_STACK_CONS                                                        
\
+        ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c,                 \
+                                                    STACK_CONS (d, Qnil)))) \
+        : list4 (a, b, c, d))
 
 /* Check whether stack-allocated strings are ASCII-only.  */
 
@@ -4652,18 +4664,19 @@
 # define verify_ascii(str) (str)
 #endif
 
-/* Build a stack-based Lisp string from STR if possible, a GC-based
-   one if not.  STR is not necessarily copied and should contain only
-   ASCII characters.  The resulting Lisp string should not be modified
-   or made visible to user code.  */
+/* Declare NAME as an auto Lisp string if possible, a GC-based one if not.
+   Take its value from STR.  STR is not necessarily copied and should
+   contain only ASCII characters.  The resulting Lisp string should
+   not be modified or made visible to user code.  */
 
-#define SCOPED_STRING(str)                                             \
-  (USE_STACK_STRING                                                    \
-   ? (make_lisp_ptr                                                    \
-      ((&(union Aligned_String)                                                
\
-       { { strlen (str), -1, 0, (unsigned char *) verify_ascii (str) } }.s), \
-       Lisp_String))                                                   \
-   : build_string (verify_ascii (str)))
+#define AUTO_STRING(name, str)                                         \
+  Lisp_Object name =                                                   \
+    (USE_STACK_STRING                                                  \
+     ? (make_lisp_ptr                                                  \
+       ((&(union Aligned_String)                                       \
+         {{strlen (str), -1, 0, (unsigned char *) verify_ascii (str)}}.s), \
+         Lisp_String))                                                 \
+     : build_string (verify_ascii (str)))
 
 /* Loop over all tails of a list, checking for cycles.
    FIXME: Make tortoise and n internal declarations.

=== modified file 'src/lread.c'
--- a/src/lread.c       2014-09-30 02:43:23 +0000
+++ b/src/lread.c       2014-10-01 03:28:16 +0000
@@ -969,9 +969,10 @@
 load_warn_old_style_backquotes (Lisp_Object file)
 {
   if (!NILP (Vold_style_backquotes))
-    Fmessage (2, ((Lisp_Object [])
-      { SCOPED_STRING ("Loading `%s': old-style backquotes detected!"),
-       file }));
+    {
+      AUTO_STRING (format, "Loading `%s': old-style backquotes detected!");
+      Fmessage (2, (Lisp_Object []) {format, file});
+    }
 }
 
 DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
@@ -2888,11 +2889,8 @@
                  if (c == '=')
                    {
                      /* Make a placeholder for #n# to use temporarily.  */
-                     Lisp_Object placeholder;
-                     Lisp_Object cell;
-
-                     placeholder = scoped_cons (Qnil, Qnil);
-                     cell = Fcons (make_number (n), placeholder);
+                     AUTO_CONS (placeholder, Qnil, Qnil);
+                     Lisp_Object cell = Fcons (make_number (n), placeholder);
                      read_objects = Fcons (cell, read_objects);
 
                      /* Read the object itself.  */
@@ -3371,7 +3369,7 @@
           substitute_in_interval contains part of the logic.  */
 
        INTERVAL root_interval = string_intervals (subtree);
-       Lisp_Object arg = scoped_cons (object, placeholder);
+       AUTO_CONS (arg, object, placeholder);
 
        traverse_intervals_noorder (root_interval,
                                    &substitute_in_interval, arg);
@@ -3678,8 +3676,10 @@
               in the installed Lisp directory.
               We don't use Fexpand_file_name because that would make
               the directory absolute now.  */
-           elt = concat2 (SCOPED_STRING ("../lisp/"),
-                          Ffile_name_nondirectory (elt));
+           {
+             AUTO_STRING (dotdotlisp, "../lisp/");
+             elt = concat2 (dotdotlisp, Ffile_name_nondirectory (elt));
+           }
        }
       else if (EQ (elt, Vload_file_name)
               && ! NILP (elt)

=== modified file 'src/menu.c'
--- a/src/menu.c        2014-09-30 02:43:23 +0000
+++ b/src/menu.c        2014-10-01 03:28:16 +0000
@@ -389,8 +389,11 @@
                    {
                      if (!submenu && SREF (tem, 0) != '\0'
                          && SREF (tem, 0) != '-')
-                       ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME,
-                             concat2 (SCOPED_STRING ("    "), tem));
+                       {
+                         AUTO_STRING (spaces, "    ");
+                         ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME,
+                               concat2 (spaces, tem));
+                       }
                      idx += MENU_ITEMS_ITEM_LENGTH;
                    }
                }
@@ -409,14 +412,20 @@
        prefix = "    ";
 
       if (prefix)
-       item_string = concat2 (SCOPED_STRING (prefix), item_string);
+       {
+         AUTO_STRING (prefix_obj, prefix);
+         item_string = concat2 (prefix_obj, item_string);
+       }
   }
 
   if ((FRAME_TERMCAP_P (XFRAME (Vmenu_updating_frame))
        || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame)))
       && !NILP (map))
     /* Indicate visually that this is a submenu.  */
-    item_string = concat2 (item_string, SCOPED_STRING (" >"));
+    {
+      AUTO_STRING (space_gt, " >");
+      item_string = concat2 (item_string, space_gt);
+    }
 
   push_menu_item (item_string, enabled, key,
                  AREF (item_properties, ITEM_PROPERTY_DEF),

=== modified file 'src/minibuf.c'
--- a/src/minibuf.c     2014-09-30 02:43:23 +0000
+++ b/src/minibuf.c     2014-10-01 03:28:16 +0000
@@ -1157,9 +1157,10 @@
                                              STRING_MULTIBYTE (prompt));
            }
 
+         AUTO_STRING (format, "%s (default %s): ");
          prompt = Fformat (3, ((Lisp_Object [])
-           { SCOPED_STRING ("%s (default %s): "),
-             prompt, CONSP (def) ? XCAR (def) : def }));
+                               {format, prompt,
+                                CONSP (def) ? XCAR (def) : def}));
        }
 
       result = Fcompleting_read (prompt, intern ("internal-complete-buffer"),

=== modified file 'src/process.c'
--- a/src/process.c     2014-09-30 02:43:23 +0000
+++ b/src/process.c     2014-10-01 03:28:16 +0000
@@ -596,7 +596,7 @@
   Lisp_Object symbol;
   int code;
   bool coredump;
-  Lisp_Object string, string2;
+  Lisp_Object string;
 
   decode_status (status, &symbol, &code, &coredump);
 
@@ -620,8 +620,8 @@
          if (c1 != c2)
            Faset (string, make_number (0), make_number (c2));
        }
-      string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n");
-      return concat2 (string, string2);
+      AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n");
+      return concat2 (string, suffix);
     }
   else if (EQ (symbol, Qexit))
     {
@@ -629,17 +629,17 @@
        return build_string (code == 0 ? "deleted\n" : "connection broken by 
remote peer\n");
       if (code == 0)
        return build_string ("finished\n");
+      AUTO_STRING (prefix, "exited abnormally with code ");
       string = Fnumber_to_string (make_number (code));
-      string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n");
-      return concat3 (SCOPED_STRING ("exited abnormally with code "),
-                     string, string2);
+      AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n");
+      return concat3 (prefix, string, suffix);
     }
   else if (EQ (symbol, Qfailed))
     {
+      AUTO_STRING (prefix, "failed with code ");
       string = Fnumber_to_string (make_number (code));
-      string2 = SCOPED_STRING ("\n");
-      return concat3 (SCOPED_STRING ("failed with code "),
-                     string, string2);
+      AUTO_STRING (suffix, "\n");
+      return concat3 (prefix, string, suffix);
     }
   else
     return Fcopy_sequence (Fsymbol_name (symbol));
@@ -1327,7 +1327,8 @@
       else
        return Qnil;
 
-      args[0] = SCOPED_STRING (format);
+      AUTO_STRING (format_obj, format);
+      args[0] = format_obj;
 
       for (i = 0; i < nargs; i++)
        {
@@ -1346,8 +1347,10 @@
     }
 
   if (CONSP (address))
-    return Fformat (2, ((Lisp_Object [])
-      { SCOPED_STRING ("<Family %d>"), Fcar (address) }));
+    {
+      AUTO_STRING (format, "<Family %d>");
+      return Fformat (2, (Lisp_Object []) {format, Fcar (address)});
+    }
 
   return Qnil;
 }
@@ -4062,12 +4065,13 @@
       {
        unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr;
 
+       AUTO_STRING (ipv4_format, "%d.%d.%d.%d");
        host = Fformat (5, ((Lisp_Object [])
-         { SCOPED_STRING ("%d.%d.%d.%d"), make_number (ip[0]),
+         { ipv4_format, make_number (ip[0]),
            make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) }));
        service = make_number (ntohs (saddr.in.sin_port));
-       caller = Fformat (3, ((Lisp_Object [])
-         { SCOPED_STRING (" <%s:%d>"), host, service }));
+       AUTO_STRING (caller_format, " <%s:%d>");
+       caller = Fformat (3, (Lisp_Object []) {caller_format, host, service});
       }
       break;
 
@@ -4078,13 +4082,14 @@
        uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr;
        int i;
 
-       args[0] = SCOPED_STRING ("%x:%x:%x:%x:%x:%x:%x:%x");
+       AUTO_STRING (ipv6_format, "%x:%x:%x:%x:%x:%x:%x:%x");
+       args[0] = ipv6_format;
        for (i = 0; i < 8; i++)
          args[i + 1] = make_number (ntohs (ip6[i]));
        host = Fformat (9, args);
        service = make_number (ntohs (saddr.in.sin_port));
-       caller = Fformat (3, ((Lisp_Object [])
-         { SCOPED_STRING (" <[%s]:%d>"), host, service }));
+       AUTO_STRING (caller_format, " <[%s]:%d>");
+       caller = Fformat (3, (Lisp_Object []) {caller_format, host, service});
       }
       break;
 #endif
@@ -4094,8 +4099,9 @@
 #endif
     default:
       caller = Fnumber_to_string (make_number (connect_counter));
-      caller = concat3
-       (SCOPED_STRING (" <"), caller, SCOPED_STRING (">"));
+      AUTO_STRING (space_lessthan, " <");
+      AUTO_STRING (greaterthan, ">");
+      caller = concat3 (space_lessthan, caller, greaterthan);
       break;
     }
 
@@ -4192,16 +4198,18 @@
   p->inherit_coding_system_flag
     = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag);
 
+  AUTO_STRING (dash, "-");
+  AUTO_STRING (nl, "\n");
+  Lisp_Object host_string = STRINGP (host) ? host : dash;
+
   if (!NILP (ps->log))
-      call3 (ps->log, server, proc,
-            concat3 (SCOPED_STRING ("accept from "),
-                     (STRINGP (host) ? host : SCOPED_STRING ("-")),
-                     SCOPED_STRING ("\n")));
+    {
+      AUTO_STRING (accept_from, "accept from ");
+      call3 (ps->log, server, proc, concat3 (accept_from, host_string, nl));
+    }
 
-  exec_sentinel (proc,
-                concat3 (SCOPED_STRING ("open from "),
-                         (STRINGP (host) ? host : SCOPED_STRING ("-")),
-                         SCOPED_STRING ("\n")));
+  AUTO_STRING (open_from, "open from ");
+  exec_sentinel (proc, concat3 (open_from, host_string, nl));
 }
 
 /* This variable is different from waiting_for_input in keyboard.c.

=== modified file 'src/textprop.c'
--- a/src/textprop.c    2014-09-29 06:44:31 +0000
+++ b/src/textprop.c    2014-10-01 03:28:16 +0000
@@ -1320,7 +1320,8 @@
   (Lisp_Object start, Lisp_Object end, Lisp_Object property,
    Lisp_Object value, Lisp_Object object)
 {
-  Fadd_text_properties (start, end, scoped_list2 (property, value), object);
+  AUTO_LIST2 (properties, property, value);
+  Fadd_text_properties (start, end, properties, object);
   return Qnil;
 }
 
@@ -1361,7 +1362,8 @@
   (Lisp_Object start, Lisp_Object end, Lisp_Object face,
    Lisp_Object append, Lisp_Object object)
 {
-  add_text_properties_1 (start, end, scoped_list2 (Qface, face), object,
+  AUTO_LIST2 (properties, Qface, face);
+  add_text_properties_1 (start, end, properties, object,
                         (NILP (append)
                          ? TEXT_PROPERTY_PREPEND
                          : TEXT_PROPERTY_APPEND));

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-09-30 23:19:31 +0000
+++ b/src/xdisp.c       2014-10-01 03:28:16 +0000
@@ -12070,7 +12070,7 @@
       (f, Fmake_string (make_number (size_needed), make_number (' ')));
   else
     {
-      Lisp_Object props = scoped_list4 (Qdisplay, Qnil, Qmenu_item, Qnil);
+      AUTO_LIST4 (props, Qdisplay, Qnil, Qmenu_item, Qnil);
       struct gcpro gcpro1;
       GCPRO1 (props);
       Fremove_text_properties (make_number (0), make_number (size),
@@ -12186,9 +12186,8 @@
         the start of this item's properties in the tool-bar items
         vector.  */
       image = Fcons (Qimage, plist);
-      Lisp_Object props
-       = scoped_list4 (Qdisplay, image, Qmenu_item,
-                       make_number (i * TOOL_BAR_ITEM_NSLOTS));
+      AUTO_LIST4 (props, Qdisplay, image, Qmenu_item,
+                 make_number (i * TOOL_BAR_ITEM_NSLOTS));
       struct gcpro gcpro1;
       GCPRO1 (props);
 
@@ -20966,7 +20965,8 @@
         the previous non-empty line.  */
       if (pos >= ZV && pos > BEGV)
        DEC_BOTH (pos, bytepos);
-      if (fast_looking_at (SCOPED_STRING ("[\f\t ]*\n"),
+      AUTO_STRING (trailing_white_space, "[\f\t ]*\n");
+      if (fast_looking_at (trailing_white_space,
                           pos, bytepos, ZV, ZV_BYTE, Qnil) > 0)
        {
          while ((c = FETCH_BYTE (bytepos)) == '\n'

=== modified file 'src/xfaces.c'
--- a/src/xfaces.c      2014-09-18 11:34:24 +0000
+++ b/src/xfaces.c      2014-10-01 03:28:16 +0000
@@ -3398,7 +3398,8 @@
          ASET (lface, LFACE_FONT_INDEX, font);
        }
       f->default_face_done_p = 0;
-      Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, font));
+      AUTO_FRAME_ARG (arg, Qfont, font);
+      Fmodify_frame_parameters (frame, arg);
     }
 }
 
@@ -3787,18 +3788,23 @@
              && newface->font)
            {
              Lisp_Object name = newface->font->props[FONT_NAME_INDEX];
-             Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, name));
+             AUTO_FRAME_ARG (arg, Qfont, name);
+             Fmodify_frame_parameters (frame, arg);
            }
 
          if (STRINGP (gvec[LFACE_FOREGROUND_INDEX]))
-           Fmodify_frame_parameters
-             (frame, FRAME_PARAMETER (Qforeground_color,
-                                      gvec[LFACE_FOREGROUND_INDEX]));
+           {
+             AUTO_FRAME_ARG (arg, Qforeground_color,
+                             gvec[LFACE_FOREGROUND_INDEX]);
+             Fmodify_frame_parameters (frame, arg);
+           }
 
          if (STRINGP (gvec[LFACE_BACKGROUND_INDEX]))
-           Fmodify_frame_parameters
-             (frame, FRAME_PARAMETER (Qbackground_color,
-                                      gvec[LFACE_BACKGROUND_INDEX]));
+           {
+             AUTO_FRAME_ARG (arg, Qbackground_color,
+                             gvec[LFACE_BACKGROUND_INDEX]);
+             Fmodify_frame_parameters (frame, arg);
+           }
        }
     }
 

=== modified file 'src/xfns.c'
--- a/src/xfns.c        2014-09-30 02:43:23 +0000
+++ b/src/xfns.c        2014-10-01 03:28:16 +0000
@@ -1569,11 +1569,14 @@
 
       /* See if an X resource for the scroll bar color has been
         specified.  */
-      tem = display_x_get_resource
-       (dpyinfo, SCOPED_STRING (foreground_p ? "foreground" : "background"),
-        empty_unibyte_string,
-        SCOPED_STRING ("verticalScrollBar"),
-        empty_unibyte_string);
+      AUTO_STRING (foreground, "foreground");
+      AUTO_STRING (background, "foreground");
+      AUTO_STRING (verticalScrollBar, "verticalScrollBar");
+      tem = (display_x_get_resource
+            (dpyinfo, foreground_p ? foreground : background,
+             empty_unibyte_string,
+             verticalScrollBar,
+             empty_unibyte_string));
       if (!STRINGP (tem))
        {
          /* If nothing has been specified, scroll bars will use a
@@ -1591,7 +1594,8 @@
 #endif /* not USE_TOOLKIT_SCROLL_BARS */
     }
 
-  x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem));
+  AUTO_FRAME_ARG (arg, prop, tem);
+  x_set_frame_parameters (f, arg);
   return tem;
 }
 
@@ -2843,7 +2847,8 @@
     {
       /* Remember the explicit font parameter, so we can re-apply it after
         we've applied the `default' face settings.  */
-      x_set_frame_parameters (f, FRAME_PARAMETER (Qfont_param, font_param));
+      AUTO_FRAME_ARG (arg, Qfont_param, font_param);
+      x_set_frame_parameters (f, arg);
     }
 
   /* This call will make X resources override any system font setting.  */
@@ -4272,9 +4277,10 @@
   Screen *screen = dpyinfo->screen;
 
   /* See if a visual is specified.  */
-  Lisp_Object value = display_x_get_resource
-    (dpyinfo, SCOPED_STRING ("visualClass"),
-     SCOPED_STRING ("VisualClass"), Qnil, Qnil);
+  AUTO_STRING (visualClass, "visualClass");
+  AUTO_STRING (VisualClass, "VisualClass");
+  Lisp_Object value = display_x_get_resource (dpyinfo, visualClass,
+                                             VisualClass, Qnil, Qnil);
 
   if (STRINGP (value))
     {
@@ -5033,7 +5039,10 @@
 
   /* Add `tooltip' frame parameter's default value. */
   if (NILP (Fframe_parameter (frame, Qtooltip)))
-    Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qtooltip, Qt));
+    {
+      AUTO_FRAME_ARG (arg, Qtooltip, Qt);
+      Fmodify_frame_parameters (frame, arg);
+    }
 
   /* FIXME - can this be done in a similar way to normal frames?
      http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */
@@ -5051,8 +5060,10 @@
       disptype = intern ("color");
 
     if (NILP (Fframe_parameter (frame, Qdisplay_type)))
-      Fmodify_frame_parameters
-       (frame, FRAME_PARAMETER (Qdisplay_type, disptype));
+      {
+       AUTO_FRAME_ARG (arg, Qdisplay_type, disptype);
+       Fmodify_frame_parameters (frame, arg);
+      }
   }
 
   /* Set up faces after all frame parameters are known.  This call
@@ -5071,7 +5082,10 @@
     call2 (Qface_set_after_frame_default, frame, Qnil);
 
     if (!EQ (bg, Fframe_parameter (frame, Qbackground_color)))
-      Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qbackground_color, 
bg));
+      {
+       AUTO_FRAME_ARG (arg, Qbackground_color, bg);
+       Fmodify_frame_parameters (frame, arg);
+      }
   }
 
   f->no_split = 1;

=== modified file 'src/xselect.c'
--- a/src/xselect.c     2014-09-30 02:43:23 +0000
+++ b/src/xselect.c     2014-10-01 03:28:16 +0000
@@ -2159,10 +2159,9 @@
 static Lisp_Object
 x_clipboard_manager_error_1 (Lisp_Object err)
 {
-  Fmessage (2, ((Lisp_Object [])
-    { SCOPED_STRING ("X clipboard manager error: %s\n\
-If the problem persists, set `x-select-enable-clipboard-manager' to nil."),
-      CAR (CDR (err)) }));
+  AUTO_STRING (format, "X clipboard manager error: %s\n\
+If the problem persists, set `x-select-enable-clipboard-manager' to nil.");
+  Fmessage (2, (Lisp_Object []) {format, CAR (CDR (err))});
   return Qnil;
 }
 
@@ -2229,9 +2228,8 @@
       local_frame = XCAR (XCDR (XCDR (XCDR (local_selection))));
       if (FRAME_LIVE_P (XFRAME (local_frame)))
        {
-         Fmessage (1, ((Lisp_Object [])
-           { SCOPED_STRING
-               ("Saving clipboard to X clipboard manager...") }));
+         AUTO_STRING (saving, "Saving clipboard to X clipboard manager...");
+         Fmessage (1, &saving);
          internal_condition_case_1 (x_clipboard_manager_save, local_frame,
                                     Qt, x_clipboard_manager_error_2);
        }

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2014-09-30 15:31:18 +0000
+++ b/src/xterm.c       2014-10-01 03:28:16 +0000
@@ -10935,10 +10935,11 @@
     {
       if (dpyinfo->visual->class == PseudoColor)
        {
-         Lisp_Object value;
-         value = display_x_get_resource
-           (dpyinfo, SCOPED_STRING ("privateColormap"),
-            SCOPED_STRING ("PrivateColormap"), Qnil, Qnil);
+         AUTO_STRING (privateColormap, "privateColormap");
+         AUTO_STRING (PrivateColormap, "PrivateColormap");
+         Lisp_Object value
+           = display_x_get_resource (dpyinfo, privateColormap,
+                                     PrivateColormap, Qnil, Qnil);
          if (STRINGP (value)
              && (!strcmp (SSDATA (value), "true")
                  || !strcmp (SSDATA (value), "on")))
@@ -11142,9 +11143,10 @@
   /* See if we should run in synchronous mode.  This is useful
      for debugging X code.  */
   {
-    Lisp_Object value = display_x_get_resource
-      (dpyinfo, SCOPED_STRING ("synchronous"),
-       SCOPED_STRING ("Synchronous"), Qnil, Qnil);
+    AUTO_STRING (synchronous, "synchronous");
+    AUTO_STRING (Synchronous, "Synchronous");
+    Lisp_Object value = display_x_get_resource (dpyinfo, synchronous,
+                                               Synchronous, Qnil, Qnil);
     if (STRINGP (value)
        && (!strcmp (SSDATA (value), "true")
            || !strcmp (SSDATA (value), "on")))
@@ -11152,9 +11154,10 @@
   }
 
   {
-    Lisp_Object value = display_x_get_resource
-      (dpyinfo, SCOPED_STRING ("useXIM"),
-       SCOPED_STRING ("UseXIM"), Qnil, Qnil);
+    AUTO_STRING (useXIM, "useXIM");
+    AUTO_STRING (UseXIM, "UseXIM");
+    Lisp_Object value = display_x_get_resource (dpyinfo, useXIM, UseXIM,
+                                               Qnil, Qnil);
 #ifdef USE_XIM
     if (STRINGP (value)
        && (!strcmp (SSDATA (value), "false")


reply via email to

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