summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2024-07-16 10:15:59 +0800
committerPo Lu <luangruo@yahoo.com>2024-07-16 10:15:59 +0800
commit06ce99b76a8e5823f003f4e0dee945d97d0271ea (patch)
tree567d917f1bfe3682b9f131cabdc7a4dc134fb625
parent0fc8d8836701f928a124ac13c32e6dae7f55ee37 (diff)
parent72c8e0df87b0776451f9065f3432a8ebecee974d (diff)
Merge remote-tracking branch 'savannah/master' into master-android-1
-rw-r--r--lisp/progmodes/project.el6
-rw-r--r--src/eval.c8
-rw-r--r--src/image.c25
3 files changed, 15 insertions, 24 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index b7c1698f50b..3d0f742c51d 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -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
diff --git a/src/eval.c b/src/eval.c
index 1e0628b4aa3..2161ab1e1ea 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -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)
diff --git a/src/image.c b/src/image.c
index 3d761bd48be..90e6312e128 100644
--- a/src/image.c
+++ b/src/image.c
@@ -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;
}