emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 87fbe1a 2/2: Use new q ‘format’ flag when fixing q


From: Paul Eggert
Subject: [Emacs-diffs] master 87fbe1a 2/2: Use new q ‘format’ flag when fixing quotes in C
Date: Wed, 19 Aug 2015 06:14:14 +0000

branch: master
commit 87fbe1a6cb6d212c69546bd10864288fcf034cc1
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Use new q ‘format’ flag when fixing quotes in C
    
    * src/image.c (image_size_error): New function.  All uses of
    image_error with "Invalid image size ..."  changed to use it.
    * src/image.c (image_size_error, xbm_load_image, xbm_load)
    (xpm_load, xpm_load_image, xpm_load, pbm_load, png_load_body)
    (jpeg_load_body, tiff_load, gif_load, imagemagick_load_image)
    (imagemagick_load, svg_load, svg_load_image, gs_load)
    (x_kill_gs_process):
    * src/lread.c (load_warn_old_style_backquotes):
    * src/xfaces.c (load_pixmap):
    * src/xselect.c (x_clipboard_manager_error_1):
    Use %qs, not uLSQM and uRSQM.
    * src/syntax.c (Finternal_describe_syntax_value):
    Prefer Fsubstitute_command_keys to Fformat, as this lets
    us use AUTO_STRING.
    * src/xdisp.c (vadd_to_log): Use AUTO_STRING on the format argument,
    as it's now guaranteed to be ASCII.
    * src/xselect.c (x_clipboard_manager_error_2):
    Avoid grave accent in low-level stderr diagnostic.
---
 src/image.c   |  158 ++++++++++++++++++++++++++-------------------------------
 src/lread.c   |    3 +-
 src/syntax.c  |    9 ++--
 src/xdisp.c   |   10 ++--
 src/xfaces.c  |    2 +-
 src/xselect.c |   13 ++---
 6 files changed, 91 insertions(+), 104 deletions(-)

diff --git a/src/image.c b/src/image.c
index 8f9b06c..63089a9 100644
--- a/src/image.c
+++ b/src/image.c
@@ -644,6 +644,11 @@ image_error (const char *format, ...)
   va_end (ap);
 }
 
