Merge remote-tracking branch 'savannah/master' into master-android-1

This commit is contained in:
Po Lu 2024-07-16 10:15:59 +08:00
commit 06ce99b76a
3 changed files with 15 additions and 24 deletions

View file

@ -1715,7 +1715,7 @@ in `project-kill-buffer-conditions'."
bufs))
;;;###autoload
(defun project-kill-buffers (&optional no-confirm)
(defun project-kill-buffers (&optional no-confirm project)
"Kill the buffers belonging to the current project.
Two buffers belong to the same project if their project
instances, as reported by `project-current' in each buffer, are
@ -1725,9 +1725,11 @@ is non-nil, the command will not ask the user for confirmation.
NO-CONFIRM is always nil when the command is invoked
interactively.
If PROJECT is non-nil, kill buffers for that project instead.
Also see the `project-kill-buffers-display-buffer-list' variable."
(interactive)
(let* ((pr (project-current t))
(let* ((pr (or project (project-current t)))
(bufs (project--buffers-to-kill pr))
(query-user (lambda ()
(yes-or-no-p

View file

@ -1857,14 +1857,6 @@ signal_or_quit (Lisp_Object error_symbol, Lisp_Object data, bool continuable)
if (gc_in_progress || waiting_for_input)
emacs_abort ();
#if 0 /* rms: I don't know why this was here,
but it is surely wrong for an error that is handled. */
#ifdef HAVE_WINDOW_SYSTEM
if (display_hourglass_p)
cancel_hourglass ();
#endif
#endif
/* This hook is used by edebug. */
if (! NILP (Vsignal_hook_function)
&& !oom)

View file

@ -3525,8 +3525,9 @@ lookup_image (struct frame *f, Lisp_Object spec, int face_id)
img->face_font_size = font_size;
img->face_font_height = face->font->height;
img->face_font_width = face->font->average_width;
img->face_font_family = xmalloc (strlen (font_family) + 1);
strcpy (img->face_font_family, font_family);
size_t len = strlen (font_family) + 1;
img->face_font_family = xmalloc (len);
memcpy (img->face_font_family, font_family, len);
img->load_failed_p = ! img->type->load_img (f, img);
/* If we can't load the image, and we don't have a width and
@ -5544,15 +5545,13 @@ xpm_color_bucket (char *color_name)
static struct xpm_cached_color *
xpm_cache_color (struct frame *f, char *color_name, XColor *color, int bucket)
{
size_t nbytes;
struct xpm_cached_color *p;
if (bucket < 0)
bucket = xpm_color_bucket (color_name);
nbytes = FLEXSIZEOF (struct xpm_cached_color, name, strlen (color_name) + 1);
p = xmalloc (nbytes);
strcpy (p->name, color_name);
size_t len = strlen (color_name) + 1;
size_t nbytes = FLEXSIZEOF (struct xpm_cached_color, name, len);
struct xpm_cached_color *p = xmalloc (nbytes);
memcpy (p->name, color_name, len);
p->color = *color;
p->next = xpm_color_cache[bucket];
xpm_color_cache[bucket] = p;
@ -6249,9 +6248,7 @@ static const char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"};
static int
xpm_str_to_color_key (const char *s)
{
int i;
for (i = 0; i < ARRAYELTS (xpm_color_key_strings); i++)
for (int i = 0; i < ARRAYELTS (xpm_color_key_strings); i++)
if (strcmp (xpm_color_key_strings[i], s) == 0)
return i;
return -1;
@ -10869,13 +10866,13 @@ static struct animation_cache *animation_cache = NULL;
static struct animation_cache *
imagemagick_create_cache (char *signature)
{
size_t len = strlen (signature) + 1;
struct animation_cache *cache
= xmalloc (FLEXSIZEOF (struct animation_cache, signature,
strlen (signature) + 1));
= xmalloc (FLEXSIZEOF (struct animation_cache, signature, len));
cache->wand = 0;
cache->index = 0;
cache->next = 0;
strcpy (cache->signature, signature);
memcpy (cache->signature, signature, len);
return cache;
}