]> git.eshelyaron.com Git - emacs.git/commitdiff
Rename 'buffer-too-small' to 'memory-buffer-too-small'.
authorPhilipp Stephani <p.stephani2@gmail.com>
Tue, 25 Mar 2025 13:24:04 +0000 (14:24 +0100)
committerEshel Yaron <me@eshelyaron.com>
Tue, 25 Mar 2025 18:26:47 +0000 (19:26 +0100)
This clarifies that the error isn't talking about an editing buffer.

* src/emacs-module.c (module_memory_buffer_too_small): Rename from
'module_buffer_too_small'.
(module_copy_string_contents, module_extract_big_integer): Adapt
callers.
(syms_of_module): Rename symbol 'buffer-too-small' to
'memory-buffer-too-small'.

(cherry picked from commit 0b1102a70413dabba082d822c200b014464de667)

src/emacs-module.c

index 32b78b0d9782da3323adeb74b6568225ce4c3f7a..22590a23cb217324f631f6ea0599b00460e69802 100644 (file)
@@ -224,11 +224,11 @@ module_decode_utf_8 (const char *str, ptrdiff_t len)
   return s;
 }
 
-/* Signal an error of type `buffer-too-small'.  */
+/* Signal an error of type `memory-buffer-too-small'.  */
 static void
-module_buffer_too_small (ptrdiff_t actual, ptrdiff_t required)
+module_memory_buffer_too_small (ptrdiff_t actual, ptrdiff_t required)
 {
-  xsignal2 (Qbuffer_too_small, INT_TO_INTEGER (actual),
+  xsignal2 (Qmemory_buffer_too_small, INT_TO_INTEGER (actual),
            INT_TO_INTEGER (required));
 }
 
@@ -825,7 +825,7 @@ module_copy_string_contents (emacs_env *env, emacs_value value, char *buf,
     {
       ptrdiff_t actual = *len;
       *len = required_buf_size;
-      module_buffer_too_small (actual, required_buf_size);
+      module_memory_buffer_too_small (actual, required_buf_size);
     }
 
   *len = required_buf_size;
@@ -1113,7 +1113,7 @@ module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign,
         {
           ptrdiff_t actual = *count;
           *count = required;
-         module_buffer_too_small (actual, required);
+         module_memory_buffer_too_small (actual, required);
        }
       /* Set u = abs(x).  See https://stackoverflow.com/a/17313717. */
       if (0 < x)
@@ -1147,7 +1147,7 @@ module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign,
     {
       ptrdiff_t actual = *count;
       *count = required;
-      module_buffer_too_small (actual, required);
+      module_memory_buffer_too_small (actual, required);
     }
   size_t written;
   mpz_export (magnitude, &written, order, size, endian, nails, *x);
@@ -1773,10 +1773,10 @@ syms_of_module (void)
   Fput (Qinvalid_arity, Qerror_message,
         build_string ("Invalid function arity"));
 
-  DEFSYM (Qbuffer_too_small, "buffer-too-small");
-  Fput (Qbuffer_too_small, Qerror_conditions,
-       list2 (Qbuffer_too_small, Qerror));
-  Fput (Qbuffer_too_small, Qerror_message,
+  DEFSYM (Qmemory_buffer_too_small, "memory-buffer-too-small");
+  Fput (Qmemory_buffer_too_small, Qerror_conditions,
+       list2 (Qmemory_buffer_too_small, Qerror));
+  Fput (Qmemory_buffer_too_small, Qerror_message,
         build_unibyte_string ("Memory buffer too small"));
 
   DEFSYM (Qmodule_function_p, "module-function-p");