+static void
+image_size_error (void)
+{
+  image_error ("Invalid image size (see %qs)", "max-image-size");
+}
 
 
 /***********************************************************************
@@ -2802,7 +2807,7 @@ xbm_read_bitmap_data (struct frame *f, unsigned char 
*contents, unsigned char *e
   if (!check_image_size (f, *width, *height))
     {
       if (!inhibit_image_error)
-       image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+       image_size_error ();
       goto failure;
     }
   else if (data == NULL)
@@ -2947,14 +2952,13 @@ xbm_load_image (struct frame *f, struct image *img, 
unsigned char *contents,
       if (img->pixmap == NO_PIXMAP)
        {
          x_clear_image (f, img);
-         image_error ("Unable to create X pixmap for "uLSQM"%s"uRSQM,
-                      img->spec);
+         image_error ("Unable to create X pixmap for %qs", img->spec);
        }
       else
        success_p = 1;
     }
   else
-    image_error ("Error loading XBM image "uLSQM"%s"uRSQM, img->spec);
+    image_error ("Error loading XBM image %qs", img->spec);
 
   return success_p;
 }
@@ -2992,7 +2996,7 @@ xbm_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_fd (file_name, &fd);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
+         image_error ("Cannot find image file %qs", file_name);
          return 0;
        }
 
@@ -3000,7 +3004,7 @@ xbm_load (struct frame *f, struct image *img)
       unsigned char *contents = slurp_file (fd, &size);
       if (contents == NULL)
        {
-         image_error ("Error loading XBM image "uLSQM"%s"uRSQM, file);
+         image_error ("Error loading XBM image %qs", file);
          return 0;
        }
 
@@ -3035,8 +3039,7 @@ xbm_load (struct frame *f, struct image *img)
          eassert (img->width > 0 && img->height > 0);
          if (!check_image_size (f, img->width, img->height))
            {
-             image_error ("Invalid image size (see "
-                          uLSQM"max-image-size"uRSQM")");
+             image_size_error ();
              return 0;
            }
        }
@@ -3113,8 +3116,7 @@ xbm_load (struct frame *f, struct image *img)
            success_p = 1;
          else
            {
-             image_error (("Unable to create pixmap for XBM image "
-                           uLSQM"%s"uRSQM),
+             image_error ("Unable to create pixmap for XBM image %qs",
                           img->spec);
              x_clear_image (f, img);
            }
@@ -3637,8 +3639,7 @@ xpm_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
-                      specified_file);
+         image_error ("Cannot find image file %qs", specified_file);
 #ifdef ALLOC_XPM_COLORS
          xpm_free_color_cache ();
 #endif
@@ -3670,7 +3671,7 @@ xpm_load (struct frame *f, struct image *img)
       Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (buffer))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, buffer);
+         image_error ("Invalid image data %qs", buffer);
 #ifdef ALLOC_XPM_COLORS
          xpm_free_color_cache ();
 #endif
@@ -4114,7 +4115,7 @@ xpm_load_image (struct frame *f,
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       goto failure;
     }
 
@@ -4301,7 +4302,7 @@ xpm_load (struct frame *f,
       Lisp_Object file = x_find_image_fd (file_name, &fd);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
+         image_error ("Cannot find image file %qs", file_name);
          return 0;
        }
 
@@ -4309,7 +4310,7 @@ xpm_load (struct frame *f,
       unsigned char *contents = slurp_file (fd, &size);
       if (contents == NULL)
        {
-         image_error ("Error loading XPM image "uLSQM"%s"uRSQM, file);
+         image_error ("Error loading XPM image %qs", file);
          return 0;
        }
 
@@ -4323,7 +4324,7 @@ xpm_load (struct frame *f,
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
+         image_error ("Invalid image data %qs", data);
          return 0;
        }
       success_p = xpm_load_image (f, img, SDATA (data),
@@ -5277,8 +5278,7 @@ pbm_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_fd (specified_file, &fd);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
-                      specified_file);
+         image_error ("Cannot find image file %qs", specified_file);
          return 0;
        }
 
@@ -5286,7 +5286,7 @@ pbm_load (struct frame *f, struct image *img)
       contents = slurp_file (fd, &size);
       if (contents == NULL)
        {
-         image_error ("Error reading "uLSQM"%s"uRSQM, file);
+         image_error ("Error reading %qs", file);
          return 0;
        }
 
@@ -5299,7 +5299,7 @@ pbm_load (struct frame *f, struct image *img)
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
+         image_error ("Invalid image data %qs", data);
          return 0;
        }
       p = SDATA (data);
@@ -5309,7 +5309,7 @@ pbm_load (struct frame *f, struct image *img)
   /* Check magic number.  */
   if (end - p < 2 || *p++ != 'P')
     {
-      image_error ("Not a PBM image: "uLSQM"%s"uRSQM, img->spec);
+      image_error ("Not a PBM image: %qs", img->spec);
     error:
       xfree (contents);
       img->pixmap = NO_PIXMAP;
@@ -5343,7 +5343,7 @@ pbm_load (struct frame *f, struct image *img)
       break;
 
     default:
-      image_error ("Not a PBM image: "uLSQM"%s"uRSQM, img->spec);
+      image_error ("Not a PBM image: %qs", img->spec);
       goto error;
     }
 
@@ -5369,7 +5369,7 @@ pbm_load (struct frame *f, struct image *img)
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       goto error;
     }
 
@@ -5442,8 +5442,7 @@ pbm_load (struct frame *f, struct image *img)
                        x_destroy_x_image (ximg);
 #endif
                        x_clear_image (f, img);
-                       image_error (("Invalid image size in image "
-                                     uLSQM"%s"uRSQM),
+                       image_error ("Invalid image size in image %qs",
                                     img->spec);
                        goto error;
                      }
@@ -5478,8 +5477,7 @@ pbm_load (struct frame *f, struct image *img)
          x_destroy_x_image (ximg);
 #endif
          x_clear_image (f, img);
-         image_error ("Invalid image size in image "uLSQM"%s"uRSQM,
-                      img->spec);
+         image_error ("Invalid image size in image %qs", img->spec);
          goto error;
        }
 
@@ -5522,8 +5520,7 @@ pbm_load (struct frame *f, struct image *img)
 #else
                x_destroy_x_image (ximg);
 #endif
-               image_error ("Invalid pixel value in image "uLSQM"%s"uRSQM,
-                            img->spec);
+               image_error ("Invalid pixel value in image %qs", img->spec);
                goto error;
              }
 
@@ -5919,8 +5916,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
       Lisp_Object file = x_find_image_fd (specified_file, &fd);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
