* lisp/net/quickurl.el: Documentation typo fixes.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
e4ed06f1
CY
12011-08-25 Chong Yidong <cyd@stupidchicken.com>
2
3 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
4 Change return value to nil.
5 (Frecord_buffer): Delete unused function.
6
f67cdd7f
EZ
72011-08-24 Eli Zaretskii <eliz@gnu.org>
8
5980d4c6
EZ
9 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
10 buffers, return left-to-right.
8610fe8b
EZ
11 (set_cursor_from_row): Consider candidate row a win if its glyph
12 represents a newline and point is on that newline. Fixes cursor
13 positioning on the newline at EOL of R2L text within L2R
14 paragraph, and vice versa.
15 (try_cursor_movement): Check continued rows, in addition to
16 continuation rows. Fixes unwarranted scroll when point enters a
17 continued line of R2L text within an L2R paragraph, or vice versa.
18 (cursor_row_p): Consider the case of point being equal to
19 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
20 from the end of a short line to the beginning of a continued line
21 of R2L text within L2R paragraph.
22 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
23 composed characters.
5980d4c6 24
f67cdd7f
EZ
25 * bidi.c (bidi_check_type): Use xassert.
26 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
27 members.
28
bca633fb
EZ
292011-08-23 Eli Zaretskii <eliz@gnu.org>
30
31 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
32 a character.
33
4a5885a7
CY
342011-08-23 Chong Yidong <cyd@stupidchicken.com>
35
36 * nsfont.m (ns_otf_to_script): Fix typo.
37
0902a04e
KH
382011-08-22 Kenichi Handa <handa@m17n.org>
39
40 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
41 extra slot even if the purpose is char-code-property-table.
42
1a2e6670
EZ
432011-08-23 Eli Zaretskii <eliz@gnu.org>
44
8ddde651
EZ
45 * xdisp.c (redisplay_window): When computing centering_position,
46 account for the height of the header line. (Bug#8874)
47
425cc014
EZ
48 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
49 instead of CHAR_TO_BYTE. Fixes a crash when a completion
50 candidate is selected by the mouse, and that candidate has a
51 composed character under the mouse.
52
1a2e6670
EZ
53 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
54 coordinates reported by pos-visible-in-window-p for a composed
55 character in column zero.
56
8b76d6f8
SM
572011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
58
59 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
60
dac347dd
EZ
612011-08-22 Eli Zaretskii <eliz@gnu.org>
62
63 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
64 consider it a hit if to_charpos is anywhere in the range of the
65 composed buffer positions.
66
e013fb34
CY
672011-08-22 Chong Yidong <cyd@stupidchicken.com>
68
69 * image.c (gif_load): Don't assume that each subimage has the same
70 dimensions as the base image. Handle disposal method that is
71 "undefined" by the gif spec (Bug#9335).
72
bd1ba3e8
CY
732011-08-20 Chong Yidong <cyd@stupidchicken.com>
74
75 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 76 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 77
54a1215b
EZ
782011-08-19 Eli Zaretskii <eliz@gnu.org>
79
823564e5
EZ
80 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
81 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
82 from an Org mode buffer to a Speedbar frame.
83
54a1215b
EZ
84 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
85 a composition, take its buffer position from IT->cmp_it.charpos.
86 Fixes cursor positioning at the beginning of a line that begins
87 with a composed character.
88
9778ebcc
EZ
892011-08-18 Eli Zaretskii <eliz@gnu.org>
90
0be6ee06
EZ
91 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
92 character bidirectional type, use STRONG_L instead. Fixes crashes
93 in a buffer produced by `describe-categories'.
94
9778ebcc
EZ
95 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
96 members before the level stack, so they would be saved and
97 restored when copying iterator state. Fixes incorrect reordering
98 around TABs covered by display properties.
99
156bffbe
AS
1002011-08-18 Andreas Schwab <schwab@linux-m68k.org>
101
102 * process.c (Fnetwork_interface_list): Correctly determine buffer
103 size.
104
72ad093b
CY
1052011-08-17 Chong Yidong <cyd@stupidchicken.com>
106
107 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
108 (internal_condition_case_2, internal_condition_case_n):
109 Remove unnecessary aborts (Bug#9081).
72ad093b 110
35774242
EZ
1112011-08-17 Eli Zaretskii <eliz@gnu.org>
112
113 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
114 has no `load' handler, try opening the file locally. (Bug#9311)
115
db76dd85
KB
1162011-08-16 Ken Brown <kbrown@cornell.edu>
117
118 * gmalloc.c: Expand comment.
119
b215eee5
EZ
1202011-08-16 Eli Zaretskii <eliz@gnu.org>
121
122 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
123 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
124
a4579d33
KB
1252011-08-16 Ken Brown <kbrown@cornell.edu>
126
127 Fix memory allocation problems in Cygwin build (Bug#9273).
128
129 * unexcw.c ( __malloc_initialized): Declare external variable.
130 (fixup_executable): Force the dumped emacs to reinitialize malloc.
131
8b76d6f8
SM
132 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
133 New variables.
a4579d33
KB
134 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
135 dumped emacs.
136 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
137 in the static heap.
138 [CYGWIN] (special_realloc): New function.
139 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
140 requests to realloc storage in the static heap.
141
3ebec551
PE
1422011-08-15 Paul Eggert <eggert@cs.ucla.edu>
143
144 * bidi.c (bidi_initialize): Remove unused local.
145
9fd8be00
EZ
1462011-08-15 Eli Zaretskii <eliz@gnu.org>
147
474a8465
EZ
148 * biditype.h: File removed.
149
150 * bidimirror.h: File removed.
151
152 * deps.mk (bidi.o): Remove biditype.h and
153 bidimirror.h.
154
155 * makefile.w32-in ($(BLD)/bidi.$(O)): Remove biditype.h and
156 bidimirror.h.
157
158 * dispextern.h: Fix a typo in the comment to bidi_type_t.
159
160 * chartab.c: Improve commentary for the uniprop_table API.
161
32413314
EZ
162 * bidi.c (bidi_paragraph_init): Support zero value of
163 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
164 (bidi_initialize): Use uniprop_table instead of including
165 biditype.h and bidimirror.h.
32413314 166
9fd8be00
EZ
167 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
168 coordinates of the iterator when restoring from ppos_it.
169 (Bug#9296)
170
5cf2b69b
KH
1712011-08-14 Kenichi Handa <handa@m17n.org>
172
173 * process.c (create_process): Call setup_process_coding_systems
72ad093b 174 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 175
daf17d00
EZ
1762011-08-14 Eli Zaretskii <eliz@gnu.org>
177
178 * xdisp.c (move_it_in_display_line_to): Don't invoke
179 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
180 ppos_it. Fixes vertical cursor motion when line beginning is
181 covered by an image. (Bug#9296)
182
08e3161a
JD
1832011-08-14 Jan Djärv <jan.h.d@swipnet.se>
184
185 * nsterm.h (ns_run_ascript): Declare.
186 (NSAPP_DATA2_RUNASSCRIPT): Define.
187
188 * nsfns.m (as_script, as_result, as_status): New static variables.
189 (ns_run_ascript): New function.
190 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
191 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
192 the event loop. Get status from as_status (Bug#7276).
193
194 * nsterm.m (sendEvent): If event is NSApplicationDefined and
195 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
196 the event loop (Bug#7276).
197
a3720aa2
AS
1982011-08-14 Andreas Schwab <schwab@linux-m68k.org>
199
200 * gnutls.c (QCgnutls_bootprop_priority)
201 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
202 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
203 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
204 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
205 (QCgnutls_bootprop_verify_hostname_error)
206 (QCgnutls_bootprop_callbacks_verify): Rename from
207 Qgnutls_bootprop_..., all uses changed.
208
209 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
210 uses changed.
211
0a0d27fb
PE
2122011-08-14 Paul Eggert <eggert@cs.ucla.edu>
213
19d5c50c
PE
214 * xfaces.c (Qframe_set_background_mode): Now static.
215 * dispextern.h (Qframe_set_background_mode): Remove decl.
216
0a0d27fb
PE
217 * process.c (Fnetwork_interface_info): Declare local only if needed.
218
377538cb
JD
2192011-08-13 Jan Djärv <jan.h.d@swipnet.se>
220
221 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
222 (Fnetwork_interface_list): Allocate in increments of bytes instead
223 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
224 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
225 sockaddr.
226 (struct ifflag_def): notrailers is smart on OSX.
227 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
228 Get hardware address with getifaddrs if available.
229
08fff70c
EZ
2302011-08-12 Eli Zaretskii <eliz@gnu.org>
231
232 * xdisp.c (iterate_out_of_display_property): xassert that
233 IT->position is set to within IT->object's boundaries. Break from
234 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
235 when IT->position is set up wrongly due to some bug.
236 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
237 (push_display_prop): Allow GET_FROM_STRING as IT->method on
238 entry. Force push_it to save on the stack the current
239 buffer/string position, to be restored by pop_it. Fix flags in
240 the iterator structure wrt the object coming from a display
241 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
242 properties. (Bug#9284)
243
7be1c708 2442011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 245
7be1c708
CY
246 * fontset.c (fontset_get_font_group): Add proper type checks.
247 (Bug#9172)
aac0c6e3 248
7be1c708 2492011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 250
7be1c708
CY
251 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
252 and LC_VERSION_MIN_MACOSX.
253 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
254 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 255
97bb72a6
EZ
2562011-08-08 Eli Zaretskii <eliz@gnu.org>
257
258 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
259 no-display-properties-and-no-overlays under bidi display.
260 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 261 properties and overlays.
97bb72a6 262
d5617611
CY
2632011-08-08 Chong Yidong <cyd@stupidchicken.com>
264
37e11a63
CY
265 * editfns.c (Fset_time_zone_rule): Document relationship with the
266 setenv function.
267
d5617611
CY
268 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
269 the font entity extracted from the cache (Bug#8109).
270
58872834
CY
2712011-08-07 Chong Yidong <cyd@stupidchicken.com>
272
273 * composite.c (autocmp_chars): Don't reset point. That is done by
274 restore_point_unwind (Bug#5984).
275
75bfc667
JL
2762011-08-07 Juri Linkov <juri@jurta.org>
277
278 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
279 to show the arg `TIME' instead of `TIMEVAL'.
280
d1410150
EZ
2812011-08-06 Eli Zaretskii <eliz@gnu.org>
282
283 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
284 display property strides EOL and includes a newline, as in
285 longlines-mode. (Bug#9254)
75b771e4
EZ
286 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
287 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
288
289 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
290 is non-zero, even if the data buffer is NULL. Fixes a crash in
291 vertical-motion with longlines-mode. (Bug#9254)
292
35928349
EZ
2932011-08-05 Eli Zaretskii <eliz@gnu.org>
294
ec7cc85b
EZ
295 * bidi.c <bidi_cache_total_alloc>: Now static.
296 (bidi_initialize): Initialize bidi_cache_total_alloc.
297
8b76d6f8 298 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
299 cache. (Bug#9221)
300
301 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
302 amount allocated this far in `bidi_cache_total_alloc'.
303 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
304 non-zero, only free the data buffer without restoring the cache
305 contents. All callers changed.
306
307 * dispextern.h (bidi_unshelve_cache): Update prototype.
308
309 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
310 (move_it_in_display_line, move_it_to)
311 (move_it_vertically_backward, move_it_by_lines): Replace the call
312 to xfree to an equivalent call to bidi_unshelve_cache.
313 (move_it_in_display_line_to): Fix logic of returning
412b6358 314 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 315
e2e2423b
EZ
3162011-08-05 Eli Zaretskii <eliz@gnu.org>
317
318 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
319 came from a string character with a `cursor' property. (Bug#9229)
320
ae9e757a
JD
3212011-08-04 Jan Djärv <jan.h.d@swipnet.se>
322
323 * Makefile.in (LIB_PTHREAD): New variable.
324 (LIBES): Add LIB_PTHREAD (Bug#9216).
325
326 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
327 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
328
213bd7f2
AS
3292011-08-04 Andreas Schwab <schwab@linux-m68k.org>
330
331 * regex.c (re_iswctype): Remove some redundant boolean
332 conversions.
333
99aaf75f
JD
3342011-08-04 Jan Djärv <jan.h.d@swipnet.se>
335
336 * xterm.c (x_find_topmost_parent): New function.
337 (x_set_frame_alpha): Find topmost parent window with
338 x_find_topmost_parent and set the property there also (bug#9181).
339 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
340
c74e9d86
PE
3412011-08-04 Paul Eggert <eggert@cs.ucla.edu>
342
343 * callproc.c (Fcall_process): Avoid vfork clobbering
344 the local vars buffer, coding_systems, current_dir.
345
640c8776
SM
3462011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
347
348 * keymap.c (Fmake_composed_keymap): Move to subr.el.
349
f26d0e4c
PE
3502011-08-03 Paul Eggert <eggert@cs.ucla.edu>
351
8a10d76c
PE
352 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
353 so that it is not optimized away.
354
f26d0e4c
PE
355 * xdisp.c (compute_display_string_pos): Remove unused local.
356
55439c61
EZ
3572011-08-02 Eli Zaretskii <eliz@gnu.org>
358
359 Fix slow cursor motion and scrolling in large buffers with
360 selective display, like Org Mode buffers. (Bug#9218)
361
362 * dispextern.h (struct bidi_it): New member disp_prop_p.
363
364 * xdisp.c: Remove one-slot cache of display string positions.
365 (compute_display_string_pos): Accept an additional argument
366 DISP_PROP_P; callers changed. Scan at most 5K characters forward
367 for a display string or property. If found, set DISP_PROP_P
368 non-zero.
369
370 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
371 DISP_PROP_P, and pass it to compute_display_string_pos.
372 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
373 non-zero. All callers of bidi_fetch_char changed.
374
fb33fa43
SM
3752011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
376
377 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
378
b099e063
DM
3792010-12-03 Don March <don@ohspite.net>
380
381 * keymap.c (Fdefine_key): Fix non-prefix key error message when
382 last character M-[char] is translated to ESC [char] (bug#7541).
383
5cc7f7af
KH
3842011-08-02 Kenichi Handa <handa@m17n.org>
385
d0fffa3f 386 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
387
388 * chartab.c (uniprop_table): Make it non-static.
389
525d5e6e
EZ
3902011-08-01 Eli Zaretskii <eliz@gnu.org>
391
392 * xdisp.c (forward_to_next_line_start): Accept additional argument
393 BIDI_IT_PREV, and store into it the state of the bidi iterator had
394 on the newline.
395 (reseat_at_next_visible_line_start): Use the bidi iterator state
396 returned by forward_to_next_line_start to restore the state of
397 it->bidi_it after backing up to previous newline. (Bug#9212)
398
31011111
AS
3992011-07-30 Andreas Schwab <schwab@linux-m68k.org>
400
401 * regex.c (re_comp): Protoize.
402 (re_exec): Fix return type.
403 (regexec): Fix type of `ret'. (Bug#9203)
404
e5d76069
PE
4052011-07-29 Paul Eggert <eggert@cs.ucla.edu>
406
407 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
408 This is needed if max-image-size is a floating-point number.
409
9a79b20c
AS
4102011-07-28 Andreas Schwab <schwab@linux-m68k.org>
411
412 * print.c (print_object): Print empty symbol as ##.
413
414 * lread.c (read1): Read ## as empty symbol.
415
d8c2fa78
AA
4162011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
417
418 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
419 setting frame foreground color (Bug#9175).
420 (x_set_background_color): Likewise.
421
ffe57a7a
AA
422 * nsmenu.m (-setText): Size tooltip dimensions precisely to
423 contents (Bug#9176).
424 (EmacsTooltip -init): Remove bezels and add shadows to
425 tooltip windows.
426
bf3492a5
AA
427 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
428 or scroll bar (Bug#8470).
429
d55e9c53
AA
430 * nsfont.m (nsfont_open): Remove assignment to voffset and
431 unnecessary vars hshink, expand, hd, full_height, min_height.
432 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
433
434 * nsterm.h (nsfont_info): Remove voffset field.
435
d8c2fa78 4362011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
437
438 Implement strike-through and overline on NextStep (Bug#8863).
439
440 * nsfont.m (nsfont_open): Use underline position provided by font,
441 instead of hard-coded value of 2.
442 (nsfont_draw): Call ns_draw_text_decoration instead.
443
444 * nsterm.h: Add declaration for ns_draw_text_decoration.
445
446 * nsterm.m (ns_draw_text_decoration): New function for drawing
447 underline, overline, and strike-through.
448 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
449 ns_draw_text_decoration. Change treatment of cursor drawing to
450 accomodate underlining, etc.
451
4cc60b9b
EZ
4522011-07-28 Eli Zaretskii <eliz@gnu.org>
453
bc7ece87
EZ
454 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
455 default.
4cc60b9b 456
476371c4
PE
4572011-07-28 Paul Eggert <eggert@cs.ucla.edu>
458
66606eea
PE
459 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
460 Without this fix, if a signal arrives just after memory fills up,
461 'malloc' might be invoked reentrantly.
462
476371c4
PE
463 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
464 In other words, assume that every image size is allowed, on non-X
465 hosts. This assumption is probably wrong, but it lets Emacs compile.
466
f3fcc40d
AS
4672011-07-28 Andreas Schwab <schwab@linux-m68k.org>
468
469 * regex.c (re_iswctype): Convert return values to boolean.
470
350c992f
EZ
4712011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
472
473 * xdisp.c (compute_display_string_pos): Don't use cached display
474 string position if the buffer had its restriction changed.
475 (Bug#9184)
476
5266b4bb
PE
4772011-07-28 Paul Eggert <eggert@cs.ucla.edu>
478
479 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
480
2573a837 4812011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 482
41f55ccd 483 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 484
39e378da
PE
485 * bidi.c: Integer size and overflow fixes.
486 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
487 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
488 (bidi_cache_find_level_change, bidi_cache_ensure_space)
489 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
490 (bidi_find_other_level_edge):
491 Use ptrdiff_t instead of EMACS_INT where either will do.
492 This works better on 32-bit hosts configured --with-wide-int.
493 (bidi_cache_ensure_space): Check for size-calculation overflow.
494 Use % rather than repeated addition, for better worst-case speed.
495 Don't set bidi_cache_size until after xrealloc returns, because it
496 might not return.
497 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
498 (bidi_cache_ensure_space): Also check that the bidi cache size
499 does not exceed that of the largest Lisp string or buffer. See Eli
500 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 501
5e927815
PE
502 * alloc.c (__malloc_size_t): Remove.
503 All uses replaced by size_t. See Andreas Schwab's note
504 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
505
ca4aa935
PE
506 * image.c: Improve checking for integer overflow.
507 (check_image_size): Assume that f is nonnull, since
508 it is always nonnull in practice. This is one less thing to
509 worry about when checking for integer overflow later.
510 (x_check_image_size): New function, which checks for integer
511 overflow issues inside X.
512 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
513 This removes the need for a memory_full check.
514 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
515 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
516 (xbm_read_bitmap_data): Change locals back to 'int', since
517 their values must fit in 'int'.
518 (xpm_load_image, png_load, tiff_load):
519 Invoke x_create_x_image_and_pixmap earlier,
520 to avoid much needless work if the image is too large.
521 (tiff_load): Treat overly large images as if
522 x_create_x_image_and_pixmap failed, not as malloc failures.
523 (gs_load): Use x_check_image_size.
524
5f8f9cc2
PE
525 * gtkutil.c: Omit integer casts.
526 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
527 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
528
5adf60bc
PE
529 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
530
c8907a93
PE
531 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
532 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
533 would wrongly return t on a 64-bit host.
534
e3c25c68
PE
535 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
536 The plain *_OVERFLOW macros run afoul of GCC bug 49705
537 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
538 and therefore cause GCC to emit a bogus diagnostic in some cases.
539
3f791afe
PE
540 * image.c: Integer signedness and overflow and related fixes.
541 This is not an exhaustive set of fixes, but it's time to
542 record what I've got.
543 (lookup_pixel_color, check_image_size): Remove redundant decls.
544 (check_image_size): Don't assume that arbitrary EMACS_INT values
545 fit in 'int', or that arbitrary 'double' values fit in 'int'.
546 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
547 (tiff_load, imagemagick_load_image):
548 Check for overflow in size calculations.
549 (x_create_x_image_and_pixmap): Remove unnecessary test for
550 xmalloc returning NULL; that can't happen.
551 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
552 (xpm_color_bucket): Use better integer hashing function.
553 (xpm_cache_color): Don't possibly over-allocate memory.
554 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
555 (gif_memory_source):
556 Use ptrdiff_t, not int or size_t, to record sizes.
557 (png_load): Don't assume values greater than 2**31 fit in 'int'.
558 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
559 either works, as we prefer signed integers.
560 (tiff_read_from_memory, tiff_write_from_memory):
561 Return tsize_t, not size_t, since that's what the TIFF API wants.
562 (tiff_read_from_memory): Don't fail simply because the read would
563 go past EOF; instead, return a short read.
564 (tiff_load): Omit no-longer-needed casts.
565 (Fimagemagick_types): Don't assume size fits into 'int'.
566
3cc5a532
PE
567 Improve hashing quality when configured --with-wide-int.
568 * fns.c (hash_string): New function, taken from sxhash_string.
569 Do not discard information about ASCII character case; this
570 discarding is no longer needed.
571 (sxhash-string): Use it. Change sig to match it. Caller changed.
572 * lisp.h: Declare it.
573 * lread.c (hash_string): Remove, since we now use fns.c's version.
574 The fns.c version returns a wider integer if --with-wide-int is
575 specified, so this should help the quality of the hashing a bit.
576
b312a492
PE
577 * emacs.c: Integer overflow minor fix.
578 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
579 Define only if GNU_LINUX.
580 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
581
dfd153ae
PE
582 * dispnew.c: Integer signedness and overflow fixes.
583 Remove unnecessary forward decls, that were a maintenance hassle.
584 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
585 All uses changed.
586 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
587 (scrolling_window): Use ptrdiff_t, not int, for byte count.
588 (prepare_desired_row, line_draw_cost):
589 Use int, not unsigned, where either works.
590 (save_current_matrix, restore_current_matrix):
591 Use ptrdiff_t, not size_t, where either works.
592 (init_display): Check for overflow more accurately, and without
593 relying on undefined behavior.
594
a81d11a3
PE
595 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
596 Remove, replacing with the new symbols in lisp.h. All uses changed.
597 * fileio.c (make_temp_name):
598 * filelock.c (lock_file_1, lock_file):
599 * xdisp.c (message_dolog):
600 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
601 Use pMd etc. instead.
602 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
603 replacing the pWIDE etc. symbols removed from editfns.c.
604
3300e6fd
PE
605 * keyboard.h (num_input_events): Now uintmax_t.
606 This is (very slightly) less likely to mess up due to wraparound.
607 All uses changed.
608
fd05c7e9
PE
609 * buffer.c: Integer signedness fixes.
610 (alloc_buffer_text, enlarge_buffer_text):
611 Use ptrdiff_t rather than size_t when either will do, as we prefer
612 signed integers.
613
903fe15d
PE
614 * alloc.c: Integer signedness and overflow fixes.
615 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
616 (__malloc_size_t): Default to size_t, not to int.
617 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
618 (Fgarbage_collect, mark_object_loop_halt, mark_object):
619 Prefer ptrdiff_t to size_t when either would do, as we prefer
620 signed integers.
621 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
622 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
623 Now const. Initialize with values that are in range even if char
624 is signed.
625 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
626 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
627 These functions do the right thing with sizes > 2**32.
628 (check_depth): Now ptrdiff_t, not int.
629 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
630 Adjust to new way of storing sizes. Check for size overflow bugs
631 in rest of code.
632 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
633 slightly wrong anyway, as it missed one instance of
634 XMALLOC_OVERRUN_CHECK_OVERHEAD.
635 (refill_memory_reserve): Omit needless cast to size_t.
636 (mark_object_loop_halt): Mark as externally visible.
637
ac82cc6a
PE
638 * xselect.c: Integer signedness and overflow fixes.
639 (Fx_register_dnd_atom, x_handle_dnd_message):
640 Use ptrdiff_t, not size_t, since we prefer signed.
641 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
642 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
643 x_dnd_atoms_size and x_dnd_atoms_length.
644
c2d1e36d
PE
645 * doprnt.c: Prefer signed to unsigned when either works.
646 * eval.c (verror):
647 * doprnt.c (doprnt):
648 * lisp.h (doprnt):
649 * xdisp.c (vmessage):
650 Use ptrdiff_t, not size_t, when using or implementing doprnt,
651 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
652 prefer signed arithmetic to avoid comparison confusion.
653 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
654 but is a bit tricky.
655
0e926e56
PE
656 Assume freestanding C89 headers, string.h, stdlib.h.
657 * data.c, doprnt.c, floatfns.c, print.c:
658 Include float.h unconditionally.
659 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
660 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
661 * regex.c: Likewise for stddef.h, string.h.
662 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
663 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
664 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
665 (STDC_HEADERS): Remove obsolete defines.
666 * sysdep.c: Include limits.h unconditionally.
667
9cfdb3ec
PE
668 Assume support for memcmp, memcpy, memmove, memset.
669 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
670 * regex.c (memcmp, memcpy):
671 Remove; we assume C89 now.
672
673 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
674 (__malloc_safe_bcopy): Remove; no longer needed.
675
cf950e6b 676 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
677 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
678 well either way, and we prefer signed to unsigned.
679
dbf38e02
LMI
6802011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
681
682 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
683 closes the connection while we're reading (bug#9182).
684
d6f0886c
JD
6852011-07-25 Jan Djärv <jan.h.d@swipnet.se>
686
687 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
688 are specified (Bug#9168).
689
2eb1f9e6
PE
6902011-07-25 Paul Eggert <eggert@cs.ucla.edu>
691
692 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
693 Found by GCC static checking and --with-wide-int on a 32-bit host.
694
22381272 6952011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
696
697 * xdisp.c (compute_display_string_pos): Fix logic of caching
698 previous display string position. Initialize cached_prev_pos to
699 -1. Fixes slow-down at the beginning of a buffer.
700
f25e39b4
EZ
7012011-07-24 Eli Zaretskii <eliz@gnu.org>
702
703 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
704 for attrs[LFACE_FONTSET_INDEX].
705
04c4b52e
PE
7062011-07-23 Paul Eggert <eggert@cs.ucla.edu>
707
708 * xml.c (parse_region): Remove unused local
709 that was recently introduced.
710
c1734fbd
EZ
7112011-07-23 Eli Zaretskii <eliz@gnu.org>
712
be18c5a5
EZ
713 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
714 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
715
c1734fbd
EZ
716 * xdisp.c (move_it_in_display_line_to): Record the best matching
717 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
718 exit if none of the characters scanned was an exact match.
719 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
720 when exact match is impossible due to invisible text, and the
721 lines are truncated.
722
a258d627
JD
7232011-07-23 Jan Djärv <jan.h.d@swipnet.se>
724
725 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
726 for OSX >= 10.7.
727
b6d5a689
EZ
7282011-07-22 Eli Zaretskii <eliz@gnu.org>
729
0f74f785
EZ
730 Fix a significant slow-down of cursor motion with C-n, C-p,
731 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
732 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 733 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
734 (next_element_from_buffer): Call compute_stop_pos_backwards to
735 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
736 base_level_stop.
737 (reseat): Don't look for prev_stop, as that could mean a very long
738 run.
739 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
740 <cached_disp_overlay_modiff>: Cache for last found display string
741 position.
551918c1 742 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
743 about the same buffer in the same area of character positions, and
744 the buffer wasn't changed since the time the display string
745 position was cached.
551918c1 746
b2d0c91a
EZ
7472011-07-22 Eli Zaretskii <eliz@gnu.org>
748
749 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
750 is an integer, which is important for empty lines. (Bug#9149)
751
043604ee
CY
7522011-07-22 Chong Yidong <cyd@stupidchicken.com>
753
754 * frame.c (Fmodify_frame_parameters): In tty case, update the
755 default face if necessary (Bug#4238).
756
da4adb04
CY
7572011-07-21 Chong Yidong <cyd@stupidchicken.com>
758
759 * editfns.c (Fstring_to_char): No need to explain what a character
760 is in the docstring (Bug#6576).
761
9abd0532
LMI
7622011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
763
764 * xml.c (parse_region): Make sure we always return a tree.
765
36881d16
HK
7662011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
767
768 * xml.c (parse_region): If a document contains only comments,
769 return that, too.
770
1e98674d
LMI
7712011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
772
773 * xml.c (make_dom): Return comments, too.
774
590bd467
PE
7752011-07-19 Paul Eggert <eggert@cs.ucla.edu>
776
777 Port to OpenBSD.
778 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
779 and the surrounding thread.
780 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
781 rather than fgets, and retry after EINTR. Otherwise, 'emacs
782 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
783 timer goes off.
784 * s/openbsd.h (BROKEN_SIGIO): Define.
785 * unexelf.c (unexec) [__OpenBSD__]:
786 Don't update the .mdebug section of the Alpha COFF symbol table.
787
f41628b2
LMI
7882011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
789
790 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
791 (bug#8460).
792
b59b67c5
PE
7932011-07-18 Paul Eggert <eggert@cs.ucla.edu>
794
15e3a074
PE
795 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
796 This fixes some race conditions on the permissions of any newly
797 created file.
798
41bed37d
PE
799 * alloc.c (valid_pointer_p): Use pipe, not open.
800 This fixes some permissions issues when debugging.
801
b59b67c5
PE
802 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
803 If fchown fails to set both uid and gid, try to set just gid,
804 as that is sometimes allowed. Adjust the file's mode to eliminate
805 setuid or setgid bits that are inappropriate if fchown fails.
806
925a6be7
SM
8072011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
808
809 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
810 to compare Lisp_Objects.
811 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
812 global_gnutls_log_level, don't mistake it for a Lisp_Object.
813 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
814
52968808
AS
8152011-07-17 Andreas Schwab <schwab@linux-m68k.org>
816
0a6a104b
AS
817 * lread.c (read_integer): Unread even EOF character.
818 (read1): Likewise. Properly record start position of symbol.
819
52968808
AS
820 * lread.c (read1): Read `#:' as empty uninterned symbol if no
821 symbol character follows.
822
9e381cdd
PE
8232011-07-17 Paul Eggert <eggert@cs.ucla.edu>
824
825 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
826 This works around a problem with the previous change to Fcopy_file.
827 Recent glibc declares fchown with __attribute__((warn_unused_result)),
828 and without this change, GCC might complain about discarding
829 fchown's return value.
830
b5641435
JB
8312011-07-16 Juanma Barranquero <lekktu@gmail.com>
832
833 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
834
a8031457
PE
8352011-07-16 Paul Eggert <eggert@cs.ucla.edu>
836
837 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
838
dd889327
LMI
8392011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
840
750c33f7
LMI
841 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
842 it's used from the C level.
843
dd889327
LMI
844 * process.c: Use the same condition for POLL_FOR_INPUT in both
845 keyboard.c and process.c (bug#1858).
846
87e86684
LM
8472011-07-09 Lawrence Mitchell <wence@gmx.li>
848
849 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
850 (Fgnutls_boot): Use it.
851
64348f40
AS
8522011-07-15 Andreas Schwab <schwab@linux-m68k.org>
853
854 * doc.c (Fsubstitute_command_keys): Revert last change.
855
1d698799
LMI
8562011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
857
f863868c
LMI
858 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
859 quotes the next character, and doesn't affect other longer
860 sequences (bug#8935).
861
1d698799
LMI
862 * lread.c (syms_of_lread): Clarify that is isn't only
863 `eval-buffer' and `eval-defun' that's affected by
864 `lexical-binding' (bug#8460).
865
aa4b6df6
EZ
8662011-07-15 Eli Zaretskii <eliz@gnu.org>
867
868 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
869 bidi redisplay when a line includes both an image and is
870 truncated.
871
5d856da6
PE
8722011-07-14 Paul Eggert <eggert@cs.ucla.edu>
873
ad6042bb
PE
874 Fix minor problems found by static checking.
875 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
876 (elsz): Now a signed constant, not a size_t var. We prefer signed
877 types to unsigned, to avoid integer comparison confusion. Without
878 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
879 "cannot optimize loop, the loop counter may overflow", a symptom
880 of the confusion.
f00bbb22 881 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
882 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
883
6468f31c
LMI
8842011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
885
49080b10
LMI
886 * search.c (Fre_search_backward): Mention `case-fold-search' in
887 all the re_search_* functions (bug#8138).
888
6468f31c
LMI
889 * keyboard.c (Fopen_dribble_file): Document when the file is
890 closed (bug#8056).
891
c965adc5
EZ
8922011-07-14 Eli Zaretskii <eliz@gnu.org>
893
df9733bf
EZ
894 * bidi.c (bidi_dump_cached_states): Fix format of displaying
895 bidi_cache_idx.
896
0bb23927
EZ
897 Support bidi reordering of display and overlay strings.
898 * xdisp.c (compute_display_string_pos)
899 (compute_display_string_end): Accept additional argument STRING.
900 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
901 (reseat_to_string): Initialize bidi_it->string.s and
902 bidi_it->string.schars.
903 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
904 NULL (avoids a crash in bidi_paragraph_init).
905 Initialize itb.string.lstring.
0bb23927
EZ
906 (init_iterator): Call bidi_init_it only of a valid
907 buffer position was specified. Initialize paragraph_embedding to
908 L2R.
909 (reseat_to_string): Initialize the bidi iterator.
910 (display_string): If we need to ignore text properties of
911 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
912 original value of -1 will not work with bidi.)
913 (compute_display_string_pos): First arg is now struct
914 `text_pos *'; all callers changed. Support display properties on
915 Lisp strings.
916 (compute_display_string_end): Support display properties on Lisp
917 strings.
918 (init_iterator, reseat_1, reseat_to_string): Initialize the
919 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
920 when iterating on a string not from display properties).
640c8776
SM
921 (compute_display_string_pos, compute_display_string_end):
922 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
923 arrow keys.
924 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
925 base_level_stop; instead, set base_level_stop to BEGV.
926 Fixes crashes in vertical-motion.
0bb23927
EZ
927 (next_element_from_buffer): Improve commentary for when
928 the iterator is before prev_stop.
929 (init_iterator): Initialize bidi_p from the default value of
930 bidi-display-reordering, not from buffer-local value. Use the
931 buffer-local value only if initializing for buffer iteration.
932 (handle_invisible_prop): Support invisible properties on strings
933 that are being bidi-reordered.
934 (set_iterator_to_next): Support bidi reordering of C strings and
935 Lisp strings.
936 (next_element_from_string): Support bidi reordering of Lisp
937 strings.
938 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
939 (display_string): Support display of R2L glyph rows.
940 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
941 (init_iterator): Don't initialize it->bidi_p for strings
942 here.
943 (reseat_to_string): Initialize it->bidi_p for strings here.
944 (next_element_from_string, next_element_from_c_string)
945 (next_element_from_buffer): Add xassert's for correspondence
946 between IT's object being iterated and it->bidi_it.string
947 structure.
948 (face_before_or_after_it_pos): Support bidi iteration.
949 (next_element_from_c_string): Handle the case of the first string
950 character that is not the first one in the visual order.
951 (get_visually_first_element): New function, refactored from common
952 parts of next_element_from_buffer, next_element_from_string, and
953 next_element_from_c_string.
954 (tool_bar_lines_needed, redisplay_tool_bar)
955 (display_menu_bar): Force left-to-right direction. Add a FIXME
956 comment for making that be controlled by a user option.
957 (push_it, pop_it): Save and restore the state of the
958 bidi iterator. Save and restore the bidi_p flag.
959 (pop_it): Iterate out of display property for string iteration as
960 well.
961 (iterate_out_of_display_property): Support iteration over strings.
962 (handle_single_display_spec): Set up it->bidi_it for iteration
963 over a display string, and call bidi_init_it.
964 (handle_single_display_spec, next_overlay_string)
965 (get_overlay_strings_1, push_display_prop): Set up the bidi
966 iterator for displaying display or overlay strings.
967 (forward_to_next_line_start): Don't use the shortcut if
968 bidi-iterating.
969 (back_to_previous_visible_line_start): If handle_display_prop
970 pushed the iterator stack, restore the internal state of the bidi
971 iterator by calling bidi_pop_it same number of times.
972 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
973 and we are bidi-iterating, don't decrement the iterator position;
974 instead, set the first_elt flag in the bidi iterator, to produce
975 the same effect.
976 (reseat_1): Remove redundant setting of string_from_display_prop_p.
977 (push_display_prop): xassert that we are iterating a buffer.
978 (push_it, pop_it): Save and restore paragraph_embedding member.
979 (handle_single_display_spec, next_overlay_string)
980 (get_overlay_strings_1, reseat_1, reseat_to_string)
981 (push_display_prop): Set up the `unibyte' member of bidi_it.string
982 correctly. Don't assume unibyte strings are not bidi-reordered.
983 (compute_display_string_pos)
984 (compute_display_string_end): Fix handling the case of C string.
985 (push_it, pop_it): Save and restore from_disp_prop_p.
986 (handle_single_display_spec, push_display_prop): Set the
987 from_disp_prop_p flag.
988 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
989 (pop_it): Call iterate_out_of_display_property only if we are
990 popping after iteration over a string that came from a display
991 property. Fix a typo in popping stretch info. Add an assertion
992 for verifying that the iterator position is in sync with the bidi
993 iterator.
994 (handle_single_display_spec, get_overlay_strings_1)
995 (push_display_prop): Fix initialization of paragraph direction for
996 string when that of the parent object is not yet determined.
997 (reseat_1): Call bidi_init_it to resync the bidi
998 iterator with IT's position. (Bug#7616)
999 (find_row_edges): If ROW->start.pos gives position
1000 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
1001 (handle_stop, back_to_previous_visible_line_start, reseat_1):
1002 Reset the from_disp_prop_p flag.
1003 (SAVE_IT, RESTORE_IT): New macros.
1004 (pos_visible_p, face_before_or_after_it_pos)
1005 (back_to_previous_visible_line_start)
1006 (move_it_in_display_line_to, move_it_in_display_line)
1007 (move_it_to, move_it_vertically_backward, move_it_by_lines)
1008 (try_scrolling, redisplay_window, display_line): Use them when
1009 saving a temporary copy of the iterator and restoring it back.
1010 (back_to_previous_visible_line_start, reseat_1)
1011 (init_iterator): Empty the bidi cache "stack".
1012 (move_it_in_display_line_to): If iterator ended up at
1013 EOL, but we never saw any buffer positions smaller than
1014 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
1015 motion in bidi-reordered lines.
1016 (move_it_in_display_line_to): Record prev_method and prev_pos
1017 immediately before the call to set_iterator_to_next. Fixes cursor
1018 motion in bidi-reordered lines with stretch glyphs and strings
1019 displayed in margins. (Bug#8133) (Bug#8867)
1020 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
1021 TO_CHARPOS.
640c8776
SM
1022 (pos_visible_p): Support positions in bidi-reordered lines.
1023 Save and restore bidi cache.
0bb23927
EZ
1024
1025 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
1026 (bidi_paragraph_info): Delete unused struct.
1027 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
1028 (bidi_cache_start): New variable.
1029 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
1030 to zero.
1031 (bidi_cache_fetch_state, bidi_cache_search)
1032 (bidi_cache_find_level_change, bidi_cache_iterator_state)
1033 (bidi_cache_find, bidi_peek_at_next_level)
1034 (bidi_level_of_next_char, bidi_find_other_level_edge)
1035 (bidi_move_to_visually_next): Compare cache index with
1036 bidi_cache_start rather than with zero.
1037 (bidi_fetch_char): Accept new argument STRING; all callers
1038 changed. Support iteration over a string. Support strings with
1039 display properties. Support unibyte strings. Fix the type of
1040 `len' according to what STRING_CHAR_AND_LENGTH expects.
1041 (bidi_paragraph_init, bidi_resolve_explicit_1)
1042 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
1043 (bidi_level_of_next_char, bidi_move_to_visually_next):
1044 Support iteration over a string.
0bb23927
EZ
1045 (bidi_set_sor_type, bidi_resolve_explicit_1)
1046 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
1047 can now be zero (for strings); special values 0 and -1 were
1048 changed to -1 and -2, respectively.
1049 (bidi_char_at_pos): New function.
1050 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
1051 Call it instead of FETCH_MULTIBYTE_CHAR.
1052 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
1053 initialized to valid values.
1054 (bidi_init_it): Don't initialize charpos and bytepos with invalid
1055 values.
1056 (bidi_level_of_next_char): Allow the sentinel "position" to pass
1057 the test for valid cached positions. Fix the logic for looking up
1058 the sentinel state in the cache. GCPRO the Lisp string we are
1059 iterating.
1060 (bidi_push_it, bidi_pop_it): New functions.
1061 (bidi_initialize): Initialize the bidi cache start stack pointer.
1062 (bidi_cache_ensure_space): New function, refactored from part of
1063 bidi_cache_iterator_state. Don't assume the required size is just
1064 one BIDI_CACHE_CHUNK away.
1065 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
1066 (bidi_count_bytes, bidi_char_at_pos): New functions.
1067 (bidi_cache_search): Don't assume bidi_cache_last_idx is
1068 always valid if bidi_cache_idx is valid.
1069 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
1070 is valid if it's going to be used.
1071 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
1072 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
1073 (bidi_cache_find_level_change, bidi_cache_ensure_space)
1074 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
1075 (bidi_find_other_level_edge, bidi_cache_start_stack):
1076 All variables related to cache indices are now EMACS_INT.
c965adc5 1077
0bb23927
EZ
1078 * dispextern.h (struct bidi_string_data): New structure.
1079 (struct bidi_it): New member `string'. Make flag members be 1-bit
1080 fields, and put them last in the struct.
640c8776
SM
1081 (compute_display_string_pos, compute_display_string_end):
1082 Update prototypes.
0bb23927
EZ
1083 (bidi_push_it, bidi_pop_it): Add prototypes.
1084 (struct iterator_stack_entry): New members bidi_p,
1085 paragraph_embedding, and from_disp_prop_p.
1086 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
1087 (bidi_shelve_cache, bidi_unshelve_cache):
1088 Declare prototypes.
0bb23927
EZ
1089
1090 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
1091 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
1092 and vector-like objects.
1093
1094 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
1095 cache around display iteration.
1096
1097 * window.c (Fwindow_end, window_scroll_pixel_based)
1098 (displayed_window_lines, Frecenter): Save and restore the bidi
1099 cache around display iteration.
1100
3bbd2265
LMI
11012011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
1102
1103 * editfns.c (Fdelete_region): Clarify the use of the named
1104 parameters (bug#6788).
1105
adc47434
MR
11062011-07-14 Martin Rudalics <rudalics@gmx.at>
1107
1108 * indent.c (Fvertical_motion): Set and restore w->pointm when
1109 saving and restoring the window's buffer (Bug#9006).
1110
837c31f8
LMI
11112011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
1112
1113 * editfns.c (Fstring_to_char): Clarify just what is returned
1114 (bug#6576). Text by Eli Zaretskii.
1115
ac389d0c
JB
11162011-07-13 Juanma Barranquero <lekktu@gmail.com>
1117
1118 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
1119
0be0ce47
EZ
11202011-07-13 Eli Zaretskii <eliz@gnu.org>
1121
1122 * buffer.c (mmap_find): Fix a typo.
1123
cd18e7e3
JB
11242011-07-13 Johan Bockgård <bojohan@gnu.org>
1125
1126 Fix execution of x selection hooks.
1127 * xselect.c (Qx_lost_selection_functions)
1128 (Qx_sent_selection_functions): New vars.
1129 (syms_of_xselect): DEFSYM them.
1130 (x_handle_selection_request): Pass Qx_sent_selection_functions
1131 rather than Vx_sent_selection_functions to Frun_hook_with_args.
1132 (x_handle_selection_clear,x_clear_frame_selections):
1133 Pass Qx_lost_selection_functions rather than
1134 Vx_lost_selection_functions to Frun_hook_with_args.
1135
47ea7f44
PE
11362011-07-13 Paul Eggert <eggert@cs.ucla.edu>
1137
ac389d0c 1138 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
1139 The old code sometimes used this field without initializing it.
1140
47ea7f44
PE
1141 * alloc.c (gc_sweep): Don't read past end of array.
1142 In theory, the old code could also have corrupted Emacs internals,
1143 though it'd be very unlikely.
1144
bc985c87
AS
11452011-07-12 Andreas Schwab <schwab@linux-m68k.org>
1146
1147 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 1148 argument. (Bug#4026)
bc985c87 1149
0cf34688
LMI
11502011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
1151
b3dadd76
LMI
1152 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
1153 key" (bug#4257).
1154
0cf34688
LMI
1155 * window.c (Fset_window_start): Doc fix (bug#4199).
1156 (Fset_window_hscroll): Ditto.
1157
270768cd
PE
11582011-07-12 Paul Eggert <eggert@cs.ucla.edu>
1159
077e3dda 1160 Fix minor new problems caught by GCC 4.6.1.
270768cd 1161 * term.c (init_tty): Remove unused local.
490011a6 1162 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 1163 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 1164 not used otherwise.
270768cd 1165
b1f58454
CY
11662011-07-12 Chong Yidong <cyd@stupidchicken.com>
1167
1168 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
1169
22b9578d
LMI
11702011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
1171
6e70ab07
LMI
1172 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
1173 are the mini-buffer and the echo area (bug#3320).
1174
22b9578d
LMI
1175 * term.c (init_tty): Remove support for supdup, c10 and perq
1176 terminals, which are no longer supported (bug#1482).
1177
8974cc9f
JB
11782011-07-10 Johan Bockgård <bojohan@gnu.org>
1179
1180 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
1181
a560d974
JD
11822011-07-10 Jan Djärv <jan.h.d@swipnet.se>
1183
1184 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
1185 for non-popups (Bug#3642).
1186
1dae0f0a
AS
11872011-07-10 Andreas Schwab <schwab@linux-m68k.org>
1188
268c2c36 1189 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 1190 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
1191 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
1192 * cm.c (losecursor): Likewise.
1dae0f0a
AS
1193 * data.c (fmod): Likewise.
1194 * dispnew.c (swap_glyphs_in_rows): Likewise.
1195 * emacs.c (memory_warning_signal): Likewise.
1196 * floatfns.c (float_error): Likewise.
1197 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
1198 (otf_open, font_otf_capability, generate_otf_features)
1199 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
1200 Likewise.
1201 * image.c (pbm_read_file): Likewise.
1202 * indent.c (string_display_width): Likewise.
1203 * intervals.c (check_for_interval, search_for_interval)
1204 (inc_interval_count, count_intervals, root_interval)
1205 (adjust_intervals_for_insertion, make_new_interval): Likewise.
1206 * lread.c (defalias): Likewise.
268c2c36 1207 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
1208 * regex.c (set_image_of_range_1, set_image_of_range)
1209 (regex_grow_registers): Likewise.
1210 * sysdep.c (strerror): Likewise.
1211 * termcap.c (valid_filename_p, tprint, main): Likewise.
1212 * tparam.c (main): Likewise.
1213 * unexhp9k800.c (run_time_remap, save_data_space)
1214 (update_file_ptrs, read_header, write_header, calculate_checksum)
1215 (copy_file, copy_rest, display_header): Likewise.
1216 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
1217 Likewise.
1218 * xdisp.c (check_it): Likewise.
1219 * xfaces.c (register_color, unregister_color, unregister_colors):
1220 Likewise.
1221 * xfns.c (print_fontset_result): Likewise.
1222 * xrdb.c (member, fatal, main): Likewise.
1223
99033785
PE
12242011-07-10 Paul Eggert <eggert@cs.ucla.edu>
1225
1226 Fix minor problems found by static checking (Bug#9031).
1227 * chartab.c (char_table_set_range, map_sub_char_table):
1228 Remove unused locals.
1229 (uniprop_table): Now static.
1230 * composite.c (_work_char): Remove unused static var.
1231
9cb2ac56
JB
12322011-07-09 Juanma Barranquero <lekktu@gmail.com>
1233
1234 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
1235
f25661f0
JD
12362011-07-09 Jan Djärv <jan.h.d@swipnet.se>
1237
1238 * gtkutil.c (qttip_cb): Remove code without function.
1239
8278c4fe
EZ
12402011-07-09 Eli Zaretskii <eliz@gnu.org>
1241
1242 * w32.c (pthread_sigmask): New stub.
1243
1692ae2d 12442011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 1245
8a6ebd58 1246 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
1247 sigprocmask is portable only for single-threaded applications, and
1248 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
1249 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
1250 (LIBES): Use it.
1251 * callproc.c (Fcall_process):
1252 * process.c (create_process):
1253 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
1254 Use pthread_sigmask, not sigprocmask.
123403e4 1255
1b854618
JD
12562011-07-08 Jan Djärv <jan.h.d@swipnet.se>
1257
1258 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
1259 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
1260 wrong (Bug#8591).
1261
3fe4b549
JD
12622011-07-08 Jan Djärv <jan.h.d@swipnet.se>
1263
0ce7e563
JD
1264 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
1265 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
1266 (xg_hide_tooltip): Fix comment.
1267
3fe4b549
JD
1268 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
1269 in registerServicesMenuSendTypes.
1270 (validRequestorForSendType): Don't check ns_return_types.
1271
1272 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
1273 ns_return_type.
1274
5df75e47
JR
12752011-07-08 Jason Rumney <jasonr@gnu.org>
1276
1277 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
1278 frame struct members of non-existent frames (Bug#6284).
1279
699c10bd
JD
12802011-07-08 Jan Djärv <jan.h.d@swipnet.se>
1281
4393663b
JD
1282 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
1283 variable firstTime not needed on OSX >= 10.6.
1284 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
1285 >= 10.5. Use setKnobProportion, setDoubleValue.
1286
1287 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
1288 (MAC_OS_X_VERSION_10_5): Define if not defined.
1289 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
1290 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
1291 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
1292
1293 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
1294 cString and lossyCString on OSX >= 10.4
1295
1296 * nsmenu.m (fillWithWidgetValue): Don't use depercated method
1297 sizeToFit on OSX >= 10.2.
1298
1299 * nsimage.m (allocInitFromFile): Don't use deprecated method
1300 bestRepresentationForDevice on OSX >= 10.6.
1301
1302 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
1303 to avoid warning.
1304
1305 * emacs.c: Declare unexec_init_emacs_zone.
1306
a63e0781
JD
1307 * nsgui.h: Fix compiler warning about gnulib redefining verify.
1308
699c10bd
JD
1309 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
1310
1311 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
1312 on svcsMenu (Bug#8842).
1313
1314 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
1315 ns_return_types.
1316 (Fns_list_services): Just return Qnil on 10.6, code not working there.
1317
1318 * nsterm.m (QUTF8_STRING): Declare.
1319 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
1320 (validRequestorForSendType): Return type is (id).
1321 Change indexOfObjectIdenticalTo to indexOfObject.
1322 Check if we have local selection before returning self (Bug#8842).
1323 (writeSelectionToPasteboard): Put local selection into paste board
1324 if we have a local selection (Bug#8842).
1325 (syms_of_nsterm): DEFSYM QUTF8_STRING.
1326
1327 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
1328 (ns_get_local_selection): Declare.
1329
54e10184
LMI
13302011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
1331
9888ff71
LMI
1332 * keymap.c (describe_map_tree): Don't insert a double newline at
1333 the end of the buffer (bug#1169) and return whether we inserted
1334 something.
1335
54e10184
LMI
1336 * callint.c (Fcall_interactively): Change "reading args" to
1337 "providing args" to try to clarify what it does (bug#1010).
1338
15fa4783
KH
13392011-07-07 Kenichi Handa <handa@m17n.org>
1340
1341 * composite.c (composition_compute_stop_pos): Ignore a static
1342 composition starting before CHARPOS (Bug#8915).
1343
1344 * xdisp.c (handle_composition_prop): Likewise.
1345
a8815b00
EZ
13462011-07-07 Eli Zaretskii <eliz@gnu.org>
1347
1348 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
1349 (Bug#9015)
1350
ef7b981d 13512011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
1352
1353 * character.h (unicode_category_t): New enum type.
1354
1355 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
1356 (Qchar_code_property_table): New variable.
1357 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
1358 (UNIPROP_COMPRESSED_FORM_P): New macros.
1359 (char_table_ascii): Uncompress the compressed values.
1360 (sub_char_table_ref): New arg is_uniprop. Callers changed.
1361 Uncompress the compressed values.
ac389d0c 1362 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
1363 (char_table_ref_and_range): Uncompress the compressed values.
1364 (sub_char_table_set): New arg is_uniprop. Callers changed.
1365 Uncompress the compressed values.
1366 (sub_char_table_set_range): Args changed. Callers changed.
1367 (char_table_set_range): Adjuted for the above change.
1368 (map_sub_char_table): Delete args default_val and parent. Add arg
1369 top. Give decoded values to a Lisp function.
640c8776 1370 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
1371 values to a Lisp function. Gcpro more variables.
1372 (uniprop_table_uncompress)
1373 (uniprop_decode_value_run_length): New functions.
1374 (uniprop_decoder, uniprop_decoder_count): New variables.
1375 (uniprop_get_decoder, uniprop_encode_value_character)
1376 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
1377 New functions.
1378 (uniprop_encoder, uniprop_encoder_count): New variables.
1379 (uniprop_get_encoder, uniprop_table)
1380 (Funicode_property_table_internal, Fget_unicode_property_internal)
1381 (Fput_unicode_property_internal): New functions.
1382 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
1383 Sunicode_property_table_internal, Sget_unicode_property_internal,
1384 and Sput_unicode_property_internal. Defvar_lisp
1385 char-code-property-alist.
1386
640c8776 1387 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
1388 Vunicode_category_table.
1389
640c8776 1390 * font.c (font_range): Adjust for the change of
c805dec0
KH
1391 Vunicode_category_table.
1392
76b397fb
DN
13932011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
1394
1395 * m/iris4d.h: Remove file, move contents ...
1396 * s/irix6-5.h: ... here.
1397
22b4128e
PE
13982011-07-06 Paul Eggert <eggert@cs.ucla.edu>
1399
1400 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
1401 * alloc.c (mark_buffer):
1402 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
1403 (clone_per_buffer_values): Don't assume that
22b4128e
PE
1404 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
1405 This isn't true in general, and it's particularly not true
1406 if Emacs is configured with --with-wide-int.
1407 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
1408 New macros, used in the buffer.c change.
1409
869795d6
JD
14102011-07-05 Jan Djärv <jan.h.d@swipnet.se>
1411
1412 * xsettings.c: Use both GConf and GSettings if both are available.
1413 (store_config_changed_event): Add comment.
1414 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
1415 (store_tool_bar_style_changed): New functions.
1416 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
1417 (struct xsettings): Move font inside HAVE_XFT.
1418 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 1419 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 1420 Move inside HAVE_XFT.
640c8776 1421 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
1422 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
1423 also.
1424 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
640c8776
SM
1425 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
1426 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
1427 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
1428 (parse_settings): Move check for font inside HAVE_XFT.
1429 (read_settings, apply_xft_settings): Add comment.
1430 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
1431 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
1432 call store_font_name_changed.
1433 (xft_settings_event): Add comment.
1434 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
1435 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
1436 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
1437 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
1438 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
1439 (xsettings_get_system_font, xsettings_get_system_normal_font):
1440 Add comment.
869795d6 1441
d8ed26bd
PE
14422011-07-05 Paul Eggert <eggert@cs.ucla.edu>
1443
1444 Random fixes. E.g., (random) never returned negative values.
1445 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
1446 subseconds part to the entropy, as that's a bit more random.
1447 Prefer signed to unsigned, since the signedness doesn't matter and
1448 in general we prefer signed. When given a limit, use a
1449 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
1450 latter isn't right if USE_2_TAGS_FOR_INTS.
1451 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
1452 not 0..VALMASK. Don't discard "excess" bits that random () returns.
1453
cabf1cac
SM
14542011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
1455
1456 * textprop.c (text_property_stickiness):
1457 Obey Vtext_property_default_nonsticky.
1458 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
1459 * w32fns.c (syms_of_w32fns):
1460 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
1461
6e9b2be9
PE
14622011-07-04 Paul Eggert <eggert@cs.ucla.edu>
1463
1464 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
1465 This is more efficient than Ffile_directory_p and avoids a minor race.
1466
90186c68
LMI
14672011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
1468
7c301272
LMI
1469 * buffer.c (Foverlay_put): Say what the return value is
1470 (bug#7835).
1471
c4f2d8d4
LMI
1472 * fileio.c (barf_or_query_if_file_exists): Check first if the file
1473 is a directory before asking whether to use the file name
1474 (bug#7564).
ad637907
LMI
1475 (barf_or_query_if_file_exists): Make the "File is a directory"
1476 error be more correct.
c4f2d8d4 1477
90186c68
LMI
1478 * fns.c (Frequire): Remove the mention of the .gz files, since
1479 that's installation-specific, but keep the mention of
1480 `get-load-suffixes'.
1481
da64016e
PE
14822011-07-04 Paul Eggert <eggert@cs.ucla.edu>
1483
1484 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
1485 Report string overflow if the output is too long.
1486
7d47b580
JB
14872011-07-04 Juanma Barranquero <lekktu@gmail.com>
1488
a555cb87
JB
1489 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
1490 (syms_of_gnutls): Remove duplicate DEFSYM for
1491 Qgnutls_bootprop_verify_hostname_error, an error for
1492 Qgnutls_bootprop_verify_error (which is no longer used).
1493
7d47b580
JB
1494 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
1495 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
1496 Also (re)move comments that are misplaced or no longer relevant.
1497
1e49bfab
LMI
14982011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
1499
1500 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
1501
1485f4c0
CY
15022011-07-03 Chong Yidong <cyd@stupidchicken.com>
1503
1504 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
1505 and background color parameters if they have been changed.
1506
a9ab721e
LMI
15072011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
1508
1509 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
1510
cf7cff57
PE
15112011-07-03 Paul Eggert <eggert@cs.ucla.edu>
1512
2e13213d
PE
1513 * xsettings.c (SYSTEM_FONT): Define only when used.
1514 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
1515
cf7cff57
PE
1516 * keymap.c (access_keymap_1): Now static.
1517
7a8e04f7
CY
15182011-07-02 Chong Yidong <cyd@stupidchicken.com>
1519
1520 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
1521 leave any prefix arg for the up event (Bug#1586).
1522
61352f62
LMI
15232011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
1524
69bb1ef7
LMI
1525 * lread.c (syms_of_lread): Mention single symbols defined by
1526 `defvar' or `defconst' (bug#7154).
1527
61352f62 1528 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 1529 (Frequire): Mention get-load-suffixes.
61352f62 1530
28545e04
MR
15312011-07-02 Martin Rudalics <rudalics@gmx.at>
1532
1533 * window.h (window): Remove clone_number slot.
1534 * window.c (Fwindow_clone_number, Fset_window_clone_number):
1535 Remove.
1536 (make_parent_window, make_window, saved_window)
1537 (Fset_window_configuration, save_window_save): Don't deal with
1538 clone numbers.
1539 * buffer.c (Qclone_number): Remove declaration.
1540 (sort_overlays, overlay_strings): Don't deal with clone numbers.
1541
3349e122
SM
15422011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
1543
1544 Add multiple inheritance to keymaps.
1545 * keymap.c (Fmake_composed_keymap): New function.
1546 (Fset_keymap_parent): Simplify.
1547 (fix_submap_inheritance): Remove.
1548 (access_keymap_1): New function extracted from access_keymap to handle
1549 embedded parents and handle lists of maps.
1550 (access_keymap): Use it.
1551 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
1552 (Fcopy_keymap): Handle embedded parents.
1553 (Fcommand_remapping, define_as_prefix): Simplify.
1554 (Fkey_binding): Simplify.
1555 (syms_of_keymap): Move minibuffer-local-completion-map,
1556 minibuffer-local-filename-completion-map,
1557 minibuffer-local-must-match-map, and
1558 minibuffer-local-filename-must-match-map to Elisp.
1559 (syms_of_keymap): Defsubr make-composed-keymap.
1560 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
1561 (parse_menu_item): Trivial simplification.
1562
3279eb87
GM
15632011-07-01 Glenn Morris <rgm@gnu.org>
1564
1565 * Makefile.in (SETTINGS_LIBS): Fix typo.
1566
4550efdf
KI
15672011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
1568
1569 * coding.c (Fencode_coding_string): Record the last coding system
1570 used, as the function doc string says (bug#8738).
1571
0949d2b6
JD
15722011-07-01 Jan Djärv <jan.h.d@swipnet.se>
1573
1574 * xsettings.c (store_monospaced_changed): Take new font as arg and
1575 check for change against current_mono_font.
1576 (EMACS_TYPE_SETTINGS): Remove this and related defines.
1577 (emacs_settings_constructor, emacs_settings_get_property)
1578 (emacs_settings_set_property, emacs_settings_class_init)
1579 (emacs_settings_init, gsettings_obj): Remove.
1580 (something_changedCB): New function for HAVE_GSETTINGS.
1581 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
1582 with value as argument.
1583 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
1584 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 1585 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
1586 "changed".
1587
1588 * xgselect.c: Add defined (HAVE_GSETTINGS).
1589 (xgselect_initialize): Ditto.
1590
1591 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
1592 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
1593 xg_select.
1594
bbc6b304
PE
15952011-07-01 Paul Eggert <eggert@cs.ucla.edu>
1596
1597 * eval.c (struct backtrace): Simplify and port the data structure.
1598 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
1599 signed bit field, as this assumption is not portable and it makes
1600 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
1601 "char debug_on_exit : 1" as this is not portable either; instead,
1602 use the portable "unsigned int debug_on_exit : 1". Remove unused
1603 member evalargs. Remove obsolete comments about cc bombing out.
1604
9851bfc5
JD
16052011-06-30 Jan Djärv <jan.h.d@swipnet.se>
1606
51bb811f 1607 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
1608 Let HAVE_GSETTINGS override HAVE_GCONF.
1609 (store_monospaced_changed): New function.
1610 (EMACS_SETTINGS): A new type derived from GObject to handle
1611 GSettings notifications.
1612 (emacs_settings_constructor, emacs_settings_get_property)
1613 (emacs_settings_set_property, emacs_settings_class_init):
1614 New functions.
1615 (gsettings_client, gsettings_obj): New variables.
1616 (GSETTINGS_SCHEMA): New define.
1617 (something_changedCB): Call store_monospaced_changed.
1618 (init_gsettings): New function.
1619 (xsettings_initialize): Call init_gsettings.
1620 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
1621 to NULL.
1622
640c8776 1623 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
1624 GCONF_CFLAGS/LIBS.
1625
5386012d
MR
16262011-06-29 Martin Rudalics <rudalics@gmx.at>
1627
1628 * window.c (resize_root_window, grow_mini_window)
1629 (shrink_mini_window): Rename Qresize_root_window to
1630 Qwindow_resize_root_window and Qresize_root_window_vertically to
1631 Qwindow_resize_root_window_vertically.
1632
f13e0b08
PE
16332011-06-28 Paul Eggert <eggert@cs.ucla.edu>
1634
1635 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
1636
94515237
JB
16372011-06-27 Juanma Barranquero <lekktu@gmail.com>
1638
1639 * makefile.w32-in: Redesign dependencies so they reflect more
1640 clearly which files are directly included by each source file,
1641 and not through other includes.
1642
e43b6e43
MR
16432011-06-27 Martin Rudalics <rudalics@gmx.at>
1644
1645 * buffer.c (Qclone_number): Declare static and DEFSYM it.
1646 (sort_overlays, overlay_strings): When an overlay's clone number
1647 matches the window's clone number process the overlay even if
1648 the overlay's window property doesn't match the current window.
1649
d68443dc
MR
1650 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
1651 (Fwindow_hchild): Rename to Fwindow_left_child.
1652 (Fwindow_next): Rename to Fwindow_next_sibling.
1653 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
1654 (resize_window_check): Rename to window_resize_check.
1655 (resize_window_apply): Rename to window_resize_apply.
1656 (Fresize_window_apply): Rename to Fwindow_resize_apply.
1657 (Fdelete_other_windows_internal, resize_frame_windows)
1658 (Fsplit_window_internal, Fdelete_window_internal)
1659 (grow_mini_window, shrink_mini_window)
1660 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 1661
c7e73be5
JD
16622011-06-26 Jan Djärv <jan.h.d@swipnet.se>
1663
1664 * emacsgtkfixed.h: State that this is only used with Gtk+3.
1665 (emacs_fixed_set_min_size): Remove.
1666 (emacs_fixed_new): Take frame as argument.
1667
1668 * emacsgtkfixed.c: State that this is only used with Gtk+3.
1669 (_EmacsFixedPrivate): Remove minwidth/height.
1670 Add struct frame *f.
1671 (emacs_fixed_init): Initialize priv->f.
1672 (get_parent_class, emacs_fixed_set_min_size): Remove.
1673 (emacs_fixed_new): Set priv->f to argument.
1674 (emacs_fixed_get_preferred_width)
1675 (emacs_fixed_get_preferred_height): Use min_width/height from
1676 frames size_hint to set minimum and natural (Bug#8919).
1677 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
1678 and use min_width/height from frames size_hint to set
1679 min_width/height (Bug#8919).
1680
1681 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
1682 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
1683 Fix indentation.
c7e73be5 1684
cf99dcf8
EZ
16852011-06-26 Eli Zaretskii <eliz@gnu.org>
1686
1687 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
1688 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
1689 called at ZV.
1690
029529ac
CY
16912011-06-26 Chong Yidong <cyd@stupidchicken.com>
1692
1693 * process.c (wait_reading_process_output): Bypass select if
1694 waiting for a cell while ignoring keyboard input, and input is
1695 pending. Suggested by Jan Djärv (Bug#8869).
1696
7a7ef429
PE
16972011-06-25 Paul Eggert <eggert@cs.ucla.edu>
1698
1699 Use gnulib's dup2 module instead of rolling our own.
1700 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
1701
11fdef7d 17022011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
1703
1704 * dispnew.c (scrolling_window): Before scrolling, turn off a
1705 mouse-highlight in the window being scrolled.
1706
cd3520a4
JB
17072011-06-24 Juanma Barranquero <lekktu@gmail.com>
1708
1709 Move DEFSYM to lisp.h and use everywhere.
1710
1711 * character.h (DEFSYM): Move declaration...
1712 * lisp.h (DEFSYM): ...here.
1713
1714 * gnutls.c:
1715 * minibuf.c:
1716 * w32menu.c:
1717 * w32proc.c:
1718 * w32select.c: Don't include character.h.
1719
1720 * alloc.c (syms_of_alloc):
1721 * buffer.c (syms_of_buffer):
1722 * bytecode.c (syms_of_bytecode):
1723 * callint.c (syms_of_callint):
1724 * casefiddle.c (syms_of_casefiddle):
1725 * casetab.c (init_casetab_once):
1726 * category.c (init_category_once, syms_of_category):
1727 * ccl.c (syms_of_ccl):
1728 * cmds.c (syms_of_cmds):
1729 * composite.c (syms_of_composite):
1730 * dbusbind.c (syms_of_dbusbind):
1731 * dired.c (syms_of_dired):
1732 * dispnew.c (syms_of_display):
1733 * doc.c (syms_of_doc):
1734 * editfns.c (syms_of_editfns):
1735 * emacs.c (syms_of_emacs):
1736 * eval.c (syms_of_eval):
1737 * fileio.c (syms_of_fileio):
1738 * fns.c (syms_of_fns):
1739 * frame.c (syms_of_frame):
1740 * fringe.c (syms_of_fringe):
1741 * insdel.c (syms_of_insdel):
1742 * keymap.c (syms_of_keymap):
1743 * lread.c (init_obarray, syms_of_lread):
1744 * macros.c (syms_of_macros):
1745 * msdos.c (syms_of_msdos):
1746 * print.c (syms_of_print):
1747 * process.c (syms_of_process):
1748 * search.c (syms_of_search):
1749 * sound.c (syms_of_sound):
1750 * syntax.c (init_syntax_once, syms_of_syntax):
1751 * terminal.c (syms_of_terminal):
1752 * textprop.c (syms_of_textprop):
1753 * undo.c (syms_of_undo):
1754 * w32.c (globals_of_w32):
1755 * window.c (syms_of_window):
1756 * xdisp.c (syms_of_xdisp):
1757 * xfaces.c (syms_of_xfaces):
1758 * xfns.c (syms_of_xfns):
1759 * xmenu.c (syms_of_xmenu):
1760 * xsettings.c (syms_of_xsettings):
1761 * xterm.c (syms_of_xterm): Use DEFSYM.
1762
4228cf16
TZ
17632011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
1764
cd3520a4 1765 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 1766
7fcccf1e
PE
17672011-06-23 Paul Eggert <eggert@cs.ucla.edu>
1768
7efb4e0e
PE
1769 Integer and buffer overflow fixes (Bug#8873).
1770
ff5844ad
PE
1771 * print.c (printchar, strout): Check for string overflow.
1772 (PRINTPREPARE, printchar, strout):
1773 Don't set size unless allocation succeeds.
1774
90532f02
PE
1775 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
1776 for sizes. Check for string overflow more accurately.
1777 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
1778
6d84508d
PE
1779 * macros.c: Integer and buffer overflow fixes.
1780 * keyboard.h (struct keyboard.kbd_macro_bufsize):
1781 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
1782 Use ptrdiff_t, not int, for sizes.
1783 Don't increment bufsize until after realloc succeeds.
1784 Check for size-calculation overflow.
1785 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
1786
437b2cb4
PE
1787 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
1788
8b9ac8b4
PE
1789 * lread.c: Integer overflow fixes.
1790 (read_integer): Radix is now EMACS_INT, not int,
1791 to improve quality of diagnostics for out-of-range radices.
1792 Calculate buffer size correctly for out-of-range radices.
1793 (read1): Check for integer overflow in radices, and in
1794 read-circle numbers.
82cb60d3
PE
1795 (read_escape): Avoid int overflow.
1796 (Fload, openp, read_buffer_size, read1)
1797 (substitute_object_recurse, read_vector, read_list, map_obarray):
1798 Use ptrdiff_t, not int, for sizes.
1799 (read1): Use EMACS_INT, not int, for sizes.
20270765 1800 Check for size overflow.
8b9ac8b4 1801
7fcccf1e
PE
1802 * image.c (cache_image): Check for size arithmetic overflow.
1803
bfbbd7e7
PE
1804 * lread.c: Integer overflow issues.
1805 (saved_doc_string_size, saved_doc_string_length)
1806 (prev_saved_doc_string_size, prev_saved_doc_string_length):
1807 Now ptrdiff_t, not int.
1808 (read1): Don't assume doc string length fits in int. Check for
1809 out-of-range doc string lengths.
1810 (read_list): Don't assume file position fits in int.
39019e54 1811 (read_escape): Check for hex character overflow.
bfbbd7e7 1812
4e323265
LL
18132011-06-22 Leo Liu <sdl.web@gmail.com>
1814
1815 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
1816 Move to minibuffer.el.
1817
85fece3e
PE
18182011-06-22 Paul Eggert <eggert@cs.ucla.edu>
1819
20b84ce9 1820 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
1821 The following patches are for when GLYPH_DEBUG && !XASSERT.
1822 * dispextern.h (trace_redisplay_p, dump_glyph_string):
1823 * dispnew.c (flush_stdout):
1824 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
1825 Mark as externally visible.
1826 * dispnew.c (check_window_matrix_pointers): Now static.
1827 * dispnew.c (window_to_frame_vpos):
1828 * xfns.c (unwind_create_frame):
1829 * xterm.c (x_check_font): Remove unused local.
1830 * scroll.c (CHECK_BOUNDS):
1831 * xfaces.c (cache_fache): Rename local to avoid shadowing.
1832 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
1833 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
1834 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
1835 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
1836 Now static.
1837 (debug_method_add): Use va_list and vsprintf rather than relying
1838 on undefined behavior with wrong number of arguments.
1839 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
1840 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
1841 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
1842 since we're not interested in debugging glyphs with old libraries.
1843 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
1844 GCC 4.6.0's static checking.
1845
0766b489
PE
18462011-06-22 Paul Eggert <eggert@cs.ucla.edu>
1847
31fd4b32
PE
1848 Integer overflow and signedness fixes (Bug#8873).
1849 A few related buffer overrun fixes, too.
1850
b79e8648
PE
1851 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
1852
0766b489
PE
1853 * dispextern.h (struct face.stipple):
1854 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
1855 (x_bitmap_mask, x_allocate_bitmap_record)
1856 (x_create_bitmap_from_data, x_create_bitmap_from_file)
1857 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
1858 (x_create_bitmap_from_xpm_data):
1859 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
1860 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
1861 (.bitmaps_last):
1862 * xfaces.c (load_pixmap):
1863 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
1864 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
1865 (.bitmaps_last, struct x_output.icon_bitmap):
1866 Use ptrdiff_t, not int, for bitmap indexes.
1867 (x_allocate_bitmap_record): Check for size overflow.
1868 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
1869
b081724f
PE
1870 Use ptrdiff_t, not int, for overlay counts.
1871 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
1872 * editfns.c (overlays_around, get_pos_property):
1873 * textprop.c (get_char_property_and_overlay):
1874 * xdisp.c (next_overlay_change, note_mouse_highlight):
1875 * xfaces.c (face_at_buffer_position):
21514da7
PE
1876 * buffer.c (OVERLAY_COUNT_MAX): New macro.
1877 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
1878 (Fnext_overlay_change, Fprevious_overlay_change)
1879 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 1880 Use ptrdiff_t, not int, for sizes.
21514da7 1881 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 1882
3de73e5e
PE
1883 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
1884
2606c57b
PE
1885 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
1886 (x_session_initialize): Do not assume string length fits in int.
1887
aaafe47a
PE
1888 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
1889 This is unlikely, but can occur if DPI is outlandish.
1890
2674ddc8 1891 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
1892 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
1893
28154962
PE
1894 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
1895 * xrdb.c (magic_file_p, search_magic_path):
1896 Omit last arg SUFFIX; it was always 0. All callers changed.
1897 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
1898
7de51af5
PE
1899 * xfont.c (xfont_match): Avoid need for strlen.
1900
25ed6cc3
PE
1901 * xfns.c: Don't assume strlen fits in int.
1902 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
1903
4eab31dd
PE
1904 * xdisp.c (message_log_check_duplicate): Return intmax_t,
1905 not unsigned long, as we prefer signed integers. All callers changed.
1906 Detect integer overflow in repeat count.
1907 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 1908 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 1909
171e2a58
PE
1910 * termcap.c: Don't assume sizes fit in int and never overflow.
1911 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
1912 (gobble_line): Check for size-calculation overflow.
1913
ad39faca 1914 * minibuf.c (Fread_buffer):
6e5bb2dc 1915 * lread.c (intern, intern_c_string):
74ca2eb3
PE
1916 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
1917 Don't assume string length fits in int.
1918
52c61c22 1919 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
1920 * gtkutil.c (style_changed_cb): Avoid need for strlen.
1921
b5b8c9e5
PE
1922 * font.c: Don't assume string length fits in int.
1923 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
1924 Use ptrdiff_t, not int.
ccd6111c
PE
1925 (font_intern_prop): Don't assume string length fits in int.
1926 Don't assume integer property fits in fixnum.
1927 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 1928
882f0d81 1929 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 1930 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
1931 Reformulate so as not to need the command string.
1932 Invoke gzip -cd rather than gunzip, as it's more portable.
1933 (lock_info_type, lock_file_1, lock_file):
1934 Don't assume pid_t and time_t fit in unsigned long.
1935 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
1936 (current_lock_owner): Prefer signed type for sizes.
1937 Use memcpy, not strncpy, where memcpy is what is really wanted.
1938 Don't assume (via atoi) that time_t and pid_t fit in int.
1939 Check for time_t and/or pid_t out of range, e.g., via a network share.
1940 Don't alloca where an auto var works fine.
1941
93f4cf88
PE
1942 * fileio.c: Fix some integer overflow issues.
1943 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
1944 Don't assume string length fits in int.
1945 (directory_file_name): Don't assume string length fits in long.
1946 (make_temp_name): Don't assume pid fits in int, or that its print
1947 length is less than 20.
1948
f3e92b69
PE
1949 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
1950
1bfdaf10
PE
1951 * coding.c (make_subsidiaries): Don't assume string length fits in int.
1952
35016e9a
PE
1953 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
1954
3d1e65a1
PE
1955 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
1956 We prefer signed integers, even for size calculations.
1957
0b963a93
PE
1958 * emacs.c: Don't assume string length fits in 'int'.
1959 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
1960 (main): Don't invoke strlen when not needed.
1961
573f4b54
PE
1962 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
1963 (XD_DEBUG_MESSAGE): Don't waste a byte.
1964
989f33ba
PE
1965 * callproc.c (getenv_internal_1, getenv_internal)
1966 (Fgetenv_internal):
965d34eb
PE
1967 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
1968
e4d29b33
PE
1969 * lread.c (invalid_syntax): Omit length argument.
1970 All uses changed. This doesn't fix a bug, but it simplifies the
1971 code away from its former Hollerith-constant appearance, and it's
1972 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 1973 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 1974
eb49b136
PE
1975 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
1976 This didn't break anything, but it didn't help either.
1977 It's confusing to put a bogus integer in a place where the actual
1978 value does not matter.
9f62aeb1 1979 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 1980 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 1981
15375a22
PE
1982 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
1983 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
1984 implementation.
b61cc01c
PE
1985 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
1986 We prefer signed types, and the value cannot exceed the EMACS_INT
1987 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
1988 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
1989 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
1990 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 1991
53b2623d
PE
1992 * indent.c (sane_tab_width): New function.
1993 (current_column, scan_for_column, Findent_to, position_indentation)
1994 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 1995 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 1996
51cab52b 1997 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 1998
f2ed8a70
PE
1999 * lisp.h (lint_assume): New macro.
2000 * composite.c (composition_gstring_put_cache):
2001 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
2002
abe80cc6
PE
2003 * editfns.c, insdel.c:
2004 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 2005
b02c740e
PE
2006 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
2007
ebc96716
PE
2008 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
2009
b4e50fa0 2010 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 2011 Use much-faster test for byte-length change.
311d5d7c 2012 Don't assume string byte-length fits in 'int'.
a4cf38e4 2013 Check that character arg fits in 'int'.
85461888 2014 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 2015
c0c1ee9f
PE
2016 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
2017
a498d7f4
PE
2018 * fns.c (concat): Catch string overflow earlier.
2019 Do not rely on integer wraparound.
2020
51cab52b
PE
2021 * dispextern.h (struct it.overlay_strings_charpos)
2022 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
2023 * xdisp.c (forward_to_next_line_start)
2024 (back_to_previous_visible_line_start)
2025 (reseat_at_next_visible_line_start, next_element_from_buffer):
2026 Don't arbitrarily truncate the value of 'selective' to int.
2027
76031fad
PE
2028 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
2029
5eb55db9
PE
2030 * composite.c: Don't truncate sizes to 'int'.
2031 (composition_gstring_p, composition_reseat_it)
2032 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
2033 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
2034 not EMACS_UINT, for indexes.
5eb55db9 2035
0703a717
PE
2036 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
2037
d6202519
PE
2038 * buffer.c: Include <verify.h>.
2039 (struct sortvec.priority, struct sortstr.priority):
8961a454 2040 Now EMACS_INT, not int.
c20998a7 2041 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
2042 (struct sortstr.size, record_overlay_string)
2043 (struct sortstrlist.size, struct sortlist.used):
2044 Don't truncate size to int.
2045 (record_overlay_string): Check for size-calculation overflow.
d6202519 2046 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 2047
d5a19415
JM
20482011-06-22 Jim Meyering <meyering@redhat.com>
2049
029529ac 2050 Don't leak an XBM-image-sized buffer
d5a19415
JM
2051 * image.c (xbm_load): Free the image buffer after using it.
2052
a9041e6c
PE
20532011-06-21 Paul Eggert <eggert@cs.ucla.edu>
2054
2055 Port to Sun C.
2056 * composite.c (find_automatic_composition): Omit needless 'return 0;'
2057 that Sun C diagnosed.
2058 * fns.c (secure_hash): Fix pointer signedness issue.
2059 * intervals.c (static_offset_intervals): New function.
2060 (offset_intervals): Use it.
2061
7f3f739f
LL
20622011-06-21 Leo Liu <sdl.web@gmail.com>
2063
2064 * deps.mk (fns.o):
2065 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
2066 sha512.h.
2067
2068 * fns.c (secure_hash): Rename from crypto_hash_function and change
2069 the first arg to accept symbols.
5b66d427 2070 (Fsecure_hash): New primitive.
7f3f739f
LL
2071 (syms_of_fns): New symbols.
2072
76147d94
DD
20732011-06-20 Deniz Dogan <deniz@dogan.se>
2074
2075 * process.c (Fset_process_buffer): Clarify return value in
2076 docstring.
2077
7d7d0045
CY
20782011-06-18 Chong Yidong <cyd@stupidchicken.com>
2079
2080 * dispnew.c (add_window_display_history): Use BVAR.
2081
2082 * xdisp.c (debug_method_add): Use BVAR.
2083 (check_window_end, dump_glyph_matrix, dump_glyph)
2084 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
2085
2086 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
2087 Likewise.
2088
2089 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
2090 check till after the cache is created in init_frame_faces.
2091
ff2bc410
SM
20922011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
2093
2094 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
2095
28177add
PE
20962011-06-16 Paul Eggert <eggert@cs.ucla.edu>
2097
dd3482fe
PE
2098 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
2099 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
2100 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
2101
393d71f3 2102 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
2103 * fileio.c (Finsert_file_contents):
2104 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
2105 Remove the old (too-loose) buffer overflow checks.
2106 They weren't needed, since make_gap checks for buffer overflow.
2107 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
2108 The old code merely checked for Emacs fixnum overflow, and relied
2109 on undefined (wraparound) behavior. The new code avoids undefined
2110 behavior, and also checks for ptrdiff_t and/or size_t overflow.
2111
2e6813b0 2112 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
2113 Tune. Don't use wider integers than needed. Don't use alloca.
2114 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 2115
599a9e4f
PE
2116 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
2117
99561444
PE
2118 * insdel.c, lisp.h (buffer_overflow): New function.
2119 (insert_from_buffer_1, replace_range, replace_range_2):
2120 * insdel.c (make_gap_larger):
2121 * editfns.c (Finsert_char):
2122 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
2123
28177add
PE
2124 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
2125
e69dafad
PE
21262011-06-15 Paul Eggert <eggert@cs.ucla.edu>
2127
a7af7fde 2128 Integer overflow and signedness fixes (Bug#8873).
ff672d2c 2129
b1c46f02
PE
2130 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
2131 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
2132
e69dafad
PE
2133 * fileio.c: Don't assume EMACS_INT fits in off_t.
2134 (emacs_lseek): New static function.
2135 (Finsert_file_contents, Fwrite_region): Use it.
2136 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
2137
566684ea
PE
2138 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
2139
e6966cd6
PE
2140 * fns.c: Don't overflow int when computing a list length.
2141 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
2142 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
2143 truncation on 64-bit hosts. Check for QUIT every
2144 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
2145 faster and is responsive enough.
2146 (Flength): Report an error instead of overflowing an integer.
2147 (Fsafe_length): Return a float if the value is not representable
2148 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 2149 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 2150 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 2151
dd0b0efb
PE
2152 * alloc.c: Check that resized vectors' lengths fit in fixnums.
2153 (header_size, word_size): New constants.
2154 (allocate_vectorlike): Don't check size overflow here.
2155 (allocate_vector): Check it here instead, since this is the only
2156 caller of allocate_vectorlike that could cause overflow.
2157 Check that the new vector's length is representable as a fixnum.
2158
86fe5cfe
PE
2159 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
2160 The previous code was bogus. For example, next_almost_prime (32)
2161 returned 39, which is undesirable as it is a multiple of 3; and
2162 next_almost_prime (24) returned 25, which is a multiple of 5 so
2163 why was the code bothering to check for multiples of 7?
2164
80e88859
PE
2165 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
2166
4a2f0ad6
PE
2167 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
2168
f66c7cf8
PE
2169 Variadic C functions now count arguments with ptrdiff_t.
2170 This partly undoes my 2011-03-30 change, which replaced int with size_t.
2171 Back then I didn't know that the Emacs coding style prefers signed int.
2172 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
2173 were being counted with int, which may truncate counts on 64-bit
2174 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
2175 * lisp.h (struct Lisp_Subr.function.aMANY)
2176 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
2177 Arg counts are now ptrdiff_t, not size_t.
2178 All variadic functions and their callers changed accordingly.
2179 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
2180 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
2181 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
2182 * callint.c (Fcall_interactively): Check arg count for overflow,
2183 to avoid potential buffer overrun. Use signed char, not 'int',
2184 for 'varies' array, so that we needn't bother to check its size
2185 calculation for overflow.
2186 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
2187 * eval.c (apply_lambda):
2188 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
2189 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
2190 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
2191
a1759b76
PE
2192 * callint.c (Fcall_interactively): Don't use index var as event count.
2193
d96be9fc
PE
2194 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
2195 * mem-limits.h (SIZE): Remove; no longer used.
2196
a690a978 2197 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 2198
578c21e6
PE
2199 Remove unnecessary casts.
2200 * xterm.c (x_term_init):
2201 * xfns.c (x_set_border_pixel):
2202 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
2203 These aren't needed now that we assume ANSI C.
2204
96f53c6c
PE
2205 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
2206 It's more likely to cause problems (due to unsigned overflow)
2207 than to cure them.
2208
83c77d31
PE
2209 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
2210
ee2079f1
PE
2211 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
2212
6da65536
PE
2213 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
2214
7147c4a4
PE
2215 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
2216
193e32d9
PE
2217 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
2218
e5533da6
PE
2219 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
2220
9910e595
PE
2221 GLYPH_CODE_FACE returns EMACS_INT, not int.
2222 * dispextern.h (merge_faces):
2223 * xfaces.c (merge_faces):
01103c44
PE
2224 * xdisp.c (get_next_display_element, next_element_from_display_vector):
2225 Don't assume EMACS_INT fits in int.
9910e595 2226
2638320e
PE
2227 * character.h (CHAR_VALID_P): Remove unused parameter.
2228 * fontset.c, lisp.h, xdisp.c: All uses changed.
2229
045eb8d9
PE
2230 * editfns.c (Ftranslate_region_internal): Omit redundant test.
2231
c1f134b5
PE
2232 * fns.c (concat): Minor tuning based on overflow analysis.
2233 This doesn't fix any bugs. Use int to hold character, instead
2234 of constantly refetching from Emacs object. Use XFASTINT, not
2235 XINT, for value known to be a character. Don't bother comparing
2236 a single byte to 0400, as it's always less.
2237
395fcb93 2238 * floatfns.c (Fexpt):
327eeec8
PE
2239 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
2240
abbd3d23
PE
2241 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
2242 for characters.
2243
684a03ef
PE
2244 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
2245
0fed43f3
PE
2246 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
2247 Without this fix, on a 64-bit host (aset S 0 4294967386) would
2248 incorrectly succeed when S was a string, because 4294967386 was
2249 truncated before it was used.
2250
8fd02eb7
PE
2251 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
2252 Otherwise, an out-of-range integer could cause undefined behavior
2253 on a 64-bit host.
2254
f8c86b69
PE
2255 * composite.c: Use int, not EMACS_INT, for characters.
2256 (fill_gstring_body, composition_compute_stop_pos): Use int, not
2257 EMACS_INT, for values that are known to be in character range.
2258 This doesn't fix any bugs but is the usual style inside Emacs and
2259 may generate better code on 32-bit machines.
2260
34206dd2
PE
2261 Make sure a 64-bit char is never passed to ENCODE_CHAR.
2262 This is for reasons similar to the recent CHAR_STRING fix.
2263 * charset.c (Fencode_char): Check that character arg is actually
2264 a character. Pass an int to ENCODE_CHAR.
2265 * charset.h (ENCODE_CHAR): Verify that the character argument is no
2266 wider than 'int', as a compile-time check to prevent future regressions
2267 in this area.
2268
c5958d4c 2269 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
2270
2271 Make sure a 64-bit char is never passed to CHAR_STRING.
2272 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
2273 by silently ignoring the top 32 bits, allowing some values
2274 that were far too large to be valid characters.
2275 * character.h: Include <verify.h>.
2276 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
2277 arguments are no wider than unsigned, as a compile-time check
2278 to prevent future regressions in this area.
2279 * data.c (Faset):
01103c44 2280 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
2281 (Fsubst_char_in_region):
2282 * fns.c (concat):
2283 * xdisp.c (decode_mode_spec_coding):
2284 Adjust to CHAR_STRING's new requirement.
2285 * editfns.c (Finsert_char, Fsubst_char_in_region):
2286 * fns.c (concat): Check that character args are actually
2287 characters. Without this test, these functions did the wrong
2288 thing with wildly out-of-range values on 64-bit hosts.
2289
d37ca623
PE
2290 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
2291 These casts should not be needed on 32-bit hosts, either.
2292 * keyboard.c (read_char):
2293 * lread.c (Fload): Remove casts to unsigned.
2294
ea204efb
PE
2295 * lisp.h (UNSIGNED_CMP): New macro.
2296 This fixes comparison bugs on 64-bit hosts.
2297 (ASCII_CHAR_P): Use it.
2298 * casefiddle.c (casify_object):
01103c44 2299 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
2300 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
2301 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
2302 * dispextern.h (FACE_FROM_ID):
2303 * keyboard.c (read_char): Use UNSIGNED_CMP.
2304
41cb286c
PE
2305 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
2306 not to EMACS_INT, to avoid GCC warning.
2307
4a1b9832
PE
2308 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
2309
55daad71
PE
2310 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
2311 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
2312 isn't needed on 32-bit machines.
8f95c75c 2313
01103c44
PE
2314 * buffer.c (Fgenerate_new_buffer_name):
2315 Use EMACS_INT for count, not int.
0ceccced 2316 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
2317
2318 * data.c (Qcompiled_function): Now static.
2319
c6f072e7
PE
2320 * window.c (window_body_lines): Now static.
2321
20ce5912
PE
2322 * image.c (gif_load): Rename local to avoid shadowing.
2323
9c4c5f81
PE
2324 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
2325 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
2326 * alloc.c (make_save_value): Integer argument is now of type
2327 ptrdiff_t, not int.
2328 (mark_object): Use ptrdiff_t, not int.
2329 * lisp.h (pD): New macro.
2330 * print.c (print_object): Use it.
2331
c0c5c8ae
PE
2332 * alloc.c: Use EMACS_INT, not int, to count objects.
2333 (total_conses, total_markers, total_symbols, total_vector_size)
2334 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
2335 (total_free_floats, total_floats, total_free_intervals)
2336 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
2337 Now EMACS_INT, not int. All uses changed.
2338 (Fgarbage_collect): Compute overall total using a double, so that
2339 integer overflow is less likely to be a problem. Check for overflow
2340 when converting back to an integer.
5a25e253
PE
2341 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
2342 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
2343 These were 'int' variables that could overflow on 64-bit hosts;
2344 they were never used, so remove them instead of repairing them.
211a0b2a 2345 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
2346 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
2347 Previously, this ceilinged at INT_MAX, but that doesn't work on
2348 64-bit machines.
e46bb31a 2349 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 2350
c78baabf 2351 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 2352 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
2353 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
2354 when a (possibly-narrower) signed value would do just as well.
2355 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 2356
c9d624c6
PE
2357 * alloc.c: Catch some string size overflows that we were missing.
2358 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
2359 for convenience in STRING_BYTES_MAX.
2360 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
2361 The definition here is exact; the one in lisp.h was approximate.
2362 (allocate_string_data): Check for string overflow. This catches
2363 some instances we weren't catching before. Also, it catches
2364 size_t overflow on (unusual) hosts where SIZE_MAX <= min
2365 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
2366 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 2367
c9d624c6
PE
2368 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
2369 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 2370 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 2371
353032ce
PE
2372 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
2373
2bccce07
PE
2374 * alloc.c (Fmake_string): Check for out-of-range init.
2375
0ac30604
SM
23762011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
2377
2378 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
2379
c195f2de
JD
23802011-06-14 Jan Djärv <jan.h.d@swipnet.se>
2381
2382 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
2383 xg_get_default_scrollbar_width.
2384
2385 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
2386 (int_gtk_range_get_value): Move to the scroll bar part of the file.
2387 (style_changed_cb): Call update_theme_scrollbar_width and call
2388 x_set_scroll_bar_default_width and xg_frame_set_char_size for
2389 all frames (Bug#8505).
2390 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
2391 Call gtk_window_set_resizable if HAVE_GTK3.
2392 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
2393 and height if HAVE_GTK3 (Bug#8505).
2394 (scroll_bar_width_for_theme): New variable.
2395 (update_theme_scrollbar_width): New function.
2396 (xg_get_default_scrollbar_width): Move code to
2397 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
2398 (xg_initialize): Call update_theme_scrollbar_width.
2399
2400 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
2401
2402 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
2403
e10ac9f1
MR
24042011-06-12 Martin Rudalics <rudalics@gmx.at>
2405
2406 * frame.c (make_frame): Call other_buffer_safely instead of
2407 other_buffer.
2408
2409 * window.c (temp_output_buffer_show): Call display_buffer with
2410 second argument Vtemp_buffer_show_specifiers and reset latter
2411 immediately after the call.
2412 (Vtemp_buffer_show_specifiers): New variable.
2413 (auto_window_vscroll_p, next_screen_context_lines)
2414 (Vscroll_preserve_screen_position): Remove leading asterisks from
2415 doc-strings.
2416
2d3c217e 24172011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 2418
7b7f97e8 2419 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
2420 * buffer.c (Qclone_number): Remove for now, as it's unused.
2421 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
2422 (record_buffer): Remove unused local.
2423 * frame.c (other_visible_frames, frame_buffer_list): Now static.
2424 (set_frame_buffer_list): Remove; unused.
2425 * frame.h (other_visible_frames): Remove decl.
2426 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
2427 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
2428 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
2429 if HAVE_GPM.
2430 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
2431 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
2432 Define only if HAVE_GPM.
2433 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
2434 (update_hints_inhibit): Remove; never set. All uses removed.
2435 * widgetprv.h (emacsFrameClassRec): Remove decl.
2436 * window.c (delete_deletable_window): Now returns void, since it
2437 wasn't returning anything.
2438 (compare_window_configurations): Remove unused locals.
2439 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
2440 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
2441 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
2442 the same widths as pointers. This follows up on the 2011-05-06 patch.
2443 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
2444 * xterm.h: Likewise.
2445 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
2446
1384b89e
JB
24472011-06-12 Juanma Barranquero <lekktu@gmail.com>
2448
2449 * makefile.w32-in: Update dependencies.
2450 (LISP_H): Add lib/intprops.h.
2451
1100a63c
CY
24522011-06-11 Chong Yidong <cyd@stupidchicken.com>
2453
2454 * image.c (gif_load): Add animation frame delay to the metadata.
2455 (syms_of_image): Use DEFSYM. New symbol `delay'.
2456
6198ccd0
MR
24572011-06-11 Martin Rudalics <rudalics@gmx.at>
2458
2459 * window.c (delete_deletable_window): Re-add.
2460 (Fset_window_configuration): Rewrite to handle dead buffers and
2461 consequently deletable windows.
2462 (window_tree, Fwindow_tree): Remove. Supply functionality in
2463 window.el.
2464 (compare_window_configurations): Simplify code.
2465
b6e3633c
AS
24662011-06-11 Andreas Schwab <schwab@linux-m68k.org>
2467
1ab0dee5
AS
2468 * image.c (imagemagick_load_image): Fix type mismatch.
2469 (Fimagemagick_types): Likewise.
2470
b6e3633c
AS
2471 * window.h (replace_buffer_in_windows): Declare.
2472
9397e56f
MR
24732011-06-11 Martin Rudalics <rudalics@gmx.at>
2474
2475 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
2476 Qclone_number. Remove external declaration of Qdelete_window.
2477 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
2478 code.
640c8776
SM
2479 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
2480 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
2481 (Fother_buffer): Rewrite doc-string. Major rewrite for new
2482 buffer list implementation.
2483 (other_buffer_safely): New function.
2484 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
2485 calls to replace_buffer_in_windows and
2486 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
2487 if allowed.
2488 (record_buffer): Inhibit quitting and rewrite using quittable
2489 functions. Run Qbuffer_list_update_hook if allowed.
2490 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
2491 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
2492 Move switch-to-buffer to window.el.
9397e56f
MR
2493 (bury-buffer): Move to window.el.
2494 (Vbuffer_list_update_hook): New variable.
2495
2496 * lisp.h (other_buffer_safely): Add prototype in buffer.c
2497 section.
2498
2499 * window.h (resize_frame_windows): Move up in code.
2500 (Fwindow_frame): Remove EXFUN.
2501 (replace_buffer_in_all_windows): Remove prototype.
2502 (replace_buffer_in_windows_safely): Add prototype.
2503
2504 * window.c: Declare Qdelete_window static again. Move down
2505 declaration of select_count.
2506 (Fnext_window, Fprevious_window): Rewrite doc-strings.
2507 (Fother_window): Move to window.el.
2508 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
2509 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
2510 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
2511 window.el.
2512 (replace_buffer_in_windows): Implement by calling
2513 Qreplace_buffer_in_windows.
2514 (replace_buffer_in_all_windows): Remove with some functionality
2515 moved into replace_buffer_in_windows_safely.
2516 (replace_buffer_in_windows_safely): New function.
2517 (select_window_norecord, select_frame_norecord): Move in front
2518 of run_window_configuration_change_hook. Remove now obsolete
2519 declarations.
640c8776
SM
2520 (Fset_window_buffer): Rewrite doc-string.
2521 Call Qrecord_window_buffer.
9397e56f
MR
2522 (keys_of_window): Move binding for other-window to window.el.
2523
b50691aa
CY
25242011-06-11 Chong Yidong <cyd@stupidchicken.com>
2525
2526 * dispextern.h (struct image): Replace data member, whose int_val
2527 and ptr_val fields were not used by anything, with a single
2528 lisp_val object.
2529
2530 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
2531 (gif_clear_image, gif_load, imagemagick_load_image)
2532 (gs_clear_image, gs_load): Callers changed.
2533
3f754b86
PE
25342011-06-10 Paul Eggert <eggert@cs.ucla.edu>
2535
cca69397
PE
2536 * buffer.h: Include <time.h>, for time_t.
2537 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
2538
109e28d0
PE
2539 Fix minor problems found by static checking.
2540
60737f02
PE
2541 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
2542
4b66faf3
PE
2543 Make identifiers static if they are not used in other modules.
2544 * data.c (Qcompiled_function, Qframe, Qvector):
2545 * image.c (QimageMagick, Qsvg):
2546 * minibuf.c (Qmetadata):
2547 * window.c (resize_window_check, resize_root_window): Now static.
2548 * window.h (resize_window_check, resize_root_window): Remove decls.
2549
109e28d0
PE
2550 * window.c (window_deletion_count, delete_deletable_window):
2551 Remove; unused.
46a4ce9e
PE
2552 (window_body_lines): Now static.
2553 (Fdelete_other_windows_internal): Mark vars as initialized.
2554 Make sure 'resize_failed' is initialized.
2555 (run_window_configuration_change_hook): Rename local to avoid shadowing.
2556 (resize_window_apply): Remove unused local.
2557 * window.h (delete_deletable_window): Remove decl.
2558
109e28d0 2559 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
2560 (imagemagick_load_image): Fix pointer signedness problem by changing
2561 last arg from unsigned char * to char *. All uses changed.
2562 Also, fix a local for similar reasons.
2563 Remove unused locals. Remove locals to avoid shadowing.
2564 (fn_rsvg_handle_free): Remove; unused.
2565 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 2566 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 2567
3f754b86
PE
2568 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
2569
2547adb1
CY
25702011-06-10 Chong Yidong <cyd@stupidchicken.com>
2571
2572 * image.c (gif_load): Fix omitted cast error introduced by
2573 2011-06-06 change.
2574
2c8e37d4
MR
25752011-06-10 Martin Rudalics <rudalics@gmx.at>
2576
2577 * window.h (resize_proportionally, orig_total_lines)
2578 (orig_top_line): Remove from window structure.
2579 (set_window_height, set_window_width, change_window_heights)
2580 (Fdelete_window): Remove prototypes.
2581 (resize_frame_windows): Remove duplicate declaration.
2582
440a42e3
EZ
25832011-06-10 Eli Zaretskii <eliz@gnu.org>
2584
2585 * window.h (resize_frame_windows, resize_window_check)
2586 (delete_deletable_window, resize_root_window)
2587 (resize_frame_windows): Declare prototypes.
2588
2589 * window.c (resize_window_apply): Make definition be "static" to
2590 match the prototype.
2591
562dd5e9
MR
25922011-06-10 Martin Rudalics <rudalics@gmx.at>
2593
2594 * window.c: Remove declarations of Qwindow_size_fixed,
2595 window_min_size_1, window_min_size_2, window_min_size,
2596 size_window, window_fixed_size_p, enlarge_window, delete_window.
2597 Remove static from declaration of Qdelete_window, it's
2598 temporarily needed by Fbury_buffer.
2599 (replace_window): Don't assign orig_top_line and
2600 orig_total_lines.
2601 (Fdelete_window, delete_window): Remove. Window deletion is
2602 handled by window.el.
640c8776
SM
2603 (window_loop): Remove DELETE_OTHER_WINDOWS case.
2604 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
2605 (Fdelete_other_windows): Remove. Deleting other windows is
2606 handled by window.el.
2607 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
2608 handled in window.el.
2609 (window_min_size_2, window_min_size_1, window_min_size): Remove.
2610 Window minimum sizes are handled in window.el.
2611 (shrink_windows, size_window, set_window_height)
2612 (set_window_width, change_window_heights, window_height)
2613 (window_width, CURBEG, CURSIZE, enlarge_window)
2614 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
2615 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
2616 handled in window.el.
2617 (make_dummy_parent): Rename to make_parent_window and give it a
2618 second argument horflag.
2619 (make_window): Don't set resize_proportionally any more.
2620 (Fsplit_window): Remove. Windows are split in window.el.
2621 (save_restore_action, save_restore_orig_size)
2622 (shrink_window_lowest_first, save_restore_orig_size): Remove.
2623 Resize mini windows in window.el.
2624 (grow_mini_window, shrink_mini_window): Implement by calling
2625 Qresize_root_window_vertically, resize_window_check and
2626 resize_window_apply.
640c8776
SM
2627 (saved_window, Fset_window_configuration, save_window_save):
2628 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
2629 resize_proportionally.
2630 (window_min_height, window_min_width): Move to window.el.
2631 (keys_of_window): Move bindings for delete-other-windows,
2632 split-window, delete-window and enlarge-window to window.el.
2633
2634 * buffer.c: Temporarily extern Qdelete_window.
2635 (Fbury_buffer): Temporarily call Qdelete_window instead of
2636 Fdelete_window (Fbury_buffer will move to window.el soon).
2637
2638 * frame.c (set_menu_bar_lines_1): Remove code handling
2639 orig_top_line and orig_total_lines.
2640
2641 * dispnew.c (adjust_frame_glyphs_initially): Don't use
2642 set_window_height but set heights directly.
2643 (change_frame_size_1): Use resize_frame_windows.
2644
2645 * xdisp.c (init_xdisp): Don't use set_window_height but set
2646 heights directly.
2647
640c8776
SM
2648 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
2649 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
2650 run_window_configuration_change_hook.
2651
2652 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
2653 instead of change_window_heights and run
2654 run_window_configuration_change_hook.
2655
1a13852e
MR
26562011-06-09 Martin Rudalics <rudalics@gmx.at>
2657
2658 * window.c (replace_window): Rename second argument REPLACEMENT to
2659 NEW. New third argument SETFLAG. Rewrite.
2660 (delete_window, make_dummy_parent): Call replace_window with
2661 third argument 1.
2662 (window_list_1): Move down in code.
2663 (run_window_configuration_change_hook): Move set_buffer part
2664 before select_frame_norecord part in order to unwind correctly.
2665 Rename count1 to count.
2666 (recombine_windows, delete_deletable_window, resize_root_window)
2667 (Fdelete_other_windows_internal)
2668 (Frun_window_configuration_change_hook, make_parent_window)
2669 (resize_window_check, resize_window_apply, Fresize_window_apply)
2670 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
2671 (Fdelete_window_internal, Fresize_mini_window_internal):
2672 New functions.
1a13852e
MR
2673 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
2674
f3d1777e
MR
26752011-06-08 Martin Rudalics <rudalics@gmx.at>
2676
496e208e
MR
2677 * window.h (window): Add some new members to window structure -
2678 normal_lines, normal_cols, new_total, new_normal, clone_number,
2679 splits, nest, prev_buffers, next_buffers.
2680 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 2681 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 2682
f3d1777e
MR
2683 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
2684 Remove.
496e208e
MR
2685 (make_dummy_parent): Set new members of windows structure.
2686 (make_window): Move down in code. Handle new members of window
2687 structure.
2688 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
2689 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
2690 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
2691 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
2692 (Fset_window_next_buffers, Fset_window_clone_number):
2693 New functions.
496e208e
MR
2694 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
2695 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
2696 Doc-string fixes.
2697 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
2698 Argument WINDOW can be now internal window too.
2699 (Fwindow_use_time): Move up in code.
2700 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
2701 Rewrite doc-string.
2702 (Fset_window_configuration, saved_window)
2703 (Fcurrent_window_configuration, save_window_save): Handle new
2704 members of window structure.
b9e809c2
MR
2705 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
2706 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
2707 (syms_of_window): New Lisp objects Qrecord_window_buffer,
2708 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
2709 Qget_mru_window, Qresize_root_window,
2710 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
2711 Qauto_buffer_name; staticpro them.
f3d1777e 2712
abde8f8c
MR
27132011-06-07 Martin Rudalics <rudalics@gmx.at>
2714
2715 * window.c (Fwindow_total_size, Fwindow_left_column)
2716 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
2717 (Fwindow_list_1): New functions.
2718 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
2719 (Fwindow_width, Fscroll_left, Fscroll_right):
2720 Use window_body_cols instead of window_box_text_cols.
2721 (delete_window, Fset_window_configuration):
2722 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
2723 (delete_all_subwindows): Take a window as argument and not a
2724 structure. Rewrite.
190b47e6
MR
2725 (window_loop): Remove handling of GET_LRU_WINDOW and
2726 GET_LARGEST_WINDOW.
2727 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
2728
2729 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
2730 window_box_text_cols. delete_all_subwindows now takes a
2731 Lisp_Object as argument.
abde8f8c 2732
640c8776
SM
2733 * indent.c (compute_motion, Fcompute_motion):
2734 Use window_body_cols instead of window_box_text_cols.
abde8f8c 2735
fa8a67e6
MR
2736 * frame.c (delete_frame): Call delete_all_subwindows with root
2737 window as argument.
2738
a54e3482
DC
27392011-06-07 Daniel Colascione <dan.colascione@gmail.com>
2740
2741 * fns.c (Fputhash): Document return value.
2742
60002bf5
CY
27432011-06-06 Chong Yidong <cyd@stupidchicken.com>
2744
2745 * image.c (gif_load): Implement gif89a spec "no disposal" method.
2746
0c671da6 27472011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 2748
b862a52a 2749 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 2750
be44ca6c
PE
2751 Check for overflow when converting integer to cons and back.
2752 * charset.c (Fdefine_charset_internal, Fdecode_char):
2753 Use cons_to_unsigned to catch overflow.
2754 (Fencode_char): Use INTEGER_TO_CONS.
2755 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
2756 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
2757 * data.c (long_to_cons, cons_to_long): Remove.
2758 (cons_to_unsigned, cons_to_signed): New functions.
2759 These signal an error for invalid or out-of-range values.
2760 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
2761 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
2762 * font.c (Ffont_variation_glyphs):
2763 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
2764 * lisp.h: Include <intprops.h>.
2765 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
2766 (cons_to_signed, cons_to_unsigned): New decls.
2767 (long_to_cons, cons_to_long): Remove decls.
2768 * undo.c (record_first_change): Use INTEGER_TO_CONS.
2769 (Fprimitive_undo): Use CONS_TO_INTEGER.
2770 * xfns.c (Fx_window_property): Likewise.
2771 * xselect.c: Include <limits.h>.
2772 (x_own_selection, selection_data_to_lisp_data):
2773 Use INTEGER_TO_CONS.
2774 (x_handle_selection_request, x_handle_selection_clear)
2775 (x_get_foreign_selection, Fx_disown_selection_internal)
2776 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
2777 (lisp_data_to_selection_data): Use cons_to_unsigned.
2778 (x_fill_property_data): Use cons_to_signed.
2779 Report values out of range.
2780
d1f3d2af
PE
2781 Check for buffer and string overflow more precisely.
2782 * buffer.h (BUF_BYTES_MAX): New macro.
2783 * lisp.h (STRING_BYTES_MAX): New macro.
2784 * alloc.c (Fmake_string):
2785 * character.c (string_escape_byte8):
2786 * coding.c (coding_alloc_by_realloc):
2787 * doprnt.c (doprnt):
2788 * editfns.c (Fformat):
2789 * eval.c (verror):
2790 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
2791 since they may not be the same number.
2792 * editfns.c (Finsert_char):
2793 * fileio.c (Finsert_file_contents):
2794 Likewise for BUF_BYTES_MAX.
2795
dd52fcea
PE
2796 * image.c: Use ptrdiff_t, not int, for sizes.
2797 (slurp_file): Switch from int to ptrdiff_t.
2798 All uses changed.
2799 (slurp_file): Check that file size fits in both size_t (for
2800 malloc) and ptrdiff_t (for sanity and safety).
2801
7f9bbdbb
PE
2802 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
2803 if b->modtime has its maximal value.
2804
dfe18f82
PE
2805 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
2806
84acfcf0
PE
2807 Don't assume time_t can fit into int.
2808 * buffer.h (struct buffer.modtime): Now time_t, not int.
2809 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
2810 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
2811
ccd9a01a
PE
2812 Minor fixes for signed vs unsigned integers.
2813 * character.h (MAYBE_UNIFY_CHAR):
2814 * charset.c (maybe_unify_char):
2815 * keyboard.c (read_char, reorder_modifiers):
2816 XINT -> XFASTINT, since the integer must be nonnegative.
2817 * ftfont.c (ftfont_spec_pattern):
2818 * keymap.c (access_keymap, silly_event_symbol_error):
2819 XUINT -> XFASTINT, since the integer must be nonnegative.
2820 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
2821 since it makes no difference and we prefer signed.
2822 * keyboard.c (record_char): Use XUINT when all the neighbors do.
2823 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
2824 nonnegative.
2825
d6d100dd
SM
28262011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
2827
2828 * window.h (Fwindow_frame): Declare.
2829
2b6148e4
PE
28302011-06-06 Paul Eggert <eggert@cs.ucla.edu>
2831
2832 * alloc.c: Simplify handling of large-request failures (Bug#8800).
2833 (SPARE_MEMORY): Always define.
2834 (LARGE_REQUEST): Remove.
2835 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
2836
f230ecc9
MR
28372011-06-06 Martin Rudalics <rudalics@gmx.at>
2838
727e958e
MR
2839 * lisp.h: Move EXFUNS for Fframe_root_window,
2840 Fframe_first_window and Fset_frame_selected_window to window.h.
2841
2842 * window.h: Move EXFUNS for Fframe_root_window,
2843 Fframe_first_window and Fset_frame_selected_window here from
2844 lisp.h.
2845
2846 * frame.c (Fwindow_frame, Fframe_first_window)
2847 (Fframe_root_window, Fframe_selected_window)
2848 (Fset_frame_selected_window): Move to window.c.
2849 (Factive_minibuffer_window): Move to minibuf.c.
2850 (Fother_visible_frames_p): New function.
2851
2852 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
2853
f230ecc9
MR
2854 * window.c (decode_window, decode_any_window): Move up in code.
2855 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
2856 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
2857 (Fwindow_buffer): Move up and rewrite doc-string.
2858 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
2859 (Fwindow_prev): New functions.
727e958e
MR
2860 (Fwindow_frame): Move here from frame.c. Accept any window as
2861 argument.
2862 (Fframe_root_window, Fframe_first_window)
2863 (Fframe_selected_window): Move here from frame.c. Accept frame
2864 or arbitrary window as argument. Update doc-strings.
2865 (Fminibuffer_window): Move up in code.
2866 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
2867 (Fset_frame_selected_window): Move here from frame.c.
2868 Marginal rewrite.
727e958e
MR
2869 (Fselected_window, select_window, Fselect_window): Move up in
2870 code. Minor doc-string fixes.
f230ecc9 2871
4d09bcf6
PE
28722011-06-06 Paul Eggert <eggert@cs.ucla.edu>
2873
2874 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
2875 Do not assume that spare memory exists; that assumption is valid
2876 only if SYSTEM_MALLOC.
2877 (LARGE_REQUEST): New macro, so that the issue of large requests
2878 is separated from the issue of spare memory.
2879
810928a2
AS
28802011-06-05 Andreas Schwab <schwab@linux-m68k.org>
2881
172418ad
AS
2882 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
2883 format. (Bug#8806)
2884
43f862f7
AS
2885 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
2886
810928a2
AS
2887 * xfns.c (x_set_scroll_bar_default_width): Move declarations
2888 before statements.
2889
a059fe24
JD
28902011-06-05 Jan Djärv <jan.h.d@swipnet.se>
2891
2892 * gtkutil.c (xg_get_default_scrollbar_width): New function.
2893
2894 * gtkutil.h: Declare xg_get_default_scrollbar_width.
2895
2896 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
2897 min width by calling x_set_scroll_bar_default_width (Bug#8505).
2898
989bf368
JB
28992011-06-05 Juanma Barranquero <lekktu@gmail.com>
2900
2901 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
2902
4b80f674
CY
29032011-06-04 Chong Yidong <cyd@stupidchicken.com>
2904
2905 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
2906 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
2907 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
2908 New error handlers.
4b80f674
CY
2909 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
2910 Obey Vx_select_enable_clipboard_manager. Catch errors in
2911 x_clipboard_manager_save (Bug#8779).
2912 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 2913 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 2914
99a33b77 29152011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
2916
2917 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
2918
99a33b77 29192011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
2920
2921 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
2922 in the current matrix if keep_current_p is non-zero.
2923
8264569d
EZ
29242011-06-04 Eli Zaretskii <eliz@gnu.org>
2925
2926 * bidi.c (bidi_level_of_next_char): Fix last change.
2927
57f97249
EZ
29282011-06-03 Eli Zaretskii <eliz@gnu.org>
2929
fec2107c 2930 Support bidi reordering of text covered by display properties.
57f97249 2931
fec2107c
EZ
2932 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
2933 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
2934 (bidi_cache_search, bidi_cache_iterator_state)
2935 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
2936 (bidi_level_of_next_char, bidi_move_to_visually_next):
2937 Support character positions inside a run of characters covered by a
fec2107c
EZ
2938 display string.
2939 (bidi_paragraph_init, bidi_resolve_explicit_1)
2940 (bidi_level_of_next_char): Call bidi_fetch_char and
2941 bidi_fetch_char_advance instead of FETCH_CHAR and
2942 FETCH_CHAR_ADVANCE.
2943 (bidi_init_it): Initialize new members.
2944 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
2945 definitions.
2946 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
2947 instead of using explicit *_CHAR codes.
d6d100dd
SM
2948 (bidi_resolve_explicit, bidi_resolve_weak):
2949 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
2950 bidirectional text is supported only in multibyte buffers.
2951 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
2952 it to initialize the frame_window_p member of struct bidi_it.
2953 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
2954 (bidi_resolve_explicit, bidi_resolve_weak)
2955 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
2956 bidi_it->nchars is non-positive.
2957 (bidi_level_of_next_char): Don't try to lookup the cache for the
2958 next/previous character if nothing is cached there yet, or if we
2959 were just reseat()'ed to a new position.
c40e2fb2 2960
0e14fe90
EZ
2961 * xdisp.c (set_cursor_from_row): Set start and stop points
2962 according to the row's direction when priming the loop that looks
2963 for the glyph on which to display cursor.
2964 (single_display_spec_intangible_p): Function deleted.
2965 (display_prop_intangible_p): Reimplement to call
2966 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
2967 Accept 3 additional arguments needed by handle_display_spec.
2968 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
2969 values: lists, `(when COND...)' forms, etc.
2970 (single_display_spec_string_p): Support property values that are
2971 lists with the argument STRING its top-level element.
2972 (display_prop_string_p): Fix the condition for processing a
2973 property that is a list to be consistent with handle_display_spec.
fec2107c 2974 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
2975 last portion of handle_display_prop.
2976 (compute_display_string_pos): Accept additional argument
2977 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
2978 value of a `display' property is a "replacing spec".
2979 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
2980 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
2981 the display property, but just return a value indicating whether
2982 the display property will replace the characters it covers.
2983 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
2984 frame_window_p members of struct bidi_it.
d6d100dd
SM
2985 (compute_display_string_pos, compute_display_string_end):
2986 New functions.
fec2107c
EZ
2987 (push_it): Accept second argument POSITION, where pop_it should
2988 jump to continue iteration.
2989 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 2990
fec2107c
EZ
2991 * keyboard.c (adjust_point_for_property): Adjust the call to
2992 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
2993
2994 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
2995 (bidi_init_it): Update prototypes.
2996 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
2997 (compute_display_string_pos, compute_display_string_end):
2998 Declare prototypes.
fec2107c
EZ
2999 (struct bidi_it): New members nchars and disp_pos. ch_len is now
3000 EMACS_INT.
fc6f18ce 3001
40087514 30022011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 3003
57f53182
PE
3004 Malloc failure behavior now depends on size of allocation.
3005 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
3006 * lisp.h: Change signatures accordingly.
3007 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
3008 All callers changed. (Bug#8762)
3009
3010 * gnutls.c: Use Emacs's memory allocators.
3011 Without this change, the gnutls library would invoke malloc etc.
3012 directly, which causes problems on non-SYNC_INPUT hosts, and which
3013 runs afoul of improving memory_full behavior. (Bug#8761)
3014 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
3015 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
3016 xfree instead of the default malloc, realloc, free.
3017 (Fgnutls_boot): No need to check for memory allocation failure,
3018 since xmalloc does that for us.
3019
ac32cd99 3020 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
3021 * category.c (hash_get_category_set):
3022 * ccl.c (ccl_driver):
3023 * charset.c (Fdefine_charset_internal):
3024 * charset.h (struct charset.hash_index):
3025 * composite.c (get_composition_id, gstring_lookup_cache)
3026 (composition_gstring_put_cache):
3027 * composite.h (struct composition.hash_index):
3028 * dispextern.h (struct image.hash):
3029 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
3030 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3031 (hashfn_equal, hashfn_user_defined, make_hash_table)
3032 (maybe_resize_hash_table, hash_lookup, hash_put)
3033 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
3034 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
3035 (Fsxhash, Fgethash, Fputhash, Fmaphash):
3036 * image.c (make_image, search_image_cache, lookup_image)
3037 (xpm_put_color_table_h):
3038 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 3039 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 3040 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 3041 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
3042 * alloc.c (allocate_vectorlike):
3043 Check for overflow in vector size calculations.
3044 * ccl.c (ccl_driver):
3045 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
3046 * fns.c, image.c: Remove unnecessary static decls that would otherwise
3047 need to be updated by these changes.
40087514
PE
3048 * fns.c (make_hash_table, maybe_resize_hash_table):
3049 Check for integer overflow with large hash tables.
0de4bb68
PE
3050 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
3051 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
3052 (SXHASH_REDUCE): New macro.
3053 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
3054 Use it instead of discarding useful hash info with large hash values.
3055 (sxhash_float): New function.
3056 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
3057 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
3058 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
3059 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
3060 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
3061 Adjust signatures to match updated version of code.
3062 (consing_since_gc): Now EMACS_INT, since a single hash table can
3063 use more than INT_MAX bytes.
3064
698d32e2
DN
30652011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
3066
3067 Make it possible to build with GCC-4.6+ -O2 -flto.
3068
3069 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
3070
fd6fa53f
SM
30712011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
3072
3073 * minibuf.c (get_minibuffer, read_minibuf_unwind):
3074 Call minibuffer-inactive-mode.
3075
864db017
JB
30762011-05-31 Juanma Barranquero <lekktu@gmail.com>
3077
3078 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
3079 Update dependencies.
3080
2ad0baf4
DN
30812011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3082
3083 * data.c (init_data): Remove code for UTS, this system is not
3084 supported anymore.
3085
4fcc2638
DN
30862011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3087
3088 Don't force ./temacs to start in terminal mode.
3089
3090 * frame.c (make_initial_frame): Initialize faces in all cases, not
3091 only when CANNOT_DUMP is defined.
3092 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
3093
c56e0fd5
DN
30942011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3095
3096 * dispnew.c (add_window_display_history): Use const for the string
3097 pointer. Remove declaration, not needed.
3098
333d54da 30992011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 3100
55d4c1b2 3101 Use 'inline', not 'INLINE'.
333d54da 3102 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
3103 * alloc.c, fontset.c (INLINE): Remove.
3104 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
3105 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
3106 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
3107 * gmalloc.c (register_heapinfo): Use inline unconditionally.
3108 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
3109
738db178
DN
31102011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
3111
3112 Make it possible to run ./temacs.
3113
3114 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
3115 syms_of_callproc does the same thing. Remove test for
3116 "initialized", do it in the caller.
3117 * emacs.c (main): Avoid calling set_initial_environment when dumping.
3118
620c53a6
SM
31192011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
3120
3121 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
3122 (read_minibuf): Use get_minibuffer.
3123 (syms_of_minibuf): Use DEFSYM.
3124 (Qmetadata): New var.
3125 * data.c (Qbuffer): Don't make it static.
3126 (syms_of_data): Use DEFSYM.
3127
e003a292
PE
31282011-05-31 Paul Eggert <eggert@cs.ucla.edu>
3129
3130 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
3131 (CCL_CODE_MIN): New macro.
3132
ed008a6d
PE
31332011-05-30 Paul Eggert <eggert@cs.ucla.edu>
3134
3687c2ef
PE
3135 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
3136
ed008a6d
PE
3137 * eval.c (Qdebug): Now static.
3138 * lisp.h (Qdebug): Remove decl. This reverts a part of the
3139 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
3140 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
3141
d66c4c7c
CY
31422011-05-29 Chong Yidong <cyd@stupidchicken.com>
3143
3144 * image.c: Various fixes to ImageMagick code comments.
3145 (Fimagemagick_types): Doc fix.
3146
5fbc2025
PE
31472011-05-29 Paul Eggert <eggert@cs.ucla.edu>
3148
0196f88a
PE
3149 Minor fixes prompted by GCC 4.6.0 warnings.
3150
3151 * xselect.c (converted_selections, conversion_fail_tag): Now static.
3152
5fbc2025
PE
3153 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
3154 (x_clipboard_manager_save_all): Move extern decl to ...
3155 * xterm.h: ... here, so that it can be checked for consistency.
3156
1dd3c2d9
CY
31572011-05-29 Chong Yidong <cyd@stupidchicken.com>
3158
3159 * xselect.c (x_clipboard_manager_save_frame)
3160 (x_clipboard_manager_save_all): New functions.
3161 (Fx_clipboard_manager_save): Lisp function deleted.
3162
3163 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
3164 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
3165
3166 * xterm.h: Update prototype.
3167
5ba6571d
WX
31682011-05-28 William Xu <william.xwl@gmail.com>
3169
3170 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
3171 exiting (Bug#8239).
3172
3eaff834
JM
31732011-05-28 Jim Meyering <meyering@redhat.com>
3174
e1900994 3175 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
3176 * fns.c (to_uchar): Define.
3177 (crypto_hash_function): Use it to convert some newly-signed
3178 variables to unsigned, to avoid sign-extension bugs. For example,
3179 without this change, (md5 "truc") would evaluate to
3180 45723a2aff78ff4fff7fff1114760e62 rather than the expected
3181 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 3182 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 3183
0f6990a7
PE
31842011-05-27 Paul Eggert <eggert@cs.ucla.edu>
3185
3186 Integer overflow fixes.
c8a9ca5a 3187
08686060
PE
3188 * dbusbind.c: Serial number integer overflow fixes.
3189 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
3190 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
3191 to hold a serial number that is too large for a fixnum.
3192 (Fdbus_method_return_internal, Fdbus_method_error_internal):
3193 Check for serial numbers out of range. Decode any serial number
59568bf0 3194 that was so large that it became a float. (Bug#8722)
08686060 3195
2d1fc3c7
PE
3196 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
3197 (Fdbus_call_method, Fdbus_call_method_asynchronously):
3198 Use XFASTINT rather than XUINT when numbers are nonnegative.
3199 (xd_append_arg, Fdbus_method_return_internal):
3200 (Fdbus_method_error_internal): Likewise. Also, for unsigned
3201 arguments, check that Lisp number is nonnegative, rather than
59568bf0 3202 silently wrapping negative numbers around. (Bug#8722)
30217ff0 3203 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 3204 (Bug#8722)
2d1fc3c7 3205
c8a9ca5a
PE
3206 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
3207
519e1d69
PE
3208 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
3209
30569699
PE
3210 ccl: add integer overflow checks
3211 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
3212 (IN_INT_RANGE): New macros.
3213 (ccl_driver): Use them to check for integer overflow when
3214 decoding a CCL program. Many of the new checks are whether XINT (x)
3215 fits in int; it doesn't always, on 64-bit hosts. The new version
3216 doesn't catch all possible integer overflows, but it's an
847044ea 3217 improvement. (Bug#8719)
30569699 3218
c11285dc
PE
3219 * alloc.c (make_event_array): Use XINT, not XUINT.
3220 There's no need for unsigned here.
3221
fdccd48e
PE
3222 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
3223 This follows up to the 2011-05-06 change that substituted uintptr_t
3224 for EMACS_INT. This case wasn't caught back then.
3225
37910ab2
PE
3226 Rework Fformat to avoid integer overflow issues.
3227 * editfns.c: Include <float.h> unconditionally, as it's everywhere
3228 now (part of C89). Include <verify.h>.
3229 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
3230 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
3231 (Fformat): Avoid the prepass trying to compute sizes; it was only
3232 approximate and thus did not catch overflow reliably. Instead, walk
3233 through the format just once, formatting and computing sizes as we go,
3234 checking for integer overflow at every step, and allocating a larger
3235 buffer as needed. Keep track separately whether the format is
3236 multibyte. Keep only the most-recently calculated precision, rather
3237 than them all. Record whether each argument has been converted to
3238 string. Use EMACS_INT, not int, for byte and char and arg counts.
3239 Support field widths and precisions larger than INT_MAX. Avoid
3240 sprintf's undefined behavior with conversion specifications such as %#d
3241 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
3242 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
3243 formatting out-of-range floating point numbers with int
9173deec 3244 formats. (Bug#8668)
37910ab2 3245
2e6578fb
PE
3246 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
3247
0ae6bdee
PE
3248 * data.c: Avoid integer truncation in expressions involving floats.
3249 * data.c: Include <intprops.h>.
3250 (arith_driver): When there's an integer overflow in an expression
3251 involving floating point, convert the integers to floating point
3252 so that the resulting value does not suffer from catastrophic
3253 integer truncation. For example, on a 64-bit host (* 4
3254 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
3255 Do not rely on undefined behavior after integer overflow.
3256
de883a70
PE
3257 merge count_size_as_multibyte, parse_str_to_multibyte
3258 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 3259 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
3260 Check for integer overflow.
3261 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
3262 since it's now a duplicate of the other. This is more of
3263 a character than a buffer op, so better that it's in character.c.
3264 * fns.c, print.c: Adjust to above changes.
3265
2ff916cb
PE
32662011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
3267
3268 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
3269
f1b54466
PE
32702011-05-27 Paul Eggert <eggert@cs.ucla.edu>
3271
fb1ac845
PE
3272 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
3273 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
3274 (x_clipboard_manager_save): Now static.
3275 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
3276
f1b54466
PE
3277 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
3278 (crypto_hash_function): Now static.
3279 Fix pointer signedness problems. Avoid unnecessary initializations.
3280
a9f737ee
CY
32812011-05-27 Chong Yidong <cyd@stupidchicken.com>
3282
3283 * termhooks.h (Vselection_alist): Make it terminal-local.
3284
3285 * terminal.c (create_terminal): Initialize it.
3286
3287 * xselect.c: Support for clipboard managers.
3288 (Vselection_alist): Move to termhooks.h as terminal-local var.
3289 (LOCAL_SELECTION): New macro.
3290 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
3291 (symbol_to_x_atom): Remove gratuitous arg.
3292 (x_handle_selection_request, lisp_data_to_selection_data)
3293 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
3294 (x_own_selection, x_get_local_selection, x_convert_selection):
3295 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
3296 (some_frame_on_display): Delete unused function.
3297 (Fx_own_selection_internal, Fx_get_selection_internal)
3298 (Fx_disown_selection_internal, Fx_selection_owner_p)
3299 (Fx_selection_exists_p): New optional frame arg.
3300 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
3301 (x_handle_selection_clear): Don't treat other terminals with the
3302 same keyboard specially. Use the terminal-local Vselection_alist.
3303 (x_clear_frame_selections): Use Frun_hook_with_args.
3304
3305 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
3306
3307 * xterm.h: Add support for those atoms.
3308
e067f0c1
CY
33092011-05-26 Chong Yidong <cyd@stupidchicken.com>
3310
3311 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
3312 (converted_selections, conversion_fail_tag): New global variables.
3313 (x_selection_request_lisp_error): Free the above.
3314 (x_get_local_selection): Remove unnecessary code.
3315 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
3316 of converted selections stored in converted_selections.
3317 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
3318 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
3319 (x_convert_selection): New function.
3320 (x_handle_selection_event): Simplify.
3321 (x_get_foreign_selection): Don't ignore incoming requests while
3322 waiting for an answer; this will fail when we implement
3323 SAVE_TARGETS, and seems unnecessary anyway.
3324 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
3325 (Vx_sent_selection_functions): Doc fix.
3326
0f4aebc0
LL
33272011-05-26 Leo Liu <sdl.web@gmail.com>
3328
3329 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
3330
e61124cd
YM
33312011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3332
3333 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
3334
3335 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
3336 for fringe update if it has periodic bitmap.
ac389d0c 3337 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
3338 and fringe_bitmap_periodic_p.
3339
3340 * fringe.c (get_fringe_bitmap_data): New function.
3341 (draw_fringe_bitmap_1, update_window_fringes): Use it.
3342 (update_window_fringes): Record periodicity of fringe bitmap in glyph
3343 row. Mark glyph row for fringe update if periodicity changed.
3344
3345 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
3346 for fringe update unless it has periodic bitmap.
3347
f16d9837
KH
33482011-05-25 Kenichi Handa <handa@m17n.org>
3349
3350 * xdisp.c (get_next_display_element): Set correct it->face_id for
3351 a static composition.
3352
e1b90ef6
LL
33532011-05-24 Leo Liu <sdl.web@gmail.com>
3354
3355 * deps.mk (fns.o):
3356 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
3357
3358 * fns.c (crypto_hash_function, Fsha1): New function.
3359 (Fmd5): Use crypto_hash_function.
3360 (syms_of_fns): Add Ssha1.
3361
7400048f
PE
33622011-05-22 Paul Eggert <eggert@cs.ucla.edu>
3363
3364 * gnutls.c: Remove unused macros.
3365 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
3366 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
3367 Remove macros that are defined and never used.
3368 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
3369
abb71cf4
CY
33702011-05-22 Chong Yidong <cyd@stupidchicken.com>
3371
3372 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
3373 (Fx_get_selection_internal): Minor cleanup.
3374 (Fx_own_selection_internal): Rename arguments for consistency with
3375 select.el.
3376
6307db39
PE
33772011-05-22 Paul Eggert <eggert@cs.ucla.edu>
3378
3379 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
3380
f3d4e0a4
CY
33812011-05-22 Chong Yidong <cyd@stupidchicken.com>
3382
3383 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
3384
4d8ade89
YM
33852011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3386
3387 * dispnew.c (scrolling_window): Don't exclude the case that the
3388 last enabled row in the desired matrix touches the bottom boundary.
3389
32078c8d
GM
33902011-05-21 Glenn Morris <rgm@gnu.org>
3391
3392 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
3393 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
3394 and add some more files.
32078c8d 3395
7285dc67
EZ
33962011-05-20 Eli Zaretskii <eliz@gnu.org>
3397
3398 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
3399 report_file_error introduced by the change from 2011-05-07.
3400
89d1bd22
PE
34012011-05-20 Paul Eggert <eggert@cs.ucla.edu>
3402
3403 * systime.h (Time): Define only if emacs is defined.
3404 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
3405 where the include path doesn't have X11/X.h by default. See
3406 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
3407
e23640bb 34082011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
3409
3410 * composite.c (find_automatic_composition): Fix previous change.
3411
b9704ad9
GM
34122011-05-20 Glenn Morris <rgm@gnu.org>
3413
3414 * lisp.mk: New file, split from Makefile.in.
3415 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
3416 (shortlisp): Remove.
3417 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
3418
4a720484
GM
34192011-05-19 Glenn Morris <rgm@gnu.org>
3420
3421 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
3422 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
3423 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
3424 (lisp): Set the order to that of loadup.el.
3425 (shortlisp): Make it a copy of $lisp.
3426 (SOME_MACHINE_LISP): Remove.
3427 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
3428 Use just $shortlisp, not $SOME_MACHINE_LISP too.
3429
a28d4396
KH
34302011-05-18 Kenichi Handa <handa@m17n.org>
3431
3432 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
3433 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
3434 (find_automatic_composition): Mostly rewrite for efficiency.
3435
a2b1fa8e
JB
34362011-05-18 Juanma Barranquero <lekktu@gmail.com>
3437
3438 * makefile.w32-in: Update dependencies.
3439
8e1f5610
CS
34402011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
3441
3442 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 3443 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 3444
7025ee00 34452011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 3446
cdfa6eab
PE
3447 Fix some integer overflow issues, such as string length overflow.
3448
06d6db33
PE
3449 * insdel.c (count_size_as_multibyte): Check for string overflow.
3450
2b4560a8
PE
3451 * character.c (lisp_string_width): Check for string overflow.
3452 Use EMACS_INT, not int, for string indexes and lengths; in
3453 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
3454 the resulting string length overflows an EMACS_INT; instead,
3455 report a string overflow if no precision given. When checking for
3456 precision exhaustion, use a check that cannot possibly have
3457 integer overflow. (Bug#8675)
3458 * character.h (lisp_string_width): Adjust to new signature.
3459
cb93f9be
PE
3460 * alloc.c (string_overflow): New function.
3461 (Fmake_string): Use it. This doesn't change behavior, but saves
3462 a few bytes and will simplify future changes.
3463 * character.c (string_escape_byte8): Likewise.
3464 * lisp.h (string_overflow): New decl.
3465
1a1f3366
PE
3466 Fixups, following up to the user-interface timestamp change.
3467 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
3468 for UI timestamps, instead of unsigned long.
9fbd6841
PE
3469 * msdos.c (mouse_get_pos): Likewise.
3470 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
3471 * w32gui.h (Time): Define by including "systime.h" rather than by
3472 declaring it ourselves. (Bug#8664)
3473
d4e3e4d3
PE
3474 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
3475 * image.c (clear_image_cache): Likewise.
3476
f6a24d19
PE
3477 * term.c (term_mouse_position): Don't assume time_t wraparound.
3478
08dc5ae6
PE
3479 Be more systematic about user-interface timestamps.
3480 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
3481 and sometimes 'EMACS_UINT', to represent these timestamps.
3482 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
3483 This makes the code easier to follow, and makes it easier to catch
3484 integer overflow bugs such as Bug#8664.
3485 * frame.c (Fmouse_position, Fmouse_pixel_position):
3486 Use Time, not unsigned long, for user-interface timestamps.
3487 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
3488 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
3489 * keyboard.h (last_event_timestamp): Likewise.
3490 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
3491 * menu.h (xmenu_show): Likewise.
3492 * term.c (term_mouse_position): Likewise.
3493 * termhooks.h (struct input_event.timestamp): Likewise.
3494 (struct terminal.mouse_position_hook): Likewise.
3495 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
3496 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
3497 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
3498 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
3499 what it was before.
3500 * menu.h, termhooks.h: Include "systime.h", for Time.
3501
8e55734a
PE
3502 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
3503 Don't assume that the difference between two unsigned long values
3504 can fit into an integer. At this point, we know button_down_time
3505 <= event->timestamp, so the difference must be nonnegative, so
3506 there's no need to cast the result if double-click-time is
3507 nonnegative, as it should be; check that it's nonnegative, just in
3508 case. This bug is triggered when events are more than 2**31 ms
86db42d2 3509 apart (about 25 days). (Bug#8664)
8e55734a 3510
841f1b75 3511 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 3512 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 3513
3e26f69c
PE
3514 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
3515 that always fit in int. Use a sentinel instead of a counter, to
3516 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
3517 * frame.h (struct frame): Use int for menu_bar_items_used
3518 instead of EMACS_INT, since it always fits in int.
3e26f69c 3519
5cc152c0
PE
3520 * menu.c (grow_menu_items): Check for int overflow.
3521
d89eb65e
PE
3522 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
3523
5235bd3e
PE
3524 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
3525 Before, the code was not consistent. These values cannot exceed
3526 2**31 - 1 so there's no need to make them unsigned.
3527 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
3528 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
3529 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
3530 as modifiers.
3531 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
3532
bc827e23
PE
3533 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
3534 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
3535 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
3536 presumably because the widths might not match.
3537
78eb494e
PE
3538 * window.c (size_window): Avoid needless test at loop start.
3539
04f2d78b
CB
35402011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
3541
3542 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
3543
d2fc7e3d 35442011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
3545
3546 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
3547
d2fc7e3d 35482011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
3549
3550 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
3551 `width' to `bar_area_x' and `bar_area_width', respectively.
3552 (x_scroll_run): Take account of fringe background extension.
3553
04f2d78b
CB
3554 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
3555 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
3556 `bar_area_width', respectively.
3557 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
3558 background extension.
3559
79b70037
GM
35602011-05-10 Jim Meyering <meyering@redhat.com>
3561
3562 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
3563
2f142cc5
JB
35642011-05-10 Juanma Barranquero <lekktu@gmail.com>
3565
3566 * image.c (Finit_image_library): Return t for built-in image types,
3567 like pbm and xbm. (Bug#8640)
3568
57679c86
AS
35692011-05-09 Andreas Schwab <schwab@linux-m68k.org>
3570
3571 * w32menu.c (set_frame_menubar): Fix submenu allocation.
3572
888c9e86
EZ
35732011-05-07 Eli Zaretskii <eliz@gnu.org>
3574
b0512a1d
EZ
3575 * w32console.c (Fset_screen_color): Doc fix.
3576 (Fget_screen_color): New function.
3577 (syms_of_ntterm): Defsubr it.
3578
7285dc67
EZ
3579 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
3580 unlink the temporary file if Fcall_process didn't create it in the
3581 first place.
3582 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
3583 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
3584 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
3585 cue to call_process_cleanup not to close that handle.
3586
4d3fcc8e
BK
35872011-05-07 Ben Key <bkey76@gmail.com>
3588
3589 * makefile.w32-in: The bootstrap-temacs rule now makes use of
3590 one of two shell specific rules, either bootstrap-temacs-CMD or
3591 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
3592 to the previous implementation of the bootstrap-temacs rule.
3593 The bootstrap-temacs-CMD rule is similar to the previous
3594 implementation of the bootstrap-temacs rule except that it
3595 makes use of the ESC_CFLAGS variable instead of the CFLAGS
3596 variable.
3597
3598 These changes, along with some changes to nt/configure.bat,
3599 nt/gmake.defs, and nt/nmake.defs, are required to extend my
3600 earlier fix to add support for --cflags and --ldflags options
3601 that include quotes so that it works whether make uses cmd or
3602 sh as the shell.
3603
b4289b64
MA
36042011-05-06 Michael Albinus <michael.albinus@gmx.de>
3605
3606 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
3607 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
3608 is a constant.
3609 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
3610 a string. Handle both cases.
3611 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
3612 (Fdbus_register_method): Use Qinvalid_function.
3613
af4c0e28
JB
36142011-05-06 Juanma Barranquero <lekktu@gmail.com>
3615
3616 * makefile.w32-in: Update dependencies.
3617 (LISP_H): Add inttypes.h and stdin.h.
3618 (PROCESS_H): Add unistd.h.
3619
c51453d9
EZ
36202011-05-06 Eli Zaretskii <eliz@gnu.org>
3621
3622 * lread.c: Include limits.h (fixes the MS-Windows build broken by
3623 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
3624
8ff0ac3c 36252011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 3626
4c4b566b
PE
3627 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
3628
aab2b9b5
PE
3629 * term.c (vfatal): Remove stray call to va_end.
3630 It's not needed and the C Standard doesn't allow it here anyway.
3631
c378da0b
PE
3632 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
3633 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
3634
288b08c7
PE
3635 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
3636 bytes.
3637
e3601888
PE
3638 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
3639
db6c0e74
PE
3640 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
3641
dd5963ea
PE
3642 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
3643
88c9450f
PE
3644 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
3645
2f9442b8
PE
3646 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
3647
c032b5f8
PE
3648 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
3649 * charset.c (Fdefine_charset_internal): Don't initialize
3650 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 3651 32-bit int (Bug#8600).
a108c10b
PE
3652
3653 * lread.c (read_integer): Be more consistent with string-to-number.
3654 Use string_to_number to do the actual conversion; this avoids
3655 rounding errors and fixes some other screwups. Without this fix,
3656 for example, #x1fffffffffffffff was misread as -2305843009213693952.
3657 (digit_to_number): Move earlier, for benefit of read_integer.
3658 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 3659 not a digit in any supported base. (Bug#8602)
a108c10b 3660
ad5f9eea
PE
3661 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
3662
aec1708a
PE
3663 * dispnew.c (scrolling_window): Return 1 if we scrolled,
3664 to match comment at start of function. This also removes a
3665 GCC warning about overflow in a 32+64-bit port.
3666
47be4ab5
PE
3667 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
3668
371cac43
PE
3669 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
3670 Reported by Stefan Monnier in
3671 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
3672 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
3673 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 3674
d01a7826
PE
3675 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
3676 (EMACS_UINTPTR): Likewise, with uintptr_t.
3677
7fd47d5c
PE
3678 * lisp.h: Prefer 64-bit EMACS_INT if available.
3679 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
3680 on 32-bit hosts that have 64-bit int, so that they can access
3681 large files.
122b0c86
PE
3682 However, temporarily disable this change unless the temporary
3683 symbol WIDE_EMACS_INT is defined.
7fd47d5c 3684
8727937b
PE
3685 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
3686
8ac068ac
PE
3687 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
3688 This removes an assumption that EMACS_INT and long are the same
3689 width as pointers. The assumption is true for Emacs porting targets
3690 now, but we want to make other targets possible.
3691 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
3692 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
3693 In the rest of the code, change types of integers that hold casted
3694 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
3695 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
3696 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
3697 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
3698 No need to cast type when ORing.
3699 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
3700 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
3701 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
3702 assume EMACS_INT is the same width as char *.
3703 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
3704 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
3705 Remove no-longer-needed casts.
3706 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
3707 (xg_tool_bar_help_callback, xg_make_tool_item):
3708 Use EMACS_INTPTR to hold an integer
3709 that will be cast to void *; this can avoid a GCC warning
3710 if EMACS_INT is not the same width as void *.
3711 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
3712 * xdisp.c (display_echo_area_1, resize_mini_window_1):
3713 (current_message_1, set_message_1):
3714 Use a local to convert to proper width without a cast.
3715 * xmenu.c (dialog_selection_callback): Likewise.
3716
ede49d71
PE
3717 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
3718 Also, don't assume VALBITS / RAND_BITS is less than 5,
3719 and don't rely on undefined behavior when shifting a 1 left into
3720 the sign bit.
3721 * lisp.h (get_random): Change signature to match.
3722
2f30ecd0
PE
3723 * lread.c (hash_string): Use size_t, not int, for hash computation.
3724 Normally we prefer signed values; but hashing is special, because
3725 it's better to use unsigned division on hash table sizes so that
3726 the remainder is nonnegative. Also, size_t is the natural width
3727 for hashing into memory. The previous code used 'int', which doesn't
3728 retain enough info to hash well into very large tables.
3729 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
3730
2a866e7b
PE
3731 * dbusbind.c: Don't possibly lose pointer info when converting.
3732 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
3733 Use XPNTR rather than XHASH, so that the high-order bits of
3734 the pointer aren't lost when converting through void *.
3735
51639eac
PE
3736 * eval.c (Fautoload): Don't double-shift a pointer.
3737
92394119
PE
3738 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
3739
dbdb9a7c
JB
37402011-05-06 Juanma Barranquero <lekktu@gmail.com>
3741
3742 * gnutls.c (DEF_GNUTLS_FN):
3743 * image.c (DEF_IMGLIB_FN): Make function pointers static.
3744
db7a0b4f
AS
37452011-05-05 Andreas Schwab <schwab@linux-m68k.org>
3746
3747 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
3748 marker. (Bug#8610)
3749
f7ff1b0f 37502011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
3751
3752 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
3753 New version that can reserve upto 2GB of heap space.
3754
f7ff1b0f 37552011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
3756
3757 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
3758
639c109b
TZ
37592011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
3760
3761 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
3762 `gnutls_certificate_set_x509_key_file'.
3763
d2127135
JB
37642011-05-05 Juanma Barranquero <lekktu@gmail.com>
3765
3766 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
3767 Update dependencies.
3768
e968f4f3
JB
37692011-05-04 Juanma Barranquero <lekktu@gmail.com>
3770
3771 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
3772 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
3773 Remove unused parameter `fildes'.
3774 * process.c (read_process_output, send_process): Don't pass it.
3775
84d358f0
JB
37762011-05-04 Juanma Barranquero <lekktu@gmail.com>
3777
3778 Fix previous change: the library cache is defined in w32.c.
3779 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
3780 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
3781
0898ca10
JB
37822011-05-04 Juanma Barranquero <lekktu@gmail.com>
3783
3784 Implement dynamic loading of GnuTLS on Windows.
3785
3786 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
3787 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
3788 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
3789 Declare.
3790
3791 * gnutls.c (Qgnutls_dll): Define.
3792 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
3793 (gnutls_*): Declare function pointers.
3794 (init_gnutls_functions): New function to initialize function pointers.
3795 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
3796 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
3797 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
3798 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
3799 (emacs_gnutls_write, emacs_gnutls_read)
3800 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
3801 (Fgnutls_available_p): New function.
3802 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
3803 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
3804 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
3805
3806 * image.c: Include w32.h.
3807 (Vimage_type_cache): Delete.
3808 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
3809 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
3810 (w32_delayed_load): Move to w32.c.
3811
3812 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
3813
3814 * w32.c (QCloaded_from, Vlibrary_cache): Define.
3815 (w32_delayed_load): Move from image.c. When loading a library, record
3816 its filename in the :loaded-from property of the library id.
3817 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
3818 Initialize and staticpro them.
3819 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
3820
3821 * process.c: Include lisp.h before w32.h, not after.
3822 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
3823 instead of gnutls_record_check_pending.
3824
3825 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
3826
ff4de4aa
TZ
38272011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
3828
3829 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
3830 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
3831 as passed in.
3832
abe95abb
JD
38332011-05-03 Jan Djärv <jan.h.d@swipnet.se>
3834
3835 * xterm.c (x_set_frame_alpha): Do not set property on anything
3836 else than FRAME_X_OUTER_WINDOW (Bug#8608).
3837
e16e55d4
JB
38382011-05-02 Juanma Barranquero <lekktu@gmail.com>
3839
3840 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
3841
bafcf6a5
JB
38422011-05-02 Juanma Barranquero <lekktu@gmail.com>
3843
3844 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
3845 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
3846 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
3847 (gnutls_global_initialized, Qgnutls_bootprop_priority)
3848 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
3849 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
3850 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
3851 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
3852 (Qgnutls_bootprop_callbacks_verify): Make static.
3853
e7a6747f
AS
38542011-05-01 Andreas Schwab <schwab@linux-m68k.org>
3855
19ed11ba
AS
3856 * callproc.c: Indentation fixup.
3857
e7a6747f 3858 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
3859 (wait_for_termination, interruptible_wait_for_termination):
3860 Move after wait_for_termination_1.
e7a6747f 3861
1ef14cb4
LMI
38622011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
3863
3864 * sysdep.c (interruptible_wait_for_termination): New function
3865 which is like wait_for_termination, but allows keyboard
3866 interruptions.
3867
3868 * callproc.c (Fcall_process): Add (:file "file") as an option for
3869 the STDOUT buffer.
3870 (Fcall_process_region): Ditto.
3871
330d880c
EZ
38722011-04-30 Eli Zaretskii <eliz@gnu.org>
3873
8db90b73
EZ
3874 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
3875 rather than `XVECTOR (FOO)->size'.
3876
330d880c
EZ
3877 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
3878 inttypes.h, as a gnulib replacement is used if it not available in
3879 system headers.
3880
15cbd324
EZ
38812011-04-21 Eli Zaretskii <eliz@gnu.org>
3882
3883 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
3884 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
3885 of MOST_POSITIVE_FIXNUM. (Bug#8528)
3886
3887 * coding.c (coding_alloc_by_realloc): Error out if destination
3888 will grow beyond MOST_POSITIVE_FIXNUM.
3889 (decode_coding_emacs_mule): Abort if there isn't enough place in
3890 charbuf for the composition carryover bytes. Reserve an extra
3891 space for up to 2 characters produced in a loop.
3892 (decode_coding_iso_2022): Abort if there isn't enough place in
3893 charbuf for the composition carryover bytes.
3894
38952011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 3896
ae940cca
EZ
3897 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
3898 aborting when %lld or %lll format is passed.
3899 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
3900 %llo or %llx format is passed. (Bug#8545)
3901
03ab8921
EZ
3902 * window.c (window_scroll_line_based): Use a marker instead of
3903 simple variables to record original value of point. (Bug#7952)
3904
afda1437
EZ
3905 * doprnt.c (doprnt): Fix the case where a multibyte sequence
3906 produced by %s or %c overflows available buffer space. (Bug#8545)
3907
f76dee0c
PE
39082011-04-28 Paul Eggert <eggert@cs.ucla.edu>
3909
3910 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 3911 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 3912
fdc5744d
JB
39132011-04-28 Juanma Barranquero <lekktu@gmail.com>
3914
3915 * w32.c (init_environment): Warn about defaulting HOME to C:\.
3916
638f053a
JB
39172011-04-28 Juanma Barranquero <lekktu@gmail.com>
3918
3919 * keyboard.c (Qdelayed_warnings_hook): Define.
3920 (command_loop_1): Run `delayed-warnings-hook'
3921 if Vdelayed_warnings_list is non-nil.
3922 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
3923 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
3924
d178f871
EZ
39252011-04-28 Eli Zaretskii <eliz@gnu.org>
3926
3927 * doprnt.c (doprnt): Don't return value smaller than the buffer
3928 size if the message was truncated. (Bug#8545).
3929
b124fd93
JB
39302011-04-28 Juanma Barranquero <lekktu@gmail.com>
3931
3932 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
3933 (Fx_window_property): #if-0 the whole functions, not just the bodies.
3934
e810457d
PE
39352011-04-27 Paul Eggert <eggert@cs.ucla.edu>
3936
3937 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
3938
ea51cceb
JB
39392011-04-27 Juanma Barranquero <lekktu@gmail.com>
3940
3941 * makefile.w32-in: Update dependencies.
3942
94dcfacf
EZ
39432011-04-27 Eli Zaretskii <eliz@gnu.org>
3944
3945 Improve `doprnt' and its usage. (Bug#8545)
3946 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
3947 `format_end'. Remove support for %l as a conversion specifier.
3948 Don't use xrealloc. Improve diagnostics when the %l size modifier
3949 is used. Update the commentary.
3950
3951 * eval.c (verror): Simplify calculation of size_t.
3952
3953 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
3954 messages.
3955
f61f41d7
PE
39562011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
3957
3958 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
3959 change.
3960
96fb4434
PE
39612011-04-27 Paul Eggert <eggert@cs.ucla.edu>
3962
3963 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
3964 This makes this file independent of the recent pseudovector change.
3965
671875da 39662011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 3967
69e9b5a3
PE
3968 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
3969
b5f869a7 3970 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 3971 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 3972 Remove unused local.
c8926152 3973 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 3974
841a1577 3975 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
3976 GCC 4.6.0 optimizes based on type-based alias analysis.
3977 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
3978 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
3979 != &v->size, and therefore "v->size = 1; b->size = 2; return
3980 v->size;" must therefore return 1. This assumption is incorrect
3981 for Emacs, since it type-puns struct Lisp_Vector * with many other
3982 types. To fix this problem, this patch adds a new type struct
f904488f 3983 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
3984 and pseudovectors, and helps optimizing compilers not get fooled
3985 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
3986 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
3987 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
3988 the size member.
eab3844f
PE
3989 (XSETPVECTYPE): Rewrite in terms of new macro.
3990 (XSETPVECTYPESIZE): New macro, specifying both type and size.
3991 This is a bit clearer, and further avoids the possibility of
3992 undesirable aliasing.
3993 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 3994 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
3995 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
3996 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
3997 (ASIZE): Now uses header.size rather than size.
3998 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
3999 to avoid the hassle of writing XVECTOR (foo)->header.size.
4000 (struct vectorlike_header): New type.
eab3844f
PE
4001 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
4002 object, to help avoid aliasing.
4003 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
4004 (SUBRP): Likewise, since Lisp_Subr is a special case.
4005 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
4006 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
4007 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 4008 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
4009 changed to be "header.size" and "header.next".
4010 * buffer.h (struct buffer): Likewise.
4011 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
4012 * frame.h (struct frame): Likewise.
4013 * process.h (struct Lisp_Process): Likewise.
4014 * termhooks.h (struct terminal): Likewise.
4015 * window.c (struct save_window_data, struct saved_window): Likewise.
4016 * window.h (struct window): Likewise.
4017 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
4018 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
4019 * buffer.c (init_buffer_once): Likewise.
4020 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
4021 special case.
4022 * process.c (Fformat_network_address): Use local var for size,
4023 for brevity.
4024
0df1eac5
PE
4025 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
4026
847ab9d1 4027 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
4028 * data.c (atof): Remove decl; no longer used or needed.
4029 (digit_to_number): Move to lread.c.
4030 (Fstring_to_number): Use new string_to_number function, to be
4031 consistent with how the Lisp reader treats infinities and NaNs.
4032 Do not assume that floating-point numbers represent EMACS_INT
4033 without losing information; this is not true on most 64-bit hosts.
4034 Avoid double-rounding errors, by insisting on integers when
4035 parsing non-base-10 numbers, as the documentation specifies.
4036 * lisp.h (string_to_number): New decl, replacing ...
4037 (isfloat_string): Remove.
bc0a5c13 4038 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 4039 (read1): Do not accept +. and -. as integers; this
452f4150
PE
4040 appears to have been a coding error. Similarly, do not accept
4041 strings like +-1e0 as floating point numbers. Do not report
4042 overflow for integer overflows unless the base is not 10 which
4043 means we have no simple and reliable way to continue.
4044 Break out the floating-point parsing into a new
4045 function string_to_number, so that Fstring_to_number parses
4046 floating point numbers consistently with the Lisp reader.
04f2d78b 4047 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
4048 (E_CHAR, EXP_INT): Remove, replacing with ...
4049 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
4050 (string_to_number): New function, replacing isfloat_string.
4051 This function checks for valid syntax and produces the resulting
4052 Lisp float number too. Rework it so that string-to-number
bc0a5c13 4053 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
4054 so that overflow for non-base-10 numbers is reported only when
4055 there's no portable and simple way to convert to floating point.
452f4150 4056
67769ffc
PE
4057 * textprop.c (set_text_properties_1): Rewrite for clarity,
4058 and to avoid GCC warning about integer overflow.
4059
c20db43f
PE
4060 * intervals.h (struct interval): Use EMACS_INT for members
4061 where EMACS_UINT might cause problems. See
4062 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
4063 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
4064 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
4065 All uses changed.
37aa2f85
PE
4066 (offset_intervals): Tell GCC not to worry about length overflow
4067 when negating a negative length.
c20db43f 4068
2538aa2f
PE
4069 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
4070 (overrun_check_free): Likewise.
4071
f2d3008d
PE
4072 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
4073 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
4074 word size.
4075
ec8df744
PE
4076 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
4077 (gnutls_make_error): Rename local to avoid shadowing.
4078 (gnutls_emacs_global_deinit): ifdef out; not used.
4079 (Fgnutls_boot): Use const for pointer to readonly storage.
4080 Comment out unused local. Fix pointer signedness problems.
4081
640ee02d
PE
4082 * lread.c (openp): Don't stuff size_t into an 'int'.
4083 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
4084 about possible signed overflow.
4085
6048fb2a
PE
4086 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
4087 (GDK_KEY_g): Don't define if already defined.
4088 (xg_prepare_tooltip): Avoid pointer signedness problem.
4089 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
4090
fa3c87e1
PE
4091 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
4092 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
4093
2172544b
PE
4094 * xfns.c (Fx_window_property): Simplify a bit,
4095 to make a bit faster and to avoid GCC 4.6.0 warning.
4096 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
4097
9b821a21
PE
4098 * fns.c (internal_equal): Don't assume size_t fits in int.
4099
3c616cfa
PE
4100 * alloc.c (compact_small_strings): Tighten assertion a little.
4101
c2982e87
PE
4102 Replace pEd with more-general pI, and fix some printf arg casts.
4103 * lisp.h (pI): New macro, generalizing old pEd macro to other
4104 conversion specifiers. For example, use "...%"pI"d..." rather
4105 than "...%"pEd"...".
4106 (pEd): Remove. All uses replaced with similar uses of pI.
4107 * src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h: Likewise.
4108 * alloc.c (check_pure_size): Don't overflow by converting size to int.
4109 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
4110 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
4111 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
4112 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
4113 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
4114 64-bit hosts.
4115 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
4116 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
4117 * print.c (safe_debug_print, print_object): Likewise.
4118 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
4119 to int.
6f04d126
PE
4120 Use pI instead of if-then-else-abort. Use %p to avoid casts,
4121 avoiding the 0 flag, which is not portable.
c2982e87
PE
4122 * process.c (Fmake_network_process): Use pI to avoid cast.
4123 * region-cache.c (pp_cache): Likewise.
4124 * xdisp.c (decode_mode_spec): Likewise.
4125 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
4126 behavior on 64-bit hosts with printf arg.
6f04d126 4127 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
4128 (x_stop_queuing_selection_requests): Likewise.
4129 (x_get_window_property): Don't truncate byte count to an 'int'
4130 when tracing.
0b432f21 4131
5e073ec7
PE
4132 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
4133 here, since it parses constructs like leading '-' and spaces,
4134 which are not wanted; and it overflows with large numbers.
4135 Instead, simply match F[0-9]+, which is what is wanted anyway.
4136
36372bf9
PE
4137 * alloc.c: Remove unportable assumptions about struct layout.
4138 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
4139 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
4140 (allocate_vectorlike, make_pure_vector): Use the new macros,
4141 plus offsetof, to remove unportable assumptions about struct layout.
4142 These assumptions hold on all porting targets that I know of, but
4143 they are not guaranteed, they're easy to remove, and removing them
4144 makes further changes easier.
4145
0b432f21
PE
4146 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
4147 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
4148 (string_overrun_cookie): Now const. Use initializers that
4149 don't formally overflow signed char, to avoid warnings.
000098c1
PE
4150 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
4151 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
4152 (allocate_buffer): Don't assume sizeof (struct buffer) is a
4153 multiple of sizeof (EMACS_INT); it need not be, if
4154 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 4155 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 4156
895009e1
JB
41572011-04-26 Juanma Barranquero <lekktu@gmail.com>
4158
4159 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
4160
6a7a1b0b
TZ
41612011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
4162
4163 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 4164 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
4165 Reported by Paul Eggert <eggert@cs.ucla.edu>.
4166
841a1577 41672011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
4168
4169 * lisp.h (Qdebug): List symbol.
895009e1 4170 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
4171 * keyboard.c (debug-on-event): New variable.
4172 (handle_user_signal): Break into debugger when debug-on-event
4173 matches the current signal symbol.
4174
f2d3ba6f
DN
41752011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
4176
4177 * alloc.c (check_sblock, check_string_bytes)
4178 (check_string_free_list): Convert to standard C.
4179
42ce4c63
TZ
41802011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
4181
4182 * w32.c (emacs_gnutls_push): Fix typo.
4183
825cd63c
EZ
41842011-04-25 Eli Zaretskii <eliz@gnu.org>
4185
fb11d64d
EZ
4186 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
4187 "cast to pointer from integer of different size".
4188
825cd63c
EZ
4189 Improve doprnt and its use in verror. (Bug#8545)
4190 * doprnt.c (doprnt): Document the set of format control sequences
4191 supported by the function. Use SAFE_ALLOCA instead of always
4192 using `alloca'.
4193
4194 * eval.c (verror): Don't limit the buffer size at size_max-1, that
4195 is one byte too soon. Don't use xrealloc; instead xfree and
4196 xmalloc anew.
4197
e061a11b
TZ
41982011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
4199
4200 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
4201 callbacks stage.
4202
4203 * gnutls.c: Renamed global_initialized to
4204 gnutls_global_initialized. Added internals for the
4205 :verify-hostname-error, :verify-error, and :verify-flags
4206 parameters of `gnutls-boot' and documented those parameters in the
4207 docstring. Start callback support.
9173deec
JB
4208 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
4209 unless a fatal error occurred. Call gnutls_alert_send_appropriate
4210 on error. Return error code.
e061a11b
TZ
4211 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
4212 (emacs_gnutls_read): Likewise.
4213 (Fgnutls_boot): Return handshake error code.
4214 (emacs_gnutls_handle_error): New function.
4215 (wsaerror_to_errno): Likewise.
4216
4217 * w32.h (emacs_gnutls_pull): Add prototype.
4218 (emacs_gnutls_push): Likewise.
4219
4220 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
4221 (emacs_gnutls_push): Likewise.
4222
42232011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
4224
4225 * process.c (wait_reading_process_output): Check if GnuTLS
4226 buffered some data internally if no FDs are set for TLS
4227 connections.
4228
4229 * makefile.w32-in (OBJ2): Add gnutls.$(O).
4230 (LIBS): Link to USER_LIBS.
4231 ($(BLD)/gnutls.$(0)): New target.
4232
fa6996bc
EZ
42332011-04-24 Eli Zaretskii <eliz@gnu.org>
4234
eb35682e
EZ
4235 * xdisp.c (handle_single_display_spec): Rename the
4236 display_replaced_before_p argument into display_replaced_p, to
4237 make it consistent with the commentary. Fix typos in the
4238 commentary.
4239
e2ad650c
EZ
4240 * textprop.c (syms_of_textprop): Remove dead code.
4241 (copy_text_properties): Delete obsolete commentary about an
4242 interface that was deleted long ago. Fix typos in the description
4243 of arguments.
4244
1b2de274
EZ
4245 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
4246 to changes in oldXMenu/XMenu.h from 2011-04-16.
4247 <menu_help_message, prev_menu_help_message>: Constify.
4248 (IT_menu_make_room): menu->help_text is now `const char **';
4249 adjust.
4250
4251 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
4252 to changes in oldXMenu/XMenu.h from 2011-04-16.
4253 (struct XMenu): Declare `help_text' `const char **'.
4254
4255 * xfaces.c <Qunspecified>: Make extern again.
4256
4257 * syntax.c: Include sys/types.h before including regex.h, as
4258 required by Posix.
4259
762b15be
EZ
4260 * doc.c (get_doc_string): Improve the format passed to `error'.
4261
4262 * doprnt.c (doprnt): Improve commentary.
4263
4264 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
4265
4266 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
4267 them with etags.
4268
f1052e5d
EZ
4269 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
4270 changes in globals.h immediately force recompilation.
762b15be
EZ
4271 (TAGS): Depend on $(CURDIR)/m/intel386.h and
4272 $(CURDIR)/s/ms-w32.h.
4273 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 4274
fa6996bc
EZ
4275 * character.c (Fchar_direction): Function deleted.
4276 (syms_of_character): Don't defsubr it.
4277 <char-direction-table>: Deleted.
4278
e6c3da20
EZ
42792011-04-23 Eli Zaretskii <eliz@gnu.org>
4280
4281 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
4282 * doprnt.c: Include limits.h.
4283 (SIZE_MAX): New macro.
04f2d78b
CB
4284 (doprnt): Return a size_t value. 2nd arg is now size_t.
4285 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
4286 Improve overflow protection. Support `l' modifier for integer
4287 conversions. Support %l conversion. Don't assume an EMACS_INT
4288 argument for integer conversions and for %c.
4289
4290 * lisp.h (doprnt): Restore prototype.
4291
4292 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
4293 $(SRC)/character.h.
4294
4295 * Makefile.in (base_obj): Add back doprnt.o.
4296
4297 * deps.mk (doprnt.o): Add back prerequisites.
4298 (callint.o): Depend on character.h.
4299
4300 * eval.c (internal_lisp_condition_case): Include the handler
4301 representation in the error message.
4302 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
4303 when breaking from the loop.
4304
4305 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
4306
4307 * callint.c (Fcall_interactively): When displaying error message
4308 about invalid control letter, pass the character's codepoint, not
4309 a pointer to its multibyte form. Improve display of the character
4310 in octal and display also its hex code.
4311
4312 * character.c (char_string): Use %x to display the (unsigned)
4313 codepoint of an invalid character, to avoid displaying a bogus
4314 negative value.
4315
4316 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
4317 `error', not SYMBOL_NAME itself.
4318
4319 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
4320 character arguments to `error'.
4321
4322 * charset.c (check_iso_charset_parameter): Fix incorrect argument
4323 to `error' in error message about FINAL_CHAR argument. Make sure
4324 FINAL_CHAR is a character, and use %c when it is passed as
4325 argument to `error'.
4326
4ffd0d6b 43272011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
4328
4329 * s/ms-w32.h (localtime): Redirect to sys_localtime.
4330
4331 * w32.c: Include <time.h>.
4332 (sys_localtime): New function.
4333
4ffd0d6b 43342011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
4335
4336 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
4337
4ffd0d6b 4338 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 4339
4ffd0d6b 43402011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 4341
4ffd0d6b
GM
4342 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
4343 zombies (Bug#8467).
aac0c6e3 4344
04c56954
EZ
43452011-04-19 Eli Zaretskii <eliz@gnu.org>
4346
4347 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
4348 gl_state.e_property when gl_state.object is Qt.
4349
4350 * insdel.c (make_gap_larger): Remove limitation of buffer size
4351 to <= INT_MAX.
4352
16a43933
CY
43532011-04-18 Chong Yidong <cyd@stupidchicken.com>
4354
4355 * xdisp.c (lookup_glyphless_char_display)
4356 (produce_glyphless_glyph): Handle cons cell entry in
4357 glyphless-char-display.
4358 (Vglyphless_char_display): Document it.
4359
4360 * term.c (produce_glyphless_glyph): Handle cons cell entry in
4361 glyphless-char-display.
4362
4581706e
CY
43632011-04-17 Chong Yidong <cyd@stupidchicken.com>
4364
4365 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
4366
4367 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
4368
4369 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
4370 definition for no-X builds.
4371
4887c6e2 43722011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 4373
fd35b6f9
PE
4374 Static checks with GCC 4.6.0 and non-default toolkits.
4375
5c1ccb01
PE
4376 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
4377
006c5daa
PE
4378 * process.c (keyboard_bit_set): Define only if SIGIO.
4379 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
4380 (send_process): Repair possible setjmp clobbering.
4381
efc736d3
PE
4382 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
4383
4e2fe2e6
PE
4384 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
4385
f97334a2
PE
4386 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
4387
4e75f29d
PE
4388 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
4389 Define only if needed.
4390
90efadd1
PE
4391 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
4392 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 4393 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 4394
3c647824
PE
4395 * dispextern.h (struct redisplay_interface): Rename param
4396 to avoid shadowing.
e264f262 4397 * termhooks.h (struct terminal): Likewise.
761383f4 4398 * xterm.c (xembed_send_message): Likewise.
3c647824 4399
b58c5c4a
PE
4400 * insdel.c (make_gap_smaller): Define only if
4401 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
4402
cad59032
PE
4403 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
4404 it.
4405
c339dc2e
PE
4406 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
4407 so that we aren't warned about unused symbols.
4408
91a3e27b
PE
4409 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
4410
399c71d3 4411 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 4412
8ffc96f5
PE
4413 * xfns.c (x_real_positions): Mark locals as initialized.
4414
eef9bc79
PE
4415 * xmenu.c (xmenu_show): Don't use uninitialized vars.
4416
098db9dd
PE
4417 * xterm.c: Fix problems found by static analysis with other toolkits.
4418 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
4419 (x_dispatch_event): Declare static if USE_GTK, and
4420 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 4421 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 4422 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
4423 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
4424 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 4425
eb18f6cc
PE
4426 * xmenu.c (menu_help_callback): Pointer type fixes.
4427 Use const pointers when pointing at readonly data. Avoid pointer
4428 signedness clashes.
4429 (FALSE): Remove unused macro.
4430 (update_frame_menubar): Remove unused decl.
4431
1fe72bf8
PE
4432 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
4433
60d9e1db
PE
4434 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
4435 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
4436 (single_menu_item): Rename local to avoid shadowing.
4437
39261c26
PE
4438 * keyboard.c (make_lispy_event): Remove unused local var.
4439
018c5e19
PE
4440 * frame.c, frame.h (x_get_resource_string): Bring this back, but
4441 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
4442
63d2b86e
PE
4443 * bitmaps: Change bitmaps from unsigned char back to the X11
4444 compatible char. Avoid the old compiler warnings about
4445 out-of-range initializers by using, for example, '\xab' rather
4446 than 0xab.
4447
aefd87e1
PE
4448 * xgselect.c (xgselect_initialize): Check vs interface
4449 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
4450
bf501fb9
PE
4451 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
4452
e9829fdf
PE
4453 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
4454 to read-only memory.
4455
1086c095
PE
4456 * fns.c (vector): Remove; this old hack is no longer needed.
4457
2baccd04 4458 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 4459 Remove unused var.
dde42981 4460 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 4461
72391843 4462 * xrdb.c (x_load_resources): Omit unused local.
3565b346 4463
436c16df 4464 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 4465 (x_window): Rename locals to avoid shadowing.
dc5ddd85 4466 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 4467
92bb796d 4468 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 4469 (x_term_init): Remove local to avoid shadowing.
92bb796d 4470
764430a3 4471 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
4472
4473 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
4474 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
4475
d1dfb56c
EZ
44762011-04-16 Eli Zaretskii <eliz@gnu.org>
4477
c4354cb4
EZ
4478 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
4479
d1dfb56c
EZ
4480 Fix regex.c, syntax.c and friends for buffers > 2GB.
4481 * syntax.h (struct gl_state_s): Declare character position members
4482 EMACS_INT.
4483
4484 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
4485
04f2d78b
CB
4486 * textprop.c (verify_interval_modification, interval_of):
4487 Declare arguments EMACS_INT.
d1dfb56c
EZ
4488
4489 * intervals.c (adjust_intervals_for_insertion): Declare arguments
4490 EMACS_INT.
4491
4492 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
4493
4494 * indent.c (Fvertical_motion): Local variable it_start is now
4495 EMACS_INT.
4496
4497 * regex.c (re_match, re_match_2, re_match_2_internal)
4498 (bcmp_translate, regcomp, regexec, print_double_string)
4499 (group_in_compile_stack, re_search, re_search_2, regex_compile)
4500 (re_compile_pattern, re_exec): Declare arguments and local
4501 variables `size_t' and `ssize_t' and return values `regoff_t', as
4502 appropriate.
4503 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
4504 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
4505 <compile_stack_type>: `size' and `avail' are now `size_t'.
4506
4507 * regex.h <regoff_t>: Use ssize_t, not int.
4508 (re_search, re_search_2, re_match, re_match_2): Arguments that
4509 specify buffer/string position and length are now ssize_t and
4510 size_t. Return type is regoff_t.
4511
613052cd
BK
45122011-04-16 Ben Key <bkey76@gmail.com>
4513
4514 * nsfont.m: Fixed bugs in ns_get_family and
4515 ns_descriptor_to_entity that were caused by using free to
4516 deallocate memory blocks that were allocated by xmalloc (via
4517 xstrdup). This caused Emacs to crash when compiled with
4518 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
4519 --enable-checking=xmallocoverrun). xfree is now used to
4520 deallocate these memory blocks.
4521
4170f62f 45222011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 4523
71b41406
PE
4524 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
4525
9587a89d
PE
4526 emacs_write: Accept and return EMACS_INT for sizes.
4527 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
4528 et seq.
4529 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
4530 Accept and return EMACS_INT.
4531 (emacs_gnutls_write): Return the number of bytes written on
4532 partial writes.
4533 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
4534 (emacs_read, emacs_write): Remove check for negative size, as the
4535 Emacs source code has been audited now.
9587a89d
PE
4536 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
4537 (emacs_read, emacs_write): Use it.
273a5f82
PE
4538 * process.c (send_process): Adjust to the new signatures of
4539 emacs_write and emacs_gnutls_write. Do not attempt to store
4540 a byte offset into an 'int'; it might overflow.
9587a89d 4541 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 4542
3e047f51
PE
4543 * sound.c: Don't assume sizes fit in 'int'.
4544 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 4545 Return EMACS_INT, not int.
3e047f51 4546 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
4547 Accept EMACS_INT, not int.
4548 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
4549 record read return values.
4550
cc39a9db
BK
45512011-04-15 Ben Key <bkey76@gmail.com>
4552
c9d0ec6d
JB
4553 * keyboard.c (Qundefined): Don't declare static since it is used
4554 in nsfns.m.
4555 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
4556 static since they are used in nsfont.m.
cc39a9db 4557
6c60eb9f
SM
45582011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
4559
4560 * process.c (Qprocessp): Don't declare static.
4561 * lisp.h (Qprocessp): Declare again.
4562
7990b61a
JB
45632011-04-15 Juanma Barranquero <lekktu@gmail.com>
4564
4565 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
4566
5d4cb038
PE
45672011-04-14 Paul Eggert <eggert@cs.ucla.edu>
4568
8bd7b830 4569 Improve C-level modularity by making more things 'static'.
cd64ea1d 4570
e3b27b31
PE
4571 Don't publish debugger-only interfaces to other modules.
4572 * lisp.h (safe_debug_print, debug_output_compilation_hack):
4573 (verify_bytepos, count_markers): Move decls to the only modules
4574 that need them.
4575 * region-cache.h (pp_cache): Likewise.
4576 * window.h (check_all_windows): Likewise.
4577 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
4578
5d4cb038
PE
4579 * sysdep.c (croak): Now static, if
4580 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
4581 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
4582
4583 * alloc.c (refill_memory_reserve): Now static if
4584 !defined REL_ALLOC || defined SYSTEM_MALLOC.
4585 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 4586
e87b6180
PE
4587 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
4588 Define only if USE_LUCID.
4589
ac64929e
PE
4590 * xrdb.c (x_customization_string, x_rm_string): Now static.
4591
6f37259d
PE
4592 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
4593 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
4594
1683e3ab
PE
4595 * xdisp.c (draw_row_with_mouse_face): Now static.
4596 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
4597
de9c2632
PE
4598 * window.h (check_all_windows): Mark externally visible.
4599
2b96acb7
PE
4600 * window.c (window_deletion_count): Now static.
4601
4602 * undo.c: Make symbols static if they're not exported.
4603 (last_undo_buffer, last_boundary_position, pending_boundary):
4604 Now static.
4605
50436f33
PE
4606 * textprop.c (interval_insert_behind_hooks): Now static.
4607 (interval_insert_in_front_hooks): Likewise.
4608
64520e5c
PE
4609 * term.c: Make symbols static if they're not exported.
4610 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
4611 (max_frame_lines, tty_set_terminal_modes):
4612 (tty_reset_terminal_modes, tty_turn_off_highlight):
4613 (get_tty_terminal): Now static.
4614 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
4615 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 4616 HAVE_WINDOW_SYSTEM.
64520e5c
PE
4617 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
4618 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
4619
1fa53021
PE
4620 * sysdep.c: Make symbols static if they're not exported.
4621 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
4622 Now static.
4623 (sigprocmask_set, full_mask): Remove; unused.
4624 (wait_debugging): Mark as visible.
4625 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
4626 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
4627
d4b43b22
PE
4628 * syntax.c (syntax_temp): Define only if !__GNUC__.
4629
b7c513d0
PE
4630 * sound.c (current_sound_device, current_sound): Now static.
4631
989b29ad
PE
4632 * search.c (searchbufs, searchbuf_head): Now static.
4633
13a55a78
PE
4634 * scroll.c (scroll_cost): Remove; unused.
4635 * dispextern.h (scroll_cost): Remove decl.
4636
de68a1fc
PE
4637 * region-cache.h (pp_cache): Mark as externally visible.
4638
40ccffa6
PE
4639 * process.c: Make symbols static if they're not exported.
4640 (process_tick, update_tick, create_process, chan_process):
4641 (Vprocess_alist, proc_buffered_char, datagram_access):
4642 (fd_callback_data, send_process_frame, process_sent_to): Now static.
4643 (deactivate_process): Mark defn as static, as well as decl.
4644 * lisp.h (create_process): Remove decl.
4645 * process.h (chan_process, Vprocess_alist): Remove decls.
4646
ad64fc97
PE
4647 * print.c: Make symbols static if they're not exported.
4648 (print_depth, new_backquote_output, being_printed, print_buffer):
4649 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
4650 (print_interval, print_number_index, initial_stderr_stream):
4651 Now static.
4652 * lisp.h (Fprinc): Remove decl.
4653 (debug_output_compilation_hack): Mark as externally visible.
4654
adddb265
PE
4655 * sysdep.c (croak): Move decl from here to syssignal.h.
4656 * syssignal.h (croak): Put it here, so the API can be checked when
4657 'croak' is called from dissociate_if_controlling_tty.
4658
1717ede2
PE
4659 * minibuf.c: Make symbols static if they're not exported.
4660 (minibuf_save_list, choose_minibuf_frame): Now static.
4661 * lisp.h (choose_minibuf_frame): Remove decl.
4662
fa5fb2bc
PE
4663 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
4664
1e3890d1
PE
4665 * lread.c: Make symbols static if they're not exported.
4666 (read_objects, initial_obarray, oblookup_last_bucket_number):
4667 Now static.
4668 (make_symbol): Remove; unused.
4669 * lisp.h (initial_obarray, make_symbol): Remove decls.
4670
8a1414fa
PE
4671 * keyboard.c: Make symbols static if they're not exported.
4672 (single_kboard, recent_keys_index, total_keys, recent_keys):
4673 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
4674 (this_single_command_key_start, echoing, last_auto_save):
4675 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
4676 (command_loop, echo_now, keyboard_init_hook, help_char_p):
4677 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
4678 (Vlispy_mouse_stem, double_click_count):
4679 Now static.
4680 (force_auto_save_soon): Define only if SIGDANGER.
4681 (ignore_mouse_drag_p): Now static if
4682 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
4683 (print_help): Remove; unused.
4684 (stop_character, last_timer_event): Mark as externally visible.
4685 * keyboard.h (ignore_mouse_drag_p): Declare only if
4686 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
4687 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
4688 * lisp.h (echoing): Remove decl.
4689 (force_auto_save_soon): Declare only if SIGDANGER.
4690 * xdisp.c (redisplay_window): Simplify code, to make it more
4691 obvious that ignore_mouse_drag_p is not accessed if !defined
4692 USE_GTK && !defined HAVE_NS.
4693
93ea6e8f
PE
4694 * intervals.c: Make symbols static if they're not exported.
4695 (merge_properties_sticky, merge_interval_right, delete_interval):
4696 Now static.
4697 * intervals.h (merge_interval_right, delete_interval): Remove decls.
4698
77382fcc
PE
4699 * insdel.c: Make symbols static if they're not exported.
4700 However, leave prepare_to_modify_buffer alone. It's never
4701 called from outside this function, but that appears to be a bug.
4702 (combine_after_change_list, combine_after_change_buffer):
4889fc82 4703 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
4704 (adjust_after_replace_noundo): Remove; unused.
4705 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 4706 (signal_before_change): Remove decls.
77382fcc 4707
9306c32e
PE
4708 * indent.c (val_compute_motion, val_vmotion): Now static.
4709
cd44d2eb
PE
4710 * image.c: Make symbols static if they're not exported.
4711 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
4712 if USE_GTK.
4713 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
4714 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
4715
ad9a7a06
PE
4716 * fringe.c (standard_bitmaps): Now static.
4717 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
4718
81626931
PE
4719 * frame.c: Make symbols static if they're not exported.
4720 (x_report_frame_params, make_terminal_frame): Now static.
4721 (get_frame_param): Now static, unless HAVE_NS.
4722 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
4723 (x_get_resource_string): Remove; not used.
4724 * frame.h (make_terminal_frame, x_report_frame_params):
4725 (x_get_resource_string); Remove decls.
4726 (x_fullscreen_adjust): Declare only if WINDOWSNT.
4727 * lisp.h (get_frame_param): Declare only if HAVE_NS.
4728
239f9db9
PE
4729 * font.c, fontset.c: Make symbols static if they're not exported.
4730 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
4731 (FACE_SUITABLE_FOR_CHAR_P): Use it.
4732 * font.c (font_close_object): Now static.
4733 * font.h (font_close_object): Remove.
4734 * fontset.c (FONTSET_OBJLIST): Remove.
4735 (free_realized_fontset) #if-0 the body, which does nothing.
4736 (face_suitable_for_char_p): #if-0, as it's never called.
4737 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
4738 * xfaces.c (face_at_string_position):
4739 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
4740 since 0 is always ASCII.
4741
dfcf3579
PE
4742 * fns.c (weak_hash_tables): Now static.
4743
5045092b
PE
4744 * fileio.c: Make symbols static if they're not exported.
4745 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
4746 (Vwrite_region_annotation_buffers): Now static.
4747
57a96f5c
PE
4748 * eval.c: Make symbols static if they're not exported.
4749 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
4750 * lisp.h (backtrace_list): Remove decl.
4751
35f08c38
PE
4752 * emacs.c: Make symbols static if they're not exported.
4753 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
4754 (fatal_error_code, fatal_error_signal_hook, standard_args):
4755 Now static.
4756 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
4757 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
4758 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
4759 * lisp.h (fatal_error_signal_hook): Remove decl.
4760 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
4761
f44bd759
PE
4762 * editfns.c: Move a (normally-unused) function to its only use.
4763 * editfns.c, lisp.h (get_operating_system_release): Remove.
4764 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
4765 worth the hassle of breaking this out.
4766
b532497d
PE
4767 * xterm.c: Make symbols static if they're not exported.
4768 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
4769 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
4770 (x_destroy_window, x_delete_display):
4771 Now static.
4772 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
4773 (x_mouse_leave): Remove; unused.
4774 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
4775 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
4776 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
4777 Remove decls.
4778 (x_mouse_leave): Declare only if WINDOWSNT.
4779 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
4780 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
4781 USE_X_TOOLKIT.
4782
1675728f
PE
4783 * ftxfont.c: Make symbols static if they're not exported.
4784 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
4785 HAVE_FREETYPE.
4786 * font.h (ftxfont_driver): Likewise.
4787
e4cebfca
PE
4788 * xfns.c: Make symbols static if they're not exported.
4789 (x_last_font_name, x_display_info_for_name):
4790 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
4791 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
4792 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
4793 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
4794 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
4795 (last_show_tip_args): Now static.
4796 (xic_defaut_fontset, xic_create_fontsetname): Define only if
4797 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
4798 (x_screen_planes): Remove; unused.
4799 * dispextern.h (x_screen_planes): Remove decl.
4800
5bf46f05
PE
4801 * dispnew.c: Make symbols static if they're not exported.
4802 * dispextern.h (redraw_garbaged_frames, scrolling):
4803 (increment_row_positions): Remove.
4804 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
4805 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
4806 Now static.
4807 (redraw_garbaged_frames): Remove; unused.
4808
435f4c28
PE
4809 * xfaces.c: Make symbols static if they're not exported.
4810 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
4811 Remove decls.
4812 * xterm.h (defined_color): Remove decls.
4813 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
4814 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
4815 (menu_face_changed_default, defined_color, free_realized_face):
4816 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
4817 (ascii_face_of_lisp_face): Remove; unused.
4818
8524aef3
PE
4819 * xdisp.c: Make symbols static if they're not exported.
4820 * dispextern.h (scratch_glyph_row, window_box_edges):
4821 (glyph_to_pixel_coords, set_cursor_from_row):
4822 (get_next_display_element, set_iterator_to_next):
4823 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
4824 (show_mouse_face): Remove decls
4825 * frame.h (message_buf_print): Likewise.
4826 * lisp.h (pop_message, set_message, check_point_in_composition):
4827 Likewise.
4828 * xterm.h (set_vertical_scroll_bar): Likewise.
4829 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
4830 (message_buf_print, scratch_glyph_row, displayed_buffer):
4831 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
4832 (get_next_display_element, show_mouse_face, window_box_edges):
4833 (frame_to_window_pixel_xy, check_point_in_composition):
4834 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
4835 (glyph_to_pixel_coords): Remove; unused.
4836
16390cd2
PE
4837 * dired.c (file_name_completion): Now static.
4838
4839 * dbusbind.c (xd_in_read_queued_messages): Now static.
4840
a25f4dfa
PE
4841 * lisp.h (circular_list_error, FOREACH): Remove; unused.
4842 * data.c (circular_list_error): Remove.
4843
14a9c8df
PE
4844 * commands.h (last_point_position, last_point_position_buffer):
4845 (last_point_position_window): Remove decls.
4846 * keyboard.c: Make these variables static.
4847
04f2d78b
CB
4848 * coding.h (coding, code_convert_region, encode_coding_gap):
4849 Remove decls.
74ab6df5
PE
4850 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
4851 (iso_code_class, detect_coding, code_convert_region): Now static.
4852 (encode_coding_gap): Remove; unused.
4853
38dfbee1
PE
4854 * chartab.c (chartab_chars, chartab_bits): Now static.
4855
a2cb4e63
PE
4856 * charset.h (charset_iso_8859_1): Remove decl.
4857 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
4858 Now static.
4859
127198fd
PE
4860 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
4861 * ccl.c (Vccl_program_table): Now static.
4862 (check_ccl_update): Remove; unused.
4863
d85b608f
PE
4864 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
4865 * category.h: ... from here.
4866 * category.c (check_category_table, set_category_set): Now static.
4867
31cd66f3
PE
4868 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
4869 * lisp.h: Remove these decls.
4870
c358e587
PE
4871 * buffer.c (buffer_count): Remove unused var.
4872
e78aecca
PE
4873 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
4874 so that it's not optimized away.
4875 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
4876 * dispextern.h (bidi_dump_cached_states): Remove, since it's
4877 exported only to the debugger.
4878
e192d7d3 4879 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 4880 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 4881
92470028
PE
4882 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
4883 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
4884 was inaccessible from Lisp.
4885 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
4886 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
4887
244ed907
PE
4888 alloc.c: Import and export fewer symbols, and remove unused items.
4889 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
4890 is defined.
4891 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
4892 it's not optimized away by whole-program optimization.
4893 (message_enable_multibyte, free_misc): Remove.
4894 (catchlist, handlerlist, mark_backtrace):
4895 Declare only if BYTE_MARK_STACK.
4896 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
4897 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
4898 (message_enable_multibyte): Remove decl.
4899 (free_misc, interval_free_list, float_block, float_block_index):
4900 (n_float_blocks, float_free_list, cons_block, cons_block_index):
4901 (cons_free_list, last_marked_index):
4902 Now static.
4903 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
4904 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
4905 (mark_backtrace): Define only if BYTE_MARK_STACK.
4906 * xdisp.c (message_enable_multibyte): Now static.
4907
61c2b50e 4908 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
4909 This makes it easier for human readers (and static analyzers)
4910 to see whether these variables are used from other modules.
4911 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
4912 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
4913 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
4914 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
4915 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
4916 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
4917 * xmenu.c, xselect.c:
4918 Declare Q* vars static if they are not used in other modules.
4919 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
4920 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
4921 Remove decls of unexported vars.
4922 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
4923
95c82688
PE
4924 * lisp.h (DEFINE_FUNC): Make sname 'static'.
4925
16a97296
PE
4926 Make Emacs functions such as Fatom 'static' by default.
4927 This makes it easier for human readers (and static analyzers)
4928 to see whether these functions can be called from other modules.
4929 DEFUN now defines a static function. To make the function external
4930 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
4931 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
4932 (Finit_image_library):
16a97296
PE
4933 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
4934 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
4935 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
4936 Remove decls, since these functions are now static.
4937 (Funintern, Fget_internal_run_time): New decls, since these functions
4938 were already external.
95c82688 4939
16a97296
PE
4940 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
4941 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
4942 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
4943 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
4944 * keyboard.c, keymap.c, lread.c:
4945 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
4946 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
4947 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
4948 Mark functions with DEFUE instead of DEFUN,
4949 if they are used in other modules.
4950 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
4951 decls for now-static functions.
4952 * buffer.h (Fdelete_overlay): Remove decl.
4953 * callproc.c (Fgetenv_internal): Mark as internal.
4954 * composite.c (Fremove_list_of_text_properties): Remove decl.
4955 (Fcomposition_get_gstring): New forward static decl.
4956 * composite.h (Fcomposite_get_gstring): Remove decl.
4957 * dired.c (Ffile_attributes): New forward static decl.
4958 * doc.c (Fdocumntation_property): New forward static decl.
4959 * eval.c (Ffetch_bytecode): New forward static decl.
4960 (Funintern): Remove extern decl; now in .h file where it belongs.
4961 * fileio.c (Fmake_symbolic_link): New forward static decl.
4962 * image.c (Finit_image_library): New forward static decl.
4963 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
4964 * intervals.h (Fprevious_property_change):
4965 (Fremove_list_of_text_properties): Remove decls.
4966 * keyboard.c (Fthis_command_keys): Remove decl.
4967 (Fcommand_execute): New forward static decl.
4968 * keymap.c (Flookup_key): New forward static decl.
4969 (Fcopy_keymap): Now static.
4970 * keymap.h (Flookup_key): Remove decl.
4971 * process.c (Fget_process): New forward static decl.
4972 (Fprocess_datagram_address): Mark as internal.
4973 * syntax.c (Fsyntax_table_p): New forward static decl.
4974 (skip_chars): Remove duplicate decl.
4975 * textprop.c (Fprevious_property_change): New forward static decl.
4976 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
4977 Now internal.
4978 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
4979 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
4980
785bbd42
PE
4981 * editfns.c (Fformat): Remove unreachable code.
4982
8b913b57
AS
49832011-04-14 Andreas Schwab <schwab@linux-m68k.org>
4984
4985 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
4986 change. (Bug#8496)
4987
a6744a35
EZ
49882011-04-13 Eli Zaretskii <eliz@gnu.org>
4989
4990 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
4991 when at ZV. (Bug#8487)
4992
e7974947
AS
49932011-04-12 Andreas Schwab <schwab@linux-m68k.org>
4994
baad03f0
AS
4995 * charset.c (Fclear_charset_maps): Use xfree instead of free.
4996 (Bug#8437)
4997 * keyboard.c (parse_tool_bar_item): Likewise.
4998 * sound.c (sound_cleanup, alsa_close): Likewise.
4999 * termcap.c (tgetent): Likewise.
5000 * xfns.c (x_default_font_parameter): Likewise.
5001 * xsettings.c (read_and_apply_settings): Likewise.
5002
e7974947
AS
5003 * alloc.c (overrun_check_malloc, overrun_check_realloc)
5004 (overrun_check_free): Protoize.
5005
28272684
PE
50062011-04-12 Paul Eggert <eggert@cs.ucla.edu>
5007
5008 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
5009 since callers should never pass a negative size.
5010 Change the signature to match that of plain 'read' and 'write'; see
5011 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
5012 * lisp.h: Update prototypes of emacs_write and emacs_read.
5013
11997c76
EZ
50142011-04-11 Eli Zaretskii <eliz@gnu.org>
5015
5016 * xdisp.c (redisplay_window): Don't try to determine the character
5017 position of the scroll margin if the window start point w->startp
e896f03c 5018 is outside the buffer's accessible region. (Bug#8468)
11997c76 5019
8a2cbd72
EZ
50202011-04-10 Eli Zaretskii <eliz@gnu.org>
5021
5022 Fix write-region and its subroutines for buffers > 2GB.
5023 * fileio.c (a_write, e_write): Modify declaration of arguments and
5024 local variables to support buffers larger than 2GB.
5025 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
5026
5027 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
5028 argument, local variables, and return value.
5029
5030 * lisp.h: Update prototypes of emacs_write and emacs_read.
5031
5032 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
5033
4073e537 50342011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 5035
1ebfdcb6
PE
5036 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
5037
b2ded58d
PE
5038 Fix more problems found by GCC 4.6.0's static checks.
5039
7d66342c
PE
5040 * xdisp.c (vmessage): Use a better test for character truncation.
5041
bbf47d44
PE
5042 * charset.c (load_charset_map): <, not <=, for optimization,
5043 and to avoid potential problems with integer overflow.
9248994d 5044 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 5045 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 5046 * editfns.c (Fformat): Likewise.
1e69125e 5047 * syntax.c (skip_chars): Likewise.
3befa583 5048
e3019616
PE
5049 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
5050 This also lets GCC 4.6.0 generate slightly better loop code.
5051
becfa255
PE
5052 * callint.c (Fcall_interactively): <, not <=, for optimization.
5053 (Fcall_interactively): Count the number of arguments produced,
5054 not the number of arguments given. This is simpler and lets GCC
5055 4.6.0 generate slightly better code.
5056
dae0cd48
PE
5057 * ftfont.c: Distingish more carefully between FcChar8 and char.
5058 The previous code passed unsigned char * to a functions like
5059 strlen and xstrcasecmp that expect char *, which does not
5060 conform to the C standard.
5061 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
5062 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
5063 char * when the C standard requires it.
5064
76032d70
PE
5065 * keyboard.c (read_char): Remove unused var.
5066
eb3f1cc8
PE
5067 * eval.c: Port to Windows vsnprintf (Bug#8435).
5068 Include <limits.h>.
5069 (SIZE_MAX): Define if the headers do not.
5070 (verror): Do not give up if vsnprintf returns a negative count.
5071 Instead, grow the buffer. This ports to Windows vsnprintf, which
5072 does not conform to C99. Problem reported by Eli Zaretskii.
5073 Also, simplify the allocation scheme, by avoiding the need for
5074 calling realloc, and removing the ALLOCATED variable.
5075
70476b54
PE
5076 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
5077
12020a9e
PE
5078 Remove invocations of doprnt, as Emacs now uses vsnprintf.
5079 But keep the doprint source code for now, as we might revamp it
5080 and use it again (Bug#8435).
ea6c7ae6
PE
5081 * lisp.h (doprnt): Remove.
5082 * Makefile.in (base_obj): Remove doprnt.o.
5083 * deps.mk (doprnt.o): Remove.
5084
5fdb398c
PE
5085 error: Print 32- and 64-bit integers portably (Bug#8435).
5086 Without this change, on typical 64-bit hosts error ("...%d...", N)
5087 was used to print both 32- and 64-bit integers N, which relied on
5088 undefined behavior.
5089 * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
5090 New macro.
5091 * lisp.h (error, verror): Mark as printf-like functions.
5092 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
5093 Report overflow in size calculations when allocating printf buffer.
5094 Do not truncate output string at its first null byte.
5095 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
5096 Truncate the output at a character boundary, since vsnprintf does not
5097 do that.
5098 * charset.c (check_iso_charset_parameter): Convert internal
5099 character to string before calling 'error', since %c now has the
5100 printf meaning.
5101 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
5102 overflow when computing char to be passed to 'error'. Do not
5103 pass Lisp_Object to 'error'; pass the integer instead.
5104 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
5105 formatted with plain %d.
5106
b189fa66
PE
5107 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
5108
bff87ef0
PE
5109 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
5110
7e2cac20
PE
5111 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
5112
ce4d90b5
PE
5113 * xterm.c (x_catch_errors): Remove duplicate declaration.
5114
266c9547
PE
5115 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
5116
79c49ad2
PE
5117 * xdisp.c, lisp.h (message_nolog): Remove; unused.
5118
368f4090
JM
51192011-04-10 Jim Meyering <meyering@redhat.com>
5120
5121 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
5122 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
5123 return ssize_t not "int", and use size_t as the buffer length.
5124 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
5125 * gnutls.h: Update declarations.
5126 * process.c (read_process_output): Use ssize_t, to match.
5127 (send_process): Likewise.
5128
a32d4040
CY
51292011-04-09 Chong Yidong <cyd@stupidchicken.com>
5130
5131 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
5132
8546720e 51332011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 5134
04f2d78b
CB
5135 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
5136 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 5137
8546720e
GM
5138 * xterm.c (handle_one_xevent):
5139 * xmenu.c (create_and_show_popup_menu):
5140 * xselect.c (x_decline_selection_request)
5141 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 5142
0a2f5c1a 51432011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
5144
5145 Fix some uses of `int' instead of EMACS_INT.
5146 * search.c (string_match_1, fast_string_match)
5147 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
5148 (scan_buffer, find_next_newline_no_quit)
5149 (find_before_next_newline, search_command, Freplace_match)
5150 (Fmatch_data): Make some `int' variables be EMACS_INT.
5151
5152 * xdisp.c (display_count_lines): 3rd argument and return value now
5153 EMACS_INT. All callers changed.
5154 (pint2hrstr): Last argument is now EMACS_INT.
5155
5156 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
5157 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5158 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
5159 (decode_coding_utf_16, decode_coding_emacs_mule)
5160 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
5161 (decode_coding_ccl, decode_coding_charset)
5162 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
5163 (decode_coding_iso_2022, decode_coding_emacs_mule)
5164 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
5165 <char_offset, last_offset>: Declare EMACS_INT.
5166 (encode_coding_utf_8, encode_coding_utf_16)
5167 (encode_coding_emacs_mule, encode_invocation_designation)
5168 (encode_designation_at_bol, encode_coding_iso_2022)
5169 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
5170 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
5171 Declare EMACS_INT.
5172 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
5173 (encode_invocation_designation): Last argument P_NCHARS is now
5174 EMACS_INT.
5175 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
5176 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
5177
5178 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
5179 All users changed.
5180
5181 * ccl.c (Fccl_execute_on_string): Declare some variables
5182 EMACS_INT.
5183
8546720e 51842011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
5185
5186 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
5187
4e19a977
CS
51882011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
5189
5190 * process.c (Fformat_network_address): Doc fix.
5191
87302331
R
51922011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
5193
5194 * xml.c (parse_region): Avoid creating spurious whiespace nodes.
5195
cbb59342
CY
51962011-04-08 Chong Yidong <cyd@stupidchicken.com>
5197
5198 * keyboard.c (read_char): Call Lisp function help-form-show,
5199 instead of using internal_with_output_to_temp_buffer.
5200 (Qhelp_form_show): New var.
e0d38eeb 5201 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
5202
5203 * print.c (internal_with_output_to_temp_buffer): Function deleted.
5204
5205 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
5206
e67a13ab
CY
52072011-04-06 Chong Yidong <cyd@stupidchicken.com>
5208
04f2d78b
CB
5209 * process.c (Flist_processes): Remove to Lisp.
5210 (list_processes_1): Delete.
e67a13ab 5211
973f782d
EZ
52122011-04-06 Eli Zaretskii <eliz@gnu.org>
5213
7c106b1e
EZ
5214 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
5215
973f782d
EZ
5216 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
5217
41cf7d1a 52182011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 5219
ca23cc88
PE
5220 Fix more problems found by GCC 4.6.0's static checks.
5221
f390e2d5
PE
5222 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
5223
42eea0d0
PE
5224 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
5225
b69769da 5226 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 5227
f9541e84
PE
5228 * xdisp.c (vmessage): Mark as a printf-like function.
5229
13841b55
PE
5230 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
5231
c136c10f
PE
5232 * sound.c (sound_warning): Don't crash if arg contains a printf format.
5233
5e2d4a30
PE
5234 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
5235 printf-like functions.
5236 (tiff_load): Add casts to remove these marks before passing them
5237 to system-supplied API.
5238
583f48b9
PE
5239 * eval.c (Fsignal): Remove excess argument to 'fatal'.
5240
b25d760e
PE
5241 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
5242 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
5243 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
5244 directly, rather than having caller test rule sign. This avoids
5245 some unnecessary tests.
5246 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
5247 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
5248 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 5249
bc7b6697 5250 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 5251 (xfont_open): Avoid unnecessary tests.
bc7b6697 5252
27ccc379
PE
5253 * composite.c (composition_gstring_put_cache): Use unsigned integer.
5254
dcd5c89a
PE
5255 * composite.h, composite.c (composition_gstring_put_cache):
5256 Use EMACS_INT, not int, for length.
5257
b13a45c6
PE
5258 * composite.h (COMPOSITION_DECODE_REFS): New macro,
5259 breaking out part of COMPOSITION_DECODE_RULE.
5260 (COMPOSITION_DECODE_RULE): Use it.
5261 * composite.c (get_composition_id): Remove unused local vars,
5262 by using the new macro.
5263
1e792e4d
PE
5264 * textprop.c (set_text_properties_1): Change while to do-while,
5265 since the condition is always true at first.
5266
dc6c6455 5267 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
5268 (interval_deletion_adjustment): Return unsigned value.
5269 All uses changed.
dc6c6455 5270
aba7731a
PE
5271 * process.c (list_processes_1, create_pty, read_process_output):
5272 (exec_sentinel): Remove vars that were set but not used.
afd4052b 5273 (create_pty): Remove unnecessary "volatile"s.
bc57d757 5274 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 5275 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 5276 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 5277
fdfc4bf3
PE
5278 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
5279
fca8fe46 5280 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 5281 (update_syntax_table): Use unsigned instead of int.
fca8fe46 5282
06a0259a 5283 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 5284 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 5285 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 5286
e7b9e80f
PE
5287 * print.c (print_error_message): Avoid int overflow.
5288
56201685
PE
5289 * font.c (font_list_entities): Redo for clarity,
5290 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
5291
78834453 5292 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 5293 (font_score): Avoid potential overflow in diff calculation.
78834453 5294
0bc0b309 5295 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 5296 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 5297
e610eaca
PE
5298 * eval.c (funcall_lambda): Rename local to avoid shadowing.
5299
b895abce
PE
5300 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
5301 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
5302 can always succeed if overflow has undefined behavior.
5303
1f1d9321 5304 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 5305 (wordify): Omit three unnecessary tests.
1f1d9321 5306
c59478bc
PE
5307 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
5308 All callers changed. This avoids the need for an unused var.
5309
79b73827
PE
5310 * casefiddle.c (casify_region): Remove var that is set but not used.
5311
a4db5dfe
PE
5312 * dired.c (file_name_completion): Remove var that is set but not used.
5313
43aae36e
PE
5314 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
5315
2a47c44d 5316 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 5317 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 5318
a37c69bf
PE
5319 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
5320 Check for integer overflow on size calculations.
5321
328ab8e7
PE
5322 * buffer.c (Fprevious_overlay_change): Remove var that is set
5323 but not used.
5324
e5a2a5cb
PE
5325 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
5326 Remove vars that are set but not used.
8d84a6eb 5327 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 5328 (timer_check_2): Mark vars as initialized.
e5a2a5cb 5329
a60e5f68
PE
5330 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
5331
f661cb61 5332 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 5333 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 5334
f0397f5a
PE
5335 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
5336 that are set but not used.
5337
8664db06 5338 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 5339 if XCreateBitmapFromData fails (Bug#8410).
8664db06 5340
6abdaa4a
PE
5341 * xselect.c (x_get_local_selection, x_handle_property_notify):
5342 Remove vars that are set but not used.
5343
0ce7538d 5344 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 5345 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 5346
9ae848fc
PE
5347 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
5348 Remove var that is set but not used.
0b918413
PE
5349 (scroll_bar_windows_size): Now size_t, not int.
5350 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
5351 Check for overflow.
9ae848fc 5352
a5a62657
PE
5353 * xfaces.c (realize_named_face): Remove vars that are set but not used.
5354 (map_tty_color) [!defined MSDOS]: Likewise.
5355
5c5cdd39
PE
5356 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
5357
66ebf983
PE
5358 * coding.c: Remove vars that are set but not used.
5359 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
5360 All callers changed.
5361 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
5362 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
5363 (decode_coding_charset): Remove vars that are set but not used.
5364
1be4d761
PE
5365 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
5366 that is set but not used.
5367
47553fa8
PE
5368 * print.c (print_object): Remove var that is set but not used.
5369
1f7196bf 5370 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
5371 The gnulib version avoids calling malloc in the usual case,
5372 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
5373 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
5374 * filelock.c (current_lock_owner): Likewise.
5375 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
5376 * sysdep.c: Include allocator.h, careadlinkat.h.
5377 (emacs_no_realloc_allocator): New static constant.
5378 (emacs_readlink): New function.
fdb61804
PE
5379 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
5380 ../lib/careadlinkat.h.
d1fdcab7 5381
f84c17c7
SM
53822011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
5383
5384 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
5385 first non-nil return value).
5386
ef3862ad
JD
53872011-04-03 Jan Djärv <jan.h.d@swipnet.se>
5388
5389 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
5390 if not defined (Bug#8403).
5391
376a7006
JB
53922011-04-02 Juanma Barranquero <lekktu@gmail.com>
5393
5394 * xdisp.c (display_count_lines): Remove parameter `start',
5395 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
5396 (get_char_face_and_encoding): Remove parameter `multibyte_p',
5397 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
5398 (fill_stretch_glyph_string): Remove parameters `row' and `area',
5399 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
5400 and thereabouts. All callers changed.
5401 (get_per_char_metric): Remove parameter `f', unused since
5402 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
5403
6ca3801d
JM
54042011-04-02 Jim Meyering <meyering@redhat.com>
5405
5406 do not dereference NULL upon failed strdup
5407 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
5408 (ns_get_family): Likewise.
5409
d8e2b5ba
JB
54102011-04-02 Juanma Barranquero <lekktu@gmail.com>
5411
5412 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
5413
8c74fcbd
JD
54142011-04-02 Jan Djärv <jan.h.d@swipnet.se>
5415
5416 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
5417 later (Bug#8403).
5418
7200d79c
SM
54192011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
5420
03408648 5421 Add lexical binding.
7200d79c 5422
03408648
SM
5423 * window.c (Ftemp_output_buffer_show): New fun.
5424 (Fsave_window_excursion):
5425 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
5426
5427 * lread.c (lisp_file_lexically_bound_p): New function.
5428 (Fload): Bind Qlexical_binding.
5429 (readevalloop): Remove `evalfun' arg.
5430 Bind Qinternal_interpreter_environment.
5431 (Feval_buffer): Bind Qlexical_binding.
5432 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
5433 Mark as dynamic.
5434 (syms_of_lread): Declare `lexical-binding'.
5435
5436 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
5437
5438 * keyboard.c (eval_dyn): New fun.
5439 (menu_item_eval_property): Use it.
ca105506
SM
5440
5441 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 5442
03408648
SM
5443 * fns.c (concat, mapcar1): Accept byte-code-functions.
5444
5445 * eval.c (Fsetq): Handle lexical vars.
5446 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
5447 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
5448 (FletX, Flet): Obey lexical binding.
5449 (Fcommandp): Handle closures.
5450 (Feval): New `lexical' arg.
5451 (eval_sub): New function extracted from Feval. Use it almost
5452 everywhere where Feval was used. Look up vars in lexical env.
5453 Handle closures.
5454 (Ffunctionp): Move from subr.el.
5455 (Ffuncall): Handle closures.
5456 (apply_lambda): Remove `eval_flags'.
5457 (funcall_lambda): Handle closures and new byte-code-functions.
5458 (Fspecial_variable_p): New function.
5459 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
5460 but without exporting it to Lisp.
23aba0ea 5461
23aba0ea 5462 * doc.c (Fdocumentation, store_function_docstring):
03408648 5463 * data.c (Finteractive_form): Handle closures.
23aba0ea 5464
03408648
SM
5465 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
5466 interactive spec.
ba83908c 5467
04f2d78b
CB
5468 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
5469 New byte-codes.
03408648
SM
5470 (exec_byte_code): New function extracted from Fbyte_code to handle new
5471 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 5472
03408648 5473 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 5474
03408648 5475 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 5476
e2abce01
JB
54772011-03-31 Juanma Barranquero <lekktu@gmail.com>
5478
5479 * xdisp.c (redisplay_internal): Fix prototype.
5480
63696a73 54812011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 5482
63696a73 5483 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
5484 (try_scrolling): Use it when setting scroll_limit.
5485 Limit scrolling to 100 screen lines.
63696a73
EZ
5486 (redisplay_window): Even when falling back on "recentering",
5487 position point in the window according to scroll-conservatively,
5488 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
5489
5490 (try_scrolling): When point is above the window, allow searching
5491 as far as scroll_max, or one screenful, to compute vertical
5492 distance from PT to the scroll margin position. This prevents
5493 try_scrolling from unnecessarily failing when
5494 scroll-conservatively is set to a value slightly larger than the
5495 window height. Clean up the case of PT below the margin at bottom
5496 of window: scroll_max can no longer be INT_MAX. When aggressive
5497 scrolling is in use, don't let point enter the opposite scroll
5498 margin as result of the scroll.
5499 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
5500 threshold of 100 lines for never-recentering scrolling.
5501
e4cc2dfc
JB
55022011-03-31 Juanma Barranquero <lekktu@gmail.com>
5503
5504 * dispextern.h (move_it_by_lines):
5505 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
5506 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
5507 (message_log_check_duplicate): Remove parameters `prev_bol' and
5508 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
5509 (redisplay_internal): Remove parameter `preserve_echo_area',
5510 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
5511
5512 * indent.c (Fvertical_motion):
5513 * window.c (window_scroll_pixel_based, Frecenter):
5514 Don't pass `need_y_p' to `move_it_by_lines'.
5515
1c470562
SM
55162011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
5517
44f230aa
SM
5518 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
5519 steal a few bits to be more compact.
5520 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
5521 Remove unneeded casts.
5522
1c470562
SM
5523 * bytecode.c (Fbyte_code): CAR and CDR can GC.
5524
888adce9
ZK
55252011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
5526
5527 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
5528 binding" message (bug#7967).
5529
f838ed7b
PE
55302011-03-30 Paul Eggert <eggert@cs.ucla.edu>
5531
77861b95
PE
5532 Fix more problems found by GCC 4.6.0's static checks.
5533
de6dbc14
PE
5534 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
5535 Remove unused local var.
5536
f838ed7b
PE
5537 * editfns.c (Fmessage_box): Remove unused local var.
5538
792c7b2b
PE
5539 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
5540 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5541 Omit unused local vars.
c499e557 5542 * window.c (shrink_windows): Omit unused local var.
b01a1c29 5543 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
5544 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
5545 Omit unused local var.
5546
ba0165e1
PE
5547 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
5548 Don't assume string length fits in int.
32ad8845 5549 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 5550 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 5551
3c59b4c9
PE
5552 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
5553 instead of alloca (Bug#8344).
5554
a3eed478 5555 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 5556 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 5557
eb4d412d
PE
5558 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
5559
1658b401
PE
5560 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
5561 concerns.
5562
5563 * term.c (produce_glyphless_glyph): Remove unnecessary test.
5564
5565 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 5566
9a2c6e05
PE
5567 * keyboard.c (syms_of_keyboard): Use the same style as later
5568 in this function when indexing through an array. This also
5569 works around GCC bug 48267.
5570
03d0a109
PE
5571 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
5572
44f730c8
PE
5573 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
5574
fe75f926
PE
5575 * chartab.c (sub_char_table_ref_and_range): Redo for slight
5576 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
5577
ffa8c828
PE
5578 * keyboard.c, keyboard.h (num_input_events): Now size_t.
5579 This avoids undefined behavior on integer overflow, and is a bit
5580 more convenient anyway since it is compared to a size_t variable.
5581
c5101a77
PE
5582 Variadic C functions now count arguments with size_t, not int.
5583 This avoids an unnecessary limitation on 64-bit machines, which
5584 caused (substring ...) to crash on large vectors (Bug#8344).
5585 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
5586 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 5587 All variadic functions and their callers changed accordingly.
c5101a77
PE
5588 (struct gcpro.nvars): Now size_t, not int. All uses changed.
5589 * data.c (arith_driver, float_arith_driver): Likewise.
5590 * editfns.c (general_insert_function): Likewise.
5591 * eval.c (struct backtrace.nargs, interactive_p)
5592 (internal_condition_case_n, run_hook_with_args, apply_lambda)
5593 (funcall_lambda, mark_backtrace): Likewise.
5594 * fns.c (concat): Likewise.
5595 * frame.c (x_set_frame_parameters): Likewise.
5596 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
5597 0 if not found, not -1. All callers changed.
5598
dd3f25f7
PE
5599 * alloc.c (garbage_collect): Don't assume stack size fits in int.
5600 (stack_copy_size): Now size_t, not int.
5601 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
5602
461c2ab9
JB
56032011-03-28 Juanma Barranquero <lekktu@gmail.com>
5604
5605 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
5606 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
5607 All callers changed.
5608
5609 * lisp.h (multibyte_char_to_unibyte):
5610 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
5611 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
5612 * character.h (CHAR_TO_BYTE8):
5613 * cmds.c (internal_self_insert):
5614 * editfns.c (general_insert_function):
5615 * keymap.c (push_key_description):
5616 * search.c (Freplace_match):
5617 * xdisp.c (message_dolog, set_message_1): All callers changed.
5618
f6d62986
SM
56192011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
5620
5621 * keyboard.c (safe_run_hook_funcall): New function.
5622 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
5623 don't set the hook to nil, but remove the offending function instead.
5624 (Qcommand_hook_internal): Remove, unused.
5625 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
5626 Vcommand_hook_internal.
5627
5628 * eval.c (enum run_hooks_condition): Remove.
5629 (funcall_nil, funcall_not): New functions.
5630 (run_hook_with_args): Call each function through a `funcall' argument.
5631 Remove `cond' argument, now redundant.
5632 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
5633 (Frun_hook_with_args_until_failure): Adjust accordingly.
5634 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
5635
1db5b1ad
JB
56362011-03-28 Juanma Barranquero <lekktu@gmail.com>
5637
5638 * dispextern.h (string_buffer_position): Remove declaration.
5639
5640 * print.c (strout): Remove parameter `multibyte', unused since
5641 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
5642
5643 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
5644 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
5645 All callers changed.
5646
5647 * w32.c (_wsa_errlist): Use braces for struct initializers.
5648
5649 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
5650 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
5651 All callers changed.
5652 (string_buffer_position): Likewise. Also, make static (it's never
5653 used outside xdisp.c).
5654 (cursor_row_p): Remove parameter `w', unused since
5655 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
5656 (decode_mode_spec): Remove parameter `precision', introduced during
5657 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
5658 All callers changed.
5659
5ffb62aa
JD
56602011-03-27 Jan Djärv <jan.h.d@swipnet.se>
5661
5662 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
5663
461c2ab9 56642011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
5665
5666 * nsterm.m (ns_menu_bar_is_hidden): New variable.
5667 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
5668 (ns_update_auto_hide_menu_bar): New functions.
5669 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
5670 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
5671 ns_constrain_all_frames.
5672 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
5673 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
5674
5c380ffb
JD
56752011-03-27 Jan Djärv <jan.h.d@swipnet.se>
5676
5677 * nsmenu.m (runDialogAt): Remove argument to timer_check.
5678
9af30bdf
GM
56792011-03-27 Glenn Morris <rgm@gnu.org>
5680
5681 * syssignal.h: Replace RETSIGTYPE with void.
5682 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
5683 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
5684 Replace SIGTYPE with void everywhere.
5685 * s/usg5-4-common.h (SIGTYPE): Remove definition.
5686 * s/template.h (SIGTYPE): Remove commented out definition.
5687
e2abce01
JB
56882011-03-26 Eli Zaretskii <eliz@gnu.org>
5689
5690 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
5691 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
5692
f868cd8a
JB
56932011-03-26 Juanma Barranquero <lekktu@gmail.com>
5694
59eb0929
JB
5695 * w32.c (read_unc_volume): Use parameter `henum', instead of
5696 global variable `wget_enum_handle'.
5697
5698 * keymap.c (describe_vector): Remove parameters `indices' and
5699 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
5700 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
5701
f868cd8a
JB
5702 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
5703
5704 * keyboard.c (timer_check): Remove parameter `do_it_now',
5705 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
5706 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
5707 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
5708
5709 * keyboard.c (read_char):
5710 * w32menu.c (w32_menu_display_help):
5711 * xmenu.c (show_help_event, menu_help_callback):
5712 Adjust calls to `show_help_echo'.
5713
5714 * gtkutil.c (xg_maybe_add_timer):
5715 * keyboard.c (readable_events):
5716 * process.c (wait_reading_process_output):
5717 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
5718
5719 * insdel.c (adjust_markers_gap_motion):
5720 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
5721 (gap_left, gap_right): Don't call it.
5722
2ecf6fdb
CY
57232011-03-25 Chong Yidong <cyd@stupidchicken.com>
5724
5725 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
5726 incurred during fontification.
5727
6b1f9ba4
JB
57282011-03-25 Juanma Barranquero <lekktu@gmail.com>
5729
5730 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
5731 (DEFVAR_PER_BUFFER): Don't pass it.
5732
5733 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
5734 (scrolling_window): Don't pass it.
5735
0f4a96b5
JB
57362011-03-25 Juanma Barranquero <lekktu@gmail.com>
5737
5738 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
5739
5740 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
5741 and `suffix'.
5742 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
5743 of variables specific to SELinux and computation of `encoded_absname'.
5744
5745 * image.c (XPutPixel): Remove unused variable `height'.
5746
5747 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
5748
5749 * unexw32.c (get_section_info): Remove unused variable `section'.
5750
5751 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
5752 (system_process_attributes): Remove unused variable `sess'.
5753 (sys_read): Remove unused variable `err'.
5754
5755 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
5756 (w32_wnd_proc): Remove unused variable `isdead'.
5757 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
5758 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
5759 (x_create_tip_frame): Remove unused variable `tem'.
5760
5761 * w32inevt.c (w32_console_read_socket):
5762 Remove unused variable `no_events'.
5763
5764 * w32term.c (x_draw_composite_glyph_string_foreground):
5765 Remove unused variable `width'.
5766
1149507c
JB
57672011-03-24 Juanma Barranquero <lekktu@gmail.com>
5768
5769 * w32term.c (x_set_glyph_string_clipping):
5770 Don't pass uninitialized region to CombineRgn.
5771
9c88f339
JB
57722011-03-23 Juanma Barranquero <lekktu@gmail.com>
5773
5774 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
5775 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
5776 (Fx_close_connection): Remove unused variable `i'.
5777
5778 * w32font.c (w32font_draw): Return number of glyphs.
5779 (w32font_open_internal): Remove unused variable `i'.
5780 (w32font_driver): Add missing initializer.
5781
5782 * w32menu.c (utf8to16): Remove unused variable `utf16'.
5783 (fill_in_menu): Remove unused variable `items_added'.
5784
5785 * w32term.c (last_mouse_press_frame): Remove static global variable.
5786 (w32_clip_to_row): Remove unused variable `f'.
5787 (x_delete_terminal): Remove unused variable `i'.
5788
5789 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
5790 (NOTHING): Remove unused static global variable.
5791 (uniscribe_check_otf): Remove unused variable `table'.
5792 (uniscribe_font_driver): Add missing initializers.
5793
dee091a3
JD
57942011-03-23 Julien Danjou <julien@danjou.info>
5795
5796 * term.c (Fsuspend_tty, Fresume_tty):
5797 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
5798 * window.c (temp_output_buffer_show):
5799 * insdel.c (signal_before_change):
5800 * frame.c (Fhandle_switch_frame):
5801 * fileio.c (Fdo_auto_save):
5802 * emacs.c (Fkill_emacs):
5803 * editfns.c (save_excursion_restore):
5804 * cmds.c (internal_self_insert):
5805 * callint.c (Fcall_interactively):
5806 * buffer.c (Fkill_all_local_variables):
5807 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
5808 Use Frun_hooks.
0f4a96b5 5809 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
dee091a3
JD
5810 unconditionnaly since it does the check itself.
5811
2c520ab5 58122011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 5813
c9c49752
PE
5814 Fix more problems found by GCC 4.5.2's static checks.
5815
8abc3f12
PE
5816 * coding.c (encode_coding_raw_text): Avoid unnecessary test
5817 the first time through the loop, since we know p0 < p1 then.
5818 This also avoids a gcc -Wstrict-overflow warning.
5819
a2d26660
PE
5820 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
5821 leading to a memory leak, possible in functions like
5822 load_charset_map_from_file that can allocate an unbounded number
b12ef411 5823 of objects (Bug#8318).
a2d26660 5824
916c72e9
PE
5825 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
5826 that could (at least in theory) be that large.
5827
19ab8a18
PE
5828 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
5829 This is less likely to overflow, and avoids undefined behavior if
5830 overflow does occur. All callers changed. Use strtoul to scan
5831 for the unsigned long integer.
b7cbbd6f
PE
5832 (pint2hrstr): Simplify and tune code slightly.
5833 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 5834
f0641eff
PE
5835 * scroll.c (do_scrolling): Work around GCC bug 48228.
5836 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
5837
7f650bb9
PE
5838 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
5839 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
5840 (validate_x_resource_name): Simplify count usage.
5841 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 5842
37dd57d1
PE
5843 * fileio.c (Fcopy_file): Report error if fchown or fchmod
5844 fail (Bug#8306).
81e56e61 5845
699979fc 5846 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 5847
401bf9b4
PE
5848 * process.c (Fmake_network_process): Use socklen_t, not int,
5849 where POSIX says socklen_t is required in portable programs.
5850 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 5851 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
5852 (Fmake_network_process, server_accept_connection):
5853 (wait_reading_process_output, read_process_output):
5854 Likewise.
5855
b93aacde
PE
5856 * process.c: Rename or move locals to avoid shadowing.
5857 (list_processes_1, Fmake_network_process):
5858 (read_process_output_error_handler, exec_sentinel_error_handler):
5859 Rename or move locals.
4dc343ee 5860 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 5861 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 5862 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 5863 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 5864 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 5865
af8a867c 5866 Make tparam.h and terminfo.c consistent.
44f230aa
SM
5867 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
5868 Include tparam.h instead, since it declares them.
af8a867c
PE
5869 * cm.h (PC): Remove extern decl; tparam.h now does this.
5870 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
5871 * terminfo.c: Include tparam.h, to check interfaces.
5872 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
5873 (tparam): Adjust signature to match interface in tparam.h;
5874 this removes some undefined behavior. Check that outstring and len
5875 are zero, which they always are with Emacs.
5876 * tparam.h (PC, BC, UP): New extern decls.
5877
0248044d 5878 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 5879 (xftfont_open): Rename locals to avoid shadowing.
0248044d 5880
8ff096c1 5881 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
5882 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
5883 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 5884 (ftfont_list): Remove unused local.
49eaafba
PE
5885 (get_adstyle_property, ftfont_pattern_entity):
5886 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
5887 Rename locals to avoid shadowing.
8ff096c1 5888
e2be39f6
PE
5889 * xfont.c (xfont_list_family): Mark var as initialized.
5890
c9735e30
PE
5891 * xml.c (make_dom): Now static.
5892
8f5201ae
PE
5893 * composite.c (composition_compute_stop_pos): Rename local to
5894 avoid shadowing.
b246f932
PE
5895 (composition_reseat_it): Remove unused locals.
5896 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 5897 (composition_update_it): Mark var as initialized.
11b61122
PE
5898 (find_automatic_composition): Mark vars as initialized,
5899 with a FIXME (Bug#8290).
8f5201ae 5900
760fbc2c
PE
5901 character.h: Rename locals to avoid shadowing.
5902 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
5903 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
5904 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
5905 (BUF_DEC_POS): Be more systematic about renaming local temporaries
5906 to avoid shadowing.
5907
ff08eb85
PE
5908 * textprop.c (property_change_between_p): Remove; unused.
5909
fc7bf025
PE
5910 * intervals.c (interval_start_pos): Now static.
5911
235d7abc
PE
5912 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
5913
44f230aa
SM
5914 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
5915 Rename locals to avoid shadowing.
3e7d6594 5916
50060332
PE
5917 * sound.c (wav_play, au_play, Fplay_sound_internal):
5918 Fix pointer signedness.
d01f234b 5919 (alsa_choose_format): Remove unused local var.
c83b8872
PE
5920 (wav_play): Initialize a variable to 0, to prevent undefined
5921 behavior (Bug#8278).
50060332 5922
c4fc4e30
PE
5923 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
5924
918436ed
PE
5925 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
5926
c939f91b
PE
5927 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
5928 clobbering (Bug#8298).
b9c7f648
PE
5929 * sysdep.c (sys_subshell): Likewise.
5930 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 5931
6bd8c144
PE
5932 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
5933 This should get cleaned up, so that child_setup has the
5934 same signature on all platforms.
5935
7710357c 5936 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 5937 (relocate_fd): Rename locals to avoid shadowing.
7710357c 5938
c59da222
CY
59392011-03-22 Chong Yidong <cyd@stupidchicken.com>
5940
5941 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
5942 not to be necessary, and produces flickering.
5943
66b87493
GM
59442011-03-20 Glenn Morris <rgm@gnu.org>
5945
5946 * config.in: Remove file.
5947
45b6f6d5
JB
59482011-03-20 Juanma Barranquero <lekktu@gmail.com>
5949
5950 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
5951 are now in src/globals.h.
5952 (syms_of_minibuf): Remove spurious & from previous change.
5953
3ec03f7e
LL
59542011-03-20 Leo <sdl.web@gmail.com>
5955
5956 * minibuf.c (completing-read-function): New variable.
5957 (completing-read-default): Rename from completing-read.
5958 (completing-read): Call completing-read-function.
5959
b14e3e21
CY
59602011-03-19 Juanma Barranquero <lekktu@gmail.com>
5961
5962 * xfaces.c (Fx_load_color_file):
5963 Read color file from absolute filename (bug#8250).
5964
f2b726e6
JB
59652011-03-19 Juanma Barranquero <lekktu@gmail.com>
5966
5967 * makefile.w32-in: Update dependencies.
5968
09f6ff02
EZ
59692011-03-17 Eli Zaretskii <eliz@gnu.org>
5970
5971 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
5972
29a6015a
PE
59732011-03-17 Paul Eggert <eggert@cs.ucla.edu>
5974
a3a6c54e
PE
5975 Fix more problems found by GCC 4.5.2's static checks.
5976
b766f867
PE
5977 * process.c (make_serial_process_unwind, send_process_trap):
5978 (sigchld_handler): Now static.
5979
be02381c
PE
5980 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
5981 That way, the code declares only the vars that it needs.
5982 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
5983 * s/cygwin.h (PTY_ITERATION): Likewise.
5984 * s/darwin.h (PTY_ITERATION): Likewise.
5985 * s/gnu-linux.h (PTY_ITERATION): Likewise.
5986
57048744
PE
5987 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
5988 * process.c (allocate_pty): Don't declare stb unless it's needed.
5989
7914961c 5990 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
5991 (CONSTANTLIM): Remove; unused.
5992 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
5993 Define only if needed.
7914961c 5994
b3967b18
PE
5995 * unexelf.c (unexec): Name an expression,
5996 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
5997 Use a different way to cause a compilation error if anyone uses
5998 n rather than nn, a way that does not involve shadowing.
73366a00 5999 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 6000
29a6015a
PE
6001 * deps.mk (unexalpha.o): Remove; unused.
6002
43cfc33e 6003 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 6004 * unexec.h: New file.
ce701a33
PE
6005 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
6006 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
6007 Depend on unexec.h.
6008 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
6009 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
6010 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 6011 Change as necessary to match prototype in unexec.h.
ce701a33 6012
01f44d5a
PE
6013 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
6014 shadowing.
4f63c6bb 6015 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 6016
a6670b0b
PE
6017 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
6018 Rename locals to avoid shadowing.
6019
cef2010d 6020 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 6021 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 6022
d4d7173a
PE
6023 * print.c (Fredirect_debugging_output): Fix pointer signedess.
6024
f08b802a
PE
6025 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
6026 warning when compiling print.c.
6027
3ddb0639
PE
6028 * font.c (font_unparse_fcname): Abort in an "impossible" situation
6029 instead of using an uninitialized var.
5ad03b97 6030 (font_sort_entities): Mark var as initialized.
3ddb0639 6031
170a2692
PE
6032 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
6033
e663c700
PE
6034 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
6035 pointers to constants.
89bc529a 6036 (font_parse_fcname): Remove unused vars.
7b81e2d0 6037 (font_delete_unmatched): Now static.
ea838e10 6038 (font_get_spec): Remove; unused.
13a547c6
PE
6039 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
6040 (font_update_drivers, Ffont_get_glyphs, font_add_log):
6041 Rename or move locals to avoid shadowing.
e663c700 6042
2a80c887 6043 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 6044 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 6045
1384fa33 6046 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 6047 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 6048
8b2c52e9
PE
6049 * alloc.c (mark_backtrace): Move decl from here ...
6050 * lisp.h: ... to here, so that it can be checked.
6051
475545b5 6052 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 6053 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
6054 (lisp_indirect_variable): Name an expression,
6055 to avoid gcc -Wbad-function-cast warning.
1faed8ae 6056 (Fdefvar): Rename locals to avoid shadowing.
475545b5 6057
b1349114 6058 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 6059 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 6060 Use const pointer when appropriate.
b1349114 6061
a2928364
PE
6062 * lisp.h (get_system_name, get_operating_system_release):
6063 Move decls here, to check interfaces.
6064 * process.c (get_operating_system_release): Move decl to lisp.h.
6065 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
6066 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
6067 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
6068 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
6069 (Fformat_time_string, Fencode_time, Finsert_char):
6070 (Ftranslate_region_internal, Fformat):
6071 Rename or remove local vars to avoid shadowing.
9710023e 6072 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 6073
a415e694
PE
6074 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
6075 avoid shadowing.
6076
8ef4622d
PE
6077 * lisp.h (eassert): Check that the argument compiles, even if
6078 ENABLE_CHECKING is not defined.
6079
946f9a5b
PE
6080 * data.c (Findirect_variable): Name an expression, to avoid
6081 gcc -Wbad-function-cast warning.
112396d6 6082 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 6083 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
6084 (Fmake_variable_buffer_local, Fmake_local_variable):
6085 Mark variables as initialized.
52746918 6086 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 6087
e5aab7e7 6088 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
6089 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
6090 Rename locals to avoid shadowing.
dff45157
PE
6091 (mark_stack): Move local variables into the #ifdef region where
6092 they're used.
7bc26fdb
PE
6093 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
6094 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
6095 needed otherwise.
6096 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
6097 (GC_STRING_CHARS): Remove; not used.
d40d4be1 6098 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 6099
e5aab7e7
PE
6100 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
6101 avoids undefined behavior in theory.
6102
4da60324
PE
6103 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
6104
88043301
PE
6105 Use functions, not macros, for up- and down-casing (Bug#8254).
6106 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
6107 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
6108 to use the following functions instead of these macros.
6109 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
6110 EMACS_INT, since callers assume the returned value fits in int.
6111 (upcase1): Likewise, for UPCASE_TABLE.
6112 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 6113 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 6114 the race-condition problem in the old DOWNCASE.
88043301 6115
19ed5445
PE
6116 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
6117 Rename locals to avoid shadowing.
6118 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
6119 (regex_compile, re_search_2, re_match_2_internal):
6120 Remove unused local vars.
952db0d7
PE
6121 (FREE_VAR): Rewrite so as not to use empty "else",
6122 which gcc can warn about.
da053e48 6123 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
6124 (RETALLOC_IF): Define only if needed.
6125 (WORDCHAR_P): Likewise. This one is never needed, but is used
6126 only in a comment talking about a compiler bug, so put inside
6127 the #if 0 of that comment.
6128 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
6129 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
6130 Remove; unused.
19ed5445 6131
1f3561e4 6132 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
6133 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
6134 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 6135
ded6f8f7
PE
6136 * search.c (simple_search): Remove unused var.
6137
dbd37a95
PE
6138 * dired.c (compile_pattern): Move decl from here ...
6139 * lisp.h: ... to here, so that it can be checked.
6140 (struct re_registers): New forward decl.
6141
7e47afad
PE
6142 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
6143
85f24f61
PE
6144 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
6145 All uses changed.
6146 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
6147 Rename locals to avoid shadowing.
5671df8f 6148 (Fvertical_motion): Mark locals as initialized.
85f24f61 6149
181aa2be 6150 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 6151 (casify_region): Mark local as initialized.
181aa2be 6152
930d429c
PE
6153 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
6154
7082eac6
PE
6155 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
6156 New macros, so that the caller can use some names other than
6157 gcpro1, gcpro2, etc.
6158 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
6159 of the new macros.
6160 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
6161 argument, for consistency with GCPRO2_VAR, etc: it is now the
6162 prefix of the variable, not the variable itself. All uses
6163 changed.
38b2c076
PE
6164 * dired.c (directory_files_internal, file_name_completion):
6165 Rename locals to avoid shadowing.
6166
15206ed9
PE
6167 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
6168 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
6169 dired.c's scmp function, had undefined behavior.
6170 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
6171 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
6172 * buffer.h: ... to here, because these macros use current_buffer,
6173 and the new implementation with inline functions needs to have
6174 current_buffer in scope now, rather than later when the macros
6175 are used.
6176 (downcase, upcase1): New static inline functions.
6177 (DOWNCASE, UPCASE1): Reimplement using these functions.
6178 This avoids undefined behavior in expressions like
6179 DOWNCASE (x) == DOWNCASE (y), which previously suffered
6180 from race conditions in accessing the global variables
6181 case_temp1 and case_temp2.
6182 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
6183 * lisp.h (case_temp1, case_temp2): Remove their decls.
6184 * character.h (ASCII_CHAR_P): Move from here ...
6185 * lisp.h: ... to here, so that the inline functions mentioned
6186 above can use them.
6187
4a6bea26
PE
6188 * dired.c (directory_files_internal_unwind): Now static.
6189
f14b7e14
PE
6190 * fileio.c (file_name_as_directory, directory_file_name):
6191 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
6192 Now static.
2893f146
PE
6193 (file_name_as_directory): Use const pointers when appropriate.
6194 (Fexpand_file_name): Likewise. In particular, newdir might
6195 point at constant storage, so make it a const pointer.
fd4ead52 6196 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
6197 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
6198 signedness issues.
f839df0c
PE
6199 (Fset_file_times, Finsert_file_contents, auto_save_error):
6200 Rename locals to avoid shadowing.
f14b7e14 6201
5716756e 6202 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
6203 (Ftry_completion, Fall_completions): Rename or remove locals
6204 to avoid shadowing.
5716756e 6205
b4c3046a
PE
6206 * marker.c (bytepos_to_charpos): Remove; unused.
6207
b45db522
PE
6208 * lisp.h (verify_bytepos, count_markers): New decls,
6209 so that gcc does not warn that these functions aren't declared.
6210
85876d07
PE
6211 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
6212 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 6213 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 6214 (copy_text): Remove unused local var.
85876d07 6215
03d78a21 6216 * filelock.c (within_one_second): Now static.
b3dd38ab 6217 (lock_file_1): Rename local to avoid shadowing.
03d78a21 6218
5df8f01b
PE
6219 * buffer.c (fix_overlays_before): Mark locals as initialized.
6220 (fix_start_end_in_overlays): Likewise. This function should be
6221 simplified by using pointers-to-pointers, but that's a different
6222 matter.
b1d876f1 6223 (switch_to_buffer_1): Now static.
8f54f30a
PE
6224 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
6225 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 6226
a70072c9 6227 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 6228 Fix pointer signedness issue.
edced198
PE
6229 (sys_subshell): Mark local as volatile if checking for lint,
6230 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 6231 (MAXPATHLEN): Define only if needed.
a70072c9 6232
a0977c44
PE
6233 * process.c (serial_open, serial_configure): Move decls from here ...
6234 * systty.h: ... to here, so that they can be checked.
6235
a884fdcc
PE
6236 * fns.c (get_random, seed_random): Move extern decls from here ...
6237 * lisp.h: ... to here, so that they can be checked.
6238
604efe86 6239 * sysdep.c (reset_io): Now static.
b8950c94 6240 (wait_for_termination_signal): Remove; unused.
604efe86 6241
38fc62d9
PE
6242 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
6243 (copy_keymap_item, append_key, push_text_char_description):
6244 Now static.
1004a21a 6245 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 6246 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
6247 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
6248 (describe_map_tree):
6249 Rename locals to avoid shadowing.
38fc62d9 6250
2f2650da
PE
6251 * keyboard.c: Declare functions static if they are not used elsewhere.
6252 (echo_char, echo_dash, cmd_error, top_level_2):
6253 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
6254 (read_char, kbd_buffer_get_event, make_lispy_position):
6255 (make_lispy_event, make_lispy_movement, apply_modifiers):
6256 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
6257 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
6258 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 6259 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 6260 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 6261
a053e86c 6262 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
6263 (mark_kboards): Move decl here ...
6264 * alloc.c (mark_kboards): ... from here.
a053e86c 6265
4752793e
PE
6266 * lisp.h (force_auto_save_soon): New decl.
6267
74f10ca7 6268 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
6269 (DEFINE_DUMMY_FUNCTION): New macro.
6270 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
6271 Use it.
c03cd23f
PE
6272 (main): Add casts to avoid warnings
6273 if GCC considers string literals to be constants.
74f10ca7 6274
022e70d4
PE
6275 * lisp.h (fatal_error_signal): Add decl, since it's exported.
6276
59d6fe83
PE
6277 * dbusbind.c: Pointer signedness fixes.
6278 (xd_signature, xd_append_arg, xd_initialize):
6279 (Fdbus_call_method, Fdbus_call_method_asynchronously):
6280 (Fdbus_method_return_internal, Fdbus_method_error_internal):
6281 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
6282 (Fdbus_register_signal): Use SSDATA when the context wants char *.
6283
78320123
PE
6284 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
6285 if GCC considers string literals to be constants.
49cebcca 6286 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 6287
35ac2a97
SM
62882011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
6289
fb103ca9
SM
6290 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
6291 (print_preprocess, print_object): New macro to fix last change.
6292
35ac2a97
SM
6293 * print.c (print_preprocess): Don't forget font objects.
6294
62973b41
JB
62952011-03-16 Juanma Barranquero <lekktu@gmail.com>
6296
6297 * emacs.c (USAGE3): Doc fixes.
6298
0e48bb22
AS
62992011-03-15 Andreas Schwab <schwab@linux-m68k.org>
6300
6301 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
6302 structure.
6303
7684e57b
JB
63042011-03-14 Juanma Barranquero <lekktu@gmail.com>
6305
6306 * lisp.h (VWindow_system, Qfile_name_history):
6307 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
6308 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
6309 (w32_system_caret_x, w32_system_caret_y): Declare extern.
6310
6311 * w32select.c: Don't #include "keyboard.h".
c96bbc66 6312 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
6313
6314 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
6315 * w32console.c (detect_input_pending, read_input_pending)
6316 (encode_terminal_code):
6317 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
6318 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
6319 (w32_system_caret_y, Qfile_name_history):
6320 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
6321 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
6322 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
6323 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
6324 * w32proc.c (Qlocal, report_file_error):
6325 * w32term.c (Vwindow_system, updating_frame):
6326 * w32uniscribe.c (initialized, uniscribe_font_driver):
6327 Remove unneeded extern declarations.
6328
2aa46d6c
CY
63292011-03-14 Chong Yidong <cyd@stupidchicken.com>
6330
c96bbc66 6331 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 6332
cffc6f3b
CY
63332011-03-13 Chong Yidong <cyd@stupidchicken.com>
6334
6335 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
6336 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
6337 These macros can no longer be used for assignment.
6338
44f230aa
SM
6339 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6340 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
6341 (record_buffer_markers, fetch_buffer_markers): New functions for
6342 recording and fetching special buffer markers.
6343 (set_buffer_internal_1, set_buffer_temp): Use them.
6344
6345 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
6346
6347 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
6348
6349 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
6350 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
6351
6352 * xdisp.c (hscroll_window_tree):
6353 (reconsider_clip_changes): Use PT instead of BUF_PT.
6354
d251f04b
EZ
63552011-03-13 Eli Zaretskii <eliz@gnu.org>
6356
6357 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
6358 $(EMACS_ROOT)/lib/intprops.h.
6359
f0c77cd1
PE
63602011-03-13 Paul Eggert <eggert@cs.ucla.edu>
6361
3eca4629
PE
6362 Fix more problems found by GCC 4.5.2's static checks.
6363
7c86ee98
PE
6364 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
6365 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
6366 (xg_free_frame_widgets): Make it clear that a local variable is
6367 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
6368 (gdk_window_get_screen): Make it clear that this macro is needed
6369 only if USE_GTK_TOOLTIP.
1e5524e7
PE
6370 (int_gtk_range_get_value): New function, which avoids a diagnostic
6371 from gcc -Wbad-function-cast.
6372 (xg_set_toolkit_scroll_bar_thumb): Use it.
6373 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
6374 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
6375 (get_utf8_string, xg_get_file_with_chooser):
6376 Rename locals to avoid shadowing.
6377 (create_dialog): Move locals to avoid shadowing.
7c86ee98 6378
41729b81
PE
6379 * xgselect.c (xg_select): Remove unused var.
6380
f0c77cd1
PE
6381 * image.c (four_corners_best): Mark locals as initialized.
6382 (gif_load): Initialize transparent_p to zero (Bug#8238).
6383 Mark another local as initialized.
ec6cf4c6 6384 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 6385
ce0ad53d 6386 * image.c (clear_image_cache): Now static.
d5d5a617 6387 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 6388 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
6389 (x_edge_detection): Remove unnecessary cast that
6390 gcc -Wbad-function-cast diagnoses.
2037898d 6391 (gif_load): Fix pointer signedness.
6ae141d6
PE
6392 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
6393 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 6394
33383987 63952011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 6396
d32df629
PE
6397 Improve quality of tests for time stamp overflow.
6398 For example, without this patch (encode-time 0 0 0 1 1
6399 1152921504606846976) returns the obviously-bogus value (-948597
6400 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
6401 reports time overflow. See
6402 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
6403 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
6404 * editfns.c: Include limits.h and intprops.h.
6405 (TIME_T_MIN, TIME_T_MAX): New macros.
6406 (time_overflow): Move earlier, to before first use.
6407 (hi_time, lo_time): New functions, for an accurate test for
6408 out-of-range times.
6409 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
6410 (Fget_internal_run_time): Don't assume time_t fits in int.
6411 (make_time): Use list2 instead of Fcons twice.
6412 (Fdecode_time): More accurate test for out-of-range times.
6413 (check_tm_member): New function.
6414 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
6415 (lisp_time_argument): Don't rely on undefined left-shift and
6416 right-shift behavior when checking for time stamp overflow.
8be6f318 6417
fe31d94c
PE
6418 * editfns.c (time_overflow): New function, refactoring common code.
6419 (Fformat_time_string, Fdecode_time, Fencode_time):
6420 (Fcurrent_time_string): Use it.
6421
8be6f318
PE
6422 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
6423 * dired.c (make_time): Move to ...
6424 * editfns.c (make_time): ... here.
6425 * systime.h: Note the move.
6426
09d9db2c 64272011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 6428
126bc0dc
YM
6429 * fringe.c (update_window_fringes): Remove unused variables.
6430
c47cbdfd
YM
6431 * unexmacosx.c (copy_data_segment): Also copy __got section.
6432 (Bug#8223)
6433
7ac80be9
EZ
64342011-03-12 Eli Zaretskii <eliz@gnu.org>
6435
c96bbc66 6436 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
6437 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
6438 Constify `char *' arguments and their references according to
6439 prototypes in tparam.h.
6440
ecb0f94d 6441 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 6442
7ac80be9
EZ
6443 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
6444 Adapt all references accordingly.
6445
6446 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
6447
ef1fd07e
TT
64482011-03-11 Tom Tromey <tromey@redhat.com>
6449
6450 * buffer.c (syms_of_buffer): Remove obsolete comment.
6451
7ef4b50c
EZ
64522011-03-11 Eli Zaretskii <eliz@gnu.org>
6453
6454 * termhooks.h (encode_terminal_code): Declare prototype.
6455
6456 * msdos.c (encode_terminal_code): Don't declare prototype.
6457
6458 * term.c (encode_terminal_code): Now external again, used by
6459 w32console.c and msdos.c.
6460
44f230aa
SM
6461 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
6462 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 6463
4b1ec863 64642011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 6465
1714f52b 6466 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 6467
4b1ec863
PE
6468 * fringe.c (update_window_fringes): Mark locals as initialized
6469 (Bug#8227).
6470 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 6471
524c7aa6
PE
6472 * alloc.c (mark_fringe_data): Move decl from here ...
6473 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
6474 to check its interface.
6475 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
6476
a5c0af81 6477 * fontset.c (free_realized_fontset): Now static.
7519b8cd 6478 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 6479 (fontset_font): Mark local as initialized.
a9a06e0b 6480 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 6481
b4716021
PE
6482 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
6483
811e9bac 6484 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 6485 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
6486 (x_own_selection, Fx_disown_selection_internal): Rename locals
6487 to avoid shadowing.
6488 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 6489
7e3ab302
PE
6490 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
6491 so that the caller can use some name other than gcpro1.
6492 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
6493 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
6494 (Fx_backspace_delete_keys_p):
6495 Use them to avoid shadowing, and rename vars to avoid shadowing.
6496 (x_decode_color, x_set_name, x_window): Now static.
6b437900 6497 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 6498 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
6499 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
6500 Remove unused locals.
7e3ab302
PE
6501 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
6502 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
6503 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
6504 macros.
f78faa98 6505
e2b13473
PE
6506 * xterm.h (x_mouse_leave): New decl.
6507
77f23912
PE
6508 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
6509 Remove unused functions.
cdf4ba58
PE
6510 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
6511 (x_calc_absolute_position): Now static.
7411c686 6512 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 6513 Don't declare local "event" unless it's used.
ed7bf3a5
PE
6514 (x_iconify_frame, x_free_frame_resources): Don't declare locals
6515 unless they are used.
38d0b34a
PE
6516 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
6517 (x_fatal_error_signal): Remove; not used.
a6067996
PE
6518 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
6519 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
6520 (x_error_catcher, x_connection_closed, x_error_handler):
6521 (x_error_quitter, xembed_send_message, x_iconify_frame):
6522 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 6523 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 6524 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 6525
44f230aa
SM
6526 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
6527 Rename or move locals to avoid shadowing.
6b463e58 6528 (tty_defined_color, merge_face_heights): Now static.
5967d051 6529 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
6530 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
6531 does not deduce is never used uninitialized.
73719eba
PE
6532 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
6533 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 6534
426994c3 6535 * terminal.c (store_terminal_param): Now static.
5489860b 6536
032f1620 6537 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 6538 (set_frame_menubar): Remove unused local.
d4323972 6539 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
6540 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
6541 since they might point to immutable storage.
281585b0
PE
6542 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
6543 since it's unused otherwise.
032f1620 6544
367c19e5 6545 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 6546 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
6547 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
6548 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 6549 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
6550 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
6551 does not deduce are never used uninitialized.
70739cbe 6552
07b48fa9
PE
6553 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
6554
8868a238 6555 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
6556 * window.c (window_loop, size_window):
6557 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 6558
7e5cf297 6559 * window.c (display_buffer): Now static.
d6550a9f
PE
6560 (size_window): Mark variables that gcc -Wuninitialized
6561 does not deduce are never used uninitialized.
a586633d
PE
6562 * window.h (check_all_windows): New decl, to forestall
6563 gcc -Wmissing-prototypes diagnostic.
5b555da1 6564 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 6565
f6095868
PE
6566 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
6567 shadowing.
6568 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
6569 Include <limits.h>.
6570 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
6571 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
6572 (load_charset_map): Mark variables that gcc -Wuninitialized
6573 does not deduce are never used uninitialized.
53df7c11 6574 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 6575
f38b440c
PE
6576 * coding.c (coding_set_source, coding_set_destination):
6577 Use "else { /* comment */ }" rather than "else /* comment */;"
6578 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
6579 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
6580 a block, when the outer 'i' will do.
6581 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
6582 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
6583 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
6584 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
6585 (Fdecode_sjis_char, Fdefine_coding_system_internal):
6586 Rename locals to avoid shadowing.
6587 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
6588 * coding.c (emacs_mule_char, encode_invocation_designation):
6589 Now static, since they're not used elsewhere.
413bb2db 6590 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 6591 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
6592 (decode_coding_emacs_mule): Mark variables that gcc
6593 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
6594 (detect_coding_iso_2022): Initialize a local variable that might
6595 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 6596 this initialization is needed. (Bug#8211)
5f58e762
PE
6597 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
6598 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
6599 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
6600 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
6601 Remove unused macros.
f38b440c 6602
232b38b9 6603 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 6604 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 6605 * character.c (string_count_byte8): Likewise.
232b38b9 6606
fb90da1b
PE
6607 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
6608 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
6609
fb93dbc2
PE
6610 * chartab.c (copy_sub_char_table): Now static, since it's not used
6611 elsewhere.
5c156ace
PE
6612 (sub_char_table_ref_and_range, char_table_ref_and_range):
6613 Rename locals to avoid shadowing.
bbcd0949 6614 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 6615
7d3b3862 6616 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 6617 (BIDI_BOB): Remove unused macro.
7d3b3862 6618
6be7d3da
PE
6619 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
6620 deduce are never used uninitialized.
c2ed9c8b 6621 * term.c (encode_terminal_code): Likewise.
6be7d3da 6622
75f8807f 6623 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 6624
50938595
PE
6625 * tparam.h: New file.
6626 * term.c, tparam.h: Include it.
6627 * deps.mk (term.o, tparam.o): Depend on tparam.h.
6628 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
6629 Move these decls to tparam.h, and make them agree with what
6630 is actually in tparam.c. The previous trick of using incompatible
6631 decls in different modules does not conform to the C standard.
6632 All callers of tparam changed to use tparam's actual API.
6633 * tparam.c (tparam1, tparam, tgoto):
6634 Use const pointers where appropriate.
6635
fbceeba2
PE
6636 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
6637 * cm.h (struct cm): Likewise.
6638 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
6639 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
6640 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
6641 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
6642 (turn_on_face, init_tty): Likewise.
6643 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 6644
7f3f1250
PE
6645 * term.c (term_mouse_position): Rename local to avoid shadowing.
6646
e6ca6543
PE
6647 * alloc.c (mark_ttys): Move decl from here ...
6648 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
6649
c40f8d15
AS
66502011-03-11 Andreas Schwab <schwab@linux-m68k.org>
6651
6652 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
6653
cfe0661d
JB
66542011-03-09 Juanma Barranquero <lekktu@gmail.com>
6655
6656 * search.c (compile_pattern_1): Remove argument regp, unused since
6657 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
6658 (compile_pattern): Don't pass it.
6659
0afb4571
J
66602011-03-08 Jan Djärv <jan.h.d@swipnet.se>
6661
6662 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
6663 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
6664 for ! HAVE_GTK3.
6665 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
6666
6667 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
6668
6669 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
6670 gdk_window_get_screen, gdk_window_get_geometry,
6671 gdk_x11_window_lookup_for_display and GDK_KEY_g.
6672 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
6673 (xg_get_pixbuf_from_pixmap): New function.
6674 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
6675 to Pixmap, take frame as parameter, remove GdkColormap parameter.
6676 Call xg_get_pixbuf_from_pixmap instead of
6677 gdk_pixbuf_get_from_drawable.
6678 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
6679 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
6680 (xg_check_special_colors): Use GtkStyleContext and its functions
6681 for HAVE_GTK3.
6682 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
6683 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
6684 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
6685 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
6686 Call gtk_widget_get_preferred_size.
0afb4571
J
6687 (xg_frame_resized): gdk_window_get_geometry only takes 5
6688 parameters.
44f230aa
SM
6689 (xg_win_to_widget, xg_event_is_for_menubar):
6690 Call gdk_x11_window_lookup_for_display.
0afb4571
J
6691 (xg_set_widget_bg): New function.
6692 (delete_cb): New function.
895009e1 6693 (xg_create_frame_widgets): Connect delete-event to delete_cb.
0afb4571
J
6694 Call xg_set_widget_bg. Only set backgrund pixmap for ! HAVE_GTK3
6695 (xg_set_background_color): Call xg_set_widget_bg.
6696 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
6697 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
6698 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
6699 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
6700 if ! HAVE_GTK3.
6701 (update_frame_tool_bar): Call gtk_widget_hide.
6702 (xg_initialize): Use GDK_KEY_g.
6703
6704 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
6705 if ! HAVE_GTK3
6706 (x_session_initialize): Call gdk_x11_set_sm_client_id.
6707
6708 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
6709 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
6710 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
6711
1c2cc4ef
JB
67122011-03-08 Juanma Barranquero <lekktu@gmail.com>
6713
6714 * w32xfns.c (select_palette): Check success of RealizePalette against
6715 GDI_ERROR, not zero.
6716
33383987 6717See ChangeLog.11 for earlier changes.
aac0c6e3
MR
6718
6719;; Local Variables:
6720;; coding: utf-8
aac0c6e3
MR
6721;; End:
6722
33383987 6723 Copyright (C) 2011 Free Software Foundation, Inc.
aac0c6e3
MR
6724
6725 This file is part of GNU Emacs.
6726
6727 GNU Emacs is free software: you can redistribute it and/or modify
6728 it under the terms of the GNU General Public License as published by
6729 the Free Software Foundation, either version 3 of the License, or
6730 (at your option) any later version.
6731
6732 GNU Emacs is distributed in the hope that it will be useful,
6733 but WITHOUT ANY WARRANTY; without even the implied warranty of
6734 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6735 GNU General Public License for more details.
6736
6737 You should have received a copy of the GNU General Public License
6738 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.