aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2012-09-12 22:22:29 +0200
committerJoakim Verona2012-09-12 22:22:29 +0200
commitaac9139d11cf7f9ee84d931ada85be8fa0c90f21 (patch)
treeac9777bdf84595af94ee0279cc53b67a5e6dfcaf /src
parent0cc36550df4f355a1b46e944fc65e533ff0df90e (diff)
parentbfeae2cf098dcf5bdb4af14d896e790cbe91d60f (diff)
downloademacs-aac9139d11cf7f9ee84d931ada85be8fa0c90f21.tar.gz
emacs-aac9139d11cf7f9ee84d931ada85be8fa0c90f21.zip
upstream
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog122
-rw-r--r--src/alloc.c63
-rw-r--r--src/bidi.c4
-rw-r--r--src/composite.h2
-rw-r--r--src/data.c10
-rw-r--r--src/eval.c15
-rw-r--r--src/fns.c2
-rw-r--r--src/image.c4
-rw-r--r--src/keyboard.c31
-rw-r--r--src/lisp.h21
-rw-r--r--src/nsterm.h2
-rw-r--r--src/nsterm.m8
-rw-r--r--src/process.c5
-rw-r--r--src/w32proc.c3
-rw-r--r--src/window.c10
-rw-r--r--src/window.h11
-rw-r--r--src/xdisp.c19
-rw-r--r--src/xfaces.c2
-rw-r--r--src/xgselect.c4
19 files changed, 247 insertions, 91 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 548c80b3b85..8b47c52c23f 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,125 @@
12012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
4 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
5 (syms_of_keyboard): Remove support for unread-command-char.
6
72012-09-12 Eli Zaretskii <eliz@gnu.org>
8
9 * w32proc.c (sys_kill): If PID is our process ID and the signal is
10 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
11 violation. (Bug#12426)
12
132012-09-12 Paul Eggert <eggert@cs.ucla.edu>
14
15 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
16
172012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
18
19 * eval.c: Add `inhibit-debugger'.
20 (Qinhibit_debugger): New symbol.
21 (call_debugger): Bind it instead of Qdebug_on_error.
22 (maybe_call_debugger): Test Vinhibit_debugger.
23 (syms_of_eval): Define inhibit-debugger.
24 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
25 (syms_of_xdisp): Remove inhibit-debug-on-message.
26
272012-09-11 Paul Eggert <eggert@cs.ucla.edu>
28
29 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
30 If a nonvolatile local variable is written before a _longjmp to
31 the frame containing the variable, and is read after the _longjmp,
32 the value read is indeterminate. Some local variables of type
33 'struct handler' and 'struct catchtag' are used in this way, so
34 mark each of their slots as volatile if the slot can be set before
35 _longjmp and read afterwards.
36 * lisp.h (struct handler): var and chosen_clause are now volatile.
37 (struct catchtag): val, next, and pdlcount are now volatile.
38
39 * bidi.c (bidi_push_it, bidi_pop_it):
40 * fns.c (copy_hash_table):
41 * image.c (define_image_type):
42 * keyboard.c (kbd_buffer_store_event_hold):
43 * process.c (Fprocess_send_eof):
44 * xfaces.c (x_create_gc) [HAVE_NS]:
45 * xgselect.c (xg_select):
46 Prefer assignment to memcpy when either will do.
47
48 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
49 Use pointer-to-a-pointer to simplify and avoid a NILP check each
50 time an item is removed. No need to mark this function 'inline';
51 the compiler knows better than we do.
52
532012-09-11 Jan Djärv <jan.h.d@swipnet.se>
54
55 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
56 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
57 to change_frame_size (Bug#12388).
58 (windowDidResize:): Pass YES to updateFrameSize.
59
60 * nsterm.h: Add delay parameter to updateFrameSize.
61
622012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
63
64 Discard killed buffers from deleted window and frame objects.
65 This reduces an amount of references to killed buffers and
66 helps GC to reclaim them faster.
67 * alloc.c (discard_killed_buffers): New function.
68 (mark_object): Use it for deleted windows and frames.
69 (mark_object): If symbol's value is set up for a killed buffer
70 or deleted frame, restore it's global binding.
71 * data.c (swap_in_global_binding): Add GC notice.
72 (swap_in_symval_forwarding): Use convenient set_blv_where.
73 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
74 * window.h: ... to here.
75
762012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
77
78 Convenient macro to check whether the buffer is live.
79 * buffer.h (BUFFER_LIVE_P): New macro.
80 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
81 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
82
832012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
84
85 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
86 composition cases (Bug#12364).
87
88 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
89 overhang of succeeding glyphs overlapping box cursor.
90
91 * w32term.c (x_draw_glyph_string): Likewise.
92
932012-09-11 Paul Eggert <eggert@cs.ucla.edu>
94
95 Simplify, document, and port floating-point (Bug#12381).
96 The porting part of this patch fixes bugs on non-IEEE platforms
97 with frexp, ldexp, logb.
98 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
99 Now static.
100 * floatfns.c: Simplify discussion of functions that Emacs doesn't
101 support, by removing commented-out code and briefly listing the
102 C89 functions excluded. The commented-out stuff was confusing
103 maintenance, e.g., we thought we needed cbrt but it was commented out.
104 (logb): Remove decl; no longer needed.
105 (isfinite): New macro, if not already supplied.
106 (isnan): Don't replace any existing macro.
107 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
108 are present on all C89 platforms.
109 (Ffrexp): Do not special-case zero, as frexp does the right thing
110 for that case.
111 (Flogb): Do not use logb, as it doesn't have the desired meaning
112 on hosts that use non-base-2 floating point. Instead, stick with
113 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
114 frexp, to avoid getting an unspecified result.
115
116 * xdisp.c (Qinhibit_debug_on_message): Now static.
117
1182012-09-10 Jan Djärv <jan.h.d@swipnet.se>
119
120 * nsterm.m (ns_update_begin): Set clip path to whole view by using
121 NSBezierPath (Bug#12131).
122
12012-09-10 Chong Yidong <cyd@gnu.org> 1232012-09-10 Chong Yidong <cyd@gnu.org>
2 124
3 * fns.c (Fdelq, Fdelete): Doc fix. 125 * fns.c (Fdelq, Fdelete): Doc fix.
diff --git a/src/alloc.c b/src/alloc.c
index 7bbc0abcd9a..61cb7086c25 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5865,6 +5865,28 @@ mark_buffer (struct buffer *buffer)
5865 mark_buffer (buffer->base_buffer); 5865 mark_buffer (buffer->base_buffer);
5866} 5866}
5867 5867
5868/* Remove killed buffers or items whose car is a killed buffer
5869 from LIST and return changed LIST. Called during GC. */
5870
5871static Lisp_Object
5872discard_killed_buffers (Lisp_Object list)
5873{
5874 Lisp_Object *prev = &list;
5875 Lisp_Object tail;
5876
5877 for (tail = list; CONSP (tail); tail = XCDR (tail))
5878 {
5879 Lisp_Object tem = XCAR (tail);
5880 if (CONSP (tem))
5881 tem = XCAR (tem);
5882 if (BUFFERP (tem) && !BUFFER_LIVE_P (XBUFFER (tem)))
5883 *prev = XCDR (tail);
5884 else
5885 prev = &XCDR_AS_LVALUE (tail);
5886 }
5887 return list;
5888}
5889
5868/* Determine type of generic Lisp_Object and mark it accordingly. */ 5890/* Determine type of generic Lisp_Object and mark it accordingly. */
5869 5891
5870void 5892void
@@ -6001,20 +6023,41 @@ mark_object (Lisp_Object arg)
6001 break; 6023 break;
6002 6024
6003 case PVEC_FRAME: 6025 case PVEC_FRAME:
6004 mark_vectorlike (ptr); 6026 {
6005 mark_face_cache (((struct frame *) ptr)->face_cache); 6027 struct frame *f = (struct frame *) ptr;
6028
6029 /* For live frames, killed buffers are filtered out by
6030 store_frame_param. For dead frames, we do it here in
6031 attempt to help GC to reclaim killed buffers faster. */
6032 if (!FRAME_LIVE_P (f))
6033 fset_buffer_list (f, discard_killed_buffers (f->buffer_list));
6034
6035 mark_vectorlike (ptr);
6036 mark_face_cache (f->face_cache);
6037 }
6006 break; 6038 break;
6007 6039
6008 case PVEC_WINDOW: 6040 case PVEC_WINDOW:
6009 { 6041 {
6010 struct window *w = (struct window *) ptr; 6042 struct window *w = (struct window *) ptr;
6043 bool leaf = NILP (w->hchild) && NILP (w->vchild);
6044
6045 /* For live windows, Lisp code filters out killed buffers
6046 from both buffer lists. For dead windows, we do it here
6047 in attempt to help GC to reclaim killed buffers faster. */
6048 if (leaf && NILP (w->buffer))
6049 {
6050 wset_prev_buffers
6051 (w, discard_killed_buffers (w->prev_buffers));
6052 wset_next_buffers
6053 (w, discard_killed_buffers (w->next_buffers));
6054 }
6011 6055
6012 mark_vectorlike (ptr); 6056 mark_vectorlike (ptr);
6013 /* Mark glyphs for leaf windows. Marking window 6057 /* Mark glyphs for leaf windows. Marking window
6014 matrices is sufficient because frame matrices 6058 matrices is sufficient because frame matrices
6015 use the same glyph memory. */ 6059 use the same glyph memory. */
6016 if (NILP (w->hchild) && NILP (w->vchild) 6060 if (leaf && w->current_matrix)
6017 && w->current_matrix)
6018 { 6061 {
6019 mark_glyph_matrix (w->current_matrix); 6062 mark_glyph_matrix (w->current_matrix);
6020 mark_glyph_matrix (w->desired_matrix); 6063 mark_glyph_matrix (w->desired_matrix);
@@ -6081,10 +6124,14 @@ mark_object (Lisp_Object arg)
6081 case SYMBOL_LOCALIZED: 6124 case SYMBOL_LOCALIZED:
6082 { 6125 {
6083 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr); 6126 struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (ptr);
6084 /* If the value is forwarded to a buffer or keyboard field, 6127 Lisp_Object where = blv->where;
6085 these are marked when we see the corresponding object. 6128 /* If the value is set up for a killed buffer or deleted
6086 And if it's forwarded to a C variable, either it's not 6129 frame, restore it's global binding. If the value is
6087 a Lisp_Object var, or it's staticpro'd already. */ 6130 forwarded to a C variable, either it's not a Lisp_Object
6131 var, or it's staticpro'd already. */
6132 if ((BUFFERP (where) && !BUFFER_LIVE_P (XBUFFER (where)))
6133 || (FRAMEP (where) && !FRAME_LIVE_P (XFRAME (where))))
6134 swap_in_global_binding (ptr);
6088 mark_object (blv->where); 6135 mark_object (blv->where);
6089 mark_object (blv->valcell); 6136 mark_object (blv->valcell);
6090 mark_object (blv->defcell); 6137 mark_object (blv->defcell);
diff --git a/src/bidi.c b/src/bidi.c
index 73fec3533a4..4186a46e19e 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -612,7 +612,7 @@ bidi_push_it (struct bidi_it *bidi_it)
612 /* Save the current iterator state in its entirety after the last 612 /* Save the current iterator state in its entirety after the last
613 used cache slot. */ 613 used cache slot. */
614 bidi_cache_ensure_space (bidi_cache_idx); 614 bidi_cache_ensure_space (bidi_cache_idx);
615 memcpy (&bidi_cache[bidi_cache_idx++], bidi_it, sizeof (struct bidi_it)); 615 bidi_cache[bidi_cache_idx++] = *bidi_it;
616 616
617 /* Push the current cache start onto the stack. */ 617 /* Push the current cache start onto the stack. */
618 eassert (bidi_cache_sp < IT_STACK_SIZE); 618 eassert (bidi_cache_sp < IT_STACK_SIZE);
@@ -636,7 +636,7 @@ bidi_pop_it (struct bidi_it *bidi_it)
636 bidi_cache_idx = bidi_cache_start - 1; 636 bidi_cache_idx = bidi_cache_start - 1;
637 637
638 /* Restore the bidi iterator state saved in the cache. */ 638 /* Restore the bidi iterator state saved in the cache. */
639 memcpy (bidi_it, &bidi_cache[bidi_cache_idx], sizeof (struct bidi_it)); 639 *bidi_it = bidi_cache[bidi_cache_idx];
640 640
641 /* Pop the previous cache start from the stack. */ 641 /* Pop the previous cache start from the stack. */
642 if (bidi_cache_sp <= 0) 642 if (bidi_cache_sp <= 0)
diff --git a/src/composite.h b/src/composite.h
index 68f5b27ee42..9462b932c66 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -113,7 +113,7 @@ extern Lisp_Object composition_temp;
113 && (end - start) == COMPOSITION_LENGTH (prop)) 113 && (end - start) == COMPOSITION_LENGTH (prop))
114 114
115/* Return the Nth glyph of composition specified by CMP. CMP is a 115/* Return the Nth glyph of composition specified by CMP. CMP is a
116 pointer to `struct composition'. */ 116 pointer to `struct composition'. */
117#define COMPOSITION_GLYPH(cmp, n) \ 117#define COMPOSITION_GLYPH(cmp, n) \
118 XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ 118 XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \
119 ->key_and_value) \ 119 ->key_and_value) \
diff --git a/src/data.c b/src/data.c
index 4678ac1208c..5d7f036b70d 100644
--- a/src/data.c
+++ b/src/data.c
@@ -948,8 +948,10 @@ store_symval_forwarding (union Lisp_Fwd *valcontents, register Lisp_Object newva
948 } 948 }
949} 949}
950 950
951/* Set up SYMBOL to refer to its global binding. 951/* Set up SYMBOL to refer to its global binding. This makes it safe
952 This makes it safe to alter the status of other bindings. */ 952 to alter the status of other bindings. BEWARE: this may be called
953 during the mark phase of GC, where we assume that Lisp_Object slots
954 of BLV are marked after this function has changed them. */
953 955
954void 956void
955swap_in_global_binding (struct Lisp_Symbol *symbol) 957swap_in_global_binding (struct Lisp_Symbol *symbol)
@@ -1008,7 +1010,7 @@ swap_in_symval_forwarding (struct Lisp_Symbol *symbol, struct Lisp_Buffer_Local_
1008 else 1010 else
1009 { 1011 {
1010 tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist)); 1012 tem1 = assq_no_quit (var, BVAR (current_buffer, local_var_alist));
1011 XSETBUFFER (blv->where, current_buffer); 1013 set_blv_where (blv, Fcurrent_buffer ());
1012 } 1014 }
1013 } 1015 }
1014 if (!(blv->found = !NILP (tem1))) 1016 if (!(blv->found = !NILP (tem1)))
@@ -1162,7 +1164,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where,
1162 the default binding is loaded, the loaded binding may be the 1164 the default binding is loaded, the loaded binding may be the
1163 wrong one. */ 1165 wrong one. */
1164 if (!EQ (blv->where, where) 1166 if (!EQ (blv->where, where)
1165 /* Also unload a global binding (if the var is local_if_set). */ 1167 /* Also unload a global binding (if the var is local_if_set). */
1166 || (EQ (blv->valcell, blv->defcell))) 1168 || (EQ (blv->valcell, blv->defcell)))
1167 { 1169 {
1168 /* The currently loaded binding is not necessarily valid. 1170 /* The currently loaded binding is not necessarily valid.
diff --git a/src/eval.c b/src/eval.c
index 4f0d6c69a51..8a8a507a1b6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -69,7 +69,7 @@ Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp;
69Lisp_Object Qinhibit_quit; 69Lisp_Object Qinhibit_quit;
70Lisp_Object Qand_rest; 70Lisp_Object Qand_rest;
71static Lisp_Object Qand_optional; 71static Lisp_Object Qand_optional;
72static Lisp_Object Qdebug_on_error; 72static Lisp_Object Qinhibit_debugger;
73static Lisp_Object Qdeclare; 73static Lisp_Object Qdeclare;
74Lisp_Object Qinternal_interpreter_environment, Qclosure; 74Lisp_Object Qinternal_interpreter_environment, Qclosure;
75 75
@@ -229,7 +229,7 @@ call_debugger (Lisp_Object arg)
229 specbind (intern ("debugger-may-continue"), 229 specbind (intern ("debugger-may-continue"),
230 debug_while_redisplaying ? Qnil : Qt); 230 debug_while_redisplaying ? Qnil : Qt);
231 specbind (Qinhibit_redisplay, Qnil); 231 specbind (Qinhibit_redisplay, Qnil);
232 specbind (Qdebug_on_error, Qnil); 232 specbind (Qinhibit_debugger, Qt);
233 233
234#if 0 /* Binding this prevents execution of Lisp code during 234#if 0 /* Binding this prevents execution of Lisp code during
235 redisplay, which necessarily leads to display problems. */ 235 redisplay, which necessarily leads to display problems. */
@@ -1725,6 +1725,7 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data)
1725 /* Don't try to run the debugger with interrupts blocked. 1725 /* Don't try to run the debugger with interrupts blocked.
1726 The editing loop would return anyway. */ 1726 The editing loop would return anyway. */
1727 ! INPUT_BLOCKED_P 1727 ! INPUT_BLOCKED_P
1728 && NILP (Vinhibit_debugger)
1728 /* Does user want to enter debugger for this kind of error? */ 1729 /* Does user want to enter debugger for this kind of error? */
1729 && (EQ (sig, Qquit) 1730 && (EQ (sig, Qquit)
1730 ? debug_on_quit 1731 ? debug_on_quit
@@ -3467,7 +3468,7 @@ before making `inhibit-quit' nil. */);
3467 3468
3468 DEFSYM (Qinhibit_quit, "inhibit-quit"); 3469 DEFSYM (Qinhibit_quit, "inhibit-quit");
3469 DEFSYM (Qautoload, "autoload"); 3470 DEFSYM (Qautoload, "autoload");
3470 DEFSYM (Qdebug_on_error, "debug-on-error"); 3471 DEFSYM (Qinhibit_debugger, "inhibit-debugger");
3471 DEFSYM (Qmacro, "macro"); 3472 DEFSYM (Qmacro, "macro");
3472 DEFSYM (Qdeclare, "declare"); 3473 DEFSYM (Qdeclare, "declare");
3473 3474
@@ -3482,6 +3483,12 @@ before making `inhibit-quit' nil. */);
3482 DEFSYM (Qclosure, "closure"); 3483 DEFSYM (Qclosure, "closure");
3483 DEFSYM (Qdebug, "debug"); 3484 DEFSYM (Qdebug, "debug");
3484 3485
3486 DEFVAR_LISP ("inhibit-debugger", Vinhibit_debugger,
3487 doc: /* Non-nil means never enter the debugger.
3488Normally set while the debugger is already active, to avoid recursive
3489invocations. */);
3490 Vinhibit_debugger = Qnil;
3491
3485 DEFVAR_LISP ("debug-on-error", Vdebug_on_error, 3492 DEFVAR_LISP ("debug-on-error", Vdebug_on_error,
3486 doc: /* Non-nil means enter debugger if an error is signaled. 3493 doc: /* Non-nil means enter debugger if an error is signaled.
3487Does not apply to errors handled by `condition-case' or those 3494Does not apply to errors handled by `condition-case' or those
@@ -3491,7 +3498,7 @@ if one of its condition symbols appears in the list.
3491When you evaluate an expression interactively, this variable 3498When you evaluate an expression interactively, this variable
3492is temporarily non-nil if `eval-expression-debug-on-error' is non-nil. 3499is temporarily non-nil if `eval-expression-debug-on-error' is non-nil.
3493The command `toggle-debug-on-error' toggles this. 3500The command `toggle-debug-on-error' toggles this.
3494See also the variable `debug-on-quit'. */); 3501See also the variable `debug-on-quit' and `inhibit-debugger'. */);
3495 Vdebug_on_error = Qnil; 3502 Vdebug_on_error = Qnil;
3496 3503
3497 DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, 3504 DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors,
diff --git a/src/fns.c b/src/fns.c
index 95450c5e911..91dc6639150 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3680,7 +3680,7 @@ copy_hash_table (struct Lisp_Hash_Table *h1)
3680 3680
3681 h2 = allocate_hash_table (); 3681 h2 = allocate_hash_table ();
3682 next = h2->header.next.vector; 3682 next = h2->header.next.vector;
3683 memcpy (h2, h1, sizeof *h2); 3683 *h2 = *h1;
3684 h2->header.next.vector = next; 3684 h2->header.next.vector = next;
3685 h2->key_and_value = Fcopy_sequence (h1->key_and_value); 3685 h2->key_and_value = Fcopy_sequence (h1->key_and_value);
3686 h2->hash = Fcopy_sequence (h1->hash); 3686 h2->hash = Fcopy_sequence (h1->hash);
diff --git a/src/image.c b/src/image.c
index 4ec6105d72d..cf01602050f 100644
--- a/src/image.c
+++ b/src/image.c
@@ -593,7 +593,7 @@ define_image_type (struct image_type *type, int loaded)
593 /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. 593 /* Make a copy of TYPE to avoid a bus error in a dumped Emacs.
594 The initialized data segment is read-only. */ 594 The initialized data segment is read-only. */
595 struct image_type *p = xmalloc (sizeof *p); 595 struct image_type *p = xmalloc (sizeof *p);
596 memcpy (p, type, sizeof *p); 596 *p = *type;
597 p->next = image_types; 597 p->next = image_types;
598 image_types = p; 598 image_types = p;
599 success = Qt; 599 success = Qt;
@@ -6181,7 +6181,7 @@ our_memory_skip_input_data (j_decompress_ptr cinfo, long int num_bytes)
6181 reading the image. */ 6181 reading the image. */
6182 6182
6183static void 6183static void
6184jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, unsigned int len) 6184jpeg_memory_src (j_decompress_ptr cinfo, JOCTET *data, ptrdiff_t len)
6185{ 6185{
6186 struct jpeg_source_mgr *src; 6186 struct jpeg_source_mgr *src;
6187 6187
diff --git a/src/keyboard.c b/src/keyboard.c
index 691a06d36cf..de48b53053b 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2369,15 +2369,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2369 goto reread_first; 2369 goto reread_first;
2370 } 2370 }
2371 2371
2372 if (unread_command_char != -1)
2373 {
2374 XSETINT (c, unread_command_char);
2375 unread_command_char = -1;
2376
2377 reread = 1;
2378 goto reread_first;
2379 }
2380
2381 if (CONSP (Vunread_command_events)) 2372 if (CONSP (Vunread_command_events))
2382 { 2373 {
2383 int was_disabled = 0; 2374 int was_disabled = 0;
@@ -2562,7 +2553,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2562 && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) 2553 && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event)
2563 /* Don't bring up a menu if we already have another event. */ 2554 /* Don't bring up a menu if we already have another event. */
2564 && NILP (Vunread_command_events) 2555 && NILP (Vunread_command_events)
2565 && unread_command_char < 0
2566 && !detect_input_pending_run_timers (0)) 2556 && !detect_input_pending_run_timers (0))
2567 { 2557 {
2568 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); 2558 c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
@@ -2698,8 +2688,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps,
2698 && !EQ (XCAR (prev_event), Qmenu_bar) 2688 && !EQ (XCAR (prev_event), Qmenu_bar)
2699 && !EQ (XCAR (prev_event), Qtool_bar) 2689 && !EQ (XCAR (prev_event), Qtool_bar)
2700 /* Don't bring up a menu if we already have another event. */ 2690 /* Don't bring up a menu if we already have another event. */
2701 && NILP (Vunread_command_events) 2691 && NILP (Vunread_command_events))
2702 && unread_command_char < 0)
2703 { 2692 {
2704 c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); 2693 c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu);
2705 2694
@@ -3605,7 +3594,7 @@ kbd_buffer_store_event_hold (register struct input_event *event,
3605 3594
3606 if (hold_quit) 3595 if (hold_quit)
3607 { 3596 {
3608 memcpy (hold_quit, event, sizeof (*event)); 3597 *hold_quit = *event;
3609 return; 3598 return;
3610 } 3599 }
3611 3600
@@ -4143,7 +4132,7 @@ kbd_buffer_get_event (KBOARD **kbp,
4143 *used_mouse_menu = 1; 4132 *used_mouse_menu = 1;
4144#endif 4133#endif
4145#ifdef HAVE_NS 4134#ifdef HAVE_NS
4146 /* certain system events are non-key events */ 4135 /* Certain system events are non-key events. */
4147 if (used_mouse_menu 4136 if (used_mouse_menu
4148 && event->kind == NS_NONKEY_EVENT) 4137 && event->kind == NS_NONKEY_EVENT)
4149 *used_mouse_menu = 1; 4138 *used_mouse_menu = 1;
@@ -4171,7 +4160,7 @@ kbd_buffer_get_event (KBOARD **kbp,
4171 so x remains nil. */ 4160 so x remains nil. */
4172 x = Qnil; 4161 x = Qnil;
4173 4162
4174 /* XXX Can f or mouse_position_hook be NULL here? */ 4163 /* XXX Can f or mouse_position_hook be NULL here? */
4175 if (f && FRAME_TERMINAL (f)->mouse_position_hook) 4164 if (f && FRAME_TERMINAL (f)->mouse_position_hook)
4176 (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, 4165 (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window,
4177 &part, &x, &y, &t); 4166 &part, &x, &y, &t);
@@ -10469,7 +10458,7 @@ clear_input_pending (void)
10469int 10458int
10470requeued_events_pending_p (void) 10459requeued_events_pending_p (void)
10471{ 10460{
10472 return (!NILP (Vunread_command_events) || unread_command_char != -1); 10461 return (!NILP (Vunread_command_events));
10473} 10462}
10474 10463
10475 10464
@@ -10479,7 +10468,7 @@ Actually, the value is nil only if we can be sure that no input is available;
10479if there is a doubt, the value is t. */) 10468if there is a doubt, the value is t. */)
10480 (void) 10469 (void)
10481{ 10470{
10482 if (!NILP (Vunread_command_events) || unread_command_char != -1 10471 if (!NILP (Vunread_command_events)
10483 || !NILP (Vunread_post_input_method_events) 10472 || !NILP (Vunread_post_input_method_events)
10484 || !NILP (Vunread_input_method_events)) 10473 || !NILP (Vunread_input_method_events))
10485 return (Qt); 10474 return (Qt);
@@ -10667,7 +10656,6 @@ Also end any kbd macro being defined. */)
10667 update_mode_lines++; 10656 update_mode_lines++;
10668 10657
10669 Vunread_command_events = Qnil; 10658 Vunread_command_events = Qnil;
10670 unread_command_char = -1;
10671 10659
10672 discard_tty_input (); 10660 discard_tty_input ();
10673 10661
@@ -11007,7 +10995,6 @@ quit_throw_to_read_char (int from_signal)
11007 input_pending = 0; 10995 input_pending = 0;
11008 10996
11009 Vunread_command_events = Qnil; 10997 Vunread_command_events = Qnil;
11010 unread_command_char = -1;
11011 10998
11012#if 0 /* Currently, sit_for is called from read_char without turning 10999#if 0 /* Currently, sit_for is called from read_char without turning
11013 off polling. And that can call set_waiting_for_input. 11000 off polling. And that can call set_waiting_for_input.
@@ -11394,12 +11381,11 @@ delete_kboard (KBOARD *kb)
11394void 11381void
11395init_keyboard (void) 11382init_keyboard (void)
11396{ 11383{
11397 /* This is correct before outermost invocation of the editor loop */ 11384 /* This is correct before outermost invocation of the editor loop. */
11398 command_loop_level = -1; 11385 command_loop_level = -1;
11399 immediate_quit = 0; 11386 immediate_quit = 0;
11400 quit_char = Ctl ('g'); 11387 quit_char = Ctl ('g');
11401 Vunread_command_events = Qnil; 11388 Vunread_command_events = Qnil;
11402 unread_command_char = -1;
11403 timer_idleness_start_time = invalid_emacs_time (); 11389 timer_idleness_start_time = invalid_emacs_time ();
11404 total_keys = 0; 11390 total_keys = 0;
11405 recent_keys_index = 0; 11391 recent_keys_index = 0;
@@ -11736,9 +11722,6 @@ as they will already have been added once as they were read for the first time.
11736An element of the form (t . EVENT) forces EVENT to be added to that list. */); 11722An element of the form (t . EVENT) forces EVENT to be added to that list. */);
11737 Vunread_command_events = Qnil; 11723 Vunread_command_events = Qnil;
11738 11724
11739 DEFVAR_INT ("unread-command-char", unread_command_char,
11740 doc: /* If not -1, an object to be read as next command input event. */);
11741
11742 DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events, 11725 DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events,
11743 doc: /* List of events to be processed as input by input methods. 11726 doc: /* List of events to be processed as input by input methods.
11744These events are processed before `unread-command-events' 11727These events are processed before `unread-command-events'
diff --git a/src/lisp.h b/src/lisp.h
index 0163a9bcdbc..41fa274a562 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2006,7 +2006,10 @@ extern ptrdiff_t specpdl_size;
2006 2006
2007#define SPECPDL_INDEX() (specpdl_ptr - specpdl) 2007#define SPECPDL_INDEX() (specpdl_ptr - specpdl)
2008 2008
2009/* Everything needed to describe an active condition case. */ 2009/* Everything needed to describe an active condition case.
2010
2011 Members are volatile if their values need to survive _longjmp when
2012 a 'struct handler' is a local variable. */
2010struct handler 2013struct handler
2011 { 2014 {
2012 /* The handler clauses and variable from the condition-case form. */ 2015 /* The handler clauses and variable from the condition-case form. */
@@ -2017,10 +2020,12 @@ struct handler
2017 error: handle all conditions, and errors can run the debugger 2020 error: handle all conditions, and errors can run the debugger
2018 or display a backtrace. */ 2021 or display a backtrace. */
2019 Lisp_Object handler; 2022 Lisp_Object handler;
2020 Lisp_Object var; 2023
2024 Lisp_Object volatile var;
2025
2021 /* Fsignal stores here the condition-case clause that applies, 2026 /* Fsignal stores here the condition-case clause that applies,
2022 and Fcondition_case thus knows which clause to run. */ 2027 and Fcondition_case thus knows which clause to run. */
2023 Lisp_Object chosen_clause; 2028 Lisp_Object volatile chosen_clause;
2024 2029
2025 /* Used to effect the longjump out to the handler. */ 2030 /* Used to effect the longjump out to the handler. */
2026 struct catchtag *tag; 2031 struct catchtag *tag;
@@ -2046,19 +2051,21 @@ struct handler
2046 of the catch form. 2051 of the catch form.
2047 2052
2048 All the other members are concerned with restoring the interpreter 2053 All the other members are concerned with restoring the interpreter
2049 state. */ 2054 state.
2050 2055
2056 Members are volatile if their values need to survive _longjmp when
2057 a 'struct catchtag' is a local variable. */
2051struct catchtag 2058struct catchtag
2052{ 2059{
2053 Lisp_Object tag; 2060 Lisp_Object tag;
2054 Lisp_Object val; 2061 Lisp_Object volatile val;
2055 struct catchtag *next; 2062 struct catchtag *volatile next;
2056 struct gcpro *gcpro; 2063 struct gcpro *gcpro;
2057 jmp_buf jmp; 2064 jmp_buf jmp;
2058 struct backtrace *backlist; 2065 struct backtrace *backlist;
2059 struct handler *handlerlist; 2066 struct handler *handlerlist;
2060 EMACS_INT lisp_eval_depth; 2067 EMACS_INT lisp_eval_depth;
2061 ptrdiff_t pdlcount; 2068 ptrdiff_t volatile pdlcount;
2062 int poll_suppress_count; 2069 int poll_suppress_count;
2063 int interrupt_input_blocked; 2070 int interrupt_input_blocked;
2064 struct byte_stack *byte_stack; 2071 struct byte_stack *byte_stack;
diff --git a/src/nsterm.h b/src/nsterm.h
index b1836692b2c..f3adab883a1 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -103,7 +103,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
103- (void) setWindowClosing: (BOOL)closing; 103- (void) setWindowClosing: (BOOL)closing;
104- (EmacsToolbar *) toolbar; 104- (EmacsToolbar *) toolbar;
105- (void) deleteWorkingText; 105- (void) deleteWorkingText;
106- (void) updateFrameSize; 106- (void) updateFrameSize: (BOOL) delay;
107 107
108#ifdef NS_IMPL_GNUSTEP 108#ifdef NS_IMPL_GNUSTEP
109/* Not declared, but useful. */ 109/* Not declared, but useful. */
diff --git a/src/nsterm.m b/src/nsterm.m
index 798c9758376..f9611fd1210 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -3727,7 +3727,7 @@ ns_judge_scroll_bars (struct frame *f)
3727 } 3727 }
3728 3728
3729 if (removed) 3729 if (removed)
3730 [eview updateFrameSize]; 3730 [eview updateFrameSize: NO];
3731} 3731}
3732 3732
3733 3733
@@ -5362,7 +5362,7 @@ not_in_argv (NSString *arg)
5362 return NO; 5362 return NO;
5363} 5363}
5364 5364
5365- (void) updateFrameSize 5365- (void) updateFrameSize: (BOOL) delay;
5366{ 5366{
5367 NSWindow *window = [self window]; 5367 NSWindow *window = [self window];
5368 NSRect wr = [window frame]; 5368 NSRect wr = [window frame];
@@ -5400,7 +5400,7 @@ not_in_argv (NSString *arg)
5400 NSView *view = FRAME_NS_VIEW (emacsframe); 5400 NSView *view = FRAME_NS_VIEW (emacsframe);
5401 FRAME_PIXEL_WIDTH (emacsframe) = neww; 5401 FRAME_PIXEL_WIDTH (emacsframe) = neww;
5402 FRAME_PIXEL_HEIGHT (emacsframe) = newh; 5402 FRAME_PIXEL_HEIGHT (emacsframe) = newh;
5403 change_frame_size (emacsframe, rows, cols, 0, 0, 1); 5403 change_frame_size (emacsframe, rows, cols, 0, delay, 0);
5404 SET_FRAME_GARBAGED (emacsframe); 5404 SET_FRAME_GARBAGED (emacsframe);
5405 cancel_mouse_face (emacsframe); 5405 cancel_mouse_face (emacsframe);
5406 [view setFrame: NSMakeRect (0, 0, neww, newh)]; 5406 [view setFrame: NSMakeRect (0, 0, neww, newh)];
@@ -5503,7 +5503,7 @@ not_in_argv (NSString *arg)
5503 x_set_window_size (emacsframe, 0, cols, rows); 5503 x_set_window_size (emacsframe, 0, cols, rows);
5504 else 5504 else
5505 { 5505 {
5506 [self updateFrameSize]; 5506 [self updateFrameSize: YES];
5507 } 5507 }
5508 } 5508 }
5509#endif 5509#endif
diff --git a/src/process.c b/src/process.c
index 0ae68567d6b..f80b5e80c76 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6367,9 +6367,8 @@ process has been transmitted to the serial port. */)
6367 if (!proc_encode_coding_system[new_outfd]) 6367 if (!proc_encode_coding_system[new_outfd])
6368 proc_encode_coding_system[new_outfd] 6368 proc_encode_coding_system[new_outfd]
6369 = xmalloc (sizeof (struct coding_system)); 6369 = xmalloc (sizeof (struct coding_system));
6370 memcpy (proc_encode_coding_system[new_outfd], 6370 *proc_encode_coding_system[new_outfd]
6371 proc_encode_coding_system[old_outfd], 6371 = *proc_encode_coding_system[old_outfd];
6372 sizeof (struct coding_system));
6373 memset (proc_encode_coding_system[old_outfd], 0, 6372 memset (proc_encode_coding_system[old_outfd], 0,
6374 sizeof (struct coding_system)); 6373 sizeof (struct coding_system));
6375 6374
diff --git a/src/w32proc.c b/src/w32proc.c
index b9239cbb99a..74427e76a4f 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -1429,6 +1429,9 @@ sys_kill (int pid, int sig)
1429 int need_to_free = 0; 1429 int need_to_free = 0;
1430 int rc = 0; 1430 int rc = 0;
1431 1431
1432 if (pid == getpid () && sig == SIGABRT)
1433 emacs_abort ();
1434
1432 /* Only handle signals that will result in the process dying */ 1435 /* Only handle signals that will result in the process dying */
1433 if (sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP) 1436 if (sig != SIGINT && sig != SIGKILL && sig != SIGQUIT && sig != SIGHUP)
1434 { 1437 {
diff --git a/src/window.c b/src/window.c
index 87429b51448..cf296a707e3 100644
--- a/src/window.c
+++ b/src/window.c
@@ -177,11 +177,6 @@ wset_new_total (struct window *w, Lisp_Object val)
177 w->new_total = val; 177 w->new_total = val;
178} 178}
179static inline void 179static inline void
180wset_next_buffers (struct window *w, Lisp_Object val)
181{
182 w->next_buffers = val;
183}
184static inline void
185wset_normal_cols (struct window *w, Lisp_Object val) 180wset_normal_cols (struct window *w, Lisp_Object val)
186{ 181{
187 w->normal_cols = val; 182 w->normal_cols = val;
@@ -202,11 +197,6 @@ wset_pointm (struct window *w, Lisp_Object val)
202 w->pointm = val; 197 w->pointm = val;
203} 198}
204static inline void 199static inline void
205wset_prev_buffers (struct window *w, Lisp_Object val)
206{
207 w->prev_buffers = val;
208}
209static inline void
210wset_right_fringe_width (struct window *w, Lisp_Object val) 200wset_right_fringe_width (struct window *w, Lisp_Object val)
211{ 201{
212 w->right_fringe_width = val; 202 w->right_fringe_width = val;
diff --git a/src/window.h b/src/window.h
index a70bc55bac5..62ae43a999d 100644
--- a/src/window.h
+++ b/src/window.h
@@ -414,7 +414,16 @@ wset_window_end_vpos (struct window *w, Lisp_Object val)
414{ 414{
415 w->window_end_vpos = val; 415 w->window_end_vpos = val;
416} 416}
417 417WINDOW_INLINE void
418wset_prev_buffers (struct window *w, Lisp_Object val)
419{
420 w->prev_buffers = val;
421}
422WINDOW_INLINE void
423wset_next_buffers (struct window *w, Lisp_Object val)
424{
425 w->next_buffers = val;
426}
418 427
419/* 1 if W is a minibuffer window. */ 428/* 1 if W is a minibuffer window. */
420 429
diff --git a/src/xdisp.c b/src/xdisp.c
index df402cd106e..3536e04fe8d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -366,7 +366,6 @@ static Lisp_Object Qslice;
366Lisp_Object Qcenter; 366Lisp_Object Qcenter;
367static Lisp_Object Qmargin, Qpointer; 367static Lisp_Object Qmargin, Qpointer;
368static Lisp_Object Qline_height; 368static Lisp_Object Qline_height;
369Lisp_Object Qinhibit_debug_on_message;
370 369
371/* These setters are used only in this file, so they can be private. */ 370/* These setters are used only in this file, so they can be private. */
372static inline void 371static inline void
@@ -10644,8 +10643,6 @@ static void
10644set_message (const char *s, Lisp_Object string, 10643set_message (const char *s, Lisp_Object string,
10645 ptrdiff_t nbytes, int multibyte_p) 10644 ptrdiff_t nbytes, int multibyte_p)
10646{ 10645{
10647 ptrdiff_t count = SPECPDL_INDEX ();
10648
10649 message_enable_multibyte 10646 message_enable_multibyte
10650 = ((s && multibyte_p) 10647 = ((s && multibyte_p)
10651 || (STRINGP (string) && STRING_MULTIBYTE (string))); 10648 || (STRINGP (string) && STRING_MULTIBYTE (string)));
@@ -10655,14 +10652,9 @@ set_message (const char *s, Lisp_Object string,
10655 message_buf_print = 0; 10652 message_buf_print = 0;
10656 help_echo_showing_p = 0; 10653 help_echo_showing_p = 0;
10657 10654
10658 if (NILP (Vinhibit_debug_on_message) && STRINGP (Vdebug_on_message) 10655 if (STRINGP (Vdebug_on_message)
10659 && fast_string_match (Vdebug_on_message, string) >= 0) 10656 && fast_string_match (Vdebug_on_message, string) >= 0)
10660 { 10657 call_debugger (list2 (Qerror, string));
10661 specbind (Qinhibit_debug_on_message, Qt);
10662 call_debugger (list2 (Qerror, string));
10663 }
10664
10665 unbind_to (count, Qnil);
10666} 10658}
10667 10659
10668 10660
@@ -12854,7 +12846,7 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row)
12854 return make_number (fringe_bitmap); 12846 return make_number (fringe_bitmap);
12855 } 12847 }
12856#endif 12848#endif
12857 return make_number (-1); /* Use default arrow bitmap */ 12849 return make_number (-1); /* Use default arrow bitmap. */
12858 } 12850 }
12859 return overlay_arrow_string_or_property (var); 12851 return overlay_arrow_string_or_property (var);
12860 } 12852 }
@@ -29566,11 +29558,6 @@ Its value should be an ASCII acronym string, `hex-code', `empty-box', or
29566 DEFVAR_LISP ("debug-on-message", Vdebug_on_message, 29558 DEFVAR_LISP ("debug-on-message", Vdebug_on_message,
29567 doc: /* If non-nil, debug if a message matching this regexp is displayed. */); 29559 doc: /* If non-nil, debug if a message matching this regexp is displayed. */);
29568 Vdebug_on_message = Qnil; 29560 Vdebug_on_message = Qnil;
29569
29570 DEFVAR_LISP ("inhibit-debug-on-message", Vinhibit_debug_on_message,
29571 doc: /* If non-nil, inhibit `debug-on-message' from entering the debugger. */);
29572 Vinhibit_debug_on_message = Qnil;
29573 DEFSYM(Qinhibit_debug_on_message, "inhibit-debug-on-message");
29574} 29561}
29575 29562
29576 29563
diff --git a/src/xfaces.c b/src/xfaces.c
index aee5158036f..c113c1a37b7 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -661,7 +661,7 @@ x_create_gc (struct frame *f,
661 XGCValues *xgcv) 661 XGCValues *xgcv)
662{ 662{
663 GC gc = xmalloc (sizeof *gc); 663 GC gc = xmalloc (sizeof *gc);
664 memcpy (gc, xgcv, sizeof (XGCValues)); 664 *gc = *xgcv;
665 return gc; 665 return gc;
666} 666}
667 667
diff --git a/src/xgselect.c b/src/xgselect.c
index 0c00d815820..5f4c7edfb79 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -49,9 +49,9 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
49 && g_main_context_pending (context = g_main_context_default ()))) 49 && g_main_context_pending (context = g_main_context_default ())))
50 return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask); 50 return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask);
51 51
52 if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); 52 if (rfds) all_rfds = *rfds;
53 else FD_ZERO (&all_rfds); 53 else FD_ZERO (&all_rfds);
54 if (wfds) memcpy (&all_wfds, wfds, sizeof (all_rfds)); 54 if (wfds) all_wfds = *wfds;
55 else FD_ZERO (&all_wfds); 55 else FD_ZERO (&all_wfds);
56 56
57 n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec, 57 n_gfds = g_main_context_query (context, G_PRIORITY_LOW, &tmo_in_millisec,