-                      specified_file);
+         image_error ("Cannot find image file %qs", specified_file);
          return 0;
        }
 
@@ -5928,7 +5924,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
       fp = fdopen (fd, "rb");
       if (!fp)
        {
-         image_error ("Cannot open image file "uLSQM"%s"uRSQM, file);
+         image_error ("Cannot open image file %qs", file);
          return 0;
        }
 
@@ -5937,7 +5933,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
          || png_sig_cmp (sig, 0, sizeof sig))
        {
          fclose (fp);
-         image_error ("Not a PNG file: "uLSQM"%s"uRSQM, file);
+         image_error ("Not a PNG file: %qs", file);
          return 0;
        }
     }
@@ -5945,7 +5941,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
     {
       if (!STRINGP (specified_data))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
+         image_error ("Invalid image data %qs", specified_data);
          return 0;
        }
 
@@ -5958,7 +5954,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
       if (tbr.len < sizeof sig
          || png_sig_cmp (tbr.bytes, 0, sizeof sig))
        {
-         image_error ("Not a PNG image: "uLSQM"%s"uRSQM, img->spec);
+         image_error ("Not a PNG image: %qs", img->spec);
          return 0;
        }
 
@@ -6026,7 +6022,7 @@ png_load_body (struct frame *f, struct image *img, struct 
png_load_context *c)
   if (! (width <= INT_MAX && height <= INT_MAX
         && check_image_size (f, width, height)))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       goto error;
     }
 
@@ -6685,21 +6681,20 @@ jpeg_load_body (struct frame *f, struct image *img,
       Lisp_Object file = x_find_image_fd (specified_file, &fd);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
-                      specified_file);
+         image_error ("Cannot find image file %qs", specified_file);
          return 0;
        }
 
       fp = fdopen (fd, "rb");
       if (fp == NULL)
        {
-         image_error ("Cannot open "uLSQM"%s"uRSQM, file);
+         image_error ("Cannot open %qs", file);
          return 0;
        }
     }
   else if (!STRINGP (specified_data))
     {
-      image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
+      image_error ("Invalid image data %qs", specified_data);
       return 0;
     }
 
@@ -6715,14 +6710,13 @@ jpeg_load_body (struct frame *f, struct image *img,
          {
            char buf[JMSG_LENGTH_MAX];
            mgr->cinfo.err->format_message ((j_common_ptr) &mgr->cinfo, buf);
-           image_error ("Error reading JPEG image "uLSQM"%s"uRSQM": %s",
+           image_error ("Error reading JPEG image %qs: %s",
                         img->spec, build_string (buf));
            break;
          }
 
        case MY_JPEG_INVALID_IMAGE_SIZE:
-         image_error ("Invalid image size (see "
-                      uLSQM"max-image-size"uRSQM")");
+         image_size_error ();
          break;
 
        case MY_JPEG_CANNOT_CREATE_X:
@@ -7202,8 +7196,7 @@ tiff_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
-                      specified_file);
+         image_error ("Cannot find image file %qs", specified_file);
          return 0;
        }
 
@@ -7216,7 +7209,7 @@ tiff_load (struct frame *f, struct image *img)
       tiff = TIFFOpen (SSDATA (encoded_file), "r");
       if (tiff == NULL)
        {
-         image_error ("Cannot open "uLSQM"%s"uRSQM, file);
+         image_error ("Cannot open %qs", file);
          return 0;
        }
     }
@@ -7224,7 +7217,7 @@ tiff_load (struct frame *f, struct image *img)
     {
       if (!STRINGP (specified_data))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
+         image_error ("Invalid image data %qs", specified_data);
          return 0;
        }
 
@@ -7244,8 +7237,7 @@ tiff_load (struct frame *f, struct image *img)
 
       if (!tiff)
        {
-         image_error ("Cannot open memory source for "uLSQM"%s"uRSQM,
-                      img->spec);
+         image_error ("Cannot open memory source for %qs", img->spec);
          return 0;
        }
     }
@@ -7257,9 +7249,8 @@ tiff_load (struct frame *f, struct image *img)
       if (! (TYPE_MINIMUM (tdir_t) <= ino && ino <= TYPE_MAXIMUM (tdir_t)
             && TIFFSetDirectory (tiff, ino)))
        {
-         image_error
-           ("Invalid image number "uLSQM"%s"uRSQM" in image "uLSQM"%s"uRSQM,
-            image, img->spec);
+         image_error ("Invalid image number %qs in image %qs",
+                      image, img->spec);
          TIFFClose (tiff);
          return 0;
        }
