aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2007-10-19 00:00:21 +0000
committerMiles Bader2007-10-19 00:00:21 +0000
commit9c8020a8df03dc67a56d7df15664dcf7ace54bf0 (patch)
tree09b0646addff3c39f9e96ba89c04bdcc038a87a7 /src
parentdfc3268dfa133a2e0a677f1af7c1ee548eae065d (diff)
parentbd3164743080f3eb5fc316aca7cc5322ca58fe33 (diff)
downloademacs-9c8020a8df03dc67a56d7df15664dcf7ace54bf0.tar.gz
emacs-9c8020a8df03dc67a56d7df15664dcf7ace54bf0.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 890-898) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 122-128) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 257-258) - Merge from emacs--rel--22 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-270
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog105
-rw-r--r--src/alloc.c25
-rw-r--r--src/buffer.c27
-rw-r--r--src/coding.c12
-rw-r--r--src/config.in2
-rw-r--r--src/data.c99
-rw-r--r--src/dired.c7
-rw-r--r--src/doc.c10
-rw-r--r--src/eval.c13
-rw-r--r--src/fileio.c3
-rw-r--r--src/fns.c6
-rw-r--r--src/frame.c3
-rw-r--r--src/keyboard.c24
-rw-r--r--src/keymap.c18
-rw-r--r--src/lisp.h60
-rw-r--r--src/lread.c2
-rw-r--r--src/macfns.c4
-rw-r--r--src/macselect.c6
-rw-r--r--src/macterm.c4
-rw-r--r--src/minibuf.c8
-rw-r--r--src/print.c6
-rw-r--r--src/process.c32
-rw-r--r--src/textprop.c44
-rw-r--r--src/w32fns.c8
-rw-r--r--src/w32menu.c8
-rw-r--r--src/window.c14
-rw-r--r--src/xdisp.c32
-rw-r--r--src/xfns.c4
-rw-r--r--src/xselect.c6
29 files changed, 371 insertions, 221 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4ba46df0f23..c50b6286407 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,103 @@
12007-10-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * keyboard.c (read_key_sequence): Undo a change introduced by multi-tty
4 which caused key-translation-map to applied repeatedly (thus breaking
5 double-mode).
6
72007-10-17 Stefan Monnier <monnier@iro.umontreal.ca>
8
9 * xselect.c (x_own_selection, x_handle_selection_clear)
10 (x_clear_frame_selections):
11 * w32menu.c (list_of_panes, list_of_items):
12 * w32fns.c (w32_color_map_lookup, Fx_create_frame, Fx_display_list):
13 * textprop.c (validate_plist, interval_has_all_properties)
14 (interval_has_some_properties, interval_has_some_properties_list)
15 (add_properties, text_property_list):
16 * process.c (Fget_buffer_process, list_processes_1, status_notify):
17 * minibuf.c (Fassoc_string):
18 * macselect.c (x_own_selection, x_clear_frame_selections)
19 (Fx_disown_selection_internal):
20 * keymap.c (Fcommand_remapping, where_is_internal, describe_map_tree):
21 Use CONSP rather than !NILP and XC[AD]R rather than Fc[ad]r.
22
232007-10-17 Chong Yidong <cyd@stupidchicken.com>
24
25 * process.c: Link to libs for calling res_init() if available.
26 (Fmake_network_process): Call res_init() before getaddrinfo or
27 gethostbyname, if possible.
28
292007-10-17 Stefan Monnier <monnier@iro.umontreal.ca>
30
31 * lread.c (read1): Set pvectype for char_tables.
32
33 * lisp.h (XMISCANY, XMARKER, XINTFWD, XBOOLFWD, XOBJFWD, XOVERLAY)
34 (XBUFFER_OBJFWD, XBUFFER_LOCAL_VALUE, XKBOARD_OBJFWD, XSAVE_VALUE):
35 Add type checks.
36 (SOME_BUFFER_LOCAL_VALUEP, GC_SOME_BUFFER_LOCAL_VALUEP): Remove.
37
38 * alloc.c (free_misc): Use XMISCTYPE.
39 (live_misc_p, gc_sweep): Use Lisp_Misc_Any.
40
412007-10-17 Glenn Morris <rgm@gnu.org>
42
43 * minibuf.c (Qcompletion_ignore_case): New Lisp_Object.
44 (syms_of_minibuf): Add Qcompletion_ignore_case.
45 * dired.c (Qcompletion_ignore_case): Change to external.
46 (syms_of_dired) [VMS]: Remove Qcompletion_ignore_case.
47 * fileio.c (Qcompletion_ignore_case): New external Lisp_Object.
48 (Fread_file_name): Use it rather than intern'ing.
49
50 * coding.c (Qcompletion_ignore_case): New external Lisp_Object.
51 (Fread_coding_system): Ignore case of user input.
52
532007-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
54
55 * xdisp.c (handle_display_prop): Ignore display specs after
56 replacing one when string text is being replaced.
57 (handle_single_display_spec): Pretend as if characters with display
58 property haven't been consumed only when buffer text is being replaced.
59
602007-10-16 Stefan Monnier <monnier@iro.umontreal.ca>
61
62 * xfns.c (Fx_create_frame, Fx_display_list):
63 * window.c (window_fixed_size_p, enlarge_window)
64 (shrink_window_lowest_first):
65 * macterm.c (init_font_name_table):
66 * macfns.c (Fx_create_frame, Fx_display_list):
67 * lread.c (close_load_descs):
68 * keyboard.c (read_char_x_menu_prompt):
69 * fns.c (Fmember, Fmemql, Fdelete, Fset_char_table_parent):
70 * coding.c (code_convert_region_unwind): Test the type of an object
71 rather than just !NILP before extracting data from it.
72
73 * alloc.c (Fpurecopy): Set the pvec tag on pseudo vectors.
74
75 * lisp.h (enum Lisp_Misc_Type): Del Lisp_Misc_Some_Buffer_Local_Value.
76 (XMISCANY): New macro.
77 (XMISCTYPE): Use it.
78 (struct Lisp_Misc_Any): New type.
79 (union Lisp_Misc): Use it.
80 (struct Lisp_Buffer_Local_Value): Add `local_if_set' bit.
81 * data.c (Fboundp, store_symval_forwarding, swap_in_global_binding)
82 (find_symbol_value, set_internal, default_value, Fset_default)
83 (Fmake_variable_buffer_local, Fmake_local_variable)
84 (Fkill_local_variable, Fmake_variable_frame_local, Flocal_variable_p)
85 (Flocal_variable_if_set_p, Fvariable_binding_locus):
86 The SOME_BUFFER_LOCAL_VALUEP distinction is replaced by local_if_set.
87 * alloc.c (allocate_buffer): Set the size and tag.
88 (allocate_misc, mark_maybe_object, mark_object, survives_gc_p):
89 Use XMISCANY.
90 (die): Follow the GNU convention for error messages.
91 * print.c (print_object): SOME_BUFFER_LOCAL_VALUEP -> local_if_set.
92 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): Don't set the
93 tag any more.
94 (set_buffer_internal_1):
95 * frame.c (store_frame_param):
96 * eval.c (specbind):
97 * xdisp.c (select_frame_for_redisplay): Drop SOME_BUFFER_LOCAL_VALUEP.
98
99 * doc.c (Fsnarf_documentation): Simplify.
100
12007-10-14 Juanma Barranquero <lekktu@gmail.com> 1012007-10-14 Juanma Barranquero <lekktu@gmail.com>
2 102
3 * w32term.c (w32_font_is_double_byte, my_create_scrollbar): Make static. 103 * w32term.c (w32_font_is_double_byte, my_create_scrollbar): Make static.
@@ -68,6 +168,11 @@
68 168
69 * puresize.h (BASE_PURESIZE): Increase to 1170000. 169 * puresize.h (BASE_PURESIZE): Increase to 1170000.
70 170
1712007-10-09 Richard Stallman <rms@gnu.org>
172
173 * xdisp.c (handle_invisible_prop): After setting up an ellipsis,
174 return HANDLED_RETURN.
175
712007-10-08 Martin Rudalics <rudalics@gmx.at> 1762007-10-08 Martin Rudalics <rudalics@gmx.at>
72 177
73 * keyboard.c (kbd_buffer_get_event): Break loop waiting for input 178 * keyboard.c (kbd_buffer_get_event): Break loop waiting for input
diff --git a/src/alloc.c b/src/alloc.c
index ed003af3ea8..295da59d026 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1153,6 +1153,8 @@ allocate_buffer ()
1153 struct buffer *b 1153 struct buffer *b
1154 = (struct buffer *) lisp_malloc (sizeof (struct buffer), 1154 = (struct buffer *) lisp_malloc (sizeof (struct buffer),
1155 MEM_TYPE_BUFFER); 1155 MEM_TYPE_BUFFER);
1156 b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
1157 XSETPVECTYPE (b, PVEC_BUFFER);
1156 return b; 1158 return b;
1157} 1159}
1158 1160
@@ -3307,7 +3309,7 @@ allocate_misc ()
3307 --total_free_markers; 3309 --total_free_markers;
3308 consing_since_gc += sizeof (union Lisp_Misc); 3310 consing_since_gc += sizeof (union Lisp_Misc);
3309 misc_objects_consed++; 3311 misc_objects_consed++;
3310 XMARKER (val)->gcmarkbit = 0; 3312 XMISCANY (val)->gcmarkbit = 0;
3311 return val; 3313 return val;
3312} 3314}
3313 3315
@@ -3317,7 +3319,7 @@ void
3317free_misc (misc) 3319free_misc (misc)
3318 Lisp_Object misc; 3320 Lisp_Object misc;
3319{ 3321{
3320 XMISC (misc)->u_marker.type = Lisp_Misc_Free; 3322 XMISCTYPE (misc) = Lisp_Misc_Free;
3321 XMISC (misc)->u_free.chain = marker_free_list; 3323 XMISC (misc)->u_free.chain = marker_free_list;
3322 marker_free_list = XMISC (misc); 3324 marker_free_list = XMISC (misc);
3323 3325
@@ -4033,7 +4035,7 @@ live_misc_p (m, p)
4033 && offset < (MARKER_BLOCK_SIZE * sizeof b->markers[0]) 4035 && offset < (MARKER_BLOCK_SIZE * sizeof b->markers[0])
4034 && (b != marker_block 4036 && (b != marker_block
4035 || offset / sizeof b->markers[0] < marker_block_index) 4037 || offset / sizeof b->markers[0] < marker_block_index)
4036 && ((union Lisp_Misc *) p)->u_marker.type != Lisp_Misc_Free); 4038 && ((union Lisp_Misc *) p)->u_any.type != Lisp_Misc_Free);
4037 } 4039 }
4038 else 4040 else
4039 return 0; 4041 return 0;
@@ -4164,7 +4166,7 @@ mark_maybe_object (obj)
4164 break; 4166 break;
4165 4167
4166 case Lisp_Misc: 4168 case Lisp_Misc:
4167 mark_p = (live_misc_p (m, po) && !XMARKER (obj)->gcmarkbit); 4169 mark_p = (live_misc_p (m, po) && !XMISCANY (obj)->gcmarkbit);
4168 break; 4170 break;
4169 4171
4170 case Lisp_Int: 4172 case Lisp_Int:
@@ -5613,14 +5615,13 @@ mark_object (arg)
5613 5615
5614 case Lisp_Misc: 5616 case Lisp_Misc:
5615 CHECK_ALLOCATED_AND_LIVE (live_misc_p); 5617 CHECK_ALLOCATED_AND_LIVE (live_misc_p);
5616 if (XMARKER (obj)->gcmarkbit) 5618 if (XMISCANY (obj)->gcmarkbit)
5617 break; 5619 break;
5618 XMARKER (obj)->gcmarkbit = 1; 5620 XMISCANY (obj)->gcmarkbit = 1;
5619 5621
5620 switch (XMISCTYPE (obj)) 5622 switch (XMISCTYPE (obj))
5621 { 5623 {
5622 case Lisp_Misc_Buffer_Local_Value: 5624 case Lisp_Misc_Buffer_Local_Value:
5623 case Lisp_Misc_Some_Buffer_Local_Value:
5624 { 5625 {
5625 register struct Lisp_Buffer_Local_Value *ptr 5626 register struct Lisp_Buffer_Local_Value *ptr
5626 = XBUFFER_LOCAL_VALUE (obj); 5627 = XBUFFER_LOCAL_VALUE (obj);
@@ -5806,7 +5807,7 @@ survives_gc_p (obj)
5806 break; 5807 break;
5807 5808
5808 case Lisp_Misc: 5809 case Lisp_Misc:
5809 survives_p = XMARKER (obj)->gcmarkbit; 5810 survives_p = XMISCANY (obj)->gcmarkbit;
5810 break; 5811 break;
5811 5812
5812 case Lisp_String: 5813 case Lisp_String:
@@ -6103,9 +6104,9 @@ gc_sweep ()
6103 6104
6104 for (i = 0; i < lim; i++) 6105 for (i = 0; i < lim; i++)
6105 { 6106 {
6106 if (!mblk->markers[i].u_marker.gcmarkbit) 6107 if (!mblk->markers[i].u_any.gcmarkbit)
6107 { 6108 {
6108 if (mblk->markers[i].u_marker.type == Lisp_Misc_Marker) 6109 if (mblk->markers[i].u_any.type == Lisp_Misc_Marker)
6109 unchain_marker (&mblk->markers[i].u_marker); 6110 unchain_marker (&mblk->markers[i].u_marker);
6110 /* Set the type of the freed object to Lisp_Misc_Free. 6111 /* Set the type of the freed object to Lisp_Misc_Free.
6111 We could leave the type alone, since nobody checks it, 6112 We could leave the type alone, since nobody checks it,
@@ -6118,7 +6119,7 @@ gc_sweep ()
6118 else 6119 else
6119 { 6120 {
6120 num_used++; 6121 num_used++;
6121 mblk->markers[i].u_marker.gcmarkbit = 0; 6122 mblk->markers[i].u_any.gcmarkbit = 0;
6122 } 6123 }
6123 } 6124 }
6124 lim = MARKER_BLOCK_SIZE; 6125 lim = MARKER_BLOCK_SIZE;
@@ -6256,7 +6257,7 @@ die (msg, file, line)
6256 const char *file; 6257 const char *file;
6257 int line; 6258 int line;
6258{ 6259{
6259 fprintf (stderr, "\r\nEmacs fatal error: %s:%d: %s\r\n", 6260 fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n",
6260 file, line, msg); 6261 file, line, msg);
6261 abort (); 6262 abort ();
6262} 6263}
diff --git a/src/buffer.c b/src/buffer.c
index d5f9541301d..416ff7e3702 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -362,8 +362,6 @@ The value is never nil. */)
362 362
363 b = (struct buffer *) allocate_buffer (); 363 b = (struct buffer *) allocate_buffer ();
364 364
365 b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
366
367 /* An ordinary buffer uses its own struct buffer_text. */ 365 /* An ordinary buffer uses its own struct buffer_text. */
368 b->text = &b->own_text; 366 b->text = &b->own_text;
369 b->base_buffer = 0; 367 b->base_buffer = 0;
@@ -417,10 +415,7 @@ The value is never nil. */)
417 STRING_SET_INTERVALS (name, NULL_INTERVAL); 415 STRING_SET_INTERVALS (name, NULL_INTERVAL);
418 b->name = name; 416 b->name = name;
419 417
420 if (SREF (name, 0) != ' ') 418 b->undo_list = (SREF (name, 0) != ' ') ? Qnil : Qt;
421 b->undo_list = Qnil;
422 else
423 b->undo_list = Qt;
424 419
425 reset_buffer (b); 420 reset_buffer (b);
426 reset_buffer_local_variables (b, 1); 421 reset_buffer_local_variables (b, 1);
@@ -430,7 +425,6 @@ The value is never nil. */)
430 b->name = name; 425 b->name = name;
431 426
432 /* Put this in the alist of all live buffers. */ 427 /* Put this in the alist of all live buffers. */
433 XSETPVECTYPE (b, PVEC_BUFFER);
434 XSETBUFFER (buf, b); 428 XSETBUFFER (buf, b);
435 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil)); 429 Vbuffer_alist = nconc2 (Vbuffer_alist, Fcons (Fcons (name, buf), Qnil));
436 430
@@ -568,13 +562,10 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
568 error ("Empty string for buffer name is not allowed"); 562 error ("Empty string for buffer name is not allowed");
569 563
570 b = (struct buffer *) allocate_buffer (); 564 b = (struct buffer *) allocate_buffer ();
571 b->size = sizeof (struct buffer) / sizeof (EMACS_INT);
572 XSETPVECTYPE (b, PVEC_BUFFER);
573 565
574 if (XBUFFER (base_buffer)->base_buffer) 566 b->base_buffer = (XBUFFER (base_buffer)->base_buffer
575 b->base_buffer = XBUFFER (base_buffer)->base_buffer; 567 ? XBUFFER (base_buffer)->base_buffer
576 else 568 : XBUFFER (base_buffer));
577 b->base_buffer = XBUFFER (base_buffer);
578 569
579 /* Use the base buffer's text object. */ 570 /* Use the base buffer's text object. */
580 b->text = b->base_buffer->text; 571 b->text = b->base_buffer->text;
@@ -1919,8 +1910,7 @@ set_buffer_internal_1 (b)
1919 for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail)) 1910 for (tail = b->local_var_alist; CONSP (tail); tail = XCDR (tail))
1920 { 1911 {
1921 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); 1912 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
1922 if ((BUFFER_LOCAL_VALUEP (valcontents) 1913 if ((BUFFER_LOCAL_VALUEP (valcontents))
1923 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1924 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, 1914 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
1925 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) 1915 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
1926 /* Just reference the variable 1916 /* Just reference the variable
@@ -1934,8 +1924,7 @@ set_buffer_internal_1 (b)
1934 for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) 1924 for (tail = old_buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
1935 { 1925 {
1936 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail))); 1926 valcontents = SYMBOL_VALUE (XCAR (XCAR (tail)));
1937 if ((BUFFER_LOCAL_VALUEP (valcontents) 1927 if ((BUFFER_LOCAL_VALUEP (valcontents))
1938 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1939 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue, 1928 && (tem = XBUFFER_LOCAL_VALUE (valcontents)->realvalue,
1940 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem)))) 1929 (BOOLFWDP (tem) || INTFWDP (tem) || OBJFWDP (tem))))
1941 /* Just reference the variable 1930 /* Just reference the variable
@@ -2509,7 +2498,7 @@ the normal hook `change-major-mode-hook'. */)
2509 /* Any which are supposed to be permanent, 2498 /* Any which are supposed to be permanent,
2510 make local again, with the same values they had. */ 2499 make local again, with the same values they had. */
2511 2500
2512 for (alist = oalist; !NILP (alist); alist = XCDR (alist)) 2501 for (alist = oalist; CONSP (alist); alist = XCDR (alist))
2513 { 2502 {
2514 sym = XCAR (XCAR (alist)); 2503 sym = XCAR (XCAR (alist));
2515 tem = Fget (sym, Qpermanent_local); 2504 tem = Fget (sym, Qpermanent_local);
@@ -2539,7 +2528,7 @@ swap_out_buffer_local_variables (b)
2539 XSETBUFFER (buffer, b); 2528 XSETBUFFER (buffer, b);
2540 oalist = b->local_var_alist; 2529 oalist = b->local_var_alist;
2541 2530
2542 for (alist = oalist; !NILP (alist); alist = XCDR (alist)) 2531 for (alist = oalist; CONSP (alist); alist = XCDR (alist))
2543 { 2532 {
2544 sym = XCAR (XCAR (alist)); 2533 sym = XCAR (XCAR (alist));
2545 2534
diff --git a/src/coding.c b/src/coding.c
index 2b518b903a4..c77aa338a1e 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -329,6 +329,8 @@ Lisp_Object Qtarget_idx;
329Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source; 329Lisp_Object Qinsufficient_source, Qinconsistent_eol, Qinvalid_source;
330Lisp_Object Qinterrupted, Qinsufficient_memory; 330Lisp_Object Qinterrupted, Qinsufficient_memory;
331 331
332extern Lisp_Object Qcompletion_ignore_case;
333
332/* If a symbol has this property, evaluate the value to define the 334/* If a symbol has this property, evaluate the value to define the
333 symbol as a coding system. */ 335 symbol as a coding system. */
334static Lisp_Object Qcoding_system_define_form; 336static Lisp_Object Qcoding_system_define_form;
@@ -7194,16 +7196,22 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system,
7194 7196
7195DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0, 7197DEFUN ("read-coding-system", Fread_coding_system, Sread_coding_system, 1, 2, 0,
7196 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT. 7198 doc: /* Read a coding system from the minibuffer, prompting with string PROMPT.
7197If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. */) 7199If the user enters null input, return second argument DEFAULT-CODING-SYSTEM.
7200Ignores case when completing coding systems (all Emacs coding systems
7201are lower-case). */)
7198 (prompt, default_coding_system) 7202 (prompt, default_coding_system)
7199 Lisp_Object prompt, default_coding_system; 7203 Lisp_Object prompt, default_coding_system;
7200{ 7204{
7201 Lisp_Object val; 7205 Lisp_Object val;
7206 int count = SPECPDL_INDEX ();
7207
7202 if (SYMBOLP (default_coding_system)) 7208 if (SYMBOLP (default_coding_system))
7203 XSETSTRING (default_coding_system, XPNTR (SYMBOL_NAME (default_coding_system))); 7209 default_coding_system = SYMBOL_NAME (default_coding_system);
7210 specbind (Qcompletion_ignore_case, Qt);
7204 val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, 7211 val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil,
7205 Qt, Qnil, Qcoding_system_history, 7212 Qt, Qnil, Qcoding_system_history,
7206 default_coding_system, Qnil); 7213 default_coding_system, Qnil);
7214 unbind_to (count, Qnil);
7207 return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil)); 7215 return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil));
7208} 7216}
7209 7217
diff --git a/src/config.in b/src/config.in
index 60be3c22003..c23ec13ac88 100644
--- a/src/config.in
+++ b/src/config.in
@@ -492,7 +492,7 @@ Boston, MA 02110-1301, USA. */
492/* Define to 1 if you have the `rename' function. */ 492/* Define to 1 if you have the `rename' function. */
493#undef HAVE_RENAME 493#undef HAVE_RENAME
494 494
495/* Define to 1 if you have the `res_init' function. */ 495/* Define to 1 if res_init is available. */
496#undef HAVE_RES_INIT 496#undef HAVE_RES_INIT
497 497
498/* Define to 1 if you have the `rindex' function. */ 498/* Define to 1 if you have the `rindex' function. */
diff --git a/src/data.c b/src/data.c
index 81cffcb38de..3139af1e001 100644
--- a/src/data.c
+++ b/src/data.c
@@ -584,8 +584,7 @@ DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
584 584
585 valcontents = SYMBOL_VALUE (symbol); 585 valcontents = SYMBOL_VALUE (symbol);
586 586
587 if (BUFFER_LOCAL_VALUEP (valcontents) 587 if (BUFFER_LOCAL_VALUEP (valcontents))
588 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
589 valcontents = swap_in_symval_forwarding (symbol, valcontents); 588 valcontents = swap_in_symval_forwarding (symbol, valcontents);
590 589
591 return (EQ (valcontents, Qunbound) ? Qnil : Qt); 590 return (EQ (valcontents, Qunbound) ? Qnil : Qt);
@@ -998,8 +997,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
998 default: 997 default:
999 def: 998 def:
1000 valcontents = SYMBOL_VALUE (symbol); 999 valcontents = SYMBOL_VALUE (symbol);
1001 if (BUFFER_LOCAL_VALUEP (valcontents) 1000 if (BUFFER_LOCAL_VALUEP (valcontents))
1002 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1003 XBUFFER_LOCAL_VALUE (valcontents)->realvalue = newval; 1001 XBUFFER_LOCAL_VALUE (valcontents)->realvalue = newval;
1004 else 1002 else
1005 SET_SYMBOL_VALUE (symbol, newval); 1003 SET_SYMBOL_VALUE (symbol, newval);
@@ -1016,8 +1014,7 @@ swap_in_global_binding (symbol)
1016 Lisp_Object valcontents, cdr; 1014 Lisp_Object valcontents, cdr;
1017 1015
1018 valcontents = SYMBOL_VALUE (symbol); 1016 valcontents = SYMBOL_VALUE (symbol);
1019 if (!BUFFER_LOCAL_VALUEP (valcontents) 1017 if (!BUFFER_LOCAL_VALUEP (valcontents))
1020 && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
1021 abort (); 1018 abort ();
1022 cdr = XBUFFER_LOCAL_VALUE (valcontents)->cdr; 1019 cdr = XBUFFER_LOCAL_VALUE (valcontents)->cdr;
1023 1020
@@ -1106,8 +1103,7 @@ find_symbol_value (symbol)
1106 CHECK_SYMBOL (symbol); 1103 CHECK_SYMBOL (symbol);
1107 valcontents = SYMBOL_VALUE (symbol); 1104 valcontents = SYMBOL_VALUE (symbol);
1108 1105
1109 if (BUFFER_LOCAL_VALUEP (valcontents) 1106 if (BUFFER_LOCAL_VALUEP (valcontents))
1110 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1111 valcontents = swap_in_symval_forwarding (symbol, valcontents); 1107 valcontents = swap_in_symval_forwarding (symbol, valcontents);
1112 1108
1113 if (MISCP (valcontents)) 1109 if (MISCP (valcontents))
@@ -1225,8 +1221,7 @@ set_internal (symbol, newval, buf, bindflag)
1225 && !let_shadows_buffer_binding_p (symbol)) 1221 && !let_shadows_buffer_binding_p (symbol))
1226 SET_PER_BUFFER_VALUE_P (buf, idx, 1); 1222 SET_PER_BUFFER_VALUE_P (buf, idx, 1);
1227 } 1223 }
1228 else if (BUFFER_LOCAL_VALUEP (valcontents) 1224 else if (BUFFER_LOCAL_VALUEP (valcontents))
1229 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1230 { 1225 {
1231 /* valcontents is a struct Lisp_Buffer_Local_Value. */ 1226 /* valcontents is a struct Lisp_Buffer_Local_Value. */
1232 if (XSYMBOL (symbol)->indirect_variable) 1227 if (XSYMBOL (symbol)->indirect_variable)
@@ -1271,7 +1266,7 @@ set_internal (symbol, newval, buf, bindflag)
1271 indicating that we're seeing the default value. 1266 indicating that we're seeing the default value.
1272 Likewise if the variable has been let-bound 1267 Likewise if the variable has been let-bound
1273 in the current buffer. */ 1268 in the current buffer. */
1274 if (bindflag || SOME_BUFFER_LOCAL_VALUEP (valcontents) 1269 if (bindflag || !XBUFFER_LOCAL_VALUE (valcontents)->local_if_set
1275 || let_shadows_buffer_binding_p (symbol)) 1270 || let_shadows_buffer_binding_p (symbol))
1276 { 1271 {
1277 XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0; 1272 XBUFFER_LOCAL_VALUE (valcontents)->found_for_buffer = 0;
@@ -1299,8 +1294,7 @@ set_internal (symbol, newval, buf, bindflag)
1299 } 1294 }
1300 1295
1301 /* Record which binding is now loaded. */ 1296 /* Record which binding is now loaded. */
1302 XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, 1297 XSETCAR (XBUFFER_LOCAL_VALUE (valcontents)->cdr, tem1);
1303 tem1);
1304 1298
1305 /* Set `buffer' and `frame' slots for the binding now loaded. */ 1299 /* Set `buffer' and `frame' slots for the binding now loaded. */
1306 XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf); 1300 XSETBUFFER (XBUFFER_LOCAL_VALUE (valcontents)->buffer, buf);
@@ -1319,8 +1313,7 @@ set_internal (symbol, newval, buf, bindflag)
1319 /* If we just set a variable whose current binding is frame-local, 1313 /* If we just set a variable whose current binding is frame-local,
1320 store the new value in the frame parameter too. */ 1314 store the new value in the frame parameter too. */
1321 1315
1322 if (BUFFER_LOCAL_VALUEP (valcontents) 1316 if (BUFFER_LOCAL_VALUEP (valcontents))
1323 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1324 { 1317 {
1325 /* What binding is loaded right now? */ 1318 /* What binding is loaded right now? */
1326 current_alist_element 1319 current_alist_element
@@ -1362,8 +1355,7 @@ default_value (symbol)
1362 } 1355 }
1363 1356
1364 /* Handle user-created local variables. */ 1357 /* Handle user-created local variables. */
1365 if (BUFFER_LOCAL_VALUEP (valcontents) 1358 if (BUFFER_LOCAL_VALUEP (valcontents))
1366 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1367 { 1359 {
1368 /* If var is set up for a buffer that lacks a local value for it, 1360 /* If var is set up for a buffer that lacks a local value for it,
1369 the current value is nominally the default value. 1361 the current value is nominally the default value.
@@ -1447,8 +1439,7 @@ for this variable. */)
1447 return value; 1439 return value;
1448 } 1440 }
1449 1441
1450 if (!BUFFER_LOCAL_VALUEP (valcontents) 1442 if (!BUFFER_LOCAL_VALUEP (valcontents))
1451 && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
1452 return Fset (symbol, value); 1443 return Fset (symbol, value);
1453 1444
1454 /* Store new value into the DEFAULT-VALUE slot. */ 1445 /* Store new value into the DEFAULT-VALUE slot. */
@@ -1533,27 +1524,28 @@ The function `default-value' gets the default value and `set-default' sets it.
1533 if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) 1524 if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents))
1534 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); 1525 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
1535 1526
1536 if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) 1527 if (BUFFER_OBJFWDP (valcontents))
1537 return variable; 1528 return variable;
1538 if (SOME_BUFFER_LOCAL_VALUEP (valcontents)) 1529 else if (BUFFER_LOCAL_VALUEP (valcontents))
1530 newval = valcontents;
1531 else
1539 { 1532 {
1540 XMISCTYPE (SYMBOL_VALUE (variable)) = Lisp_Misc_Buffer_Local_Value; 1533 if (EQ (valcontents, Qunbound))
1541 return variable; 1534 SET_SYMBOL_VALUE (variable, Qnil);
1535 tem = Fcons (Qnil, Fsymbol_value (variable));
1536 XSETCAR (tem, tem);
1537 newval = allocate_misc ();
1538 XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
1539 XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
1540 XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer ();
1541 XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
1542 XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
1543 XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
1544 XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
1545 XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
1546 SET_SYMBOL_VALUE (variable, newval);
1542 } 1547 }
1543 if (EQ (valcontents, Qunbound)) 1548 XBUFFER_LOCAL_VALUE (newval)->local_if_set = 1;
1544 SET_SYMBOL_VALUE (variable, Qnil);
1545 tem = Fcons (Qnil, Fsymbol_value (variable));
1546 XSETCAR (tem, tem);
1547 newval = allocate_misc ();
1548 XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
1549 XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
1550 XBUFFER_LOCAL_VALUE (newval)->buffer = Fcurrent_buffer ();
1551 XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
1552 XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
1553 XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
1554 XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
1555 XBUFFER_LOCAL_VALUE (newval)->cdr = tem;
1556 SET_SYMBOL_VALUE (variable, newval);
1557 return variable; 1549 return variable;
1558} 1550}
1559 1551
@@ -1589,7 +1581,9 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
1589 if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) 1581 if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents))
1590 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); 1582 error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable)));
1591 1583
1592 if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) 1584 if ((BUFFER_LOCAL_VALUEP (valcontents)
1585 && XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
1586 || BUFFER_OBJFWDP (valcontents))
1593 { 1587 {
1594 tem = Fboundp (variable); 1588 tem = Fboundp (variable);
1595 1589
@@ -1599,16 +1593,17 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */)
1599 return variable; 1593 return variable;
1600 } 1594 }
1601 /* Make sure symbol is set up to hold per-buffer values. */ 1595 /* Make sure symbol is set up to hold per-buffer values. */
1602 if (!SOME_BUFFER_LOCAL_VALUEP (valcontents)) 1596 if (!BUFFER_LOCAL_VALUEP (valcontents))
1603 { 1597 {
1604 Lisp_Object newval; 1598 Lisp_Object newval;
1605 tem = Fcons (Qnil, do_symval_forwarding (valcontents)); 1599 tem = Fcons (Qnil, do_symval_forwarding (valcontents));
1606 XSETCAR (tem, tem); 1600 XSETCAR (tem, tem);
1607 newval = allocate_misc (); 1601 newval = allocate_misc ();
1608 XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value; 1602 XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
1609 XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); 1603 XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
1610 XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; 1604 XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
1611 XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; 1605 XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
1606 XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
1612 XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; 1607 XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
1613 XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; 1608 XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
1614 XBUFFER_LOCAL_VALUE (newval)->check_frame = 0; 1609 XBUFFER_LOCAL_VALUE (newval)->check_frame = 0;
@@ -1681,8 +1676,7 @@ From now on the default value will apply in this buffer. Return VARIABLE. */)
1681 return variable; 1676 return variable;
1682 } 1677 }
1683 1678
1684 if (!BUFFER_LOCAL_VALUEP (valcontents) 1679 if (!BUFFER_LOCAL_VALUEP (valcontents))
1685 && !SOME_BUFFER_LOCAL_VALUEP (valcontents))
1686 return variable; 1680 return variable;
1687 1681
1688 /* Get rid of this buffer's alist element, if any. */ 1682 /* Get rid of this buffer's alist element, if any. */
@@ -1743,8 +1737,7 @@ Buffer-local bindings take precedence over frame-local bindings. */)
1743 || BUFFER_OBJFWDP (valcontents)) 1737 || BUFFER_OBJFWDP (valcontents))
1744 error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); 1738 error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable)));
1745 1739
1746 if (BUFFER_LOCAL_VALUEP (valcontents) 1740 if (BUFFER_LOCAL_VALUEP (valcontents))
1747 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1748 { 1741 {
1749 XBUFFER_LOCAL_VALUE (valcontents)->check_frame = 1; 1742 XBUFFER_LOCAL_VALUE (valcontents)->check_frame = 1;
1750 return variable; 1743 return variable;
@@ -1755,10 +1748,11 @@ Buffer-local bindings take precedence over frame-local bindings. */)
1755 tem = Fcons (Qnil, Fsymbol_value (variable)); 1748 tem = Fcons (Qnil, Fsymbol_value (variable));
1756 XSETCAR (tem, tem); 1749 XSETCAR (tem, tem);
1757 newval = allocate_misc (); 1750 newval = allocate_misc ();
1758 XMISCTYPE (newval) = Lisp_Misc_Some_Buffer_Local_Value; 1751 XMISCTYPE (newval) = Lisp_Misc_Buffer_Local_Value;
1759 XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable); 1752 XBUFFER_LOCAL_VALUE (newval)->realvalue = SYMBOL_VALUE (variable);
1760 XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil; 1753 XBUFFER_LOCAL_VALUE (newval)->buffer = Qnil;
1761 XBUFFER_LOCAL_VALUE (newval)->frame = Qnil; 1754 XBUFFER_LOCAL_VALUE (newval)->frame = Qnil;
1755 XBUFFER_LOCAL_VALUE (newval)->local_if_set = 0;
1762 XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0; 1756 XBUFFER_LOCAL_VALUE (newval)->found_for_buffer = 0;
1763 XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0; 1757 XBUFFER_LOCAL_VALUE (newval)->found_for_frame = 0;
1764 XBUFFER_LOCAL_VALUE (newval)->check_frame = 1; 1758 XBUFFER_LOCAL_VALUE (newval)->check_frame = 1;
@@ -1789,8 +1783,7 @@ BUFFER defaults to the current buffer. */)
1789 variable = indirect_variable (variable); 1783 variable = indirect_variable (variable);
1790 1784
1791 valcontents = SYMBOL_VALUE (variable); 1785 valcontents = SYMBOL_VALUE (variable);
1792 if (BUFFER_LOCAL_VALUEP (valcontents) 1786 if (BUFFER_LOCAL_VALUEP (valcontents))
1793 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
1794 { 1787 {
1795 Lisp_Object tail, elt; 1788 Lisp_Object tail, elt;
1796 1789
@@ -1838,15 +1831,14 @@ BUFFER defaults to the current buffer. */)
1838 1831
1839 valcontents = SYMBOL_VALUE (variable); 1832 valcontents = SYMBOL_VALUE (variable);
1840 1833
1841 /* This means that make-variable-buffer-local was done. */
1842 if (BUFFER_LOCAL_VALUEP (valcontents))
1843 return Qt;
1844 /* All these slots become local if they are set. */
1845 if (BUFFER_OBJFWDP (valcontents)) 1834 if (BUFFER_OBJFWDP (valcontents))
1835 /* All these slots become local if they are set. */
1846 return Qt; 1836 return Qt;
1847 if (SOME_BUFFER_LOCAL_VALUEP (valcontents)) 1837 else if (BUFFER_LOCAL_VALUEP (valcontents))
1848 { 1838 {
1849 Lisp_Object tail, elt; 1839 Lisp_Object tail, elt;
1840 if (XBUFFER_LOCAL_VALUE (valcontents)->local_if_set)
1841 return Qt;
1850 for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail)) 1842 for (tail = buf->local_var_alist; CONSP (tail); tail = XCDR (tail))
1851 { 1843 {
1852 elt = XCAR (tail); 1844 elt = XCAR (tail);
@@ -1877,14 +1869,13 @@ If the current binding is global (the default), the value is nil. */)
1877 valcontents = XSYMBOL (variable)->value; 1869 valcontents = XSYMBOL (variable)->value;
1878 1870
1879 if (BUFFER_LOCAL_VALUEP (valcontents) 1871 if (BUFFER_LOCAL_VALUEP (valcontents)
1880 || SOME_BUFFER_LOCAL_VALUEP (valcontents)
1881 || BUFFER_OBJFWDP (valcontents)) 1872 || BUFFER_OBJFWDP (valcontents))
1882 { 1873 {
1883 /* For a local variable, record both the symbol and which 1874 /* For a local variable, record both the symbol and which
1884 buffer's or frame's value we are saving. */ 1875 buffer's or frame's value we are saving. */
1885 if (!NILP (Flocal_variable_p (variable, Qnil))) 1876 if (!NILP (Flocal_variable_p (variable, Qnil)))
1886 return Fcurrent_buffer (); 1877 return Fcurrent_buffer ();
1887 else if (!BUFFER_OBJFWDP (valcontents) 1878 else if (BUFFER_LOCAL_VALUEP (valcontents)
1888 && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) 1879 && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
1889 return XBUFFER_LOCAL_VALUE (valcontents)->frame; 1880 return XBUFFER_LOCAL_VALUE (valcontents)->frame;
1890 } 1881 }
diff --git a/src/dired.c b/src/dired.c
index b362eec62b5..ccd27dbb713 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -116,10 +116,10 @@ extern void filemodestring P_ ((struct stat *, char *));
116#endif 116#endif
117 117
118extern int completion_ignore_case; 118extern int completion_ignore_case;
119extern Lisp_Object Qcompletion_ignore_case;
119extern Lisp_Object Vcompletion_regexp_list; 120extern Lisp_Object Vcompletion_regexp_list;
120 121
121Lisp_Object Vcompletion_ignored_extensions; 122Lisp_Object Vcompletion_ignored_extensions;
122Lisp_Object Qcompletion_ignore_case;
123Lisp_Object Qdirectory_files; 123Lisp_Object Qdirectory_files;
124Lisp_Object Qdirectory_files_and_attributes; 124Lisp_Object Qdirectory_files_and_attributes;
125Lisp_Object Qfile_name_completion; 125Lisp_Object Qfile_name_completion;
@@ -1078,11 +1078,6 @@ syms_of_dired ()
1078 defsubr (&Sfile_attributes); 1078 defsubr (&Sfile_attributes);
1079 defsubr (&Sfile_attributes_lessp); 1079 defsubr (&Sfile_attributes_lessp);
1080 1080
1081#ifdef VMS
1082 Qcompletion_ignore_case = intern ("completion-ignore-case");
1083 staticpro (&Qcompletion_ignore_case);
1084#endif /* VMS */
1085
1086 DEFVAR_LISP ("completion-ignored-extensions", &Vcompletion_ignored_extensions, 1081 DEFVAR_LISP ("completion-ignored-extensions", &Vcompletion_ignored_extensions,
1087 doc: /* Completion ignores file names ending in any string in this list. 1082 doc: /* Completion ignores file names ending in any string in this list.
1088It does not ignore them if all possible completions end in one of 1083It does not ignore them if all possible completions end in one of
diff --git a/src/doc.c b/src/doc.c
index 3b335127a75..f491661a616 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -693,15 +693,17 @@ the same file name is found in the `doc-directory'. */)
693 if (fromfile[len-1] == 'c') 693 if (fromfile[len-1] == 'c')
694 fromfile[len-1] = 'o'; 694 fromfile[len-1] = 'o';
695 695
696 if (EQ (Fmember (build_string (fromfile), Vbuild_files), Qnil)) 696 skip_file = NILP (Fmember (build_string (fromfile),
697 skip_file = 1; 697 Vbuild_files));
698 else
699 skip_file = 0;
700 } 698 }
701 699
702 sym = oblookup (Vobarray, p + 2, 700 sym = oblookup (Vobarray, p + 2,
703 multibyte_chars_in_text (p + 2, end - p - 2), 701 multibyte_chars_in_text (p + 2, end - p - 2),
704 end - p - 2); 702 end - p - 2);
703 /* Check skip_file so that when a function is defined several
704 times in different files (typically, once in xterm, once in
705 w32term, ...), we only pay attention to the one that
706 matters. */
705 if (! skip_file && SYMBOLP (sym)) 707 if (! skip_file && SYMBOLP (sym))
706 { 708 {
707 /* Attach a docstring to a variable? */ 709 /* Attach a docstring to a variable? */
diff --git a/src/eval.c b/src/eval.c
index b69eea44c75..eaa1a6855f6 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -468,7 +468,7 @@ usage: (prog1 FIRST BODY...) */)
468 struct gcpro gcpro1, gcpro2; 468 struct gcpro gcpro1, gcpro2;
469 register int argnum = 0; 469 register int argnum = 0;
470 470
471 if (NILP(args)) 471 if (NILP (args))
472 return Qnil; 472 return Qnil;
473 473
474 args_left = args; 474 args_left = args;
@@ -1043,10 +1043,10 @@ usage: (let VARLIST BODY...) */)
1043 GCPRO2 (args, *temps); 1043 GCPRO2 (args, *temps);
1044 gcpro2.nvars = 0; 1044 gcpro2.nvars = 0;
1045 1045
1046 for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) 1046 for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist))
1047 { 1047 {
1048 QUIT; 1048 QUIT;
1049 elt = Fcar (varlist); 1049 elt = XCAR (varlist);
1050 if (SYMBOLP (elt)) 1050 if (SYMBOLP (elt))
1051 temps [argnum++] = Qnil; 1051 temps [argnum++] = Qnil;
1052 else if (! NILP (Fcdr (Fcdr (elt)))) 1052 else if (! NILP (Fcdr (Fcdr (elt))))
@@ -1058,9 +1058,9 @@ usage: (let VARLIST BODY...) */)
1058 UNGCPRO; 1058 UNGCPRO;
1059 1059
1060 varlist = Fcar (args); 1060 varlist = Fcar (args);
1061 for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) 1061 for (argnum = 0; CONSP (varlist); varlist = XCDR (varlist))
1062 { 1062 {
1063 elt = Fcar (varlist); 1063 elt = XCAR (varlist);
1064 tem = temps[argnum++]; 1064 tem = temps[argnum++];
1065 if (SYMBOLP (elt)) 1065 if (SYMBOLP (elt))
1066 specbind (elt, tem); 1066 specbind (elt, tem);
@@ -3285,7 +3285,6 @@ specbind (symbol, value)
3285 valcontents = XSYMBOL (symbol)->value; 3285 valcontents = XSYMBOL (symbol)->value;
3286 3286
3287 if (BUFFER_LOCAL_VALUEP (valcontents) 3287 if (BUFFER_LOCAL_VALUEP (valcontents)
3288 || SOME_BUFFER_LOCAL_VALUEP (valcontents)
3289 || BUFFER_OBJFWDP (valcontents)) 3288 || BUFFER_OBJFWDP (valcontents))
3290 { 3289 {
3291 Lisp_Object where, current_buffer; 3290 Lisp_Object where, current_buffer;
@@ -3296,7 +3295,7 @@ specbind (symbol, value)
3296 buffer's or frame's value we are saving. */ 3295 buffer's or frame's value we are saving. */
3297 if (!NILP (Flocal_variable_p (symbol, Qnil))) 3296 if (!NILP (Flocal_variable_p (symbol, Qnil)))
3298 where = current_buffer; 3297 where = current_buffer;
3299 else if (!BUFFER_OBJFWDP (valcontents) 3298 else if (BUFFER_LOCAL_VALUEP (valcontents)
3300 && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame) 3299 && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame)
3301 where = XBUFFER_LOCAL_VALUE (valcontents)->frame; 3300 where = XBUFFER_LOCAL_VALUE (valcontents)->frame;
3302 else 3301 else
diff --git a/src/fileio.c b/src/fileio.c
index c9b6462e4a0..8b6f5ef1a84 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6079,6 +6079,7 @@ then any auto-save counts as "recent". */)
6079 6079
6080/* Reading and completing file names */ 6080/* Reading and completing file names */
6081extern Lisp_Object Ffile_name_completion (), Ffile_name_all_completions (); 6081extern Lisp_Object Ffile_name_completion (), Ffile_name_all_completions ();
6082extern Lisp_Object Qcompletion_ignore_case;
6082 6083
6083/* In the string VAL, change each $ to $$ and return the result. */ 6084/* In the string VAL, change each $ to $$ and return the result. */
6084 6085
@@ -6384,7 +6385,7 @@ and `read-file-name-function'. */)
6384 } 6385 }
6385 6386
6386 count = SPECPDL_INDEX (); 6387 count = SPECPDL_INDEX ();
6387 specbind (intern ("completion-ignore-case"), 6388 specbind (Qcompletion_ignore_case,
6388 read_file_name_completion_ignore_case ? Qt : Qnil); 6389 read_file_name_completion_ignore_case ? Qt : Qnil);
6389 specbind (intern ("minibuffer-completing-file-name"), Qt); 6390 specbind (intern ("minibuffer-completing-file-name"), Qt);
6390 specbind (intern ("read-file-name-predicate"), 6391 specbind (intern ("read-file-name-predicate"),
diff --git a/src/fns.c b/src/fns.c
index 9f7e422d757..82f9501f7aa 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1370,7 +1370,7 @@ The value is actually the tail of LIST whose car is ELT. */)
1370 Lisp_Object list; 1370 Lisp_Object list;
1371{ 1371{
1372 register Lisp_Object tail; 1372 register Lisp_Object tail;
1373 for (tail = list; !NILP (tail); tail = XCDR (tail)) 1373 for (tail = list; CONSP (tail); tail = XCDR (tail))
1374 { 1374 {
1375 register Lisp_Object tem; 1375 register Lisp_Object tem;
1376 CHECK_LIST_CONS (tail, list); 1376 CHECK_LIST_CONS (tail, list);
@@ -1421,7 +1421,7 @@ The value is actually the tail of LIST whose car is ELT. */)
1421 if (!FLOATP (elt)) 1421 if (!FLOATP (elt))
1422 return Fmemq (elt, list); 1422 return Fmemq (elt, list);
1423 1423
1424 for (tail = list; !NILP (tail); tail = XCDR (tail)) 1424 for (tail = list; CONSP (tail); tail = XCDR (tail))
1425 { 1425 {
1426 register Lisp_Object tem; 1426 register Lisp_Object tem;
1427 CHECK_LIST_CONS (tail, list); 1427 CHECK_LIST_CONS (tail, list);
@@ -1741,7 +1741,7 @@ to be sure of changing the value of `foo'. */)
1741 { 1741 {
1742 Lisp_Object tail, prev; 1742 Lisp_Object tail, prev;
1743 1743
1744 for (tail = seq, prev = Qnil; !NILP (tail); tail = XCDR (tail)) 1744 for (tail = seq, prev = Qnil; CONSP (tail); tail = XCDR (tail))
1745 { 1745 {
1746 CHECK_LIST_CONS (tail, seq); 1746 CHECK_LIST_CONS (tail, seq);
1747 1747
diff --git a/src/frame.c b/src/frame.c
index 389a94ae3e8..5c89c96a239 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -2299,8 +2299,7 @@ store_frame_param (f, prop, val)
2299 { 2299 {
2300 Lisp_Object valcontents; 2300 Lisp_Object valcontents;
2301 valcontents = SYMBOL_VALUE (prop); 2301 valcontents = SYMBOL_VALUE (prop);
2302 if ((BUFFER_LOCAL_VALUEP (valcontents) 2302 if ((BUFFER_LOCAL_VALUEP (valcontents))
2303 || SOME_BUFFER_LOCAL_VALUEP (valcontents))
2304 && XBUFFER_LOCAL_VALUE (valcontents)->check_frame 2303 && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
2305 && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame 2304 && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame
2306 && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f) 2305 && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
diff --git a/src/keyboard.c b/src/keyboard.c
index 6d6ba6e0cc0..2002aded95d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -8538,7 +8538,7 @@ read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu)
8538 to indicate that they came from a mouse menu, 8538 to indicate that they came from a mouse menu,
8539 so that when present in last_nonmenu_event 8539 so that when present in last_nonmenu_event
8540 they won't confuse things. */ 8540 they won't confuse things. */
8541 for (tem = XCDR (value); !NILP (tem); tem = XCDR (tem)) 8541 for (tem = XCDR (value); CONSP (tem); tem = XCDR (tem))
8542 { 8542 {
8543 record_menu_key (XCAR (tem)); 8543 record_menu_key (XCAR (tem));
8544 if (SYMBOLP (XCAR (tem)) 8544 if (SYMBOLP (XCAR (tem))
@@ -9185,13 +9185,16 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9185 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); 9185 orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
9186 from_string = Qnil; 9186 from_string = Qnil;
9187 9187
9188 /* We jump here when the key sequence has been thoroughly changed, and 9188 /* The multi-tty merge moved the code below to right after
9189 we need to rescan it starting from the beginning. When we jump here, 9189 `replay_sequence' which caused alll these translation maps to be applied
9190 keybuf[0..mock_input] holds the sequence we should reread. */ 9190 repeatedly, even tho their doc says very clearly they are not applied to
9191 replay_sequence: 9191 their own output.
9192 9192 The reason for this move was: "We may switch keyboards between rescans,
9193 /* We may switch keyboards between rescans, so we need to 9193 so we need to reinitialize fkey and keytran before each replay".
9194 reinitialize fkey and keytran before each replay. */ 9194 This move was wrong (even if we switch keyboards, keybuf still holds the
9195 keys we've read already from the original keyboard and some of those keys
9196 may have already been translated). So there may still be a bug out there
9197 lurking. */
9195 indec.map = indec.parent = current_kboard->Vinput_decode_map; 9198 indec.map = indec.parent = current_kboard->Vinput_decode_map;
9196 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map; 9199 fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
9197 keytran.map = keytran.parent = Vkey_translation_map; 9200 keytran.map = keytran.parent = Vkey_translation_map;
@@ -9199,6 +9202,11 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9199 fkey.start = fkey.end = 0; 9202 fkey.start = fkey.end = 0;
9200 keytran.start = keytran.end = 0; 9203 keytran.start = keytran.end = 0;
9201 9204
9205 /* We jump here when the key sequence has been thoroughly changed, and
9206 we need to rescan it starting from the beginning. When we jump here,
9207 keybuf[0..mock_input] holds the sequence we should reread. */
9208 replay_sequence:
9209
9202 starting_buffer = current_buffer; 9210 starting_buffer = current_buffer;
9203 first_unbound = bufsize + 1; 9211 first_unbound = bufsize + 1;
9204 9212
diff --git a/src/keymap.c b/src/keymap.c
index b6243594beb..b5abb194e1f 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1280,9 +1280,9 @@ remapping in all currently active keymaps. */)
1280 { 1280 {
1281 Lisp_Object maps, binding; 1281 Lisp_Object maps, binding;
1282 1282
1283 for (maps = keymaps; !NILP (maps); maps = Fcdr (maps)) 1283 for (maps = keymaps; CONSP (maps); maps = XCDR (maps))
1284 { 1284 {
1285 binding = Flookup_key (Fcar (maps), command_remapping_vector, Qnil); 1285 binding = Flookup_key (XCAR (maps), command_remapping_vector, Qnil);
1286 if (!NILP (binding) && !INTEGERP (binding)) 1286 if (!NILP (binding) && !INTEGERP (binding))
1287 return binding; 1287 return binding;
1288 } 1288 }
@@ -2653,7 +2653,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
2653 && !NILP (Fcommand_remapping (definition, Qnil, keymaps))) 2653 && !NILP (Fcommand_remapping (definition, Qnil, keymaps)))
2654 RETURN_UNGCPRO (Qnil); 2654 RETURN_UNGCPRO (Qnil);
2655 2655
2656 for (; !NILP (maps); maps = Fcdr (maps)) 2656 for (; CONSP (maps); maps = XCDR (maps))
2657 { 2657 {
2658 /* Key sequence to reach map, and the map that it reaches */ 2658 /* Key sequence to reach map, and the map that it reaches */
2659 register Lisp_Object this, map, tem; 2659 register Lisp_Object this, map, tem;
@@ -2665,8 +2665,8 @@ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
2665 Lisp_Object last; 2665 Lisp_Object last;
2666 int last_is_meta; 2666 int last_is_meta;
2667 2667
2668 this = Fcar (Fcar (maps)); 2668 this = Fcar (XCAR (maps));
2669 map = Fcdr (Fcar (maps)); 2669 map = Fcdr (XCAR (maps));
2670 last = make_number (XINT (Flength (this)) - 1); 2670 last = make_number (XINT (Flength (this)) - 1);
2671 last_is_meta = (XINT (last) >= 0 2671 last_is_meta = (XINT (last) >= 0
2672 && EQ (Faref (this, last), meta_prefix_char)); 2672 && EQ (Faref (this, last), meta_prefix_char));
@@ -3155,11 +3155,11 @@ key binding\n\
3155 Lisp_Object list; 3155 Lisp_Object list;
3156 3156
3157 /* Delete from MAPS each element that is for the menu bar. */ 3157 /* Delete from MAPS each element that is for the menu bar. */
3158 for (list = maps; !NILP (list); list = XCDR (list)) 3158 for (list = maps; CONSP (list); list = XCDR (list))
3159 { 3159 {
3160 Lisp_Object elt, prefix, tem; 3160 Lisp_Object elt, prefix, tem;
3161 3161
3162 elt = Fcar (list); 3162 elt = XCAR (list);
3163 prefix = Fcar (elt); 3163 prefix = Fcar (elt);
3164 if (XVECTOR (prefix)->size >= 1) 3164 if (XVECTOR (prefix)->size >= 1)
3165 { 3165 {
@@ -3186,11 +3186,11 @@ key binding\n\
3186 something = 1; 3186 something = 1;
3187 } 3187 }
3188 3188
3189 for (; !NILP (maps); maps = Fcdr (maps)) 3189 for (; CONSP (maps); maps = XCDR (maps))
3190 { 3190 {
3191 register Lisp_Object elt, prefix, tail; 3191 register Lisp_Object elt, prefix, tail;
3192 3192
3193 elt = Fcar (maps); 3193 elt = XCAR (maps);
3194 prefix = Fcar (elt); 3194 prefix = Fcar (elt);
3195 3195
3196 sub_shadows = Qnil; 3196 sub_shadows = Qnil;
diff --git a/src/lisp.h b/src/lisp.h
index 231cfcc7379..9ce5b3429e7 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -214,7 +214,6 @@ enum Lisp_Misc_Type
214 Lisp_Misc_Objfwd, 214 Lisp_Misc_Objfwd,
215 Lisp_Misc_Buffer_Objfwd, 215 Lisp_Misc_Buffer_Objfwd,
216 Lisp_Misc_Buffer_Local_Value, 216 Lisp_Misc_Buffer_Local_Value,
217 Lisp_Misc_Some_Buffer_Local_Value,
218 Lisp_Misc_Overlay, 217 Lisp_Misc_Overlay,
219 Lisp_Misc_Kboard_Objfwd, 218 Lisp_Misc_Kboard_Objfwd,
220 Lisp_Misc_Save_Value, 219 Lisp_Misc_Save_Value,
@@ -512,16 +511,20 @@ extern size_t pure_size;
512/* Misc types. */ 511/* Misc types. */
513 512
514#define XMISC(a) ((union Lisp_Misc *) XPNTR(a)) 513#define XMISC(a) ((union Lisp_Misc *) XPNTR(a))
515#define XMISCTYPE(a) (XMARKER (a)->type) 514#define XMISCANY(a) (eassert (MISCP (a)), &(XMISC(a)->u_any))
516#define XMARKER(a) (&(XMISC(a)->u_marker)) 515#define XMISCTYPE(a) (XMISCANY (a)->type)
517#define XINTFWD(a) (&(XMISC(a)->u_intfwd)) 516#define XMARKER(a) (eassert (MARKERP (a)), &(XMISC(a)->u_marker))
518#define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd)) 517#define XINTFWD(a) (eassert (INTFWDP (a)), &(XMISC(a)->u_intfwd))
519#define XOBJFWD(a) (&(XMISC(a)->u_objfwd)) 518#define XBOOLFWD(a) (eassert (BOOLFWDP (a)), &(XMISC(a)->u_boolfwd))
520#define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd)) 519#define XOBJFWD(a) (eassert (OBJFWDP (a)), &(XMISC(a)->u_objfwd))
521#define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value)) 520#define XOVERLAY(a) (eassert (OVERLAYP (a)), &(XMISC(a)->u_overlay))
522#define XOVERLAY(a) (&(XMISC(a)->u_overlay)) 521#define XSAVE_VALUE(a) (eassert (SAVE_VALUEP (a)), &(XMISC(a)->u_save_value))
523#define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd)) 522#define XBUFFER_OBJFWD(a) \
524#define XSAVE_VALUE(a) (&(XMISC(a)->u_save_value)) 523 (eassert (BUFFER_OBJFWDP (a)), &(XMISC(a)->u_buffer_objfwd))
524#define XBUFFER_LOCAL_VALUE(a) \
525 (eassert (BUFFER_LOCAL_VALUEP (a)), &(XMISC(a)->u_buffer_local_value))
526#define XKBOARD_OBJFWD(a) \
527 (eassert (KBOARD_OBJFWDP (a)), &(XMISC(a)->u_kboard_objfwd))
525 528
526/* Pseudovector types. */ 529/* Pseudovector types. */
527 530
@@ -1108,6 +1111,13 @@ struct Lisp_Hash_Table
1108 1111
1109/* These structures are used for various misc types. */ 1112/* These structures are used for various misc types. */
1110 1113
1114struct Lisp_Misc_Any /* Supertype of all Misc types. */
1115{
1116 int type : 16; /* = Lisp_Misc_Marker */
1117 unsigned gcmarkbit : 1;
1118 int spacer : 15;
1119};
1120
1111struct Lisp_Marker 1121struct Lisp_Marker
1112{ 1122{
1113 int type : 16; /* = Lisp_Misc_Marker */ 1123 int type : 16; /* = Lisp_Misc_Marker */
@@ -1208,19 +1218,19 @@ struct Lisp_Buffer_Objfwd
1208 binding into `realvalue' (or through it). Also update 1218 binding into `realvalue' (or through it). Also update
1209 LOADED-BINDING to point to the newly loaded binding. 1219 LOADED-BINDING to point to the newly loaded binding.
1210 1220
1211 Lisp_Misc_Buffer_Local_Value and Lisp_Misc_Some_Buffer_Local_Value 1221 `local_if_set' indicates that merely setting the variable creates a local
1212 both use this kind of structure. With the former, merely setting 1222 binding for the current buffer. Otherwise the latter, setting the
1213 the variable creates a local binding for the current buffer. With 1223 variable does not do that; only make-local-variable does that. */
1214 the latter, setting the variable does not do that; only
1215 make-local-variable does that. */
1216 1224
1217struct Lisp_Buffer_Local_Value 1225struct Lisp_Buffer_Local_Value
1218 { 1226 {
1219 int type : 16; /* = Lisp_Misc_Buffer_Local_Value 1227 int type : 16; /* = Lisp_Misc_Buffer_Local_Value */
1220 or Lisp_Misc_Some_Buffer_Local_Value */
1221 unsigned gcmarkbit : 1; 1228 unsigned gcmarkbit : 1;
1222 int spacer : 12; 1229 int spacer : 11;
1223 1230
1231 /* 1 means that merely setting the variable creates a local
1232 binding for the current buffer */
1233 unsigned int local_if_set : 1;
1224 /* 1 means this variable is allowed to have frame-local bindings, 1234 /* 1 means this variable is allowed to have frame-local bindings,
1225 so check for them when looking for the proper binding. */ 1235 so check for them when looking for the proper binding. */
1226 unsigned int check_frame : 1; 1236 unsigned int check_frame : 1;
@@ -1310,7 +1320,8 @@ struct Lisp_Free
1310 1320
1311union Lisp_Misc 1321union Lisp_Misc
1312 { 1322 {
1313 struct Lisp_Free u_free; 1323 struct Lisp_Misc_Any u_any; /* Supertype of all Misc types. */
1324 struct Lisp_Free u_free; /* Includes padding to force alignment. */
1314 struct Lisp_Marker u_marker; 1325 struct Lisp_Marker u_marker;
1315 struct Lisp_Intfwd u_intfwd; 1326 struct Lisp_Intfwd u_intfwd;
1316 struct Lisp_Boolfwd u_boolfwd; 1327 struct Lisp_Boolfwd u_boolfwd;
@@ -1452,8 +1463,17 @@ typedef unsigned char UCHAR;
1452#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd) 1463#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
1453#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd) 1464#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
1454#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value) 1465#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
1466<<<<<<< TREE
1455#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value) 1467#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
1468=======
1469#define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
1470>>>>>>> MERGE-SOURCE
1456#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd) 1471#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
1472<<<<<<< TREE
1473=======
1474#define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
1475#define SAVE_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Save_Value)
1476>>>>>>> MERGE-SOURCE
1457 1477
1458 1478
1459/* True if object X is a pseudovector whose code is CODE. */ 1479/* True if object X is a pseudovector whose code is CODE. */
diff --git a/src/lread.c b/src/lread.c
index 1bcad4672f0..a75e615acda 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1299,7 +1299,7 @@ close_load_descs ()
1299{ 1299{
1300#ifndef WINDOWSNT 1300#ifndef WINDOWSNT
1301 Lisp_Object tail; 1301 Lisp_Object tail;
1302 for (tail = load_descriptor_list; !NILP (tail); tail = XCDR (tail)) 1302 for (tail = load_descriptor_list; CONSP (tail); tail = XCDR (tail))
1303 emacs_close (XFASTINT (XCAR (tail))); 1303 emacs_close (XFASTINT (XCAR (tail)));
1304#endif 1304#endif
1305} 1305}
diff --git a/src/macfns.c b/src/macfns.c
index 9a9eb69fa63..708fe576f17 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -2826,7 +2826,7 @@ This function is an internal primitive--use `make-frame' instead. */)
2826 2826
2827 /* All remaining specified parameters, which have not been "used" 2827 /* All remaining specified parameters, which have not been "used"
2828 by x_get_arg and friends, now go in the misc. alist of the frame. */ 2828 by x_get_arg and friends, now go in the misc. alist of the frame. */
2829 for (tem = parameters; !NILP (tem); tem = XCDR (tem)) 2829 for (tem = parameters; CONSP (tem); tem = XCDR (tem))
2830 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) 2830 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
2831 f->param_alist = Fcons (XCAR (tem), f->param_alist); 2831 f->param_alist = Fcons (XCAR (tem), f->param_alist);
2832 2832
@@ -3402,7 +3402,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
3402 Lisp_Object tail, result; 3402 Lisp_Object tail, result;
3403 3403
3404 result = Qnil; 3404 result = Qnil;
3405 for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail)) 3405 for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
3406 result = Fcons (XCAR (XCAR (tail)), result); 3406 result = Fcons (XCAR (XCAR (tail)), result);
3407 3407
3408 return result; 3408 return result;
diff --git a/src/macselect.c b/src/macselect.c
index 9515a5774ec..f8038effd8b 100644
--- a/src/macselect.c
+++ b/src/macselect.c
@@ -487,7 +487,7 @@ x_own_selection (selection_name, selection_value)
487 if (!NILP (prev_value)) 487 if (!NILP (prev_value))
488 { 488 {
489 Lisp_Object rest; /* we know it's not the CAR, so it's easy. */ 489 Lisp_Object rest; /* we know it's not the CAR, so it's easy. */
490 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) 490 for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
491 if (EQ (prev_value, Fcar (XCDR (rest)))) 491 if (EQ (prev_value, Fcar (XCDR (rest))))
492 { 492 {
493 XSETCDR (rest, Fcdr (XCDR (rest))); 493 XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -619,7 +619,7 @@ x_clear_frame_selections (f)
619 } 619 }
620 620
621 /* Delete elements after the beginning of Vselection_alist. */ 621 /* Delete elements after the beginning of Vselection_alist. */
622 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) 622 for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
623 if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest)))))))) 623 if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest))))))))
624 { 624 {
625 /* Let random Lisp code notice that the selection has been stolen. */ 625 /* Let random Lisp code notice that the selection has been stolen. */
@@ -762,7 +762,7 @@ Disowning it means there is no such selection. */)
762 else 762 else
763 { 763 {
764 Lisp_Object rest; 764 Lisp_Object rest;
765 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) 765 for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
766 if (EQ (local_selection_data, Fcar (XCDR (rest)))) 766 if (EQ (local_selection_data, Fcar (XCDR (rest))))
767 { 767 {
768 XSETCDR (rest, Fcdr (XCDR (rest))); 768 XSETCDR (rest, Fcdr (XCDR (rest)));
diff --git a/src/macterm.c b/src/macterm.c
index a15f0b0fcfc..3c01a6618a2 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -8300,7 +8300,7 @@ init_font_name_table ()
8300 Lisp_Object rest = XCDR (XCDR (text_encoding_info)); 8300 Lisp_Object rest = XCDR (XCDR (text_encoding_info));
8301 8301
8302 if (size > 0 || style == normal) 8302 if (size > 0 || style == normal)
8303 for (; !NILP (rest); rest = XCDR (rest)) 8303 for (; CONSP (rest); rest = XCDR (rest))
8304 add_mac_font_name (name, size, style, SDATA (XCAR (rest))); 8304 add_mac_font_name (name, size, style, SDATA (XCAR (rest)));
8305 } 8305 }
8306 } 8306 }
@@ -8375,7 +8375,7 @@ init_font_name_table ()
8375 { 8375 {
8376 Lisp_Object rest = XCDR (XCDR (text_encoding_info)); 8376 Lisp_Object rest = XCDR (XCDR (text_encoding_info));
8377 8377
8378 for (; !NILP (rest); rest = XCDR (rest)) 8378 for (; CONSP (rest); rest = XCDR (rest))
8379 add_mac_font_name (name, assc_entry->fontSize, 8379 add_mac_font_name (name, assc_entry->fontSize,
8380 assc_entry->fontStyle, 8380 assc_entry->fontStyle,
8381 SDATA (XCAR (rest))); 8381 SDATA (XCAR (rest)));
diff --git a/src/minibuf.c b/src/minibuf.c
index 39d2f8e17be..340f6dae319 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -118,6 +118,7 @@ Lisp_Object Vread_buffer_function;
118/* Nonzero means completion ignores case. */ 118/* Nonzero means completion ignores case. */
119 119
120int completion_ignore_case; 120int completion_ignore_case;
121Lisp_Object Qcompletion_ignore_case;
121 122
122/* List of regexps that should restrict possible completions. */ 123/* List of regexps that should restrict possible completions. */
123 124
@@ -2109,10 +2110,10 @@ string rather than a cons cell whose car is a string. */)
2109 if (SYMBOLP (key)) 2110 if (SYMBOLP (key))
2110 key = Fsymbol_name (key); 2111 key = Fsymbol_name (key);
2111 2112
2112 for (tail = list; !NILP (tail); tail = Fcdr (tail)) 2113 for (tail = list; CONSP (tail); tail = XCDR (tail))
2113 { 2114 {
2114 register Lisp_Object elt, tem, thiscar; 2115 register Lisp_Object elt, tem, thiscar;
2115 elt = Fcar (tail); 2116 elt = XCAR (tail);
2116 thiscar = CONSP (elt) ? XCAR (elt) : elt; 2117 thiscar = CONSP (elt) ? XCAR (elt) : elt;
2117 if (SYMBOLP (thiscar)) 2118 if (SYMBOLP (thiscar))
2118 thiscar = Fsymbol_name (thiscar); 2119 thiscar = Fsymbol_name (thiscar);
@@ -2822,6 +2823,9 @@ syms_of_minibuf ()
2822 minibuf_save_list = Qnil; 2823 minibuf_save_list = Qnil;
2823 staticpro (&minibuf_save_list); 2824 staticpro (&minibuf_save_list);
2824 2825
2826 Qcompletion_ignore_case = intern ("completion-ignore-case");
2827 staticpro (&Qcompletion_ignore_case);
2828
2825 Qread_file_name_internal = intern ("read-file-name-internal"); 2829 Qread_file_name_internal = intern ("read-file-name-internal");
2826 staticpro (&Qread_file_name_internal); 2830 staticpro (&Qread_file_name_internal);
2827 2831
diff --git a/src/print.c b/src/print.c
index edd22abc038..c23e020eb8d 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2243,10 +2243,8 @@ print_object (obj, printcharfun, escapeflag)
2243 2243
2244 case Lisp_Misc_Buffer_Local_Value: 2244 case Lisp_Misc_Buffer_Local_Value:
2245 strout ("#<buffer_local_value ", -1, -1, printcharfun, 0); 2245 strout ("#<buffer_local_value ", -1, -1, printcharfun, 0);
2246 goto do_buffer_local; 2246 if (XBUFFER_LOCAL_VALUE (obj)->local_if_set)
2247 case Lisp_Misc_Some_Buffer_Local_Value: 2247 strout ("[local-if-set] ", -1, -1, printcharfun, 0);
2248 strout ("#<some_buffer_local_value ", -1, -1, printcharfun, 0);
2249 do_buffer_local:
2250 strout ("[realvalue] ", -1, -1, printcharfun, 0); 2248 strout ("[realvalue] ", -1, -1, printcharfun, 0);
2251 print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue, 2249 print_object (XBUFFER_LOCAL_VALUE (obj)->realvalue,
2252 printcharfun, escapeflag); 2250 printcharfun, escapeflag);
diff --git a/src/process.c b/src/process.c
index d94e6d13866..6bcaef63303 100644
--- a/src/process.c
+++ b/src/process.c
@@ -121,6 +121,12 @@ Boston, MA 02110-1301, USA. */
121#include <sys/wait.h> 121#include <sys/wait.h>
122#endif 122#endif
123 123
124#ifdef HAVE_RES_INIT
125#include <netinet/in.h>
126#include <arpa/nameser.h>
127#include <resolv.h>
128#endif
129
124#include "lisp.h" 130#include "lisp.h"
125#include "systime.h" 131#include "systime.h"
126#include "systty.h" 132#include "systty.h"
@@ -732,9 +738,9 @@ BUFFER may be a buffer or the name of one. */)
732 buf = Fget_buffer (buffer); 738 buf = Fget_buffer (buffer);
733 if (NILP (buf)) return Qnil; 739 if (NILP (buf)) return Qnil;
734 740
735 for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) 741 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
736 { 742 {
737 proc = Fcdr (Fcar (tail)); 743 proc = Fcdr (XCAR (tail));
738 if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf)) 744 if (PROCESSP (proc) && EQ (XPROCESS (proc)->buffer, buf))
739 return proc; 745 return proc;
740 } 746 }
@@ -1338,11 +1344,11 @@ list_processes_1 (query_only)
1338 w_buffer = 6; /* Buffer */ 1344 w_buffer = 6; /* Buffer */
1339 w_tty = 0; /* Omit if no ttys */ 1345 w_tty = 0; /* Omit if no ttys */
1340 1346
1341 for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) 1347 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
1342 { 1348 {
1343 int i; 1349 int i;
1344 1350
1345 proc = Fcdr (Fcar (tail)); 1351 proc = Fcdr (XCAR (tail));
1346 p = XPROCESS (proc); 1352 p = XPROCESS (proc);
1347 if (NILP (p->childp)) 1353 if (NILP (p->childp))
1348 continue; 1354 continue;
@@ -1401,11 +1407,11 @@ list_processes_1 (query_only)
1401 Findent_to (i_command, minspace); write_string ("-------", -1); 1407 Findent_to (i_command, minspace); write_string ("-------", -1);
1402 write_string ("\n", -1); 1408 write_string ("\n", -1);
1403 1409
1404 for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) 1410 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
1405 { 1411 {
1406 Lisp_Object symbol; 1412 Lisp_Object symbol;
1407 1413
1408 proc = Fcdr (Fcar (tail)); 1414 proc = Fcdr (XCAR (tail));
1409 p = XPROCESS (proc); 1415 p = XPROCESS (proc);
1410 if (NILP (p->childp)) 1416 if (NILP (p->childp))
1411 continue; 1417 continue;
@@ -3082,6 +3088,11 @@ usage: (make-network-process &rest ARGS) */)
3082 hints.ai_family = family; 3088 hints.ai_family = family;
3083 hints.ai_socktype = socktype; 3089 hints.ai_socktype = socktype;
3084 hints.ai_protocol = 0; 3090 hints.ai_protocol = 0;
3091
3092#ifdef HAVE_RES_INIT
3093 res_init ();
3094#endif
3095
3085 ret = getaddrinfo (SDATA (host), portstring, &hints, &res); 3096 ret = getaddrinfo (SDATA (host), portstring, &hints, &res);
3086 if (ret) 3097 if (ret)
3087#ifdef HAVE_GAI_STRERROR 3098#ifdef HAVE_GAI_STRERROR
@@ -3127,6 +3138,11 @@ usage: (make-network-process &rest ARGS) */)
3127 as it may `hang' Emacs for a very long time. */ 3138 as it may `hang' Emacs for a very long time. */
3128 immediate_quit = 1; 3139 immediate_quit = 1;
3129 QUIT; 3140 QUIT;
3141
3142#ifdef HAVE_RES_INIT
3143 res_init ();
3144#endif
3145
3130 host_info_ptr = gethostbyname (SDATA (host)); 3146 host_info_ptr = gethostbyname (SDATA (host));
3131 immediate_quit = 0; 3147 immediate_quit = 0;
3132 3148
@@ -6689,12 +6705,12 @@ status_notify (deleting_process)
6689 that we run, we get called again to handle their status changes. */ 6705 that we run, we get called again to handle their status changes. */
6690 update_tick = process_tick; 6706 update_tick = process_tick;
6691 6707
6692 for (tail = Vprocess_alist; !NILP (tail); tail = Fcdr (tail)) 6708 for (tail = Vprocess_alist; CONSP (tail); tail = XCDR (tail))
6693 { 6709 {
6694 Lisp_Object symbol; 6710 Lisp_Object symbol;
6695 register struct Lisp_Process *p; 6711 register struct Lisp_Process *p;
6696 6712
6697 proc = Fcdr (Fcar (tail)); 6713 proc = Fcdr (XCAR (tail));
6698 p = XPROCESS (proc); 6714 p = XPROCESS (proc);
6699 6715
6700 if (p->tick != p->update_tick) 6716 if (p->tick != p->update_tick)
diff --git a/src/textprop.c b/src/textprop.c
index 8ce5656e5a2..e8ba1d87afc 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -201,9 +201,9 @@ validate_plist (list)
201 { 201 {
202 register int i; 202 register int i;
203 register Lisp_Object tail; 203 register Lisp_Object tail;
204 for (i = 0, tail = list; !NILP (tail); i++) 204 for (i = 0, tail = list; CONSP (tail); i++)
205 { 205 {
206 tail = Fcdr (tail); 206 tail = XCDR (tail);
207 QUIT; 207 QUIT;
208 } 208 }
209 if (i & 1) 209 if (i & 1)
@@ -226,18 +226,18 @@ interval_has_all_properties (plist, i)
226 register int found; 226 register int found;
227 227
228 /* Go through each element of PLIST. */ 228 /* Go through each element of PLIST. */
229 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) 229 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
230 { 230 {
231 sym1 = Fcar (tail1); 231 sym1 = XCAR (tail1);
232 found = 0; 232 found = 0;
233 233
234 /* Go through I's plist, looking for sym1 */ 234 /* Go through I's plist, looking for sym1 */
235 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) 235 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
236 if (EQ (sym1, Fcar (tail2))) 236 if (EQ (sym1, XCAR (tail2)))
237 { 237 {
238 /* Found the same property on both lists. If the 238 /* Found the same property on both lists. If the
239 values are unequal, return zero. */ 239 values are unequal, return zero. */
240 if (! EQ (Fcar (Fcdr (tail1)), Fcar (Fcdr (tail2)))) 240 if (! EQ (Fcar (XCDR (tail1)), Fcar (XCDR (tail2))))
241 return 0; 241 return 0;
242 242
243 /* Property has same value on both lists; go to next one. */ 243 /* Property has same value on both lists; go to next one. */
@@ -263,13 +263,13 @@ interval_has_some_properties (plist, i)
263 register Lisp_Object tail1, tail2, sym; 263 register Lisp_Object tail1, tail2, sym;
264 264
265 /* Go through each element of PLIST. */ 265 /* Go through each element of PLIST. */
266 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) 266 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
267 { 267 {
268 sym = Fcar (tail1); 268 sym = XCAR (tail1);
269 269
270 /* Go through i's plist, looking for tail1 */ 270 /* Go through i's plist, looking for tail1 */
271 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) 271 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
272 if (EQ (sym, Fcar (tail2))) 272 if (EQ (sym, XCAR (tail2)))
273 return 1; 273 return 1;
274 } 274 }
275 275
@@ -287,12 +287,12 @@ interval_has_some_properties_list (list, i)
287 register Lisp_Object tail1, tail2, sym; 287 register Lisp_Object tail1, tail2, sym;
288 288
289 /* Go through each element of LIST. */ 289 /* Go through each element of LIST. */
290 for (tail1 = list; ! NILP (tail1); tail1 = XCDR (tail1)) 290 for (tail1 = list; CONSP (tail1); tail1 = XCDR (tail1))
291 { 291 {
292 sym = Fcar (tail1); 292 sym = Fcar (tail1);
293 293
294 /* Go through i's plist, looking for tail1 */ 294 /* Go through i's plist, looking for tail1 */
295 for (tail2 = i->plist; ! NILP (tail2); tail2 = XCDR (XCDR (tail2))) 295 for (tail2 = i->plist; CONSP (tail2); tail2 = XCDR (XCDR (tail2)))
296 if (EQ (sym, XCAR (tail2))) 296 if (EQ (sym, XCAR (tail2)))
297 return 1; 297 return 1;
298 } 298 }
@@ -391,21 +391,21 @@ add_properties (plist, i, object)
391 GCPRO3 (tail1, sym1, val1); 391 GCPRO3 (tail1, sym1, val1);
392 392
393 /* Go through each element of PLIST. */ 393 /* Go through each element of PLIST. */
394 for (tail1 = plist; ! NILP (tail1); tail1 = Fcdr (Fcdr (tail1))) 394 for (tail1 = plist; CONSP (tail1); tail1 = Fcdr (XCDR (tail1)))
395 { 395 {
396 sym1 = Fcar (tail1); 396 sym1 = XCAR (tail1);
397 val1 = Fcar (Fcdr (tail1)); 397 val1 = Fcar (XCDR (tail1));
398 found = 0; 398 found = 0;
399 399
400 /* Go through I's plist, looking for sym1 */ 400 /* Go through I's plist, looking for sym1 */
401 for (tail2 = i->plist; ! NILP (tail2); tail2 = Fcdr (Fcdr (tail2))) 401 for (tail2 = i->plist; CONSP (tail2); tail2 = Fcdr (XCDR (tail2)))
402 if (EQ (sym1, Fcar (tail2))) 402 if (EQ (sym1, XCAR (tail2)))
403 { 403 {
404 /* No need to gcpro, because tail2 protects this 404 /* No need to gcpro, because tail2 protects this
405 and it must be a cons cell (we get an error otherwise). */ 405 and it must be a cons cell (we get an error otherwise). */
406 register Lisp_Object this_cdr; 406 register Lisp_Object this_cdr;
407 407
408 this_cdr = Fcdr (tail2); 408 this_cdr = XCDR (tail2);
409 /* Found the property. Now check its value. */ 409 /* Found the property. Now check its value. */
410 found = 1; 410 found = 1;
411 411
@@ -1965,10 +1965,10 @@ text_property_list (object, start, end, prop)
1965 plist = i->plist; 1965 plist = i->plist;
1966 1966
1967 if (!NILP (prop)) 1967 if (!NILP (prop))
1968 for (; !NILP (plist); plist = Fcdr (Fcdr (plist))) 1968 for (; CONSP (plist); plist = Fcdr (XCDR (plist)))
1969 if (EQ (Fcar (plist), prop)) 1969 if (EQ (XCAR (plist), prop))
1970 { 1970 {
1971 plist = Fcons (prop, Fcons (Fcar (Fcdr (plist)), Qnil)); 1971 plist = Fcons (prop, Fcons (Fcar (XCDR (plist)), Qnil));
1972 break; 1972 break;
1973 } 1973 }
1974 1974
diff --git a/src/w32fns.c b/src/w32fns.c
index 74b2a0ed655..de5b6db3d77 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -850,11 +850,11 @@ w32_color_map_lookup (colorname)
850 850
851 BLOCK_INPUT; 851 BLOCK_INPUT;
852 852
853 for (tail = Vw32_color_map; !NILP (tail); tail = Fcdr (tail)) 853 for (tail = Vw32_color_map; CONSP (tail); tail = XCDR (tail))
854 { 854 {
855 register Lisp_Object elt, tem; 855 register Lisp_Object elt, tem;
856 856
857 elt = Fcar (tail); 857 elt = XCAR (tail);
858 if (!CONSP (elt)) continue; 858 if (!CONSP (elt)) continue;
859 859
860 tem = Fcar (elt); 860 tem = Fcar (elt);
@@ -4506,7 +4506,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4506 4506
4507 /* All remaining specified parameters, which have not been "used" 4507 /* All remaining specified parameters, which have not been "used"
4508 by x_get_arg and friends, now go in the misc. alist of the frame. */ 4508 by x_get_arg and friends, now go in the misc. alist of the frame. */
4509 for (tem = parameters; !NILP (tem); tem = XCDR (tem)) 4509 for (tem = parameters; CONSP (tem); tem = XCDR (tem))
4510 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) 4510 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
4511 f->param_alist = Fcons (XCAR (tem), f->param_alist); 4511 f->param_alist = Fcons (XCAR (tem), f->param_alist);
4512 4512
@@ -6958,7 +6958,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
6958 Lisp_Object tail, result; 6958 Lisp_Object tail, result;
6959 6959
6960 result = Qnil; 6960 result = Qnil;
6961 for (tail = w32_display_name_list; ! NILP (tail); tail = XCDR (tail)) 6961 for (tail = w32_display_name_list; CONSP (tail); tail = XCDR (tail))
6962 result = Fcons (XCAR (XCAR (tail)), result); 6962 result = Fcons (XCAR (XCAR (tail)), result);
6963 6963
6964 return result; 6964 return result;
diff --git a/src/w32menu.c b/src/w32menu.c
index 986832b3e7c..c570385c3bb 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -568,10 +568,10 @@ list_of_panes (menu)
568 568
569 init_menu_items (); 569 init_menu_items ();
570 570
571 for (tail = menu; !NILP (tail); tail = Fcdr (tail)) 571 for (tail = menu; CONSP (tail); tail = XCDR (tail))
572 { 572 {
573 Lisp_Object elt, pane_name, pane_data; 573 Lisp_Object elt, pane_name, pane_data;
574 elt = Fcar (tail); 574 elt = XCAR (tail);
575 pane_name = Fcar (elt); 575 pane_name = Fcar (elt);
576 CHECK_STRING (pane_name); 576 CHECK_STRING (pane_name);
577 push_menu_pane (pane_name, Qnil); 577 push_menu_pane (pane_name, Qnil);
@@ -591,9 +591,9 @@ list_of_items (pane)
591{ 591{
592 Lisp_Object tail, item, item1; 592 Lisp_Object tail, item, item1;
593 593
594 for (tail = pane; !NILP (tail); tail = Fcdr (tail)) 594 for (tail = pane; CONSP (tail); tail = XCDR (tail))
595 { 595 {
596 item = Fcar (tail); 596 item = XCAR (tail);
597 if (STRINGP (item)) 597 if (STRINGP (item))
598 push_menu_item (item, Qnil, Qnil, Qt, Qnil, Qnil, Qnil, Qnil); 598 push_menu_item (item, Qnil, Qnil, Qt, Qnil, Qnil, Qnil, Qnil);
599 else if (NILP (item)) 599 else if (NILP (item))
diff --git a/src/window.c b/src/window.c
index 2fd4d286eba..766c291820f 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2670,12 +2670,12 @@ window_fixed_size_p (w, width_p, check_siblings_p)
2670 { 2670 {
2671 Lisp_Object child; 2671 Lisp_Object child;
2672 2672
2673 for (child = w->prev; !NILP (child); child = XWINDOW (child)->prev) 2673 for (child = w->prev; WINDOWP (child); child = XWINDOW (child)->prev)
2674 if (!window_fixed_size_p (XWINDOW (child), width_p, 0)) 2674 if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
2675 break; 2675 break;
2676 2676
2677 if (NILP (child)) 2677 if (NILP (child))
2678 for (child = w->next; !NILP (child); child = XWINDOW (child)->next) 2678 for (child = w->next; WINDOWP (child); child = XWINDOW (child)->next)
2679 if (!window_fixed_size_p (XWINDOW (child), width_p, 0)) 2679 if (!window_fixed_size_p (XWINDOW (child), width_p, 0))
2680 break; 2680 break;
2681 2681
@@ -4291,10 +4291,10 @@ enlarge_window (window, delta, horiz_flag)
4291 4291
4292 /* Find the total we can get from other siblings without deleting them. */ 4292 /* Find the total we can get from other siblings without deleting them. */
4293 maximum = 0; 4293 maximum = 0;
4294 for (next = p->next; ! NILP (next); next = XWINDOW (next)->next) 4294 for (next = p->next; WINDOWP (next); next = XWINDOW (next)->next)
4295 maximum += (*sizefun) (next) - window_min_size (XWINDOW (next), 4295 maximum += (*sizefun) (next) - window_min_size (XWINDOW (next),
4296 horiz_flag, 0, 0); 4296 horiz_flag, 0, 0);
4297 for (prev = p->prev; ! NILP (prev); prev = XWINDOW (prev)->prev) 4297 for (prev = p->prev; WINDOWP (prev); prev = XWINDOW (prev)->prev)
4298 maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev), 4298 maximum += (*sizefun) (prev) - window_min_size (XWINDOW (prev),
4299 horiz_flag, 0, 0); 4299 horiz_flag, 0, 0);
4300 4300
@@ -4442,10 +4442,10 @@ enlarge_window (window, delta, horiz_flag)
4442 Lisp_Object s; 4442 Lisp_Object s;
4443 int n = 1; 4443 int n = 1;
4444 4444
4445 for (s = w->next; !NILP (s); s = XWINDOW (s)->next) 4445 for (s = w->next; WINDOWP (s); s = XWINDOW (s)->next)
4446 if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) 4446 if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
4447 ++n; 4447 ++n;
4448 for (s = w->prev; !NILP (s); s = XWINDOW (s)->prev) 4448 for (s = w->prev; WINDOWP (s); s = XWINDOW (s)->prev)
4449 if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0)) 4449 if (!window_fixed_size_p (XWINDOW (s), horiz_flag, 0))
4450 ++n; 4450 ++n;
4451 4451
@@ -4701,7 +4701,7 @@ shrink_window_lowest_first (w, height)
4701 /* Find the last child. We are taking space from lowest windows 4701 /* Find the last child. We are taking space from lowest windows
4702 first, so we iterate over children from the last child 4702 first, so we iterate over children from the last child
4703 backwards. */ 4703 backwards. */
4704 for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next) 4704 for (child = w->vchild; WINDOWP (child); child = XWINDOW (child)->next)
4705 last_child = child; 4705 last_child = child;
4706 4706
4707 /* Assign new heights. We leave only MIN_SAFE_WINDOW_HEIGHT. */ 4707 /* Assign new heights. We leave only MIN_SAFE_WINDOW_HEIGHT. */
diff --git a/src/xdisp.c b/src/xdisp.c
index fef50689ab5..a83ee8983dc 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3844,7 +3844,13 @@ handle_display_prop (it)
3844 { 3844 {
3845 if (handle_single_display_spec (it, XCAR (prop), object, 3845 if (handle_single_display_spec (it, XCAR (prop), object,
3846 position, display_replaced_p)) 3846 position, display_replaced_p))
3847 display_replaced_p = 1; 3847 {
3848 display_replaced_p = 1;
3849 /* If some text in a string is replaced, `position' no
3850 longer points to the position of `object'. */
3851 if (STRINGP (object))
3852 break;
3853 }
3848 } 3854 }
3849 } 3855 }
3850 else if (VECTORP (prop)) 3856 else if (VECTORP (prop))
@@ -3853,7 +3859,13 @@ handle_display_prop (it)
3853 for (i = 0; i < ASIZE (prop); ++i) 3859 for (i = 0; i < ASIZE (prop); ++i)
3854 if (handle_single_display_spec (it, AREF (prop, i), object, 3860 if (handle_single_display_spec (it, AREF (prop, i), object,
3855 position, display_replaced_p)) 3861 position, display_replaced_p))
3856 display_replaced_p = 1; 3862 {
3863 display_replaced_p = 1;
3864 /* If some text in a string is replaced, `position' no
3865 longer points to the position of `object'. */
3866 if (STRINGP (object))
3867 break;
3868 }
3857 } 3869 }
3858 else 3870 else
3859 { 3871 {
@@ -4242,13 +4254,16 @@ handle_single_display_spec (it, spec, object, position,
4242 /* Say that we haven't consumed the characters with 4254 /* Say that we haven't consumed the characters with
4243 `display' property yet. The call to pop_it in 4255 `display' property yet. The call to pop_it in
4244 set_iterator_to_next will clean this up. */ 4256 set_iterator_to_next will clean this up. */
4245 *position = start_pos; 4257 if (BUFFERP (object))
4258 it->current.pos = start_pos;
4246 } 4259 }
4247 else if (CONSP (value) && EQ (XCAR (value), Qspace)) 4260 else if (CONSP (value) && EQ (XCAR (value), Qspace))
4248 { 4261 {
4249 it->method = GET_FROM_STRETCH; 4262 it->method = GET_FROM_STRETCH;
4250 it->object = value; 4263 it->object = value;
4251 *position = it->position = start_pos; 4264 it->position = start_pos;
4265 if (BUFFERP (object))
4266 it->current.pos = start_pos;
4252 } 4267 }
4253#ifdef HAVE_WINDOW_SYSTEM 4268#ifdef HAVE_WINDOW_SYSTEM
4254 else 4269 else
@@ -4262,7 +4277,8 @@ handle_single_display_spec (it, spec, object, position,
4262 /* Say that we haven't consumed the characters with 4277 /* Say that we haven't consumed the characters with
4263 `display' property yet. The call to pop_it in 4278 `display' property yet. The call to pop_it in
4264 set_iterator_to_next will clean this up. */ 4279 set_iterator_to_next will clean this up. */
4265 *position = start_pos; 4280 if (BUFFERP (object))
4281 it->current.pos = start_pos;
4266 } 4282 }
4267#endif /* HAVE_WINDOW_SYSTEM */ 4283#endif /* HAVE_WINDOW_SYSTEM */
4268 4284
@@ -10972,8 +10988,7 @@ select_frame_for_redisplay (frame)
10972 SYMBOLP (sym)) 10988 SYMBOLP (sym))
10973 && (sym = indirect_variable (sym), 10989 && (sym = indirect_variable (sym),
10974 val = SYMBOL_VALUE (sym), 10990 val = SYMBOL_VALUE (sym),
10975 (BUFFER_LOCAL_VALUEP (val) 10991 (BUFFER_LOCAL_VALUEP (val)))
10976 || SOME_BUFFER_LOCAL_VALUEP (val)))
10977 && XBUFFER_LOCAL_VALUE (val)->check_frame) 10992 && XBUFFER_LOCAL_VALUE (val)->check_frame)
10978 /* Use find_symbol_value rather than Fsymbol_value 10993 /* Use find_symbol_value rather than Fsymbol_value
10979 to avoid an error if it is void. */ 10994 to avoid an error if it is void. */
@@ -10985,8 +11000,7 @@ select_frame_for_redisplay (frame)
10985 SYMBOLP (sym)) 11000 SYMBOLP (sym))
10986 && (sym = indirect_variable (sym), 11001 && (sym = indirect_variable (sym),
10987 val = SYMBOL_VALUE (sym), 11002 val = SYMBOL_VALUE (sym),
10988 (BUFFER_LOCAL_VALUEP (val) 11003 (BUFFER_LOCAL_VALUEP (val)))
10989 || SOME_BUFFER_LOCAL_VALUEP (val)))
10990 && XBUFFER_LOCAL_VALUE (val)->check_frame) 11004 && XBUFFER_LOCAL_VALUE (val)->check_frame)
10991 find_symbol_value (sym); 11005 find_symbol_value (sym);
10992} 11006}
diff --git a/src/xfns.c b/src/xfns.c
index 8d21a69461a..fce3316b235 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -3675,7 +3675,7 @@ else
3675 3675
3676 /* All remaining specified parameters, which have not been "used" 3676 /* All remaining specified parameters, which have not been "used"
3677 by x_get_arg and friends, now go in the misc. alist of the frame. */ 3677 by x_get_arg and friends, now go in the misc. alist of the frame. */
3678 for (tem = parms; !NILP (tem); tem = XCDR (tem)) 3678 for (tem = parms; CONSP (tem); tem = XCDR (tem))
3679 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem)))) 3679 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
3680 f->param_alist = Fcons (XCAR (tem), f->param_alist); 3680 f->param_alist = Fcons (XCAR (tem), f->param_alist);
3681 3681
@@ -4363,7 +4363,7 @@ DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
4363 Lisp_Object tail, result; 4363 Lisp_Object tail, result;
4364 4364
4365 result = Qnil; 4365 result = Qnil;
4366 for (tail = x_display_name_list; ! NILP (tail); tail = XCDR (tail)) 4366 for (tail = x_display_name_list; CONSP (tail); tail = XCDR (tail))
4367 result = Fcons (XCAR (XCAR (tail)), result); 4367 result = Fcons (XCAR (XCAR (tail)), result);
4368 4368
4369 return result; 4369 return result;
diff --git a/src/xselect.c b/src/xselect.c
index d71ac42aa7c..0db5ef57767 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -442,7 +442,7 @@ x_own_selection (selection_name, selection_value)
442 if (!NILP (prev_value)) 442 if (!NILP (prev_value))
443 { 443 {
444 Lisp_Object rest; /* we know it's not the CAR, so it's easy. */ 444 Lisp_Object rest; /* we know it's not the CAR, so it's easy. */
445 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) 445 for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
446 if (EQ (prev_value, Fcar (XCDR (rest)))) 446 if (EQ (prev_value, Fcar (XCDR (rest))))
447 { 447 {
448 XSETCDR (rest, Fcdr (XCDR (rest))); 448 XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -1072,7 +1072,7 @@ x_handle_selection_clear (event)
1072 else 1072 else
1073 { 1073 {
1074 Lisp_Object rest; 1074 Lisp_Object rest;
1075 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) 1075 for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
1076 if (EQ (local_selection_data, Fcar (XCDR (rest)))) 1076 if (EQ (local_selection_data, Fcar (XCDR (rest))))
1077 { 1077 {
1078 XSETCDR (rest, Fcdr (XCDR (rest))); 1078 XSETCDR (rest, Fcdr (XCDR (rest)));
@@ -1153,7 +1153,7 @@ x_clear_frame_selections (f)
1153 } 1153 }
1154 1154
1155 /* Delete elements after the beginning of Vselection_alist. */ 1155 /* Delete elements after the beginning of Vselection_alist. */
1156 for (rest = Vselection_alist; !NILP (rest); rest = Fcdr (rest)) 1156 for (rest = Vselection_alist; CONSP (rest); rest = XCDR (rest))
1157 if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest)))))))) 1157 if (EQ (frame, Fcar (Fcdr (Fcdr (Fcdr (Fcar (XCDR (rest))))))))
1158 { 1158 {
1159 /* Let random Lisp code notice that the selection has been stolen. */ 1159 /* Let random Lisp code notice that the selection has been stolen. */