@@ -7272,7 +7263,7 @@ tiff_load (struct frame *f, struct image *img)
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       TIFFClose (tiff);
       return 0;
     }
@@ -7302,7 +7293,7 @@ tiff_load (struct frame *f, struct image *img)
   TIFFClose (tiff);
   if (!rc)
     {
-      image_error ("Error reading TIFF image "uLSQM"%s"uRSQM, img->spec);
+      image_error ("Error reading TIFF image %qs", img->spec);
       xfree (buf);
       return 0;
     }
@@ -7638,8 +7629,7 @@ gif_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_file (specified_file);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM,
-                      specified_file);
+         image_error ("Cannot find image file %qs", specified_file);
          return 0;
        }
 
@@ -7653,14 +7643,14 @@ gif_load (struct frame *f, struct image *img)
       gif = DGifOpenFileName (SSDATA (encoded_file));
       if (gif == NULL)
        {
-         image_error ("Cannot open "uLSQM"%s"uRSQM, file);
+         image_error ("Cannot open %qs", file);
          return 0;
        }
 #else
       gif = DGifOpenFileName (SSDATA (encoded_file), &gif_err);
       if (gif == NULL)
        {
-         image_error ("Cannot open "uLSQM"%s"uRSQM": %s",
+         image_error ("Cannot open %qs: %s",
                       file, build_string (GifErrorString (gif_err)));
          return 0;
        }
@@ -7670,7 +7660,7 @@ gif_load (struct frame *f, struct image *img)
     {
       if (!STRINGP (specified_data))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, specified_data);
+         image_error ("Invalid image data %qs", specified_data);
          return 0;
        }
 
@@ -7684,14 +7674,14 @@ gif_load (struct frame *f, struct image *img)
       gif = DGifOpen (&memsrc, gif_read_from_memory);
       if (!gif)
        {
-         image_error ("Cannot open memory source "uLSQM"%s"uRSQM, img->spec);
+         image_error ("Cannot open memory source %qs", img->spec);
          return 0;
        }
 #else
       gif = DGifOpen (&memsrc, gif_read_from_memory, &gif_err);
       if (!gif)
        {
-         image_error ("Cannot open memory source "uLSQM"%s"uRSQM": %s",
+         image_error ("Cannot open memory source %qs: %s",
                       img->spec, build_string (GifErrorString (gif_err)));
          return 0;
        }
@@ -7701,7 +7691,7 @@ gif_load (struct frame *f, struct image *img)
   /* Before reading entire contents, check the declared image size. */
   if (!check_image_size (f, gif->SWidth, gif->SHeight))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       gif_close (gif, NULL);
       return 0;
     }
@@ -7710,7 +7700,7 @@ gif_load (struct frame *f, struct image *img)
   rc = DGifSlurp (gif);
   if (rc == GIF_ERROR || gif->ImageCount <= 0)
     {
-      image_error ("Error reading "uLSQM"%s"uRSQM, img->spec);
+      image_error ("Error reading %qs", img->spec);
       gif_close (gif, NULL);
       return 0;
     }
@@ -7721,9 +7711,8 @@ gif_load (struct frame *f, struct image *img)
     idx = INTEGERP (image_number) ? XFASTINT (image_number) : 0;
     if (idx < 0 || idx >= gif->ImageCount)
       {
-       image_error
-         ("Invalid image number "uLSQM"%s"uRSQM" in image "uLSQM"%s"uRSQM,
-          image_number, img->spec);
+       image_error ("Invalid image number %qs in image %qs",
+                    image_number, img->spec);
        gif_close (gif, NULL);
        return 0;
       }
@@ -7741,7 +7730,7 @@ gif_load (struct frame *f, struct image *img)
 
   if (!check_image_size (f, width, height))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       gif_close (gif, NULL);
       return 0;
     }
@@ -7995,10 +7984,10 @@ gif_load (struct frame *f, struct image *img)
       char *error_text = GifErrorString (gif_err);
 
       if (error_text)
-       image_error ("Error closing "uLSQM"%s"uRSQM": %s",
+       image_error ("Error closing %qs: %s",
                     img->spec, build_string (error_text));
 #else
-      image_error ("Error closing "uLSQM"%s"uRSQM, img->spec);
+      image_error ("Error closing %qs", img->spec);
 #endif
     }
 
@@ -8539,9 +8528,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
 
   if (ino < 0 || ino >= MagickGetNumberImages (image_wand))
     {
-      image_error
-       ("Invalid image number "uLSQM"%s"uRSQM" in image "uLSQM"%s"uRSQM,
-        image, img->spec);
+      image_error ("Invalid image number %qs in image %qs", image, img->spec);
       DestroyMagickWand (image_wand);
       return 0;
     }
@@ -8675,7 +8662,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
   if (! (image_width <= INT_MAX && image_height <= INT_MAX
         && check_image_size (f, image_width, image_height)))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       goto imagemagick_error;
     }
 
@@ -8810,7 +8797,7 @@ imagemagick_load_image (struct frame *f, struct image 
*img,
 
   MagickWandTerminus ();
   /* TODO more cleanup.  */
-  image_error ("Error parsing IMAGEMAGICK image "uLSQM"%s"uRSQM, img->spec);
+  image_error ("Error parsing IMAGEMAGICK image %qs", img->spec);
   return 0;
 }
 
@@ -8832,7 +8819,7 @@ imagemagick_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_file (file_name);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
+         image_error ("Cannot find image file %qs", file_name);
          return 0;
        }
       file = ENCODE_FILE (file);
@@ -8850,7 +8837,7 @@ imagemagick_load (struct frame *f, struct image *img)
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
+         image_error ("Invalid image data %qs", data);
          return 0;
        }
       success_p = imagemagick_load_image (f, img, SDATA (data),
@@ -9111,7 +9098,7 @@ svg_load (struct frame *f, struct image *img)
       Lisp_Object file = x_find_image_fd (file_name, &fd);
       if (!STRINGP (file))
        {
-         image_error ("Cannot find image file "uLSQM"%s"uRSQM, file_name);
+         image_error ("Cannot find image file %qs", file_name);
          return 0;
        }
 
@@ -9120,7 +9107,7 @@ svg_load (struct frame *f, struct image *img)
       unsigned char *contents = slurp_file (fd, &size);
       if (contents == NULL)
        {
-         image_error ("Error loading SVG image "uLSQM"%s"uRSQM, file);
+         image_error ("Error loading SVG image %qs", file);
          return 0;
        }
       /* If the file was slurped into memory properly, parse it.  */
@@ -9137,7 +9124,7 @@ svg_load (struct frame *f, struct image *img)
       data = image_spec_value (img->spec, QCdata, NULL);
       if (!STRINGP (data))
        {
-         image_error ("Invalid image data "uLSQM"%s"uRSQM, data);
+         image_error ("Invalid image data %qs", data);
          return 0;
        }
       original_filename = BVAR (current_buffer, filename);
@@ -9204,7 +9191,7 @@ svg_load_image (struct frame *f,         /* Pointer to 
emacs frame structure.  *
   rsvg_handle_get_dimensions (rsvg_handle, &dimension_data);
   if (! check_image_size (f, dimension_data.width, dimension_data.height))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       goto rsvg_error;
     }
 
@@ -9336,7 +9323,7 @@ svg_load_image (struct frame *f,         /* Pointer to 
emacs frame structure.  *
   g_object_unref (rsvg_handle);
   /* FIXME: Use error->message so the user knows what is the actual
      problem with the image.  */
-  image_error ("Error parsing SVG image "uLSQM"%s"uRSQM, img->spec);
+  image_error ("Error parsing SVG image %qs", img->spec);
   g_error_free (err);
   return 0;
 }
@@ -9489,7 +9476,7 @@ gs_load (struct frame *f, struct image *img)
   if (! (in_width <= INT_MAX && in_height <= INT_MAX
         && check_image_size (f, in_width, in_height)))
     {
-      image_error ("Invalid image size (see "uLSQM"max-image-size"uRSQM")");
+      image_size_error ();
       return 0;
     }
   img->width = in_width;
@@ -9510,7 +9497,7 @@ gs_load (struct frame *f, struct image *img)
 
   if (!img->pixmap)
     {
-      image_error ("Unable to create pixmap for "uLSQM"%s"uRSQM, img->spec);
+      image_error ("Unable to create pixmap for %qs" , img->spec);
       return 0;
     }
 
@@ -9622,8 +9609,7 @@ x_kill_gs_process (Pixmap pixmap, struct frame *f)
 #endif
        }
       else
-       image_error (("Cannot get X image of "uLSQM"%s"uRSQM";"
-                     " colors will not be freed"),
+       image_error ("Cannot get X image of %qs; colors will not be freed",
                     img->spec);
 
       unblock_input ();
diff --git a/src/lread.c b/src/lread.c
index 77a6211..c342218 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -947,8 +947,7 @@ load_warn_old_style_backquotes (Lisp_Object file)
 {
   if (!NILP (Vold_style_backquotes))
     {
-      Lisp_Object format = build_string ("Loading "uLSQM"%s"uRSQM
-                                        ": old-style backquotes detected!");
+      AUTO_STRING (format, "Loading %qs: old-style backquotes detected!");
       CALLN (Fmessage, format, file);
     }
 }
diff --git a/src/syntax.c b/src/syntax.c
index d543a5f..30560af 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1333,10 +1333,11 @@ DEFUN ("internal-describe-syntax-value", 
Finternal_describe_syntax_value,
     insert_string (" (nestable)");
 
   if (prefix)
-    insert1 (CALLN (Fformat,
-                   (build_string
-                    (",\n\t  is a prefix character for "
-                     uLSQM"backward-prefix-chars"uRSQM))));
+    {
+      AUTO_STRING (prefixdoc,
+                  ",\n\t  is a prefix character for `backward-prefix-chars'");
+      insert1 (Fsubstitute_command_keys (prefixdoc));
+    }
 
   return syntax;
 }
diff --git a/src/xdisp.c b/src/xdisp.c
index 88e6c8d..8be7497 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9826,16 +9826,18 @@ add_to_log (const char *format, ...)
 void
 vadd_to_log (char const *format, va_list ap)
 {
-  ptrdiff_t nargs = 1 + format_nargs (format);
+  ptrdiff_t form_nargs = format_nargs (format);
+  ptrdiff_t nargs = 1 + form_nargs;
   Lisp_Object args[10];
   eassert (nargs <= ARRAYELTS (args));
-  args[0] = build_string (format);
+  AUTO_STRING (args0, format);
+  args[0] = args0;
   for (ptrdiff_t i = 1; i <= nargs; i++)
     args[i] = va_arg (ap, Lisp_Object);
   Lisp_Object msg = Qnil;
   struct gcpro gcpro1, gcpro2;
-  GCPRO2 (args, msg);
-  gcpro1.nvars = nargs;
+  GCPRO2 (args[1], msg);
+  gcpro1.nvars = form_nargs;
   msg = Fformat (nargs, args);
 
   ptrdiff_t len = SBYTES (msg) + 1;
diff --git a/src/xfaces.c b/src/xfaces.c
index d519578..b599e6a 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -797,7 +797,7 @@ load_pixmap (struct frame *f, Lisp_Object name)
 
   if (bitmap_id < 0)
     {
-      add_to_log ("Invalid or undefined bitmap "uLSQM"%s"uRSQM, name);
+      add_to_log ("Invalid or undefined bitmap %qs", name);
       bitmap_id = 0;
     }
   else
diff --git a/src/xselect.c b/src/xselect.c
index b54ddd8..d4d4dc0 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -2147,11 +2147,10 @@ x_clipboard_manager_save (Lisp_Object frame)
 static Lisp_Object
 x_clipboard_manager_error_1 (Lisp_Object err)
 {
-  Lisp_Object format
-    = build_string ("X clipboard manager error: %s\n"
-                   "If the problem persists, set "
-                   uLSQM"x-select-enable-clipboard-manager"uRSQM" to nil.");
-  CALLN (Fmessage, format, CAR (CDR (err)));
+  AUTO_STRING (format, "X clipboard manager error: %s\n\
+If the problem persists, set %qs to nil.");
+  AUTO_STRING (varname, "x-select-enable-clipboard-manager");
+  CALLN (Fmessage, format, CAR (CDR (err)), varname);
   return Qnil;
 }
 
@@ -2161,8 +2160,8 @@ static Lisp_Object
 x_clipboard_manager_error_2 (Lisp_Object err)
 {
   fprintf (stderr, "Error saving to X clipboard manager.\n\
-If the problem persists, set `x-select-enable-clipboard-manager' \
-to nil.\n");
+If the problem persists, set '%s' \
+to nil.\n", "x-select-enable-clipboard-manager");
   return Qnil;
 }
 



reply via email to

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