Avoid integer overflow on scroll-left and scroll-right.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
aa754e6a
PE
12012-06-28 Paul Eggert <eggert@cs.ucla.edu>
2
3 Avoid integer overflow on scroll-left and scroll-right.
4 * window.c (HSCROLL_MAX): New macro.
5 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6 overflow when requested scroll falls outside ptrdiff_t range.
7
80b00b08
DA
82012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
9
10 * window.h (struct window): Change type of 'hscroll',
11 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
12 'last_modified' and 'last_overlay_modified' to EMACS_INT.
13 Adjust users accordingly.
14 * xdisp.c (try_cursor_movement): Replace type check with eassert.
15 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
16 from EMACS_INT to ptrdiff_t.
17 (make_window): Omit redundant initialization.
18
62b2bcf6
JB
192012-06-28 Juanma Barranquero <lekktu@gmail.com>
20
21 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
22
45942c7d
DA
232012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
24
25 * window.h (struct window): Change type of 'use_time' and
26 'sequence_number' from Lisp_Object to int.
27 * frame.c (make_frame): Adjust users accordingly.
28 * print.c (print_object): Likewise.
29 * window.c (select_window, Fwindow_use_time, make_parent_window)
30 (make_window): Likewise.
31
e509cfa6
DA
322012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
33
34 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
35 enabled with --enable-checking=[all,glyphs] configure option.
36 Fix GLYPH_DEBUG usage assuming that it may be undefined,
37 adjust comments accordingly.
38 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
39 undefined, adjust comments accordingly.
40 * image.c: Likewise.
41 * scroll.c: Likewise.
42 * w32fns.c: Likewise.
43 * w32term.c: Likewise.
44 * xdisp.c: Likewise.
45 * xfaces.c: Likewise.
46 * xfns.c: Likewise.
47 * xterm.c: Likewise.
48
a54e2c05
DA
492012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
50
51 Generalize run-time debugging checks.
52 * dispextern.h (XASSERTS): Remove.
53 * fontset.c (xassert): Remove.
54 Convert from xassert to eassert.
55 * alloc.c: Convert from xassert to eassert.
56 * bidi.c: Likewise.
57 * dispnew.c: Likewise.
58 * fns.c: Likewise.
59 * fringe.c: Likewise.
60 * ftfont.c: Likewise.
61 * gtkutil.c: Likewise.
62 * image.c: Likewise.
63 * keyboard.c: Likewise.
64 * menu.c: Likewise.
65 * process.c: Likewise.
66 * scroll.c: Likewise.
67 * sound.c: Likewise.
68 * term.c: Likewise.
69 * w32console.c: Likewise.
70 * w32fns.c: Likewise.
71 * w32term.c: Likewise.
72 * window.c: Likewise.
73 * xdisp.c: Likewise.
74 * xfaces.c: Likewise.
75 * xfns.c: Likewise.
76 * xselect.c: Likewise.
77 * xterm.c: Likewise.
78
1ec4b7b2
SM
792012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
80
81 * fns.c (maybe_resize_hash_table): Output message when growing the
82 purify-hashtable.
83
2014308a
DA
842012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
85
86 * alloc.c (allocate_string_data): Remove dead code.
87 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
88 avoid GCC warning about unused macro.
89
246155eb
DA
902012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
91
92 * alloc.c (allocate_string): Omit intervals initialization.
93 * alloc.c (make_uninit_multibyte_string): Initialize intervals
94 as in make_pure_string and make_pure_c_string.
95
43184b7b
DA
962012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
97
98 * alloc.c (allocate_string): Fix last change.
99
3fe6dd74
DA
1002012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
101
102 * alloc.c (allocate_string): Remove two redundant calls
103 to memset, add explicit initialization where appropriate.
104
1ba6038a
GM
1052012-06-27 Glenn Morris <rgm@gnu.org>
106
107 * lisp.mk (lisp): Remove paths.elc.
108
c89926a5
CY
1092012-06-27 Chong Yidong <cyd@gnu.org>
110
111 * doc.c (Fsubstitute_command_keys): Fix punctuation.
112
ed6b3510
JW
1132012-06-26 John Wiegley <johnw@newartisans.com>
114
1ec4b7b2 115 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
116 on Mac OS X Lion: __mod_init_func and __mod_term_func.
117
ed6b3510
JW
118 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
119 when building with Clang.
120
8edd4a2b
SM
1212012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
122
123 * eval.c (Fapply): Allow calling it with a single argument.
124
f6f62d1b
EZ
1252012-06-26 Eli Zaretskii <eliz@gnu.org>
126
127 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
128 _stricmp and _strnicmp.
129 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
130
62efea5e
DA
1312012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
132
133 * alloc.c (allocate_window): Zero out non-Lisp part of newly
134 allocated window.
135 (allocate_process): Likewise for new process.
8edd4a2b 136 (allocate_terminal): Change to use offsetof.
62efea5e
DA
137 (allocate_frame): Likewise.
138 * frame.c (make_frame): Omit redundant initialization.
139 * window.c (make_parent_window): Use memset.
140 (make_window): Omit redundant initialization.
141 * process.c (make_process): Omit redundant initialization.
142 * terminal.c (create_terminal): Likewise.
143
42997f4d
DA
1442012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
145
146 * term.c (delete_tty): Remove redundant call to memset.
147
1130ecfc
DA
1482012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
149
150 * alloc.c: Remove build_string.
151 * lisp.h: Define build_string as static inline. This provides
152 a better opportunity to optimize away calls to strlen when the
153 function is called with compile-time constant argument.
154 * image.c (imagemagick_error): Convert to build_string.
155 * w32proc.c (sys_spawnve): Likewise.
156 * xterm.c (x_term_init): Likewise.
157
cf38a720
PE
1582012-06-26 Paul Eggert <eggert@cs.ucla.edu>
159
99027bdd
PE
160 Use sprintf return value instead of invoking strlen on result.
161 In the old days this wasn't portable, since some sprintf
162 implementations returned char *. But they died out years ago and
163 Emacs already assumes sprintf returns int.
164 Similarly for float_to_string.
165 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
166 * ccl.c (ccl_driver):
167 * character.c (string_escape_byte8):
168 * data.c (Fnumber_to_string):
169 * doprnt.c (doprnt):
170 * print.c (print_object):
171 * xdisp.c (message_dolog):
172 * xfns.c (syms_of_xfns):
173 Use sprintf or float_to_string result to avoid need to call strlen.
174 * data.c (Fnumber_to_string):
175 Use make_unibyte_string, since the string must be ASCII.
176 * lisp.h, print.c (float_to_string): Now returns int length.
177 * term.c (produce_glyphless_glyph):
178 Use sprintf result rather than recomputing it.
179
cf38a720
PE
180 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
181 * Makefile.in (ALL_CFLAGS):
182 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
183 * gmalloc.c, regex.c: Include <config.h> unconditionally.
184
3511c784
DA
1852012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
186
0a08eb21 187 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
188 strcasecmp if available.
189 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
190
fb7da12e
AS
1912012-06-25 Andreas Schwab <schwab@linux-m68k.org>
192
193 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
194 Avoid comma operator.
195 * menu.c (push_submenu_start, push_submenu_end)
196 (push_left_right_boundary, push_menu_pane): Likewise.
197 * msdos.c (dos_rawgetc): Likewise.
198
afa2ffd8
DA
1992012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
200
201 * xfns.c (xic_create_fontsetname): Remove redundant calls
202 to memset.
203
b3b4476b
PE
2042012-06-25 Paul Eggert <eggert@cs.ucla.edu>
205
4495ff38
PE
206 * gtkutil.c (get_utf8_string): Remove redundant assignment.
207 sprintf already null-terminates its output.
208
b3b4476b
PE
209 * xfns.c (x_window): Remove redundant cast.
210
b00876c9
DA
2112012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
212
213 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
214 `const char *' to `char *' to avoid compiler warning.
215
d188e26b
PE
2162012-06-24 Paul Eggert <eggert@cs.ucla.edu>
217
885d1d74
PE
218 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
219 instead of truncating it to 63 (admittedly a generous limit).
220
d188e26b
PE
221 * process.c: Fix spelling and caps in comments.
222
e2f560b1
DN
2232012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
224
e86db54b 225 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
226 * sysdep.c (setpgrp): Remove definition, not used in this file.
227
7583a3a1
JB
2282012-06-24 Juanma Barranquero <lekktu@gmail.com>
229
230 * makefile.w32-in: Update dependencies.
231
696056c2
EZ
2322012-06-24 Eli Zaretskii <eliz@gnu.org>
233
234 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
235 (SYSTIME_H): Add nt/inc/sys/time.h.
236
237 * systime.h [WINDOWSNT]: Include sys/time.h.
238
239 * s/ms-w32.h (struct timespec): Definition moved from
240 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
241
845ca893
PE
2422012-06-24 Paul Eggert <eggert@cs.ucla.edu>
243
244 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
245 * buffer.h (buffer_slot_type_mismatch):
246 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
247 * eval.c (unwind_to_catch):
248 * image.c (my_png_error, my_error_exit):
249 * keyboard.c (quit_throw_to_read_char, user_error)
250 (Fexit_recursive_edit, Fabort_recursive_edit):
251 * lisp.h (die, args_out_of_range, args_out_of_range_3)
252 (wrong_type_argument, buffer_overflow, __executable_start)
253 (memory_full, buffer_memory_full, string_overflow, Fthrow)
254 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
255 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
256 (fatal):
257 (child_setup) [!DOS_NT]:
258 * lread.c (end_of_file_error, invalid_syntax):
259 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
260 * puresize.h (pure_write_error):
261 * search.c (matcher_overflow):
262 * sound.c (sound_perror, alsa_sound_perror):
263 * sysdep.c, syssignal.h (croak):
264 * term.c (maybe_fatal, vfatal):
265 * textprop.c (text_read_only):
266 * undo.c (user_error):
267 * unexmacosx.c (unexec_error):
268 * xterm.c (x_ins_del_lines, x_delete_glyphs):
269 Use _Noreturn rather than NO_RETURN.
270 No need for separate decl merely because of _Noreturn.
271 * sound.c (sound_warning, parse_sound):
272 Remove unnecessary forward decls.
273
f1dd8073
PE
2742012-06-24 Paul Eggert <eggert@cs.ucla.edu>
275
276 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
277 * lisp.h (WAIT_READING_MAX): New macro.
278 * dispnew.c (Fsleep_for, sit_for):
279 * keyboard.c (kbd_buffer_get_event):
280 * process.c (Faccept_process_output):
281 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
282 This improves on the previous patch, which introduced a bug
283 when time_t is unsigned and as wide as intmax_t.
284 See <http://bugs.gnu.org/9000#51>.
285
b82c1755
EZ
2862012-06-23 Eli Zaretskii <eliz@gnu.org>
287
288 * dispnew.c (sit_for, Fsleep_for):
289 * keyboard.c (kbd_buffer_get_event):
290 * process.c (Faccept_process_output): Avoid compiler warnings when
291 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
292
ca300656
JB
2932012-06-23 Juanma Barranquero <lekktu@gmail.com>
294
049ec95b
JB
295 * makefile.w32-in: Update dependencies.
296
ca300656
JB
297 * w32.c (ltime): Add return type and declare static.
298 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
299
db7b8d06
PE
3002012-06-23 Paul Eggert <eggert@cs.ucla.edu>
301
302 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
303 Privately reported by Herbert J. Skuhra.
304 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
305 All uses changed.
306 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
307 not make_lisp_timeval, when the argument is of type EMACS_TIME.
308
0bd8297f
EZ
3092012-06-23 Eli Zaretskii <eliz@gnu.org>
310
96512555
EZ
311 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
312 last argument of make_unibyte_string.
313
0bd8297f
EZ
314 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
315 language ID in the event parameters.
316
317 * w32term.c (w32_read_socket): Put the new keyboard codepage into
318 event.code, not the obscure "character set ID".
319
63def6b6
CY
3202012-06-23 Chong Yidong <cyd@gnu.org>
321
322 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
323
e8a02204
EZ
3242012-06-23 Eli Zaretskii <eliz@gnu.org>
325
388cdec0
EZ
326 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
327 * w32.c (fdutimens): New function.
328
329 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
330
331 * s/ms-w32.h (pselect): Redirect to sys_select.
332
333 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
334
e8a02204
EZ
335 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
336 in the logic of incrementing and decrementing the value of
337 use_relocatable_buffers.
338
d054f3fb
PE
3392012-06-23 Paul Eggert <eggert@cs.ucla.edu>
340
341 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
342 Privately reported by Herbert J. Skuhra.
343 [__FreeBSD__]: Remove "*/" typo after "#include".
344 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
345 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
346 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
347 Don't assume EMACS_TIME and struct timeval are the same type.
348
d35af63c
PE
3492012-06-22 Paul Eggert <eggert@cs.ucla.edu>
350
351 Support higher-resolution time stamps (Bug#9000).
352 The time stamps are only nanosecond-resolution at the C level,
353 since that's the best that any real-world system supports now.
354 But they are picosecond-resolution at the Lisp level, as that's
355 easy, and leaves room for future OS improvements.
356
357 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
358 (LIBES): Use it.
359
360 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
361 Don't get current time unless it's needed.
362
363 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
364 now provides it if it's absent.
365 (start_atimer): Port to higher-res time stamps.
366 Check for time stamp overflow. Don't get current time more
367 often than is needed.
368
369 * buffer.h (struct buffer): Buffer modtime now has high resolution.
370 Include systime.h, not time.h.
371 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
372
373 * dired.c: Include stat-time.h.
374 (Ffile-attributes): File times now have higher resolution.
375
376 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
377 (struct image): Timestamp now has higher resolution.
378
379 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
380 has at least microseconds now. All uses removed.
381 (update_frame, update_single_window, update_window, update_frame_1)
382 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
383
384 * editfns.c (time_overflow): Now extern.
385 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
386 (float-time, Fformat_time_string, Fcurrent_time_string)
387 (Fcurrent_time_zone): Accept and generate higher-resolution
388 time stamps.
389 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
390 (decode_time_components, lisp_seconds_argument): New functions.
391 (make_time): Now static.
392 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
393 Report an error if the time is invalid, rather than having the caller
394 do that.
395
396 * fileio.c: Include <stat-time.h>
397 (Fcopy_file): Copy higher-resolution time stamps.
398 Prefer to set the time stamp via a file descriptor if that works.
399 (Fset_file_times, Finsert_file_contents, Fwrite_region)
400 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
401 (Fvisited_file_modtime, Fset_visited_file_modtime):
402 Support higher-resolution time stamps.
403
404 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
405
406 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
407
408 * image.c (prepare_image_for_display, clear_image_cache)
409 (lookup_image): Port to higer-resolution time stamps.
410
411 * keyboard.c (start_polling, bind_polling_period):
412 Check for time stamp overflow.
413 (read_char, kbd_buffer_get_event, timer_start_idle)
414 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
415 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
416 Port to higher-resolution time stamps. Do not assume time_t is signed.
417 (decode_timer): New function. Timers are now vectors of length 9,
418 not 8, to accommodate the picosecond component.
419 (timer_check_2): Use it.
420
421 * nsterm.m (select_timeout, timeval_subtract): Remove.
422 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
423 as they're a bit more accurate and handle overflow better.
424 (ns_select): Change prototype to be compatible with pselect.
425 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
426 * nsterm.h (ns_select): Adjust prototype.
427
428 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
429 us-resolution time stamps.
430 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
431
432 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
433
434 * lisp.h (time_overflow): New decl.
435 (wait_reading_process_output): First arg is now intmax_t, not int,
436 to accommodate larger waits.
437
438 * process.h (struct Lisp_Process.read_output_delay):
439 Now counts nanoseconds, not microseconds.
440 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
441 EMACS_HAS_USECS.
442 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
443 (wait_reading_process_output):
444 Port to ns-resolution time stamps.
445 (Faccept_process_output, wait_reading_process_output):
446 Check for time stamp overflow. Do not assume time_t is signed.
447 (select_wrapper): Remove; we now use pselect.
448 (Fprocess_attributes): Now generates ns-resolution time stamps.
449
450 * sysdep.c: Include utimens.h. Don't include utime.h
451 or worry about struct utimbuf; gnulib does that for us now.
452 (gettimeofday): Remove; gnulib provides a substitute.
453 (make_timeval): New function.
454 (set_file_times): Now sets ns-resolution time stamps.
455 New arg FD; all uses changed.
456 (time_from_jiffies, ltime_from_jiffies, get_up_time)
457 (system_process_attributes):
458 Now returns ns-resolution time stamp. All uses changed.
459 Check for time stamp overflow.
460
461 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
462 provides a substitute now.
463
464 * systime.h: Include timespec.h rather than sys/time.h and time.h,
465 since it guarantees struct timespec.
466 (EMACS_TIME): Now struct timespec, so that we can support
467 ns-resolution time stamps.
468 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
469 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
470 (EMACS_USECS): Remove.
471 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
472 so multiply the arg by 1000 before storing it.
473 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
474 New macros.
475 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
476 Port to ns-resolution time stamps.
477 (EMACS_TIME_NEG_P): Remove; replaced by....
478 (EMACS_TIME_SIGN): New macro.
479 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
480 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
481 (set_file_times, make_time, lisp_time_argument): Adjust signature.
482 (make_timeval, make_lisp_time, decode_time_components): New decls.
483 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
484 that it mishandled time_t overflow. You can't compare by subtracting!
485 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
486 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
487
488 * term.c: Include <sys/time.h>.
489 (timeval_to_Time): New function, for proper overflow wraparound.
490 (term_mouse_position, term_mouse_click): Use it.
491
492 * undo.c (record_first_change): Support higher-resolution time stamps
493 in the undo buffer.
494 (Fprimitive_undo): Use them when restoring time stamps.
495
496 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
497 (w32_get_internal_run_time):
498 Port to higher-resolution Emacs time stamps.
499 (ltime): Now accepts single 64-bit integer, as that's more convenient
500 for callers.
501
502 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
503
504 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
505 for compatibility with pselect. Support ns-resolution time stamps.
506
507 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
508
509 * xselect.c (wait_for_property_change, x_get_foreign_selection):
510 Check for time stamp overflow, and support ns-resolution time stamps.
511
512 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
513 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
514 (timeval_subtract): Remove; no longer needed.
515 (XTflash, XTring_bell, x_wait_for_event):
516 Port to ns-resolution time stamps. Don't assume time_t is signed.
517
b6a92dfe
CY
5182012-06-22 Chong Yidong <cyd@gnu.org>
519
520 * xdisp.c (x_consider_frame_title): Revert last change.
521
d251c37c
EZ
5222012-06-22 Eli Zaretskii <eliz@gnu.org>
523
524 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
525 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
526 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
527 staticidx goes up to 1597 out of 1600 = 0x640.)
528
f10deafb
PE
5292012-06-20 Paul Eggert <eggert@cs.ucla.edu>
530
531 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
532 Otherwise, the umask might be mistakenly 0 while handling input signals.
533
ec6de1e2
SM
5342012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
535
536 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
537
28be1ada
DA
5382012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
539
540 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
541 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
542 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
543 access to `contents' member of Lisp_Vector objects with AREF and ASET
544 where appropriate.
545
c6bf3022
CY
5462012-06-19 Chong Yidong <cyd@gnu.org>
547
548 * frame.c (delete_frame): When selecting a frame on a different
549 text terminal, do not alter the terminal's top-frame.
550
551 * xdisp.c (format_mode_line_unwind_data): Record the target
552 frame's selected window and its terminal's top-frame.
553 (unwind_format_mode_line): Restore them.
554 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
555 Callers changed.
556 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
557 since tty frames can be explicitly named.
558 (prepare_menu_bars): Likewise.
559
560 * term.c (Ftty_top_frame): New function.
561
defd4196
PE
5622012-06-18 Paul Eggert <eggert@cs.ucla.edu>
563
564 Port byte-code-meter to modern targets.
565 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
566 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 567 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
568 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
569 (METER_1, METER_2): Simplify.
570
1053a871
SM
5712012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
572
573 * data.c (Fdefalias): Return `symbol' (bug#11686).
574
b7e8d081
MR
5752012-06-18 Martin Rudalics <rudalics@gmx.at>
576
577 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
578 gets killed during executing of this function (Bug#11665).
579 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
580 (Vkill_buffer_query_functions): In doc-string say that functions
581 run by this hook should not change the current buffer.
582
7ea2b339
PE
5832012-06-18 Paul Eggert <eggert@cs.ucla.edu>
584
585 Fix recently-introduced process.c problems found by static checking.
586 * process.c (write_queue_push, write_queue_pop, send_process):
587 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
588 (write_queue_pop): Fix pointer signedness problem.
589 (send_process): Remove unused local.
590
96a313a1
CY
5912012-06-17 Chong Yidong <cyd@gnu.org>
592
593 * xdisp.c (redisplay_internal): No need to redisplay terminal
594 frames that are not on top.
595
20ca2e94
TN
5962012-06-17 Troels Nielsen <bn.troels@gmail.com>
597
598 * process.c (make_process): Initialize write_queue.
599 (write_queue_push, write_queue_pop): New functions.
600 (send_process): Use them to maintain correct ordering of process
601 writes (Bug#10815).
602
9a900ca9
PE
6032012-06-17 Paul Eggert <eggert@cs.ucla.edu>
604
310fbfa8
PE
605 * lisp.h (eassert): Assume C89 or later.
606 This removes the need for CHECK.
607 (CHECK): Remove. Its comments about always evaluating its
608 argument were confusing, as 'eassert' typically does not evaluate
609 its argument.
610
27bb1ca4
PE
611 * coding.c (produce_chars): Use ptrdiff_t, not int.
612
9a900ca9
PE
613 * xterm.c (x_draw_underwave): Check for integer overflow.
614 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
615
41b7f8bc 6162012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
617
618 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
619 referenced (Bug#11583).
620
9b0e3eba
AA
6212012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
622
623 Implement wave-style variant of underlining.
624 * dispextern.h (face_underline_type): New enum.
625 (face): Add field for underline type.
626 * nsterm.m (ns_draw_underwave): New function.
627 (ns_draw_text_decoration): Use it.
628 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
629 New functions.
630 (x_draw_glyph_string): Use them.
631 * xfaces.c (Qline, Qwave): New Lisp objects.
632 (check_lface_attrs, merge_face_ref)
1053a871
SM
633 (Finternal_set_lisp_face_attribute, realize_x_face):
634 Handle wave-style underline face attributes.
9b0e3eba
AA
635 * xterm.c (x_draw_underwave): New function.
636 (x_draw_glyph_string): Use it.
637
0fb52f11
JB
6382012-06-16 Juanma Barranquero <lekktu@gmail.com>
639
640 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
641 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
642 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
643 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
644 ($(BLD)/w32select.$(O)): Update dependencies.
645
e5560ff7
AS
6462012-06-16 Andreas Schwab <schwab@linux-m68k.org>
647
648 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
649 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
650 * character.c (_fetch_multibyte_char_p): Remove.
651 * alloc.c: Include "character.h" before "buffer.h".
652 * bidi.c: Likewise.
653 * buffer.c: Likewise.
654 * bytecode.c: Likewise.
655 * callint.c: Likewise.
656 * callproc.c: Likewise.
657 * casefiddle.c: Likewise.
658 * casetab.c: Likewise.
659 * category.c: Likewise.
660 * cmds.c: Likewise.
661 * coding.c: Likewise.
662 * composite.c: Likewise.
663 * dired.c: Likewise.
664 * dispnew.c: Likewise.
665 * doc.c: Likewise.
666 * dosfns.c: Likewise.
667 * editfns.c: Likewise.
668 * emacs.c: Likewise.
669 * fileio.c: Likewise.
670 * filelock.c: Likewise.
671 * font.c: Likewise.
672 * fontset.c: Likewise.
673 * fringe.c: Likewise.
674 * indent.c: Likewise.
675 * insdel.c: Likewise.
676 * intervals.c: Likewise.
677 * keyboard.c: Likewise.
678 * keymap.c: Likewise.
679 * lread.c: Likewise.
680 * macros.c: Likewise.
681 * marker.c: Likewise.
682 * minibuf.c: Likewise.
683 * nsfns.m: Likewise.
684 * nsmenu.m: Likewise.
685 * print.c: Likewise.
686 * process.c: Likewise.
687 * regex.c: Likewise.
688 * region-cache.c: Likewise.
689 * search.c: Likewise.
690 * syntax.c: Likewise.
691 * term.c: Likewise.
692 * textprop.c: Likewise.
693 * undo.c: Likewise.
694 * unexsol.c: Likewise.
695 * w16select.c: Likewise.
696 * w32fns.c: Likewise.
697 * w32menu.c: Likewise.
698 * window.c: Likewise.
699 * xdisp.c: Likewise.
700 * xfns.c: Likewise.
701 * xmenu.c: Likewise.
702 * xml.c: Likewise.
703 * xselect.c: Likewise.
704
2f07e6af
EZ
7052012-06-16 Eli Zaretskii <eliz@gnu.org>
706
1053a871
SM
707 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
708 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 709 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
710 row.
711 (handle_face_prop): Use chunk-relative overlay string index when
712 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
713 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
714 the rightmost. (Bug#11720)
2f07e6af 715
29b83cec
AS
7162012-06-16 Andreas Schwab <schwab@linux-m68k.org>
717
718 * category.h (CHAR_HAS_CATEGORY): Define as inline.
719 (CATEGORY_MEMBER): Enforce 1/0 value.
720 * category.c (_temp_category_set): Remove.
721
4c5501e9
EZ
7222012-06-16 Eli Zaretskii <eliz@gnu.org>
723
724 * window.c (Fdelete_other_windows_internal)
725 (Fdelete_window_internal): Don't access frame's mouse highlight
726 info of the initial frame. (Bug#11677)
727
2b570124
PE
7282012-06-14 Paul Eggert <eggert@cs.ucla.edu>
729
e93864f9
PE
730 * .gdbinit (xgetint): Fix recently-introduced paren typo.
731 Assume USE_2_TAGS_FOR_INTS.
732 (xreload): Adjust $tagmask width to match recent lisp.h change.
733
2b570124
PE
734 Simplify lisp.h in minor ways that should not affect code.
735 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
736 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
737 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
738 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
739 (INTTYPEBITS): New macro, for clarity.
740 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
741 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
742 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
743 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
744 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
745
81755f69
JB
7462012-06-13 Juanma Barranquero <lekktu@gmail.com>
747
748 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
749
16192a57
GM
7502012-06-13 Glenn Morris <rgm@gnu.org>
751
752 * s/bsd-common.h (BSD4_3):
753 * s/usg5-4-common.h (USG5_4): No longer define; unused.
754
646b5f55
AS
7552012-06-13 Andreas Schwab <schwab@linux-m68k.org>
756
757 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
758 instead of union.
759 (XLI, XIL): Define.
1053a871
SM
760 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
761 Use them.
762 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 763 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 764 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
765 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
766 * frame.c (delete_frame): Remove outdated comment.
767 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
768 USE_LISP_UNION_TYPE.
769 (Fw32_unregister_hot_key): Likewise.
770 (Fw32_toggle_lock_key): Likewise.
771 * w32menu.c (add_menu_item): Likewise.
772 (w32_menu_display_help): Use XIL instead of checking
773 USE_LISP_UNION_TYPE.
774 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
775 (init_heap): Likewise.
776 * w32term.c (w32_read_socket): Update comment.
777
1d3823c9
GM
7782012-06-13 Glenn Morris <rgm@gnu.org>
779
c62ff706
GM
780 * s/usg5-4-common.h, src/s/unixware.h:
781 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
782
1d3823c9
GM
783 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
784
bfe3e0a2
PE
7852012-06-13 Paul Eggert <eggert@cs.ucla.edu>
786
787 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
788 * alloc.c (make_number) [!defined make_number]:
789 Remove, as lisp.h always defines this now.
790 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
791 (roundup_size): Verify that it is a power of 2.
792 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
793 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
794 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
795 -DUSE_LSB_TAG=0, to override the automatically-selected default.
796 USE_LSB_TAG now is always defined to be either 0 or 1.
797 All uses changed.
798 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
799 code works fine either way, and efficiency is not a concern here,
800 as the union type is for debugging, not for production.
801 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
802 Use an inline function on all platforms when using the union type,
803 since this is simpler and 'static inline' can be used portably
804 within Emacs now.
805 (LISP_INITIALLY_ZERO): New macro.
806 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
807 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
808
45fa9c0f
GM
8092012-06-12 Glenn Morris <rgm@gnu.org>
810
b4492cba
GM
811 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
812
813 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 814
45fa9c0f
GM
815 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
816 Move BROKEN_SIGIO to configure.
817
818 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
819 Move NO_TERMIO to configure.
820
0e25d334
CY
8212012-06-12 Chong Yidong <cyd@gnu.org>
822
823 * image.c (imagemagick_load_image): Use MagickFlattenImage if
824 MagickMergeImageLayers is undefined. Use pixel pusher loop if
825 MagickExportImagePixels is undefined.
826
43682bb6
PE
8272012-06-12 Paul Eggert <eggert@cs.ucla.edu>
828
829 * image.c (imagemagick_load_image): Remove unused label.
830
a9be7d2b
GM
8312012-06-11 Glenn Morris <rgm@gnu.org>
832
833 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
834 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
835 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
836 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
837
3017f87f
SM
8382012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
839
840 * alloc.c (make_byte_code): New function.
841 (Fmake_byte_code): Use it. Don't purify here.
842 * lread.c (read1): Use it as well to avoid extra allocation.
843
1b9b4cf4
CY
8442012-06-11 Chong Yidong <cyd@gnu.org>
845
846 * image.c (imagemagick_load_image): Implement transparency.
847
95988fcf
AS
8482012-06-10 Andreas Schwab <schwab@linux-m68k.org>
849
850 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
851 account for preceding backslashes. (Bug#11663)
852
cd4eb164
CY
8532012-06-09 Chong Yidong <cyd@gnu.org>
854
855 * term.c: Support italics in capable terminals (Bug#9652).
856 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
857 (turn_on_face): Output using TS_enter_italic_mode if available.
858 Don't handle unused blinking and alt-charset cases.
859 (turn_off_face): Handle italic case; discard unused tty_blinking_p
860 and tty_alt_charset_p cases.
861 (tty_capable_p, init_tty): Support italics.
862
863 * termchar.h (struct tty_display_info): Add field for italics.
864 Remove unused blink field.
865
866 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
867 Handle slant.
868
869 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
870 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
871 tty_alt_charset_p. Add tty_italic_p.
872
ff88beb8
MA
8732012-06-09 Michael Albinus <michael.albinus@gmx.de>
874
875 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
876 dbus_type_is_basic if available.
877 (xd_extract_signed, xd_extract_unsigned): Rename from
878 extract_signed and extract_unsigned, respectively. Adapt callers.
879
44286096
CY
8802012-06-09 Chong Yidong <cyd@gnu.org>
881
1682701f
CY
882 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
883
44286096
CY
884 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
885 case (Bug#9752).
886
d86feb17
PE
8872012-06-08 Paul Eggert <eggert@cs.ucla.edu>
888
889 * xdisp.c (vmessage): Treat frame message as multibyte.
890 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
891 would generate the diagnostic "Making \302\247 buffer-local while
892 let-bound!".
893
d5c20fe8
EZ
8942012-06-08 Eli Zaretskii <eliz@gnu.org>
895
896 * dispnew.c (showing_window_margins_p): Undo last change, which
897 was done due to an inadvertent commit.
898 (adjust_frame_glyphs_for_frame_redisplay): Do call
899 showing_window_margins_p.
900
513749ee
SM
9012012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
902
903 * eval.c (Fmake_var_non_special): New primitive.
904 (syms_of_eval): Defsubr it.
905 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
906
d4a8f5c1
JB
9072012-06-08 Juanma Barranquero <lekktu@gmail.com>
908
909 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
910 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
911
8bbbc977
EZ
9122012-06-08 Eli Zaretskii <eliz@gnu.org>
913
914 * alloc.c (allocate_vectorlike): Fix last change.
915
f3372c87
DA
9162012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
917
918 Block-based vector allocation of small vectors.
919 * lisp.h (struct vectorlike_header): New field `nbytes',
920 adjust comment accordingly.
921 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
922 to denote vector blocks. Adjust users (live_vector_p,
923 mark_maybe_pointer, valid_lisp_object_p) accordingly.
924 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
925 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
926 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
927 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
928 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
929 (roundup_size): New constant.
930 (struct vector_block): New data type.
931 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 932 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
933 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
934 (sweep_vectors): New functions.
935 (allocate_vectorlike): Return `zero_vector' as the only vector of
936 0 items. Allocate new vector from block if vector size is less than
937 or equal to VBLOCK_BYTES_MAX.
938 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
939 (init_alloc_once): Add call to init_vectors.
940
4f18a4ed
SM
9412012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
942
943 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
944
86f158bc
PE
9452012-06-07 Paul Eggert <eggert@cs.ucla.edu>
946
947 * doprnt.c (doprnt): Truncate multibyte char correctly.
948 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
949 would mishandle a string argument "Xc" if X was a multibyte
950 character of length 2: it would truncate after X's first byte
951 rather than including all of X.
952
c5cfcbe0
CY
9532012-06-06 Chong Yidong <cyd@gnu.org>
954
955 * buffer.c (word_wrap): Doc fix.
956
c05cf390
PE
9572012-06-04 Paul Eggert <eggert@cs.ucla.edu>
958
959 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
960
0c3461de
GM
9612012-06-03 Glenn Morris <rgm@gnu.org>
962
963 * xdisp.c (tool-bar-style): Doc fix.
964
c71232db
UM
9652012-06-03 Ulrich Müller <ulm@gentoo.org>
966
967 * Makefile.in (PAXCTL): Define.
968 (temacs$(EXEEXT)): Disable memory randomization for the temacs
969 binary via PaX flags if the paxctl utility is available.
970 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
971 Restore PaX flags to their default. (Bug#11398)
972
383f7350
CY
9732012-06-03 Chong Yidong <cyd@gnu.org>
974
975 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
976 buffer (Bug#11226).
977
5f2c76c6
CY
9782012-06-03 Chong Yidong <cyd@gnu.org>
979
980 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
981 (note_mode_line_or_margin_highlight): If there is no help echo,
982 use mode-line-default-help-echo. Handle the case where the mouse
983 position is past the end of the mode line string.
984
985 * buffer.c (buffer_local_value_1): New function, split from
986 Fbuffer_local_value; can return Qunbound.
987 (Fbuffer_local_value): Use it.
988 (Vmode_line_format): Docstring tweaks.
989
773d47f6
PE
9902012-06-02 Paul Eggert <eggert@cs.ucla.edu>
991
992 * sysdep.c (system_process_attributes): Improve comment.
993
f2d6a3df
SM
9942012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
995
996 * keyboard.c: Export real-this-command to Elisp.
997 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
998 and DEFVAR it. Update all users.
999
63810350
PE
10002012-06-02 Paul Eggert <eggert@cs.ucla.edu>
1001
7bd5c1f4
PE
1002 * minibuf.c (Fassoc_string): Remove duplicate declaration.
1003
63810350
PE
1004 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
1005 Convert pctcpu and pctmem to Lisp float properly.
1006 Let the compiler fold better, as 100.0/0x8000 is exact.
1007
a2821611
AS
10082012-06-02 Andreas Schwab <schwab@linux-m68k.org>
1009
1010 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
1011 cons_block.
1012
5fceba1d
PE
10132012-06-01 Paul Eggert <eggert@cs.ucla.edu>
1014
1015 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
1016
c98ff5dd
DA
10172012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
1018
1019 For a 'struct window', replace some Lisp_Object fields to
1020 bitfields where appropriate, remove unused fields.
1021 * window.h (struct window): Remove unused 'last_mark_x' and
1022 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1023 change it's type from Lisp_Object to bitfield.
1024 Change type of 'force_start', 'optional_new_start',
1025 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
1026 fields from Lisp_Object to bitfield. Adjust users accordingly.
1027
ca34e0be
PE
10282012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1029
1030 Pacify gcc -Wdouble-precision when using Xaw.
1031 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
1032 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
1033 Use 'float' consistently, rather than 'float' in most places
1034 and 'double' in a couple of places.
1035
efc00ab1 10362012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
1037
1038 * xdisp.c (handle_stop): Detect whether we have overlay strings
1039 loaded by testing it->current.overlay_string_index to be
1040 non-negative, instead of checking whether n_overlay_strings is
1041 positive. (Bug#11587)
1042
efc00ab1 10432012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
1044
1045 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
1046
1047 * doc.c (Fsubstitute_command_keys): Doc fix.
1048
efc00ab1 10492012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
1050
1051 * search.c (search_buffer): Remove calls to
1052 r_alloc_inhibit_buffer_relocation, as it is now called by
1053 maybe_unify_char, which was the cause of relocation of buffer text
1054 in bug#11519.
1055
efc00ab1 10562012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
1057
1058 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
1059 for the duration of call to load_charset, to avoid problems with
1060 callers of maybe_unify_char that access buffer text through C
1061 pointers.
1062
1063 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
1064 decrement the inhibition flag, instead of just setting or
1065 resetting it.
1066
ba93a187
PE
10672012-05-31 Paul Eggert <eggert@cs.ucla.edu>
1068
1069 Remove obsolete '#define static' cruft.
1070 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
1071 This #undef was "temporary" in 2000; it is no longer needed
1072 now that '#define static' has gone away.
1073 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
1074 (gray_bitmap_bits): Remove; no longer needed.
1075 All uses replaced with definiens.
1076 * xterm.c: Include "bitmaps/gray.xbm".
1077
9e4bf381
PE
10782012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1079
1080 Clean up __executable_start, monstartup when --enable-profiling.
1081 The following changes affect the code only when profiling.
1082 * dispnew.c (__executable_start): Rename from safe_bcopy.
1083 Define only on platforms that need it.
1084 * emacs.c: Include <sys/gmon.h> when profiling.
1085 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
1086 (__executable_start): Remove decl, since lisp.h does it now.
1087 (safe_bcopy): Remove decl; no longer has that name.
1088 (main): Coalesce #if into single bit of code, for simplicity.
1089 Cast pointers to uintptr_t, since standard libraries want integers
1090 and not pointers.
1091 * lisp.h (__executable_start): New decl.
1092
32d72c2f
GM
10932012-05-31 Glenn Morris <rgm@gnu.org>
1094
1095 * image.c (Fimagemagick_types): Doc fix.
1096
baac5bc7
JM
10972012-05-30 Jim Meyering <meyering@redhat.com>
1098
1099 * callproc.c (Fcall_process_region): Include directory component
1100 in mkstemp error message (Bug#11586).
1101
72cb32cf
PE
11022012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1103
1104 * alloc.c, lisp.h (make_pure_vector): Now static.
1105
61b108cc
SM
11062012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
1107
1108 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
1109 Move to byte-run.el.
1110 (Fautoload): Do the hash-doc more carefully.
1111 * data.c (Fdefalias): Purify definition, except for keymaps.
1112 (Qdefun): Move from eval.c.
1113 * lisp.h (Qdefun): Remove.
1114 * lread.c (read1): Tiny simplification.
1115
471fe23d
TN
11162012-05-29 Troels Nielsen <bn.troels@gmail.com>
1117
934f3f58 1118 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
1119 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
1120 Bug#9642, but explicitly check that the buffer the overlay would
1121 be moved to is live and rearrange lines to make sure that errors
1122 will not put the overlay in an inconsistent state.
1123 (Fdelete_overlay): Cosmetics.
1124
85d0efd1
EZ
11252012-05-28 Eli Zaretskii <eliz@gnu.org>
1126
1127 * w32term.c (my_bring_window_to_top): New function.
1128 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
1129 could be different from the original one.
1130 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
1131 (Bug#11513)
1132
1133 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
1134 by calling BringWindowToTop.
1135
1136 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
1137 (WM_EMACS_END): Increase by one.
1138
da92a98c
PE
11392012-05-28 Paul Eggert <eggert@cs.ucla.edu>
1140
1141 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
1142 This avoids undefined behavior that might cause the eassert
1143 to not catch an out-of-range value.
1144
74d1f848
JB
11452012-05-28 Juanma Barranquero <lekktu@gmail.com>
1146
1147 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
1148 Update dependencies.
1149
9e1a06fc
EZ
11502012-05-27 Eli Zaretskii <eliz@gnu.org>
1151
1152 * bidi.c (bidi_mirror_char): Fix last change.
1153
f3dd7312
AS
11542012-05-27 Andreas Schwab <schwab@linux-m68k.org>
1155
1156 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
1157 when referring to sectname field in printf format.
1158
81899c91
PE
11592012-05-27 Paul Eggert <eggert@cs.ucla.edu>
1160
57b81a9f
PE
1161 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
1162 Only r_alloc_inhibit_buffer_relocation needed to be added;
1163 the others were already declared.
1164
81899c91
PE
1165 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
1166 before checking whether it's out of range. Put the check inside
1167 eassert. See
1168 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
1169
33017faf 11702012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
1171
1172 * callproc.c (Fcall_process): Restore a line that was accidentally
1173 commented out in the 2011-02-13 change (bug#11547).
1174
33017faf 11752012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
1176
1177 * lisp.h [REL_ALLOC]: Add prototypes for external functions
1178 defined on ralloc.c.
1179
1180 * buffer.c [REL_ALLOC]: Remove prototypes of
1181 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
1182 they are now on lisp.h.
1183
1184 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
1185
1186 * search.c (search_buffer): Use it to inhibit relocation of buffer
1187 text while re_search_2 is doing its job, because re_search_2 is
1188 passed C pointers to buffer text. (Bug#11519)
1189
23415acf
EZ
1190 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
1191 Update value to 24.
1192
44e27368
EZ
1193 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
1194 state after an additional call to move_it_in_display_line_to, keep
1195 the values of it->max_ascent and it->max_descent found for the
1196 entire line.
1197 (pos_visible_p): Revert the comparison against bottom_y to what it
1198 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
1199 (Bug#11464)
1200
c1892f11
PE
12012012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1202
1203 Fix coding-related core dumps with gcc -ftrapv.
1204 The code was computing A - B, where A and B are pointers, and B is
1205 random garbage. This can lead to core dumps on platforms that
1206 have special pointer registers, and it also leads to core dumps on
1207 x86-64 when compiled with gcc -ftrapv. The fix is to compute
1208 A - B only when B is initialized properly.
1209 * coding.c (coding_set_source, coding_set_destination): Return void.
1210 (coding_change_source, coding_change_destinations): New functions,
1211 with the old behaviors of coding_set_source and coding_set_destination.
1212 All callers that need an offset changed to use these new functions.
1213
eb7afdad
GM
12142012-05-26 Glenn Morris <rgm@gnu.org>
1215
1216 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
1217
f12fdf02
EZ
12182012-05-26 Eli Zaretskii <eliz@gnu.org>
1219
53a63be6 1220 Extend mouse support on W32 text-mode console.
61b108cc
SM
1221 * xdisp.c (draw_row_with_mouse_face):
1222 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 1223
eb3f6f01 1224 * w32console.c: Include window.h.
61b108cc
SM
1225 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
1226 New functions.
eb3f6f01
EZ
1227 (initialize_w32_display): Initialize mouse-highlight data.
1228
53a63be6
EZ
1229 * w32inevt.c: Include termchar.h and window.h.
1230 (do_mouse_event): Support mouse-autoselect-window. When the mouse
1231 moves, call note_mouse_highlight. If help_echo changed, call
1232 gen_help_event to produce help-echo message in the echo area.
1233 Call clear_mouse_face if mouse_face_hidden is set in the mouse
1234 highlight info.
1235
4cfd81f6
PE
12362012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1237
1238 * lread.c (read1): Simplify slightly to avoid an overflow warning
1239 with GCC 4.7.0 on x86-64.
1240
4446092a
EZ
12412012-05-26 Eli Zaretskii <eliz@gnu.org>
1242
1243 * bidi.c (bidi_mirror_char): Revert last change: an int is
1244 definitely wide enough here.
1245
42b2a986 12462012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 1247
42b2a986 1248 Fix integer width and related bugs (Bug#9874).
eb106a49 1249 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
1250 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
1251 (string_bytes, check_sblock, allocate_string_data):
1252 (compact_small_strings, Fmake_bool_vector, make_string)
1253 (make_unibyte_string, make_multibyte_string)
1254 (make_string_from_bytes, make_specified_string)
1255 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
1256 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
1257 (mark_vectorlike):
1258 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1259 (allocate_pseudovector):
1260 Use int, not EMACS_INT, where int is wide enough.
1261 (inhibit_garbage_collection, Fgarbage_collect):
1262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1263 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
1264 int might not be wide enough.
1265 (bidi_cache_search, bidi_cache_find, bidi_init_it)
1266 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1267 (bidi_at_paragraph_end, bidi_find_paragraph_start)
1268 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
1269 (bidi_level_of_next_char, bidi_move_to_visually_next):
1270 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1271 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
1272 (Fkill_buffer, Fset_buffer_major_mode)
1273 (advance_to_char_boundary, Fbuffer_swap_text)
1274 (Fset_buffer_multibyte, overlays_at, overlays_in)
1275 (overlay_touches_p, struct sortvec, record_overlay_string)
1276 (overlay_strings, recenter_overlay_lists)
1277 (adjust_overlays_for_insert, adjust_overlays_for_delete)
1278 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
1279 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
1280 (Foverlay_recenter, last_overlay_modification_hooks_used)
1281 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
1282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
1283 (validate_region): Omit unnecessary test for b <= e,
1284 since that's guaranteed by the previous test.
d311d28c
PE
1285 (adjust_overlays_for_delete): Avoid pos + length overflow.
1286 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
1287 (report_overlay_modification):
1288 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1289 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
1290 Omit pointer cast, which isn't needed anyway, and doesn't work
1291 after the EMACS_INT -> ptrdiff_t change.
02481186 1292 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
1293 * buffer.h: Adjust decls to match defn changes elsewhere.
1294 (struct buffer_text, struct buffer):
1295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1296 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
1297 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
1298 not int, to avoid needless 32-bit limit on 64-bit hosts.
1299 (exec_byte_code): Use tighter memory-full test, one that checks
1300 for alloca overflow. Don't compute the address of the object just
1301 before an array, as that's not portable. Use EMACS_INT, not
1302 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
1303 * callint.c (Fcall_interactively):
1304 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1305 * callproc.c (call_process_kill, Fcall_process):
1306 Don't assume pid_t fits into an Emacs fixnum.
1307 (call_process_cleanup, Fcall_process, child_setup):
1308 Don't assume pid_t fits into int.
1309 (call_process_cleanup, Fcall_process, delete_temp_file)
1310 (Fcall_process_region):
1311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1312 (Fcall_process): Simplify handling of volatile integers.
1313 Use int, not EMACS_INT, where int will do.
1314 * casefiddle.c (casify_object, casify_region, operate_on_word)
1315 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
1316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1317 (casify_object): Avoid integer overflow when overallocating buffer.
1318 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 1319 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
1320 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
1321 * category.h (CATEGORYP): Don't assume arg is nonnegative.
1322 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
1323 integers are now checked earlier. All uses replaced with XINT.
1324 (ccl_driver):
1325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1326 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
1327 (ccl_driver, Fregister_code_conversion_map):
1328 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
1329 (resolve_symbol_ccl_program): Check that vector header is in range.
1330 Always copy the vector, so that we can check its contents reliably
1331 now rather than having to recheck each instruction as it's being
1332 executed. Check that vector words fit in 'int'.
1333 (ccl_get_compiled_code, Fregister_ccl_program)
1334 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
1335 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
1336 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
1337 contents are in range.
1338 (Fccl_execute_on_string): Check that status is in range.
1339 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
1340 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
1341 Accept and return EMACS_INT, not int, because callers can pass values
1342 out of 'int' range.
1343 (c_string_width, strwidth, lisp_string_width, chars_in_text)
1344 (multibyte_chars_in_text, parse_str_as_multibyte)
1345 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
1346 (str_as_unibyte, str_to_unibyte, string_count_byte8)
1347 (string_escape_byte8, Fget_byte):
1348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 1349 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
1350 avoid mishandling large integers.
1351 * character.h: Adjust decls to match defn changes elsewhere.
1352 * charset.c (load_charset_map_from_file, find_charsets_in_text)
1353 (Ffind_charset_region):
1354 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1355 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
1356 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 1357 Don't assume fixnum fits in int.
d311d28c
PE
1358 (load_charset_map_from_vector, Fmap_charset_chars):
1359 Remove now-unnecessary CHECK_NATNUMs.
1360 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
1361 Don't rely on undefined behavior with signed left shift overflow.
1362 Don't assume unsigned int fits into fixnum, or that fixnum fits
1363 into unsigned int. Don't require max_code to be a valid fixnum;
1364 that's not true for gb10830 4-byte on a 32-bit host. Allow
1365 invalid_code to be a cons, for the same reason. Require code_offset
1366 to be a character. Avoid int overflow if max_char is close
1367 to INT_MAX.
1368 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
1369 this is intended anyway and avoids some undefined behavior.
1370 (load_charset_map): Pass unsigned, not int, as 2nd arg of
1371 INDEX_TO_CODE_POINT, as that's what it expects.
1372 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
1373 * charset.h (DECODE_CHAR): Return int, not unsigned;
1374 this is what was intended anyway, and it avoids undefined behavior.
1375 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
1376 integer-overflow issues.
1377 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
1378 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
1379 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
1380 * chartab.c (Fmake_char_table, Fset_char_table_range)
1381 (uniprop_get_decoder, uniprop_get_encoder):
1382 Don't assume fixnum fits in int.
1383 * cmds.c (move_point): New function, that does the gist of
1384 Fforward_char and Fbackward_char, but does so while checking
1385 for integer overflow more accurately.
c96e5d6a 1386 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
1387 (Fforward_line, Fend_of_line, internal_self_insert)
1388 (internal_self_insert):
1389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1390 Fix a FIXME, by checking for integer overflow when calculating
1391 target_clm and actual_clm.
1392 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 1393 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
1394 (ASSURE_DESTINATION, coding_alloc_by_realloc)
1395 (coding_alloc_by_making_gap, alloc_destination)
1396 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
1397 (encode_coding_utf_16, detect_coding_emacs_mule)
1398 (decode_coding_emacs_mule, encode_coding_emacs_mule)
1399 (detect_coding_iso_2022, decode_coding_iso_2022)
1400 (encode_invocation_designation, encode_designation_at_bol)
1401 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1402 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
1403 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
1404 (encode_coding_ccl, encode_coding_raw_text)
1405 (detect_coding_charset, decode_coding_charset)
1406 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
1407 (produce_composition, produce_charset, produce_annotation)
1408 (decode_coding, handle_composition_annotation)
1409 (handle_charset_annotation, consume_chars, decode_coding_gap)
1410 (decode_coding_object, encode_coding_object, detect_coding_system)
1411 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
1412 (code_convert_region, code_convert_string)
8f50130c
PE
1413 (Fdefine_coding_system_internal)
1414 (coding_set_source, coding_set_destination):
d311d28c
PE
1415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1416 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
1417 (Fdefine_coding_system_internal):
1418 Don't assume fixnums fit in int.
1419 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 1420 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
1421 (Funencodable_char_position, Fcheck_coding_systems_region)
1422 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 1423 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 1424 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 1425 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 1426 Don't access memory outside of the args array.
d311d28c 1427 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
1428 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
1429 result of ENCODE_CHAR.
d311d28c
PE
1430 * coding.h: Adjust decls to match defn changes elsewhere.
1431 (struct coding_system):
1432 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1433 * composite.c (get_composition_id, find_composition)
1434 (run_composition_function, update_compositions)
1435 (compose_text, composition_gstring_put_cache)
1436 (composition_gstring_p, composition_gstring_width)
1437 (fill_gstring_header, fill_gstring_body, autocmp_chars)
1438 (composition_compute_stop_pos, composition_reseat_it)
1439 (composition_update_it, struct position_record)
1440 (find_automatic_composition, composition_adjust_point)
1441 (Fcomposition_get_gstring, Ffind_composition_internal):
1442 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1443 (update_compositions):
1444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1445 * composite.h: Adjust decls to match defn changes elsewhere.
1446 (struct composition):
1447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1448 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1449 Do not attempt to compute the address of the object just before a
1450 buffer; this is not portable.
1451 (Faref, Faset):
1452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1453 (Faset): Use int, not EMACS_INT, where int is wide enough.
1454 (Fstring_to_number): Don't assume fixnums fit in int.
1455 (Frem): Don't assume arg is nonnegative.
1456 * dbusbind.c (xd_append_arg): Check for integers out of range.
1457 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 1458 (extract_signed, extract_unsigned): New functions.
243e0530
PE
1459 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
1460 (xd_get_connection_references): Return ptrdiff_t, not int.
1461 All uses changed.
1462 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
1463 (xd_read_message_1):
1464 Use int, not unsigned, where the dbus API uses int.
1465 (Fdbus_message_internal): Don't overflow mtype.
1466 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
1467 * dired.c (directory_files_internal, file_name_completion, scmp)
1468 (file_name_completion_stat):
1469 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1470 (file_name_completion): Don't overflow matchcount.
1471 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
1472 * dispextern.h: Adjust decls to match defn changes elsewhere.
1473 (struct text_pos, struct glyph, struct bidi_saved_info)
1474 (struct bidi_string_data, struct bidi_it, struct composition_it)
1475 (struct it):
1476 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1477 (struct display_pos, struct composition_it, struct it):
1478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1479 * dispnew.c (increment_matrix_positions)
1480 (increment_row_positions, mode_line_string)
1481 (marginal_area_string):
1482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 1483 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
1484 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1485 (duration_to_sec_usec): New function, to check for overflow better.
1486 (Fsleep_for, sit_for): Use it.
1487 * doc.c (get_doc_string, store_function_docstring):
1488 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1489 (get_doc_string, Fsnarf_documentation):
1490 Use int, not EMACS_INT, where int is wide enough.
1491 (get_doc_string):
1492 Use SAFE_ALLOCA, not alloca.
1493 Check for overflow when converting EMACS_INT to off_t.
1494 * doprnt.c (doprnt):
1495 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1496 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
1497 Don't assume uid_t fits into fixnum.
1498 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
1499 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
1500 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
1501 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
1502 (general_insert_function)
1503 (Finsert_char, make_buffer_string, make_buffer_string_both)
1504 (update_buffer_properties, Fbuffer_substring)
1505 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
1506 (Fsubst_char_in_region, check_translation)
1507 (Ftranslate_region_internal, save_restriction_restore, Fformat)
1508 (transpose_markers, Ftranspose_regions):
1509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1510 (clip_to_bounds): Move to lisp.h as an inline function).
1511 (Fconstrain_to_field): Don't assume integers are nonnegative.
1512 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
1513 (Fsubst_char_in_region, Fsave_restriction):
1514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1515 (Femacs_pid): Don't assume pid_t fits into fixnum.
1516 (lo_time): Use int, not EMACS_INT, when int suffices.
1517 (lisp_time_argument): Check for usec out of range.
1518 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
1519 (Fuser_login_name, Fuser_full_name): Signal an error
1520 if a uid argument is out of range, rather than relying on
1521 undefined behavior.
c8d5c857
PE
1522 (Fformat_time_string): Remove now-unnecessary check.
1523 lisp_time_argument checks for out-of-range usec now.
243e0530 1524 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
1525 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
1526 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
1527 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
1528 (init_cmdargs, Fdump_emacs):
1529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1530 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
1531 the bottom (typically) 32 bits of the fixnum.
1532 * eval.c (specpdl_size, call_debugger):
1533 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1534 (when_entered_debugger, Fbacktrace_debug):
1535 Don't assume fixnum can fit in int.
1536 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
1537 the object just before a buffer; this is not portable.
1538 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
1539 (grow_specpdl, unbind_to):
1540 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1541 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
1542 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 1543 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
1544 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
1545 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
1546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1547 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
1548 (a_write, e_write):
1549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1550 (Fcopy_file, non_regular_nbytes, read_non_regular)
1551 (Finsert_file_contents):
1552 Use int, not EMACS_INT, where int is wide enough.
1553 (READ_BUF_SIZE): Verify that it fits in int.
1554 (Finsert_file_contents): Check that counts are in proper range,
1555 rather than assuming fixnums fit into ptrdiff_t etc.
1556 Don't assume fixnums fit into int.
125b3835 1557 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
1558 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
1559 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
1560 (string_char_to_byte, string_byte_to_char)
1561 (string_make_multibyte, string_to_multibyte)
1562 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
1563 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
1564 (substring_both, Fdelete, internal_equal, Ffillarray)
1565 (Fclear_string, mapcar1)
1566 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
1567 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
1568 (larger_vector, make_hash_table, maybe_resize_hash_table)
1569 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
1570 (Fmaphash, secure_hash):
1571 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1572 (concat): Check for string index and length overflow.
1573 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
1574 (Frequire):
1575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1576 (larger_vector): New API (vec, incr_min, size_max) replaces old
1577 one (vec, new_size, init). This catches size overflow.
1578 INIT was removed because it was always Qnil.
1579 All callers changed.
1580 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
1581 the upper bound on a hash table index size.
1582 (make_hash_table, maybe_resize_hash_table): Use it.
1583 (secure_hash): Computer start_byte and end_byte only after
1584 they're known to be in ptrdiff_t range.
1585 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
1586 (Ffont_get_glyphs, Ffont_at):
1587 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1588 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
1589 (Flist_fonts, Fopen_font):
1590 Don't assume fixnum can fit in int.
1591 (check_gstring): Don't assume index can fit in int.
1592 (font_match_p): Check that fixnum is a character, not a nonnegative
1593 fixnum, since the later code needs to stuff it into an int.
1594 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
1595 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
1596 conversion overflow issues.
1597 (Fopen_font): Check for integer out of range.
1598 (Ffont_get_glyphs): Don't assume index can fit in int.
1599 * font.h: Adjust decls to match defn changes elsewhere.
1600 * fontset.c (reorder_font_vector): Redo score calculation to avoid
1601 integer overflow.
1602 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
1603 printmax_t, where ptrdiff_t is wide enough.
1604 (Finternal_char_font):
1605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1606 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
1607 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
1608 (Fset_frame_position, x_set_frame_parameters)
1609 (x_set_line_spacing, x_set_border_width)
1610 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
1611 Check that fixnums are in proper range for system types.
1612 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
1613 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1614 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
1615 Use SAFE_ALLOCA_LISP, not alloca.
1616 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
1617 intptr_t is wide enough.
1618 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
1619 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
1620 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
1621 Check for fixnum out of range.
1622 * ftfont.c (ftfont_list): Don't assume index fits in int.
1623 Check that fixnums are in proper range for system types.
1624 (ftfont_shape_by_flt):
1625 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
1626 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
1627 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1628 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
1629 Check that fixnums are in proper range for system types.
1630 * gnutls.h: Adjust decls to match defn changes elsewhere.
1631 * gtkutil.c (xg_dialog_run):
1632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1633 (update_frame_tool_bar):
1634 Check that fixnums are in proper range for system types.
1635 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 1636 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
1637 * indent.c (last_known_column, last_known_column_point):
1638 (current_column_bol_cache):
1639 (skip_invisible, current_column, check_display_width):
1640 (check_display_width, scan_for_column, current_column_1)
1641 (Findent_to, Fcurrent_indentation, position_indentation)
1642 (indented_beyond_p, Fmove_to_column, compute_motion):
1643 (Fcompute_motion, Fvertical_motion):
1644 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1645 (last_known_column_modified): Use EMACS_INT, not int.
1646 (check_display_width):
1647 (Fcompute_motion):
1648 Check that fixnums and floats are in proper range for system types.
1649 (compute_motion): Don't assume index or fixnum fits in int.
1650 (compute_motion, Fcompute_motion):
1651 Use int, not EMACS_INT, when it is wide enough.
1652 (vmotion): Omit local var start_hpos that is always 0; that way
1653 we don't need to worry about overflow in expressions involving it.
1654 * indent.h: Adjust decls to match defn changes elsewhere.
1655 (struct position):
1656 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1657 Use int, not EMACS_INT, where int is wide enough.
1658 Remove unused members ovstring_chars_done and tab_offset;
1659 all uses removed.
1660 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
1661 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
1662 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
1663 (make_gap, copy_text, insert, insert_and_inherit)
1664 (insert_before_markers, insert_before_markers_and_inherit)
1665 (insert_1, count_combining_before, count_combining_after)
1666 (insert_1_both, insert_from_string)
1667 (insert_from_string_before_markers, insert_from_string_1)
1668 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
1669 (adjust_after_replace, adjust_after_insert, replace_range)
1670 (replace_range_2, del_range, del_range_1, del_range_byte)
1671 (del_range_both, del_range_2, modify_region)
1672 (prepare_to_modify_buffer, signal_before_change)
1673 (signal_after_change, Fcombine_after_change_execute):
1674 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1675 * intervals.c (traverse_intervals, rotate_right, rotate_left)
1676 (balance_an_interval, split_interval_right, split_interval_left)
1677 (find_interval, next_interval, update_interval)
1678 (adjust_intervals_for_insertion, delete_node, delete_interval)
1679 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1680 (static_offset_intervals, offset_intervals)
1681 (merge_interval_right, merge_interval_left, make_new_interval)
1682 (graft_intervals_into_buffer, temp_set_point_both)
1683 (temp_set_point, set_point, adjust_for_invis_intang)
1684 (set_point_both, move_if_not_intangible, get_property_and_range)
1685 (get_local_map, copy_intervals, copy_intervals_to_string)
1686 (compare_string_intervals, set_intervals_multibyte_1):
1687 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1688 * intervals.h: Adjust decls to match defn changes elsewhere.
1689 (struct interval):
1690 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1691 * keyboard.c (this_command_key_count, this_single_command_key_start)
1692 (before_command_key_count, before_command_echo_length, echo_now)
1693 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
1694 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
1695 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
1696 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
1697 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1698 (last_non_minibuf_size, last_point_position, echo_truncate)
1699 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
1700 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
1701 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
1702 (stuff_buffered_input):
1703 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1704 (last_auto_save, command_loop_1, read_char):
1705 Use EMACS_INT, not int, to avoid integer overflow.
1706 (record_char): Avoid overflow in total_keys computation.
1707 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
1708 * keyboard.h: Adjust decls to match defn changes elsewhere.
1709 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
1710 (Fkey_description, Fdescribe_vector, Flookup_key):
1711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1712 (click_position): New function, to check that positions are in range.
1713 (Fcurrent_active_maps):
1714 (describe_command):
1715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1716 (Faccessible_keymaps, Fkey_description):
1717 (preferred_sequence_p):
1718 Don't assume fixnum can fit into int.
1719 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
1720 Check for integer overflow in size calculations.
1721 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
1722 avoid mishandling large integers.
1723 * lisp.h: Adjust decls to match defn changes elsewhere.
1724 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
1725 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
1726 (struct Lisp_Marker):
1727 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1728 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
1729 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
1730 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
1731 All callers changed.
1732 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
1733 Assume the arg has valid form, since it always does.
1734 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
1735 unsigned integer system type.
1736 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
1737 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
1738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1739 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
1740 (duration_to_sec_usec): New decl.
1741 * lread.c (read_from_string_index, read_from_string_index_byte)
1742 (read_from_string_limit, readchar, unreadchar, openp)
1743 (read_internal_start, read1, oblookup):
1744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1745 (Fload, readevalloop, Feval_buffer, Feval_region):
1746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1747 (openp): Check for out-of-range argument to 'access'.
1748 (read1): Use int, not EMACS_INT, where int is wide enough.
1749 Don't assume fixnum fits into int.
6efdadfd 1750 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
1751 (read_filtered_event): Use duration_to_sec_usec
1752 to do proper overflow checking on durations.
d311d28c
PE
1753 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
1754 in size calculation.
1755 (Fexecute_kbd_macro):
1756 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1757 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
1758 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
1759 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
1760 (set_marker_both, set_marker_restricted_both, marker_position)
1761 (marker_byte_position, Fbuffer_has_markers_at):
1762 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1763 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 1764 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
1765 It now merely ensures that the menu is large enough, without
1766 necessarily growing it, as this avoids some integer overflow issues.
1767 All callers changed.
1768 (keymap_panes, parse_single_submenu, Fx_popup_menu):
1769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1770 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
1771 Use SAFE_ALLOCA_LISP, not alloca.
1772 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
1773 to EMACS_INT. Check that fixnums are in proper range for system types.
1774 * minibuf.c (minibuf_prompt_width, string_to_object)
1775 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
1776 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
1777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1778 (get_minibuffer, read_minibuf_unwind):
1779 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1780 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
1781 this simplifies overflow checking. All callers changed.
1782 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
1783 (Ftest_completion):
1784 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1785 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
1786 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
1787 Check that fixnums are in proper range for system types.
1788 (Fx_create_frame, Fx_show_tip):
1789 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1790 * nsfont.m (ns_findfonts, nsfont_list_family):
1791 Don't assume fixnum fits in long.
1792 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
1793 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1794 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
1795 wide enough.
17fdb222 1796 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
1797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1798 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
1799 (PRINTDECLARE, PRINTPREPARE):
1800 (strout, print_string):
1801 (print, print_preprocess, print_check_string_charset_prop)
1802 (print_object):
1803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1804 (PRINTDECLARE):
1805 (temp_output_buffer_setup, Fprin1_to_string, print_object):
1806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1807 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 1808 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 1809 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
1810 (print_error_message): Use SAFE_ALLOCA, not alloca.
1811 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
1812 (print_depth, new_backquote_output, print_number_index):
1813 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
1814 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
1815 (Fset_process_window_size, Fformat_network_address)
1816 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 1817 (sigchld_handler):
d311d28c 1818 Check that fixnums are in proper range for system types.
d44287d4 1819 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
1820 Check for process-ids out of pid_t range rather than relying on
1821 undefined behavior.
e4d81efc 1822 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
1823 (Fformat_network_address, read_process_output, send_process)
1824 (Fprocess_send_region, status_notify):
1825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1826 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
1827 (wait_reading_process_output, read_process_output, exec_sentinel):
1828 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1829 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
1830 (Faccept_process_output): Use duration_to_sec_usec to do proper
1831 overflow checking on durations.
dde14581
PE
1832 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
1833 Don't assume pid_t fits in int.
02481186
PE
1834 * process.h (struct Lisp_Process): Members tick and update_tick
1835 are now of type EMACS_INT, not int.
b62b53e8
PE
1836 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
1837 configured --with-wide-int.
d311d28c
PE
1838 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
1839 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
1840 * search.c (looking_at_1, string_match_1):
1841 (fast_string_match, fast_c_string_match_ignore_case)
1842 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
1843 (scan_newline, find_before_next_newline, search_command)
1844 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
1845 (set_search_regs, wordify):
1846 (Freplace_match):
1847 (Fmatch_data):
1848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1849 (string_match_1, search_buffer, set_search_regs):
1850 (Fmatch_data):
1851 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1852 (wordify): Check for overflow in size calculation.
1853 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
1854 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
1855 Check that fixnums are in proper range for system types.
1856 * sound.c (struct sound_device)
1857 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
1858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1859 (Fplay_sound_internal):
1860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 1861 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
1862 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
1863 (Fparse_partial_sexp):
1864 Don't assume fixnums can fit in int.
1865 (struct lisp_parse_state, find_start_pos, find_start_value)
1866 (find_start_value_byte, find_start_begv)
1867 (update_syntax_table, char_quoted, dec_bytepos)
1868 (find_defun_start, prev_char_comend_first, back_comment):
1869 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
1870 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
1871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1872 (Finternal_describe_syntax_value): Check that match_lisp is a
1873 character, not an integer, since the code stuffs it into int.
1874 (scan_words, scan_sexps_forward):
1875 Check that fixnums are in proper range for system types.
1876 (Fforward_word):
1877 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1878 (scan_sexps_forward):
1879 Use CHARACTERP, not INTEGERP, since the value must fit into int.
1880 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
1881 * syntax.h: Adjust decls to match defn changes elsewhere.
1882 (struct gl_state_s):
1883 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
1884 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
1885 MOST_POSITIVE_FIXNUM.
d311d28c
PE
1886 * sysdep.c (wait_for_termination_1, wait_for_termination)
1887 (interruptible_wait_for_termination, mkdir):
1888 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
1889 (emacs_read, emacs_write):
1890 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
1891 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
1892 and double all fit in int.
d311d28c
PE
1893 * term.c (set_tty_color_mode):
1894 Check that fixnums are in proper range for system types.
1895 * termhooks.h (struct input_event):
1896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1897 * textprop.c (validate_interval_range, interval_of)
1898 (Fadd_text_properties, set_text_properties_1)
1899 (Fremove_text_properties, Fremove_list_of_text_properties)
1900 (Ftext_property_any, Ftext_property_not_all)
1901 (copy_text_properties, text_property_list, extend_property_ranges)
1902 (verify_interval_modification):
1903 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1904 (Fnext_single_char_property_change)
1905 (Fprevious_single_char_property_change):
1906 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
1907 (copy_text_properties):
1908 Check for integer overflow in index calculation.
d311d28c
PE
1909 * undo.c (last_boundary_position, record_point, record_insert)
1910 (record_delete, record_marker_adjustment, record_change)
1911 (record_property_change):
1912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1913 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
1914 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1915 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1916 (Fx_hide_tip, Fx_file_dialog):
1917 * w32menu.c (set_frame_menubar):
1918 Use ptrdiff_t, not int, for consistency with rest of code.
1919 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
1920 (select_window, Fdelete_other_windows_internal)
1921 (window_scroll_pixel_based, window_scroll_line_based)
1922 (Frecenter, Fset_window_configuration):
1923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1924 (Fset_window_hscroll, run_window_configuration_change_hook)
1925 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 1926 (Fscroll_other_window, Frecenter):
d311d28c
PE
1927 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1928 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
1929 Don't assume fixnum fits in int.
1930 (Fset_window_scroll_bars):
1931 Check that fixnums are in proper range for system types.
1932 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
1933 (string_pos, c_string_pos, number_of_chars, init_iterator)
1934 (in_ellipses_for_invisible_text_p, init_from_display_pos)
1935 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
1936 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
1937 (face_before_or_after_it_pos, handle_invisible_prop)
1938 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
1939 (display_prop_intangible_p, string_buffer_position_lim)
1940 (string_buffer_position, handle_composition_prop, load_overlay_strings)
1941 (get_overlay_strings_1, get_overlay_strings)
1942 (iterate_out_of_display_property, forward_to_next_line_start)
1943 (back_to_previous_visible_line_start, reseat, reseat_to_string)
1944 (get_next_display_element, set_iterator_to_next)
1945 (get_visually_first_element, compute_stop_pos_backwards)
1946 (handle_stop_backwards, next_element_from_buffer)
1947 (move_it_in_display_line_to, move_it_in_display_line)
1948 (move_it_to, move_it_vertically_backward, move_it_by_lines)
1949 (add_to_log, message_dolog, message_log_check_duplicate)
1950 (message2, message2_nolog, message3, message3_nolog
1951 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
1952 (current_message_1, truncate_echo_area, truncate_message_1)
1953 (set_message, set_message_1, store_mode_line_noprop)
1954 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
1955 (text_outside_line_unchanged_p, check_point_in_composition)
1956 (reconsider_clip_changes)
1957 (redisplay_internal, set_cursor_from_row, try_scrolling)
1958 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
1959 (redisplay_window, find_last_unchanged_at_beg_row)
1960 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
1961 (trailing_whitespace_p, find_row_edges, display_line)
1962 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
1963 (display_mode_element, store_mode_line_string)
1964 (pint2str, pint2hrstr, decode_mode_spec)
1965 (display_count_lines, display_string, draw_glyphs)
1966 (x_produce_glyphs, x_insert_glyphs)
1967 (rows_from_pos_range, mouse_face_from_buffer_pos)
1968 (fast_find_string_pos, mouse_face_from_string_pos)
1969 (note_mode_line_or_margin_highlight, note_mouse_highlight):
1970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1971 (safe_call, init_from_display_pos, handle_fontified_prop)
1972 (handle_single_display_spec, load_overlay_strings)
1973 (with_echo_area_buffer, setup_echo_area_for_printing)
1974 (display_echo_area, echo_area_display)
1975 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
1976 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
1977 (redisplay_window, dump_glyph_row, display_mode_line)
1978 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 1979 (handle_display_spec, display_prop_string_p):
d311d28c
PE
1980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1981 (handle_single_display_spec, build_desired_tool_bar_string)
1982 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
1983 (get_specified_cursor_type):
1984 Check that fixnums are in proper range for system types.
1985 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
1986 (Flookup_image_map):
1987 Don't assume fixnums fit in int.
1988 (compare_overlay_entries):
1989 Avoid mishandling comparisons due to subtraction overflow.
1990 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
1991 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
1992 (handle_tool_bar_click):
1993 Use int, not unsigned, since we prefer signed and the signedness
1994 doesn't matter here.
1995 (get_next_display_element, next_element_from_display_vector):
1996 Use int, not EMACS_INT, when int is wide enough.
1997 (start_hourglass): Use duration_to_sec_usec to do proper
1998 overflow checking on durations.
1999 * xfaces.c (Fbitmap_spec_p):
2000 Check that fixnums are in proper range for system types.
2001 (compare_fonts_by_sort_order):
2002 Avoid mishandling comparisons due to subtraction overflow.
2003 (Fx_family_fonts, realize_basic_faces):
2004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2005 (Fx_family_fonts):
2006 Don't assume fixnum fits in int.
2007 Use SAFE_ALLOCA_LISP, not alloca.
2008 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
2009 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
2010 (face_at_buffer_position, face_for_overlay_string)
2011 (face_at_string_position):
2012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2013 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
2014 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
2015 (Fx_show_tip):
2016 Check that fixnums are in proper range for system types.
2017 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
2018 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
2019 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2020 (Fx_change_window_property): Don't assume fixnums fit in int.
2021 * xfont.c (xfont_chars_supported):
2022 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2023 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
2024 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
2025 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2026 * xml.c (parse_region):
2027 * xrdb.c (magic_file_p):
2028 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
2029 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
2030 (x_get_local_selection, x_reply_selection_request)
2031 (x_handle_selection_request, wait_for_property_change):
2032 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2033 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
2034 short is wide enough.
2035 (x_send_client_event): Don't assume fixnum fits in int.
2036 * xterm.c (x_x_to_emacs_modifiers):
2037 Don't assume EMACS_INT overflows nicely into int.
2038 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
2039 may come from Lisp.
2040 (handle_one_xevent): NATNUMP can eval its arg twice.
2041 (x_connection_closed):
2042 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
2043 * xterm.h: Adjust decls to match defn changes elsewhere.
2044 (struct scroll_bar): Use struct vectorlike_header
2045 rather than rolling our own approximation.
2046 (SCROLL_BAR_VEC_SIZE): Remove; not used.
2047
c6574eb5
GM
20482012-05-25 Glenn Morris <rgm@gnu.org>
2049
2050 * lisp.mk (lisp): Update for more files being compiled now.
2051
e8d32c7e
SM
20522012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
2053
48def666
SM
2054 * lread.c: Remove `read_pure' which makes no difference.
2055 (read_pure): Remove var.
2056 (unreadpure): Remove function.
2057 (readevalloop): Don't call read_list with -1 flag.
2058 (read1, read_vector): Don't test read_pure any more.
2059 (read_list): Simplify.
2060
e8d32c7e
SM
2061 * fileio.c, character.h: Minor style tweaks.
2062
4b2addb7
DA
20632012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
2064
2065 * window.h (clip_changed): Remove useless declaration.
2066
584461b2
JB
20672012-05-22 Juanma Barranquero <lekktu@gmail.com>
2068
2069 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
2070 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
2071
34374650
PE
20722012-05-22 Paul Eggert <eggert@cs.ucla.edu>
2073
2074 Remove src/m/*.
2075 This directory predates autoconf and is no longer needed nowadays.
2076 Move its few remaining bits of functionality to where they're needed.
2077 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
2078 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
2079 * m/template.h: Remove.
2080 * Makefile.in (M_FILE): Remove. All uses removed.
2081 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
2082 * lisp.h (USE_LSB_TAG):
2083 * mem-limits.h (EXCEEDS_LISP_PTR):
2084 Use VAL_MAX, not VALBITS, in #if.
2085 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
2086 (EMACS_UINT): Define unconditionally now.
2087 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
2088 (BITS_PER_EMACS_INT): New constants, replacing
2089 what used to be in config.h, but not useful in #if.
2090 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
2091 define them any more.
2092 (VAL_MAX): New macro.
2093 (VALMASK): Use it.
2094 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
2095 BITS_PER_EMACS_INT, in #if.
2096 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2097 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
2098 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
2099 * s/ms-w32.h (DATA_START):
2100 Move here from removed file m/intel386.h.
2101 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
2102 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
2103
261cb4bb
PE
21042012-05-21 Paul Eggert <eggert@cs.ucla.edu>
2105
2106 Assume C89 or later.
2107 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
2108 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
2109 (xrealloc):
2110 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
2111 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
2112 * textprop.c, tparam.c (NULL): Remove.
2113 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
2114 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
2115 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
2116 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
2117 * xterm.c (input_signal_count): Assume volatile works.
2118
ff23cd9f
KB
21192012-05-21 Ken Brown <kbrown@cornell.edu>
2120
2121 * xgselect.c (xg_select): Fix first argument in call to 'select'
2122 (bug#11508).
2123
1b170bc6
KB
21242012-05-20 Ken Brown <kbrown@cornell.edu>
2125
2126 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 2127 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 2128
b2f4d39f
KB
21292012-05-19 Ken Brown <kbrown@cornell.edu>
2130
2131 * xfns.c (x_in_use): Remove `static' qualifier.
2132 * xterm.h (x_in_use): Declare.
2133 * xgselect.c: Include xterm.h.
2134 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
2135 and `display_arg' (bug#9754).
2136
003fdae2
PE
21372012-05-19 Paul Eggert <eggert@cs.ucla.edu>
2138
9232a6d9
PE
2139 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
2140
003fdae2
PE
2141 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
2142 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
2143
784b56e2
EZ
21442012-05-18 Eli Zaretskii <eliz@gnu.org>
2145
2146 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
2147
2148 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
2149 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
2150
2151 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
2152 reference to image_cache->refcount.
2153 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
2154
a0a79cde
JL
21552012-05-17 Juri Linkov <juri@jurta.org>
2156
2157 * search.c (Fword_search_regexp, Fword_search_backward)
2158 (Fword_search_forward, Fword_search_backward_lax)
2159 (Fword_search_forward_lax): Move functions to isearch.el
2160 (bug#10145, bug#11381).
2161
b0572523
PE
21622012-05-16 Paul Eggert <eggert@cs.ucla.edu>
2163
2164 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
2165
9660f5fc
SM
21662012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2167
2168 * lread.c (init_obarray): Declare Qt and Qnil as special.
2169
4374de83
GM
21702012-05-14 Glenn Morris <rgm@gnu.org>
2171
2172 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 2173 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 2174
dc44c39a
PE
21752012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2176
078c97cb
PE
2177 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
2178
dc44c39a
PE
2179 * unexaix.c: Port to more-recent AIX compilers.
2180 (report_error, report_error_1, make_hdr, copy_sym)
2181 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
2182 Make arguments const char *, not char *, to avoid violations of C
2183 standard and to fix some AIX warnings reported by Gilles Pion.
2184
e18afed7 21852012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
2186
2187 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
2188 already have overlays loaded.
2189 (handle_single_display_spec): Before returning without displaying
2190 fringe bitmap, synchronize the bidi iterator with the main display
2191 iterator, by calling iterate_out_of_display_property.
2192 (iterate_out_of_display_property): Detect buffer iteration by
2193 testing that it->string is a Lisp string.
2194 (get_next_display_element): When the current object is exhausted,
2195 and there's something on it->stack, call set_iterator_to_next to
2196 proceed with what's on the stack, instead of returning zero.
2197 (set_iterator_to_next): If called at the end of a Lisp string,
2198 proceed to consider_string_end without incrementing string
2199 position. Don't increment display vector index past the end of
2200 the display vector. (Bug#11417)
c8fb9dc6
EZ
2201 (pos_visible_p): Don't report a position visible when move_it_to
2202 stopped at the last line of window, which happens to be scanned
2203 backwards by the bidi iteration. (Bug#11464)
ac268e67 2204
e18afed7 22052012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
2206
2207 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
2208 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
2209 are on a TTY, and thus unable to display on the fringes.
2210 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
2211 so we need to signal to the caller that this is a "replacing"
2212 display spec. This fixes display when the spec is invalid or we
2213 are on a TTY.
2214
e18afed7 22152012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
2216
2217 * unexaix.c (make_hdr): Fix typo in prototype.
2218 This bug broke the build on AIX. Problem reported by Gilles Pion.
2219
9d0a235a
MA
22202012-05-14 Michael Albinus <michael.albinus@gmx.de>
2221
2222 * keyboard.c (kbd_buffer_get_event): Read special events also in
2223 batch mode. (Bug#11415)
2224
9e6b06ed
GM
22252012-05-12 Glenn Morris <rgm@gnu.org>
2226
2227 * ns.mk: Update for ns_appbindir no longer having trailing "/".
2228
c1a1d7a3
EZ
22292012-05-12 Eli Zaretskii <eliz@gnu.org>
2230
2231 * lisp.mk (lisp): Add newcomment.elc.
2232
3fe7cdc8
GM
22332012-05-12 Glenn Morris <rgm@gnu.org>
2234
2235 * Makefile.in (MKDIR_P): New, set by configure.
2236 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
2237
53f7d2c0
PE
22382012-05-11 Paul Eggert <eggert@cs.ucla.edu>
2239
2240 Remove unused function hourglass_started.
2241 * dispextern.h (hourglass_started):
2242 * w32fns.c (hourglass_started):
2243 * xdisp.c (hourglass_started): Remove.
2244
75aafb17
JB
22452012-05-10 Juanma Barranquero <lekktu@gmail.com>
2246
2247 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
2248 Update dependencies.
2249
12959e8e
PE
22502012-05-10 Paul Eggert <eggert@cs.ucla.edu>
2251
97107e2e
PE
2252 * xgselect.c (xg_select): Put maxfds+1 into a var.
2253 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
2254
12959e8e
PE
2255 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
2256
836d29b3
DA
22572012-05-10 Dave Abrahams <dave@boostpro.com>
2258
2259 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
2260 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
2261
5cb67954
MA
22622012-05-09 Michael Albinus <michael.albinus@gmx.de>
2263
2264 * dbusbind.c (xd_registered_buses): New internal Lisp object.
2265 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
2266 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
2267 Initialize xd_registered_buses.
2268
3478ec45
PE
22692012-05-09 Paul Eggert <eggert@cs.ucla.edu>
2270
b263a6b0
PE
2271 Untag more efficiently if USE_LSB_TAG.
2272 This is based on a proposal by YAMAMOTO Mitsuharu in
2273 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
2274 For an admittedly artificial (nth 8000 longlist) benchmark on
2275 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
2276 Emacs's overall text size by 1%.
2277 * lisp.h (XUNTAG): New macro.
2278 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
2279 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
2280 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
2281 * eval.c (Fautoload):
2282 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
2283 * frame.h (XFRAME): Use XUNTAG.
2284
3478ec45
PE
2285 Port recent dbusbind.c changes to 32-bit --with-wide-int.
2286 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
2287 Remove unportable assumptions about print widths of types like
2288 dbus_uint32_t.
2289 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
2290 intptr_t when converting between pointer and integer, to avoid GCC
2291 warnings about wrong width.
2292
666b903b 22932012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
2294
2295 * w32proc.c (new_child): Force Windows to reserve only 64KB of
2296 stack for each reader_thread, instead of defaulting to 8MB
2297 determined by the linker. This avoids failures in creating
2298 subprocesses on Windows 7, see the discussion in this thread:
2299 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
2300
b120cc17
JC
23012012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
2302
2303 Fix up display of the *Minibuf-0* buffer in the mini window.
2304 * keyboard.c (read_char): Don't clear the echo area if there's no
2305 message to clear.
2306 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 2307 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 2308
9a4b36f8
MA
23092012-05-07 Michael Albinus <michael.albinus@gmx.de>
2310
2311 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
2312 batch mode.
2313
e5f9458f
CY
23142012-05-06 Chong Yidong <cyd@gnu.org>
2315
2316 * lisp.mk (lisp): Update.
2317
eceeb5fc 23182012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
2319
2320 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
2321
71873e2b
SM
23222012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2323
2324 * data.c (PUT_ERROR): New macro.
2325 (syms_of_data): Use it. Add new error type `user-error'.
2326 * undo.c (user_error): New function.
2327 (Fprimitive_undo): Use it.
2328 * print.c (print_error_message): Adjust print style for `user-error'.
2329 * keyboard.c (user_error): New function.
2330 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2331
ab0fa4e4
PE
23322012-05-03 Paul Eggert <eggert@cs.ucla.edu>
2333
2334 Do not limit current-time-string to years 1000..9999.
2335 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
2336 (Fcurrent_time_string): Support any year that is supported by the
2337 underlying localtime representation. Don't use asctime, as it
2338 has undefined behavior for years outside the range -999..9999.
2339
7ed806a7
PE
23402012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2341
2342 Fix race conditions involving setenv, gmtime, localtime, asctime.
2343 Without this fix, interrupts could mess up code that uses these
2344 nonreentrant functions, since setting TZ invalidates existing
2345 tm_zone or tzname values, and since most of these functions return
2346 pointers to static storage.
2347 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
2348 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
2349 Grow the critical sections to include not just invoking
2350 localtime/gmtime, but also accessing these functions' results
2351 including their tm_zone values if any, and any related TZ setting.
2352 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
2353 so that the struct tm is saved in the critical section.
2354 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
2355 motivated by the fact that memory allocation needs to be outside
2356 the critical section.
2357
0c16dfed
DA
23582012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2359
2360 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
2361 with RESET_INTERVAL.
2362
2363 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2364 Remove duplicated buffer name initialization.
2365
3f83ace8
JM
23662012-05-02 Jim Meyering <jim@meyering.net>
2367
2368 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
2369
c7b8541e
JM
2370 * xfns.c (x_window): Use xstrdup (Bug#11375).
2371
90207a15 23722012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
2373
2374 * xdisp.c (pos_visible_p): If already at a newline from the
2375 display string before the 'while' loop, don't walk back the glyphs
2376 from it3.glyph_row. Solves assertion violation when the display
2377 string begins with a newline (egg.el). (Bug#11367)
2378
b593d6a9
AH
23792012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
2380
2381 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
2382 Move to simple.el.
2383
4737362e
GM
23842012-05-01 Glenn Morris <rgm@gnu.org>
2385
99cf43f9
GM
2386 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
2387 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
2388 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
2389 All were removed before 23.1.
2390
9311dcff
GM
2391 * dispnew.c: Remove HAVE_LIBNCURSES test;
2392 it is always true on relevant platforms.
2393
4d5c6349
GM
2394 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
2395 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
2396
4737362e
GM
2397 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
2398
74dd3a6b
AS
23992012-04-30 Andreas Schwab <schwab@linux-m68k.org>
2400
2401 * .gdbinit (xpr): Remove checks for no longer existing misc types.
2402 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
2403 Remove.
2404
13c379ee
PE
24052012-04-28 Paul Eggert <eggert@cs.ucla.edu>
2406
2407 Do not avoid creating empty evaporating overlays (Bug#9642).
2408 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
2409 That is, do not delete an evaporating overlay if it becomes
2410 empty after its bounds are adjusted to fit within its buffer.
2411 This fix caused other problems, and I'm reverting it until we get
2412 to the bottom of them.
2413
a8e7d6d7 24142012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
2415
2416 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
2417
a8e7d6d7 24182012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
2419
2420 * xdisp.c (pos_visible_p): If the window start position is beyond
2421 ZV, start the display from buffer beginning. Prevents assertion
2422 violation in init_iterator when the minibuffer window is scrolled
2423 via the scroll bar.
2424
2425 * window.c (window_scroll_pixel_based): Likewise.
2426
a8e7d6d7 24272012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
2428
2429 * keymap.c (where_is_internal): Doc fix (Bug#10872).
2430
a8e7d6d7 24312012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
2432
2433 * fileio.c (Fcopy_file, Fset_file_selinux_context):
2434 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
2435
a8e7d6d7 24362012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 2437
b593d6a9
AH
2438 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
2439 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 2440
1c6900d9
EZ
24412012-04-26 Eli Zaretskii <eliz@gnu.org>
2442
4c3fa1d9
EZ
2443 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
2444 display element, check also the underlying string or buffer
2445 character. (Bug#11341)
2446
1c6900d9
EZ
2447 * w32menu.c: Include w32heap.h.
2448 (add_menu_item): If the call to AppendMenuW (via
2449 unicode_append_menu) fails, disable Unicode menus only if we are
2450 running on Windows 9X/Me.
2451
42bf8205
AS
24522012-04-24 Andreas Schwab <schwab@linux-m68k.org>
2453
2454 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
2455 (xgetint): Add missing shift for LSB tags.
2456
b1bac16e
MR
24572012-04-24 Martin Rudalics <rudalics@gmx.at>
2458
2459 * keyboard.c (read_char): Don't wipe echo area for select window
2460 events: These might get delayed via `mouse-autoselect-window'
2461 (Bug#11304).
2462
d69621cc
JB
24632012-04-24 Juanma Barranquero <lekktu@gmail.com>
2464
2465 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
2466 manipulation of :loaded-from data.
2467
02fd101b
JB
24682012-04-23 Juanma Barranquero <lekktu@gmail.com>
2469
2470 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
2471 now a cons (bug#11311).
2472
888bec30
PE
24732012-04-23 Paul Eggert <eggert@cs.ucla.edu>
2474
89a438bd
PE
2475 Do not create empty overlays with the evaporate property (Bug#9642).
2476 * buffer.c (Fmove_overlay): Delete an evaporating overlay
2477 if it becomes empty after its bounds are adjusted to fit within
2478 its buffer. Without this fix, in a nonempty buffer (let ((o
2479 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
2480 yields an empty overlay that has the evaporate property, which is
2481 not supposed to happen.
2482
1068fe4d
PE
2483 Fix minor GTK3 problems found by static checking.
2484 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2485 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2486 (struct _EmacsFixedClass, emacs_fixed_get_type):
2487 Move decls here from emacsgtkfixed.h, since they needn't be public.
2488 (emacs_fixed_get_type): Now static.
2489 (emacs_fixed_class_init): Omit unused local.
2490 (emacs_fixed_child_type): Remove; unused.
2491 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2492 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2493 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
2494 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
2495 (EMACS_FIXED_GET_CLASS): Remove; unused.
2496 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
2497
888bec30
PE
2498 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
2499 Problem reported by Juanma Barranquero for Windows -Wunused-function.
2500
de85e130
PE
25012012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2502
d0baac98 2503 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 2504 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
2505 (__malloc_size_t, __malloc_ptrdiff_t):
2506 Remove. All uses removed, replaced by the definiens if needed,
2507 since we can assume C89 or better now.
2508 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
2509 (protect_malloc_state, align, get_contiguous_space)
2510 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
2511 (malloc_atfork_handler_child, malloc_enable_thread)
2512 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
2513 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
2514 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
2515 (special_realloc, _realloc_internal_nolock, _realloc_internal)
2516 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
2517 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
2518 Define using prototypes, not old style.
2519 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
2520 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
2521 (align): Don't assume that signed integer overflow wraps around.
2522 Omit unused local var.
2523 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
2524 (_free_internal_nolock, memalign, mallochook, reallochook):
2525 Omit no-longer-needed casts.
2526 (valloc): Use getpagesize, not __getpagesize.
2527 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
2528 (struct hdr): The 'magic' member is now size_t, not unsigned long.
2529
de85e130
PE
2530 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
2531
dcbf5805
MA
25322012-04-22 Michael Albinus <michael.albinus@gmx.de>
2533
2534 Move functions from C to Lisp. Make non-blocking method calls
2535 the default. Implement further D-Bus standard interfaces.
2536
2537 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
2538 (QCdbus_request_name_allow_replacement)
2539 (QCdbus_request_name_replace_existing)
2540 (QCdbus_request_name_do_not_queue)
2541 (QCdbus_request_name_reply_primary_owner)
2542 (QCdbus_request_name_reply_in_queue)
2543 (QCdbus_request_name_reply_exists)
2544 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
2545 (QCdbus_registered_serial, QCdbus_registered_method)
2546 (QCdbus_registered_signal): New Lisp objects.
2547 (XD_DEBUG_MESSAGE): Use sizeof.
2548 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
2549 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
2550 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
2551 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
2552 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
2553 (xd_signature, xd_append_arg): Allow float for integer types.
2554 (xd_get_connection_references): New function.
b593d6a9
AH
2555 (xd_get_connection_address): Rename from xd_initialize.
2556 Return cached address.
dcbf5805
MA
2557 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
2558 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
2559 level.
2560 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 2561 Return number of refcounts.
dcbf5805
MA
2562 (Fdbus_get_unique_name): Make stronger parameter check.
2563 (Fdbus_message_internal): New defun.
2564 (Fdbus_call_method, Fdbus_call_method_asynchronously)
2565 (Fdbus_method_return_internal, Fdbus_method_error_internal)
2566 (Fdbus_send_signal, Fdbus_register_service)
2567 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
2568 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
2569 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
2570 (Vdbus_compiled_version, Vdbus_runtime_version)
2571 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
2572 (Vdbus_message_type_method_return, Vdbus_message_type_error)
2573 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
2574 (Vdbus_registered_buses, Vdbus_registered_objects_table):
2575 Adapt docstring.
dcbf5805 2576
52828e02
PE
25772012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2578
da05bc4c
PE
2579 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
2580 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
2581 Do not assume ptrdiff_t is the same width as 'int'.
2582
52828e02
PE
2583 * alloc.c: Handle unusual debugging option combinations.
2584 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
2585 since the two debugging options are incompatible.
2586 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
2587 is defined.
2588 (mem_init, mem_insert, mem_insert_fixup):
2589 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
2590 (NEED_MEM_INSERT): Remove; no longer needed.
2591
f01769f9
LL
25922012-04-22 Leo Liu <sdl.web@gmail.com>
2593
2594 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
2595
5790543d
PE
25962012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2597
2598 * sysdep.c [__FreeBSD__]: Minor cleanups.
2599 (list_system_processes, system_process_attributes) [__FreeBSD__]:
2600 Use Emacs indenting style more consistently. Avoid some casts.
2601 Use 'double' consistently rather than mixing 'float' and 'double'.
2602
b91b7e4d
EW
26032012-04-21 Eduard Wiebe <usenet@pusto.de>
2604
b593d6a9
AH
2605 * sysdep.c (list_system_processes, system_process_attributes):
2606 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 2607
6114eb15
AS
26082012-04-21 Andreas Schwab <schwab@linux-m68k.org>
2609
2610 * lisp.mk (lisp): Update.
2611
2f38dff7
PE
26122012-04-20 Paul Eggert <eggert@cs.ucla.edu>
2613
2614 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
2615 It is never used otherwise.
2616
4ae29f89
SM
26172012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
2618
2619 * print.c (print_preprocess): Only check print_depth if print-circle
2620 is nil.
2621 (print_object): Check for cycles even when print-circle is nil and
2622 print-gensym is t, but only check print_depth if print-circle is nil.
2623
f30d612a
CY
26242012-04-20 Chong Yidong <cyd@gnu.org>
2625
2626 * process.c (wait_reading_process_output): If EIO occurs on a pty,
2627 set the status to "failed" and ensure that sentinel is run.
2628
c07a4c0b 26292012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
2630
2631 * process.c (Fset_process_inherit_coding_system_flag)
2632 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 2633 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 2634
c07a4c0b 26352012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
2636
2637 * xdisp.c (string_buffer_position_lim): Limit starting position to
2638 BEGV.
2639 (set_cursor_from_row): If called for a mode-line or header-line
2640 row, return zero immediately.
2641 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
2642 farther than the first row after the header line, if any.
2643 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
2644 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
2645
c07a4c0b 26462012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 2647
4ae29f89
SM
2648 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
2649 (bug#11238).
ad3a2b41 2650
c07a4c0b 26512012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 26522012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
2653
2654 configure: new option --enable-gcc-warnings (Bug#11207)
2655 * Makefile.in (C_WARNINGS_SWITCH): Remove.
2656 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
2657 (ALL_CFLAGS): Use new macros rather than old.
2658 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
2659 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
2660 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
2661 -Wunused-result, -Wunused-variable. This should go away once
2662 the Emacs and Gnulib regex code is merged.
2663 (xmalloc, xrealloc): Now static.
2664
aba027e8
PE
26652012-04-17 Paul Eggert <eggert@cs.ucla.edu>
2666
2667 * dired.c (Fsystem_groups): Remove unused local.
2668
e5a36063
GM
26692012-04-17 Glenn Morris <rgm@gnu.org>
2670
2671 * dired.c (Fsystem_users): Doc fix.
2672
316411f0
DA
26732012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
2674
2675 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
2676 (syms_of_dired): Add them.
2677
9426aba4
PE
26782012-04-16 Paul Eggert <eggert@cs.ucla.edu>
2679
b62a57be
PE
2680 Fix minor alloc.c problems found by static checking.
2681 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
2682 New extern decls, to avoid calling undeclared functions.
2683 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
2684 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
2685 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
2686 (NEED_MEM_INSERT): New macro.
2687 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 2688 Remove one incorrect comment and fix another.
b62a57be 2689
3539f31f
PE
2690 Fix minor ralloc.c problems found by static checking.
2691 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2692 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
2693 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
2694 (r_alloc_sbrk): Now static.
2695
a041960a
PE
2696 Improve ralloc.c interface checking.
2697 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2698 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
2699 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
2700 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
2701 [REL_ALLOC]: ... to here, to check interface.
2702 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
2703 Remove decls. This fixes an "It stinks!".
2704
9426aba4
PE
2705 * alloc.c (which_symbols): Fix alignment issue / type clash.
2706
d55c12ed
AS
27072012-04-15 Andreas Schwab <schwab@linux-m68k.org>
2708
2709 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
2710 (struct Lisp_Misc_Any): Likewise.
2711 (struct Lisp_Free): Likewise.
2712 * alloc.c (union aligned_Lisp_Symbol): Define.
2713 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
2714 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
2715 (union aligned_Lisp_Misc): Define.
2716 (MARKER_BLOCK_SIZE, struct marker_block): Use union
2717 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 2718 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 2719
b948ce8b
PE
27202012-04-14 Paul Eggert <eggert@cs.ucla.edu>
2721
2722 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
2723 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
2724 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
2725 * s/netbsd.h, s/sol2-6.h:
2726 Remove definition of GC_MARK_STACK, since the default now works.
2727 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
2728 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
2729 no longer the default.
2730 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
2731
35dc09a1 27322012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 2733
35dc09a1
GM
2734 * lread.c (lisp_file_lexically_bound_p):
2735 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 2736
35dc09a1
GM
27372012-04-14 Eli Zaretskii <eliz@gnu.org>
2738
2739 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
2740 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
2741
27422012-04-14 Jan Djärv <jan.h.d@swipnet.se>
2743
2744 * nsterm.m (constrainFrameRect): Always constrain when there is only
2745 one screen (Bug#10962).
2746
bcd86815
KB
27472012-04-13 Ken Brown <kbrown@cornell.edu>
2748
2749 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
2750
c25df26e
RT
27512012-04-13 Reuben Thomas <rrt@sc3d.org>
2752
2753 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
2754
0fc59f1e
DC
27552012-04-11 Daniel Colascione <dancol@dancol.org>
2756
2757 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
2758 against is gone. It's better to use vfork now so that when Cygwin
2759 gains a new, working vfork, we use it automatically (bug#10398).
2760
de8c03dc
SM
27612012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2762
2763 * window.c (save_window_save): Obey window-point-insertion-type.
2764
2f097256
GM
27652012-04-11 Glenn Morris <rgm@gnu.org>
2766
2767 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
2768
453b951e
SM
27692012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2770
2771 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
2772
75f1671a 27732012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
2774
2775 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
2776 (force_quit_count): New var.
2777 (handle_interrupt): Use it.
2778
2a8ce227
JB
27792012-04-10 Juanma Barranquero <lekktu@gmail.com>
2780
2781 * w32.c (w32_delayed_load): Record the full path of the library
2782 being loaded (bug#10424).
2783
935396c0
GM
27842012-04-09 Glenn Morris <rgm@gnu.org>
2785
05920a43
GM
2786 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
2787 not just in the obarray, before snarfing them. (Bug#11036)
2788
935396c0
GM
2789 * Makefile.in ($(leimdir)/leim-list.el):
2790 Pass EMACS rather than BUILT_EMACS.
2791
a18ecafa
TZ
27922012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
2793
2794 * process.c (make_process):
2795 * process.h: Add integer `gnutls_handshakes_tried' member to
2796 process struct.
2797
6bbef4e5
JC
2798 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
2799 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
2800
2801 * gnutls.c (gnutls_log_function2i): Convenience log function.
2802 (emacs_gnutls_read): Use new log functions,
2803 `gnutls_handshakes_tried' process member, and
2804 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
2805 attempts per process (connection).
2806
b4d3bc10
CY
28072012-04-09 Chong Yidong <cyd@gnu.org>
2808
2809 * eval.c (Fuser_variable_p, user_variable_p_eh)
2810 (lisp_indirect_variable): Functions deleted.
2811 (Fdefvar): Caller changed.
2812
2813 * callint.c (Finteractive, Fcall_interactively):
2814 * minibuf.c (Fread_variable): Callers changed.
2815
70f4d973
EZ
28162012-04-09 Eli Zaretskii <eliz@gnu.org>
2817
2818 * xdisp.c (set_cursor_from_row): If the display string appears in
2819 the buffer at position that is closer to point than the position
2820 after the display string, display the cursor on the first glyph of
2821 the display string. Fixes cursor display when a 'display' text
2822 property immediately follows invisible text. (Bug#11094)
2823
cb3c2e3e
PE
28242012-04-09 Paul Eggert <eggert@cs.ucla.edu>
2825
2826 composite.c: use 'double' consistently
2827 * composite.c (get_composition_id): Use 'double' consistently
2828 instead of converting 'float' to 'double' and vice versa; this is
2829 easier to understand and avoids a GCC warning.
2830
fd06db5d
GM
28312012-04-09 Glenn Morris <rgm@gnu.org>
2832
50fe702a
GM
2833 * Makefile.in: Generate leim-list with bootstrap-emacs, in
2834 preparation for dumping it with emacs. (Bug#4789)
2835 (leimdir): New variable.
2836 ($(leimdir)/leim-list.el): New rule.
2837 (emacs$(EXEEXT)): Depend on leim-list.el.
2838
fd06db5d
GM
2839 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
2840 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
2841 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
2842
55c131ee
AS
28432012-04-08 Andreas Schwab <schwab@linux-m68k.org>
2844
2845 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
2846 proper alignment.
2847
9209588f
JB
28482012-04-07 Juanma Barranquero <lekktu@gmail.com>
2849
2850 * xml.c (init_libxml2_functions) [WINDOWSNT]:
2851 Remove unused local variable.
2852
e3fb2efb
PE
28532012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2854
2855 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
2856 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
2857 (mark_memory): Mark Lisp_Objects only if pointers might hide in
2858 objects, as mark_maybe_pointer will catch them otherwise.
2859 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
2860 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
2861
b5385551
PE
28622012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2863
2864 Fix typo that broke non-Windows builds.
2865 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
2866
9078ead6
EZ
28672012-04-07 Eli Zaretskii <eliz@gnu.org>
2868
2869 Support building on MS-Windows with libxml2.
2870
2871 * makefile.w32-in (OBJ2): Add xml.$(O).
2872 (GLOBAL_SOURCES): Add xml.c.
2873 ($(BLD)/xml.$(O)): New dependency list.
2874
2875 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
2876 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
2877 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
2878 [!WINDOWSNT]: New macros.
2879 (init_libxml2_functions, libxml2_loaded_p): New functions.
2880 (parse_region): Call fn_xmlCheckVersion instead of using the macro
2881 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
2882 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
2883 Calls xmlCleanupParser only if libxml2 was loaded (or statically
2884 linked in).
6bbef4e5
JC
2885 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
2886 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
2887 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
2888
2889 * emacs.c: Don't include libxml/parser.h.
2890 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
2891 xmlCleanupParser directly.
2892
2893 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
2894
3811fdf3
EZ
28952012-04-07 Eli Zaretskii <eliz@gnu.org>
2896
2897 * indent.c (Fvertical_motion): If there is a display string at
2898 point, use it.vpos to compute how many lines to backtrack after
2899 move_it_to point. (Bug#11133)
2900
2f8e16b2
EZ
29012012-04-06 Eli Zaretskii <eliz@gnu.org>
2902
2903 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
2904 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
2905 about subtle differences between FETCH_CHAR* and STRING_CHAR*
2906 macros related to unification of CJK characters. For the details,
2907 see the discussion following the message here:
2908 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
2909
3d439cd1
CY
29102012-04-04 Chong Yidong <cyd@gnu.org>
2911
2912 * keyboard.c (Vdelayed_warnings_list): Doc fix.
2913
8bc53d00
EZ
29142012-04-01 Eli Zaretskii <eliz@gnu.org>
2915
2916 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
2917 instead of alloca. (Bug#11138)
2918
3b0512a3
AS
29192012-04-01 Andreas Schwab <schwab@linux-m68k.org>
2920
2921 * w32menu.c (is_simple_dialog): Properly check lisp types.
2922 (Bug#11141)
2923
8427ddd2
EZ
29242012-03-31 Eli Zaretskii <eliz@gnu.org>
2925
979022ef
EZ
2926 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
2927 position we get to after a call to move_it_to fails the
2928 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
2929 only if we wind up in a string from display property. (Bug#11063)
2930
a6b1c7cc
EZ
2931 * window.c (Fdelete_other_windows_internal): Invalidate the row
2932 and column information about mouse highlight, so that redisplay
2933 restores it after reallocating the glyph matrices. (Bug#7464)
2934
8427ddd2
EZ
2935 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
2936 string comes from a `display' text property, use the buffer
2937 position of that property as if we actually saw that position in
2938 the row's glyphs.
697ba24b
EZ
2939 (move_it_by_lines): Remove the assertion that
2940 "it->current_x == 0 && it->hpos == 0" which can be legitimately
2941 violated when there's a before-string at the beginning of a line.
2942 (Bug#11063)
8427ddd2 2943
65a0a738
EZ
29442012-03-30 Eli Zaretskii <eliz@gnu.org>
2945
2946 * xdisp.c (append_space_for_newline): If the default face was
2947 remapped, use the remapped face for the appended newline.
2948 (extend_face_to_end_of_line): Use the remapped default face for
2949 extending the face to the end of the line.
2950 (display_line): Call extend_face_to_end_of_line when the default
2951 face was remapped. (Bug#11068)
2952
581355cc
EZ
29532012-03-29 Eli Zaretskii <eliz@gnu.org>
2954
2955 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
2956
e8fc049f
SM
29572012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
2958
2959 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
2960
4fb9a543
GM
29612012-03-27 Glenn Morris <rgm@gnu.org>
2962
2963 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
2964 Doc fixes.
2965
679910f1
KH
29662012-03-26 Kenichi Handa <handa@m17n.org>
2967
2968 * dispextern.h (struct glyph): Fix previous change. Change the
2969 bit length of glyphless.ch to 25 (Bug#11082).
2970
90d49b7f
CY
29712012-03-26 Chong Yidong <cyd@gnu.org>
2972
2973 * keyboard.c (Vselection_inhibit_update_commands): New variable.
2974 (command_loop_1): Use it; inhibit selection update for
2975 handle-select-window too (Bug#8996).
2976
f514f6f0
FP
29772012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
2978
e8fc049f 2979 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 2980
bf43fa51
KH
29812012-03-25 Kenichi Handa <handa@m17n.org>
2982
2983 * dispextern.h (struct glyph): Change the bit length of
2984 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
2985
8a0c01dd
EZ
29862012-03-24 Eli Zaretskii <eliz@gnu.org>
2987
2988 * s/ms-w32.h (tzname): Include time.h before redirecting to
2989 _tzname. Fixes the MSVC build. (Bug#9960)
2990
7d1c3a76
AS
29912012-03-24 Andreas Schwab <schwab@linux-m68k.org>
2992
8ed79523
AS
2993 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
2994 characters.
2995
7d1c3a76
AS
2996 * xterm.c (XTread_socket): Only modify handling_signal if
2997 !SYNC_INPUT. (Bug#11080)
2998
e99a9b8b
EZ
29992012-03-23 Eli Zaretskii <eliz@gnu.org>
3000
3001 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
3002 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
3003 when fetching a multibyte character consumes more bytes than
3004 CHAR_BYTES returns, due to unification of CJK characters in
3005 string_char. (Bug#11073)
3006
5063c0e1
TN
30072012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
3008
3009 * process.c (wait_reading_process_output): Handle pty disconnect
3010 by refraining from sending oneself a SIGCHLD (bug#10933).
3011
9f851fbd
CY
30122012-03-22 Chong Yidong <cyd@gnu.org>
3013
3014 * dispextern.h (struct it): New member string_from_prefix_prop_p.
3015
5063c0e1 3016 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
3017 Mark string as coming from a prefix property.
3018 (handle_face_prop): Use default face for prefix strings (Bug#4281).
3019 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
3020
fb5b8aca
CY
30212012-03-21 Chong Yidong <cyd@gnu.org>
3022
3023 * xfaces.c (Vface_remapping_alist): Doc fix.
3024
62356a1b
EZ
30252012-03-20 Eli Zaretskii <eliz@gnu.org>
3026
3027 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
3028 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
3029 Doc fixes.
62356a1b 3030
025de85b
CY
30312012-03-20 Chong Yidong <cyd@gnu.org>
3032
3033 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
3034 to reflect default non-nil value of redisplay-dont-pause.
3035
4827f94e
KH
30362012-03-19 Kenichi Handa <handa@m17n.org>
3037
3038 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
3039 it fit in a valid range (Bug#11003).
3040
e50a24a2
EZ
30412012-03-18 Eli Zaretskii <eliz@gnu.org>
3042
3043 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
3044 that is not from display property, accept the row as a "cursor
3045 row" if one of the string's character has a non-nil `cursor'
3046 property. Fixes cursor positioning when there are newlines in
3047 overlay strings, e.g. in icomplete.el. (Bug#11035)
3048
9af5ed87
PE
30492012-03-12 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
3052
d1f55f16
CY
30532012-03-12 Chong Yidong <cyd@gnu.org>
3054
3055 * eval.c (inhibit_lisp_code): Rename from
3056 inhibit_window_configuration_change_hook; move from window.c.
3057
3058 * xfns.c (unwind_create_frame_1, Fx_create_frame):
3059 * window.c (run_window_configuration_change_hook)
3060 (syms_of_window): Callers changed.
3061
66c5eebd
CY
30622012-03-11 Chong Yidong <cyd@gnu.org>
3063
413df973
CY
3064 * keymap.c (Fkey_description): Doc fix (Bug#9700).
3065
66c5eebd
CY
3066 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
3067
1de11f56
CY
30682012-03-10 Chong Yidong <cyd@gnu.org>
3069
3070 * frame.c (other_visible_frames): Don't assume the selected frame
3071 is visible (Bug#10955).
3072
cae07000
SM
30732012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
3074
3075 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
3076
89c94350
JD
30772012-03-08 Jan Djärv <jan.h.d@swipnet.se>
3078
3079 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
3080 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
3081 zero (Bug#10954).
3082
999dd333
GM
30832012-03-03 Glenn Morris <rgm@gnu.org>
3084
01a6dcc8 3085 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 3086
de0100f2
EZ
30872012-03-02 Eli Zaretskii <eliz@gnu.org>
3088
3089 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
3090 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
3091 (redisplay_window, next_element_from_string): Fix typos in
3092 comments.
3e441275
EZ
3093 (redisplay_window): Pass to move_it_vertically the margin in
3094 pixels, not in screen lines.
de0100f2 3095
96a72ee9
GM
30962012-03-02 Glenn Morris <rgm@gnu.org>
3097
3098 * buffer.c (buffer-list-update-hook): Doc fix.
3099
312508d7
EZ
31002012-02-29 Eli Zaretskii <eliz@gnu.org>
3101
3102 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
3103 push_it before setting up the iterator for the first overlay
3104 string, even if we have an empty string loaded.
3105 (next_overlay_string): If there's an empty string on the iterator
3106 stack, pop the stack. (Bug#10903)
3107
27f3c637
PE
31082012-02-25 Paul Eggert <eggert@cs.ucla.edu>
3109
3110 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
3111 Suggested by Stefan Monnier in
3112 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
3113 * alloc.c (widen_to_Lisp_Object): New static function.
3114 (mark_memory): Also mark Lisp_Objects by fetching pointer words
3115 and widening them to Lisp_Objects. This would work even if
3116 USE_LSB_TAG is defined and wide integers are used, which might
3117 happen in a future version of Emacs.
3118
3c9dfce6
CY
31192012-02-25 Chong Yidong <cyd@gnu.org>
3120
fa74b241
CY
3121 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
3122 Doc fix.
3123
3c9dfce6
CY
3124 * xselect.c (Fx_selection_exists_p): Doc fix.
3125 (x_clipboard_manager_save_all): Print an informative message
3126 before saving to clipboard manager.
3127
9486df08
CY
31282012-02-24 Chong Yidong <cyd@gnu.org>
3129
3130 * keyboard.c (process_special_events): Handle all X selection
3131 requests in kbd_buffer, not just the next one (Bug#8869).
3132
f01d3321
CY
31332012-02-23 Chong Yidong <cyd@gnu.org>
3134
3135 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
3136 call when setting menu-bar-lines and tool-bar-lines parameters.
3137 (unwind_create_frame_1): New helper function.
3138
3139 * window.c (inhibit_window_configuration_change_hook): New var.
3140 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 3141 (syms_of_window): Initialize it.
f01d3321 3142
86b847b6
CY
31432012-02-22 Chong Yidong <cyd@gnu.org>
3144
3145 * xterm.c (x_draw_image_relief): Add missing type check for
3146 Vtool_bar_button_margin (Bug#10743).
3147
a59225b1
CY
31482012-02-21 Chong Yidong <cyd@gnu.org>
3149
3150 * fileio.c (Vfile_name_handler_alist): Doc fix.
3151
3152 * buffer.c (Fget_file_buffer): Protect against invalid file
3153 handler return value.
3154
310f5bd4
PE
31552012-02-20 Paul Eggert <eggert@cs.ucla.edu>
3156
cb3a28cc
PE
3157 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
3158 when computing $valmask.
3159
310f5bd4
PE
3160 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
3161 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
3162 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
3163 It's useless in that case, and it can cause problems on hosts
3164 that allocate halves of EMACS_INT values separately.
3165 Reported by Dan Horák. Diagnosed by Andreas Schwab in
3166 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
3167 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
3168 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
3169 it avoids undefined behavior on hosts where shifting right by more
3170 than the word width has undefined behavior.
3171
2375c96a
CY
31722012-02-19 Chong Yidong <cyd@gnu.org>
3173
3174 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
3175 (Funhandled_file_name_directory, Ffile_name_as_directory)
3176 (Fdirectory_file_name, Fexpand_file_name)
3177 (Fsubstitute_in_file_name): Protect against invalid file handler
3178 return values (Bug#10845).
3179
3eb49e71
EZ
31802012-02-18 Eli Zaretskii <eliz@gnu.org>
3181
3182 * .gdbinit (pitx): Fix incorrect references to fields of the
3183 iterator stack.
3184
7b926f3f
CY
31852012-02-17 Chong Yidong <cyd@gnu.org>
3186
3187 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
3188
11273115
PE
31892012-02-15 Paul Eggert <eggert@cs.ucla.edu>
3190
3191 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
3192 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
3193
c3a70e2b
CY
31942012-02-15 Chong Yidong <cyd@gnu.org>
3195
3196 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
3197 marked as special. Also, starting docstrings with * is obsolete.
3198
0ca43699
AS
31992012-02-13 Andreas Schwab <schwab@linux-m68k.org>
3200
3201 * gnutls.c (emacs_gnutls_write): Fix last change.
3202
2e8f3c56
LI
32032012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
3204
3205 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
3206 send_process.
3207
af70074f
SM
32082012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
3209
3210 * keymap.c (Fsingle_key_description): Handle char ranges.
3211
95986d52
CY
32122012-02-12 Chong Yidong <cyd@gnu.org>
3213
afd83bd1
CY
3214 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
3215 as that creates a dangerous corner case.
3216
95986d52
CY
3217 * window.c (Fdelete_window_internal): Invalidate the mouse
3218 highlight (Bug#9904).
3219
bd7da63e
GM
32202012-02-12 Glenn Morris <rgm@gnu.org>
3221
3222 * xselect.c (Fx_own_selection_internal)
3223 (Fx_get_selection_internal, Fx_disown_selection_internal)
3224 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
3225 * nsselect.m (Fx_own_selection_internal)
3226 (Fx_disown_selection_internal, Fx_selection_exists_p)
3227 (Fx_selection_owner_p, Fx_get_selection_internal):
3228 Sync docs and argument specs with the xselect.c versions.
3229
77abcbc2
LI
32302012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
3231
3232 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
3233
90b671e2
EZ
32342012-02-11 Eli Zaretskii <eliz@gnu.org>
3235
1c0ca0b7
EZ
3236 * w32select.c (Fx_selection_exists_p): Sync doc string and
3237 argument list with xselect.c. (Bug#10783)
3238
3239 * w16select.c (Fx_selection_exists_p): Sync doc string and
3240 argument list with xselect.c. (Bug#10783)
90b671e2 3241
49241268
GM
32422012-02-10 Glenn Morris <rgm@gnu.org>
3243
3244 * fns.c (Fsecure_hash): Doc fix.
3245
f998bbe7 32462012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
3247
3248 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
3249
0992bd9c
CY
32502012-02-07 Chong Yidong <cyd@gnu.org>
3251
3252 * buffer.c (Fbuffer_local_variables)
3253 (buffer_lisp_local_variables): Handle unbound vars correctly;
3254 don't let Qunbound leak into Lisp.
3255
af008560
GM
32562012-02-07 Glenn Morris <rgm@gnu.org>
3257
dd605cc4
GM
3258 * image.c (Fimagemagick_types): Doc fix.
3259
af008560
GM
3260 * image.c (imagemagick-render-type): Change it from a lisp object
3261 to an integer. Move the doc here from the lisp manual.
3262 Treat all values not equal to 0 the same.
3263
1449fa1d
CY
32642012-02-06 Chong Yidong <cyd@gnu.org>
3265
3266 * doc.c (store_function_docstring): Avoid applying docstring of
3267 alias to base function (Bug#2603).
3268
3723ec07
AS
32692012-02-04 Andreas Schwab <schwab@linux-m68k.org>
3270
3271 * .gdbinit (pp1, pv1): Remove redundant defines.
3272 (pr): Use pp.
3273
79c1cc1e
CY
32742012-02-04 Chong Yidong <cyd@gnu.org>
3275
3276 * nsterm.m: Declare a global (Bug#10694).
3277
d7f29f8e
EZ
32782012-02-04 Eli Zaretskii <eliz@gnu.org>
3279
cae07000
SM
3280 * w32.c (get_emacs_configuration_options):
3281 Include --enable-checking, if specified, in the return value.
d7f29f8e 3282
3b95a6f9
MR
32832012-02-04 Martin Rudalics <rudalics@gmx.at>
3284
3285 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
3286 after rounding frame sizes. (Bug#9723)
3287
d6fa96a6
EZ
32882012-02-04 Eli Zaretskii <eliz@gnu.org>
3289
3290 * keyboard.c (adjust_point_for_property): Don't position point
3291 before BEGV. (Bug#10696)
3292
df0b2940
PE
32932012-02-03 Paul Eggert <eggert@cs.ucla.edu>
3294
3295 Handle overflow when computing char display width (Bug#9496).
3296 * character.c (char_width): Return EMACS_INT, not int.
3297 (char_width, c_string_width): Check for overflow when
3298 computing the width; this is possible now that individual
3299 characters can have unbounded width. Problem introduced
3300 by merge from Emacs 23 on 2012-01-19.
3301
6bee44d6
MA
33022012-02-02 Michael Albinus <michael.albinus@gmx.de>
3303
3304 * dbusbind.c (Fdbus_register_method): Mention the return value
3305 :ignore in the docstring.
3306
44f92739
GM
33072012-02-02 Glenn Morris <rgm@gnu.org>
3308
1b9f60cc
GM
3309 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
3310
44f92739
GM
3311 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3312 Unconditionally set to t. (Bug#10673)
3313 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3314 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3315 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
3316
c5d3843c
KH
33172012-02-02 Kenichi Handa <handa@m17n.org>
3318
3319 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
3320 0, do not call append_composite_glyph.
3321
159462d4 33222012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
3323
3324 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
3325 NULL (Bug#6988).
3326 (x_produce_glyphs): If the component of a composition is a null
3327 string, set it->pixel_width to 1 to avoid zero-width glyph.
3328
78cef877
EZ
33292012-02-01 Eli Zaretskii <eliz@gnu.org>
3330
3331 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
3332 first 2 arguments are identical. This makes inserting large
3333 output from a subprocess an order of magnitude faster on
3334 MS-Windows, where all sbrk'ed memory is always contiguous.
3335
97897668
GM
33362012-01-31 Glenn Morris <rgm@gnu.org>
3337
3338 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 3339 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
3340 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
3341
31fd3586
GM
33422012-01-29 Glenn Morris <rgm@gnu.org>
3343
3344 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
3345
0e24a8b2
CY
33462012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
3347
3348 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
3349
cc0adcb0
CY
33502012-01-28 Chong Yidong <cyd@gnu.org>
3351
3352 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
3353
acc28cb9
CY
33542012-01-26 Chong Yidong <cyd@gnu.org>
3355
9c69cfb7
CY
3356 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
3357
acc28cb9
CY
3358 * search.c (Fsearch_forward, Fsearch_backward): Document negative
3359 repeat counts (Bug#10507).
3360
48da7392
GM
33612012-01-26 Glenn Morris <rgm@gnu.org>
3362
3363 * lread.c (syms_of_lread): Doc fix.
3364
14af5f7f
CY
33652012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
3366
3367 * coding.c (encode_designation_at_bol): Change return value to
3368 EMACS_INT.
3369
0b21c100
CY
33702012-01-25 Chong Yidong <cyd@gnu.org>
3371
3372 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
3373
3c2907f7
CY
33742012-01-21 Chong Yidong <cyd@gnu.org>
3375
3376 * floatfns.c (Fcopysign): Make the second argument non-optional,
3377 since nil is not allowed anyway.
3378
959ad23f
AS
33792012-01-21 Andreas Schwab <schwab@linux-m68k.org>
3380
3381 * process.c (read_process_output): Use p instead of XPROCESS (proc).
3382 (send_process): Likewise.
3383
34a02f46
MR
33842012-01-19 Martin Rudalics <rudalics@gmx.at>
3385
3386 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
3387 (Vwindow_persistent_parameters): Do not use Qstate.
3388 Rewrite doc-strings.
34a02f46 3389
1259009a 33902012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
3391
3392 * character.c (char_width): New function.
70d4fdf6
GM
3393 (Fchar_width, c_string_width, lisp_string_width):
3394 Use char_width (Bug#9496).
25ed9e61 3395
6a6ee00d
MR
33962012-01-16 Martin Rudalics <rudalics@gmx.at>
3397
3398 * window.c (Vwindow_persistent_parameters): New variable.
3399 (Fset_window_configuration, save_window_save): Handle persistent
3400 window parameters.
3401
c85efaf7
EZ
34022012-01-14 Eli Zaretskii <eliz@gnu.org>
3403
3404 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
3405 thrashing the stack of the thread. (Bug#9087)
3406
5944709e
PE
34072012-01-12 Paul Eggert <eggert@cs.ucla.edu>
3408
3409 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
3410
e71f5d99
EZ
34112012-01-11 Eli Zaretskii <eliz@gnu.org>
3412
3413 * xdisp.c (rows_from_pos_range): Handle the case where the
3414 highlight ends on a newline. (Bug#10464)
3415 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
3416 he end column for display of highlight that ends on a newline
3417 before a R2L line.
3418
ce316182
GM
34192012-01-11 Glenn Morris <rgm@gnu.org>
3420
3421 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
3422 from load-path also when installation-directory is nil. (Bug#10208)
3423
5b43da69
GM
34242012-01-10 Glenn Morris <rgm@gnu.org>
3425
74cc8ff9
GM
3426 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
3427
7d8d6e4e
GM
3428 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
3429 Update template values to be closer to their typical values these days.
5b43da69 3430
a0db8d43
EZ
34312012-01-09 Eli Zaretskii <eliz@gnu.org>
3432
3433 * xdisp.c (rows_from_pos_range): Accept additional argument
3434 DISP_STRING, and accept any glyph in a row whose object is that
3435 string as eligible for mouse highlight. Fixes mouse highlight of
3436 display strings from overlays. (Bug#10464)
3437
9a0115ab 34382012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 3439
b9110d6a 3440 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
3441 * fileio.c (auto_saving_dir_umask): New static var.
3442 (Fmake_directory_internal): Use it.
3443 (do_auto_save_make_dir): Set it, instead of invoking chmod after
3444 creating the directory. The old code temporarily assigns
3445 too-generous permissions to the directory.
3446 (do_auto_save_eh): Clear it.
b9110d6a 3447 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
3448 that the var is always cleared.
3449
6c1bd3f3
EZ
34502012-01-07 Eli Zaretskii <eliz@gnu.org>
3451
3452 * search.c (scan_buffer): Pass character positions to
3453 know_region_cache, not byte positions. (Bug#6540)
3454
069d2b50
L
34552012-01-07 LynX <_LynX@bk.ru> (tiny change)
3456
3457 * w32.c (sys_rename): Report EXDEV when rename of a directory
3458 fails because the target is on another logical disk. (Bug#10284)
3459
75bf0d33
DB
34602012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
3461
3462 * xterm.c (x_embed_request_focus): New function.
3463
3464 * xterm.h: Add prototype.
3465
3466 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
3467
1c6e5a32
GM
34682012-01-05 Glenn Morris <rgm@gnu.org>
3469
3470 * emacs.c (emacs_copyright): Update short copyright year to 2012.
3471
651e947e
EZ
34722012-01-01 Eli Zaretskii <eliz@gnu.org>
3473
3474 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
3475 Load gnutls_transport_set_lowat only if GnuTLS version is below
3476 2.11.1.
3477 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
3478 GnuTLS versions below 2.11.1.
3479
3778cdd8
AL
34802011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
3481
3482 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
3483 to the doc string advising against its use for altering the way
3484 windows are scrolled.
3485
0e5317f7
KH
34862011-12-28 Kenichi Handa <handa@m17n.org>
3487
3488 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
3489 coding-system ASCII compatible only when it does not produce BOM
3490 on encoding (Bug#10383).
3491
93d5ca1f
JD
34922011-12-26 Jan Djärv <jan.h.d@swipnet.se>
3493
3494 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
3495 can scroll.
3496 (create_and_show_popup_menu): Always use menu_position_func for
3497 Gtk3 (Bug#10361).
3498
ca22b785
AS
34992011-12-24 Andreas Schwab <schwab@linux-m68k.org>
3500
3501 * callint.c (Fcall_interactively): Don't truncate prompt string.
3502
d048e1e6
EZ
35032011-12-23 Eli Zaretskii <eliz@gnu.org>
3504
3505 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
3506 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 3507 resumed from there (after widening). (Bug#10360)
d048e1e6 3508
5ccaba1f
JD
35092011-12-22 Jan Djärv <jan.h.d@swipnet.se>
3510
3511 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
3512
204ee57f
JD
35132011-12-21 Jan Djärv <jan.h.d@swipnet.se>
3514
b81d40f0
JB
3515 * nsterm.m (x_free_frame_resources):
3516 Release f->output_data.ns->miniimage.
204ee57f
JD
3517 (ns_index_color): Fix indentation. Do not retain
3518 color_table->colors[i].
3519
3520 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
3521 before returning.
3522
3523 * nsfns.m (x_set_background_color): Assign return value from
3524 ns_index_color to face-background instead of NSColor*.
3525 (ns_implicitly_set_icon_type): Fix indentation.
3526 Change assignment in for loop to comparison.
3527
3528 * emacs.c (ns_pool): New variable.
3529 (main): Assign ns_pool.
3530 (Fkill_emacs): Call ns_release_autorelease_pool.
3531
3532 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
3533 autorelease fdesc, release fdAttrs and tdict.
3534 (ns_get_covering_families): Release charset.
3535 (ns_findfonts): Release NSFontDescriptor created with new.
3536 (ns_uni_to_glyphs): Fix indentation.
3537 (setString): Release attrStr before assigning new value.
3538
c803b2b7
JD
35392011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3540
678f4426
JD
3541 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
3542 and NS_IMPL_COCOA.
3543 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
3544 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
3545
cd394be1 35462011-12-18 David Reitter <reitter@cmu.edu>
678f4426 3547
5fecd5fc
JD
3548 * nsterm.m (ns_term_init): Subscribe for notifications
3549 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
3550 to method trackingNotification in EmacsMenu.
3551
3552 * nsmenu.m (trackingMenu): New variable.
3771cb17 3553 (trackingNotification): New method (from Aquamacs).
5fecd5fc 3554 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 3555 from Aquamacs (Bug#7030).
678f4426
JD
3556
35572011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 3558
c803b2b7
JD
3559 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
3560 (symbol_to_nsstring): Fix indentation.
3561 (ns_symbol_to_pb): New function.
cae07000
SM
3562 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
3563 (Fns_rotate_cut_buffers_internal): Remove.
3564 (Fns_store_selection_internal): Rename from
c803b2b7
JD
3565 Fns_store_cut_buffer_internal.
3566 (ns_get_foreign_selection, Fx_own_selection_internal)
3567 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
3568 (Fns_get_selection_internal, Fns_store_selection_internal):
3569 Use ns_symbol_to_pb and check if return value is nil.
3570 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
3571 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
3572 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
3573 renamed to Sns_store_selection_internal.
3574 (ns_handle_selection_request): Move code to Fx_own_selection_internal
3575 and remove this function.
3576 (ns_handle_selection_clear): Remove, never used.
3577 (Fx_own_selection_internal): Move code from ns_handle_selection_request
3578 here.
3579
e1b01a3a
KB
35802011-12-17 Ken Brown <kbrown@cornell.edu>
3581
3582 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
3583 GID is unknown (Bug#10257).
3584
2adb6e85
PE
35852011-12-17 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
3588 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
3589 which caused a build failure on GNU/Linux IA-64. This problem was
3590 introduced by my 2011-10-07 patch.
3591
d1d7b339
JL
35922011-12-15 Juri Linkov <juri@jurta.org>
3593
3594 * image.c (imagemagick_error): New function. (Bug#10112)
3595 (imagemagick_load_image): Comment out `MagickSetResolution' call.
3596 Use `imagemagick_error' where ImageMagick functions return
3597 `MagickFalse'.
3598 (Fimagemagick_types): Add `Fnreverse' to return the list in the
3599 proper order.
3600
100d5755
KH
36012011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3602
3603 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
3604 fill background (Bug#8992).
3605
454592a6
MR
36062011-12-13 Martin Rudalics <rudalics@gmx.at>
3607
3608 * window.c (Vwindow_combination_resize)
3609 (Vwindow_combination_limit): Use t instead of non-nil in
3610 doc-strings.
61d4b438
MR
3611 (Vrecenter_redisplay): Add first sentence of doc-string on
3612 separate line.
53524d93 3613 (Frecenter): Fix doc-string typo.
454592a6 3614
3633e3aa
KH
36152011-12-11 Kenichi Handa <handa@m17n.org>
3616
3617 * coding.c (Funencodable_char_position): Pay attention to the
3618 buffer text relocation (Bug#9389).
3619
7b9d523a 36202011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 3621
7b9d523a
JD
3622 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
3623 gtk_init (Bug#10100).
3624
b73189c6
EZ
36252011-12-10 Eli Zaretskii <eliz@gnu.org>
3626
3627 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
3628 IT->string is nil. (Bug#10263)
3629
f7dfe5d6
JD
36302011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3631
83faebb4
JD
3632 * nsterm.h (x_free_frame_resources): Declare.
3633
f7dfe5d6
JD
3634 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
3635 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
3636
3637 * nsterm.h (ns_get_defaults_value): Declare.
3638
3639 * nsterm.m (ns_default): Call ns_get_defaults_value.
3640
7cd4e72c
EZ
36412011-12-09 Eli Zaretskii <eliz@gnu.org>
3642
3643 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
3644 (Bug#10170)
3645
b34d7317
YM
36462011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3647
3648 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
3649 that where the value of an _OBJC_* symbol points to is in the .bss
3650 section (Bug#10240).
3651
76470ad1
KH
36522011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3653
3654 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 3655 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 3656
745fff94
KH
36572011-12-08 Kenichi Handa <handa@m17n.org>
3658
3659 * ftfont.c (get_adstyle_property): Fix previous change
3660 (Bug#10233).
3661
6e44397c
JB
36622011-12-07 Juanma Barranquero <lekktu@gmail.com>
3663
3664 * w32.c (init_environment): If no_site_lisp, remove site-lisp
3665 dirs from the default value of EMACSLOADPATH (bug#10208).
3666
7efa6272
GM
36672011-12-07 Glenn Morris <rgm@gnu.org>
3668
3669 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
3670 installation and source directories as well. (Bug#10208)
3671
f6fc4d87
CY
36722011-12-06 Chong Yidong <cyd@gnu.org>
3673
3674 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
3675
2bf26180
GM
36762011-12-06 Glenn Morris <rgm@gnu.org>
3677
3678 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
3679 as an error, not just -1. (Bug#10217)
3680
3a6ad4f0
CY
36812011-12-05 Chong Yidong <cyd@gnu.org>
3682
3683 * keyboard.c (process_special_events): New function.
3684 (swallow_events, Finput_pending_p): Use it (Bug#10195).
3685
75a3b399
PE
36862011-12-05 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 * coding.c (encode_designation_at_bol): Don't use uninitialized
3689 local variable (Bug#9318).
3690
c3c9e25e
KH
36912011-12-05 Kenichi Handa <handa@m17n.org>
3692
3693 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
3694 return Qnil (Bug#8046, Bug#10193).
3695
5eb05ea3
KH
36962011-12-05 Kenichi Handa <handa@m17n.org>
3697
3698 * coding.c (encode_designation_at_bol): New args charbuf_end and
3699 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
3700 (coding_set_source): Return how many bytes coding->source was
3701 relocated.
3702 (coding_set_destination): Return how many bytes
3703 coding->destination was relocated.
3704 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 3705 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
3706
37072011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3708
3709 * coding.c (CODING_CHAR_CHARSET_P): New macro.
3710 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
3711 macro (Bug#9318).
3712
37132011-12-05 Andreas Schwab <schwab@linux-m68k.org>
3714
3715 The following changes are to fix Bug#9318.
3716
a79703f5 3717 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
3718 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
3719 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 3720 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 3721
7dbda6df
JB
37222011-12-05 Juanma Barranquero <lekktu@gmail.com>
3723
3724 * lisp.h (process_quit_flag): Fix external declaration.
3725
6d5eb5b0
SM
37262011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
3727
3728 Don't macro-inline non-performance-critical code.
3729 * eval.c (process_quit_flag): New function.
3730 * lisp.h (QUIT): Use it.
3731
a0c3fad0
JD
37322011-12-04 Jan Djärv <jan.h.d@swipnet.se>
3733
3734 * nsfns.m (get_geometry_from_preferences): New function.
3735 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
3736
6c07aac2
AS
37372011-12-04 Andreas Schwab <schwab@linux-m68k.org>
3738
3739 * emacs.c (Qkill_emacs): Define.
3740 (syms_of_emacs): Initialize it.
3741 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
3742 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
3743 (quit_throw_to_read_char): Add parameter `from_signal'.
3744 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
3745 * lisp.h (QUIT): Call Fkill_emacs if requested.
3746
c052ead4
JD
37472011-12-03 Jan Djärv <jan.h.d@swipnet.se>
3748
3749 * widget.c (update_wm_hints): Return if wmshell is null.
3750 (widget_update_wm_size_hints): New function.
3751
3752 * widget.h (widget_update_wm_size_hints): Declare.
3753
3754 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
3755 widget_update_wm_size_hints (Bug#10104).
3756
9e49252b
EZ
37572011-12-03 Eli Zaretskii <eliz@gnu.org>
3758
3759 * xdisp.c (handle_invisible_prop): If the invisible text ends just
3760 before a newline, prepare the bidi iterator for consuming the
3761 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 3762 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 3763
02b16839
JL
37642011-12-02 Juri Linkov <juri@jurta.org>
3765
3766 * search.c (Fword_search_regexp): New Lisp function created from
3767 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
3768 (Fword_search_backward, Fword_search_forward)
3769 (Fword_search_backward_lax, Fword_search_forward_lax):
3770 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
3771 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
3772
0068070e
SM
37732011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
3774
3775 * fileio.c (Finsert_file_contents): Move after-change-function call
3776 to before the "handled:" label, since all "goto handled" appear in
3777 cases where the *-change-functions have already been properly called
3778 (bug#10117).
3779
3360a3fc
AS
37802011-12-01 Andreas Schwab <schwab@linux-m68k.org>
3781
3782 * keyboard.c (interrupt_signal): Don't call kill-emacs when
3783 waiting for input. (Bug#10169)
3784
73d6c093
EZ
37852011-11-30 Eli Zaretskii <eliz@gnu.org>
3786
3787 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
3788 verifies glyph row's hash code--we have just reallocated the
3789 glyphs, so their contents can be complete garbage. (Bug#10164)
3790
febe6bea
JB
37912011-11-30 Juanma Barranquero <lekktu@gmail.com>
3792
3793 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
3794
801a4313
EZ
37952011-11-30 Eli Zaretskii <eliz@gnu.org>
3796
3797 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
3798 attributes are tested _before_ calling verify_row_hash, to protect
3799 against GCC re-ordering of the tests. (Bug#10164)
3800
2b56b87e
JD
38012011-11-29 Jan Djärv <jan.h.d@swipnet.se>
3802
3803 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
3804
3805 * xterm.c (handle_one_xevent): Only set async_visible and friends
3806 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 3807 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
3808 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
3809
dbf31225
PE
38102011-11-28 Paul Eggert <eggert@cs.ucla.edu>
3811
3812 Remove GCPRO-related macros that exist only to avoid shadowing locals.
3813 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
3814 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
3815 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3816 All uses changed to use GCPRO1 etc.
3817 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
3818 Revert to old implementation (i.e., before 2011-03-11).
3819
1305621b
YM
38202011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3821
3822 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
3823 of scroll runs so as to avoid assigning disabled bogus rows and
3824 unnecessary graphics copy operations.
3825
8c9afb46
EZ
38262011-11-27 Eli Zaretskii <eliz@gnu.org>
3827
3828 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
3829 (snprintf) [_MSC_VER]: Redirect to _snprintf.
3830 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
3831 (malloc, free, realloc, calloc): Redirect to e_* only when
3832 compiling Emacs.
3833
3834 * lisp.h (GCTYPEBITS): Move before first use.
3835 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
3836 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
3837 this macro definition.
3838
3839 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
3840 _MSC_VER.
3841
54e9e3bf
JD
38422011-11-27 Jan Djärv <jan.h.d@swipnet.se>
3843
6d5eb5b0
SM
3844 * gtkutil.c (xg_create_frame_widgets):
3845 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
3846 present with Gtk+ 2.0.
3847
83aca1cb
PE
38482011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3849
3850 * fileio.c (Finsert_file_contents): Undo previous change; see
3851 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3852
5b76caa4
PE
38532011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3854
3855 Rename locals to avoid shadowing.
3856 * fileio.c (Finsert_file_contents):
3857 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
3858 * process.c (wait_reading_process_output):
3859 Rename inner 'proc' to 'p' to avoid shadowing.
3860 Indent for consistency with usual Emacs style.
3861
8c535114
EZ
38622011-11-25 Eli Zaretskii <eliz@gnu.org>
3863
3864 * xdisp.c (redisplay_window): If cursor row is not fully visible
3865 after recentering, and scroll-conservatively is set to a large
3866 number, scroll window by a few more lines to make the cursor fully
3867 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
3868 (start_display): Don't move to the next line if the display should
3869 start at a newline that is part of a display vector or an overlay
3870 string. (Bug#10119)
8c535114 3871
fa4fdb5c
JL
38722011-11-24 Juri Linkov <juri@jurta.org>
3873
3874 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
3875 after the `MagickPingImage' call. (Bug#10112)
3876
90ec88df
CY
38772011-11-23 Chong Yidong <cyd@gnu.org>
3878
3879 * window.c (Fcoordinates_in_window_p): Accept only live windows.
3880
56e2e794
MR
38812011-11-23 Martin Rudalics <rudalics@gmx.at>
3882
3883 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
3884 making another buffer current. (Bug#10114)
3885
b6e64c41
GM
38862011-11-23 Glenn Morris <rgm@gnu.org>
3887
3888 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
3889
6b21de18
CY
38902011-11-23 Chong Yidong <cyd@gnu.org>
3891
3892 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
3893 using it (Bug#5984).
3894
b12cd789
EZ
38952011-11-22 Eli Zaretskii <eliz@gnu.org>
3896
3897 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
3898 and header-lines, as they don't have one computed for them.
3899 (Bug#10098)
3900
3901 * .gdbinit (prow): Make displayed values more self-explaining.
3902 Add row's hash code.
3903
261b6fd4
LMI
39042011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
3905
3906 * process.c (wait_reading_process_output): Fix asynchrounous
3907 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 3908 (wait_reading_process_output): Add comment and URL.
261b6fd4 3909
e7cfd277
JD
39102011-11-21 Jan Djärv <jan.h.d@swipnet.se>
3911
3912 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
3913
a9b9b7f5
CY
39142011-11-21 Chong Yidong <cyd@gnu.org>
3915
3916 * window.c (Fnext_window, Fprevious_window): Doc fix.
3917
b0d15b4f
SM
39182011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3919
3920 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
3921
fe7a3057
JB
39222011-11-20 Juanma Barranquero <lekktu@gmail.com>
3923
3924 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
3925
d2999b1a
MR
39262011-11-20 Martin Rudalics <rudalics@gmx.at>
3927
3928 * window.c (Fset_window_combination_limit): Rename argument
3929 STATUS to LIMIT.
3930 (Vwindow_combination_limit): Remove "status" from doc-string.
3931
d5ff9cd0
AS
39322011-11-20 Andreas Schwab <schwab@linux-m68k.org>
3933
3934 * m/ibms390.h: Remove.
3935 * m/ibms390x.h: Don't include "ibms390.h".
3936
a5bb9bd3
SM
39372011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3938
3939 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
3940 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
3941
cd1181db
JB
39422011-11-20 Juanma Barranquero <lekktu@gmail.com>
3943
3944 * casetab.c (Fset_case_table):
3945 * charset.c (Fcharset_after): Fix typos.
3946
615a3b8d 39472011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 3948
17e845af
PE
3949 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
3950 Otherwise, valgrind does not work on some platforms.
3951 Problem reported by Andreas Schwab in
6a0bf43d
PE
3952 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
3953 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
3954 is set, removing the need for VIRT_ADDRESS_VARIES.
3955 (PURE_P): Use a more-efficient implementation that needs just one
3956 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
3957 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
3958 to 4 (xorl, subq, cmpq, setbe).
3959 * alloc.c (pure): Always extern now, since that's the
3960 VIRT_ADDR_VARIES behavior.
3961 (PURE_POINTER_P): Use a single comparison, not two, for
3962 consistency with the new puresize.h.
3963 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
3964 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
3965 Remove VIRT_ADDR_VARIES no longer needed.
3966
f8fe6f96
EZ
39672011-11-19 Eli Zaretskii <eliz@gnu.org>
3968
3969 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
3970 (erase_phys_cursor, update_window_cursor, show_mouse_face)
3971 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
3972 behave as if the cursor position were at the window margin.
3973
3974 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
3975 and the cursor position is out of bounds, behave as if the cursor
3976 position were at the window margin. (Bug#10075)
3977
df05a53c
CY
39782011-11-18 Chong Yidong <cyd@gnu.org>
3979
3980 * window.c (Fwindow_combination_limit): Make first argument
3981 non-optional, since it is meaningless for live windows like the
3982 selected window.
61ccba97 3983
2071918e
DA
39842011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
3985
3986 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
3987
b50a28de
SM
39882011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
3989
3990 * intervals.c: Fix grafting over the whole buffer (bug#10071).
3991 (graft_intervals_into_buffer): Simplify.
3992
015137db
EZ
39932011-11-18 Eli Zaretskii <eliz@gnu.org>
3994
3995 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
3996 hash values of the two rows.
3997 (copy_row_except_pointers): Preserve the used[] arrays and the
3998 hash values of the two rows. (Bug#10035)
68c95424 3999 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
4000
4001 * xdisp.c (row_hash): New function, body extracted from
4002 compute_line_metrics.
4003 (compute_line_metrics): Call row_hash, instead of computing the
4004 hash code inline.
4005
4006 * dispnew.c (verify_row_hash): Call row_hash for computing the
4007 hash code of a row, instead of duplicating code from xdisp.c.
4008
4009 * dispextern.h (row_hash): Add prototype.
4010
a2addb04
TH
40112011-11-18 Tassilo Horn <tassilo@member.fsf.org>
4012
4013 * frame.c (delete_frame): Don't delete the terminal when the last
4014 X frame is closed if emacs is built with GTK toolkit.
4015
df85d315
JB
40162011-11-17 Juanma Barranquero <lekktu@gmail.com>
4017
4018 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
4019
a0c2d0ae
MR
40202011-11-17 Martin Rudalics <rudalics@gmx.at>
4021
4022 * window.c (Vwindow_splits): Rename to
4023 Vwindow_combination_resize. Suggested by Juri Linkov.
4024 (Fsplit_window_internal): Use Vwindow_combination_resize instead
4025 of Vwindow_splits.
4026
58179cce
JB
40272011-11-16 Juanma Barranquero <lekktu@gmail.com>
4028
7877f373
JB
4029 * nsfns.m (Fns_font_name):
4030 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 4031
b6f67890
MR
40322011-11-16 Martin Rudalics <rudalics@gmx.at>
4033
4034 * window.h (window): Rename slot "nest" to "combination_limit".
4035 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
4036 (Fset_window_nest): Rename to Fset_window_combination_limit.
4037 (Vwindow_nest): Rename to Vwindow_combination_limit.
4038 (recombine_windows, make_parent_window, make_window)
4039 (Fsplit_window_internal, saved_window)
4040 (Fset_window_configuration, save_window_save): Rename all
4041 occurrences of window_nest to window_combination_limit.
4042
c7015153
JB
40432011-11-15 Juanma Barranquero <lekktu@gmail.com>
4044
4045 * image.c (imagemagick_load_image): Fix typo.
4046
322ad6ec
EZ
40472011-11-14 Eli Zaretskii <eliz@gnu.org>
4048
4049 * xdisp.c (display_line): Move the call to
4050 highlight_trailing_whitespace before the call to
4051 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
4052 faces of all the glyphs to compute ROW's hash value.
4053 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 4054
f067b8ec
JB
40552011-11-14 Juanma Barranquero <lekktu@gmail.com>
4056
4057 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
4058 just return (bug#10044).
4059
1e5b2111
EZ
40602011-11-12 Eli Zaretskii <eliz@gnu.org>
4061
7ef3cbd5
EZ
4062 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
4063 with user-defined heap size. Bump the default size of the temacs
4064 heap to 27MB, to avoid memory warning when running temacs.
4065 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
4066
1e5b2111
EZ
4067 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
4068 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
4069 (verify_row_hash) [XASSERTS]: New function.
4070 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
4071 that the hash value of glyph rows is correct.
1e5b2111 4072
89d61221
MR
40732011-11-12 Martin Rudalics <rudalics@gmx.at>
4074
4075 * window.h (window): Remove splits slot.
4076 * window.c (Fwindow_splits, Fset_window_splits): Remove.
4077 (Fdelete_other_windows_internal, make_parent_window)
4078 (make_window, Fsplit_window_internal, Fdelete_window_internal)
4079 (Fset_window_configuration, save_window_save): Don't deal with
4080 split status of windows.
4081 (saved_window): Remove splits slot.
4082 (Vwindow_splits): Rewrite doc-string.
4083
97f18cc8
JD
40842011-11-11 Jan Djärv <jan.h.d@swipnet.se>
4085
4086 * xfns.c (unwind_create_frame):
4087 * nsfns.m (unwind_create_frame):
4088 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
4089 Vframe_list (Bug#9999).
4090
22a648b4
DA
40912011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
4092
0b381c7e 4093 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 4094
659afede
KH
40952011-11-11 Kenichi Handa <handa@m17n.org>
4096
4097 * callproc.c (Fcall_process): Set the member dst_multibyte of
4098 process_coding.
4099
9ac0394b
KH
41002011-11-11 Johan Bockgård <bojohan@gnu.org>
4101
4102 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
4103 avoid a crash (bug#9496).
4104
2fbdc249
CY
41052011-11-09 Chong Yidong <cyd@gnu.org>
4106
4107 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4108 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
4109
ac6b1f81
PE
41102011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4111
4112 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
4113
09db192c
PE
41142011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4115
4116 Avoid some portability problems by eschewing 'extern inline' functions.
4117 The trivial performance wins aren't worth the portability hassles; see
4118 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
4119 et seq.
4120 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4121 (window_box_width, window_box_left, window_box_left_offset)
4122 (window_box_right, window_box_right_offset): Undo previous change,
4123 by removing the "extern"s.
4124 * intervals.c (adjust_intervals_for_insertion)
4125 (adjust_intervals_for_deletion): Undo previous change,
4126 making these static again.
4127 (offset_intervals, temp_set_point_both, temp_set_point)
4128 (copy_intervals_to_string): No longer inline.
4129 * xdisp.c (window_text_bottom_y, window_box_width)
4130 (window_box_height, window_box_left_offset)
4131 (window_box_right_offset, window_box_left, window_box_right)
4132 (window_box): No longer inline.
4133
105216ed
CY
41342011-11-08 Chong Yidong <cyd@gnu.org>
4135
4136 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
4137 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
4138 Signal an error if not a live window.
105216ed
CY
4139 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
4140 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
4141
ae9e237f
JB
41422011-11-07 Juanma Barranquero <lekktu@gmail.com>
4143
4144 * lisp.h (syms_of_abbrev): Remove declaration.
4145 Reported by CHENG Gao <chenggao@royau.me>.
4146
c7aa8333
EZ
41472011-11-07 Eli Zaretskii <eliz@gnu.org>
4148
4149 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
4150 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
4151 of temacs in GUI mode.
4152
be7f5545
MR
41532011-11-07 Martin Rudalics <rudalics@gmx.at>
4154
4155 * window.h: Declare delete_all_child_windows instead of
4156 delete_all_subwindows.
4157 * window.c (Fwindow_nest, Fset_window_nest)
4158 (Fset_window_new_total, Fset_window_new_normal)
4159 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
4160 (delete_all_subwindows): Rename to delete_all_child_windows.
4161 (Fdelete_other_windows_internal, Fset_window_configuration):
4162 Call delete_all_child_windows instead of delete_all_subwindows.
4163 * frame.c (delete_frame): Call delete_all_child_windows instead
4164 of delete_all_subwindows.
4165
ca78dc43
PE
41662011-11-07 Paul Eggert <eggert@cs.ucla.edu>
4167
4168 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
4169 This is also needed for porting to any host where GC_MARK_STACK is
4170 not GC_MAKE_GCPROS_NOOPS.
4171 (which_symbols): Use it.
4172
a0241d01
KH
41732011-11-07 Kenichi Handa <handa@m17n.org>
4174
4175 * coding.c (coding_set_destination): Check coding->src_pos only
4176 when coding->src_object is a buffer (bug#9910).
4177
4178 * process.c (send_process): Set the member src_multibyte of coding
4179 to 0 (bug#9911) when sending a unibyte text.
4180
4181 * callproc.c (Fcall_process): Set the member src_multibyte of
4182 process_coding to 0 (bug#9912).
4183
a64bfdfa 41842011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
4185
4186 * xmenu.c (cleanup_widget_value_tree): New function.
4187 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
4188 calling free_menubar_widget_value_tree directly (Bug#9830).
4189
cb41b32a
PE
41902011-11-06 Paul Eggert <eggert@cs.ucla.edu>
4191
4192 Fix some portability problems with 'inline'.
4193 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4194 (window_box_width, window_box_left, window_box_left_offset)
4195 (window_box_right, window_box_right_offset): Declare extern.
4196 Otherwise, these inline functions do not conform to C99 and
4197 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
4198 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
4199 * intervals.c (adjust_intervals_for_insertion)
4200 (adjust_intervals_for_deletion): Now extern, because otherwise the
4201 extern inline functions 'offset_intervals' couldn't refer to it.
4202 (static_offset_intervals): Remove.
4203 (offset_intervals): Rewrite using the old contents of
4204 static_offset_intervals. The old version didn't conform to C99
4205 because an extern inline function contained a reference to an
4206 identifier with static linkage.
4207
b7041366
AS
42082011-11-06 Andreas Schwab <schwab@linux-m68k.org>
4209
4210 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
4211 GC.
4212
88a37c4d
EZ
42132011-11-06 Eli Zaretskii <eliz@gnu.org>
4214
4215 * xdisp.c (init_iterator, reseat_to_string): Don't set the
4216 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
4217 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
4218 return Qleft_to_right.
4219
49745b39
CY
42202011-11-06 Chong Yidong <cyd@gnu.org>
4221
4222 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
4223 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
4224 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
4225 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
4226 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
4227 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
4228 (Fwindow_vscroll): Doc fix.
4229 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
4230 argument, since it makes no sense to pass a live window and for
4231 consistency with window-child.
4232
1f05cd82
CS
42332011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
4234
4235 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
4236 support MSVC.
4237
22610910
JR
42382011-11-05 Jason Rumney <jasonr@gnu.org>
4239
4240 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
4241 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
4242 fonts (Bug#6029).
4243 (add_font_entity_to_list): Fix logic errors in mixed boolean and
4244 bitwise arithmetic preventing use of unicode-sip and non-truetype
4245 opentype fonts.
4246
a06776b2
EZ
42472011-11-05 Eli Zaretskii <eliz@gnu.org>
4248
3ad924ba
EZ
4249 * s/ms-w32.h (fstat, stat, utime): Move redirections to
4250 "emacs"-only part.
4251
a06776b2
EZ
4252 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
4253 initialization code to keep similarity to xfns.c after changes
4254 from 2011-11-05.
4255
c9e7db78
JD
42562011-11-05 Jan Djärv <jan.h.d@swipnet.se>
4257
a97f8f3f
JD
4258 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
4259 (unwind_create_frame): New function (Bug#9943).
4260 (Fx_create_frame): Restructure code to be more similar to the one in
4261 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
4262 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
4263 Move terminal->reference_count++ just before making the frame official
4264 (Bug#9943).
4265
4266 * nsterm.m (x_free_frame_resources): New function.
4267 (x_destroy_window): Move code to x_free_frame_resources.
4268
c9e7db78 4269 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
4270 (Fx_create_frame, x_create_tip_frame):
4271 Move terminal->reference_count++ just before making the frame
75f1671a 4272 official. Move initialization of image_cache_refcount and
c9e7db78
JD
4273 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
4274
a6fc3b5c
EZ
42752011-11-05 Eli Zaretskii <eliz@gnu.org>
4276
4277 Support MSVC build with newer versions of Visual Studio.
4278 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
4279 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
4280 nt/gmake.defs.
4281
4282 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
4283 which are not supported by MSVC.
4284 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
4285 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
4286 bitfields.
4287 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
4288 types in bitfields.
4289 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
4290
4291 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
4292
58179cce 42932011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
4294
4295 Support MSVC build with newer versions of Visual Studio.
4296 * w32.c: Don't include w32api.h for MSVC.
4297 (init_environment) [_MSC_VER]: Call sys_access, not _access.
4298
4299 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
4300 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
4301 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
4302 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
4303 e_* cousins.
4304 (alloca) [_MSC_VER]: Define to _alloca.
4305
4306 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
4307
4308 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
4309
a58c13ed
EZ
43102011-11-04 Eli Zaretskii <eliz@gnu.org>
4311
4312 * xdisp.c (note_mouse_highlight): If either of
4313 previous/next-single-property-change returns nil, treat that as
4314 the beginning or the end of the buffer. (Bug#9955)
4315
fe0b6370
JD
43162011-11-04 Jan Djärv <jan.h.d@swipnet.se>
4317
a58c13ed 4318 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
4319 label is not null (Bug#9951).
4320 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
4321 may be NULL.
4322
89bd5ee1
EZ
43232011-11-04 Eli Zaretskii <eliz@gnu.org>
4324
4325 * window.c (Fwindow_body_size): Mention in the doc string that the
4326 return value is in frame's canonical units. (Bug#9949)
4327
84c3edb9
EZ
43282011-11-03 Eli Zaretskii <eliz@gnu.org>
4329
4e2fb5c7
EZ
4330 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
4331
84c3edb9 4332 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 4333 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 4334 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 4335
bc17a887
EZ
43362011-11-01 Eli Zaretskii <eliz@gnu.org>
4337
4338 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
4339 Don't stop backward scan on the continuation glyph, even though
4340 its CHARPOS is positive.
6d5eb5b0
SM
4341 (mouse_face_from_buffer_pos, note_mouse_highlight):
4342 Rename cover_string to disp_string.
bc17a887 4343
4ee88440
MR
43442011-11-01 Martin Rudalics <rudalics@gmx.at>
4345
4346 * window.c (temp_output_buffer_show): Don't use
4347 Vtemp_buffer_show_specifiers.
4348 (Vtemp_buffer_show_specifiers): Remove unused variable.
4349
c2ff3c02
EZ
43502011-10-30 Eli Zaretskii <eliz@gnu.org>
4351
4352 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
4353 past the beginning of the current glyph matrix.
4354
58179cce 43552011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
4356
4357 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
4358 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
4359 HAVE_GTK3 (Bug#9869).
b77a6a7f 4360
3b574623
JD
4361 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
4362 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
4363
b77a6a7f
JD
4364 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
4365
4366 * xterm.c: Declare x_handle_net_wm_state to return int.
4367 (handle_one_xevent): Check if we are iconified but don't have
4368 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
4369 (get_current_wm_state): Return non-zero if not hidden,
4370 check for _NET_WM_STATE_HIDDEN (Bug#9893).
4371 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
4372 (x_handle_net_wm_state): Return what get_current_wm_state returns.
4373 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
4374
196e41e4
PE
43752011-10-29 Paul Eggert <eggert@cs.ucla.edu>
4376
4377 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
4378 so that this new function doesn't get optimized away by a
4379 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
4380
021f2e1a
AS
43812011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4382
4383 * frame.h (MOUSE_HL_INFO): Remove excess parens.
4384
8b058d44
EZ
43852011-10-29 Eli Zaretskii <eliz@gnu.org>
4386
4387 Fix the `xbytecode' command.
4388 * .gdbinit (xprintbytestr): New command.
b50a28de 4389 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
4390 (xbytecode): Print the byte-code string as well.
4391
4452fb80
EZ
43922011-10-29 Kim Storm <storm@cua.dk>
4393
8b058d44
EZ
4394 * alloc.c (which_symbols): New function.
4395
21b72067
AS
43962011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4397
4398 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
4399 line. (Bug#9903)
4400
83ed7b5c
GM
44012011-10-29 Glenn Morris <rgm@gnu.org>
4402
4403 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
4404 Not clear what it was for, and it causes various bugs. (Bug#9839)
4405
5a7a728b
EZ
44062011-10-28 Eli Zaretskii <eliz@gnu.org>
4407
4408 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4409 possible random value that matches one of those tested as
4410 condition to clear the mouse face.
4411
d3d0842f
CY
44122011-10-28 Chong Yidong <cyd@gnu.org>
4413
4414 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
4415
31b39d13
DN
44162011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
4417
4418 * window.c (make_window): Initialize phys_cursor_on_p.
4419
9aba6043
SM
44202011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4421
4422 * lisp.h (struct Lisp_Symbol): Update comments.
4423
c20992f4
JB
44242011-10-28 Juanma Barranquero <lekktu@gmail.com>
4425
4426 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
4427
db4f02f2
EZ
44282011-10-28 Eli Zaretskii <eliz@gnu.org>
4429
4430 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
4431 <oslsachem@gmail.com> for helping to debug this.
4432
4433 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
4434 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
4435 (g_b_init_get_glyph_outline_w): New static variables.
4436 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
4437 (GetGlyphOutlineW_Proc): New typedefs.
4438 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
4439 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
4440 New functions.
4441 (w32font_open_internal, compute_metrics):
4442 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
4443 instead of calling the "wide" APIs directly.
4444
4445 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
4446
4447 * w32.h (syms_of_w32font): Add prototype.
4448
87e68db4
JB
44492011-10-27 Juanma Barranquero <lekktu@gmail.com>
4450
4451 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
4452 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
4453 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
4454 (Fmove_to_window_line): Doc fix.
4455
435c1d67
CY
44562011-10-27 Chong Yidong <cyd@gnu.org>
4457
4458 * process.c (make_process): Set gnutls_state to NULL.
4459
4460 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
4461 non-NULL, regardless of GNUTLS_INITSTAGE.
4462 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
4463 an error. Set process slots as soon as we allocate them.
4464
4465 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
4466
9c6c6f49
CY
44672011-10-27 Chong Yidong <cyd@gnu.org>
4468
9aba6043
SM
4469 * gnutls.c (emacs_gnutls_deinit): New function.
4470 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
4471 (Fgnutls_deinit, Fgnutls_boot): Use it.
4472
4473 * process.c (make_process): Initialize GnuTLS credentials to NULL.
4474 (deactivate_process): Call emacs_gnutls_deinit.
4475
657d08d3
JB
44762011-10-27 Juanma Barranquero <lekktu@gmail.com>
4477
4478 * image.c (x_create_x_image_and_pixmap):
4479 * w32.c (sys_rename, w32_delayed_load):
4480 * w32font.c (fill_in_logfont):
4481 * w32reg.c (x_get_string_resource): Silence compiler warnings.
4482
5430d399
JB
44832011-10-26 Juanma Barranquero <lekktu@gmail.com>
4484
4485 * w32fns.c (w32_default_color_map): New function,
4486 extracted from Fw32_default_color_map.
a7ef684b 4487 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 4488
fe0055fa
PE
44892011-10-25 Paul Eggert <eggert@cs.ucla.edu>
4490
4491 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
4492
e6346438
SM
44932011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
4494
4495 * keyboard.c (test_undefined): New function (bug#9751).
4496 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
4497
e112cc37
ET
44982011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
4499
4500 * sysdep.c (init_sys_modes): Fix the check for the controlling
4501 terminal (Bug#6649).
4502
7b5d6677
EZ
45032011-10-20 Eli Zaretskii <eliz@gnu.org>
4504
4505 * dispextern.h (struct bidi_it): New member next_en_type.
4506
4507 * bidi.c (bidi_line_init): Initialize the next_en_type member.
4508 (bidi_resolve_explicit_1): When next_en_pos is valid for the
4509 current character, check also for next_en_type being WEAK_EN.
4510 (bidi_resolve_weak): Don't enter the expensive loop if the current
4511 position is before next_en_pos. Record the bidi type of the first
4512 non-ET, non-BN character we find, in addition to its position.
4513 (bidi_level_of_next_char): Invalidate next_en_type when
4514 next_en_pos is over-stepped.
4515
7da0b018
PE
45162011-10-20 Paul Eggert <eggert@cs.ucla.edu>
4517
4518 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
4519 * editfns.c: Rewrite current-time-zone so that it invokes
4520 the equivalent of (format-time-string "%Z") to get the time zone name.
4521 This fixes a bug when the time zone name contains characters that
4522 need converting from the system time locale to Emacs internal format.
4523 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
4524 that patch fixed format-time-string to do the conversion, but
4525 I forgot to fix current-time-zone.
4526 (format_time_string): New function, containing most of
4527 what Fformat_time_string used to contain.
4528 (Fformat_time_string): Rewrite in terms of format_time_string.
4529 This doesn't change this function's behavior.
4530 (current-time-zone): Rewrite to use format_time_string.
4531 This fixes the bug reported by Michael Schierl in
4532 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
4533 Jason Rumney's 2007-06-07 change worked around this bug, but
4534 didn't fix it.
4535 * systime.h (tzname, timezone): Remove no-longer-used declarations.
4536
8547b010
EZ
45372011-10-19 Eli Zaretskii <eliz@gnu.org>
4538
4539 * xdisp.c (start_display): If the character at POS is displayed
4540 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
4541 (try_window_reusing_current_matrix): If a line ends in a display
4542 vector or the next line starts in a display vector, continue
4543 redrawing the window even though the character position of
4544 start_row was reached.
8547b010
EZ
4545 (Bug#9771, part 2)
4546
4e948d15
CY
45472011-10-18 Chong Yidong <cyd@gnu.org>
4548
4549 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
4550 with nobreak-char-display too.
4551
4787455f
EZ
45522011-10-18 Eli Zaretskii <eliz@gnu.org>
4553
4554 Fix part 3 of bug#9771.
4555 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
4556 (bidi_resolve_neutral): Don't enter the expensive loop looking for
4557 non-neutral characters if the current character is a paragraph
4558 separator (a.k.a. Newline). This avoids running the same
4559 expensive loop twice, once when we consume the preceding newline
4560 and the other time when the line actually needs to be displayed.
4561 Avoid the loop when we see neutrals on the base embedding level
4562 following a character whose directionality is the same as the
4563 paragraph's. This avoids running the expensive loop when a line
4564 ends in a long sequence of neutrals, like control characters.
4565 Add assertion against STRONG_AL type. Slightly rearrange code
4566 that determines the type of a neutral given the first non-neutral
4567 that follows it.
4568 (bidi_level_of_next_char): Set next_en_pos to zero when
4569 invalidating its info.
4570
2c91f553
EZ
45712011-10-17 Eli Zaretskii <eliz@gnu.org>
4572
4573 * xdisp.c (push_display_prop): Determine whether to record string
4574 or buffer position by IT->string, not by IT->method. Allow
4575 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
4576 (move_it_vertically_backward): Don't look for character position
4577 immediately after the newline when in a continuation line.
4578 (Bug#9771, part 1)
2c91f553 4579
c7b08b0d
MR
45802011-10-15 Martin Rudalics <rudalics@gmx.at>
4581
4582 * window.c (coordinates_in_window): Rewrite and delabelize
4583 vertical border check. (Bug#5357) (Bug#9618)
4584
6b02f655
SM
45852011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
4586
4587 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
4588 errors in XSetWindowBorder (bug#9310).
4589
81d40c92
DA
45902011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
4591
4592 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
4593 avoid crash when xmalloc overrun checking is enabled.
4594
d4172c3b
EZ
45952011-10-13 Eli Zaretskii <eliz@gnu.org>
4596
4597 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
4598 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
4599 cursor motion with <left> and <right> arrow keys.
4600
4601 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
4602 some callers set that themselves.
4603
b00eea75
EZ
46042011-10-12 Eli Zaretskii <eliz@gnu.org>
4605
4606 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
4607 display string and the previous row comes from the same string and
4608 is empty. (Bug#9739) (Bug#9738)
4609
8fe012c4
SM
46102011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4611
4612 * doc.c (get_doc_string): Encode file name (bug#9735).
4613
0074aef2
EZ
46142011-10-12 Eli Zaretskii <eliz@gnu.org>
4615
79beb178
EZ
4616 * bidi.c (bidi_level_of_next_char):
4617 * xdisp.c (get_visually_first_element): Remove old incorrect
4618 comments regarding the Unicode Line Separator character.
4619
0074aef2
EZ
4620 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
4621
6e4b3fbe
DA
46222011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
4623
4624 * alloc.c (Fgc_status): Do not access beyond zombies array
4625 boundary if nzombies > MAX_ZOMBIES.
4626 * alloc.c (dump_zombies): Add missing format specifier.
4627
0324f3af
PE
46282011-10-12 Paul Eggert <eggert@cs.ucla.edu>
4629
b5525cac
PE
4630 * xdisp.c (set_cursor_from_row): Simplify conditionals,
4631 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
4632
0324f3af
PE
4633 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
4634 Some packages use them to denote characters with modifiers.
4635
e9b5f888
AS
46362011-10-11 Andreas Schwab <schwab@linux-m68k.org>
4637
4638 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
4639 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
4640 matching a pp-number. Rename parameter var to var1.
4641
127827c0
SM
46422011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4643
4644 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
4645
c8fd3bd0
GM
46462011-10-08 Glenn Morris <rgm@gnu.org>
4647
4648 * callint.c (Fcall_interactively): Give a more explicit error for the
4649 'c' case with a non-character input. (Bug#8479)
4650
352ec8ff
EZ
46512011-10-08 Eli Zaretskii <eliz@gnu.org>
4652
03669ccb
EZ
4653 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
4654 lines.
7061c986
EZ
4655 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
4656 lines that are hscrolled on the left.
03669ccb 4657
352ec8ff
EZ
4658 * dispnew.c (buffer_posn_from_coords): Account for a possible
4659 presence of header-line. (Bug#4426)
4660
a66cfb1c
SM
46612011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
4662
6b02f655
SM
4663 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
4664 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 4665
7c5ee88e
PE
46662011-10-07 Paul Eggert <eggert@cs.ucla.edu>
4667
4668 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
4669 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
4670 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
4671 this makes Emacs dump core during garbage collection on rare
4672 occasions. sizeof is obviously inferior to offsetof here, so
4673 stick with offsetof.
4674 (GC_POINTER_ALIGNMENT): New macro.
4675 (mark_memory): Omit 3rd (offset) arg; caller changed.
4676 Don't assume EMACS_INT alignment is the same as pointer alignment.
4677
df1bbe5b
SM
46782011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
4679
4680 * keyboard.c (read_key_sequence_remapped): New var.
4681 (read_key_sequence): Compute remapping in the right buffer.
4682 (command_loop_1): Use read_key_sequence's remapping directly.
4683
51553db6
SM
46842011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4685
32c1fffd
SM
4686 * dired.c (file_name_completion): Don't expand file name.
4687 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
4688 before checking file name handler.
4689
51553db6
SM
4690 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
4691 they've been requested explicitly (bug#9591).
4692
b6bd1599 46932011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
4694
4695 * keymap.c (Fsingle_key_description): Use make_specified_string
4696 instead of build_string to build string from push_key_description.
4697 (Bug#5193)
4698
f701dc2a
PE
46992011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4700
4222c55d
PE
4701 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
4702 This fixes a Y2038 bug on 64-bit hosts.
4703 * buffer.c (reset_buffer):
4704 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
4705 (Fclear_buffer_auto_save_failure):
4706 Use 0, not -1, to represent an unset failure time, since time_t
4707 might not be signed.
4708
f701dc2a
PE
4709 Remove dependency on glibc malloc internals.
4710 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4711 Move back here from lisp.h, but with their new implementations.
4712 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4713 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
4714 * charset.c (charset_table_init): New static var.
4715 (syms_of_charset): Use it instead of xmalloc. This removes a
4716 dependency on glibc malloc internals. See Eli Zaretskii's comment in
4717 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
4718 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4719 Move back to alloc.c.
4720 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4721 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
4722
9ceebf39
JD
47232011-09-30 Jan Djärv <jan.h.d@swipnet.se>
4724
4725 * nsterm.m (windowDidResize): Call x_set_window_size only when
4726 ns_in_resize is true. Otherwise set pixelwidth/height and
4727 call change_frame_size (Bug#9628).
4728
cb993c58
PE
47292011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4730
3930c88b
PE
4731 Port --enable-checking=all to Fedora 14 x86-64.
4732 * charset.c (syms_of_charset): Also account for glibc malloc's
4733 internal overhead when calculating the initial malloc maximum.
4734
cb993c58
PE
4735 Port --enable-checking=all to Fedora 14 x86.
4736 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4737 Move to lisp.h.
4738 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
4739 (overrun_check_realloc, overrun_check_free):
4740 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
4741 That way, xmalloc returns a properly-aligned pointer even if
4742 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
4743 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
4744 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
4745 into account when calculating the initial malloc maximum.
4746 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4747 Move here from alloc.c, so that charset.c can use it too.
4748 Properly align; the old code wasn't right for common 32-bit hosts
4749 when configured with --enable-checking=all.
4750 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4751 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
4752
31bed486
EZ
47532011-09-29 Eli Zaretskii <eliz@gnu.org>
4754
04c70788 4755 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
4756 use EDOM.
4757
fbcaa2f3
EZ
47582011-09-28 Eli Zaretskii <eliz@gnu.org>
4759
4760 * xdisp.c (compute_display_string_end): If there's no display
4761 string at CHARPOS, return -1.
4762
4763 * bidi.c (bidi_fetch_char): When compute_display_string_end
4764 returns a negative value, treat the character as a normal
4765 character not covered by a display string. (Bug#9624)
4766
a239d4e9
JB
47672011-09-28 Juanma Barranquero <lekktu@gmail.com>
4768
4769 * lread.c (Fread_from_string): Fix typo in docstring.
4770
88652fd5
EZ
47712011-09-27 Eli Zaretskii <eliz@gnu.org>
4772
4773 * xdisp.c (handle_invisible_prop): If invisible text ends on a
4774 newline, reseat the iterator instead of bidi-iterating there one
4775 character at a time. (Bug#9610)
32c1fffd
SM
4776 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
4777 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 4778
ed497dd4
AS
47792011-09-27 Andreas Schwab <schwab@linux-m68k.org>
4780
4781 * lread.c (readevalloop): Use correct code for NBSP.
4782 (read1): Likewise. (Bug#9608)
4783
b2bf61aa
MA
47842011-09-25 Michael Albinus <michael.albinus@gmx.de>
4785
4786 * dbusbind.c (Fdbus_register_signal): When service is not
4787 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
4788
32bbb17c
GM
47892011-09-25 Glenn Morris <rgm@gnu.org>
4790
4791 * buffer.c (truncate-lines): Doc fix.
4792
94e0933e
CY
47932011-09-24 Chong Yidong <cyd@stupidchicken.com>
4794
4795 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
4796 (Fset_window_next_buffers): Doc fix.
4797
cddde921
GM
47982011-09-24 Glenn Morris <rgm@gnu.org>
4799
4800 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
4801
1260aef1
PE
48022011-09-24 Paul Eggert <eggert@cs.ucla.edu>
4803
25b4bfa0
PE
4804 Fix minor problems found by static checking.
4805 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
4806 * indent.c (Fvertical_motion): Fix == vs = typo.
4807
e3cbd34b
EZ
48082011-09-24 Eli Zaretskii <eliz@gnu.org>
4809
a66cfb1c
SM
4810 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
4811 Default value is now t. Doc fix.
6bf7006f 4812
e3cbd34b 4813 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 4814 logic when moving up, not only when moving down. Fix the
e3cbd34b 4815 confusing name and values of the it_overshoot_expected variable;
32c1fffd 4816 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
4817
4818 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
4819 CHARPOS is covered by a display string which includes newlines.
4820 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
4821 is covered by a display string with embedded newlines.
4822
a3de0cbd
MA
48232011-09-24 Michael Albinus <michael.albinus@gmx.de>
4824
4825 * dbusbind.c (Fdbus_register_signal): Add match rule to
4826 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
4827 (Fdbus_register_method, Vdbus_registered_objects_table):
4828 Fix docstring.
a3de0cbd 4829
b260039d
JM
48302011-09-24 Jim Meyering <meyering@redhat.com>
4831
32c1fffd 4832 do not ignore write error for any output size
b260039d
JM
4833 The previous change was incomplete.
4834 While it makes emacs --batch detect the vast majority of stdout
4835 write failures, errors were still ignored whenever the output size is
4836 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
4837 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
4838 && echo FAIL: ignored write error
4839 FAIL: ignored write error
4840 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
4841 && echo FAIL: ignored write error
4842 FAIL: ignored write error
4843 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
4844
8eca8a7c
AS
48452011-09-23 Andreas Schwab <schwab@linux-m68k.org>
4846
4847 * emacs.c (Fkill_emacs): In noninteractive mode exit
4848 non-successfully if a write error occurred on stdout. (Bug#9574)
4849
3341db62
EZ
48502011-09-21 Eli Zaretskii <eliz@gnu.org>
4851
4852 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
4853 the xassert test.
4854
4855 * dispextern.h (struct it): Update the comment documenting what
4856 can it->OBJECT be.
4857
8c203dbf
EZ
48582011-09-20 Eli Zaretskii <eliz@gnu.org>
4859
4860 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
4861 a display string, extend search for cursor position to end of row.
4862 (find_row_edges): If the row ends in a newline from a display
4863 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
4864 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
4865 (Fcurrent_bidi_paragraph_direction): Fix search for previous
4866 non-empty line. Fixes confusing cursor motion with arrow keys at
4867 the beginning of a line that starts with whitespace.
8c203dbf 4868
a4824228
LMI
48692011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4870
4871 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
4872 (bug#9493).
4873
33ed493b
CY
48742011-09-18 Chong Yidong <cyd@stupidchicken.com>
4875
4876 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
4877 boolean (Bug#9154).
4878
56cd55c8
EZ
48792011-09-18 Eli Zaretskii <eliz@gnu.org>
4880
4881 * xdisp.c (display_line): Record maximum and minimum buffer
4882 positions even if no glyphs were produced (e.g., by a zero-width
4883 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
4884 buffer positions that will be removed from the glyph row because
4885 they don't fit.
c02dcedf
EZ
4886 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
4887 column is beyond frame width: don't subtract 1 "pixel" when
4888 computing width of the stretch.
3e62b7e0
EZ
4889 (reseat_at_next_visible_line_start): Undo the change made on
4890 2011-09-17 that saved paragraph information and restored it after
4891 the call to `reseat'. (Bug#9545)
56cd55c8 4892
5ed99d36 48932011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
4894
4895 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
4896 and turn window cursor on if cleared (Bug#9415).
4897
5ed99d36 48982011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
4899
4900 * search.c (boyer_moore): Take unibyte characters from pattern
4901 literally. (Bug#9458)
4902
9bade7b2
EZ
49032011-09-18 Eli Zaretskii <eliz@gnu.org>
4904
4905 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
4906
e5e9d610
PE
49072011-09-18 Paul Eggert <eggert@cs.ucla.edu>
4908
87e4427a
PE
4909 Fix minor problem found by static checking.
4910 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
4911 initialized, to pacify gcc -Wuninitialized.
4912
e5e9d610
PE
4913 * fileio.c: Report proper errno when syscall falls.
4914 (Finsert_file_contents): Save and restore errno,
4915 so that report_file_error outputs the correct diagnostic.
4916 (Fwrite_region) [CLASH_DETECTION]: Likewise.
4917
a1674f0b
EZ
49182011-09-18 Eli Zaretskii <eliz@gnu.org>
4919
4920 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
4921
fbfb6dd4
EZ
49222011-09-17 Eli Zaretskii <eliz@gnu.org>
4923
4924 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
4925 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
4926
bb187662
EZ
49272011-09-17 Eli Zaretskii <eliz@gnu.org>
4928
1137e8b8 4929 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 4930 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
4931
4932 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
4933 (bidi_find_paragraph_start): Search back for paragraph beginning
4934 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
4935 (bidi_move_to_visually_next): Only trigger paragraph-related
4936 computations when the last character is a newline or at EOB, not
4937 just any NEUTRAL_B. (Bug#9470)
4938
bb187662
EZ
4939 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
4940 truncated lines if point is covered by a display string. (Bug#9524)
4941
2e621251
PE
49422011-09-16 Paul Eggert <eggert@cs.ucla.edu>
4943
4944 * xselect.c: Relax test for outgoing X longs (Bug#9498).
4945 (cons_to_x_long): New function.
4946 (lisp_data_to_selection_data): Use it. Correct the test for
4947 short-versus-long data; it was negated. Break out of vector
4948 loop, for efficiency, when a long datum is discovered.
4949
91a15bc6
SM
49502011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
4951
4952 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
4953
b41c3a35
EZ
49542011-09-16 Eli Zaretskii <eliz@gnu.org>
4955
4956 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
4957 GCC PR/17406) by declaring this function with external scope.
4958
7812ba2d
PE
49592011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4960
4961 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
4962 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
4963
cf7edc2a
AS
49642011-09-15 Andreas Schwab <schwab@linux-m68k.org>
4965
4966 * editfns.c (Fformat): Correctly handle text properties on "%%".
4967
bd01620e
EZ
49682011-09-15 Eli Zaretskii <eliz@gnu.org>
4969
4970 * xterm.c (x_draw_composite_glyph_string_foreground):
4971 * w32term.c (x_draw_composite_glyph_string_foreground):
4972 * term.c (encode_terminal_code):
4973 * composite.c (composition_update_it, get_composition_id):
4974 * xdisp.c (get_next_display_element)
4975 (fill_composite_glyph_string): Add comments about special meaning
4976 of TAB characters in a composition.
4977
a02719a3
PE
49782011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4979
4980 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
4981 This occurs when processing a multibyte format.
4982 Problem reported by Wolfgang Jenker.
a02719a3 4983
72589a3c
JB
49842011-09-15 Johan Bockgård <bojohan@gnu.org>
4985
4986 * xdisp.c (try_cursor_movement): Only check for exact match if
4987 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
4988
1c14176c
PE
49892011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4990
4991 Remove unused external symbols.
4992 * dispextern.h (calc_pixel_width_or_height): Remove decl.
4993 * xdisp.c (calc_pixel_width_or_height): Now static.
4994 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
4995 * indent.c (check_display_width):
4996 * w32term.c: Fix comment to match code.
4997 * xterm.c, xterm.h (x_catching_errors): Remove.
4998
d2eea5b5
PE
49992011-09-14 Paul Eggert <eggert@cs.ucla.edu>
5000
5001 * xselect.c: Use signed conversions more consistently (Bug#9498).
5002 (selection_data_to_lisp_data): Assume incoming selection data are
5003 signed integers, not unsigned. This is to be consistent with
5004 outgoing selection data, which was modified to use signed integers
5005 in as part of the fix to Bug#9196 in response to Jan D.'s comment
5006 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
5007 expects long, not unsigned long.
5008
46888499
EZ
50092011-09-14 Eli Zaretskii <eliz@gnu.org>
5010
5011 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
5012 computation of loop end. Reported by Johan Bockgård
5013 <bojohan@gnu.org>.
5014
ef8ef9fb
CY
50152011-09-13 Chong Yidong <cyd@stupidchicken.com>
5016
5017 * frame.c (Fother_visible_frames_p): Function deleted.
5018
fa819fed
EZ
50192011-09-12 Eli Zaretskii <eliz@gnu.org>
5020
5021 * indent.c (compute_motion): Process display vector front to back
5022 rather than the other way around. (Bug#2496)
5023
2ba8e008
SM
50242011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
5025
5026 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
5027
20f53c69
CY
50282011-09-11 Chong Yidong <cyd@stupidchicken.com>
5029
5030 * minibuf.c (Fread_from_minibuffer): Doc fix.
5031
d562d7a4
EZ
50322011-09-11 Eli Zaretskii <eliz@gnu.org>
5033
5034 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
5035 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
5036
1c4d7f3d
LMI
50372011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
5038
5039 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
5040 value for non-existent files.
5041
b885bf36
EZ
50422011-09-11 Eli Zaretskii <eliz@gnu.org>
5043
5044 * fileio.c (Finsert_file_contents): If the file cannot be opened,
5045 set its "size" to -1. This will set the modtime_size field of
5046 the corresponding buffer to -1, which is what
5047 verify-visited-file-modtime expects for files that do not exist.
5048 (Bug#9139)
5049
6612f0bf
PE
50502011-09-11 Paul Eggert <eggert@cs.ucla.edu>
5051
5052 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
5053 here ...
5054 * lisp.h: ... from here. push_key_description is no longer
5055 defined in keyboard.c, so its declaration should not be in
5056 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
5057 logically belongs with push_key_description.
5058
dfb3f755
PE
50592011-09-10 Paul Eggert <eggert@cs.ucla.edu>
5060
5061 * buffer.h: Include <sys/types.h> instead of <time.h>.
5062 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
5063 Problem reported by Herbert J. Skuhra.
5064
3134906c
LMI
50652011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
5066
5067 * xml.c (parse_region): Make the parsing work for
5068 non-comment-starting XML files again (bug#9144).
5069
8d903f4e
AS
50702011-09-10 Andreas Schwab <schwab@linux-m68k.org>
5071
5072 * image.c (gif_load): Fix calculation of bottom and right corner.
5073 (Bug#9468)
5074
80ad64f4
EZ
50752011-09-10 Eli Zaretskii <eliz@gnu.org>
5076
5077 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
5078 redisplay in small windows.
5079
208a048d
EZ
50802011-09-09 Eli Zaretskii <eliz@gnu.org>
5081
5082 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
5083
9b1c252e
MR
50842011-09-08 Martin Rudalics <rudalics@gmx.at>
5085
5086 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
5087 Operate on live windows only.
5088
2949f33b
JB
50892011-09-08 Juanma Barranquero <lekktu@gmail.com>
5090
5091 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
5092
e08dcafd
EZ
50932011-09-07 Eli Zaretskii <eliz@gnu.org>
5094
5095 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
5096 only under bidi iteration.
5097
115b96bd
JD
50982011-09-07 Jan Djärv <jan.h.d@swipnet.se>
5099
5100 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
5101
c8199d0f
PE
51022011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5103
5104 isnan: Fix porting problem to Solaris 10 with bundled gcc.
5105 Without this fix, the command to link temacs failed due to an
5106 undefined symbol __builtin_isnan. This is because
5107 /usr/include/iso/math_c99.h #defines isnan(x) to
5108 __builtin_isnan(x), but the bundled gcc, which identifies itself
5109 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
5110 a __builtin_isnan.
5111 * floatfns.c (isnan): #undef, and then #define to a clone of
5112 what's in data.c.
5113 (Fisnan): Always define, since it's always available now.
5114 (syms_of_floatfns): Always define isnan at the Lisp level.
5115
e39b275c 51162011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
5117
5118 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
5119
b2db44d9 51202011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 5121
f4af5137 5122 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
5123 The previous code assumed that file offsets (off_t values) fit in
5124 EMACS_INT variables, which is not true on typical 32-bit hosts.
5125 The code messed up by falsely reporting buffer overflow in cases
5126 such as (insert-file-contents "big" nil 1 2) into an empty buffer
5127 when "big" contains more than 2**29 bytes, even though this
5128 inserts just one byte and does not overflow the buffer.
5129 (Finsert_file_contents): Store file offsets as off_t
5130 values, not as EMACS_INT values. Check for overflow when
5131 converting between EMACS_INT and off_t. When checking for
5132 buffer overflow or for overlap, take the offsets into account.
5133 Don't use EMACS_INT for small values where int suffices.
5134 When checking for overlap, fix a typo: ZV was used where
5135 ZV_BYTE was intended.
5136 (Fwrite_region): Don't assume off_t fits into 'long'.
5137 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
5138
ecfc0a49
MA
51392011-09-05 Michael Albinus <michael.albinus@gmx.de>
5140
5141 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
5142
6511acf2 51432011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 5144
0999621a 5145 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
5146
5147 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 5148 (esprintf, exprintf, evxprintf): New functions.
62f19c19 5149 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 5150 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
5151 (modify_event_symbol): Do not assume that the length of
5152 name_alist_or_stem is safe to alloca and fits in int.
5153 (Fexecute_extended_command): Likewise for function name and binding.
5154 (Frecursion_depth): Wrap around reliably on integer overflow.
5155 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
5156 since some callers pass EMACS_INT values.
5157 (Fsingle_key_description): Don't crash if symbol name contains more
5158 than MAX_ALLOCA bytes.
5159 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
5160 (get_minibuffer): Arg is now EMACS_INT, not int.
5161 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 5162 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
5163 * window.h (command_loop_level, minibuf_level): Reflect API changes.
5164
2be7d702
PE
5165 * dbusbind.c (signature_cat): New function.
5166 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
5167 Do not overrun buffer; instead, report string overflow.
5168
9d1df220
PE
5169 * dispnew.c (add_window_display_history): Don't overrun buffer.
5170 Truncate instead; this is OK since it's just a log.
5171
33ef5c64
PE
5172 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
5173 even if the time zone offset is outlandishly large.
5174 Don't mishandle offset == INT_MIN.
5175
66c6fdd5
PE
5176 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
5177 when creating daemon; the previous buffer-overflow check was incorrect.
5178
d749b01b
PE
5179 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
5180 which has the guts of the old verror function.
5181
b5cd1905
PE
5182 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
5183 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
5184
6e1a67fb
PE
5185 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
5186 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 5187 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 5188 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
5189 length of string rather than counting it via multiple sprintfs;
5190 that's simpler and more reliable.
c21721cc
PE
5191 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
5192 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
5193 sprintf, in case result does not fit in int.
5194
c57b67fc
PE
5195 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
5196 (fontset_from_font): Print it.
5197
8a401434
PE
5198 * frame.c (tty_frame_count): Now printmax_t, not int.
5199 (make_terminal_frame, set_term_frame_name): Print it.
5200 (x_report_frame_params): In X, window IDs are unsigned long,
5201 not signed long, so print them as unsigned.
5202 (validate_x_resource_name): Check for implausibly long names,
5203 and don't assume name length fits in 'int'.
5204 (x_get_resource_string): Don't blindly alloca invocation name;
5205 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
5206 not fit in int.
5207
6e1a67fb
PE
5208 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
5209 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
5210 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
5211
0df02bf3
PE
5212 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
5213 Use esprintf, not sprintf, in case result does not fit in int.
5214
48e30793
PE
5215 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5216 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
5217 it as a large positive number.
5218 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
5219 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5220
a66ff6d8
PE
5221 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
5222 in case result does not fit in int.
5223
aca216ff
PE
5224 * print.c (float_to_string): Detect width overflow more reliably.
5225 (print_object): Make sprintf buffer a bit bigger, to avoid potential
5226 buffer overrun. Don't assume list length fits in 'int'. Treat
5227 print length of 0 as 0, not as infinity; to be consistent with other
5228 uses of print length in this function. Don't overflow print length
5229 index. Don't assume hash table size fits in 'long', or that
5230 vectorlike size fits in 'unsigned long'.
5231
31c286f7
PE
5232 * process.c (make_process): Use printmax_t, not int, to format
5233 process-name gensyms.
5234
55e5faa1
PE
5235 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
5236
80f2e268
PE
5237 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
5238 to avoid potential buffer overrun.
5239
670741ab
PE
5240 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
5241 if X resource line is longer than 512 bytes.
5242
b7163a50
PE
5243 * xfns.c (x_window): Make sprintf buffer a bit bigger
5244 to avoid potential buffer overrun.
5245
ae58ff1f
PE
5246 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
5247
c43c8a6a
PE
5248 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
5249
3f8236f4
PE
52502011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5251
53e9fe90 5252 Integer overflow fixes for scrolling, etc.
6511acf2
PE
5253 Without these, Emacs silently mishandles large integers sometimes.
5254 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
5255 it were "C-u 1 M-x recenter" on a typical 64-bit host.
5256
6511acf2
PE
5257 * xdisp.c (try_window_id): Check Emacs fixnum range before
5258 converting to 'int'.
806add1d 5259
6511acf2 5260 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
5261 Check that an Emacs fixnum is in range before assigning it to 'int'.
5262 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
5263 values converted from Emacs fixnums.
5264 (Frecenter): Don't wrap around a line count if it is out of 'int'
5265 range; instead, treat it as an extreme value.
5266 (Fset_window_configuration, compare_window_configurations):
5267 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
5268
6511acf2
PE
5269 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
5270 that can exceed INT_MAX. Check that EMACS_INT value is in range
5271 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
5272 (match_limit): Don't assume that a fixnum can fit in 'int'.
5273
6511acf2 5274 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
5275 exceed INT_MAX.
5276
6511acf2 5277 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
5278 (Fvertical_motion): Don't wrap around LINES values that don't fit
5279 in 'int'. Instead, treat them as extreme values. This is good
5280 enough for windows, which can't have more than INT_MAX lines anyway.
5281
fcb901a7
LMI
52822011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5283
0f2f6b6d
LMI
5284 * Require libxml/parser.h to avoid compilation warning.
5285
fcb901a7
LMI
5286 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
5287
5288 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
5289 since this reportedly can destroy thread storage.
5290
6e20a0d4
CY
52912011-08-30 Chong Yidong <cyd@stupidchicken.com>
5292
5293 * syntax.c (find_defun_start): Update all cache variables if
5294 exiting early (Bug#9401).
5295
148ae00e
EZ
52962011-08-30 Eli Zaretskii <eliz@gnu.org>
5297
f6cfbd8f
EZ
5298 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
5299
148ae00e
EZ
5300 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
5301 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
5302 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
5303
5304 * term.c (tty_append_glyph): New function.
5305 (produce_stretch_glyph): Static function and its prototype deleted.
5306
a66cfb1c
SM
5307 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
5308 Add prototypes.
148ae00e 5309
c4a07a4c
PE
53102011-08-29 Paul Eggert <eggert@cs.ucla.edu>
5311
5312 * image.c (parse_image_spec): Check for nonnegative, not for positive,
5313 when checking :margin (Bug#9390).
5314 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 5315 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
5316 so that the name doesn't mislead. All uses changed.
5317
6bc8cd65
JB
53182011-08-28 Johan Bockgård <bojohan@gnu.org>
5319
5320 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
5321 set_tty_hooks.
5322
dca4927e
EZ
53232011-08-27 Eli Zaretskii <eliz@gnu.org>
5324
5325 * xdisp.c (move_it_to): Don't bail out early when reaching
5326 position beyond to_charpos, if we are scanning backwards.
5327 (move_it_vertically_backward): When DY == 0, make sure we get to
5328 the first character in the line after the newline.
5329
f2cad773
PE
53302011-08-27 Paul Eggert <eggert@cs.ucla.edu>
5331
5332 * ccl.c: Improve and simplify overflow checking (Bug#9196).
5333 (ccl_driver): Do not generate an out-of-range pointer.
5334 (Fccl_execute_on_string): Remove unnecessary check for
5335 integer overflow, noted by Stefan Monnier in
5336 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
5337 Remove a FIXME that didn't need fixing.
5338 Simplify the newly-introduced buffer reallocation code.
5339
0cae2cdb
JB
53402011-08-27 Juanma Barranquero <lekktu@gmail.com>
5341
5342 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
5343
5fc295a4 53442011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 5345
70c60eb2 5346 Integer and memory overflow issues (Bug#9196).
726e0ab1 5347
d31850da
PE
5348 * doc.c (get_doc_string): Rework so that
5349 get_doc_string_buffer_size is the actual buffer size, rather than
5350 being 1 less than the actual buffer size; this makes xpalloc more
5351 convenient.
5352
a69fbedb
PE
5353 * image.c (x_allocate_bitmap_record, cache_image):
5354 * xselect.c (Fx_register_dnd_atom):
5355 Simplify previous changes by using xpalloc.
5356
fe5c5d37
PE
5357 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
5358 since either will do and ptrdiff_t is convenient with xpalloc.
5359
0065d054
PE
5360 * charset.c (charset_table_size)
5361 (struct charset_sort_data.priority): Now ptrdiff_t.
5362 (charset_compare): Don't overflow if priorities differ greatly.
5363 (Fsort_charsets): Don't assume list length fits in int.
5364 Check for size-calculation overflow when allocating sort data.
5365 (syms_of_charset): Allocate an initial charset table that is
5366 just under 64 KiB, to avoid problems with glibc malloc and mmap.
5367
5368 * cmds.c (internal_self_insert): Check for size-calculation overflow.
5369
5370 * composite.h (struct composition.glyph_len): Now int, not unsigned.
5371 The actual value is always <= INT_MAX, and leaving it unsigned made
5372 overflow checking harder.
5373
5374 * dispextern.h (struct glyph_matrix.rows_allocated)
5375 (struct face_cache.size): Now ptrdiff_t, for convenience in use
5376 with xpalloc. The values are still always <= INT_MAX.
5377
5378 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
5379
5380 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
5381 (SAFE_NALLOCA): New macro.
5382
5383 * region-cache.c (struct boundary.pos, find_cache_boundary)
5384 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
5385 (set_cache_region, invalidate_region_cache)
5386 (revalidate_region_cache, know_region_cache, region_cache_forward)
5387 (region_cache_backward, pp_cache):
5388 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
5389 so that ptrdiff_t * can be passed to xpalloc.
5390 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
5391 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
5392 (pp_cache): Don't assume cache_len fits in int.
5393 * region-cache.h: Adjust extern decls to match.
5394
5395 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
5396 EMACS_INT, since either will do, for xpalloc.
5397
5398 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
5399 (xnmalloc, xnrealloc, xpalloc): New functions.
5400
726e0ab1
PE
5401 * bidi.c (bidi_shelve_header_size): New constant.
5402 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
5403 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
5404
51f30bc5 5405 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
5406 * buffer.c (overlays_at, overlays_in, record_overlay_string)
5407 (overlay_strings):
5408 Don't update size of array until after memory allocation succeeds,
5409 because xmalloc/xrealloc may not return.
0065d054
PE
5410 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
5411 now that we have proper integer overflow checking.
5412 (record_overlay_string, overlay_strings): Catch overflows when
5413 calculating size of overlay_str_buf.
726e0ab1 5414
0065d054
PE
5415 * callproc.c (Fcall_process): Check for size overflow when
5416 calculating size of args2.
5417 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
5418 Normally we prefer signed values, but sticking with ptrdiff_t would
5419 require adding more-complicated checks.
726e0ab1
PE
5420
5421 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
5422 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
5423 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 5424 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
5425
5426 * character.c (Fstring): Check for size-calculation overflow.
5427
5428 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
5429 unnecessary integer overflow. Check for size overflow.
5430 (encode_coding_object): Don't update size until xmalloc succeeds.
5431
5432 * composite.c (get_composition_id): Check for overflow in glyph
5433 length calculations.
5434
5435 Integer and memory overflow fixes for display code.
5436 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
5437 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
5438 (scrolling_window): Check for overflow in size calculations.
5439 (line_draw_cost, realloc_glyph_pool, add_row_entry):
5440 Don't assume glyph table len fits in int.
5441 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
5442 (row_table_size): Now ptrdiff_t, not int.
5443 (scrolling_window): Avoid overflow in size calculations.
5444 Don't update size until allocation succeeds.
5445 * fns.c (concat): Check for overflow in size calculations.
5446 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
5447 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5448 (NEXT_ALMOST_PRIME_LIMIT): New constant.
5449
5450 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
5451 (get_doc_string): Check for size calculation overflow.
5452 Don't update size until allocation succeeds.
5453 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
5454 EMACS_INT, where ptrdiff_t will do.
5455 (Fsubstitute_command_keys): Check for string overflow.
5456
5457 * editfns.c (set_time_zone_rule): Don't assume environment length
5458 fits in int.
5459 (message_length): Now ptrdiff_t, not int.
5460 (Fmessage_box): Don't update size until allocation succeeds.
5461 Don't assume message length fits in int.
5462 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
5463
0065d054
PE
5464 * emacs.c (main): Do not reallocate argv, since there is a null at
5465 the end that can be overwritten, and this way there's no need to
5466 worry about size-calculation overflow.
5467 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
5468
5469 * eval.c (init_eval_once, grow_specpdl): Don't update size until
5470 alloc succeeds.
5471 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
5472
5473 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
5474 (x_set_scroll_bar_width, x_figure_window_size):
5475 Check for integer overflow.
5476 (x_set_alpha): Do not assume XINT fits in int.
5477
5478 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
5479 This is for the members text_lines, text_cols, total_lines, total_cols,
5480 where the system imposes an 'int' limit.
5481
5482 * fringe.c (Fdefine_fringe_bitmap):
5483 Don't update size until alloc works.
5484
5485 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
5486 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
5487
5488 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
5489 Check for size-calculation overflow.
5490 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
5491 do, as we prefer signed integers.
5492 (id_to_widget.max_size, id_to_widget.used)
5493 (xg_store_widget_in_map, xg_remove_widget_from_map)
5494 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
5495 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
5496 Use and return ptrdiff_t, not int.
5497 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
5498 * gtkutil.h: Change prototypes to match the above.
5499
5500 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
5501 are duplicate now that they've been promoted to lisp.h.
5502 (x_allocate_bitmap_record, x_alloc_image_color)
5503 (make_image_cache, cache_image, xpm_load):
5504 Don't update size until alloc is done.
5505 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
5506 (x_detect_edges):
3256efce 5507 Check for size calculation overflow.
726e0ab1
PE
5508 (ct_colors_allocated_max): New constant.
5509 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
5510 overflow.
3256efce 5511
726e0ab1
PE
5512 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
5513 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
5514 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
5515 Use ptrdiff_t, not int, to count maps.
5516 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
5517 calculations. Don't update size until allocation succeeds.
5518 Redo calculations to avoid overflow.
726e0ab1
PE
5519 * keyboard.h: Change prototypes to match the above.
5520
5521 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
5522 to count maps.
5523 (current_minor_maps): Check for size calculation overflow.
5524 * keymap.h: Change prototypes to match the above.
5525
5526 * lread.c (read1, init_obarray): Don't update size until alloc done.
5527
5528 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
5529 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
5530
726e0ab1
PE
5531 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
5532 Now ptrdiff_t, not int.
5533 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
5534 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
5535
5536 * process.c (Fnetwork_interface_list): Check for overflow
5537 in size calculation.
5538
5539 * region-cache.c (move_cache_gap): Check for size calculation overflow.
5540
5541 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
5542 overflow. Don't bother calling xmalloc when xrealloc will do.
5543
5544 * search.c (Freplace_match): Check for size calculation overflow.
5545 (Fset_match_data): Don't assume list lengths fit in 'int'.
5546
5547 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
5548 for command line length. Do not attempt to address one before the
5549 beginning of an array, as that's not portable.
5550
5551 * term.c (max_frame_lines): Remove; unused.
5552 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
5553 not int.
5554 (encode_terminal_code, calculate_costs): Check for size
5555 calculation overflow.
5556 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
5557 table lengths and related sizes. Don't update size until alloc
5558 done. Redo calculations to avoid overflow.
5559 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
5560
5561 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
5562 subtracting pointers.
5563 (gobble_line): Check for overflow more carefully. Don't update size
5564 until alloc done.
5565
5566 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
5567 Don't update size until alloc done.
5568 Redo size calculations to avoid overflow.
5569 Check for size calculation overflow.
0065d054 5570 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
5571
5572 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
5573 Use ptrdiff_t, not int, for sizes.
5574 (store_mode_line_noprop_char): Don't update size until alloc done.
5575
0065d054
PE
5576 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
5577 Use ptrdiff_t, not int, for sizes.
5578 (Finternal_make_lisp_face, cache_face):
5579 Check for size calculation overflow.
5580 (cache_face): Treat size calculation overflows as if they were
5581 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
5582
5583 * xfns.c (x_encode_text, x_set_name_internal)
5584 (Fx_change_window_property): Use ptrdiff_t, not int, to count
5585 sizes, since they can exceed INT_MAX in size. Check for size
5586 calculation overflow.
5587
0065d054
PE
5588 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
5589 (xg_select): Check for size calculation overflow.
726e0ab1
PE
5590 Don't update size until alloc done.
5591
0065d054 5592 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 5593 as sprintf is limited to int lengths.
1d526e2f 5594
252c5ee1
PE
5595 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
5596 (X_LONG_MIN): New macros.
864d7ce7
PE
5597 Use them to make the following changes clearer.
5598 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
5599 This change doesn't affect the value now, but it may help remind
5600 future maintainers not to raise the value too much later.
5601 (SELECTION_QUANTUM): Remove, replacing with ...
5602 (selection_quantum): ... new function, which avoids overflow.
5603 All uses changed.
5604 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
5605 assumption that selection length fits in 'int'.
5606 (x_reply_selection_request, x_handle_selection_request)
5607 (x_get_window_property, receive_incremental_selection)
5608 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
5609 (lisp_data_to_selection_data, clean_local_selection_data):
5610 Use ptrdiff_t, not int, to record length of selection.
5611 (x_reply_selection_request, x_get_window_property)
5612 (receive_incremental_selection, x_property_data_to_lisp):
5613 Redo calculations to avoid overflow.
5614 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 5615 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
5616 something.
5617 (x_get_window_property, receive_incremental_selection)
5618 (lisp_data_to_selection_data, x_property_data_to_lisp):
5619 Check for size-calculation overflow.
5620 (x_get_window_property, receive_incremental_selection)
5621 (lisp_data_to_selection_data, Fx_register_dnd_atom):
5622 Don't store size until memory allocation succeeds.
5623 (x_get_window_property): Plug memory leak on memory exhaustion.
5624 Don't double-block input; malloc is safe here. Don't assume 2**34
5625 - 4 fits in unsigned long. Add an xassert to check
5626 XGetWindowProperty overflow. Be more careful about overflow
5627 calculations, and distinguish size from memory overflow better.
5628 (receive_incremental_selection): When tracing, don't assume
5629 unsigned int is less than INT_MAX.
5630 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
5631 harmful) conversions of unsigned short to int.
5632 (lisp_data_to_selection_data): Don't assume that integers
5633 in the range -65535 through -1 fit in an X unsigned short.
5634 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
5635 result parameters unless successful. Rely on cons_to_unsigned
5636 to report problems with elements; the old code wasn't right anyway.
5637 (x_check_property_data): Check for int overflow; we cannot use
5638 a wider type due to X limits.
5639 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
5640
726e0ab1 5641 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 5642
0065d054
PE
5643 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
5644 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
5645 (x_color_cells): Don't store size until memory allocation succeeds.
5646 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 5647 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
5648 (x_term_init): Don't assume length fits in int (sprintf is limited
5649 to int size).
bc18e09d 5650
ebfa62c0
PE
5651 Use ptrdiff_t for composition IDs.
5652 * character.c (lisp_string_width):
5653 * composite.c (composition_table_size, n_compositions)
5654 (get_composition_id, composition_gstring_from_id):
5655 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
5656 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
5657 * window.c (Frecenter):
5658 Use ptrdiff_t, not int, for composition IDs.
5659 * composite.c (get_composition_id): Check for integer overflow.
5660 * composite.h: Adjust prototypes to match the above changes.
5661
d3411f89
PE
5662 Use ptrdiff_t for hash table indexes.
5663 * category.c (hash_get_category_set):
5664 * ccl.c (ccl_driver):
5665 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
5666 * coding.c (coding_system_charset_list, detect_coding_system):
5667 * coding.h (struct coding_system.id):
5668 * composite.c (get_composition_id, gstring_lookup_cache):
5669 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
5670 * image.c (xpm_get_color_table_h):
5671 * lisp.h (hash_lookup, hash_put):
5672 * minibuf.c (Ftest_completion):
5673 Use ptrdiff_t for hash table indexes, not int (which is too
5674 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
5675 32-bit --with-wide-int hosts).
5676
e097a6fa
PE
5677 * charset.c (Fdefine_charset_internal): Check for integer overflow.
5678 Add a FIXME comment about memory leaks.
5679 (syms_of_charset): Don't assume xmalloc returns.
5680
5637687f
PE
5681 Don't assume that stated character widths fit in int.
5682 * character.c (Fchar_width, c_string_width, lisp_string_width):
5683 * character.h (CHAR_WIDTH):
5684 * indent.c (MULTIBYTE_BYTES_WIDTH):
5685 Use sanitize_char_width to avoid undefined and/or bad behavior
5686 with outlandish widths.
a66cfb1c 5687 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
5688 now that we have two such functions. All uses changed.
5689 (sanitize_char_width): New inline function.
5690
a2271ba2
PE
5691 Don't assume that tab-width fits in int.
5692 * character.h (sanitize_width): New inline function.
5693 (SANE_TAB_WIDTH): New macro.
5694 (ASCII_CHAR_WIDTH): Use it.
5695 * indent.c (sane_tab_width): Remove. All uses replaced by
5696 SANE_TAB_WIDTH (current_buffer).
5697 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
5698
18c52557
PE
5699 * fileio.c: Integer overflow issues with file modes.
5700 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
5701
caeeedc1
PE
5702 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
5703 Remove unreachable code.
5704 (read_hex, load_charset_map_from_file): Check for integer overflow.
5705
6df6ae42 5706 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
5707 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
5708 (x_send_scroll_bar_event): Likewise. Check that the size does not
5709 exceed limits imposed by XClientMessageEvent, as well as the usual
5710 ptrdiff_t and size_t limits.
5711
b13995db
PE
5712 * keyboard.c: Overflow, signedness and related fixes.
5713 (make_lispy_movement): Use same integer type in forward decl
5714 that is used in the definition.
5715 (read_key_sequence, keyremap_step):
5716 Change bufsize argument back to int, undoing my 2011-03-30 change.
5717 We prefer signed types, and int is wide enough here.
5718 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
5719 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
5720 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
5721 length, not size_t. Use ptrdiff_t for index, not int.
5722 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
5723 possibility of integer overflow.
5724
13464394
PE
5725 Overflow, signedness and related fixes for images.
5726
5727 * dispextern.h (struct it.stack[0].u.image.image_id)
5728 (struct_it.image_id, struct image.id, struct image_cache.size)
5729 (struct image_cache.used, struct image_cache.ref_count):
5730 * gtkutil.c (update_frame_tool_bar):
5731 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
5732 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
5733 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
5734 * nsmenu.m (update_frame_tool_bar):
5735 * xdisp.c (calc_pixel_width_or_height):
5736 * xfns.c (image_cache_refcount):
5737 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
5738 on typical 64-bit hosts.
5739
5740 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5741 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
5742 Omit unnecessary casts to int.
5743 (parse_image_spec): Check that integers fall into 'int' range
5744 when the callers expect that.
5745 (image_ascent): Redo ascent calculation to avoid int overflow.
5746 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
5747 (lookup_image): Remove unnecessary tests.
5748 (xbm_image_p): Locals are now of int, not EMACS_INT,
5749 since parse_image_check makes sure they fit into int.
5750 (png_load, gif_load, svg_load_image):
5751 Prefer int to unsigned where either will do.
5752 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
5753 old tiff_error_handler and tiff_warning_handler.
5754 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
5755 stack buffer overflows. It uses only the features of vsnprintf
5756 that are common to both POSIX and native Microsoft.
5757 (tiff_error_handler, tiff_warning_handler): Use it.
5758 (tiff_load, gif_load, imagemagick_load_image):
5759 Don't assume :index value fits in 'int'.
5760 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
5761 (imagemagick_load_image): Check that crop parameters fit into
5762 the integer types that MagickCropImage accepts. Don't assume
5763 Vimagemagick_render_type has a nonnegative value. Don't assume
5764 size_t fits in 'long'.
5765 (gs_load): Use printmax_t to print the widest integers possible.
5766 Check for integer overflow when computing image height and width.
5767
c11821d4
EZ
57682011-08-26 Eli Zaretskii <eliz@gnu.org>
5769
5770 * xdisp.c (redisplay_window): Don't force window start if point
5771 will be invisible in the resulting window. (Bug#9324)
5772
0c95fcf7
EZ
57732011-08-25 Eli Zaretskii <eliz@gnu.org>
5774
5775 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
5776 the display spec is of the form `(space ...)'.
5777 (handle_display_spec): Return the value returned by
5778 handle_single_display_spec, not just 1 or zero.
5779 (handle_single_display_spec): If the display spec is of the form
5780 `(space ...)', and specifies display in the text area, return 2
5781 rather than 1.
fee65a97 5782 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
5783 accurately, and prefer exact match for point under bidi.
5784 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
5785
5786 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
5787 into disp_prop; all users changed.
5788
5789 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
5790 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
5791 for the text covered by the display property.
5792
e4ed06f1
CY
57932011-08-25 Chong Yidong <cyd@stupidchicken.com>
5794
5795 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
5796 Change return value to nil.
5797 (Frecord_buffer): Delete unused function.
5798
f67cdd7f
EZ
57992011-08-24 Eli Zaretskii <eliz@gnu.org>
5800
5980d4c6
EZ
5801 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
5802 buffers, return left-to-right.
8610fe8b
EZ
5803 (set_cursor_from_row): Consider candidate row a win if its glyph
5804 represents a newline and point is on that newline. Fixes cursor
5805 positioning on the newline at EOL of R2L text within L2R
5806 paragraph, and vice versa.
5807 (try_cursor_movement): Check continued rows, in addition to
5808 continuation rows. Fixes unwarranted scroll when point enters a
5809 continued line of R2L text within an L2R paragraph, or vice versa.
5810 (cursor_row_p): Consider the case of point being equal to
5811 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
5812 from the end of a short line to the beginning of a continued line
5813 of R2L text within L2R paragraph.
5814 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
5815 composed characters.
5980d4c6 5816
f67cdd7f
EZ
5817 * bidi.c (bidi_check_type): Use xassert.
5818 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
5819 members.
5820
bca633fb
EZ
58212011-08-23 Eli Zaretskii <eliz@gnu.org>
5822
5823 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
5824 a character.
5825
4a5885a7
CY
58262011-08-23 Chong Yidong <cyd@stupidchicken.com>
5827
5828 * nsfont.m (ns_otf_to_script): Fix typo.
5829
0902a04e
KH
58302011-08-22 Kenichi Handa <handa@m17n.org>
5831
5832 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
5833 extra slot even if the purpose is char-code-property-table.
5834
1a2e6670
EZ
58352011-08-23 Eli Zaretskii <eliz@gnu.org>
5836
8ddde651
EZ
5837 * xdisp.c (redisplay_window): When computing centering_position,
5838 account for the height of the header line. (Bug#8874)
5839
425cc014
EZ
5840 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
5841 instead of CHAR_TO_BYTE. Fixes a crash when a completion
5842 candidate is selected by the mouse, and that candidate has a
5843 composed character under the mouse.
5844
1a2e6670
EZ
5845 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
5846 coordinates reported by pos-visible-in-window-p for a composed
5847 character in column zero.
5848
8b76d6f8
SM
58492011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
5850
5851 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
5852
dac347dd
EZ
58532011-08-22 Eli Zaretskii <eliz@gnu.org>
5854
5855 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
5856 consider it a hit if to_charpos is anywhere in the range of the
5857 composed buffer positions.
5858
e013fb34
CY
58592011-08-22 Chong Yidong <cyd@stupidchicken.com>
5860
5861 * image.c (gif_load): Don't assume that each subimage has the same
5862 dimensions as the base image. Handle disposal method that is
5863 "undefined" by the gif spec (Bug#9335).
5864
bd1ba3e8
CY
58652011-08-20 Chong Yidong <cyd@stupidchicken.com>
5866
5867 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 5868 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 5869
54a1215b
EZ
58702011-08-19 Eli Zaretskii <eliz@gnu.org>
5871
823564e5
EZ
5872 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
5873 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
5874 from an Org mode buffer to a Speedbar frame.
5875
54a1215b
EZ
5876 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
5877 a composition, take its buffer position from IT->cmp_it.charpos.
5878 Fixes cursor positioning at the beginning of a line that begins
5879 with a composed character.
5880
9778ebcc
EZ
58812011-08-18 Eli Zaretskii <eliz@gnu.org>
5882
0be6ee06
EZ
5883 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
5884 character bidirectional type, use STRONG_L instead. Fixes crashes
5885 in a buffer produced by `describe-categories'.
5886
9778ebcc
EZ
5887 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
5888 members before the level stack, so they would be saved and
5889 restored when copying iterator state. Fixes incorrect reordering
5890 around TABs covered by display properties.
5891
156bffbe
AS
58922011-08-18 Andreas Schwab <schwab@linux-m68k.org>
5893
6b02f655 5894 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 5895
72ad093b
CY
58962011-08-17 Chong Yidong <cyd@stupidchicken.com>
5897
5898 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
5899 (internal_condition_case_2, internal_condition_case_n):
5900 Remove unnecessary aborts (Bug#9081).
72ad093b 5901
35774242
EZ
59022011-08-17 Eli Zaretskii <eliz@gnu.org>
5903
5904 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
5905 has no `load' handler, try opening the file locally. (Bug#9311)
5906
db76dd85
KB
59072011-08-16 Ken Brown <kbrown@cornell.edu>
5908
5909 * gmalloc.c: Expand comment.
5910
b215eee5
EZ
59112011-08-16 Eli Zaretskii <eliz@gnu.org>
5912
5913 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
5914 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
5915
a4579d33
KB
59162011-08-16 Ken Brown <kbrown@cornell.edu>
5917
5918 Fix memory allocation problems in Cygwin build (Bug#9273).
5919
5920 * unexcw.c ( __malloc_initialized): Declare external variable.
5921 (fixup_executable): Force the dumped emacs to reinitialize malloc.
5922
8b76d6f8
SM
5923 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
5924 New variables.
a4579d33
KB
5925 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
5926 dumped emacs.
5927 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
5928 in the static heap.
5929 [CYGWIN] (special_realloc): New function.
5930 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
5931 requests to realloc storage in the static heap.
5932
3ebec551
PE
59332011-08-15 Paul Eggert <eggert@cs.ucla.edu>
5934
5935 * bidi.c (bidi_initialize): Remove unused local.
5936
9fd8be00
EZ
59372011-08-15 Eli Zaretskii <eliz@gnu.org>
5938
6b02f655
SM
5939 * bidimirror.h:
5940 * biditype.h: Remove file.
5941 * makefile.w32-in ($(BLD)/bidi.$(O)):
5942 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
5943
5944 * dispextern.h: Fix a typo in the comment to bidi_type_t.
5945
5946 * chartab.c: Improve commentary for the uniprop_table API.
5947
32413314
EZ
5948 * bidi.c (bidi_paragraph_init): Support zero value of
5949 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
5950 (bidi_initialize): Use uniprop_table instead of including
5951 biditype.h and bidimirror.h.
32413314 5952
9fd8be00
EZ
5953 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
5954 coordinates of the iterator when restoring from ppos_it.
5955 (Bug#9296)
5956
5cf2b69b
KH
59572011-08-14 Kenichi Handa <handa@m17n.org>
5958
5959 * process.c (create_process): Call setup_process_coding_systems
72ad093b 5960 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 5961
daf17d00
EZ
59622011-08-14 Eli Zaretskii <eliz@gnu.org>
5963
5964 * xdisp.c (move_it_in_display_line_to): Don't invoke
5965 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
5966 ppos_it. Fixes vertical cursor motion when line beginning is
5967 covered by an image. (Bug#9296)
5968
08e3161a
JD
59692011-08-14 Jan Djärv <jan.h.d@swipnet.se>
5970
5971 * nsterm.h (ns_run_ascript): Declare.
5972 (NSAPP_DATA2_RUNASSCRIPT): Define.
5973
5974 * nsfns.m (as_script, as_result, as_status): New static variables.
5975 (ns_run_ascript): New function.
5e617bc2 5976 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
5977 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
5978 the event loop. Get status from as_status (Bug#7276).
5979
5980 * nsterm.m (sendEvent): If event is NSApplicationDefined and
5981 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
5982 the event loop (Bug#7276).
5983
a3720aa2
AS
59842011-08-14 Andreas Schwab <schwab@linux-m68k.org>
5985
5986 * gnutls.c (QCgnutls_bootprop_priority)
5987 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
5988 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
5989 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
5990 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
5991 (QCgnutls_bootprop_verify_hostname_error)
5992 (QCgnutls_bootprop_callbacks_verify): Rename from
5993 Qgnutls_bootprop_..., all uses changed.
5994
5995 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
5996 uses changed.
5997
0a0d27fb
PE
59982011-08-14 Paul Eggert <eggert@cs.ucla.edu>
5999
19d5c50c
PE
6000 * xfaces.c (Qframe_set_background_mode): Now static.
6001 * dispextern.h (Qframe_set_background_mode): Remove decl.
6002
0a0d27fb
PE
6003 * process.c (Fnetwork_interface_info): Declare local only if needed.
6004
377538cb
JD
60052011-08-13 Jan Djärv <jan.h.d@swipnet.se>
6006
6007 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
6008 (Fnetwork_interface_list): Allocate in increments of bytes instead
6009 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
6010 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
6011 sockaddr.
6012 (struct ifflag_def): notrailers is smart on OSX.
6013 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
6014 Get hardware address with getifaddrs if available.
6015
08fff70c
EZ
60162011-08-12 Eli Zaretskii <eliz@gnu.org>
6017
6018 * xdisp.c (iterate_out_of_display_property): xassert that
6019 IT->position is set to within IT->object's boundaries. Break from
6020 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
6021 when IT->position is set up wrongly due to some bug.
6022 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
6023 (push_display_prop): Allow GET_FROM_STRING as IT->method on
6024 entry. Force push_it to save on the stack the current
6025 buffer/string position, to be restored by pop_it. Fix flags in
6026 the iterator structure wrt the object coming from a display
6027 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
6028 properties. (Bug#9284)
6029
7be1c708 60302011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 6031
7be1c708
CY
6032 * fontset.c (fontset_get_font_group): Add proper type checks.
6033 (Bug#9172)
aac0c6e3 6034
7be1c708 60352011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 6036
7be1c708
CY
6037 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
6038 and LC_VERSION_MIN_MACOSX.
6039 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
6040 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 6041
97bb72a6
EZ
60422011-08-08 Eli Zaretskii <eliz@gnu.org>
6043
6044 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
6045 no-display-properties-and-no-overlays under bidi display.
6046 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 6047 properties and overlays.
97bb72a6 6048
d5617611
CY
60492011-08-08 Chong Yidong <cyd@stupidchicken.com>
6050
37e11a63
CY
6051 * editfns.c (Fset_time_zone_rule): Document relationship with the
6052 setenv function.
6053
d5617611
CY
6054 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
6055 the font entity extracted from the cache (Bug#8109).
6056
58872834
CY
60572011-08-07 Chong Yidong <cyd@stupidchicken.com>
6058
6059 * composite.c (autocmp_chars): Don't reset point. That is done by
6060 restore_point_unwind (Bug#5984).
6061
75bfc667
JL
60622011-08-07 Juri Linkov <juri@jurta.org>
6063
6064 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
6065 to show the arg `TIME' instead of `TIMEVAL'.
6066
d1410150
EZ
60672011-08-06 Eli Zaretskii <eliz@gnu.org>
6068
6069 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
6070 display property strides EOL and includes a newline, as in
6071 longlines-mode. (Bug#9254)
75b771e4
EZ
6072 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
6073 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
6074
6075 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
6076 is non-zero, even if the data buffer is NULL. Fixes a crash in
6077 vertical-motion with longlines-mode. (Bug#9254)
6078
35928349
EZ
60792011-08-05 Eli Zaretskii <eliz@gnu.org>
6080
ec7cc85b
EZ
6081 * bidi.c <bidi_cache_total_alloc>: Now static.
6082 (bidi_initialize): Initialize bidi_cache_total_alloc.
6083
8b76d6f8 6084 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
6085 cache. (Bug#9221)
6086
6087 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
6088 amount allocated this far in `bidi_cache_total_alloc'.
6089 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
6090 non-zero, only free the data buffer without restoring the cache
6091 contents. All callers changed.
6092
6093 * dispextern.h (bidi_unshelve_cache): Update prototype.
6094
6095 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
6096 (move_it_in_display_line, move_it_to)
6097 (move_it_vertically_backward, move_it_by_lines): Replace the call
6098 to xfree to an equivalent call to bidi_unshelve_cache.
6099 (move_it_in_display_line_to): Fix logic of returning
412b6358 6100 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 6101
e2e2423b
EZ
61022011-08-05 Eli Zaretskii <eliz@gnu.org>
6103
6104 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
6105 came from a string character with a `cursor' property. (Bug#9229)
6106
ae9e757a
JD
61072011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6108
6109 * Makefile.in (LIB_PTHREAD): New variable.
6110 (LIBES): Add LIB_PTHREAD (Bug#9216).
6111
6112 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
6113 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
6114
213bd7f2
AS
61152011-08-04 Andreas Schwab <schwab@linux-m68k.org>
6116
6b02f655 6117 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 6118
99aaf75f
JD
61192011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6120
6121 * xterm.c (x_find_topmost_parent): New function.
6122 (x_set_frame_alpha): Find topmost parent window with
6123 x_find_topmost_parent and set the property there also (bug#9181).
6124 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
6125
c74e9d86
PE
61262011-08-04 Paul Eggert <eggert@cs.ucla.edu>
6127
6128 * callproc.c (Fcall_process): Avoid vfork clobbering
6129 the local vars buffer, coding_systems, current_dir.
6130
640c8776
SM
61312011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
6132
6133 * keymap.c (Fmake_composed_keymap): Move to subr.el.
6134
f26d0e4c
PE
61352011-08-03 Paul Eggert <eggert@cs.ucla.edu>
6136
8a10d76c
PE
6137 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
6138 so that it is not optimized away.
6139
f26d0e4c
PE
6140 * xdisp.c (compute_display_string_pos): Remove unused local.
6141
55439c61
EZ
61422011-08-02 Eli Zaretskii <eliz@gnu.org>
6143
6144 Fix slow cursor motion and scrolling in large buffers with
6145 selective display, like Org Mode buffers. (Bug#9218)
6146
6147 * dispextern.h (struct bidi_it): New member disp_prop_p.
6148
6149 * xdisp.c: Remove one-slot cache of display string positions.
6150 (compute_display_string_pos): Accept an additional argument
5e617bc2 6151 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
6152 for a display string or property. If found, set DISP_PROP_P
6153 non-zero.
6154
6155 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
6156 DISP_PROP_P, and pass it to compute_display_string_pos.
6157 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
6158 non-zero. All callers of bidi_fetch_char changed.
6159
fb33fa43
SM
61602011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
6161
6162 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
6163
b099e063
DM
61642010-12-03 Don March <don@ohspite.net>
6165
6166 * keymap.c (Fdefine_key): Fix non-prefix key error message when
6167 last character M-[char] is translated to ESC [char] (bug#7541).
6168
5cc7f7af
KH
61692011-08-02 Kenichi Handa <handa@m17n.org>
6170
d0fffa3f 6171 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
6172
6173 * chartab.c (uniprop_table): Make it non-static.
6174
525d5e6e
EZ
61752011-08-01 Eli Zaretskii <eliz@gnu.org>
6176
6177 * xdisp.c (forward_to_next_line_start): Accept additional argument
6178 BIDI_IT_PREV, and store into it the state of the bidi iterator had
6179 on the newline.
6180 (reseat_at_next_visible_line_start): Use the bidi iterator state
6181 returned by forward_to_next_line_start to restore the state of
6182 it->bidi_it after backing up to previous newline. (Bug#9212)
6183
31011111
AS
61842011-07-30 Andreas Schwab <schwab@linux-m68k.org>
6185
6186 * regex.c (re_comp): Protoize.
6187 (re_exec): Fix return type.
6188 (regexec): Fix type of `ret'. (Bug#9203)
6189
476371c4
PE
61902011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6191
e5d76069
PE
6192 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
6193 This is needed if max-image-size is a floating-point number.
6194
9a79b20c
AS
61952011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6196
6197 * print.c (print_object): Print empty symbol as ##.
6198
6199 * lread.c (read1): Read ## as empty symbol.
6200
d8c2fa78
AA
62012011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6202
6203 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
6204 setting frame foreground color (Bug#9175).
6205 (x_set_background_color): Likewise.
6206
ffe57a7a
AA
6207 * nsmenu.m (-setText): Size tooltip dimensions precisely to
6208 contents (Bug#9176).
6209 (EmacsTooltip -init): Remove bezels and add shadows to
6210 tooltip windows.
6211
bf3492a5
AA
6212 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
6213 or scroll bar (Bug#8470).
6214
d55e9c53
AA
6215 * nsfont.m (nsfont_open): Remove assignment to voffset and
6216 unnecessary vars hshink, expand, hd, full_height, min_height.
6217 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
6218
6219 * nsterm.h (nsfont_info): Remove voffset field.
6220
d8c2fa78 62212011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
6222
6223 Implement strike-through and overline on NextStep (Bug#8863).
6224
6225 * nsfont.m (nsfont_open): Use underline position provided by font,
6226 instead of hard-coded value of 2.
6227 (nsfont_draw): Call ns_draw_text_decoration instead.
6228
6229 * nsterm.h: Add declaration for ns_draw_text_decoration.
6230
6231 * nsterm.m (ns_draw_text_decoration): New function for drawing
6232 underline, overline, and strike-through.
6233 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
6234 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 6235 accommodate underlining, etc.
4843aac3 6236
4cc60b9b
EZ
62372011-07-28 Eli Zaretskii <eliz@gnu.org>
6238
bc7ece87
EZ
6239 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
6240 default.
4cc60b9b 6241
476371c4
PE
62422011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6243
66606eea
PE
6244 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
6245 Without this fix, if a signal arrives just after memory fills up,
6246 'malloc' might be invoked reentrantly.
6247
476371c4
PE
6248 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
6249 In other words, assume that every image size is allowed, on non-X
6250 hosts. This assumption is probably wrong, but it lets Emacs compile.
6251
f3fcc40d
AS
62522011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6253
6254 * regex.c (re_iswctype): Convert return values to boolean.
6255
350c992f
EZ
62562011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
6257
6258 * xdisp.c (compute_display_string_pos): Don't use cached display
6259 string position if the buffer had its restriction changed.
6260 (Bug#9184)
6261
5266b4bb
PE
62622011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6263
6264 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
6265
2573a837 62662011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 6267
41f55ccd 6268 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 6269
39e378da
PE
6270 * bidi.c: Integer size and overflow fixes.
6271 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
6272 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
6273 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6274 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
6275 (bidi_find_other_level_edge):
6276 Use ptrdiff_t instead of EMACS_INT where either will do.
6277 This works better on 32-bit hosts configured --with-wide-int.
6278 (bidi_cache_ensure_space): Check for size-calculation overflow.
6279 Use % rather than repeated addition, for better worst-case speed.
6280 Don't set bidi_cache_size until after xrealloc returns, because it
6281 might not return.
6282 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
6283 (bidi_cache_ensure_space): Also check that the bidi cache size
6284 does not exceed that of the largest Lisp string or buffer. See Eli
6285 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 6286
5e927815
PE
6287 * alloc.c (__malloc_size_t): Remove.
6288 All uses replaced by size_t. See Andreas Schwab's note
6289 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
6290
ca4aa935
PE
6291 * image.c: Improve checking for integer overflow.
6292 (check_image_size): Assume that f is nonnull, since
6293 it is always nonnull in practice. This is one less thing to
6294 worry about when checking for integer overflow later.
6295 (x_check_image_size): New function, which checks for integer
6296 overflow issues inside X.
6297 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
6298 This removes the need for a memory_full check.
6299 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
6300 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
6301 (xbm_read_bitmap_data): Change locals back to 'int', since
6302 their values must fit in 'int'.
6303 (xpm_load_image, png_load, tiff_load):
6304 Invoke x_create_x_image_and_pixmap earlier,
6305 to avoid much needless work if the image is too large.
6306 (tiff_load): Treat overly large images as if
6307 x_create_x_image_and_pixmap failed, not as malloc failures.
6308 (gs_load): Use x_check_image_size.
6309
5f8f9cc2
PE
6310 * gtkutil.c: Omit integer casts.
6311 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
6312 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
6313
5adf60bc
PE
6314 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
6315
c8907a93
PE
6316 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
6317 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
6318 would wrongly return t on a 64-bit host.
6319
e3c25c68
PE
6320 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
6321 The plain *_OVERFLOW macros run afoul of GCC bug 49705
6322 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
6323 and therefore cause GCC to emit a bogus diagnostic in some cases.
6324
3f791afe
PE
6325 * image.c: Integer signedness and overflow and related fixes.
6326 This is not an exhaustive set of fixes, but it's time to
6327 record what I've got.
6328 (lookup_pixel_color, check_image_size): Remove redundant decls.
6329 (check_image_size): Don't assume that arbitrary EMACS_INT values
6330 fit in 'int', or that arbitrary 'double' values fit in 'int'.
6331 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
6332 (tiff_load, imagemagick_load_image):
6333 Check for overflow in size calculations.
6334 (x_create_x_image_and_pixmap): Remove unnecessary test for
6335 xmalloc returning NULL; that can't happen.
6336 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
6337 (xpm_color_bucket): Use better integer hashing function.
6338 (xpm_cache_color): Don't possibly over-allocate memory.
6339 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
6340 (gif_memory_source):
6341 Use ptrdiff_t, not int or size_t, to record sizes.
6342 (png_load): Don't assume values greater than 2**31 fit in 'int'.
6343 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
6344 either works, as we prefer signed integers.
6345 (tiff_read_from_memory, tiff_write_from_memory):
6346 Return tsize_t, not size_t, since that's what the TIFF API wants.
6347 (tiff_read_from_memory): Don't fail simply because the read would
6348 go past EOF; instead, return a short read.
6349 (tiff_load): Omit no-longer-needed casts.
6350 (Fimagemagick_types): Don't assume size fits into 'int'.
6351
3cc5a532
PE
6352 Improve hashing quality when configured --with-wide-int.
6353 * fns.c (hash_string): New function, taken from sxhash_string.
6354 Do not discard information about ASCII character case; this
6355 discarding is no longer needed.
6356 (sxhash-string): Use it. Change sig to match it. Caller changed.
6357 * lisp.h: Declare it.
6358 * lread.c (hash_string): Remove, since we now use fns.c's version.
6359 The fns.c version returns a wider integer if --with-wide-int is
6360 specified, so this should help the quality of the hashing a bit.
6361
b312a492
PE
6362 * emacs.c: Integer overflow minor fix.
6363 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
6364 Define only if GNU_LINUX.
6365 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
6366
dfd153ae
PE
6367 * dispnew.c: Integer signedness and overflow fixes.
6368 Remove unnecessary forward decls, that were a maintenance hassle.
6369 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
6370 All uses changed.
6371 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
6372 (scrolling_window): Use ptrdiff_t, not int, for byte count.
6373 (prepare_desired_row, line_draw_cost):
6374 Use int, not unsigned, where either works.
6375 (save_current_matrix, restore_current_matrix):
6376 Use ptrdiff_t, not size_t, where either works.
6377 (init_display): Check for overflow more accurately, and without
6378 relying on undefined behavior.
6379
a81d11a3
PE
6380 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
6381 Remove, replacing with the new symbols in lisp.h. All uses changed.
6382 * fileio.c (make_temp_name):
6383 * filelock.c (lock_file_1, lock_file):
6384 * xdisp.c (message_dolog):
6385 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
6386 Use pMd etc. instead.
6387 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
6388 replacing the pWIDE etc. symbols removed from editfns.c.
6389
3300e6fd
PE
6390 * keyboard.h (num_input_events): Now uintmax_t.
6391 This is (very slightly) less likely to mess up due to wraparound.
6392 All uses changed.
6393
fd05c7e9
PE
6394 * buffer.c: Integer signedness fixes.
6395 (alloc_buffer_text, enlarge_buffer_text):
6396 Use ptrdiff_t rather than size_t when either will do, as we prefer
6397 signed integers.
6398
903fe15d
PE
6399 * alloc.c: Integer signedness and overflow fixes.
6400 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
6401 (__malloc_size_t): Default to size_t, not to int.
6402 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
6403 (Fgarbage_collect, mark_object_loop_halt, mark_object):
6404 Prefer ptrdiff_t to size_t when either would do, as we prefer
6405 signed integers.
6406 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
6407 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
6408 Now const. Initialize with values that are in range even if char
6409 is signed.
6410 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
6411 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
6412 These functions do the right thing with sizes > 2**32.
6413 (check_depth): Now ptrdiff_t, not int.
6414 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
6415 Adjust to new way of storing sizes. Check for size overflow bugs
6416 in rest of code.
6417 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
6418 slightly wrong anyway, as it missed one instance of
6419 XMALLOC_OVERRUN_CHECK_OVERHEAD.
6420 (refill_memory_reserve): Omit needless cast to size_t.
6421 (mark_object_loop_halt): Mark as externally visible.
6422
ac82cc6a
PE
6423 * xselect.c: Integer signedness and overflow fixes.
6424 (Fx_register_dnd_atom, x_handle_dnd_message):
6425 Use ptrdiff_t, not size_t, since we prefer signed.
6426 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
6427 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
6428 x_dnd_atoms_size and x_dnd_atoms_length.
6429
c2d1e36d
PE
6430 * doprnt.c: Prefer signed to unsigned when either works.
6431 * eval.c (verror):
6432 * doprnt.c (doprnt):
6433 * lisp.h (doprnt):
6434 * xdisp.c (vmessage):
6435 Use ptrdiff_t, not size_t, when using or implementing doprnt,
6436 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
6437 prefer signed arithmetic to avoid comparison confusion.
6438 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
6439 but is a bit tricky.
6440
0e926e56
PE
6441 Assume freestanding C89 headers, string.h, stdlib.h.
6442 * data.c, doprnt.c, floatfns.c, print.c:
6443 Include float.h unconditionally.
6444 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
6445 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
6446 * regex.c: Likewise for stddef.h, string.h.
6447 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
6448 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
6449 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
6450 (STDC_HEADERS): Remove obsolete defines.
6451 * sysdep.c: Include limits.h unconditionally.
6452
9cfdb3ec
PE
6453 Assume support for memcmp, memcpy, memmove, memset.
6454 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
6455 * regex.c (memcmp, memcpy):
6456 Remove; we assume C89 now.
6457
6458 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
6459 (__malloc_safe_bcopy): Remove; no longer needed.
6460
cf950e6b 6461 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
6462 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
6463 well either way, and we prefer signed to unsigned.
6464
dbf38e02
LMI
64652011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
6466
6467 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
6468 closes the connection while we're reading (bug#9182).
6469
d6f0886c 64702011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 6471
d6f0886c
JD
6472 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
6473 are specified (Bug#9168).
24e0f6b1 6474
2eb1f9e6
PE
64752011-07-25 Paul Eggert <eggert@cs.ucla.edu>
6476
6477 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
6478 Found by GCC static checking and --with-wide-int on a 32-bit host.
6479
22381272 64802011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
6481
6482 * xdisp.c (compute_display_string_pos): Fix logic of caching
6483 previous display string position. Initialize cached_prev_pos to
6484 -1. Fixes slow-down at the beginning of a buffer.
6485
f25e39b4
EZ
64862011-07-24 Eli Zaretskii <eliz@gnu.org>
6487
6488 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
6489 for attrs[LFACE_FONTSET_INDEX].
6490
04c4b52e
PE
64912011-07-23 Paul Eggert <eggert@cs.ucla.edu>
6492
6493 * xml.c (parse_region): Remove unused local
6494 that was recently introduced.
6495
c1734fbd
EZ
64962011-07-23 Eli Zaretskii <eliz@gnu.org>
6497
be18c5a5
EZ
6498 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
6499 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
6500
c1734fbd
EZ
6501 * xdisp.c (move_it_in_display_line_to): Record the best matching
6502 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
6503 exit if none of the characters scanned was an exact match.
6504 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
6505 when exact match is impossible due to invisible text, and the
6506 lines are truncated.
6507
a258d627
JD
65082011-07-23 Jan Djärv <jan.h.d@swipnet.se>
6509
6510 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
6511 for OSX >= 10.7.
6512
b6d5a689
EZ
65132011-07-22 Eli Zaretskii <eliz@gnu.org>
6514
0f74f785
EZ
6515 Fix a significant slow-down of cursor motion with C-n, C-p,
6516 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
6517 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 6518 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
6519 (next_element_from_buffer): Call compute_stop_pos_backwards to
6520 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
6521 base_level_stop.
6522 (reseat): Don't look for prev_stop, as that could mean a very long
6523 run.
6524 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
6525 <cached_disp_overlay_modiff>: Cache for last found display string
6526 position.
551918c1 6527 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
6528 about the same buffer in the same area of character positions, and
6529 the buffer wasn't changed since the time the display string
6530 position was cached.
551918c1 6531
b2d0c91a
EZ
65322011-07-22 Eli Zaretskii <eliz@gnu.org>
6533
6534 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
6535 is an integer, which is important for empty lines. (Bug#9149)
6536
043604ee
CY
65372011-07-22 Chong Yidong <cyd@stupidchicken.com>
6538
6539 * frame.c (Fmodify_frame_parameters): In tty case, update the
6540 default face if necessary (Bug#4238).
6541
da4adb04
CY
65422011-07-21 Chong Yidong <cyd@stupidchicken.com>
6543
6544 * editfns.c (Fstring_to_char): No need to explain what a character
6545 is in the docstring (Bug#6576).
6546
9abd0532
LMI
65472011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6548
6549 * xml.c (parse_region): Make sure we always return a tree.
6550
36881d16
HK
65512011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
6552
6553 * xml.c (parse_region): If a document contains only comments,
6554 return that, too.
6555
1e98674d
LMI
65562011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6557
6558 * xml.c (make_dom): Return comments, too.
6559
590bd467
PE
65602011-07-19 Paul Eggert <eggert@cs.ucla.edu>
6561
6562 Port to OpenBSD.
6563 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
6564 and the surrounding thread.
6565 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
6566 rather than fgets, and retry after EINTR. Otherwise, 'emacs
6567 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
6568 timer goes off.
6569 * s/openbsd.h (BROKEN_SIGIO): Define.
6570 * unexelf.c (unexec) [__OpenBSD__]:
6571 Don't update the .mdebug section of the Alpha COFF symbol table.
6572
f41628b2
LMI
65732011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6574
6575 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
6576 (bug#8460).
6577
b59b67c5
PE
65782011-07-18 Paul Eggert <eggert@cs.ucla.edu>
6579
15e3a074
PE
6580 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
6581 This fixes some race conditions on the permissions of any newly
6582 created file.
6583
41bed37d
PE
6584 * alloc.c (valid_pointer_p): Use pipe, not open.
6585 This fixes some permissions issues when debugging.
6586
b59b67c5
PE
6587 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
6588 If fchown fails to set both uid and gid, try to set just gid,
6589 as that is sometimes allowed. Adjust the file's mode to eliminate
6590 setuid or setgid bits that are inappropriate if fchown fails.
6591
925a6be7
SM
65922011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6593
6594 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
6595 to compare Lisp_Objects.
6596 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
6597 global_gnutls_log_level, don't mistake it for a Lisp_Object.
6598 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
6599
52968808
AS
66002011-07-17 Andreas Schwab <schwab@linux-m68k.org>
6601
0a6a104b
AS
6602 * lread.c (read_integer): Unread even EOF character.
6603 (read1): Likewise. Properly record start position of symbol.
6604
52968808
AS
6605 * lread.c (read1): Read `#:' as empty uninterned symbol if no
6606 symbol character follows.
6607
9e381cdd
PE
66082011-07-17 Paul Eggert <eggert@cs.ucla.edu>
6609
6610 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
6611 This works around a problem with the previous change to Fcopy_file.
6612 Recent glibc declares fchown with __attribute__((warn_unused_result)),
6613 and without this change, GCC might complain about discarding
6614 fchown's return value.
6615
b5641435
JB
66162011-07-16 Juanma Barranquero <lekktu@gmail.com>
6617
6618 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
6619
a8031457
PE
66202011-07-16 Paul Eggert <eggert@cs.ucla.edu>
6621
6622 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
6623
dd889327
LMI
66242011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
6625
750c33f7
LMI
6626 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
6627 it's used from the C level.
6628
dd889327
LMI
6629 * process.c: Use the same condition for POLL_FOR_INPUT in both
6630 keyboard.c and process.c (bug#1858).
6631
87e86684
LM
66322011-07-09 Lawrence Mitchell <wence@gmx.li>
6633
6634 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
6635 (Fgnutls_boot): Use it.
6636
64348f40
AS
66372011-07-15 Andreas Schwab <schwab@linux-m68k.org>
6638
6639 * doc.c (Fsubstitute_command_keys): Revert last change.
6640
1d698799
LMI
66412011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
6642
f863868c
LMI
6643 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
6644 quotes the next character, and doesn't affect other longer
6645 sequences (bug#8935).
6646
1d698799
LMI
6647 * lread.c (syms_of_lread): Clarify that is isn't only
6648 `eval-buffer' and `eval-defun' that's affected by
6649 `lexical-binding' (bug#8460).
6650
aa4b6df6
EZ
66512011-07-15 Eli Zaretskii <eliz@gnu.org>
6652
6653 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 6654 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 6655
5d856da6
PE
66562011-07-14 Paul Eggert <eggert@cs.ucla.edu>
6657
ad6042bb
PE
6658 Fix minor problems found by static checking.
6659 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
6660 (elsz): Now a signed constant, not a size_t var. We prefer signed
6661 types to unsigned, to avoid integer comparison confusion. Without
6662 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
6663 "cannot optimize loop, the loop counter may overflow", a symptom
6664 of the confusion.
f00bbb22 6665 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
6666 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
6667
6468f31c
LMI
66682011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6669
49080b10
LMI
6670 * search.c (Fre_search_backward): Mention `case-fold-search' in
6671 all the re_search_* functions (bug#8138).
6672
6468f31c
LMI
6673 * keyboard.c (Fopen_dribble_file): Document when the file is
6674 closed (bug#8056).
6675
c965adc5
EZ
66762011-07-14 Eli Zaretskii <eliz@gnu.org>
6677
df9733bf
EZ
6678 * bidi.c (bidi_dump_cached_states): Fix format of displaying
6679 bidi_cache_idx.
6680
0bb23927
EZ
6681 Support bidi reordering of display and overlay strings.
6682 * xdisp.c (compute_display_string_pos)
6683 (compute_display_string_end): Accept additional argument STRING.
6684 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
6685 (reseat_to_string): Initialize bidi_it->string.s and
6686 bidi_it->string.schars.
6687 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
6688 NULL (avoids a crash in bidi_paragraph_init).
6689 Initialize itb.string.lstring.
0bb23927
EZ
6690 (init_iterator): Call bidi_init_it only of a valid
6691 buffer position was specified. Initialize paragraph_embedding to
6692 L2R.
6693 (reseat_to_string): Initialize the bidi iterator.
6694 (display_string): If we need to ignore text properties of
6695 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
6696 original value of -1 will not work with bidi.)
6697 (compute_display_string_pos): First arg is now struct
6698 `text_pos *'; all callers changed. Support display properties on
6699 Lisp strings.
6700 (compute_display_string_end): Support display properties on Lisp
6701 strings.
6702 (init_iterator, reseat_1, reseat_to_string): Initialize the
6703 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
6704 when iterating on a string not from display properties).
640c8776
SM
6705 (compute_display_string_pos, compute_display_string_end):
6706 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
6707 arrow keys.
6708 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
6709 base_level_stop; instead, set base_level_stop to BEGV.
6710 Fixes crashes in vertical-motion.
0bb23927
EZ
6711 (next_element_from_buffer): Improve commentary for when
6712 the iterator is before prev_stop.
6713 (init_iterator): Initialize bidi_p from the default value of
6714 bidi-display-reordering, not from buffer-local value. Use the
6715 buffer-local value only if initializing for buffer iteration.
6716 (handle_invisible_prop): Support invisible properties on strings
6717 that are being bidi-reordered.
6718 (set_iterator_to_next): Support bidi reordering of C strings and
6719 Lisp strings.
6720 (next_element_from_string): Support bidi reordering of Lisp
6721 strings.
6722 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
6723 (display_string): Support display of R2L glyph rows.
6724 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
6725 (init_iterator): Don't initialize it->bidi_p for strings
6726 here.
6727 (reseat_to_string): Initialize it->bidi_p for strings here.
6728 (next_element_from_string, next_element_from_c_string)
6729 (next_element_from_buffer): Add xassert's for correspondence
6730 between IT's object being iterated and it->bidi_it.string
6731 structure.
6732 (face_before_or_after_it_pos): Support bidi iteration.
6733 (next_element_from_c_string): Handle the case of the first string
6734 character that is not the first one in the visual order.
6735 (get_visually_first_element): New function, refactored from common
6736 parts of next_element_from_buffer, next_element_from_string, and
6737 next_element_from_c_string.
6738 (tool_bar_lines_needed, redisplay_tool_bar)
6739 (display_menu_bar): Force left-to-right direction. Add a FIXME
6740 comment for making that be controlled by a user option.
6741 (push_it, pop_it): Save and restore the state of the
6742 bidi iterator. Save and restore the bidi_p flag.
6743 (pop_it): Iterate out of display property for string iteration as
6744 well.
6745 (iterate_out_of_display_property): Support iteration over strings.
6746 (handle_single_display_spec): Set up it->bidi_it for iteration
6747 over a display string, and call bidi_init_it.
6748 (handle_single_display_spec, next_overlay_string)
6749 (get_overlay_strings_1, push_display_prop): Set up the bidi
6750 iterator for displaying display or overlay strings.
6751 (forward_to_next_line_start): Don't use the shortcut if
6752 bidi-iterating.
6753 (back_to_previous_visible_line_start): If handle_display_prop
6754 pushed the iterator stack, restore the internal state of the bidi
6755 iterator by calling bidi_pop_it same number of times.
6756 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
6757 and we are bidi-iterating, don't decrement the iterator position;
6758 instead, set the first_elt flag in the bidi iterator, to produce
6759 the same effect.
6760 (reseat_1): Remove redundant setting of string_from_display_prop_p.
6761 (push_display_prop): xassert that we are iterating a buffer.
6762 (push_it, pop_it): Save and restore paragraph_embedding member.
6763 (handle_single_display_spec, next_overlay_string)
6764 (get_overlay_strings_1, reseat_1, reseat_to_string)
6765 (push_display_prop): Set up the `unibyte' member of bidi_it.string
6766 correctly. Don't assume unibyte strings are not bidi-reordered.
6767 (compute_display_string_pos)
6768 (compute_display_string_end): Fix handling the case of C string.
6769 (push_it, pop_it): Save and restore from_disp_prop_p.
6770 (handle_single_display_spec, push_display_prop): Set the
6771 from_disp_prop_p flag.
6772 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
6773 (pop_it): Call iterate_out_of_display_property only if we are
6774 popping after iteration over a string that came from a display
6775 property. Fix a typo in popping stretch info. Add an assertion
6776 for verifying that the iterator position is in sync with the bidi
6777 iterator.
6778 (handle_single_display_spec, get_overlay_strings_1)
6779 (push_display_prop): Fix initialization of paragraph direction for
6780 string when that of the parent object is not yet determined.
6781 (reseat_1): Call bidi_init_it to resync the bidi
6782 iterator with IT's position. (Bug#7616)
6783 (find_row_edges): If ROW->start.pos gives position
6784 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
6785 (handle_stop, back_to_previous_visible_line_start, reseat_1):
6786 Reset the from_disp_prop_p flag.
6787 (SAVE_IT, RESTORE_IT): New macros.
6788 (pos_visible_p, face_before_or_after_it_pos)
6789 (back_to_previous_visible_line_start)
6790 (move_it_in_display_line_to, move_it_in_display_line)
6791 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6792 (try_scrolling, redisplay_window, display_line): Use them when
6793 saving a temporary copy of the iterator and restoring it back.
6794 (back_to_previous_visible_line_start, reseat_1)
6795 (init_iterator): Empty the bidi cache "stack".
6796 (move_it_in_display_line_to): If iterator ended up at
6797 EOL, but we never saw any buffer positions smaller than
6798 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
6799 motion in bidi-reordered lines.
6800 (move_it_in_display_line_to): Record prev_method and prev_pos
6801 immediately before the call to set_iterator_to_next. Fixes cursor
6802 motion in bidi-reordered lines with stretch glyphs and strings
6803 displayed in margins. (Bug#8133) (Bug#8867)
6804 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
6805 TO_CHARPOS.
640c8776
SM
6806 (pos_visible_p): Support positions in bidi-reordered lines.
6807 Save and restore bidi cache.
0bb23927
EZ
6808
6809 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
6810 (bidi_paragraph_info): Delete unused struct.
6811 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
6812 (bidi_cache_start): New variable.
6813 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
6814 to zero.
6815 (bidi_cache_fetch_state, bidi_cache_search)
6816 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6817 (bidi_cache_find, bidi_peek_at_next_level)
6818 (bidi_level_of_next_char, bidi_find_other_level_edge)
6819 (bidi_move_to_visually_next): Compare cache index with
6820 bidi_cache_start rather than with zero.
6821 (bidi_fetch_char): Accept new argument STRING; all callers
6822 changed. Support iteration over a string. Support strings with
6823 display properties. Support unibyte strings. Fix the type of
6824 `len' according to what STRING_CHAR_AND_LENGTH expects.
6825 (bidi_paragraph_init, bidi_resolve_explicit_1)
6826 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
6827 (bidi_level_of_next_char, bidi_move_to_visually_next):
6828 Support iteration over a string.
0bb23927
EZ
6829 (bidi_set_sor_type, bidi_resolve_explicit_1)
6830 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
6831 can now be zero (for strings); special values 0 and -1 were
6832 changed to -1 and -2, respectively.
6833 (bidi_char_at_pos): New function.
6834 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
6835 Call it instead of FETCH_MULTIBYTE_CHAR.
6836 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
6837 initialized to valid values.
6838 (bidi_init_it): Don't initialize charpos and bytepos with invalid
6839 values.
6840 (bidi_level_of_next_char): Allow the sentinel "position" to pass
6841 the test for valid cached positions. Fix the logic for looking up
6842 the sentinel state in the cache. GCPRO the Lisp string we are
6843 iterating.
6844 (bidi_push_it, bidi_pop_it): New functions.
6845 (bidi_initialize): Initialize the bidi cache start stack pointer.
6846 (bidi_cache_ensure_space): New function, refactored from part of
6847 bidi_cache_iterator_state. Don't assume the required size is just
6848 one BIDI_CACHE_CHUNK away.
6849 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
6850 (bidi_count_bytes, bidi_char_at_pos): New functions.
6851 (bidi_cache_search): Don't assume bidi_cache_last_idx is
6852 always valid if bidi_cache_idx is valid.
6853 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
6854 is valid if it's going to be used.
6855 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
6856 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
6857 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6858 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
6859 (bidi_find_other_level_edge, bidi_cache_start_stack):
6860 All variables related to cache indices are now EMACS_INT.
c965adc5 6861
0bb23927
EZ
6862 * dispextern.h (struct bidi_string_data): New structure.
6863 (struct bidi_it): New member `string'. Make flag members be 1-bit
6864 fields, and put them last in the struct.
640c8776
SM
6865 (compute_display_string_pos, compute_display_string_end):
6866 Update prototypes.
0bb23927
EZ
6867 (bidi_push_it, bidi_pop_it): Add prototypes.
6868 (struct iterator_stack_entry): New members bidi_p,
6869 paragraph_embedding, and from_disp_prop_p.
6870 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
6871 (bidi_shelve_cache, bidi_unshelve_cache):
6872 Declare prototypes.
0bb23927
EZ
6873
6874 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
6875 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
6876 and vector-like objects.
6877
6878 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
6879 cache around display iteration.
6880
6881 * window.c (Fwindow_end, window_scroll_pixel_based)
6882 (displayed_window_lines, Frecenter): Save and restore the bidi
6883 cache around display iteration.
6884
3bbd2265
LMI
68852011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6886
6887 * editfns.c (Fdelete_region): Clarify the use of the named
6888 parameters (bug#6788).
6889
adc47434
MR
68902011-07-14 Martin Rudalics <rudalics@gmx.at>
6891
6892 * indent.c (Fvertical_motion): Set and restore w->pointm when
6893 saving and restoring the window's buffer (Bug#9006).
6894
837c31f8
LMI
68952011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
6896
6897 * editfns.c (Fstring_to_char): Clarify just what is returned
6898 (bug#6576). Text by Eli Zaretskii.
6899
ac389d0c
JB
69002011-07-13 Juanma Barranquero <lekktu@gmail.com>
6901
6902 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
6903
0be0ce47
EZ
69042011-07-13 Eli Zaretskii <eliz@gnu.org>
6905
6906 * buffer.c (mmap_find): Fix a typo.
6907
cd18e7e3
JB
69082011-07-13 Johan Bockgård <bojohan@gnu.org>
6909
6910 Fix execution of x selection hooks.
6911 * xselect.c (Qx_lost_selection_functions)
6912 (Qx_sent_selection_functions): New vars.
6913 (syms_of_xselect): DEFSYM them.
6914 (x_handle_selection_request): Pass Qx_sent_selection_functions
6915 rather than Vx_sent_selection_functions to Frun_hook_with_args.
6916 (x_handle_selection_clear,x_clear_frame_selections):
6917 Pass Qx_lost_selection_functions rather than
6918 Vx_lost_selection_functions to Frun_hook_with_args.
6919
47ea7f44
PE
69202011-07-13 Paul Eggert <eggert@cs.ucla.edu>
6921
ac389d0c 6922 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
6923 The old code sometimes used this field without initializing it.
6924
47ea7f44
PE
6925 * alloc.c (gc_sweep): Don't read past end of array.
6926 In theory, the old code could also have corrupted Emacs internals,
6927 though it'd be very unlikely.
6928
bc985c87
AS
69292011-07-12 Andreas Schwab <schwab@linux-m68k.org>
6930
6931 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 6932 argument. (Bug#4026)
bc985c87 6933
0cf34688
LMI
69342011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
6935
b3dadd76
LMI
6936 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
6937 key" (bug#4257).
6938
0cf34688
LMI
6939 * window.c (Fset_window_start): Doc fix (bug#4199).
6940 (Fset_window_hscroll): Ditto.
6941
270768cd
PE
69422011-07-12 Paul Eggert <eggert@cs.ucla.edu>
6943
077e3dda 6944 Fix minor new problems caught by GCC 4.6.1.
270768cd 6945 * term.c (init_tty): Remove unused local.
490011a6 6946 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 6947 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 6948 not used otherwise.
270768cd 6949
b1f58454
CY
69502011-07-12 Chong Yidong <cyd@stupidchicken.com>
6951
6952 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
6953
22b9578d
LMI
69542011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6955
6e70ab07
LMI
6956 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
6957 are the mini-buffer and the echo area (bug#3320).
6958
22b9578d
LMI
6959 * term.c (init_tty): Remove support for supdup, c10 and perq
6960 terminals, which are no longer supported (bug#1482).
6961
8974cc9f
JB
69622011-07-10 Johan Bockgård <bojohan@gnu.org>
6963
6964 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
6965
a560d974
JD
69662011-07-10 Jan Djärv <jan.h.d@swipnet.se>
6967
6968 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
6969 for non-popups (Bug#3642).
6970
1dae0f0a
AS
69712011-07-10 Andreas Schwab <schwab@linux-m68k.org>
6972
268c2c36 6973 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 6974 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
6975 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
6976 * cm.c (losecursor): Likewise.
1dae0f0a
AS
6977 * data.c (fmod): Likewise.
6978 * dispnew.c (swap_glyphs_in_rows): Likewise.
6979 * emacs.c (memory_warning_signal): Likewise.
6980 * floatfns.c (float_error): Likewise.
6981 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
6982 (otf_open, font_otf_capability, generate_otf_features)
6983 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
6984 Likewise.
6985 * image.c (pbm_read_file): Likewise.
6986 * indent.c (string_display_width): Likewise.
6987 * intervals.c (check_for_interval, search_for_interval)
6988 (inc_interval_count, count_intervals, root_interval)
6989 (adjust_intervals_for_insertion, make_new_interval): Likewise.
6990 * lread.c (defalias): Likewise.
268c2c36 6991 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
6992 * regex.c (set_image_of_range_1, set_image_of_range)
6993 (regex_grow_registers): Likewise.
6994 * sysdep.c (strerror): Likewise.
6995 * termcap.c (valid_filename_p, tprint, main): Likewise.
6996 * tparam.c (main): Likewise.
6997 * unexhp9k800.c (run_time_remap, save_data_space)
6998 (update_file_ptrs, read_header, write_header, calculate_checksum)
6999 (copy_file, copy_rest, display_header): Likewise.
7000 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
7001 Likewise.
7002 * xdisp.c (check_it): Likewise.
7003 * xfaces.c (register_color, unregister_color, unregister_colors):
7004 Likewise.
7005 * xfns.c (print_fontset_result): Likewise.
7006 * xrdb.c (member, fatal, main): Likewise.
7007
99033785
PE
70082011-07-10 Paul Eggert <eggert@cs.ucla.edu>
7009
7010 Fix minor problems found by static checking (Bug#9031).
7011 * chartab.c (char_table_set_range, map_sub_char_table):
7012 Remove unused locals.
7013 (uniprop_table): Now static.
7014 * composite.c (_work_char): Remove unused static var.
7015
9cb2ac56
JB
70162011-07-09 Juanma Barranquero <lekktu@gmail.com>
7017
7018 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
7019
f25661f0
JD
70202011-07-09 Jan Djärv <jan.h.d@swipnet.se>
7021
7022 * gtkutil.c (qttip_cb): Remove code without function.
7023
8278c4fe
EZ
70242011-07-09 Eli Zaretskii <eliz@gnu.org>
7025
7026 * w32.c (pthread_sigmask): New stub.
7027
1692ae2d 70282011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 7029
8a6ebd58 7030 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
7031 sigprocmask is portable only for single-threaded applications, and
7032 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
7033 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
7034 (LIBES): Use it.
7035 * callproc.c (Fcall_process):
7036 * process.c (create_process):
7037 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
7038 Use pthread_sigmask, not sigprocmask.
123403e4 7039
1b854618
JD
70402011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7041
7042 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
7043 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
7044 wrong (Bug#8591).
7045
3fe4b549
JD
70462011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7047
0ce7e563
JD
7048 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
7049 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
7050 (xg_hide_tooltip): Fix comment.
7051
3fe4b549
JD
7052 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
7053 in registerServicesMenuSendTypes.
7054 (validRequestorForSendType): Don't check ns_return_types.
7055
7056 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
7057 ns_return_type.
7058
5df75e47
JR
70592011-07-08 Jason Rumney <jasonr@gnu.org>
7060
22610910
JR
7061 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
7062 SH_SHOW for hidden windows (Bug#5482).
7063
5df75e47
JR
7064 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
7065 frame struct members of non-existent frames (Bug#6284).
7066
699c10bd
JD
70672011-07-08 Jan Djärv <jan.h.d@swipnet.se>
7068
4393663b
JD
7069 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
7070 variable firstTime not needed on OSX >= 10.6.
7071 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
7072 >= 10.5. Use setKnobProportion, setDoubleValue.
7073
7074 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
7075 (MAC_OS_X_VERSION_10_5): Define if not defined.
7076 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
7077 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
7078 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
7079
7080 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
7081 cString and lossyCString on OSX >= 10.4
7082
58179cce 7083 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
7084 sizeToFit on OSX >= 10.2.
7085
7086 * nsimage.m (allocInitFromFile): Don't use deprecated method
7087 bestRepresentationForDevice on OSX >= 10.6.
7088
7089 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
7090 to avoid warning.
7091
7092 * emacs.c: Declare unexec_init_emacs_zone.
7093
a63e0781
JD
7094 * nsgui.h: Fix compiler warning about gnulib redefining verify.
7095
699c10bd
JD
7096 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
7097
7098 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
7099 on svcsMenu (Bug#8842).
7100
7101 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
7102 ns_return_types.
7103 (Fns_list_services): Just return Qnil on 10.6, code not working there.
7104
7105 * nsterm.m (QUTF8_STRING): Declare.
7106 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
7107 (validRequestorForSendType): Return type is (id).
7108 Change indexOfObjectIdenticalTo to indexOfObject.
7109 Check if we have local selection before returning self (Bug#8842).
7110 (writeSelectionToPasteboard): Put local selection into paste board
7111 if we have a local selection (Bug#8842).
7112 (syms_of_nsterm): DEFSYM QUTF8_STRING.
7113
7114 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
7115 (ns_get_local_selection): Declare.
7116
54e10184
LMI
71172011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
7118
9888ff71
LMI
7119 * keymap.c (describe_map_tree): Don't insert a double newline at
7120 the end of the buffer (bug#1169) and return whether we inserted
7121 something.
7122
54e10184
LMI
7123 * callint.c (Fcall_interactively): Change "reading args" to
7124 "providing args" to try to clarify what it does (bug#1010).
7125
15fa4783
KH
71262011-07-07 Kenichi Handa <handa@m17n.org>
7127
7128 * composite.c (composition_compute_stop_pos): Ignore a static
7129 composition starting before CHARPOS (Bug#8915).
7130
7131 * xdisp.c (handle_composition_prop): Likewise.
7132
a8815b00
EZ
71332011-07-07 Eli Zaretskii <eliz@gnu.org>
7134
7135 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
7136 (Bug#9015)
7137
ef7b981d 71382011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
7139
7140 * character.h (unicode_category_t): New enum type.
7141
7142 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
7143 (Qchar_code_property_table): New variable.
7144 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
7145 (UNIPROP_COMPRESSED_FORM_P): New macros.
7146 (char_table_ascii): Uncompress the compressed values.
7147 (sub_char_table_ref): New arg is_uniprop. Callers changed.
7148 Uncompress the compressed values.
ac389d0c 7149 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
7150 (char_table_ref_and_range): Uncompress the compressed values.
7151 (sub_char_table_set): New arg is_uniprop. Callers changed.
7152 Uncompress the compressed values.
7153 (sub_char_table_set_range): Args changed. Callers changed.
7154 (char_table_set_range): Adjuted for the above change.
7155 (map_sub_char_table): Delete args default_val and parent. Add arg
7156 top. Give decoded values to a Lisp function.
640c8776 7157 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
7158 values to a Lisp function. Gcpro more variables.
7159 (uniprop_table_uncompress)
7160 (uniprop_decode_value_run_length): New functions.
7161 (uniprop_decoder, uniprop_decoder_count): New variables.
7162 (uniprop_get_decoder, uniprop_encode_value_character)
7163 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
7164 New functions.
7165 (uniprop_encoder, uniprop_encoder_count): New variables.
7166 (uniprop_get_encoder, uniprop_table)
7167 (Funicode_property_table_internal, Fget_unicode_property_internal)
7168 (Fput_unicode_property_internal): New functions.
7169 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
7170 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 7171 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
7172 char-code-property-alist.
7173
640c8776 7174 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
7175 Vunicode_category_table.
7176
640c8776 7177 * font.c (font_range): Adjust for the change of
c805dec0
KH
7178 Vunicode_category_table.
7179
76b397fb
DN
71802011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
7181
7182 * m/iris4d.h: Remove file, move contents ...
7183 * s/irix6-5.h: ... here.
7184
22b4128e
PE
71852011-07-06 Paul Eggert <eggert@cs.ucla.edu>
7186
7187 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
7188 * alloc.c (mark_buffer):
7189 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
7190 (clone_per_buffer_values): Don't assume that
22b4128e
PE
7191 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
7192 This isn't true in general, and it's particularly not true
7193 if Emacs is configured with --with-wide-int.
7194 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
7195 New macros, used in the buffer.c change.
7196
869795d6
JD
71972011-07-05 Jan Djärv <jan.h.d@swipnet.se>
7198
7199 * xsettings.c: Use both GConf and GSettings if both are available.
7200 (store_config_changed_event): Add comment.
7201 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
7202 (store_tool_bar_style_changed): New functions.
5e617bc2 7203 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
7204 (struct xsettings): Move font inside HAVE_XFT.
7205 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 7206 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 7207 Move inside HAVE_XFT.
640c8776 7208 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
7209 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
7210 also.
7211 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 7212 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 7213 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
7214 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
7215 (parse_settings): Move check for font inside HAVE_XFT.
7216 (read_settings, apply_xft_settings): Add comment.
7217 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
7218 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
7219 call store_font_name_changed.
7220 (xft_settings_event): Add comment.
7221 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
7222 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
7223 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
7224 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
7225 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
7226 (xsettings_get_system_font, xsettings_get_system_normal_font):
7227 Add comment.
869795d6 7228
d8ed26bd
PE
72292011-07-05 Paul Eggert <eggert@cs.ucla.edu>
7230
7231 Random fixes. E.g., (random) never returned negative values.
7232 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
7233 subseconds part to the entropy, as that's a bit more random.
7234 Prefer signed to unsigned, since the signedness doesn't matter and
7235 in general we prefer signed. When given a limit, use a
7236 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
7237 latter isn't right if USE_2_TAGS_FOR_INTS.
7238 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
7239 not 0..VALMASK. Don't discard "excess" bits that random () returns.
7240
cabf1cac
SM
72412011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7242
7243 * textprop.c (text_property_stickiness):
7244 Obey Vtext_property_default_nonsticky.
7245 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
7246 * w32fns.c (syms_of_w32fns):
7247 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
7248
6e9b2be9
PE
72492011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
7252 This is more efficient than Ffile_directory_p and avoids a minor race.
7253
90186c68
LMI
72542011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
7255
7c301272
LMI
7256 * buffer.c (Foverlay_put): Say what the return value is
7257 (bug#7835).
7258
c4f2d8d4
LMI
7259 * fileio.c (barf_or_query_if_file_exists): Check first if the file
7260 is a directory before asking whether to use the file name
7261 (bug#7564).
ad637907
LMI
7262 (barf_or_query_if_file_exists): Make the "File is a directory"
7263 error be more correct.
c4f2d8d4 7264
90186c68
LMI
7265 * fns.c (Frequire): Remove the mention of the .gz files, since
7266 that's installation-specific, but keep the mention of
7267 `get-load-suffixes'.
7268
da64016e
PE
72692011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7270
7271 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
7272 Report string overflow if the output is too long.
7273
7d47b580
JB
72742011-07-04 Juanma Barranquero <lekktu@gmail.com>
7275
a555cb87
JB
7276 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
7277 (syms_of_gnutls): Remove duplicate DEFSYM for
7278 Qgnutls_bootprop_verify_hostname_error, an error for
7279 Qgnutls_bootprop_verify_error (which is no longer used).
7280
7d47b580
JB
7281 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
7282 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
7283 Also (re)move comments that are misplaced or no longer relevant.
7284
1e49bfab
LMI
72852011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7286
7287 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
7288
1485f4c0
CY
72892011-07-03 Chong Yidong <cyd@stupidchicken.com>
7290
7291 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
7292 and background color parameters if they have been changed.
7293
a9ab721e
LMI
72942011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7295
7296 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
7297
cf7cff57
PE
72982011-07-03 Paul Eggert <eggert@cs.ucla.edu>
7299
2e13213d
PE
7300 * xsettings.c (SYSTEM_FONT): Define only when used.
7301 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
7302
cf7cff57
PE
7303 * keymap.c (access_keymap_1): Now static.
7304
7a8e04f7
CY
73052011-07-02 Chong Yidong <cyd@stupidchicken.com>
7306
7307 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
7308 leave any prefix arg for the up event (Bug#1586).
7309
61352f62
LMI
73102011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
7311
69bb1ef7
LMI
7312 * lread.c (syms_of_lread): Mention single symbols defined by
7313 `defvar' or `defconst' (bug#7154).
7314
61352f62 7315 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 7316 (Frequire): Mention get-load-suffixes.
61352f62 7317
28545e04
MR
73182011-07-02 Martin Rudalics <rudalics@gmx.at>
7319
7320 * window.h (window): Remove clone_number slot.
7321 * window.c (Fwindow_clone_number, Fset_window_clone_number):
7322 Remove.
7323 (make_parent_window, make_window, saved_window)
7324 (Fset_window_configuration, save_window_save): Don't deal with
7325 clone numbers.
7326 * buffer.c (Qclone_number): Remove declaration.
7327 (sort_overlays, overlay_strings): Don't deal with clone numbers.
7328
3349e122
SM
73292011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
7330
7331 Add multiple inheritance to keymaps.
7332 * keymap.c (Fmake_composed_keymap): New function.
7333 (Fset_keymap_parent): Simplify.
7334 (fix_submap_inheritance): Remove.
7335 (access_keymap_1): New function extracted from access_keymap to handle
7336 embedded parents and handle lists of maps.
7337 (access_keymap): Use it.
7338 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
7339 (Fcopy_keymap): Handle embedded parents.
7340 (Fcommand_remapping, define_as_prefix): Simplify.
7341 (Fkey_binding): Simplify.
7342 (syms_of_keymap): Move minibuffer-local-completion-map,
7343 minibuffer-local-filename-completion-map,
7344 minibuffer-local-must-match-map, and
7345 minibuffer-local-filename-must-match-map to Elisp.
7346 (syms_of_keymap): Defsubr make-composed-keymap.
7347 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
7348 (parse_menu_item): Trivial simplification.
7349
3279eb87
GM
73502011-07-01 Glenn Morris <rgm@gnu.org>
7351
7352 * Makefile.in (SETTINGS_LIBS): Fix typo.
7353
4550efdf
KI
73542011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
7355
7356 * coding.c (Fencode_coding_string): Record the last coding system
7357 used, as the function doc string says (bug#8738).
7358
0949d2b6
JD
73592011-07-01 Jan Djärv <jan.h.d@swipnet.se>
7360
7361 * xsettings.c (store_monospaced_changed): Take new font as arg and
7362 check for change against current_mono_font.
7363 (EMACS_TYPE_SETTINGS): Remove this and related defines.
7364 (emacs_settings_constructor, emacs_settings_get_property)
7365 (emacs_settings_set_property, emacs_settings_class_init)
7366 (emacs_settings_init, gsettings_obj): Remove.
7367 (something_changedCB): New function for HAVE_GSETTINGS.
7368 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
7369 with value as argument.
7370 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
7371 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 7372 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
7373 "changed".
7374
7375 * xgselect.c: Add defined (HAVE_GSETTINGS).
7376 (xgselect_initialize): Ditto.
7377
7378 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
7379 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
7380 xg_select.
7381
bbc6b304
PE
73822011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7383
7384 * eval.c (struct backtrace): Simplify and port the data structure.
7385 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
7386 signed bit field, as this assumption is not portable and it makes
7387 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
7388 "char debug_on_exit : 1" as this is not portable either; instead,
7389 use the portable "unsigned int debug_on_exit : 1". Remove unused
7390 member evalargs. Remove obsolete comments about cc bombing out.
7391
9851bfc5
JD
73922011-06-30 Jan Djärv <jan.h.d@swipnet.se>
7393
51bb811f 7394 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
7395 Let HAVE_GSETTINGS override HAVE_GCONF.
7396 (store_monospaced_changed): New function.
7397 (EMACS_SETTINGS): A new type derived from GObject to handle
7398 GSettings notifications.
7399 (emacs_settings_constructor, emacs_settings_get_property)
7400 (emacs_settings_set_property, emacs_settings_class_init):
7401 New functions.
7402 (gsettings_client, gsettings_obj): New variables.
7403 (GSETTINGS_SCHEMA): New define.
7404 (something_changedCB): Call store_monospaced_changed.
7405 (init_gsettings): New function.
7406 (xsettings_initialize): Call init_gsettings.
7407 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
7408 to NULL.
7409
640c8776 7410 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
7411 GCONF_CFLAGS/LIBS.
7412
5386012d
MR
74132011-06-29 Martin Rudalics <rudalics@gmx.at>
7414
7415 * window.c (resize_root_window, grow_mini_window)
7416 (shrink_mini_window): Rename Qresize_root_window to
7417 Qwindow_resize_root_window and Qresize_root_window_vertically to
7418 Qwindow_resize_root_window_vertically.
7419
f13e0b08
PE
74202011-06-28 Paul Eggert <eggert@cs.ucla.edu>
7421
7422 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
7423
94515237
JB
74242011-06-27 Juanma Barranquero <lekktu@gmail.com>
7425
7426 * makefile.w32-in: Redesign dependencies so they reflect more
7427 clearly which files are directly included by each source file,
7428 and not through other includes.
7429
e43b6e43
MR
74302011-06-27 Martin Rudalics <rudalics@gmx.at>
7431
7432 * buffer.c (Qclone_number): Declare static and DEFSYM it.
7433 (sort_overlays, overlay_strings): When an overlay's clone number
7434 matches the window's clone number process the overlay even if
7435 the overlay's window property doesn't match the current window.
7436
d68443dc
MR
7437 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
7438 (Fwindow_hchild): Rename to Fwindow_left_child.
7439 (Fwindow_next): Rename to Fwindow_next_sibling.
7440 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
7441 (resize_window_check): Rename to window_resize_check.
7442 (resize_window_apply): Rename to window_resize_apply.
7443 (Fresize_window_apply): Rename to Fwindow_resize_apply.
7444 (Fdelete_other_windows_internal, resize_frame_windows)
7445 (Fsplit_window_internal, Fdelete_window_internal)
7446 (grow_mini_window, shrink_mini_window)
7447 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 7448
c7e73be5
JD
74492011-06-26 Jan Djärv <jan.h.d@swipnet.se>
7450
7451 * emacsgtkfixed.h: State that this is only used with Gtk+3.
7452 (emacs_fixed_set_min_size): Remove.
7453 (emacs_fixed_new): Take frame as argument.
7454
7455 * emacsgtkfixed.c: State that this is only used with Gtk+3.
7456 (_EmacsFixedPrivate): Remove minwidth/height.
7457 Add struct frame *f.
7458 (emacs_fixed_init): Initialize priv->f.
7459 (get_parent_class, emacs_fixed_set_min_size): Remove.
7460 (emacs_fixed_new): Set priv->f to argument.
7461 (emacs_fixed_get_preferred_width)
7462 (emacs_fixed_get_preferred_height): Use min_width/height from
7463 frames size_hint to set minimum and natural (Bug#8919).
7464 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
7465 and use min_width/height from frames size_hint to set
7466 min_width/height (Bug#8919).
7467
7468 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
7469 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
7470 Fix indentation.
c7e73be5 7471
cf99dcf8
EZ
74722011-06-26 Eli Zaretskii <eliz@gnu.org>
7473
7474 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
7475 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
7476 called at ZV.
7477
029529ac
CY
74782011-06-26 Chong Yidong <cyd@stupidchicken.com>
7479
7480 * process.c (wait_reading_process_output): Bypass select if
7481 waiting for a cell while ignoring keyboard input, and input is
7482 pending. Suggested by Jan Djärv (Bug#8869).
7483
7a7ef429
PE
74842011-06-25 Paul Eggert <eggert@cs.ucla.edu>
7485
7486 Use gnulib's dup2 module instead of rolling our own.
7487 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
7488
11fdef7d 74892011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
7490
7491 * dispnew.c (scrolling_window): Before scrolling, turn off a
7492 mouse-highlight in the window being scrolled.
7493
cd3520a4
JB
74942011-06-24 Juanma Barranquero <lekktu@gmail.com>
7495
7496 Move DEFSYM to lisp.h and use everywhere.
7497
7498 * character.h (DEFSYM): Move declaration...
7499 * lisp.h (DEFSYM): ...here.
7500
7501 * gnutls.c:
7502 * minibuf.c:
7503 * w32menu.c:
7504 * w32proc.c:
7505 * w32select.c: Don't include character.h.
7506
7507 * alloc.c (syms_of_alloc):
7508 * buffer.c (syms_of_buffer):
7509 * bytecode.c (syms_of_bytecode):
7510 * callint.c (syms_of_callint):
7511 * casefiddle.c (syms_of_casefiddle):
7512 * casetab.c (init_casetab_once):
7513 * category.c (init_category_once, syms_of_category):
7514 * ccl.c (syms_of_ccl):
7515 * cmds.c (syms_of_cmds):
7516 * composite.c (syms_of_composite):
7517 * dbusbind.c (syms_of_dbusbind):
7518 * dired.c (syms_of_dired):
7519 * dispnew.c (syms_of_display):
7520 * doc.c (syms_of_doc):
7521 * editfns.c (syms_of_editfns):
7522 * emacs.c (syms_of_emacs):
7523 * eval.c (syms_of_eval):
7524 * fileio.c (syms_of_fileio):
7525 * fns.c (syms_of_fns):
7526 * frame.c (syms_of_frame):
7527 * fringe.c (syms_of_fringe):
7528 * insdel.c (syms_of_insdel):
7529 * keymap.c (syms_of_keymap):
7530 * lread.c (init_obarray, syms_of_lread):
7531 * macros.c (syms_of_macros):
7532 * msdos.c (syms_of_msdos):
7533 * print.c (syms_of_print):
7534 * process.c (syms_of_process):
7535 * search.c (syms_of_search):
7536 * sound.c (syms_of_sound):
7537 * syntax.c (init_syntax_once, syms_of_syntax):
7538 * terminal.c (syms_of_terminal):
7539 * textprop.c (syms_of_textprop):
7540 * undo.c (syms_of_undo):
7541 * w32.c (globals_of_w32):
7542 * window.c (syms_of_window):
7543 * xdisp.c (syms_of_xdisp):
7544 * xfaces.c (syms_of_xfaces):
7545 * xfns.c (syms_of_xfns):
7546 * xmenu.c (syms_of_xmenu):
7547 * xsettings.c (syms_of_xsettings):
7548 * xterm.c (syms_of_xterm): Use DEFSYM.
7549
4228cf16
TZ
75502011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
7551
cd3520a4 7552 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 7553
7fcccf1e
PE
75542011-06-23 Paul Eggert <eggert@cs.ucla.edu>
7555
7efb4e0e
PE
7556 Integer and buffer overflow fixes (Bug#8873).
7557
ff5844ad
PE
7558 * print.c (printchar, strout): Check for string overflow.
7559 (PRINTPREPARE, printchar, strout):
7560 Don't set size unless allocation succeeds.
7561
90532f02
PE
7562 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
7563 for sizes. Check for string overflow more accurately.
7564 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
7565
6d84508d
PE
7566 * macros.c: Integer and buffer overflow fixes.
7567 * keyboard.h (struct keyboard.kbd_macro_bufsize):
7568 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
7569 Use ptrdiff_t, not int, for sizes.
7570 Don't increment bufsize until after realloc succeeds.
7571 Check for size-calculation overflow.
7572 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
7573
437b2cb4
PE
7574 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
7575
8b9ac8b4
PE
7576 * lread.c: Integer overflow fixes.
7577 (read_integer): Radix is now EMACS_INT, not int,
7578 to improve quality of diagnostics for out-of-range radices.
7579 Calculate buffer size correctly for out-of-range radices.
7580 (read1): Check for integer overflow in radices, and in
7581 read-circle numbers.
82cb60d3
PE
7582 (read_escape): Avoid int overflow.
7583 (Fload, openp, read_buffer_size, read1)
7584 (substitute_object_recurse, read_vector, read_list, map_obarray):
7585 Use ptrdiff_t, not int, for sizes.
7586 (read1): Use EMACS_INT, not int, for sizes.
20270765 7587 Check for size overflow.
8b9ac8b4 7588
7fcccf1e
PE
7589 * image.c (cache_image): Check for size arithmetic overflow.
7590
bfbbd7e7
PE
7591 * lread.c: Integer overflow issues.
7592 (saved_doc_string_size, saved_doc_string_length)
7593 (prev_saved_doc_string_size, prev_saved_doc_string_length):
7594 Now ptrdiff_t, not int.
7595 (read1): Don't assume doc string length fits in int. Check for
7596 out-of-range doc string lengths.
7597 (read_list): Don't assume file position fits in int.
39019e54 7598 (read_escape): Check for hex character overflow.
bfbbd7e7 7599
4e323265
LL
76002011-06-22 Leo Liu <sdl.web@gmail.com>
7601
7602 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
7603 Move to minibuffer.el.
7604
85fece3e
PE
76052011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7606
20b84ce9 7607 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
7608 The following patches are for when GLYPH_DEBUG && !XASSERT.
7609 * dispextern.h (trace_redisplay_p, dump_glyph_string):
7610 * dispnew.c (flush_stdout):
7611 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
7612 Mark as externally visible.
7613 * dispnew.c (check_window_matrix_pointers): Now static.
7614 * dispnew.c (window_to_frame_vpos):
7615 * xfns.c (unwind_create_frame):
7616 * xterm.c (x_check_font): Remove unused local.
7617 * scroll.c (CHECK_BOUNDS):
7618 * xfaces.c (cache_fache): Rename local to avoid shadowing.
7619 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
7620 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
7621 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
7622 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
7623 Now static.
7624 (debug_method_add): Use va_list and vsprintf rather than relying
7625 on undefined behavior with wrong number of arguments.
7626 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
7627 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
7628 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
7629 since we're not interested in debugging glyphs with old libraries.
7630 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
7631 GCC 4.6.0's static checking.
7632
0766b489
PE
76332011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7634
31fd4b32
PE
7635 Integer overflow and signedness fixes (Bug#8873).
7636 A few related buffer overrun fixes, too.
7637
b79e8648
PE
7638 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
7639
0766b489
PE
7640 * dispextern.h (struct face.stipple):
7641 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
7642 (x_bitmap_mask, x_allocate_bitmap_record)
7643 (x_create_bitmap_from_data, x_create_bitmap_from_file)
7644 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
7645 (x_create_bitmap_from_xpm_data):
7646 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
7647 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
7648 (.bitmaps_last):
7649 * xfaces.c (load_pixmap):
7650 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
7651 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
7652 (.bitmaps_last, struct x_output.icon_bitmap):
7653 Use ptrdiff_t, not int, for bitmap indexes.
7654 (x_allocate_bitmap_record): Check for size overflow.
7655 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
7656
b081724f
PE
7657 Use ptrdiff_t, not int, for overlay counts.
7658 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
7659 * editfns.c (overlays_around, get_pos_property):
7660 * textprop.c (get_char_property_and_overlay):
7661 * xdisp.c (next_overlay_change, note_mouse_highlight):
7662 * xfaces.c (face_at_buffer_position):
21514da7
PE
7663 * buffer.c (OVERLAY_COUNT_MAX): New macro.
7664 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
7665 (Fnext_overlay_change, Fprevious_overlay_change)
7666 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 7667 Use ptrdiff_t, not int, for sizes.
21514da7 7668 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 7669
3de73e5e
PE
7670 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
7671
2606c57b
PE
7672 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
7673 (x_session_initialize): Do not assume string length fits in int.
7674
aaafe47a
PE
7675 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
7676 This is unlikely, but can occur if DPI is outlandish.
7677
2674ddc8 7678 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
7679 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
7680
28154962
PE
7681 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
7682 * xrdb.c (magic_file_p, search_magic_path):
7683 Omit last arg SUFFIX; it was always 0. All callers changed.
7684 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
7685
7de51af5
PE
7686 * xfont.c (xfont_match): Avoid need for strlen.
7687
25ed6cc3
PE
7688 * xfns.c: Don't assume strlen fits in int.
7689 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
7690
4eab31dd
PE
7691 * xdisp.c (message_log_check_duplicate): Return intmax_t,
7692 not unsigned long, as we prefer signed integers. All callers changed.
7693 Detect integer overflow in repeat count.
7694 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 7695 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 7696
171e2a58
PE
7697 * termcap.c: Don't assume sizes fit in int and never overflow.
7698 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
7699 (gobble_line): Check for size-calculation overflow.
7700
ad39faca 7701 * minibuf.c (Fread_buffer):
6e5bb2dc 7702 * lread.c (intern, intern_c_string):
74ca2eb3
PE
7703 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
7704 Don't assume string length fits in int.
7705
52c61c22 7706 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
7707 * gtkutil.c (style_changed_cb): Avoid need for strlen.
7708
b5b8c9e5
PE
7709 * font.c: Don't assume string length fits in int.
7710 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
7711 Use ptrdiff_t, not int.
ccd6111c
PE
7712 (font_intern_prop): Don't assume string length fits in int.
7713 Don't assume integer property fits in fixnum.
7714 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 7715
882f0d81 7716 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 7717 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
7718 Reformulate so as not to need the command string.
7719 Invoke gzip -cd rather than gunzip, as it's more portable.
7720 (lock_info_type, lock_file_1, lock_file):
7721 Don't assume pid_t and time_t fit in unsigned long.
7722 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
7723 (current_lock_owner): Prefer signed type for sizes.
7724 Use memcpy, not strncpy, where memcpy is what is really wanted.
7725 Don't assume (via atoi) that time_t and pid_t fit in int.
7726 Check for time_t and/or pid_t out of range, e.g., via a network share.
7727 Don't alloca where an auto var works fine.
7728
93f4cf88
PE
7729 * fileio.c: Fix some integer overflow issues.
7730 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
7731 Don't assume string length fits in int.
7732 (directory_file_name): Don't assume string length fits in long.
7733 (make_temp_name): Don't assume pid fits in int, or that its print
7734 length is less than 20.
7735
f3e92b69
PE
7736 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
7737
1bfdaf10
PE
7738 * coding.c (make_subsidiaries): Don't assume string length fits in int.
7739
35016e9a
PE
7740 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
7741
3d1e65a1
PE
7742 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
7743 We prefer signed integers, even for size calculations.
7744
0b963a93
PE
7745 * emacs.c: Don't assume string length fits in 'int'.
7746 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
7747 (main): Don't invoke strlen when not needed.
7748
573f4b54
PE
7749 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
7750 (XD_DEBUG_MESSAGE): Don't waste a byte.
7751
989f33ba
PE
7752 * callproc.c (getenv_internal_1, getenv_internal)
7753 (Fgetenv_internal):
965d34eb
PE
7754 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
7755
e4d29b33
PE
7756 * lread.c (invalid_syntax): Omit length argument.
7757 All uses changed. This doesn't fix a bug, but it simplifies the
7758 code away from its former Hollerith-constant appearance, and it's
7759 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 7760 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 7761
eb49b136
PE
7762 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
7763 This didn't break anything, but it didn't help either.
7764 It's confusing to put a bogus integer in a place where the actual
7765 value does not matter.
9f62aeb1 7766 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 7767 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 7768
15375a22
PE
7769 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
7770 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
7771 implementation.
b61cc01c
PE
7772 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
7773 We prefer signed types, and the value cannot exceed the EMACS_INT
7774 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
7775 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
7776 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
7777 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 7778
53b2623d
PE
7779 * indent.c (sane_tab_width): New function.
7780 (current_column, scan_for_column, Findent_to, position_indentation)
7781 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 7782 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 7783
51cab52b 7784 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 7785
f2ed8a70
PE
7786 * lisp.h (lint_assume): New macro.
7787 * composite.c (composition_gstring_put_cache):
7788 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
7789
abe80cc6
PE
7790 * editfns.c, insdel.c:
7791 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 7792
b02c740e
PE
7793 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
7794
ebc96716
PE
7795 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
7796
b4e50fa0 7797 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 7798 Use much-faster test for byte-length change.
311d5d7c 7799 Don't assume string byte-length fits in 'int'.
a4cf38e4 7800 Check that character arg fits in 'int'.
85461888 7801 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 7802
c0c1ee9f
PE
7803 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
7804
a498d7f4
PE
7805 * fns.c (concat): Catch string overflow earlier.
7806 Do not rely on integer wraparound.
7807
51cab52b
PE
7808 * dispextern.h (struct it.overlay_strings_charpos)
7809 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
7810 * xdisp.c (forward_to_next_line_start)
7811 (back_to_previous_visible_line_start)
7812 (reseat_at_next_visible_line_start, next_element_from_buffer):
7813 Don't arbitrarily truncate the value of 'selective' to int.
7814
76031fad
PE
7815 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
7816
5eb55db9
PE
7817 * composite.c: Don't truncate sizes to 'int'.
7818 (composition_gstring_p, composition_reseat_it)
7819 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
7820 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
7821 not EMACS_UINT, for indexes.
5eb55db9 7822
0703a717
PE
7823 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
7824
d6202519
PE
7825 * buffer.c: Include <verify.h>.
7826 (struct sortvec.priority, struct sortstr.priority):
8961a454 7827 Now EMACS_INT, not int.
c20998a7 7828 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
7829 (struct sortstr.size, record_overlay_string)
7830 (struct sortstrlist.size, struct sortlist.used):
7831 Don't truncate size to int.
7832 (record_overlay_string): Check for size-calculation overflow.
d6202519 7833 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 7834
d5a19415
JM
78352011-06-22 Jim Meyering <meyering@redhat.com>
7836
029529ac 7837 Don't leak an XBM-image-sized buffer
d5a19415
JM
7838 * image.c (xbm_load): Free the image buffer after using it.
7839
a9041e6c
PE
78402011-06-21 Paul Eggert <eggert@cs.ucla.edu>
7841
7842 Port to Sun C.
7843 * composite.c (find_automatic_composition): Omit needless 'return 0;'
7844 that Sun C diagnosed.
7845 * fns.c (secure_hash): Fix pointer signedness issue.
7846 * intervals.c (static_offset_intervals): New function.
7847 (offset_intervals): Use it.
7848
7f3f739f
LL
78492011-06-21 Leo Liu <sdl.web@gmail.com>
7850
7851 * deps.mk (fns.o):
7852 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
7853 sha512.h.
7854
7855 * fns.c (secure_hash): Rename from crypto_hash_function and change
7856 the first arg to accept symbols.
5b66d427 7857 (Fsecure_hash): New primitive.
7f3f739f
LL
7858 (syms_of_fns): New symbols.
7859
76147d94
DD
78602011-06-20 Deniz Dogan <deniz@dogan.se>
7861
7862 * process.c (Fset_process_buffer): Clarify return value in
7863 docstring.
7864
7d7d0045
CY
78652011-06-18 Chong Yidong <cyd@stupidchicken.com>
7866
7867 * dispnew.c (add_window_display_history): Use BVAR.
7868
7869 * xdisp.c (debug_method_add): Use BVAR.
7870 (check_window_end, dump_glyph_matrix, dump_glyph)
7871 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
7872
7873 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
7874 Likewise.
7875
7876 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
7877 check till after the cache is created in init_frame_faces.
7878
ff2bc410
SM
78792011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
7880
7881 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
7882
28177add
PE
78832011-06-16 Paul Eggert <eggert@cs.ucla.edu>
7884
dd3482fe
PE
7885 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
7886 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
7887 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
7888
393d71f3 7889 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
7890 * fileio.c (Finsert_file_contents):
7891 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
7892 Remove the old (too-loose) buffer overflow checks.
7893 They weren't needed, since make_gap checks for buffer overflow.
7894 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
7895 The old code merely checked for Emacs fixnum overflow, and relied
7896 on undefined (wraparound) behavior. The new code avoids undefined
7897 behavior, and also checks for ptrdiff_t and/or size_t overflow.
7898
2e6813b0 7899 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
7900 Tune. Don't use wider integers than needed. Don't use alloca.
7901 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 7902
599a9e4f
PE
7903 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
7904
99561444
PE
7905 * insdel.c, lisp.h (buffer_overflow): New function.
7906 (insert_from_buffer_1, replace_range, replace_range_2):
7907 * insdel.c (make_gap_larger):
7908 * editfns.c (Finsert_char):
7909 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
7910
28177add
PE
7911 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
7912
e69dafad
PE
79132011-06-15 Paul Eggert <eggert@cs.ucla.edu>
7914
4baa020d 7915 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 7916
b1c46f02
PE
7917 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
7918 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
7919
e69dafad
PE
7920 * fileio.c: Don't assume EMACS_INT fits in off_t.
7921 (emacs_lseek): New static function.
7922 (Finsert_file_contents, Fwrite_region): Use it.
7923 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
7924
566684ea
PE
7925 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
7926
e6966cd6
PE
7927 * fns.c: Don't overflow int when computing a list length.
7928 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
7929 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
7930 truncation on 64-bit hosts. Check for QUIT every
7931 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
7932 faster and is responsive enough.
7933 (Flength): Report an error instead of overflowing an integer.
7934 (Fsafe_length): Return a float if the value is not representable
7935 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 7936 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 7937 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 7938
dd0b0efb
PE
7939 * alloc.c: Check that resized vectors' lengths fit in fixnums.
7940 (header_size, word_size): New constants.
7941 (allocate_vectorlike): Don't check size overflow here.
7942 (allocate_vector): Check it here instead, since this is the only
7943 caller of allocate_vectorlike that could cause overflow.
7944 Check that the new vector's length is representable as a fixnum.
7945
86fe5cfe
PE
7946 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
7947 The previous code was bogus. For example, next_almost_prime (32)
7948 returned 39, which is undesirable as it is a multiple of 3; and
7949 next_almost_prime (24) returned 25, which is a multiple of 5 so
7950 why was the code bothering to check for multiples of 7?
7951
80e88859
PE
7952 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
7953
4a2f0ad6
PE
7954 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
7955
f66c7cf8
PE
7956 Variadic C functions now count arguments with ptrdiff_t.
7957 This partly undoes my 2011-03-30 change, which replaced int with size_t.
7958 Back then I didn't know that the Emacs coding style prefers signed int.
7959 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
7960 were being counted with int, which may truncate counts on 64-bit
7961 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
7962 * lisp.h (struct Lisp_Subr.function.aMANY)
7963 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
7964 Arg counts are now ptrdiff_t, not size_t.
7965 All variadic functions and their callers changed accordingly.
7966 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
7967 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
7968 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
7969 * callint.c (Fcall_interactively): Check arg count for overflow,
7970 to avoid potential buffer overrun. Use signed char, not 'int',
7971 for 'varies' array, so that we needn't bother to check its size
7972 calculation for overflow.
7973 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
7974 * eval.c (apply_lambda):
7975 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
7976 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
7977 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
7978
a1759b76
PE
7979 * callint.c (Fcall_interactively): Don't use index var as event count.
7980
d96be9fc
PE
7981 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
7982 * mem-limits.h (SIZE): Remove; no longer used.
7983
a690a978 7984 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 7985
578c21e6
PE
7986 Remove unnecessary casts.
7987 * xterm.c (x_term_init):
7988 * xfns.c (x_set_border_pixel):
7989 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
7990 These aren't needed now that we assume ANSI C.
7991
96f53c6c
PE
7992 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
7993 It's more likely to cause problems (due to unsigned overflow)
7994 than to cure them.
7995
83c77d31
PE
7996 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
7997
ee2079f1
PE
7998 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
7999
6da65536
PE
8000 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
8001
7147c4a4
PE
8002 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
8003
193e32d9
PE
8004 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
8005
e5533da6
PE
8006 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
8007
9910e595
PE
8008 GLYPH_CODE_FACE returns EMACS_INT, not int.
8009 * dispextern.h (merge_faces):
8010 * xfaces.c (merge_faces):
01103c44
PE
8011 * xdisp.c (get_next_display_element, next_element_from_display_vector):
8012 Don't assume EMACS_INT fits in int.
9910e595 8013
2638320e
PE
8014 * character.h (CHAR_VALID_P): Remove unused parameter.
8015 * fontset.c, lisp.h, xdisp.c: All uses changed.
8016
045eb8d9
PE
8017 * editfns.c (Ftranslate_region_internal): Omit redundant test.
8018
c1f134b5
PE
8019 * fns.c (concat): Minor tuning based on overflow analysis.
8020 This doesn't fix any bugs. Use int to hold character, instead
8021 of constantly refetching from Emacs object. Use XFASTINT, not
8022 XINT, for value known to be a character. Don't bother comparing
8023 a single byte to 0400, as it's always less.
8024
395fcb93 8025 * floatfns.c (Fexpt):
327eeec8
PE
8026 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
8027
abbd3d23
PE
8028 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
8029 for characters.
8030
684a03ef
PE
8031 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
8032
0fed43f3
PE
8033 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
8034 Without this fix, on a 64-bit host (aset S 0 4294967386) would
8035 incorrectly succeed when S was a string, because 4294967386 was
8036 truncated before it was used.
8037
8fd02eb7
PE
8038 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
8039 Otherwise, an out-of-range integer could cause undefined behavior
8040 on a 64-bit host.
8041
f8c86b69
PE
8042 * composite.c: Use int, not EMACS_INT, for characters.
8043 (fill_gstring_body, composition_compute_stop_pos): Use int, not
8044 EMACS_INT, for values that are known to be in character range.
8045 This doesn't fix any bugs but is the usual style inside Emacs and
8046 may generate better code on 32-bit machines.
8047
34206dd2
PE
8048 Make sure a 64-bit char is never passed to ENCODE_CHAR.
8049 This is for reasons similar to the recent CHAR_STRING fix.
8050 * charset.c (Fencode_char): Check that character arg is actually
8051 a character. Pass an int to ENCODE_CHAR.
8052 * charset.h (ENCODE_CHAR): Verify that the character argument is no
8053 wider than 'int', as a compile-time check to prevent future regressions
8054 in this area.
8055
c5958d4c 8056 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
8057
8058 Make sure a 64-bit char is never passed to CHAR_STRING.
8059 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
8060 by silently ignoring the top 32 bits, allowing some values
8061 that were far too large to be valid characters.
8062 * character.h: Include <verify.h>.
8063 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
8064 arguments are no wider than unsigned, as a compile-time check
8065 to prevent future regressions in this area.
8066 * data.c (Faset):
01103c44 8067 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
8068 (Fsubst_char_in_region):
8069 * fns.c (concat):
8070 * xdisp.c (decode_mode_spec_coding):
8071 Adjust to CHAR_STRING's new requirement.
8072 * editfns.c (Finsert_char, Fsubst_char_in_region):
8073 * fns.c (concat): Check that character args are actually
8074 characters. Without this test, these functions did the wrong
8075 thing with wildly out-of-range values on 64-bit hosts.
8076
d37ca623
PE
8077 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
8078 These casts should not be needed on 32-bit hosts, either.
8079 * keyboard.c (read_char):
8080 * lread.c (Fload): Remove casts to unsigned.
8081
ea204efb
PE
8082 * lisp.h (UNSIGNED_CMP): New macro.
8083 This fixes comparison bugs on 64-bit hosts.
8084 (ASCII_CHAR_P): Use it.
8085 * casefiddle.c (casify_object):
01103c44 8086 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
8087 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
8088 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
8089 * dispextern.h (FACE_FROM_ID):
8090 * keyboard.c (read_char): Use UNSIGNED_CMP.
8091
41cb286c
PE
8092 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
8093 not to EMACS_INT, to avoid GCC warning.
8094
4a1b9832
PE
8095 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
8096
55daad71
PE
8097 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
8098 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
8099 isn't needed on 32-bit machines.
8f95c75c 8100
01103c44
PE
8101 * buffer.c (Fgenerate_new_buffer_name):
8102 Use EMACS_INT for count, not int.
0ceccced 8103 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
8104
8105 * data.c (Qcompiled_function): Now static.
8106
c6f072e7
PE
8107 * window.c (window_body_lines): Now static.
8108
20ce5912
PE
8109 * image.c (gif_load): Rename local to avoid shadowing.
8110
9c4c5f81
PE
8111 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
8112 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
8113 * alloc.c (make_save_value): Integer argument is now of type
8114 ptrdiff_t, not int.
8115 (mark_object): Use ptrdiff_t, not int.
8116 * lisp.h (pD): New macro.
8117 * print.c (print_object): Use it.
8118
c0c5c8ae
PE
8119 * alloc.c: Use EMACS_INT, not int, to count objects.
8120 (total_conses, total_markers, total_symbols, total_vector_size)
8121 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
8122 (total_free_floats, total_floats, total_free_intervals)
8123 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
8124 Now EMACS_INT, not int. All uses changed.
8125 (Fgarbage_collect): Compute overall total using a double, so that
8126 integer overflow is less likely to be a problem. Check for overflow
8127 when converting back to an integer.
5a25e253
PE
8128 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
8129 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
8130 These were 'int' variables that could overflow on 64-bit hosts;
8131 they were never used, so remove them instead of repairing them.
211a0b2a 8132 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
8133 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
8134 Previously, this ceilinged at INT_MAX, but that doesn't work on
8135 64-bit machines.
e46bb31a 8136 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 8137
c78baabf 8138 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 8139 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
8140 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
8141 when a (possibly-narrower) signed value would do just as well.
8142 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 8143
c9d624c6
PE
8144 * alloc.c: Catch some string size overflows that we were missing.
8145 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
8146 for convenience in STRING_BYTES_MAX.
8147 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
8148 The definition here is exact; the one in lisp.h was approximate.
8149 (allocate_string_data): Check for string overflow. This catches
8150 some instances we weren't catching before. Also, it catches
8151 size_t overflow on (unusual) hosts where SIZE_MAX <= min
8152 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
8153 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 8154
c9d624c6
PE
8155 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
8156 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 8157 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 8158
353032ce
PE
8159 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
8160
2bccce07
PE
8161 * alloc.c (Fmake_string): Check for out-of-range init.
8162
0ac30604
SM
81632011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
8164
8165 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
8166
c195f2de
JD
81672011-06-14 Jan Djärv <jan.h.d@swipnet.se>
8168
8169 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
8170 xg_get_default_scrollbar_width.
8171
8172 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
8173 (int_gtk_range_get_value): Move to the scroll bar part of the file.
8174 (style_changed_cb): Call update_theme_scrollbar_width and call
8175 x_set_scroll_bar_default_width and xg_frame_set_char_size for
8176 all frames (Bug#8505).
8177 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
8178 Call gtk_window_set_resizable if HAVE_GTK3.
8179 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
8180 and height if HAVE_GTK3 (Bug#8505).
8181 (scroll_bar_width_for_theme): New variable.
8182 (update_theme_scrollbar_width): New function.
8183 (xg_get_default_scrollbar_width): Move code to
8184 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
8185 (xg_initialize): Call update_theme_scrollbar_width.
8186
8187 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
8188
8189 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
8190
e10ac9f1
MR
81912011-06-12 Martin Rudalics <rudalics@gmx.at>
8192
8193 * frame.c (make_frame): Call other_buffer_safely instead of
8194 other_buffer.
8195
8196 * window.c (temp_output_buffer_show): Call display_buffer with
8197 second argument Vtemp_buffer_show_specifiers and reset latter
8198 immediately after the call.
8199 (Vtemp_buffer_show_specifiers): New variable.
8200 (auto_window_vscroll_p, next_screen_context_lines)
8201 (Vscroll_preserve_screen_position): Remove leading asterisks from
8202 doc-strings.
8203
2d3c217e 82042011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 8205
7b7f97e8 8206 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
8207 * buffer.c (Qclone_number): Remove for now, as it's unused.
8208 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
8209 (record_buffer): Remove unused local.
8210 * frame.c (other_visible_frames, frame_buffer_list): Now static.
8211 (set_frame_buffer_list): Remove; unused.
8212 * frame.h (other_visible_frames): Remove decl.
8213 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
8214 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
8215 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
8216 if HAVE_GPM.
8217 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
8218 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
8219 Define only if HAVE_GPM.
8220 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
8221 (update_hints_inhibit): Remove; never set. All uses removed.
8222 * widgetprv.h (emacsFrameClassRec): Remove decl.
8223 * window.c (delete_deletable_window): Now returns void, since it
8224 wasn't returning anything.
8225 (compare_window_configurations): Remove unused locals.
8226 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
8227 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
8228 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
8229 the same widths as pointers. This follows up on the 2011-05-06 patch.
8230 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
8231 * xterm.h: Likewise.
8232 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
8233
1384b89e
JB
82342011-06-12 Juanma Barranquero <lekktu@gmail.com>
8235
8236 * makefile.w32-in: Update dependencies.
8237 (LISP_H): Add lib/intprops.h.
8238
1100a63c
CY
82392011-06-11 Chong Yidong <cyd@stupidchicken.com>
8240
8241 * image.c (gif_load): Add animation frame delay to the metadata.
8242 (syms_of_image): Use DEFSYM. New symbol `delay'.
8243
6198ccd0
MR
82442011-06-11 Martin Rudalics <rudalics@gmx.at>
8245
8246 * window.c (delete_deletable_window): Re-add.
8247 (Fset_window_configuration): Rewrite to handle dead buffers and
8248 consequently deletable windows.
8249 (window_tree, Fwindow_tree): Remove. Supply functionality in
8250 window.el.
8251 (compare_window_configurations): Simplify code.
8252
b6e3633c
AS
82532011-06-11 Andreas Schwab <schwab@linux-m68k.org>
8254
1ab0dee5
AS
8255 * image.c (imagemagick_load_image): Fix type mismatch.
8256 (Fimagemagick_types): Likewise.
8257
b6e3633c
AS
8258 * window.h (replace_buffer_in_windows): Declare.
8259
9397e56f
MR
82602011-06-11 Martin Rudalics <rudalics@gmx.at>
8261
8262 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
8263 Qclone_number. Remove external declaration of Qdelete_window.
8264 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
8265 code.
640c8776
SM
8266 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
8267 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
8268 (Fother_buffer): Rewrite doc-string. Major rewrite for new
8269 buffer list implementation.
8270 (other_buffer_safely): New function.
8271 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
8272 calls to replace_buffer_in_windows and
8273 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
8274 if allowed.
8275 (record_buffer): Inhibit quitting and rewrite using quittable
8276 functions. Run Qbuffer_list_update_hook if allowed.
8277 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
8278 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
8279 Move switch-to-buffer to window.el.
9397e56f
MR
8280 (bury-buffer): Move to window.el.
8281 (Vbuffer_list_update_hook): New variable.
8282
8283 * lisp.h (other_buffer_safely): Add prototype in buffer.c
8284 section.
8285
8286 * window.h (resize_frame_windows): Move up in code.
8287 (Fwindow_frame): Remove EXFUN.
8288 (replace_buffer_in_all_windows): Remove prototype.
8289 (replace_buffer_in_windows_safely): Add prototype.
8290
8291 * window.c: Declare Qdelete_window static again. Move down
8292 declaration of select_count.
8293 (Fnext_window, Fprevious_window): Rewrite doc-strings.
8294 (Fother_window): Move to window.el.
8295 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
8296 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
8297 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
8298 window.el.
8299 (replace_buffer_in_windows): Implement by calling
8300 Qreplace_buffer_in_windows.
8301 (replace_buffer_in_all_windows): Remove with some functionality
8302 moved into replace_buffer_in_windows_safely.
8303 (replace_buffer_in_windows_safely): New function.
8304 (select_window_norecord, select_frame_norecord): Move in front
8305 of run_window_configuration_change_hook. Remove now obsolete
8306 declarations.
640c8776
SM
8307 (Fset_window_buffer): Rewrite doc-string.
8308 Call Qrecord_window_buffer.
9397e56f
MR
8309 (keys_of_window): Move binding for other-window to window.el.
8310
b50691aa
CY
83112011-06-11 Chong Yidong <cyd@stupidchicken.com>
8312
8313 * dispextern.h (struct image): Replace data member, whose int_val
8314 and ptr_val fields were not used by anything, with a single
8315 lisp_val object.
8316
8317 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
8318 (gif_clear_image, gif_load, imagemagick_load_image)
8319 (gs_clear_image, gs_load): Callers changed.
8320
3f754b86
PE
83212011-06-10 Paul Eggert <eggert@cs.ucla.edu>
8322
cca69397
PE
8323 * buffer.h: Include <time.h>, for time_t.
8324 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
8325
109e28d0
PE
8326 Fix minor problems found by static checking.
8327
60737f02
PE
8328 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
8329
4b66faf3
PE
8330 Make identifiers static if they are not used in other modules.
8331 * data.c (Qcompiled_function, Qframe, Qvector):
8332 * image.c (QimageMagick, Qsvg):
8333 * minibuf.c (Qmetadata):
8334 * window.c (resize_window_check, resize_root_window): Now static.
8335 * window.h (resize_window_check, resize_root_window): Remove decls.
8336
109e28d0
PE
8337 * window.c (window_deletion_count, delete_deletable_window):
8338 Remove; unused.
46a4ce9e
PE
8339 (window_body_lines): Now static.
8340 (Fdelete_other_windows_internal): Mark vars as initialized.
8341 Make sure 'resize_failed' is initialized.
8342 (run_window_configuration_change_hook): Rename local to avoid shadowing.
8343 (resize_window_apply): Remove unused local.
8344 * window.h (delete_deletable_window): Remove decl.
8345
109e28d0 8346 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
8347 (imagemagick_load_image): Fix pointer signedness problem by changing
8348 last arg from unsigned char * to char *. All uses changed.
8349 Also, fix a local for similar reasons.
8350 Remove unused locals. Remove locals to avoid shadowing.
8351 (fn_rsvg_handle_free): Remove; unused.
8352 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 8353 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 8354
3f754b86
PE
8355 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
8356
2547adb1
CY
83572011-06-10 Chong Yidong <cyd@stupidchicken.com>
8358
8359 * image.c (gif_load): Fix omitted cast error introduced by
8360 2011-06-06 change.
8361
2c8e37d4
MR
83622011-06-10 Martin Rudalics <rudalics@gmx.at>
8363
8364 * window.h (resize_proportionally, orig_total_lines)
8365 (orig_top_line): Remove from window structure.
8366 (set_window_height, set_window_width, change_window_heights)
8367 (Fdelete_window): Remove prototypes.
8368 (resize_frame_windows): Remove duplicate declaration.
8369
440a42e3
EZ
83702011-06-10 Eli Zaretskii <eliz@gnu.org>
8371
8372 * window.h (resize_frame_windows, resize_window_check)
8373 (delete_deletable_window, resize_root_window)
8374 (resize_frame_windows): Declare prototypes.
8375
8376 * window.c (resize_window_apply): Make definition be "static" to
8377 match the prototype.
8378
562dd5e9
MR
83792011-06-10 Martin Rudalics <rudalics@gmx.at>
8380
8381 * window.c: Remove declarations of Qwindow_size_fixed,
8382 window_min_size_1, window_min_size_2, window_min_size,
8383 size_window, window_fixed_size_p, enlarge_window, delete_window.
8384 Remove static from declaration of Qdelete_window, it's
8385 temporarily needed by Fbury_buffer.
8386 (replace_window): Don't assign orig_top_line and
8387 orig_total_lines.
8388 (Fdelete_window, delete_window): Remove. Window deletion is
8389 handled by window.el.
640c8776
SM
8390 (window_loop): Remove DELETE_OTHER_WINDOWS case.
8391 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
8392 (Fdelete_other_windows): Remove. Deleting other windows is
8393 handled by window.el.
8394 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
8395 handled in window.el.
8396 (window_min_size_2, window_min_size_1, window_min_size): Remove.
8397 Window minimum sizes are handled in window.el.
8398 (shrink_windows, size_window, set_window_height)
8399 (set_window_width, change_window_heights, window_height)
8400 (window_width, CURBEG, CURSIZE, enlarge_window)
8401 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
8402 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
8403 handled in window.el.
8404 (make_dummy_parent): Rename to make_parent_window and give it a
8405 second argument horflag.
8406 (make_window): Don't set resize_proportionally any more.
8407 (Fsplit_window): Remove. Windows are split in window.el.
8408 (save_restore_action, save_restore_orig_size)
8409 (shrink_window_lowest_first, save_restore_orig_size): Remove.
8410 Resize mini windows in window.el.
8411 (grow_mini_window, shrink_mini_window): Implement by calling
8412 Qresize_root_window_vertically, resize_window_check and
8413 resize_window_apply.
640c8776
SM
8414 (saved_window, Fset_window_configuration, save_window_save):
8415 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
8416 resize_proportionally.
8417 (window_min_height, window_min_width): Move to window.el.
8418 (keys_of_window): Move bindings for delete-other-windows,
8419 split-window, delete-window and enlarge-window to window.el.
8420
8421 * buffer.c: Temporarily extern Qdelete_window.
8422 (Fbury_buffer): Temporarily call Qdelete_window instead of
8423 Fdelete_window (Fbury_buffer will move to window.el soon).
8424
8425 * frame.c (set_menu_bar_lines_1): Remove code handling
8426 orig_top_line and orig_total_lines.
8427
8428 * dispnew.c (adjust_frame_glyphs_initially): Don't use
8429 set_window_height but set heights directly.
8430 (change_frame_size_1): Use resize_frame_windows.
8431
8432 * xdisp.c (init_xdisp): Don't use set_window_height but set
8433 heights directly.
8434
640c8776
SM
8435 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
8436 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
8437 run_window_configuration_change_hook.
8438
8439 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
8440 instead of change_window_heights and run
8441 run_window_configuration_change_hook.
8442
1a13852e
MR
84432011-06-09 Martin Rudalics <rudalics@gmx.at>
8444
8445 * window.c (replace_window): Rename second argument REPLACEMENT to
8446 NEW. New third argument SETFLAG. Rewrite.
8447 (delete_window, make_dummy_parent): Call replace_window with
8448 third argument 1.
8449 (window_list_1): Move down in code.
8450 (run_window_configuration_change_hook): Move set_buffer part
8451 before select_frame_norecord part in order to unwind correctly.
8452 Rename count1 to count.
8453 (recombine_windows, delete_deletable_window, resize_root_window)
8454 (Fdelete_other_windows_internal)
8455 (Frun_window_configuration_change_hook, make_parent_window)
8456 (resize_window_check, resize_window_apply, Fresize_window_apply)
8457 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
8458 (Fdelete_window_internal, Fresize_mini_window_internal):
8459 New functions.
1a13852e
MR
8460 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
8461
f3d1777e
MR
84622011-06-08 Martin Rudalics <rudalics@gmx.at>
8463
496e208e
MR
8464 * window.h (window): Add some new members to window structure -
8465 normal_lines, normal_cols, new_total, new_normal, clone_number,
8466 splits, nest, prev_buffers, next_buffers.
8467 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 8468 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 8469
f3d1777e
MR
8470 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
8471 Remove.
496e208e
MR
8472 (make_dummy_parent): Set new members of windows structure.
8473 (make_window): Move down in code. Handle new members of window
8474 structure.
8475 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
8476 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
8477 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
8478 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
8479 (Fset_window_next_buffers, Fset_window_clone_number):
8480 New functions.
496e208e
MR
8481 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
8482 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
8483 Doc-string fixes.
8484 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
8485 Argument WINDOW can be now internal window too.
8486 (Fwindow_use_time): Move up in code.
8487 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
8488 Rewrite doc-string.
8489 (Fset_window_configuration, saved_window)
8490 (Fcurrent_window_configuration, save_window_save): Handle new
8491 members of window structure.
b9e809c2
MR
8492 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
8493 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
8494 (syms_of_window): New Lisp objects Qrecord_window_buffer,
8495 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
8496 Qget_mru_window, Qresize_root_window,
8497 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
8498 Qauto_buffer_name; staticpro them.
f3d1777e 8499
abde8f8c
MR
85002011-06-07 Martin Rudalics <rudalics@gmx.at>
8501
8502 * window.c (Fwindow_total_size, Fwindow_left_column)
8503 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
8504 (Fwindow_list_1): New functions.
8505 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
8506 (Fwindow_width, Fscroll_left, Fscroll_right):
8507 Use window_body_cols instead of window_box_text_cols.
8508 (delete_window, Fset_window_configuration):
8509 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
8510 (delete_all_subwindows): Take a window as argument and not a
8511 structure. Rewrite.
190b47e6
MR
8512 (window_loop): Remove handling of GET_LRU_WINDOW and
8513 GET_LARGEST_WINDOW.
8514 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
8515
8516 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
8517 window_box_text_cols. delete_all_subwindows now takes a
8518 Lisp_Object as argument.
abde8f8c 8519
640c8776
SM
8520 * indent.c (compute_motion, Fcompute_motion):
8521 Use window_body_cols instead of window_box_text_cols.
abde8f8c 8522
fa8a67e6
MR
8523 * frame.c (delete_frame): Call delete_all_subwindows with root
8524 window as argument.
8525
a54e3482
DC
85262011-06-07 Daniel Colascione <dan.colascione@gmail.com>
8527
8528 * fns.c (Fputhash): Document return value.
8529
60002bf5
CY
85302011-06-06 Chong Yidong <cyd@stupidchicken.com>
8531
8532 * image.c (gif_load): Implement gif89a spec "no disposal" method.
8533
0c671da6 85342011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 8535
b862a52a 8536 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 8537
be44ca6c
PE
8538 Check for overflow when converting integer to cons and back.
8539 * charset.c (Fdefine_charset_internal, Fdecode_char):
8540 Use cons_to_unsigned to catch overflow.
8541 (Fencode_char): Use INTEGER_TO_CONS.
8542 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
8543 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
8544 * data.c (long_to_cons, cons_to_long): Remove.
8545 (cons_to_unsigned, cons_to_signed): New functions.
8546 These signal an error for invalid or out-of-range values.
8547 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
8548 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
8549 * font.c (Ffont_variation_glyphs):
8550 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
8551 * lisp.h: Include <intprops.h>.
8552 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
8553 (cons_to_signed, cons_to_unsigned): New decls.
8554 (long_to_cons, cons_to_long): Remove decls.
8555 * undo.c (record_first_change): Use INTEGER_TO_CONS.
8556 (Fprimitive_undo): Use CONS_TO_INTEGER.
8557 * xfns.c (Fx_window_property): Likewise.
8558 * xselect.c: Include <limits.h>.
8559 (x_own_selection, selection_data_to_lisp_data):
8560 Use INTEGER_TO_CONS.
8561 (x_handle_selection_request, x_handle_selection_clear)
8562 (x_get_foreign_selection, Fx_disown_selection_internal)
8563 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
8564 (lisp_data_to_selection_data): Use cons_to_unsigned.
8565 (x_fill_property_data): Use cons_to_signed.
8566 Report values out of range.
8567
d1f3d2af
PE
8568 Check for buffer and string overflow more precisely.
8569 * buffer.h (BUF_BYTES_MAX): New macro.
8570 * lisp.h (STRING_BYTES_MAX): New macro.
8571 * alloc.c (Fmake_string):
8572 * character.c (string_escape_byte8):
8573 * coding.c (coding_alloc_by_realloc):
8574 * doprnt.c (doprnt):
8575 * editfns.c (Fformat):
8576 * eval.c (verror):
8577 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
8578 since they may not be the same number.
8579 * editfns.c (Finsert_char):
8580 * fileio.c (Finsert_file_contents):
8581 Likewise for BUF_BYTES_MAX.
8582
dd52fcea
PE
8583 * image.c: Use ptrdiff_t, not int, for sizes.
8584 (slurp_file): Switch from int to ptrdiff_t.
8585 All uses changed.
8586 (slurp_file): Check that file size fits in both size_t (for
8587 malloc) and ptrdiff_t (for sanity and safety).
8588
7f9bbdbb
PE
8589 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
8590 if b->modtime has its maximal value.
8591
dfe18f82
PE
8592 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
8593
84acfcf0
PE
8594 Don't assume time_t can fit into int.
8595 * buffer.h (struct buffer.modtime): Now time_t, not int.
8596 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
8597 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
8598
ccd9a01a
PE
8599 Minor fixes for signed vs unsigned integers.
8600 * character.h (MAYBE_UNIFY_CHAR):
8601 * charset.c (maybe_unify_char):
8602 * keyboard.c (read_char, reorder_modifiers):
8603 XINT -> XFASTINT, since the integer must be nonnegative.
8604 * ftfont.c (ftfont_spec_pattern):
8605 * keymap.c (access_keymap, silly_event_symbol_error):
8606 XUINT -> XFASTINT, since the integer must be nonnegative.
8607 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
8608 since it makes no difference and we prefer signed.
8609 * keyboard.c (record_char): Use XUINT when all the neighbors do.
8610 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
8611 nonnegative.
8612
d6d100dd
SM
86132011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
8614
8615 * window.h (Fwindow_frame): Declare.
8616
2b6148e4
PE
86172011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8618
8619 * alloc.c: Simplify handling of large-request failures (Bug#8800).
8620 (SPARE_MEMORY): Always define.
8621 (LARGE_REQUEST): Remove.
8622 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
8623
f230ecc9
MR
86242011-06-06 Martin Rudalics <rudalics@gmx.at>
8625
727e958e
MR
8626 * lisp.h: Move EXFUNS for Fframe_root_window,
8627 Fframe_first_window and Fset_frame_selected_window to window.h.
8628
8629 * window.h: Move EXFUNS for Fframe_root_window,
8630 Fframe_first_window and Fset_frame_selected_window here from
8631 lisp.h.
8632
8633 * frame.c (Fwindow_frame, Fframe_first_window)
8634 (Fframe_root_window, Fframe_selected_window)
8635 (Fset_frame_selected_window): Move to window.c.
8636 (Factive_minibuffer_window): Move to minibuf.c.
8637 (Fother_visible_frames_p): New function.
8638
8639 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
8640
f230ecc9
MR
8641 * window.c (decode_window, decode_any_window): Move up in code.
8642 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
8643 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
8644 (Fwindow_buffer): Move up and rewrite doc-string.
8645 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
8646 (Fwindow_prev): New functions.
727e958e
MR
8647 (Fwindow_frame): Move here from frame.c. Accept any window as
8648 argument.
8649 (Fframe_root_window, Fframe_first_window)
8650 (Fframe_selected_window): Move here from frame.c. Accept frame
8651 or arbitrary window as argument. Update doc-strings.
8652 (Fminibuffer_window): Move up in code.
8653 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
8654 (Fset_frame_selected_window): Move here from frame.c.
8655 Marginal rewrite.
727e958e
MR
8656 (Fselected_window, select_window, Fselect_window): Move up in
8657 code. Minor doc-string fixes.
f230ecc9 8658
4d09bcf6
PE
86592011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8660
8661 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
8662 Do not assume that spare memory exists; that assumption is valid
8663 only if SYSTEM_MALLOC.
8664 (LARGE_REQUEST): New macro, so that the issue of large requests
8665 is separated from the issue of spare memory.
8666
810928a2
AS
86672011-06-05 Andreas Schwab <schwab@linux-m68k.org>
8668
172418ad
AS
8669 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
8670 format. (Bug#8806)
8671
43f862f7
AS
8672 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
8673
810928a2
AS
8674 * xfns.c (x_set_scroll_bar_default_width): Move declarations
8675 before statements.
8676
a059fe24
JD
86772011-06-05 Jan Djärv <jan.h.d@swipnet.se>
8678
8679 * gtkutil.c (xg_get_default_scrollbar_width): New function.
8680
8681 * gtkutil.h: Declare xg_get_default_scrollbar_width.
8682
8683 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
8684 min width by calling x_set_scroll_bar_default_width (Bug#8505).
8685
989bf368
JB
86862011-06-05 Juanma Barranquero <lekktu@gmail.com>
8687
8688 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
8689
4b80f674
CY
86902011-06-04 Chong Yidong <cyd@stupidchicken.com>
8691
8692 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
8693 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
8694 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
8695 New error handlers.
4b80f674
CY
8696 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
8697 Obey Vx_select_enable_clipboard_manager. Catch errors in
8698 x_clipboard_manager_save (Bug#8779).
8699 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 8700 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 8701
99a33b77 87022011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
8703
8704 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
8705
99a33b77 87062011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
8707
8708 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
8709 in the current matrix if keep_current_p is non-zero.
8710
8264569d
EZ
87112011-06-04 Eli Zaretskii <eliz@gnu.org>
8712
8713 * bidi.c (bidi_level_of_next_char): Fix last change.
8714
57f97249
EZ
87152011-06-03 Eli Zaretskii <eliz@gnu.org>
8716
fec2107c 8717 Support bidi reordering of text covered by display properties.
57f97249 8718
fec2107c
EZ
8719 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
8720 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
8721 (bidi_cache_search, bidi_cache_iterator_state)
8722 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
8723 (bidi_level_of_next_char, bidi_move_to_visually_next):
8724 Support character positions inside a run of characters covered by a
fec2107c
EZ
8725 display string.
8726 (bidi_paragraph_init, bidi_resolve_explicit_1)
8727 (bidi_level_of_next_char): Call bidi_fetch_char and
8728 bidi_fetch_char_advance instead of FETCH_CHAR and
8729 FETCH_CHAR_ADVANCE.
8730 (bidi_init_it): Initialize new members.
8731 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
8732 definitions.
8733 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
8734 instead of using explicit *_CHAR codes.
d6d100dd
SM
8735 (bidi_resolve_explicit, bidi_resolve_weak):
8736 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
8737 bidirectional text is supported only in multibyte buffers.
8738 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
8739 it to initialize the frame_window_p member of struct bidi_it.
8740 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
8741 (bidi_resolve_explicit, bidi_resolve_weak)
8742 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
8743 bidi_it->nchars is non-positive.
8744 (bidi_level_of_next_char): Don't try to lookup the cache for the
8745 next/previous character if nothing is cached there yet, or if we
8746 were just reseat()'ed to a new position.
c40e2fb2 8747
0e14fe90
EZ
8748 * xdisp.c (set_cursor_from_row): Set start and stop points
8749 according to the row's direction when priming the loop that looks
8750 for the glyph on which to display cursor.
8751 (single_display_spec_intangible_p): Function deleted.
8752 (display_prop_intangible_p): Reimplement to call
8753 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
8754 Accept 3 additional arguments needed by handle_display_spec.
8755 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
8756 values: lists, `(when COND...)' forms, etc.
8757 (single_display_spec_string_p): Support property values that are
8758 lists with the argument STRING its top-level element.
8759 (display_prop_string_p): Fix the condition for processing a
8760 property that is a list to be consistent with handle_display_spec.
fec2107c 8761 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
8762 last portion of handle_display_prop.
8763 (compute_display_string_pos): Accept additional argument
8764 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
8765 value of a `display' property is a "replacing spec".
8766 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
8767 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
8768 the display property, but just return a value indicating whether
8769 the display property will replace the characters it covers.
8770 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
8771 frame_window_p members of struct bidi_it.
d6d100dd
SM
8772 (compute_display_string_pos, compute_display_string_end):
8773 New functions.
fec2107c
EZ
8774 (push_it): Accept second argument POSITION, where pop_it should
8775 jump to continue iteration.
8776 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 8777
fec2107c
EZ
8778 * keyboard.c (adjust_point_for_property): Adjust the call to
8779 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
8780
8781 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
8782 (bidi_init_it): Update prototypes.
8783 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
8784 (compute_display_string_pos, compute_display_string_end):
8785 Declare prototypes.
fec2107c
EZ
8786 (struct bidi_it): New members nchars and disp_pos. ch_len is now
8787 EMACS_INT.
fc6f18ce 8788
40087514 87892011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 8790
57f53182
PE
8791 Malloc failure behavior now depends on size of allocation.
8792 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
8793 * lisp.h: Change signatures accordingly.
8794 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
8795 All callers changed. (Bug#8762)
8796
8797 * gnutls.c: Use Emacs's memory allocators.
8798 Without this change, the gnutls library would invoke malloc etc.
8799 directly, which causes problems on non-SYNC_INPUT hosts, and which
8800 runs afoul of improving memory_full behavior. (Bug#8761)
8801 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
8802 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
8803 xfree instead of the default malloc, realloc, free.
8804 (Fgnutls_boot): No need to check for memory allocation failure,
8805 since xmalloc does that for us.
8806
ac32cd99 8807 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
8808 * category.c (hash_get_category_set):
8809 * ccl.c (ccl_driver):
8810 * charset.c (Fdefine_charset_internal):
8811 * charset.h (struct charset.hash_index):
8812 * composite.c (get_composition_id, gstring_lookup_cache)
8813 (composition_gstring_put_cache):
8814 * composite.h (struct composition.hash_index):
8815 * dispextern.h (struct image.hash):
8816 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
8817 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
8818 (hashfn_equal, hashfn_user_defined, make_hash_table)
8819 (maybe_resize_hash_table, hash_lookup, hash_put)
8820 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
8821 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
8822 (Fsxhash, Fgethash, Fputhash, Fmaphash):
8823 * image.c (make_image, search_image_cache, lookup_image)
8824 (xpm_put_color_table_h):
8825 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 8826 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 8827 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 8828 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
8829 * alloc.c (allocate_vectorlike):
8830 Check for overflow in vector size calculations.
8831 * ccl.c (ccl_driver):
8832 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
8833 * fns.c, image.c: Remove unnecessary static decls that would otherwise
8834 need to be updated by these changes.
40087514
PE
8835 * fns.c (make_hash_table, maybe_resize_hash_table):
8836 Check for integer overflow with large hash tables.
0de4bb68
PE
8837 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
8838 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
8839 (SXHASH_REDUCE): New macro.
8840 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
8841 Use it instead of discarding useful hash info with large hash values.
8842 (sxhash_float): New function.
8843 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
8844 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
8845 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
8846 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
8847 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
8848 Adjust signatures to match updated version of code.
8849 (consing_since_gc): Now EMACS_INT, since a single hash table can
8850 use more than INT_MAX bytes.
8851
698d32e2
DN
88522011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
8853
8854 Make it possible to build with GCC-4.6+ -O2 -flto.
8855
8856 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
8857
fd6fa53f
SM
88582011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
8859
8860 * minibuf.c (get_minibuffer, read_minibuf_unwind):
8861 Call minibuffer-inactive-mode.
8862
864db017
JB
88632011-05-31 Juanma Barranquero <lekktu@gmail.com>
8864
8865 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
8866 Update dependencies.
8867
2ad0baf4
DN
88682011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8869
8870 * data.c (init_data): Remove code for UTS, this system is not
8871 supported anymore.
8872
4fcc2638
DN
88732011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8874
8875 Don't force ./temacs to start in terminal mode.
8876
8877 * frame.c (make_initial_frame): Initialize faces in all cases, not
8878 only when CANNOT_DUMP is defined.
8879 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
8880
c56e0fd5
DN
88812011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8882
8883 * dispnew.c (add_window_display_history): Use const for the string
8884 pointer. Remove declaration, not needed.
8885
333d54da 88862011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 8887
55d4c1b2 8888 Use 'inline', not 'INLINE'.
333d54da 8889 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
8890 * alloc.c, fontset.c (INLINE): Remove.
8891 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
8892 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
8893 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
8894 * gmalloc.c (register_heapinfo): Use inline unconditionally.
8895 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
8896
738db178
DN
88972011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8898
8899 Make it possible to run ./temacs.
8900
8901 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
8902 syms_of_callproc does the same thing. Remove test for
8903 "initialized", do it in the caller.
8904 * emacs.c (main): Avoid calling set_initial_environment when dumping.
8905
620c53a6
SM
89062011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
8907
8908 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
8909 (read_minibuf): Use get_minibuffer.
8910 (syms_of_minibuf): Use DEFSYM.
8911 (Qmetadata): New var.
8912 * data.c (Qbuffer): Don't make it static.
8913 (syms_of_data): Use DEFSYM.
8914
e003a292
PE
89152011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8916
8917 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
8918 (CCL_CODE_MIN): New macro.
8919
ed008a6d
PE
89202011-05-30 Paul Eggert <eggert@cs.ucla.edu>
8921
3687c2ef
PE
8922 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
8923
ed008a6d
PE
8924 * eval.c (Qdebug): Now static.
8925 * lisp.h (Qdebug): Remove decl. This reverts a part of the
8926 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
8927 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
8928
d66c4c7c
CY
89292011-05-29 Chong Yidong <cyd@stupidchicken.com>
8930
8931 * image.c: Various fixes to ImageMagick code comments.
8932 (Fimagemagick_types): Doc fix.
8933
5fbc2025
PE
89342011-05-29 Paul Eggert <eggert@cs.ucla.edu>
8935
0196f88a
PE
8936 Minor fixes prompted by GCC 4.6.0 warnings.
8937
8938 * xselect.c (converted_selections, conversion_fail_tag): Now static.
8939
5fbc2025
PE
8940 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
8941 (x_clipboard_manager_save_all): Move extern decl to ...
8942 * xterm.h: ... here, so that it can be checked for consistency.
8943
1dd3c2d9
CY
89442011-05-29 Chong Yidong <cyd@stupidchicken.com>
8945
8946 * xselect.c (x_clipboard_manager_save_frame)
8947 (x_clipboard_manager_save_all): New functions.
8948 (Fx_clipboard_manager_save): Lisp function deleted.
8949
8950 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
8951 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
8952
8953 * xterm.h: Update prototype.
8954
5ba6571d
WX
89552011-05-28 William Xu <william.xwl@gmail.com>
8956
8957 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
8958 exiting (Bug#8239).
8959
3eaff834
JM
89602011-05-28 Jim Meyering <meyering@redhat.com>
8961
e1900994 8962 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
8963 * fns.c (to_uchar): Define.
8964 (crypto_hash_function): Use it to convert some newly-signed
8965 variables to unsigned, to avoid sign-extension bugs. For example,
8966 without this change, (md5 "truc") would evaluate to
8967 45723a2aff78ff4fff7fff1114760e62 rather than the expected
8968 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 8969 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 8970
0f6990a7
PE
89712011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8972
8973 Integer overflow fixes.
c8a9ca5a 8974
08686060
PE
8975 * dbusbind.c: Serial number integer overflow fixes.
8976 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
8977 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
8978 to hold a serial number that is too large for a fixnum.
8979 (Fdbus_method_return_internal, Fdbus_method_error_internal):
8980 Check for serial numbers out of range. Decode any serial number
59568bf0 8981 that was so large that it became a float. (Bug#8722)
08686060 8982
2d1fc3c7
PE
8983 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
8984 (Fdbus_call_method, Fdbus_call_method_asynchronously):
8985 Use XFASTINT rather than XUINT when numbers are nonnegative.
8986 (xd_append_arg, Fdbus_method_return_internal):
8987 (Fdbus_method_error_internal): Likewise. Also, for unsigned
8988 arguments, check that Lisp number is nonnegative, rather than
59568bf0 8989 silently wrapping negative numbers around. (Bug#8722)
30217ff0 8990 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 8991 (Bug#8722)
2d1fc3c7 8992
c8a9ca5a
PE
8993 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
8994
519e1d69
PE
8995 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
8996
6df6ae42 8997 ccl: Add integer overflow checks.
30569699
PE
8998 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
8999 (IN_INT_RANGE): New macros.
9000 (ccl_driver): Use them to check for integer overflow when
9001 decoding a CCL program. Many of the new checks are whether XINT (x)
9002 fits in int; it doesn't always, on 64-bit hosts. The new version
9003 doesn't catch all possible integer overflows, but it's an
847044ea 9004 improvement. (Bug#8719)
30569699 9005
c11285dc
PE
9006 * alloc.c (make_event_array): Use XINT, not XUINT.
9007 There's no need for unsigned here.
9008
fdccd48e
PE
9009 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
9010 This follows up to the 2011-05-06 change that substituted uintptr_t
9011 for EMACS_INT. This case wasn't caught back then.
9012
37910ab2
PE
9013 Rework Fformat to avoid integer overflow issues.
9014 * editfns.c: Include <float.h> unconditionally, as it's everywhere
9015 now (part of C89). Include <verify.h>.
9016 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
9017 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
9018 (Fformat): Avoid the prepass trying to compute sizes; it was only
9019 approximate and thus did not catch overflow reliably. Instead, walk
9020 through the format just once, formatting and computing sizes as we go,
9021 checking for integer overflow at every step, and allocating a larger
9022 buffer as needed. Keep track separately whether the format is
9023 multibyte. Keep only the most-recently calculated precision, rather
9024 than them all. Record whether each argument has been converted to
9025 string. Use EMACS_INT, not int, for byte and char and arg counts.
9026 Support field widths and precisions larger than INT_MAX. Avoid
9027 sprintf's undefined behavior with conversion specifications such as %#d
9028 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
9029 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
9030 formatting out-of-range floating point numbers with int
9173deec 9031 formats. (Bug#8668)
37910ab2 9032
2e6578fb
PE
9033 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
9034
0ae6bdee
PE
9035 * data.c: Avoid integer truncation in expressions involving floats.
9036 * data.c: Include <intprops.h>.
9037 (arith_driver): When there's an integer overflow in an expression
9038 involving floating point, convert the integers to floating point
9039 so that the resulting value does not suffer from catastrophic
9040 integer truncation. For example, on a 64-bit host (* 4
9041 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
9042 Do not rely on undefined behavior after integer overflow.
9043
de883a70
PE
9044 merge count_size_as_multibyte, parse_str_to_multibyte
9045 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 9046 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
9047 Check for integer overflow.
9048 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
9049 since it's now a duplicate of the other. This is more of
9050 a character than a buffer op, so better that it's in character.c.
9051 * fns.c, print.c: Adjust to above changes.
9052
2ff916cb
PE
90532011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
9054
9055 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
9056
f1b54466
PE
90572011-05-27 Paul Eggert <eggert@cs.ucla.edu>
9058
fb1ac845
PE
9059 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9060 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
9061 (x_clipboard_manager_save): Now static.
9062 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
9063
f1b54466
PE
9064 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
9065 (crypto_hash_function): Now static.
9066 Fix pointer signedness problems. Avoid unnecessary initializations.
9067
a9f737ee
CY
90682011-05-27 Chong Yidong <cyd@stupidchicken.com>
9069
9070 * termhooks.h (Vselection_alist): Make it terminal-local.
9071
9072 * terminal.c (create_terminal): Initialize it.
9073
9074 * xselect.c: Support for clipboard managers.
9075 (Vselection_alist): Move to termhooks.h as terminal-local var.
9076 (LOCAL_SELECTION): New macro.
9077 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
9078 (symbol_to_x_atom): Remove gratuitous arg.
9079 (x_handle_selection_request, lisp_data_to_selection_data)
9080 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
9081 (x_own_selection, x_get_local_selection, x_convert_selection):
9082 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
9083 (some_frame_on_display): Delete unused function.
9084 (Fx_own_selection_internal, Fx_get_selection_internal)
9085 (Fx_disown_selection_internal, Fx_selection_owner_p)
9086 (Fx_selection_exists_p): New optional frame arg.
9087 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
9088 (x_handle_selection_clear): Don't treat other terminals with the
9089 same keyboard specially. Use the terminal-local Vselection_alist.
9090 (x_clear_frame_selections): Use Frun_hook_with_args.
9091
9092 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
9093
9094 * xterm.h: Add support for those atoms.
9095
e067f0c1
CY
90962011-05-26 Chong Yidong <cyd@stupidchicken.com>
9097
9098 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
9099 (converted_selections, conversion_fail_tag): New global variables.
9100 (x_selection_request_lisp_error): Free the above.
9101 (x_get_local_selection): Remove unnecessary code.
9102 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
9103 of converted selections stored in converted_selections.
9104 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
9105 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
9106 (x_convert_selection): New function.
9107 (x_handle_selection_event): Simplify.
9108 (x_get_foreign_selection): Don't ignore incoming requests while
9109 waiting for an answer; this will fail when we implement
9110 SAVE_TARGETS, and seems unnecessary anyway.
9111 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
9112 (Vx_sent_selection_functions): Doc fix.
9113
0f4aebc0
LL
91142011-05-26 Leo Liu <sdl.web@gmail.com>
9115
9116 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
9117
e61124cd
YM
91182011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9119
9120 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
9121
9122 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
9123 for fringe update if it has periodic bitmap.
ac389d0c 9124 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
9125 and fringe_bitmap_periodic_p.
9126
9127 * fringe.c (get_fringe_bitmap_data): New function.
9128 (draw_fringe_bitmap_1, update_window_fringes): Use it.
9129 (update_window_fringes): Record periodicity of fringe bitmap in glyph
9130 row. Mark glyph row for fringe update if periodicity changed.
9131
9132 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
9133 for fringe update unless it has periodic bitmap.
9134
f16d9837
KH
91352011-05-25 Kenichi Handa <handa@m17n.org>
9136
9137 * xdisp.c (get_next_display_element): Set correct it->face_id for
9138 a static composition.
9139
e1b90ef6
LL
91402011-05-24 Leo Liu <sdl.web@gmail.com>
9141
9142 * deps.mk (fns.o):
9143 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
9144
9145 * fns.c (crypto_hash_function, Fsha1): New function.
9146 (Fmd5): Use crypto_hash_function.
9147 (syms_of_fns): Add Ssha1.
9148
7400048f
PE
91492011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9150
9151 * gnutls.c: Remove unused macros.
9152 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
9153 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
9154 Remove macros that are defined and never used.
9155 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
9156
abb71cf4
CY
91572011-05-22 Chong Yidong <cyd@stupidchicken.com>
9158
9159 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
9160 (Fx_get_selection_internal): Minor cleanup.
9161 (Fx_own_selection_internal): Rename arguments for consistency with
9162 select.el.
9163
6307db39
PE
91642011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9165
9166 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
9167
f3d4e0a4
CY
91682011-05-22 Chong Yidong <cyd@stupidchicken.com>
9169
9170 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
9171
4d8ade89
YM
91722011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9173
9174 * dispnew.c (scrolling_window): Don't exclude the case that the
9175 last enabled row in the desired matrix touches the bottom boundary.
9176
32078c8d
GM
91772011-05-21 Glenn Morris <rgm@gnu.org>
9178
9179 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
9180 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
9181 and add some more files.
32078c8d 9182
7285dc67
EZ
91832011-05-20 Eli Zaretskii <eliz@gnu.org>
9184
9185 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
9186 report_file_error introduced by the change from 2011-05-07.
9187
89d1bd22
PE
91882011-05-20 Paul Eggert <eggert@cs.ucla.edu>
9189
9190 * systime.h (Time): Define only if emacs is defined.
9191 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
9192 where the include path doesn't have X11/X.h by default. See
9193 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
9194
cd394be1 91952011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
9196
9197 * composite.c (find_automatic_composition): Fix previous change.
9198
b9704ad9
GM
91992011-05-20 Glenn Morris <rgm@gnu.org>
9200
9201 * lisp.mk: New file, split from Makefile.in.
9202 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
9203 (shortlisp): Remove.
9204 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
9205
4a720484
GM
92062011-05-19 Glenn Morris <rgm@gnu.org>
9207
9208 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
9209 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
9210 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
9211 (lisp): Set the order to that of loadup.el.
9212 (shortlisp): Make it a copy of $lisp.
9213 (SOME_MACHINE_LISP): Remove.
9214 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
9215 Use just $shortlisp, not $SOME_MACHINE_LISP too.
9216
a28d4396
KH
92172011-05-18 Kenichi Handa <handa@m17n.org>
9218
9219 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
9220 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
9221 (find_automatic_composition): Mostly rewrite for efficiency.
9222
a2b1fa8e
JB
92232011-05-18 Juanma Barranquero <lekktu@gmail.com>
9224
9225 * makefile.w32-in: Update dependencies.
9226
8e1f5610
CS
92272011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
9228
9229 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 9230 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 9231
7025ee00 92322011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 9233
cdfa6eab
PE
9234 Fix some integer overflow issues, such as string length overflow.
9235
06d6db33
PE
9236 * insdel.c (count_size_as_multibyte): Check for string overflow.
9237
2b4560a8
PE
9238 * character.c (lisp_string_width): Check for string overflow.
9239 Use EMACS_INT, not int, for string indexes and lengths; in
9240 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
9241 the resulting string length overflows an EMACS_INT; instead,
9242 report a string overflow if no precision given. When checking for
9243 precision exhaustion, use a check that cannot possibly have
9244 integer overflow. (Bug#8675)
9245 * character.h (lisp_string_width): Adjust to new signature.
9246
cb93f9be
PE
9247 * alloc.c (string_overflow): New function.
9248 (Fmake_string): Use it. This doesn't change behavior, but saves
9249 a few bytes and will simplify future changes.
9250 * character.c (string_escape_byte8): Likewise.
9251 * lisp.h (string_overflow): New decl.
9252
1a1f3366
PE
9253 Fixups, following up to the user-interface timestamp change.
9254 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
9255 for UI timestamps, instead of unsigned long.
9fbd6841
PE
9256 * msdos.c (mouse_get_pos): Likewise.
9257 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
9258 * w32gui.h (Time): Define by including "systime.h" rather than by
9259 declaring it ourselves. (Bug#8664)
9260
d4e3e4d3
PE
9261 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
9262 * image.c (clear_image_cache): Likewise.
9263
f6a24d19
PE
9264 * term.c (term_mouse_position): Don't assume time_t wraparound.
9265
08dc5ae6
PE
9266 Be more systematic about user-interface timestamps.
9267 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
9268 and sometimes 'EMACS_UINT', to represent these timestamps.
9269 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
9270 This makes the code easier to follow, and makes it easier to catch
9271 integer overflow bugs such as Bug#8664.
9272 * frame.c (Fmouse_position, Fmouse_pixel_position):
9273 Use Time, not unsigned long, for user-interface timestamps.
9274 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
9275 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
9276 * keyboard.h (last_event_timestamp): Likewise.
9277 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
9278 * menu.h (xmenu_show): Likewise.
9279 * term.c (term_mouse_position): Likewise.
9280 * termhooks.h (struct input_event.timestamp): Likewise.
9281 (struct terminal.mouse_position_hook): Likewise.
9282 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
9283 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
9284 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
9285 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
9286 what it was before.
9287 * menu.h, termhooks.h: Include "systime.h", for Time.
9288
8e55734a
PE
9289 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
9290 Don't assume that the difference between two unsigned long values
9291 can fit into an integer. At this point, we know button_down_time
9292 <= event->timestamp, so the difference must be nonnegative, so
9293 there's no need to cast the result if double-click-time is
9294 nonnegative, as it should be; check that it's nonnegative, just in
9295 case. This bug is triggered when events are more than 2**31 ms
86db42d2 9296 apart (about 25 days). (Bug#8664)
8e55734a 9297
841f1b75 9298 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 9299 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 9300
3e26f69c
PE
9301 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
9302 that always fit in int. Use a sentinel instead of a counter, to
9303 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
9304 * frame.h (struct frame): Use int for menu_bar_items_used
9305 instead of EMACS_INT, since it always fits in int.
3e26f69c 9306
5cc152c0
PE
9307 * menu.c (grow_menu_items): Check for int overflow.
9308
d89eb65e
PE
9309 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
9310
5235bd3e
PE
9311 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
9312 Before, the code was not consistent. These values cannot exceed
9313 2**31 - 1 so there's no need to make them unsigned.
9314 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
9315 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
9316 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
9317 as modifiers.
9318 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
9319
bc827e23
PE
9320 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
9321 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
9322 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
9323 presumably because the widths might not match.
9324
78eb494e
PE
9325 * window.c (size_window): Avoid needless test at loop start.
9326
04f2d78b
CB
93272011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
9328
9329 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
9330
d2fc7e3d 93312011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
9332
9333 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
9334
d2fc7e3d 93352011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
9336
9337 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
9338 `width' to `bar_area_x' and `bar_area_width', respectively.
9339 (x_scroll_run): Take account of fringe background extension.
9340
04f2d78b
CB
9341 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
9342 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
9343 `bar_area_width', respectively.
9344 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
9345 background extension.
9346
79b70037
GM
93472011-05-10 Jim Meyering <meyering@redhat.com>
9348
9349 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
9350
2f142cc5
JB
93512011-05-10 Juanma Barranquero <lekktu@gmail.com>
9352
9353 * image.c (Finit_image_library): Return t for built-in image types,
9354 like pbm and xbm. (Bug#8640)
9355
57679c86
AS
93562011-05-09 Andreas Schwab <schwab@linux-m68k.org>
9357
9358 * w32menu.c (set_frame_menubar): Fix submenu allocation.
9359
888c9e86
EZ
93602011-05-07 Eli Zaretskii <eliz@gnu.org>
9361
b0512a1d
EZ
9362 * w32console.c (Fset_screen_color): Doc fix.
9363 (Fget_screen_color): New function.
9364 (syms_of_ntterm): Defsubr it.
9365
7285dc67
EZ
9366 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
9367 unlink the temporary file if Fcall_process didn't create it in the
9368 first place.
9369 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
9370 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
9371 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
9372 cue to call_process_cleanup not to close that handle.
9373
4d3fcc8e
BK
93742011-05-07 Ben Key <bkey76@gmail.com>
9375
9376 * makefile.w32-in: The bootstrap-temacs rule now makes use of
9377 one of two shell specific rules, either bootstrap-temacs-CMD or
9378 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
9379 to the previous implementation of the bootstrap-temacs rule.
9380 The bootstrap-temacs-CMD rule is similar to the previous
9381 implementation of the bootstrap-temacs rule except that it
9382 makes use of the ESC_CFLAGS variable instead of the CFLAGS
9383 variable.
9384
9385 These changes, along with some changes to nt/configure.bat,
9386 nt/gmake.defs, and nt/nmake.defs, are required to extend my
9387 earlier fix to add support for --cflags and --ldflags options
9388 that include quotes so that it works whether make uses cmd or
9389 sh as the shell.
9390
b4289b64
MA
93912011-05-06 Michael Albinus <michael.albinus@gmx.de>
9392
9393 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
9394 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
9395 is a constant.
9396 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
9397 a string. Handle both cases.
9398 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
9399 (Fdbus_register_method): Use Qinvalid_function.
9400
af4c0e28
JB
94012011-05-06 Juanma Barranquero <lekktu@gmail.com>
9402
9403 * makefile.w32-in: Update dependencies.
9404 (LISP_H): Add inttypes.h and stdin.h.
9405 (PROCESS_H): Add unistd.h.
9406
c51453d9
EZ
94072011-05-06 Eli Zaretskii <eliz@gnu.org>
9408
9409 * lread.c: Include limits.h (fixes the MS-Windows build broken by
9410 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
9411
8ff0ac3c 94122011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 9413
4c4b566b
PE
9414 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
9415
aab2b9b5
PE
9416 * term.c (vfatal): Remove stray call to va_end.
9417 It's not needed and the C Standard doesn't allow it here anyway.
9418
c378da0b
PE
9419 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
9420 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
9421
288b08c7
PE
9422 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
9423 bytes.
9424
e3601888
PE
9425 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
9426
db6c0e74
PE
9427 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9428
dd5963ea
PE
9429 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
9430
88c9450f
PE
9431 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
9432
2f9442b8
PE
9433 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
9434
c032b5f8
PE
9435 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
9436 * charset.c (Fdefine_charset_internal): Don't initialize
9437 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 9438 32-bit int (Bug#8600).
a108c10b
PE
9439
9440 * lread.c (read_integer): Be more consistent with string-to-number.
9441 Use string_to_number to do the actual conversion; this avoids
9442 rounding errors and fixes some other screwups. Without this fix,
9443 for example, #x1fffffffffffffff was misread as -2305843009213693952.
9444 (digit_to_number): Move earlier, for benefit of read_integer.
9445 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 9446 not a digit in any supported base. (Bug#8602)
a108c10b 9447
ad5f9eea
PE
9448 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
9449
aec1708a
PE
9450 * dispnew.c (scrolling_window): Return 1 if we scrolled,
9451 to match comment at start of function. This also removes a
9452 GCC warning about overflow in a 32+64-bit port.
9453
47be4ab5
PE
9454 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
9455
371cac43
PE
9456 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
9457 Reported by Stefan Monnier in
9458 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
9459 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9460 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 9461
d01a7826
PE
9462 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
9463 (EMACS_UINTPTR): Likewise, with uintptr_t.
9464
7fd47d5c
PE
9465 * lisp.h: Prefer 64-bit EMACS_INT if available.
9466 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
9467 on 32-bit hosts that have 64-bit int, so that they can access
9468 large files.
122b0c86
PE
9469 However, temporarily disable this change unless the temporary
9470 symbol WIDE_EMACS_INT is defined.
7fd47d5c 9471
8727937b
PE
9472 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
9473
8ac068ac
PE
9474 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
9475 This removes an assumption that EMACS_INT and long are the same
9476 width as pointers. The assumption is true for Emacs porting targets
9477 now, but we want to make other targets possible.
9478 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
9479 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
9480 In the rest of the code, change types of integers that hold casted
9481 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
9482 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
9483 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
9484 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
9485 No need to cast type when ORing.
9486 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
9487 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
9488 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
9489 assume EMACS_INT is the same width as char *.
9490 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
9491 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
9492 Remove no-longer-needed casts.
9493 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
9494 (xg_tool_bar_help_callback, xg_make_tool_item):
9495 Use EMACS_INTPTR to hold an integer
9496 that will be cast to void *; this can avoid a GCC warning
9497 if EMACS_INT is not the same width as void *.
9498 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
9499 * xdisp.c (display_echo_area_1, resize_mini_window_1):
9500 (current_message_1, set_message_1):
9501 Use a local to convert to proper width without a cast.
9502 * xmenu.c (dialog_selection_callback): Likewise.
9503
ede49d71
PE
9504 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
9505 Also, don't assume VALBITS / RAND_BITS is less than 5,
9506 and don't rely on undefined behavior when shifting a 1 left into
9507 the sign bit.
9508 * lisp.h (get_random): Change signature to match.
9509
2f30ecd0
PE
9510 * lread.c (hash_string): Use size_t, not int, for hash computation.
9511 Normally we prefer signed values; but hashing is special, because
9512 it's better to use unsigned division on hash table sizes so that
9513 the remainder is nonnegative. Also, size_t is the natural width
9514 for hashing into memory. The previous code used 'int', which doesn't
9515 retain enough info to hash well into very large tables.
9516 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
9517
2a866e7b
PE
9518 * dbusbind.c: Don't possibly lose pointer info when converting.
9519 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9520 Use XPNTR rather than XHASH, so that the high-order bits of
9521 the pointer aren't lost when converting through void *.
9522
51639eac
PE
9523 * eval.c (Fautoload): Don't double-shift a pointer.
9524
92394119
PE
9525 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
9526
dbdb9a7c
JB
95272011-05-06 Juanma Barranquero <lekktu@gmail.com>
9528
9529 * gnutls.c (DEF_GNUTLS_FN):
9530 * image.c (DEF_IMGLIB_FN): Make function pointers static.
9531
db7a0b4f
AS
95322011-05-05 Andreas Schwab <schwab@linux-m68k.org>
9533
9534 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
9535 marker. (Bug#8610)
9536
cd394be1 95372011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
9538
9539 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
9540 New version that can reserve upto 2GB of heap space.
9541
f7ff1b0f 95422011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
9543
9544 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
9545
639c109b
TZ
95462011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
9547
9548 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
9549 `gnutls_certificate_set_x509_key_file'.
9550
d2127135
JB
95512011-05-05 Juanma Barranquero <lekktu@gmail.com>
9552
9553 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
9554 Update dependencies.
9555
e968f4f3
JB
95562011-05-04 Juanma Barranquero <lekktu@gmail.com>
9557
9558 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
9559 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9560 Remove unused parameter `fildes'.
9561 * process.c (read_process_output, send_process): Don't pass it.
9562
84d358f0
JB
95632011-05-04 Juanma Barranquero <lekktu@gmail.com>
9564
9565 Fix previous change: the library cache is defined in w32.c.
9566 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
9567 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
9568
0898ca10
JB
95692011-05-04 Juanma Barranquero <lekktu@gmail.com>
9570
9571 Implement dynamic loading of GnuTLS on Windows.
9572
9573 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
9574 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
9575 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9576 Declare.
9577
9578 * gnutls.c (Qgnutls_dll): Define.
9579 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
9580 (gnutls_*): Declare function pointers.
9581 (init_gnutls_functions): New function to initialize function pointers.
9582 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
9583 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
9584 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9585 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
9586 (emacs_gnutls_write, emacs_gnutls_read)
9587 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
9588 (Fgnutls_available_p): New function.
9589 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
9590 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
9591 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
9592
9593 * image.c: Include w32.h.
9594 (Vimage_type_cache): Delete.
9595 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
9596 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
9597 (w32_delayed_load): Move to w32.c.
9598
9599 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
9600
9601 * w32.c (QCloaded_from, Vlibrary_cache): Define.
9602 (w32_delayed_load): Move from image.c. When loading a library, record
9603 its filename in the :loaded-from property of the library id.
9604 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
9605 Initialize and staticpro them.
9606 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
9607
9608 * process.c: Include lisp.h before w32.h, not after.
9609 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
9610 instead of gnutls_record_check_pending.
9611
9612 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
9613
ff4de4aa
TZ
96142011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
9615
9616 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
9617 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
9618 as passed in.
9619
abe95abb
JD
96202011-05-03 Jan Djärv <jan.h.d@swipnet.se>
9621
9622 * xterm.c (x_set_frame_alpha): Do not set property on anything
9623 else than FRAME_X_OUTER_WINDOW (Bug#8608).
9624
e16e55d4
JB
96252011-05-02 Juanma Barranquero <lekktu@gmail.com>
9626
9627 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
9628
bafcf6a5
JB
96292011-05-02 Juanma Barranquero <lekktu@gmail.com>
9630
9631 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
9632 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
9633 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
9634 (gnutls_global_initialized, Qgnutls_bootprop_priority)
9635 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
9636 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
9637 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
9638 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
9639 (Qgnutls_bootprop_callbacks_verify): Make static.
9640
e7a6747f
AS
96412011-05-01 Andreas Schwab <schwab@linux-m68k.org>
9642
19ed11ba
AS
9643 * callproc.c: Indentation fixup.
9644
e7a6747f 9645 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
9646 (wait_for_termination, interruptible_wait_for_termination):
9647 Move after wait_for_termination_1.
e7a6747f 9648
1ef14cb4
LMI
96492011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
9650
9651 * sysdep.c (interruptible_wait_for_termination): New function
9652 which is like wait_for_termination, but allows keyboard
9653 interruptions.
9654
9655 * callproc.c (Fcall_process): Add (:file "file") as an option for
9656 the STDOUT buffer.
9657 (Fcall_process_region): Ditto.
9658
330d880c
EZ
96592011-04-30 Eli Zaretskii <eliz@gnu.org>
9660
8db90b73
EZ
9661 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
9662 rather than `XVECTOR (FOO)->size'.
9663
330d880c
EZ
9664 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
9665 inttypes.h, as a gnulib replacement is used if it not available in
9666 system headers.
9667
15cbd324
EZ
96682011-04-21 Eli Zaretskii <eliz@gnu.org>
9669
9670 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
9671 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
9672 of MOST_POSITIVE_FIXNUM. (Bug#8528)
9673
9674 * coding.c (coding_alloc_by_realloc): Error out if destination
9675 will grow beyond MOST_POSITIVE_FIXNUM.
9676 (decode_coding_emacs_mule): Abort if there isn't enough place in
9677 charbuf for the composition carryover bytes. Reserve an extra
9678 space for up to 2 characters produced in a loop.
9679 (decode_coding_iso_2022): Abort if there isn't enough place in
9680 charbuf for the composition carryover bytes.
9681
96822011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 9683
ae940cca
EZ
9684 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
9685 aborting when %lld or %lll format is passed.
9686 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
9687 %llo or %llx format is passed. (Bug#8545)
9688
03ab8921
EZ
9689 * window.c (window_scroll_line_based): Use a marker instead of
9690 simple variables to record original value of point. (Bug#7952)
9691
afda1437
EZ
9692 * doprnt.c (doprnt): Fix the case where a multibyte sequence
9693 produced by %s or %c overflows available buffer space. (Bug#8545)
9694
f76dee0c
PE
96952011-04-28 Paul Eggert <eggert@cs.ucla.edu>
9696
9697 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 9698 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 9699
fdc5744d
JB
97002011-04-28 Juanma Barranquero <lekktu@gmail.com>
9701
9702 * w32.c (init_environment): Warn about defaulting HOME to C:\.
9703
638f053a
JB
97042011-04-28 Juanma Barranquero <lekktu@gmail.com>
9705
9706 * keyboard.c (Qdelayed_warnings_hook): Define.
9707 (command_loop_1): Run `delayed-warnings-hook'
9708 if Vdelayed_warnings_list is non-nil.
9709 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
9710 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
9711
d178f871
EZ
97122011-04-28 Eli Zaretskii <eliz@gnu.org>
9713
9714 * doprnt.c (doprnt): Don't return value smaller than the buffer
9715 size if the message was truncated. (Bug#8545).
9716
b124fd93
JB
97172011-04-28 Juanma Barranquero <lekktu@gmail.com>
9718
9719 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
9720 (Fx_window_property): #if-0 the whole functions, not just the bodies.
9721
e810457d
PE
97222011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9723
9724 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
9725
ea51cceb
JB
97262011-04-27 Juanma Barranquero <lekktu@gmail.com>
9727
9728 * makefile.w32-in: Update dependencies.
9729
94dcfacf
EZ
97302011-04-27 Eli Zaretskii <eliz@gnu.org>
9731
9732 Improve `doprnt' and its usage. (Bug#8545)
9733 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
9734 `format_end'. Remove support for %l as a conversion specifier.
9735 Don't use xrealloc. Improve diagnostics when the %l size modifier
9736 is used. Update the commentary.
9737
9738 * eval.c (verror): Simplify calculation of size_t.
9739
9740 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
9741 messages.
9742
f61f41d7
PE
97432011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
9744
9745 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
9746 change.
9747
96fb4434
PE
97482011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9749
9750 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
9751 This makes this file independent of the recent pseudovector change.
9752
671875da 97532011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 9754
69e9b5a3
PE
9755 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
9756
b5f869a7 9757 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 9758 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 9759 Remove unused local.
c8926152 9760 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 9761
841a1577 9762 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
9763 GCC 4.6.0 optimizes based on type-based alias analysis.
9764 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
9765 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
9766 != &v->size, and therefore "v->size = 1; b->size = 2; return
9767 v->size;" must therefore return 1. This assumption is incorrect
9768 for Emacs, since it type-puns struct Lisp_Vector * with many other
9769 types. To fix this problem, this patch adds a new type struct
f904488f 9770 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
9771 and pseudovectors, and helps optimizing compilers not get fooled
9772 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
9773 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
9774 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
9775 the size member.
eab3844f
PE
9776 (XSETPVECTYPE): Rewrite in terms of new macro.
9777 (XSETPVECTYPESIZE): New macro, specifying both type and size.
9778 This is a bit clearer, and further avoids the possibility of
9779 undesirable aliasing.
9780 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 9781 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
9782 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
9783 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
9784 (ASIZE): Now uses header.size rather than size.
9785 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
9786 to avoid the hassle of writing XVECTOR (foo)->header.size.
9787 (struct vectorlike_header): New type.
eab3844f
PE
9788 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
9789 object, to help avoid aliasing.
9790 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
9791 (SUBRP): Likewise, since Lisp_Subr is a special case.
9792 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
9793 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
9794 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 9795 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
9796 changed to be "header.size" and "header.next".
9797 * buffer.h (struct buffer): Likewise.
9798 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
9799 * frame.h (struct frame): Likewise.
9800 * process.h (struct Lisp_Process): Likewise.
9801 * termhooks.h (struct terminal): Likewise.
9802 * window.c (struct save_window_data, struct saved_window): Likewise.
9803 * window.h (struct window): Likewise.
9804 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
9805 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
9806 * buffer.c (init_buffer_once): Likewise.
9807 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
9808 special case.
9809 * process.c (Fformat_network_address): Use local var for size,
9810 for brevity.
9811
0df1eac5
PE
9812 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
9813
847ab9d1 9814 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
9815 * data.c (atof): Remove decl; no longer used or needed.
9816 (digit_to_number): Move to lread.c.
9817 (Fstring_to_number): Use new string_to_number function, to be
9818 consistent with how the Lisp reader treats infinities and NaNs.
9819 Do not assume that floating-point numbers represent EMACS_INT
9820 without losing information; this is not true on most 64-bit hosts.
9821 Avoid double-rounding errors, by insisting on integers when
9822 parsing non-base-10 numbers, as the documentation specifies.
9823 * lisp.h (string_to_number): New decl, replacing ...
9824 (isfloat_string): Remove.
bc0a5c13 9825 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 9826 (read1): Do not accept +. and -. as integers; this
452f4150
PE
9827 appears to have been a coding error. Similarly, do not accept
9828 strings like +-1e0 as floating point numbers. Do not report
9829 overflow for integer overflows unless the base is not 10 which
9830 means we have no simple and reliable way to continue.
9831 Break out the floating-point parsing into a new
9832 function string_to_number, so that Fstring_to_number parses
9833 floating point numbers consistently with the Lisp reader.
04f2d78b 9834 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
9835 (E_CHAR, EXP_INT): Remove, replacing with ...
9836 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
9837 (string_to_number): New function, replacing isfloat_string.
9838 This function checks for valid syntax and produces the resulting
9839 Lisp float number too. Rework it so that string-to-number
bc0a5c13 9840 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
9841 so that overflow for non-base-10 numbers is reported only when
9842 there's no portable and simple way to convert to floating point.
452f4150 9843
67769ffc
PE
9844 * textprop.c (set_text_properties_1): Rewrite for clarity,
9845 and to avoid GCC warning about integer overflow.
9846
c20db43f
PE
9847 * intervals.h (struct interval): Use EMACS_INT for members
9848 where EMACS_UINT might cause problems. See
9849 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
9850 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
9851 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
9852 All uses changed.
37aa2f85
PE
9853 (offset_intervals): Tell GCC not to worry about length overflow
9854 when negating a negative length.
c20db43f 9855
2538aa2f
PE
9856 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
9857 (overrun_check_free): Likewise.
9858
f2d3008d
PE
9859 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
9860 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
9861 word size.
9862
ec8df744
PE
9863 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9864 (gnutls_make_error): Rename local to avoid shadowing.
9865 (gnutls_emacs_global_deinit): ifdef out; not used.
9866 (Fgnutls_boot): Use const for pointer to readonly storage.
9867 Comment out unused local. Fix pointer signedness problems.
9868
640ee02d
PE
9869 * lread.c (openp): Don't stuff size_t into an 'int'.
9870 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
9871 about possible signed overflow.
9872
6048fb2a
PE
9873 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9874 (GDK_KEY_g): Don't define if already defined.
9875 (xg_prepare_tooltip): Avoid pointer signedness problem.
9876 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
9877
fa3c87e1
PE
9878 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
9879 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
9880
2172544b
PE
9881 * xfns.c (Fx_window_property): Simplify a bit,
9882 to make a bit faster and to avoid GCC 4.6.0 warning.
9883 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
9884
9b821a21
PE
9885 * fns.c (internal_equal): Don't assume size_t fits in int.
9886
3c616cfa
PE
9887 * alloc.c (compact_small_strings): Tighten assertion a little.
9888
c2982e87
PE
9889 Replace pEd with more-general pI, and fix some printf arg casts.
9890 * lisp.h (pI): New macro, generalizing old pEd macro to other
9891 conversion specifiers. For example, use "...%"pI"d..." rather
9892 than "...%"pEd"...".
9893 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 9894 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
9895 * alloc.c (check_pure_size): Don't overflow by converting size to int.
9896 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
9897 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
9898 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
9899 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
9900 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
9901 64-bit hosts.
9902 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
9903 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
9904 * print.c (safe_debug_print, print_object): Likewise.
9905 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
9906 to int.
6f04d126
PE
9907 Use pI instead of if-then-else-abort. Use %p to avoid casts,
9908 avoiding the 0 flag, which is not portable.
c2982e87
PE
9909 * process.c (Fmake_network_process): Use pI to avoid cast.
9910 * region-cache.c (pp_cache): Likewise.
9911 * xdisp.c (decode_mode_spec): Likewise.
9912 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
9913 behavior on 64-bit hosts with printf arg.
6f04d126 9914 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
9915 (x_stop_queuing_selection_requests): Likewise.
9916 (x_get_window_property): Don't truncate byte count to an 'int'
9917 when tracing.
0b432f21 9918
5e073ec7
PE
9919 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
9920 here, since it parses constructs like leading '-' and spaces,
9921 which are not wanted; and it overflows with large numbers.
9922 Instead, simply match F[0-9]+, which is what is wanted anyway.
9923
36372bf9
PE
9924 * alloc.c: Remove unportable assumptions about struct layout.
9925 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
9926 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
9927 (allocate_vectorlike, make_pure_vector): Use the new macros,
9928 plus offsetof, to remove unportable assumptions about struct layout.
9929 These assumptions hold on all porting targets that I know of, but
9930 they are not guaranteed, they're easy to remove, and removing them
9931 makes further changes easier.
9932
0b432f21
PE
9933 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
9934 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
9935 (string_overrun_cookie): Now const. Use initializers that
9936 don't formally overflow signed char, to avoid warnings.
000098c1
PE
9937 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
9938 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
9939 (allocate_buffer): Don't assume sizeof (struct buffer) is a
9940 multiple of sizeof (EMACS_INT); it need not be, if
9941 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 9942 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 9943
895009e1
JB
99442011-04-26 Juanma Barranquero <lekktu@gmail.com>
9945
9946 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
9947
6a7a1b0b
TZ
99482011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
9949
9950 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 9951 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
9952 Reported by Paul Eggert <eggert@cs.ucla.edu>.
9953
841a1577 99542011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
9955
9956 * lisp.h (Qdebug): List symbol.
895009e1 9957 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
9958 * keyboard.c (debug-on-event): New variable.
9959 (handle_user_signal): Break into debugger when debug-on-event
9960 matches the current signal symbol.
9961
f2d3ba6f
DN
99622011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
9963
9964 * alloc.c (check_sblock, check_string_bytes)
9965 (check_string_free_list): Convert to standard C.
9966
42ce4c63
TZ
99672011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
9968
9969 * w32.c (emacs_gnutls_push): Fix typo.
9970
825cd63c
EZ
99712011-04-25 Eli Zaretskii <eliz@gnu.org>
9972
fb11d64d
EZ
9973 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
9974 "cast to pointer from integer of different size".
9975
825cd63c
EZ
9976 Improve doprnt and its use in verror. (Bug#8545)
9977 * doprnt.c (doprnt): Document the set of format control sequences
9978 supported by the function. Use SAFE_ALLOCA instead of always
9979 using `alloca'.
9980
9981 * eval.c (verror): Don't limit the buffer size at size_max-1, that
9982 is one byte too soon. Don't use xrealloc; instead xfree and
9983 xmalloc anew.
9984
e061a11b
TZ
99852011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
9986
9987 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
9988 callbacks stage.
9989
9990 * gnutls.c: Renamed global_initialized to
9991 gnutls_global_initialized. Added internals for the
9992 :verify-hostname-error, :verify-error, and :verify-flags
9993 parameters of `gnutls-boot' and documented those parameters in the
9994 docstring. Start callback support.
9173deec
JB
9995 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
9996 unless a fatal error occurred. Call gnutls_alert_send_appropriate
9997 on error. Return error code.
e061a11b
TZ
9998 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
9999 (emacs_gnutls_read): Likewise.
10000 (Fgnutls_boot): Return handshake error code.
10001 (emacs_gnutls_handle_error): New function.
10002 (wsaerror_to_errno): Likewise.
10003
10004 * w32.h (emacs_gnutls_pull): Add prototype.
10005 (emacs_gnutls_push): Likewise.
10006
10007 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
10008 (emacs_gnutls_push): Likewise.
10009
100102011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
10011
10012 * process.c (wait_reading_process_output): Check if GnuTLS
10013 buffered some data internally if no FDs are set for TLS
10014 connections.
10015
10016 * makefile.w32-in (OBJ2): Add gnutls.$(O).
10017 (LIBS): Link to USER_LIBS.
10018 ($(BLD)/gnutls.$(0)): New target.
10019
fa6996bc
EZ
100202011-04-24 Eli Zaretskii <eliz@gnu.org>
10021
eb35682e
EZ
10022 * xdisp.c (handle_single_display_spec): Rename the
10023 display_replaced_before_p argument into display_replaced_p, to
10024 make it consistent with the commentary. Fix typos in the
10025 commentary.
10026
e2ad650c
EZ
10027 * textprop.c (syms_of_textprop): Remove dead code.
10028 (copy_text_properties): Delete obsolete commentary about an
10029 interface that was deleted long ago. Fix typos in the description
10030 of arguments.
10031
1b2de274
EZ
10032 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
10033 to changes in oldXMenu/XMenu.h from 2011-04-16.
10034 <menu_help_message, prev_menu_help_message>: Constify.
10035 (IT_menu_make_room): menu->help_text is now `const char **';
10036 adjust.
10037
10038 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
10039 to changes in oldXMenu/XMenu.h from 2011-04-16.
10040 (struct XMenu): Declare `help_text' `const char **'.
10041
10042 * xfaces.c <Qunspecified>: Make extern again.
10043
10044 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 10045 required by POSIX.
1b2de274 10046
762b15be
EZ
10047 * doc.c (get_doc_string): Improve the format passed to `error'.
10048
10049 * doprnt.c (doprnt): Improve commentary.
10050
10051 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
10052
10053 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
10054 them with etags.
10055
f1052e5d
EZ
10056 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
10057 changes in globals.h immediately force recompilation.
762b15be
EZ
10058 (TAGS): Depend on $(CURDIR)/m/intel386.h and
10059 $(CURDIR)/s/ms-w32.h.
10060 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 10061
fa6996bc
EZ
10062 * character.c (Fchar_direction): Function deleted.
10063 (syms_of_character): Don't defsubr it.
10064 <char-direction-table>: Deleted.
10065
e6c3da20
EZ
100662011-04-23 Eli Zaretskii <eliz@gnu.org>
10067
10068 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
10069 * doprnt.c: Include limits.h.
10070 (SIZE_MAX): New macro.
04f2d78b
CB
10071 (doprnt): Return a size_t value. 2nd arg is now size_t.
10072 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
10073 Improve overflow protection. Support `l' modifier for integer
10074 conversions. Support %l conversion. Don't assume an EMACS_INT
10075 argument for integer conversions and for %c.
10076
10077 * lisp.h (doprnt): Restore prototype.
10078
10079 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
10080 $(SRC)/character.h.
10081
10082 * Makefile.in (base_obj): Add back doprnt.o.
10083
10084 * deps.mk (doprnt.o): Add back prerequisites.
10085 (callint.o): Depend on character.h.
10086
10087 * eval.c (internal_lisp_condition_case): Include the handler
10088 representation in the error message.
10089 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
10090 when breaking from the loop.
10091
10092 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
10093
10094 * callint.c (Fcall_interactively): When displaying error message
10095 about invalid control letter, pass the character's codepoint, not
10096 a pointer to its multibyte form. Improve display of the character
10097 in octal and display also its hex code.
10098
10099 * character.c (char_string): Use %x to display the (unsigned)
10100 codepoint of an invalid character, to avoid displaying a bogus
10101 negative value.
10102
10103 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
10104 `error', not SYMBOL_NAME itself.
10105
10106 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
10107 character arguments to `error'.
10108
10109 * charset.c (check_iso_charset_parameter): Fix incorrect argument
10110 to `error' in error message about FINAL_CHAR argument. Make sure
10111 FINAL_CHAR is a character, and use %c when it is passed as
10112 argument to `error'.
10113
4ffd0d6b 101142011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
10115
10116 * s/ms-w32.h (localtime): Redirect to sys_localtime.
10117
10118 * w32.c: Include <time.h>.
10119 (sys_localtime): New function.
10120
4ffd0d6b 101212011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
10122
10123 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
10124
4ffd0d6b 10125 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 10126
4ffd0d6b 101272011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 10128
4ffd0d6b
GM
10129 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
10130 zombies (Bug#8467).
aac0c6e3 10131
04c56954
EZ
101322011-04-19 Eli Zaretskii <eliz@gnu.org>
10133
10134 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
10135 gl_state.e_property when gl_state.object is Qt.
10136
10137 * insdel.c (make_gap_larger): Remove limitation of buffer size
10138 to <= INT_MAX.
10139
16a43933
CY
101402011-04-18 Chong Yidong <cyd@stupidchicken.com>
10141
10142 * xdisp.c (lookup_glyphless_char_display)
10143 (produce_glyphless_glyph): Handle cons cell entry in
10144 glyphless-char-display.
10145 (Vglyphless_char_display): Document it.
10146
10147 * term.c (produce_glyphless_glyph): Handle cons cell entry in
10148 glyphless-char-display.
10149
4581706e
CY
101502011-04-17 Chong Yidong <cyd@stupidchicken.com>
10151
10152 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
10153
10154 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
10155
10156 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
10157 definition for no-X builds.
10158
4887c6e2 101592011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 10160
fd35b6f9
PE
10161 Static checks with GCC 4.6.0 and non-default toolkits.
10162
5c1ccb01
PE
10163 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
10164
006c5daa
PE
10165 * process.c (keyboard_bit_set): Define only if SIGIO.
10166 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
10167 (send_process): Repair possible setjmp clobbering.
10168
efc736d3
PE
10169 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
10170
4e2fe2e6
PE
10171 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
10172
f97334a2
PE
10173 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
10174
4e75f29d
PE
10175 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
10176 Define only if needed.
10177
90efadd1
PE
10178 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
10179 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 10180 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 10181
3c647824
PE
10182 * dispextern.h (struct redisplay_interface): Rename param
10183 to avoid shadowing.
e264f262 10184 * termhooks.h (struct terminal): Likewise.
761383f4 10185 * xterm.c (xembed_send_message): Likewise.
3c647824 10186
b58c5c4a
PE
10187 * insdel.c (make_gap_smaller): Define only if
10188 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
10189
cad59032
PE
10190 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
10191 it.
10192
c339dc2e
PE
10193 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
10194 so that we aren't warned about unused symbols.
10195
91a3e27b
PE
10196 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
10197
399c71d3 10198 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 10199
8ffc96f5
PE
10200 * xfns.c (x_real_positions): Mark locals as initialized.
10201
eef9bc79
PE
10202 * xmenu.c (xmenu_show): Don't use uninitialized vars.
10203
098db9dd
PE
10204 * xterm.c: Fix problems found by static analysis with other toolkits.
10205 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
10206 (x_dispatch_event): Declare static if USE_GTK, and
10207 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 10208 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 10209 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
10210 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
10211 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 10212
eb18f6cc
PE
10213 * xmenu.c (menu_help_callback): Pointer type fixes.
10214 Use const pointers when pointing at readonly data. Avoid pointer
10215 signedness clashes.
10216 (FALSE): Remove unused macro.
10217 (update_frame_menubar): Remove unused decl.
10218
1fe72bf8
PE
10219 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
10220
60d9e1db
PE
10221 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
10222 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
10223 (single_menu_item): Rename local to avoid shadowing.
10224
39261c26
PE
10225 * keyboard.c (make_lispy_event): Remove unused local var.
10226
018c5e19
PE
10227 * frame.c, frame.h (x_get_resource_string): Bring this back, but
10228 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
10229
63d2b86e
PE
10230 * bitmaps: Change bitmaps from unsigned char back to the X11
10231 compatible char. Avoid the old compiler warnings about
10232 out-of-range initializers by using, for example, '\xab' rather
10233 than 0xab.
10234
aefd87e1
PE
10235 * xgselect.c (xgselect_initialize): Check vs interface
10236 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
10237
bf501fb9
PE
10238 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
10239
e9829fdf
PE
10240 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
10241 to read-only memory.
10242
1086c095
PE
10243 * fns.c (vector): Remove; this old hack is no longer needed.
10244
2baccd04 10245 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 10246 Remove unused var.
dde42981 10247 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 10248
72391843 10249 * xrdb.c (x_load_resources): Omit unused local.
3565b346 10250
436c16df 10251 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 10252 (x_window): Rename locals to avoid shadowing.
dc5ddd85 10253 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 10254
92bb796d 10255 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 10256 (x_term_init): Remove local to avoid shadowing.
92bb796d 10257
764430a3 10258 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
10259
10260 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
10261 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
10262
d1dfb56c
EZ
102632011-04-16 Eli Zaretskii <eliz@gnu.org>
10264
c4354cb4
EZ
10265 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
10266
d1dfb56c
EZ
10267 Fix regex.c, syntax.c and friends for buffers > 2GB.
10268 * syntax.h (struct gl_state_s): Declare character position members
10269 EMACS_INT.
10270
10271 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
10272
04f2d78b
CB
10273 * textprop.c (verify_interval_modification, interval_of):
10274 Declare arguments EMACS_INT.
d1dfb56c
EZ
10275
10276 * intervals.c (adjust_intervals_for_insertion): Declare arguments
10277 EMACS_INT.
10278
10279 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
10280
10281 * indent.c (Fvertical_motion): Local variable it_start is now
10282 EMACS_INT.
10283
10284 * regex.c (re_match, re_match_2, re_match_2_internal)
10285 (bcmp_translate, regcomp, regexec, print_double_string)
10286 (group_in_compile_stack, re_search, re_search_2, regex_compile)
10287 (re_compile_pattern, re_exec): Declare arguments and local
10288 variables `size_t' and `ssize_t' and return values `regoff_t', as
10289 appropriate.
10290 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
10291 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
10292 <compile_stack_type>: `size' and `avail' are now `size_t'.
10293
10294 * regex.h <regoff_t>: Use ssize_t, not int.
10295 (re_search, re_search_2, re_match, re_match_2): Arguments that
10296 specify buffer/string position and length are now ssize_t and
10297 size_t. Return type is regoff_t.
10298
613052cd
BK
102992011-04-16 Ben Key <bkey76@gmail.com>
10300
10301 * nsfont.m: Fixed bugs in ns_get_family and
10302 ns_descriptor_to_entity that were caused by using free to
10303 deallocate memory blocks that were allocated by xmalloc (via
10304 xstrdup). This caused Emacs to crash when compiled with
10305 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
10306 --enable-checking=xmallocoverrun). xfree is now used to
10307 deallocate these memory blocks.
10308
4170f62f 103092011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 10310
71b41406
PE
10311 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
10312
9587a89d
PE
10313 emacs_write: Accept and return EMACS_INT for sizes.
10314 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
10315 et seq.
10316 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
10317 Accept and return EMACS_INT.
10318 (emacs_gnutls_write): Return the number of bytes written on
10319 partial writes.
10320 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
10321 (emacs_read, emacs_write): Remove check for negative size, as the
10322 Emacs source code has been audited now.
9587a89d
PE
10323 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
10324 (emacs_read, emacs_write): Use it.
273a5f82
PE
10325 * process.c (send_process): Adjust to the new signatures of
10326 emacs_write and emacs_gnutls_write. Do not attempt to store
10327 a byte offset into an 'int'; it might overflow.
9587a89d 10328 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 10329
3e047f51
PE
10330 * sound.c: Don't assume sizes fit in 'int'.
10331 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 10332 Return EMACS_INT, not int.
3e047f51 10333 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
10334 Accept EMACS_INT, not int.
10335 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
10336 record read return values.
10337
cc39a9db
BK
103382011-04-15 Ben Key <bkey76@gmail.com>
10339
c9d0ec6d
JB
10340 * keyboard.c (Qundefined): Don't declare static since it is used
10341 in nsfns.m.
10342 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
10343 static since they are used in nsfont.m.
cc39a9db 10344
6c60eb9f
SM
103452011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
10346
10347 * process.c (Qprocessp): Don't declare static.
10348 * lisp.h (Qprocessp): Declare again.
10349
7990b61a
JB
103502011-04-15 Juanma Barranquero <lekktu@gmail.com>
10351
10352 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
10353
5d4cb038
PE
103542011-04-14 Paul Eggert <eggert@cs.ucla.edu>
10355
8bd7b830 10356 Improve C-level modularity by making more things 'static'.
cd64ea1d 10357
e3b27b31
PE
10358 Don't publish debugger-only interfaces to other modules.
10359 * lisp.h (safe_debug_print, debug_output_compilation_hack):
10360 (verify_bytepos, count_markers): Move decls to the only modules
10361 that need them.
10362 * region-cache.h (pp_cache): Likewise.
10363 * window.h (check_all_windows): Likewise.
10364 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
10365
5d4cb038
PE
10366 * sysdep.c (croak): Now static, if
10367 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
10368 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
10369
10370 * alloc.c (refill_memory_reserve): Now static if
10371 !defined REL_ALLOC || defined SYSTEM_MALLOC.
10372 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 10373
e87b6180
PE
10374 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
10375 Define only if USE_LUCID.
10376
ac64929e
PE
10377 * xrdb.c (x_customization_string, x_rm_string): Now static.
10378
6f37259d
PE
10379 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
10380 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
10381
1683e3ab
PE
10382 * xdisp.c (draw_row_with_mouse_face): Now static.
10383 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
10384
de9c2632
PE
10385 * window.h (check_all_windows): Mark externally visible.
10386
2b96acb7
PE
10387 * window.c (window_deletion_count): Now static.
10388
10389 * undo.c: Make symbols static if they're not exported.
10390 (last_undo_buffer, last_boundary_position, pending_boundary):
10391 Now static.
10392
50436f33
PE
10393 * textprop.c (interval_insert_behind_hooks): Now static.
10394 (interval_insert_in_front_hooks): Likewise.
10395
64520e5c
PE
10396 * term.c: Make symbols static if they're not exported.
10397 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
10398 (max_frame_lines, tty_set_terminal_modes):
10399 (tty_reset_terminal_modes, tty_turn_off_highlight):
10400 (get_tty_terminal): Now static.
10401 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
10402 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 10403 HAVE_WINDOW_SYSTEM.
64520e5c
PE
10404 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
10405 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
10406
1fa53021
PE
10407 * sysdep.c: Make symbols static if they're not exported.
10408 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
10409 Now static.
10410 (sigprocmask_set, full_mask): Remove; unused.
10411 (wait_debugging): Mark as visible.
10412 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
10413 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
10414
d4b43b22
PE
10415 * syntax.c (syntax_temp): Define only if !__GNUC__.
10416
b7c513d0
PE
10417 * sound.c (current_sound_device, current_sound): Now static.
10418
989b29ad
PE
10419 * search.c (searchbufs, searchbuf_head): Now static.
10420
13a55a78
PE
10421 * scroll.c (scroll_cost): Remove; unused.
10422 * dispextern.h (scroll_cost): Remove decl.
10423
de68a1fc
PE
10424 * region-cache.h (pp_cache): Mark as externally visible.
10425
40ccffa6
PE
10426 * process.c: Make symbols static if they're not exported.
10427 (process_tick, update_tick, create_process, chan_process):
10428 (Vprocess_alist, proc_buffered_char, datagram_access):
10429 (fd_callback_data, send_process_frame, process_sent_to): Now static.
10430 (deactivate_process): Mark defn as static, as well as decl.
10431 * lisp.h (create_process): Remove decl.
10432 * process.h (chan_process, Vprocess_alist): Remove decls.
10433
ad64fc97
PE
10434 * print.c: Make symbols static if they're not exported.
10435 (print_depth, new_backquote_output, being_printed, print_buffer):
10436 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
10437 (print_interval, print_number_index, initial_stderr_stream):
10438 Now static.
10439 * lisp.h (Fprinc): Remove decl.
10440 (debug_output_compilation_hack): Mark as externally visible.
10441
adddb265
PE
10442 * sysdep.c (croak): Move decl from here to syssignal.h.
10443 * syssignal.h (croak): Put it here, so the API can be checked when
10444 'croak' is called from dissociate_if_controlling_tty.
10445
1717ede2
PE
10446 * minibuf.c: Make symbols static if they're not exported.
10447 (minibuf_save_list, choose_minibuf_frame): Now static.
10448 * lisp.h (choose_minibuf_frame): Remove decl.
10449
fa5fb2bc
PE
10450 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
10451
1e3890d1
PE
10452 * lread.c: Make symbols static if they're not exported.
10453 (read_objects, initial_obarray, oblookup_last_bucket_number):
10454 Now static.
10455 (make_symbol): Remove; unused.
10456 * lisp.h (initial_obarray, make_symbol): Remove decls.
10457
8a1414fa
PE
10458 * keyboard.c: Make symbols static if they're not exported.
10459 (single_kboard, recent_keys_index, total_keys, recent_keys):
10460 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
10461 (this_single_command_key_start, echoing, last_auto_save):
10462 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
10463 (command_loop, echo_now, keyboard_init_hook, help_char_p):
10464 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10465 (Vlispy_mouse_stem, double_click_count):
10466 Now static.
10467 (force_auto_save_soon): Define only if SIGDANGER.
10468 (ignore_mouse_drag_p): Now static if
10469 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
10470 (print_help): Remove; unused.
10471 (stop_character, last_timer_event): Mark as externally visible.
10472 * keyboard.h (ignore_mouse_drag_p): Declare only if
10473 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
10474 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
10475 * lisp.h (echoing): Remove decl.
10476 (force_auto_save_soon): Declare only if SIGDANGER.
10477 * xdisp.c (redisplay_window): Simplify code, to make it more
10478 obvious that ignore_mouse_drag_p is not accessed if !defined
10479 USE_GTK && !defined HAVE_NS.
10480
93ea6e8f
PE
10481 * intervals.c: Make symbols static if they're not exported.
10482 (merge_properties_sticky, merge_interval_right, delete_interval):
10483 Now static.
10484 * intervals.h (merge_interval_right, delete_interval): Remove decls.
10485
77382fcc
PE
10486 * insdel.c: Make symbols static if they're not exported.
10487 However, leave prepare_to_modify_buffer alone. It's never
10488 called from outside this function, but that appears to be a bug.
10489 (combine_after_change_list, combine_after_change_buffer):
4889fc82 10490 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
10491 (adjust_after_replace_noundo): Remove; unused.
10492 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 10493 (signal_before_change): Remove decls.
77382fcc 10494
9306c32e
PE
10495 * indent.c (val_compute_motion, val_vmotion): Now static.
10496
cd44d2eb
PE
10497 * image.c: Make symbols static if they're not exported.
10498 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
10499 if USE_GTK.
10500 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
10501 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
10502
ad9a7a06
PE
10503 * fringe.c (standard_bitmaps): Now static.
10504 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
10505
81626931
PE
10506 * frame.c: Make symbols static if they're not exported.
10507 (x_report_frame_params, make_terminal_frame): Now static.
10508 (get_frame_param): Now static, unless HAVE_NS.
10509 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
10510 (x_get_resource_string): Remove; not used.
10511 * frame.h (make_terminal_frame, x_report_frame_params):
10512 (x_get_resource_string); Remove decls.
10513 (x_fullscreen_adjust): Declare only if WINDOWSNT.
10514 * lisp.h (get_frame_param): Declare only if HAVE_NS.
10515
239f9db9
PE
10516 * font.c, fontset.c: Make symbols static if they're not exported.
10517 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
10518 (FACE_SUITABLE_FOR_CHAR_P): Use it.
10519 * font.c (font_close_object): Now static.
10520 * font.h (font_close_object): Remove.
10521 * fontset.c (FONTSET_OBJLIST): Remove.
10522 (free_realized_fontset) #if-0 the body, which does nothing.
10523 (face_suitable_for_char_p): #if-0, as it's never called.
10524 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
10525 * xfaces.c (face_at_string_position):
10526 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
10527 since 0 is always ASCII.
10528
dfcf3579
PE
10529 * fns.c (weak_hash_tables): Now static.
10530
5045092b
PE
10531 * fileio.c: Make symbols static if they're not exported.
10532 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
10533 (Vwrite_region_annotation_buffers): Now static.
10534
57a96f5c
PE
10535 * eval.c: Make symbols static if they're not exported.
10536 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
10537 * lisp.h (backtrace_list): Remove decl.
10538
35f08c38
PE
10539 * emacs.c: Make symbols static if they're not exported.
10540 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
10541 (fatal_error_code, fatal_error_signal_hook, standard_args):
10542 Now static.
10543 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
10544 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
10545 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
10546 * lisp.h (fatal_error_signal_hook): Remove decl.
10547 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
10548
f44bd759
PE
10549 * editfns.c: Move a (normally-unused) function to its only use.
10550 * editfns.c, lisp.h (get_operating_system_release): Remove.
10551 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
10552 worth the hassle of breaking this out.
10553
b532497d
PE
10554 * xterm.c: Make symbols static if they're not exported.
10555 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
10556 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
10557 (x_destroy_window, x_delete_display):
10558 Now static.
10559 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
10560 (x_mouse_leave): Remove; unused.
10561 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
10562 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
10563 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
10564 Remove decls.
10565 (x_mouse_leave): Declare only if WINDOWSNT.
10566 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
10567 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
10568 USE_X_TOOLKIT.
10569
1675728f
PE
10570 * ftxfont.c: Make symbols static if they're not exported.
10571 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
10572 HAVE_FREETYPE.
10573 * font.h (ftxfont_driver): Likewise.
10574
e4cebfca
PE
10575 * xfns.c: Make symbols static if they're not exported.
10576 (x_last_font_name, x_display_info_for_name):
10577 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
10578 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
10579 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
10580 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
10581 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
10582 (last_show_tip_args): Now static.
10583 (xic_defaut_fontset, xic_create_fontsetname): Define only if
10584 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
10585 (x_screen_planes): Remove; unused.
10586 * dispextern.h (x_screen_planes): Remove decl.
10587
5bf46f05
PE
10588 * dispnew.c: Make symbols static if they're not exported.
10589 * dispextern.h (redraw_garbaged_frames, scrolling):
10590 (increment_row_positions): Remove.
10591 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
10592 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
10593 Now static.
10594 (redraw_garbaged_frames): Remove; unused.
10595
435f4c28
PE
10596 * xfaces.c: Make symbols static if they're not exported.
10597 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
10598 Remove decls.
10599 * xterm.h (defined_color): Remove decls.
10600 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
10601 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
10602 (menu_face_changed_default, defined_color, free_realized_face):
10603 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
10604 (ascii_face_of_lisp_face): Remove; unused.
10605
8524aef3
PE
10606 * xdisp.c: Make symbols static if they're not exported.
10607 * dispextern.h (scratch_glyph_row, window_box_edges):
10608 (glyph_to_pixel_coords, set_cursor_from_row):
10609 (get_next_display_element, set_iterator_to_next):
10610 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
10611 (show_mouse_face): Remove decls
10612 * frame.h (message_buf_print): Likewise.
10613 * lisp.h (pop_message, set_message, check_point_in_composition):
10614 Likewise.
10615 * xterm.h (set_vertical_scroll_bar): Likewise.
10616 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
10617 (message_buf_print, scratch_glyph_row, displayed_buffer):
10618 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
10619 (get_next_display_element, show_mouse_face, window_box_edges):
10620 (frame_to_window_pixel_xy, check_point_in_composition):
10621 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
10622 (glyph_to_pixel_coords): Remove; unused.
10623
16390cd2
PE
10624 * dired.c (file_name_completion): Now static.
10625
10626 * dbusbind.c (xd_in_read_queued_messages): Now static.
10627
a25f4dfa
PE
10628 * lisp.h (circular_list_error, FOREACH): Remove; unused.
10629 * data.c (circular_list_error): Remove.
10630
14a9c8df
PE
10631 * commands.h (last_point_position, last_point_position_buffer):
10632 (last_point_position_window): Remove decls.
10633 * keyboard.c: Make these variables static.
10634
04f2d78b
CB
10635 * coding.h (coding, code_convert_region, encode_coding_gap):
10636 Remove decls.
74ab6df5
PE
10637 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
10638 (iso_code_class, detect_coding, code_convert_region): Now static.
10639 (encode_coding_gap): Remove; unused.
10640
38dfbee1
PE
10641 * chartab.c (chartab_chars, chartab_bits): Now static.
10642
a2cb4e63
PE
10643 * charset.h (charset_iso_8859_1): Remove decl.
10644 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
10645 Now static.
10646
127198fd
PE
10647 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
10648 * ccl.c (Vccl_program_table): Now static.
10649 (check_ccl_update): Remove; unused.
10650
d85b608f
PE
10651 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
10652 * category.h: ... from here.
10653 * category.c (check_category_table, set_category_set): Now static.
10654
31cd66f3
PE
10655 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
10656 * lisp.h: Remove these decls.
10657
c358e587
PE
10658 * buffer.c (buffer_count): Remove unused var.
10659
e78aecca
PE
10660 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
10661 so that it's not optimized away.
10662 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
10663 * dispextern.h (bidi_dump_cached_states): Remove, since it's
10664 exported only to the debugger.
10665
e192d7d3 10666 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 10667 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 10668
92470028
PE
10669 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
10670 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
10671 was inaccessible from Lisp.
10672 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
10673 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
10674
244ed907
PE
10675 alloc.c: Import and export fewer symbols, and remove unused items.
10676 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
10677 is defined.
10678 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
10679 it's not optimized away by whole-program optimization.
10680 (message_enable_multibyte, free_misc): Remove.
10681 (catchlist, handlerlist, mark_backtrace):
10682 Declare only if BYTE_MARK_STACK.
10683 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
10684 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
10685 (message_enable_multibyte): Remove decl.
10686 (free_misc, interval_free_list, float_block, float_block_index):
10687 (n_float_blocks, float_free_list, cons_block, cons_block_index):
10688 (cons_free_list, last_marked_index):
10689 Now static.
10690 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
10691 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
10692 (mark_backtrace): Define only if BYTE_MARK_STACK.
10693 * xdisp.c (message_enable_multibyte): Now static.
10694
61c2b50e 10695 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
10696 This makes it easier for human readers (and static analyzers)
10697 to see whether these variables are used from other modules.
10698 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
10699 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
10700 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
10701 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
10702 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
10703 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
10704 * xmenu.c, xselect.c:
10705 Declare Q* vars static if they are not used in other modules.
10706 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
10707 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
10708 Remove decls of unexported vars.
10709 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
10710
95c82688
PE
10711 * lisp.h (DEFINE_FUNC): Make sname 'static'.
10712
16a97296
PE
10713 Make Emacs functions such as Fatom 'static' by default.
10714 This makes it easier for human readers (and static analyzers)
10715 to see whether these functions can be called from other modules.
10716 DEFUN now defines a static function. To make the function external
10717 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
10718 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
10719 (Finit_image_library):
16a97296
PE
10720 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
10721 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
10722 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
10723 Remove decls, since these functions are now static.
10724 (Funintern, Fget_internal_run_time): New decls, since these functions
10725 were already external.
95c82688 10726
16a97296
PE
10727 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
10728 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
10729 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
10730 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
10731 * keyboard.c, keymap.c, lread.c:
10732 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
10733 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
10734 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
10735 Mark functions with DEFUE instead of DEFUN,
10736 if they are used in other modules.
10737 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
10738 decls for now-static functions.
10739 * buffer.h (Fdelete_overlay): Remove decl.
10740 * callproc.c (Fgetenv_internal): Mark as internal.
10741 * composite.c (Fremove_list_of_text_properties): Remove decl.
10742 (Fcomposition_get_gstring): New forward static decl.
10743 * composite.h (Fcomposite_get_gstring): Remove decl.
10744 * dired.c (Ffile_attributes): New forward static decl.
10745 * doc.c (Fdocumntation_property): New forward static decl.
10746 * eval.c (Ffetch_bytecode): New forward static decl.
10747 (Funintern): Remove extern decl; now in .h file where it belongs.
10748 * fileio.c (Fmake_symbolic_link): New forward static decl.
10749 * image.c (Finit_image_library): New forward static decl.
10750 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
10751 * intervals.h (Fprevious_property_change):
10752 (Fremove_list_of_text_properties): Remove decls.
10753 * keyboard.c (Fthis_command_keys): Remove decl.
10754 (Fcommand_execute): New forward static decl.
10755 * keymap.c (Flookup_key): New forward static decl.
10756 (Fcopy_keymap): Now static.
10757 * keymap.h (Flookup_key): Remove decl.
10758 * process.c (Fget_process): New forward static decl.
10759 (Fprocess_datagram_address): Mark as internal.
10760 * syntax.c (Fsyntax_table_p): New forward static decl.
10761 (skip_chars): Remove duplicate decl.
10762 * textprop.c (Fprevious_property_change): New forward static decl.
10763 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
10764 Now internal.
10765 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
10766 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
10767
785bbd42
PE
10768 * editfns.c (Fformat): Remove unreachable code.
10769
8b913b57
AS
107702011-04-14 Andreas Schwab <schwab@linux-m68k.org>
10771
10772 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
10773 change. (Bug#8496)
10774
a6744a35
EZ
107752011-04-13 Eli Zaretskii <eliz@gnu.org>
10776
10777 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
10778 when at ZV. (Bug#8487)
10779
e7974947
AS
107802011-04-12 Andreas Schwab <schwab@linux-m68k.org>
10781
baad03f0
AS
10782 * charset.c (Fclear_charset_maps): Use xfree instead of free.
10783 (Bug#8437)
10784 * keyboard.c (parse_tool_bar_item): Likewise.
10785 * sound.c (sound_cleanup, alsa_close): Likewise.
10786 * termcap.c (tgetent): Likewise.
10787 * xfns.c (x_default_font_parameter): Likewise.
10788 * xsettings.c (read_and_apply_settings): Likewise.
10789
e7974947
AS
10790 * alloc.c (overrun_check_malloc, overrun_check_realloc)
10791 (overrun_check_free): Protoize.
10792
28272684
PE
107932011-04-12 Paul Eggert <eggert@cs.ucla.edu>
10794
10795 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
10796 since callers should never pass a negative size.
10797 Change the signature to match that of plain 'read' and 'write'; see
10798 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
10799 * lisp.h: Update prototypes of emacs_write and emacs_read.
10800
11997c76
EZ
108012011-04-11 Eli Zaretskii <eliz@gnu.org>
10802
10803 * xdisp.c (redisplay_window): Don't try to determine the character
10804 position of the scroll margin if the window start point w->startp
e896f03c 10805 is outside the buffer's accessible region. (Bug#8468)
11997c76 10806
8a2cbd72
EZ
108072011-04-10 Eli Zaretskii <eliz@gnu.org>
10808
10809 Fix write-region and its subroutines for buffers > 2GB.
10810 * fileio.c (a_write, e_write): Modify declaration of arguments and
10811 local variables to support buffers larger than 2GB.
10812 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
10813
10814 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
10815 argument, local variables, and return value.
10816
10817 * lisp.h: Update prototypes of emacs_write and emacs_read.
10818
10819 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
10820
4073e537 108212011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 10822
1ebfdcb6
PE
10823 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
10824
b2ded58d
PE
10825 Fix more problems found by GCC 4.6.0's static checks.
10826
7d66342c
PE
10827 * xdisp.c (vmessage): Use a better test for character truncation.
10828
bbf47d44
PE
10829 * charset.c (load_charset_map): <, not <=, for optimization,
10830 and to avoid potential problems with integer overflow.
9248994d 10831 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 10832 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 10833 * editfns.c (Fformat): Likewise.
1e69125e 10834 * syntax.c (skip_chars): Likewise.
3befa583 10835
e3019616
PE
10836 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
10837 This also lets GCC 4.6.0 generate slightly better loop code.
10838
becfa255
PE
10839 * callint.c (Fcall_interactively): <, not <=, for optimization.
10840 (Fcall_interactively): Count the number of arguments produced,
10841 not the number of arguments given. This is simpler and lets GCC
10842 4.6.0 generate slightly better code.
10843
dae0cd48
PE
10844 * ftfont.c: Distingish more carefully between FcChar8 and char.
10845 The previous code passed unsigned char * to a functions like
10846 strlen and xstrcasecmp that expect char *, which does not
10847 conform to the C standard.
10848 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
10849 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
10850 char * when the C standard requires it.
10851
76032d70
PE
10852 * keyboard.c (read_char): Remove unused var.
10853
eb3f1cc8
PE
10854 * eval.c: Port to Windows vsnprintf (Bug#8435).
10855 Include <limits.h>.
10856 (SIZE_MAX): Define if the headers do not.
10857 (verror): Do not give up if vsnprintf returns a negative count.
10858 Instead, grow the buffer. This ports to Windows vsnprintf, which
10859 does not conform to C99. Problem reported by Eli Zaretskii.
10860 Also, simplify the allocation scheme, by avoiding the need for
10861 calling realloc, and removing the ALLOCATED variable.
10862
70476b54
PE
10863 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
10864
12020a9e
PE
10865 Remove invocations of doprnt, as Emacs now uses vsnprintf.
10866 But keep the doprint source code for now, as we might revamp it
10867 and use it again (Bug#8435).
ea6c7ae6
PE
10868 * lisp.h (doprnt): Remove.
10869 * Makefile.in (base_obj): Remove doprnt.o.
10870 * deps.mk (doprnt.o): Remove.
10871
5fdb398c
PE
10872 error: Print 32- and 64-bit integers portably (Bug#8435).
10873 Without this change, on typical 64-bit hosts error ("...%d...", N)
10874 was used to print both 32- and 64-bit integers N, which relied on
10875 undefined behavior.
61bdb816 10876 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
10877 * lisp.h (error, verror): Mark as printf-like functions.
10878 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
10879 Report overflow in size calculations when allocating printf buffer.
10880 Do not truncate output string at its first null byte.
10881 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
10882 Truncate the output at a character boundary, since vsnprintf does not
10883 do that.
10884 * charset.c (check_iso_charset_parameter): Convert internal
10885 character to string before calling 'error', since %c now has the
10886 printf meaning.
10887 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
10888 overflow when computing char to be passed to 'error'. Do not
10889 pass Lisp_Object to 'error'; pass the integer instead.
10890 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
10891 formatted with plain %d.
10892
b189fa66
PE
10893 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
10894
bff87ef0
PE
10895 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
10896
7e2cac20
PE
10897 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
10898
ce4d90b5
PE
10899 * xterm.c (x_catch_errors): Remove duplicate declaration.
10900
266c9547
PE
10901 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
10902
79c49ad2
PE
10903 * xdisp.c, lisp.h (message_nolog): Remove; unused.
10904
368f4090
JM
109052011-04-10 Jim Meyering <meyering@redhat.com>
10906
10907 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
10908 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
10909 return ssize_t not "int", and use size_t as the buffer length.
10910 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
10911 * gnutls.h: Update declarations.
10912 * process.c (read_process_output): Use ssize_t, to match.
10913 (send_process): Likewise.
10914
a32d4040
CY
109152011-04-09 Chong Yidong <cyd@stupidchicken.com>
10916
10917 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
10918
8546720e 109192011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 10920
04f2d78b
CB
10921 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
10922 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 10923
8546720e
GM
10924 * xterm.c (handle_one_xevent):
10925 * xmenu.c (create_and_show_popup_menu):
10926 * xselect.c (x_decline_selection_request)
10927 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 10928
0a2f5c1a 109292011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
10930
10931 Fix some uses of `int' instead of EMACS_INT.
10932 * search.c (string_match_1, fast_string_match)
10933 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
10934 (scan_buffer, find_next_newline_no_quit)
10935 (find_before_next_newline, search_command, Freplace_match)
10936 (Fmatch_data): Make some `int' variables be EMACS_INT.
10937
10938 * xdisp.c (display_count_lines): 3rd argument and return value now
10939 EMACS_INT. All callers changed.
10940 (pint2hrstr): Last argument is now EMACS_INT.
10941
10942 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
10943 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10944 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
10945 (decode_coding_utf_16, decode_coding_emacs_mule)
10946 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
10947 (decode_coding_ccl, decode_coding_charset)
10948 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
10949 (decode_coding_iso_2022, decode_coding_emacs_mule)
10950 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
10951 <char_offset, last_offset>: Declare EMACS_INT.
10952 (encode_coding_utf_8, encode_coding_utf_16)
10953 (encode_coding_emacs_mule, encode_invocation_designation)
10954 (encode_designation_at_bol, encode_coding_iso_2022)
10955 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
10956 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
10957 Declare EMACS_INT.
10958 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
10959 (encode_invocation_designation): Last argument P_NCHARS is now
10960 EMACS_INT.
10961 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
10962 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
10963
10964 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
10965 All users changed.
10966
10967 * ccl.c (Fccl_execute_on_string): Declare some variables
10968 EMACS_INT.
10969
8546720e 109702011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
10971
10972 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
10973
4e19a977
CS
109742011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
10975
10976 * process.c (Fformat_network_address): Doc fix.
10977
87302331
R
109782011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
10979
ee7683eb 10980 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 10981
cbb59342
CY
109822011-04-08 Chong Yidong <cyd@stupidchicken.com>
10983
10984 * keyboard.c (read_char): Call Lisp function help-form-show,
10985 instead of using internal_with_output_to_temp_buffer.
10986 (Qhelp_form_show): New var.
e0d38eeb 10987 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
10988
10989 * print.c (internal_with_output_to_temp_buffer): Function deleted.
10990
10991 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
10992
e67a13ab
CY
109932011-04-06 Chong Yidong <cyd@stupidchicken.com>
10994
04f2d78b
CB
10995 * process.c (Flist_processes): Remove to Lisp.
10996 (list_processes_1): Delete.
e67a13ab 10997
973f782d
EZ
109982011-04-06 Eli Zaretskii <eliz@gnu.org>
10999
7c106b1e
EZ
11000 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
11001
973f782d
EZ
11002 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
11003
41cf7d1a 110042011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 11005
ca23cc88
PE
11006 Fix more problems found by GCC 4.6.0's static checks.
11007
f390e2d5
PE
11008 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
11009
42eea0d0
PE
11010 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
11011
b69769da 11012 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 11013
f9541e84
PE
11014 * xdisp.c (vmessage): Mark as a printf-like function.
11015
13841b55
PE
11016 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
11017
c136c10f
PE
11018 * sound.c (sound_warning): Don't crash if arg contains a printf format.
11019
5e2d4a30
PE
11020 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
11021 printf-like functions.
11022 (tiff_load): Add casts to remove these marks before passing them
11023 to system-supplied API.
11024
583f48b9
PE
11025 * eval.c (Fsignal): Remove excess argument to 'fatal'.
11026
b25d760e
PE
11027 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
11028 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
11029 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
11030 directly, rather than having caller test rule sign. This avoids
11031 some unnecessary tests.
11032 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
11033 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
11034 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 11035
bc7b6697 11036 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 11037 (xfont_open): Avoid unnecessary tests.
bc7b6697 11038
27ccc379
PE
11039 * composite.c (composition_gstring_put_cache): Use unsigned integer.
11040
dcd5c89a
PE
11041 * composite.h, composite.c (composition_gstring_put_cache):
11042 Use EMACS_INT, not int, for length.
11043
b13a45c6
PE
11044 * composite.h (COMPOSITION_DECODE_REFS): New macro,
11045 breaking out part of COMPOSITION_DECODE_RULE.
11046 (COMPOSITION_DECODE_RULE): Use it.
11047 * composite.c (get_composition_id): Remove unused local vars,
11048 by using the new macro.
11049
1e792e4d
PE
11050 * textprop.c (set_text_properties_1): Change while to do-while,
11051 since the condition is always true at first.
11052
dc6c6455 11053 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
11054 (interval_deletion_adjustment): Return unsigned value.
11055 All uses changed.
dc6c6455 11056
aba7731a
PE
11057 * process.c (list_processes_1, create_pty, read_process_output):
11058 (exec_sentinel): Remove vars that were set but not used.
afd4052b 11059 (create_pty): Remove unnecessary "volatile"s.
bc57d757 11060 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 11061 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 11062 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 11063
fdfc4bf3
PE
11064 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
11065
fca8fe46 11066 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 11067 (update_syntax_table): Use unsigned instead of int.
fca8fe46 11068
06a0259a 11069 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 11070 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 11071 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 11072
e7b9e80f
PE
11073 * print.c (print_error_message): Avoid int overflow.
11074
56201685
PE
11075 * font.c (font_list_entities): Redo for clarity,
11076 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
11077
78834453 11078 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 11079 (font_score): Avoid potential overflow in diff calculation.
78834453 11080
0bc0b309 11081 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 11082 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 11083
e610eaca
PE
11084 * eval.c (funcall_lambda): Rename local to avoid shadowing.
11085
b895abce
PE
11086 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
11087 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
11088 can always succeed if overflow has undefined behavior.
11089
1f1d9321 11090 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 11091 (wordify): Omit three unnecessary tests.
1f1d9321 11092
c59478bc
PE
11093 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
11094 All callers changed. This avoids the need for an unused var.
11095
79b73827
PE
11096 * casefiddle.c (casify_region): Remove var that is set but not used.
11097
a4db5dfe
PE
11098 * dired.c (file_name_completion): Remove var that is set but not used.
11099
43aae36e
PE
11100 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
11101
2a47c44d 11102 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 11103 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 11104
a37c69bf
PE
11105 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
11106 Check for integer overflow on size calculations.
11107
328ab8e7
PE
11108 * buffer.c (Fprevious_overlay_change): Remove var that is set
11109 but not used.
11110
e5a2a5cb
PE
11111 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
11112 Remove vars that are set but not used.
8d84a6eb 11113 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 11114 (timer_check_2): Mark vars as initialized.
e5a2a5cb 11115
a60e5f68
PE
11116 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
11117
f661cb61 11118 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 11119 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 11120
f0397f5a
PE
11121 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
11122 that are set but not used.
11123
8664db06 11124 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 11125 if XCreateBitmapFromData fails (Bug#8410).
8664db06 11126
6abdaa4a
PE
11127 * xselect.c (x_get_local_selection, x_handle_property_notify):
11128 Remove vars that are set but not used.
11129
0ce7538d 11130 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 11131 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 11132
9ae848fc
PE
11133 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
11134 Remove var that is set but not used.
0b918413
PE
11135 (scroll_bar_windows_size): Now size_t, not int.
11136 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
11137 Check for overflow.
9ae848fc 11138
a5a62657
PE
11139 * xfaces.c (realize_named_face): Remove vars that are set but not used.
11140 (map_tty_color) [!defined MSDOS]: Likewise.
11141
5c5cdd39
PE
11142 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
11143
66ebf983
PE
11144 * coding.c: Remove vars that are set but not used.
11145 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
11146 All callers changed.
11147 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
11148 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
11149 (decode_coding_charset): Remove vars that are set but not used.
11150
1be4d761
PE
11151 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
11152 that is set but not used.
11153
47553fa8
PE
11154 * print.c (print_object): Remove var that is set but not used.
11155
1f7196bf 11156 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
11157 The gnulib version avoids calling malloc in the usual case,
11158 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
11159 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
11160 * filelock.c (current_lock_owner): Likewise.
11161 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
11162 * sysdep.c: Include allocator.h, careadlinkat.h.
11163 (emacs_no_realloc_allocator): New static constant.
11164 (emacs_readlink): New function.
fdb61804
PE
11165 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
11166 ../lib/careadlinkat.h.
d1fdcab7 11167
f84c17c7
SM
111682011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
11169
11170 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
11171 first non-nil return value).
11172
ef3862ad
JD
111732011-04-03 Jan Djärv <jan.h.d@swipnet.se>
11174
11175 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
11176 if not defined (Bug#8403).
11177
376a7006
JB
111782011-04-02 Juanma Barranquero <lekktu@gmail.com>
11179
11180 * xdisp.c (display_count_lines): Remove parameter `start',
11181 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11182 (get_char_face_and_encoding): Remove parameter `multibyte_p',
11183 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11184 (fill_stretch_glyph_string): Remove parameters `row' and `area',
11185 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
11186 and thereabouts. All callers changed.
11187 (get_per_char_metric): Remove parameter `f', unused since
11188 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11189
6ca3801d
JM
111902011-04-02 Jim Meyering <meyering@redhat.com>
11191
11192 do not dereference NULL upon failed strdup
11193 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
11194 (ns_get_family): Likewise.
11195
d8e2b5ba
JB
111962011-04-02 Juanma Barranquero <lekktu@gmail.com>
11197
11198 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
11199
8c74fcbd
JD
112002011-04-02 Jan Djärv <jan.h.d@swipnet.se>
11201
11202 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
11203 later (Bug#8403).
11204
7200d79c
SM
112052011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
11206
03408648 11207 Add lexical binding.
7200d79c 11208
03408648
SM
11209 * window.c (Ftemp_output_buffer_show): New fun.
11210 (Fsave_window_excursion):
11211 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
11212
11213 * lread.c (lisp_file_lexically_bound_p): New function.
11214 (Fload): Bind Qlexical_binding.
11215 (readevalloop): Remove `evalfun' arg.
11216 Bind Qinternal_interpreter_environment.
11217 (Feval_buffer): Bind Qlexical_binding.
11218 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
11219 Mark as dynamic.
11220 (syms_of_lread): Declare `lexical-binding'.
11221
11222 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
11223
11224 * keyboard.c (eval_dyn): New fun.
11225 (menu_item_eval_property): Use it.
ca105506
SM
11226
11227 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 11228
03408648
SM
11229 * fns.c (concat, mapcar1): Accept byte-code-functions.
11230
11231 * eval.c (Fsetq): Handle lexical vars.
11232 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
11233 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
11234 (FletX, Flet): Obey lexical binding.
11235 (Fcommandp): Handle closures.
11236 (Feval): New `lexical' arg.
11237 (eval_sub): New function extracted from Feval. Use it almost
11238 everywhere where Feval was used. Look up vars in lexical env.
11239 Handle closures.
11240 (Ffunctionp): Move from subr.el.
11241 (Ffuncall): Handle closures.
11242 (apply_lambda): Remove `eval_flags'.
11243 (funcall_lambda): Handle closures and new byte-code-functions.
11244 (Fspecial_variable_p): New function.
11245 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
11246 but without exporting it to Lisp.
23aba0ea 11247
23aba0ea 11248 * doc.c (Fdocumentation, store_function_docstring):
03408648 11249 * data.c (Finteractive_form): Handle closures.
23aba0ea 11250
03408648
SM
11251 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
11252 interactive spec.
ba83908c 11253
04f2d78b
CB
11254 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
11255 New byte-codes.
03408648
SM
11256 (exec_byte_code): New function extracted from Fbyte_code to handle new
11257 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 11258
03408648 11259 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 11260
03408648 11261 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 11262
e2abce01
JB
112632011-03-31 Juanma Barranquero <lekktu@gmail.com>
11264
11265 * xdisp.c (redisplay_internal): Fix prototype.
11266
63696a73 112672011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 11268
63696a73 11269 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
11270 (try_scrolling): Use it when setting scroll_limit.
11271 Limit scrolling to 100 screen lines.
63696a73
EZ
11272 (redisplay_window): Even when falling back on "recentering",
11273 position point in the window according to scroll-conservatively,
11274 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
11275
11276 (try_scrolling): When point is above the window, allow searching
11277 as far as scroll_max, or one screenful, to compute vertical
11278 distance from PT to the scroll margin position. This prevents
11279 try_scrolling from unnecessarily failing when
11280 scroll-conservatively is set to a value slightly larger than the
11281 window height. Clean up the case of PT below the margin at bottom
11282 of window: scroll_max can no longer be INT_MAX. When aggressive
11283 scrolling is in use, don't let point enter the opposite scroll
11284 margin as result of the scroll.
11285 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
11286 threshold of 100 lines for never-recentering scrolling.
11287
e4cc2dfc
JB
112882011-03-31 Juanma Barranquero <lekktu@gmail.com>
11289
11290 * dispextern.h (move_it_by_lines):
11291 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
11292 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
11293 (message_log_check_duplicate): Remove parameters `prev_bol' and
11294 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11295 (redisplay_internal): Remove parameter `preserve_echo_area',
11296 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
11297
11298 * indent.c (Fvertical_motion):
11299 * window.c (window_scroll_pixel_based, Frecenter):
11300 Don't pass `need_y_p' to `move_it_by_lines'.
11301
1c470562
SM
113022011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
11303
44f230aa
SM
11304 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
11305 steal a few bits to be more compact.
11306 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
11307 Remove unneeded casts.
11308
1c470562
SM
11309 * bytecode.c (Fbyte_code): CAR and CDR can GC.
11310
888adce9
ZK
113112011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
11312
11313 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
11314 binding" message (bug#7967).
11315
f838ed7b
PE
113162011-03-30 Paul Eggert <eggert@cs.ucla.edu>
11317
77861b95
PE
11318 Fix more problems found by GCC 4.6.0's static checks.
11319
de6dbc14
PE
11320 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
11321 Remove unused local var.
11322
f838ed7b
PE
11323 * editfns.c (Fmessage_box): Remove unused local var.
11324
792c7b2b
PE
11325 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11326 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11327 Omit unused local vars.
c499e557 11328 * window.c (shrink_windows): Omit unused local var.
b01a1c29 11329 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
11330 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
11331 Omit unused local var.
11332
ba0165e1
PE
11333 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
11334 Don't assume string length fits in int.
32ad8845 11335 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 11336 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 11337
3c59b4c9
PE
11338 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
11339 instead of alloca (Bug#8344).
11340
a3eed478 11341 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 11342 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 11343
eb4d412d
PE
11344 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
11345
1658b401
PE
11346 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
11347 concerns.
11348
11349 * term.c (produce_glyphless_glyph): Remove unnecessary test.
11350
11351 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 11352
9a2c6e05
PE
11353 * keyboard.c (syms_of_keyboard): Use the same style as later
11354 in this function when indexing through an array. This also
11355 works around GCC bug 48267.
11356
03d0a109
PE
11357 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
11358
44f730c8
PE
11359 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
11360
fe75f926
PE
11361 * chartab.c (sub_char_table_ref_and_range): Redo for slight
11362 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
11363
ffa8c828
PE
11364 * keyboard.c, keyboard.h (num_input_events): Now size_t.
11365 This avoids undefined behavior on integer overflow, and is a bit
11366 more convenient anyway since it is compared to a size_t variable.
11367
c5101a77
PE
11368 Variadic C functions now count arguments with size_t, not int.
11369 This avoids an unnecessary limitation on 64-bit machines, which
11370 caused (substring ...) to crash on large vectors (Bug#8344).
11371 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
11372 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 11373 All variadic functions and their callers changed accordingly.
c5101a77
PE
11374 (struct gcpro.nvars): Now size_t, not int. All uses changed.
11375 * data.c (arith_driver, float_arith_driver): Likewise.
11376 * editfns.c (general_insert_function): Likewise.
11377 * eval.c (struct backtrace.nargs, interactive_p)
11378 (internal_condition_case_n, run_hook_with_args, apply_lambda)
11379 (funcall_lambda, mark_backtrace): Likewise.
11380 * fns.c (concat): Likewise.
11381 * frame.c (x_set_frame_parameters): Likewise.
11382 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
11383 0 if not found, not -1. All callers changed.
11384
dd3f25f7
PE
11385 * alloc.c (garbage_collect): Don't assume stack size fits in int.
11386 (stack_copy_size): Now size_t, not int.
11387 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
11388
461c2ab9
JB
113892011-03-28 Juanma Barranquero <lekktu@gmail.com>
11390
11391 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
11392 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11393 All callers changed.
11394
11395 * lisp.h (multibyte_char_to_unibyte):
11396 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
11397 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11398 * character.h (CHAR_TO_BYTE8):
11399 * cmds.c (internal_self_insert):
11400 * editfns.c (general_insert_function):
11401 * keymap.c (push_key_description):
11402 * search.c (Freplace_match):
11403 * xdisp.c (message_dolog, set_message_1): All callers changed.
11404
f6d62986
SM
114052011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11406
11407 * keyboard.c (safe_run_hook_funcall): New function.
11408 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
11409 don't set the hook to nil, but remove the offending function instead.
11410 (Qcommand_hook_internal): Remove, unused.
11411 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
11412 Vcommand_hook_internal.
11413
11414 * eval.c (enum run_hooks_condition): Remove.
11415 (funcall_nil, funcall_not): New functions.
11416 (run_hook_with_args): Call each function through a `funcall' argument.
11417 Remove `cond' argument, now redundant.
11418 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
11419 (Frun_hook_with_args_until_failure): Adjust accordingly.
11420 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
11421
1db5b1ad
JB
114222011-03-28 Juanma Barranquero <lekktu@gmail.com>
11423
11424 * dispextern.h (string_buffer_position): Remove declaration.
11425
11426 * print.c (strout): Remove parameter `multibyte', unused since
11427 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
11428
11429 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
11430 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
11431 All callers changed.
11432
11433 * w32.c (_wsa_errlist): Use braces for struct initializers.
11434
11435 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
11436 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
11437 All callers changed.
11438 (string_buffer_position): Likewise. Also, make static (it's never
11439 used outside xdisp.c).
11440 (cursor_row_p): Remove parameter `w', unused since
11441 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
11442 (decode_mode_spec): Remove parameter `precision', introduced during
11443 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
11444 All callers changed.
11445
5ffb62aa
JD
114462011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11447
11448 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
11449
461c2ab9 114502011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
11451
11452 * nsterm.m (ns_menu_bar_is_hidden): New variable.
11453 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
11454 (ns_update_auto_hide_menu_bar): New functions.
11455 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
11456 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
11457 ns_constrain_all_frames.
11458 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
11459 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
11460
5c380ffb
JD
114612011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11462
11463 * nsmenu.m (runDialogAt): Remove argument to timer_check.
11464
9af30bdf
GM
114652011-03-27 Glenn Morris <rgm@gnu.org>
11466
11467 * syssignal.h: Replace RETSIGTYPE with void.
11468 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
11469 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
11470 Replace SIGTYPE with void everywhere.
11471 * s/usg5-4-common.h (SIGTYPE): Remove definition.
11472 * s/template.h (SIGTYPE): Remove commented out definition.
11473
e2abce01
JB
114742011-03-26 Eli Zaretskii <eliz@gnu.org>
11475
11476 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
11477 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
11478
f868cd8a
JB
114792011-03-26 Juanma Barranquero <lekktu@gmail.com>
11480
59eb0929
JB
11481 * w32.c (read_unc_volume): Use parameter `henum', instead of
11482 global variable `wget_enum_handle'.
11483
11484 * keymap.c (describe_vector): Remove parameters `indices' and
11485 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
11486 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
11487
f868cd8a
JB
11488 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
11489
11490 * keyboard.c (timer_check): Remove parameter `do_it_now',
11491 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
11492 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
11493 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
11494
11495 * keyboard.c (read_char):
11496 * w32menu.c (w32_menu_display_help):
11497 * xmenu.c (show_help_event, menu_help_callback):
11498 Adjust calls to `show_help_echo'.
11499
11500 * gtkutil.c (xg_maybe_add_timer):
11501 * keyboard.c (readable_events):
11502 * process.c (wait_reading_process_output):
11503 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
11504
11505 * insdel.c (adjust_markers_gap_motion):
11506 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
11507 (gap_left, gap_right): Don't call it.
11508
2ecf6fdb
CY
115092011-03-25 Chong Yidong <cyd@stupidchicken.com>
11510
11511 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
11512 incurred during fontification.
11513
6b1f9ba4
JB
115142011-03-25 Juanma Barranquero <lekktu@gmail.com>
11515
11516 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
11517 (DEFVAR_PER_BUFFER): Don't pass it.
11518
11519 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
11520 (scrolling_window): Don't pass it.
11521
0f4a96b5
JB
115222011-03-25 Juanma Barranquero <lekktu@gmail.com>
11523
11524 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
11525
11526 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
11527 and `suffix'.
11528 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
11529 of variables specific to SELinux and computation of `encoded_absname'.
11530
11531 * image.c (XPutPixel): Remove unused variable `height'.
11532
11533 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
11534
11535 * unexw32.c (get_section_info): Remove unused variable `section'.
11536
11537 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
11538 (system_process_attributes): Remove unused variable `sess'.
11539 (sys_read): Remove unused variable `err'.
11540
11541 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
11542 (w32_wnd_proc): Remove unused variable `isdead'.
11543 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
11544 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
11545 (x_create_tip_frame): Remove unused variable `tem'.
11546
11547 * w32inevt.c (w32_console_read_socket):
11548 Remove unused variable `no_events'.
11549
11550 * w32term.c (x_draw_composite_glyph_string_foreground):
11551 Remove unused variable `width'.
11552
1149507c
JB
115532011-03-24 Juanma Barranquero <lekktu@gmail.com>
11554
11555 * w32term.c (x_set_glyph_string_clipping):
11556 Don't pass uninitialized region to CombineRgn.
11557
9c88f339
JB
115582011-03-23 Juanma Barranquero <lekktu@gmail.com>
11559
11560 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
11561 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
11562 (Fx_close_connection): Remove unused variable `i'.
11563
11564 * w32font.c (w32font_draw): Return number of glyphs.
11565 (w32font_open_internal): Remove unused variable `i'.
11566 (w32font_driver): Add missing initializer.
11567
11568 * w32menu.c (utf8to16): Remove unused variable `utf16'.
11569 (fill_in_menu): Remove unused variable `items_added'.
11570
11571 * w32term.c (last_mouse_press_frame): Remove static global variable.
11572 (w32_clip_to_row): Remove unused variable `f'.
11573 (x_delete_terminal): Remove unused variable `i'.
11574
11575 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
11576 (NOTHING): Remove unused static global variable.
11577 (uniscribe_check_otf): Remove unused variable `table'.
11578 (uniscribe_font_driver): Add missing initializers.
11579
dee091a3
JD
115802011-03-23 Julien Danjou <julien@danjou.info>
11581
11582 * term.c (Fsuspend_tty, Fresume_tty):
11583 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
11584 * window.c (temp_output_buffer_show):
11585 * insdel.c (signal_before_change):
11586 * frame.c (Fhandle_switch_frame):
11587 * fileio.c (Fdo_auto_save):
11588 * emacs.c (Fkill_emacs):
11589 * editfns.c (save_excursion_restore):
11590 * cmds.c (internal_self_insert):
11591 * callint.c (Fcall_interactively):
11592 * buffer.c (Fkill_all_local_variables):
11593 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
11594 Use Frun_hooks.
0f4a96b5 11595 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 11596 unconditionally since it does the check itself.
dee091a3 11597
2c520ab5 115982011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 11599
c9c49752
PE
11600 Fix more problems found by GCC 4.5.2's static checks.
11601
8abc3f12
PE
11602 * coding.c (encode_coding_raw_text): Avoid unnecessary test
11603 the first time through the loop, since we know p0 < p1 then.
11604 This also avoids a gcc -Wstrict-overflow warning.
11605
a2d26660
PE
11606 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
11607 leading to a memory leak, possible in functions like
11608 load_charset_map_from_file that can allocate an unbounded number
b12ef411 11609 of objects (Bug#8318).
a2d26660 11610
916c72e9
PE
11611 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
11612 that could (at least in theory) be that large.
11613
19ab8a18
PE
11614 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
11615 This is less likely to overflow, and avoids undefined behavior if
11616 overflow does occur. All callers changed. Use strtoul to scan
11617 for the unsigned long integer.
b7cbbd6f
PE
11618 (pint2hrstr): Simplify and tune code slightly.
11619 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 11620
f0641eff
PE
11621 * scroll.c (do_scrolling): Work around GCC bug 48228.
11622 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
11623
7f650bb9
PE
11624 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
11625 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
11626 (validate_x_resource_name): Simplify count usage.
11627 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 11628
37dd57d1
PE
11629 * fileio.c (Fcopy_file): Report error if fchown or fchmod
11630 fail (Bug#8306).
81e56e61 11631
699979fc 11632 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 11633
401bf9b4
PE
11634 * process.c (Fmake_network_process): Use socklen_t, not int,
11635 where POSIX says socklen_t is required in portable programs.
11636 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 11637 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
11638 (Fmake_network_process, server_accept_connection):
11639 (wait_reading_process_output, read_process_output):
11640 Likewise.
11641
b93aacde
PE
11642 * process.c: Rename or move locals to avoid shadowing.
11643 (list_processes_1, Fmake_network_process):
11644 (read_process_output_error_handler, exec_sentinel_error_handler):
11645 Rename or move locals.
4dc343ee 11646 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 11647 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 11648 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 11649 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 11650 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 11651
af8a867c 11652 Make tparam.h and terminfo.c consistent.
44f230aa
SM
11653 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
11654 Include tparam.h instead, since it declares them.
af8a867c
PE
11655 * cm.h (PC): Remove extern decl; tparam.h now does this.
11656 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
11657 * terminfo.c: Include tparam.h, to check interfaces.
11658 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
11659 (tparam): Adjust signature to match interface in tparam.h;
11660 this removes some undefined behavior. Check that outstring and len
11661 are zero, which they always are with Emacs.
11662 * tparam.h (PC, BC, UP): New extern decls.
11663
0248044d 11664 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 11665 (xftfont_open): Rename locals to avoid shadowing.
0248044d 11666
8ff096c1 11667 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
11668 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
11669 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 11670 (ftfont_list): Remove unused local.
49eaafba
PE
11671 (get_adstyle_property, ftfont_pattern_entity):
11672 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
11673 Rename locals to avoid shadowing.
8ff096c1 11674
e2be39f6
PE
11675 * xfont.c (xfont_list_family): Mark var as initialized.
11676
c9735e30
PE
11677 * xml.c (make_dom): Now static.
11678
8f5201ae
PE
11679 * composite.c (composition_compute_stop_pos): Rename local to
11680 avoid shadowing.
b246f932
PE
11681 (composition_reseat_it): Remove unused locals.
11682 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 11683 (composition_update_it): Mark var as initialized.
11b61122
PE
11684 (find_automatic_composition): Mark vars as initialized,
11685 with a FIXME (Bug#8290).
8f5201ae 11686
760fbc2c
PE
11687 character.h: Rename locals to avoid shadowing.
11688 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
11689 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
11690 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
11691 (BUF_DEC_POS): Be more systematic about renaming local temporaries
11692 to avoid shadowing.
11693
ff08eb85
PE
11694 * textprop.c (property_change_between_p): Remove; unused.
11695
fc7bf025
PE
11696 * intervals.c (interval_start_pos): Now static.
11697
235d7abc
PE
11698 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
11699
44f230aa
SM
11700 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
11701 Rename locals to avoid shadowing.
3e7d6594 11702
50060332
PE
11703 * sound.c (wav_play, au_play, Fplay_sound_internal):
11704 Fix pointer signedness.
d01f234b 11705 (alsa_choose_format): Remove unused local var.
c83b8872
PE
11706 (wav_play): Initialize a variable to 0, to prevent undefined
11707 behavior (Bug#8278).
50060332 11708
c4fc4e30
PE
11709 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
11710
918436ed
PE
11711 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
11712
c939f91b
PE
11713 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
11714 clobbering (Bug#8298).
b9c7f648
PE
11715 * sysdep.c (sys_subshell): Likewise.
11716 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 11717
6bd8c144
PE
11718 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
11719 This should get cleaned up, so that child_setup has the
11720 same signature on all platforms.
11721
7710357c 11722 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 11723 (relocate_fd): Rename locals to avoid shadowing.
7710357c 11724
c59da222
CY
117252011-03-22 Chong Yidong <cyd@stupidchicken.com>
11726
11727 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
11728 not to be necessary, and produces flickering.
11729
66b87493
GM
117302011-03-20 Glenn Morris <rgm@gnu.org>
11731
11732 * config.in: Remove file.
11733
45b6f6d5
JB
117342011-03-20 Juanma Barranquero <lekktu@gmail.com>
11735
11736 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
11737 are now in src/globals.h.
11738 (syms_of_minibuf): Remove spurious & from previous change.
11739
cd394be1 117402011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
11741
11742 * minibuf.c (completing-read-function): New variable.
11743 (completing-read-default): Rename from completing-read.
11744 (completing-read): Call completing-read-function.
11745
b14e3e21
CY
117462011-03-19 Juanma Barranquero <lekktu@gmail.com>
11747
11748 * xfaces.c (Fx_load_color_file):
11749 Read color file from absolute filename (bug#8250).
11750
f2b726e6
JB
117512011-03-19 Juanma Barranquero <lekktu@gmail.com>
11752
11753 * makefile.w32-in: Update dependencies.
11754
09f6ff02
EZ
117552011-03-17 Eli Zaretskii <eliz@gnu.org>
11756
11757 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
11758
29a6015a
PE
117592011-03-17 Paul Eggert <eggert@cs.ucla.edu>
11760
a3a6c54e
PE
11761 Fix more problems found by GCC 4.5.2's static checks.
11762
b766f867
PE
11763 * process.c (make_serial_process_unwind, send_process_trap):
11764 (sigchld_handler): Now static.
11765
be02381c
PE
11766 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
11767 That way, the code declares only the vars that it needs.
11768 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
11769 * s/cygwin.h (PTY_ITERATION): Likewise.
11770 * s/darwin.h (PTY_ITERATION): Likewise.
11771 * s/gnu-linux.h (PTY_ITERATION): Likewise.
11772
57048744
PE
11773 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
11774 * process.c (allocate_pty): Don't declare stb unless it's needed.
11775
7914961c 11776 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
11777 (CONSTANTLIM): Remove; unused.
11778 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
11779 Define only if needed.
7914961c 11780
b3967b18
PE
11781 * unexelf.c (unexec): Name an expression,
11782 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
11783 Use a different way to cause a compilation error if anyone uses
11784 n rather than nn, a way that does not involve shadowing.
73366a00 11785 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 11786
29a6015a
PE
11787 * deps.mk (unexalpha.o): Remove; unused.
11788
43cfc33e 11789 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 11790 * unexec.h: New file.
ce701a33
PE
11791 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
11792 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
11793 Depend on unexec.h.
11794 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
11795 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
11796 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 11797 Change as necessary to match prototype in unexec.h.
ce701a33 11798
01f44d5a
PE
11799 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
11800 shadowing.
4f63c6bb 11801 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 11802
a6670b0b
PE
11803 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
11804 Rename locals to avoid shadowing.
11805
cef2010d 11806 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 11807 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 11808
d4d7173a
PE
11809 * print.c (Fredirect_debugging_output): Fix pointer signedess.
11810
f08b802a
PE
11811 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
11812 warning when compiling print.c.
11813
3ddb0639
PE
11814 * font.c (font_unparse_fcname): Abort in an "impossible" situation
11815 instead of using an uninitialized var.
5ad03b97 11816 (font_sort_entities): Mark var as initialized.
3ddb0639 11817
170a2692
PE
11818 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
11819
e663c700
PE
11820 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
11821 pointers to constants.
89bc529a 11822 (font_parse_fcname): Remove unused vars.
7b81e2d0 11823 (font_delete_unmatched): Now static.
ea838e10 11824 (font_get_spec): Remove; unused.
13a547c6
PE
11825 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
11826 (font_update_drivers, Ffont_get_glyphs, font_add_log):
11827 Rename or move locals to avoid shadowing.
e663c700 11828
2a80c887 11829 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 11830 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 11831
1384fa33 11832 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 11833 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 11834
8b2c52e9
PE
11835 * alloc.c (mark_backtrace): Move decl from here ...
11836 * lisp.h: ... to here, so that it can be checked.
11837
475545b5 11838 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 11839 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
11840 (lisp_indirect_variable): Name an expression,
11841 to avoid gcc -Wbad-function-cast warning.
1faed8ae 11842 (Fdefvar): Rename locals to avoid shadowing.
475545b5 11843
b1349114 11844 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 11845 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 11846 Use const pointer when appropriate.
b1349114 11847
a2928364
PE
11848 * lisp.h (get_system_name, get_operating_system_release):
11849 Move decls here, to check interfaces.
11850 * process.c (get_operating_system_release): Move decl to lisp.h.
11851 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
11852 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
11853 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
11854 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
11855 (Fformat_time_string, Fencode_time, Finsert_char):
11856 (Ftranslate_region_internal, Fformat):
11857 Rename or remove local vars to avoid shadowing.
9710023e 11858 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 11859
a415e694
PE
11860 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
11861 avoid shadowing.
11862
8ef4622d
PE
11863 * lisp.h (eassert): Check that the argument compiles, even if
11864 ENABLE_CHECKING is not defined.
11865
946f9a5b
PE
11866 * data.c (Findirect_variable): Name an expression, to avoid
11867 gcc -Wbad-function-cast warning.
112396d6 11868 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 11869 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
11870 (Fmake_variable_buffer_local, Fmake_local_variable):
11871 Mark variables as initialized.
52746918 11872 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 11873
e5aab7e7 11874 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
11875 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
11876 Rename locals to avoid shadowing.
dff45157
PE
11877 (mark_stack): Move local variables into the #ifdef region where
11878 they're used.
7bc26fdb
PE
11879 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
11880 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
11881 needed otherwise.
11882 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
11883 (GC_STRING_CHARS): Remove; not used.
d40d4be1 11884 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 11885
e5aab7e7
PE
11886 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
11887 avoids undefined behavior in theory.
11888
4da60324
PE
11889 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
11890
88043301
PE
11891 Use functions, not macros, for up- and down-casing (Bug#8254).
11892 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11893 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
11894 to use the following functions instead of these macros.
11895 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
11896 EMACS_INT, since callers assume the returned value fits in int.
11897 (upcase1): Likewise, for UPCASE_TABLE.
11898 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 11899 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 11900 the race-condition problem in the old DOWNCASE.
88043301 11901
19ed5445
PE
11902 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
11903 Rename locals to avoid shadowing.
11904 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
11905 (regex_compile, re_search_2, re_match_2_internal):
11906 Remove unused local vars.
952db0d7
PE
11907 (FREE_VAR): Rewrite so as not to use empty "else",
11908 which gcc can warn about.
da053e48 11909 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
11910 (RETALLOC_IF): Define only if needed.
11911 (WORDCHAR_P): Likewise. This one is never needed, but is used
11912 only in a comment talking about a compiler bug, so put inside
11913 the #if 0 of that comment.
11914 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
11915 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
11916 Remove; unused.
19ed5445 11917
1f3561e4 11918 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
11919 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
11920 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 11921
ded6f8f7
PE
11922 * search.c (simple_search): Remove unused var.
11923
dbd37a95
PE
11924 * dired.c (compile_pattern): Move decl from here ...
11925 * lisp.h: ... to here, so that it can be checked.
11926 (struct re_registers): New forward decl.
11927
7e47afad
PE
11928 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
11929
85f24f61
PE
11930 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
11931 All uses changed.
11932 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
11933 Rename locals to avoid shadowing.
5671df8f 11934 (Fvertical_motion): Mark locals as initialized.
85f24f61 11935
181aa2be 11936 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 11937 (casify_region): Mark local as initialized.
181aa2be 11938
930d429c
PE
11939 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
11940
7082eac6
PE
11941 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
11942 New macros, so that the caller can use some names other than
11943 gcpro1, gcpro2, etc.
11944 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
11945 of the new macros.
11946 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
11947 argument, for consistency with GCPRO2_VAR, etc: it is now the
11948 prefix of the variable, not the variable itself. All uses
11949 changed.
38b2c076
PE
11950 * dired.c (directory_files_internal, file_name_completion):
11951 Rename locals to avoid shadowing.
11952
15206ed9
PE
11953 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
11954 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
11955 dired.c's scmp function, had undefined behavior.
11956 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11957 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
11958 * buffer.h: ... to here, because these macros use current_buffer,
11959 and the new implementation with inline functions needs to have
11960 current_buffer in scope now, rather than later when the macros
11961 are used.
11962 (downcase, upcase1): New static inline functions.
11963 (DOWNCASE, UPCASE1): Reimplement using these functions.
11964 This avoids undefined behavior in expressions like
11965 DOWNCASE (x) == DOWNCASE (y), which previously suffered
11966 from race conditions in accessing the global variables
11967 case_temp1 and case_temp2.
11968 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
11969 * lisp.h (case_temp1, case_temp2): Remove their decls.
11970 * character.h (ASCII_CHAR_P): Move from here ...
11971 * lisp.h: ... to here, so that the inline functions mentioned
11972 above can use them.
11973
4a6bea26
PE
11974 * dired.c (directory_files_internal_unwind): Now static.
11975
f14b7e14
PE
11976 * fileio.c (file_name_as_directory, directory_file_name):
11977 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
11978 Now static.
2893f146
PE
11979 (file_name_as_directory): Use const pointers when appropriate.
11980 (Fexpand_file_name): Likewise. In particular, newdir might
11981 point at constant storage, so make it a const pointer.
fd4ead52 11982 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
11983 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
11984 signedness issues.
f839df0c
PE
11985 (Fset_file_times, Finsert_file_contents, auto_save_error):
11986 Rename locals to avoid shadowing.
f14b7e14 11987
5716756e 11988 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
11989 (Ftry_completion, Fall_completions): Rename or remove locals
11990 to avoid shadowing.
5716756e 11991
b4c3046a
PE
11992 * marker.c (bytepos_to_charpos): Remove; unused.
11993
b45db522
PE
11994 * lisp.h (verify_bytepos, count_markers): New decls,
11995 so that gcc does not warn that these functions aren't declared.
11996
85876d07
PE
11997 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
11998 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 11999 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 12000 (copy_text): Remove unused local var.
85876d07 12001
03d78a21 12002 * filelock.c (within_one_second): Now static.
b3dd38ab 12003 (lock_file_1): Rename local to avoid shadowing.
03d78a21 12004
5df8f01b
PE
12005 * buffer.c (fix_overlays_before): Mark locals as initialized.
12006 (fix_start_end_in_overlays): Likewise. This function should be
12007 simplified by using pointers-to-pointers, but that's a different
12008 matter.
b1d876f1 12009 (switch_to_buffer_1): Now static.
8f54f30a
PE
12010 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
12011 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 12012
a70072c9 12013 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 12014 Fix pointer signedness issue.
edced198
PE
12015 (sys_subshell): Mark local as volatile if checking for lint,
12016 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 12017 (MAXPATHLEN): Define only if needed.
a70072c9 12018
a0977c44
PE
12019 * process.c (serial_open, serial_configure): Move decls from here ...
12020 * systty.h: ... to here, so that they can be checked.
12021
a884fdcc
PE
12022 * fns.c (get_random, seed_random): Move extern decls from here ...
12023 * lisp.h: ... to here, so that they can be checked.
12024
604efe86 12025 * sysdep.c (reset_io): Now static.
b8950c94 12026 (wait_for_termination_signal): Remove; unused.
604efe86 12027
38fc62d9
PE
12028 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
12029 (copy_keymap_item, append_key, push_text_char_description):
12030 Now static.
1004a21a 12031 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 12032 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
12033 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
12034 (describe_map_tree):
12035 Rename locals to avoid shadowing.
38fc62d9 12036
2f2650da
PE
12037 * keyboard.c: Declare functions static if they are not used elsewhere.
12038 (echo_char, echo_dash, cmd_error, top_level_2):
12039 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
12040 (read_char, kbd_buffer_get_event, make_lispy_position):
12041 (make_lispy_event, make_lispy_movement, apply_modifiers):
12042 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
12043 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
12044 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 12045 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 12046 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 12047
a053e86c 12048 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
12049 (mark_kboards): Move decl here ...
12050 * alloc.c (mark_kboards): ... from here.
a053e86c 12051
4752793e
PE
12052 * lisp.h (force_auto_save_soon): New decl.
12053
74f10ca7 12054 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
12055 (DEFINE_DUMMY_FUNCTION): New macro.
12056 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
12057 Use it.
c03cd23f
PE
12058 (main): Add casts to avoid warnings
12059 if GCC considers string literals to be constants.
74f10ca7 12060
022e70d4
PE
12061 * lisp.h (fatal_error_signal): Add decl, since it's exported.
12062
59d6fe83
PE
12063 * dbusbind.c: Pointer signedness fixes.
12064 (xd_signature, xd_append_arg, xd_initialize):
12065 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12066 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12067 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
12068 (Fdbus_register_signal): Use SSDATA when the context wants char *.
12069
78320123
PE
12070 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
12071 if GCC considers string literals to be constants.
49cebcca 12072 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 12073
35ac2a97
SM
120742011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
12075
fb103ca9
SM
12076 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
12077 (print_preprocess, print_object): New macro to fix last change.
12078
35ac2a97
SM
12079 * print.c (print_preprocess): Don't forget font objects.
12080
62973b41
JB
120812011-03-16 Juanma Barranquero <lekktu@gmail.com>
12082
12083 * emacs.c (USAGE3): Doc fixes.
12084
0e48bb22
AS
120852011-03-15 Andreas Schwab <schwab@linux-m68k.org>
12086
12087 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
12088 structure.
12089
7684e57b
JB
120902011-03-14 Juanma Barranquero <lekktu@gmail.com>
12091
12092 * lisp.h (VWindow_system, Qfile_name_history):
12093 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
12094 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
12095 (w32_system_caret_x, w32_system_caret_y): Declare extern.
12096
12097 * w32select.c: Don't #include "keyboard.h".
c96bbc66 12098 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
12099
12100 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
12101 * w32console.c (detect_input_pending, read_input_pending)
12102 (encode_terminal_code):
12103 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
12104 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
12105 (w32_system_caret_y, Qfile_name_history):
12106 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
12107 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
12108 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
12109 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
12110 * w32proc.c (Qlocal, report_file_error):
12111 * w32term.c (Vwindow_system, updating_frame):
12112 * w32uniscribe.c (initialized, uniscribe_font_driver):
12113 Remove unneeded extern declarations.
12114
2aa46d6c
CY
121152011-03-14 Chong Yidong <cyd@stupidchicken.com>
12116
c96bbc66 12117 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 12118
cffc6f3b
CY
121192011-03-13 Chong Yidong <cyd@stupidchicken.com>
12120
12121 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
12122 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
12123 These macros can no longer be used for assignment.
12124
44f230aa
SM
12125 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12126 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
12127 (record_buffer_markers, fetch_buffer_markers): New functions for
12128 recording and fetching special buffer markers.
12129 (set_buffer_internal_1, set_buffer_temp): Use them.
12130
12131 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
12132
12133 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
12134
12135 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
12136 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
12137
12138 * xdisp.c (hscroll_window_tree):
12139 (reconsider_clip_changes): Use PT instead of BUF_PT.
12140
d251f04b
EZ
121412011-03-13 Eli Zaretskii <eliz@gnu.org>
12142
12143 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
12144 $(EMACS_ROOT)/lib/intprops.h.
12145
f0c77cd1
PE
121462011-03-13 Paul Eggert <eggert@cs.ucla.edu>
12147
3eca4629
PE
12148 Fix more problems found by GCC 4.5.2's static checks.
12149
7c86ee98
PE
12150 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
12151 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
12152 (xg_free_frame_widgets): Make it clear that a local variable is
12153 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
12154 (gdk_window_get_screen): Make it clear that this macro is needed
12155 only if USE_GTK_TOOLTIP.
1e5524e7
PE
12156 (int_gtk_range_get_value): New function, which avoids a diagnostic
12157 from gcc -Wbad-function-cast.
12158 (xg_set_toolkit_scroll_bar_thumb): Use it.
12159 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
12160 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
12161 (get_utf8_string, xg_get_file_with_chooser):
12162 Rename locals to avoid shadowing.
12163 (create_dialog): Move locals to avoid shadowing.
7c86ee98 12164
41729b81
PE
12165 * xgselect.c (xg_select): Remove unused var.
12166
f0c77cd1
PE
12167 * image.c (four_corners_best): Mark locals as initialized.
12168 (gif_load): Initialize transparent_p to zero (Bug#8238).
12169 Mark another local as initialized.
ec6cf4c6 12170 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 12171
ce0ad53d 12172 * image.c (clear_image_cache): Now static.
d5d5a617 12173 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 12174 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
12175 (x_edge_detection): Remove unnecessary cast that
12176 gcc -Wbad-function-cast diagnoses.
2037898d 12177 (gif_load): Fix pointer signedness.
6ae141d6
PE
12178 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
12179 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 12180
33383987 121812011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 12182
d32df629
PE
12183 Improve quality of tests for time stamp overflow.
12184 For example, without this patch (encode-time 0 0 0 1 1
12185 1152921504606846976) returns the obviously-bogus value (-948597
12186 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
12187 reports time overflow. See
12188 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
12189 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
12190 * editfns.c: Include limits.h and intprops.h.
12191 (TIME_T_MIN, TIME_T_MAX): New macros.
12192 (time_overflow): Move earlier, to before first use.
12193 (hi_time, lo_time): New functions, for an accurate test for
12194 out-of-range times.
12195 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
12196 (Fget_internal_run_time): Don't assume time_t fits in int.
12197 (make_time): Use list2 instead of Fcons twice.
12198 (Fdecode_time): More accurate test for out-of-range times.
12199 (check_tm_member): New function.
12200 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
12201 (lisp_time_argument): Don't rely on undefined left-shift and
12202 right-shift behavior when checking for time stamp overflow.
8be6f318 12203
fe31d94c
PE
12204 * editfns.c (time_overflow): New function, refactoring common code.
12205 (Fformat_time_string, Fdecode_time, Fencode_time):
12206 (Fcurrent_time_string): Use it.
12207
8be6f318
PE
12208 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
12209 * dired.c (make_time): Move to ...
12210 * editfns.c (make_time): ... here.
12211 * systime.h: Note the move.
12212
09d9db2c 122132011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 12214
126bc0dc
YM
12215 * fringe.c (update_window_fringes): Remove unused variables.
12216
c47cbdfd
YM
12217 * unexmacosx.c (copy_data_segment): Also copy __got section.
12218 (Bug#8223)
12219
7ac80be9
EZ
122202011-03-12 Eli Zaretskii <eliz@gnu.org>
12221
c96bbc66 12222 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
12223 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
12224 Constify `char *' arguments and their references according to
12225 prototypes in tparam.h.
12226
ecb0f94d 12227 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 12228
7ac80be9
EZ
12229 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
12230 Adapt all references accordingly.
12231
12232 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
12233
ef1fd07e
TT
122342011-03-11 Tom Tromey <tromey@redhat.com>
12235
12236 * buffer.c (syms_of_buffer): Remove obsolete comment.
12237
7ef4b50c
EZ
122382011-03-11 Eli Zaretskii <eliz@gnu.org>
12239
12240 * termhooks.h (encode_terminal_code): Declare prototype.
12241
12242 * msdos.c (encode_terminal_code): Don't declare prototype.
12243
12244 * term.c (encode_terminal_code): Now external again, used by
12245 w32console.c and msdos.c.
12246
44f230aa
SM
12247 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
12248 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 12249
4b1ec863 122502011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 12251
1714f52b 12252 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 12253
4b1ec863
PE
12254 * fringe.c (update_window_fringes): Mark locals as initialized
12255 (Bug#8227).
12256 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 12257
524c7aa6
PE
12258 * alloc.c (mark_fringe_data): Move decl from here ...
12259 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
12260 to check its interface.
12261 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
12262
a5c0af81 12263 * fontset.c (free_realized_fontset): Now static.
7519b8cd 12264 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 12265 (fontset_font): Mark local as initialized.
a9a06e0b 12266 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 12267
b4716021
PE
12268 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
12269
811e9bac 12270 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 12271 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
12272 (x_own_selection, Fx_disown_selection_internal): Rename locals
12273 to avoid shadowing.
12274 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 12275
7e3ab302
PE
12276 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
12277 so that the caller can use some name other than gcpro1.
12278 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
12279 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12280 (Fx_backspace_delete_keys_p):
12281 Use them to avoid shadowing, and rename vars to avoid shadowing.
12282 (x_decode_color, x_set_name, x_window): Now static.
6b437900 12283 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 12284 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
12285 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
12286 Remove unused locals.
7e3ab302
PE
12287 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12288 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
12289 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
12290 macros.
f78faa98 12291
e2b13473
PE
12292 * xterm.h (x_mouse_leave): New decl.
12293
77f23912
PE
12294 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
12295 Remove unused functions.
cdf4ba58
PE
12296 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
12297 (x_calc_absolute_position): Now static.
7411c686 12298 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 12299 Don't declare local "event" unless it's used.
ed7bf3a5
PE
12300 (x_iconify_frame, x_free_frame_resources): Don't declare locals
12301 unless they are used.
38d0b34a
PE
12302 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
12303 (x_fatal_error_signal): Remove; not used.
a6067996
PE
12304 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
12305 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
12306 (x_error_catcher, x_connection_closed, x_error_handler):
12307 (x_error_quitter, xembed_send_message, x_iconify_frame):
12308 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 12309 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 12310 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 12311
44f230aa
SM
12312 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
12313 Rename or move locals to avoid shadowing.
6b463e58 12314 (tty_defined_color, merge_face_heights): Now static.
5967d051 12315 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
12316 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
12317 does not deduce is never used uninitialized.
73719eba
PE
12318 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
12319 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 12320
426994c3 12321 * terminal.c (store_terminal_param): Now static.
5489860b 12322
032f1620 12323 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 12324 (set_frame_menubar): Remove unused local.
d4323972 12325 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
12326 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
12327 since they might point to immutable storage.
281585b0
PE
12328 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
12329 since it's unused otherwise.
032f1620 12330
367c19e5 12331 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 12332 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
12333 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
12334 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 12335 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
12336 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
12337 does not deduce are never used uninitialized.
70739cbe 12338
07b48fa9
PE
12339 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
12340
8868a238 12341 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
12342 * window.c (window_loop, size_window):
12343 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 12344
7e5cf297 12345 * window.c (display_buffer): Now static.
d6550a9f
PE
12346 (size_window): Mark variables that gcc -Wuninitialized
12347 does not deduce are never used uninitialized.
a586633d
PE
12348 * window.h (check_all_windows): New decl, to forestall
12349 gcc -Wmissing-prototypes diagnostic.
5b555da1 12350 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 12351
f6095868
PE
12352 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
12353 shadowing.
12354 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
12355 Include <limits.h>.
12356 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
12357 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
12358 (load_charset_map): Mark variables that gcc -Wuninitialized
12359 does not deduce are never used uninitialized.
53df7c11 12360 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 12361
f38b440c
PE
12362 * coding.c (coding_set_source, coding_set_destination):
12363 Use "else { /* comment */ }" rather than "else /* comment */;"
12364 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
12365 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
12366 a block, when the outer 'i' will do.
12367 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
12368 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
12369 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
12370 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
12371 (Fdecode_sjis_char, Fdefine_coding_system_internal):
12372 Rename locals to avoid shadowing.
12373 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
12374 * coding.c (emacs_mule_char, encode_invocation_designation):
12375 Now static, since they're not used elsewhere.
413bb2db 12376 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 12377 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
12378 (decode_coding_emacs_mule): Mark variables that gcc
12379 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
12380 (detect_coding_iso_2022): Initialize a local variable that might
12381 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 12382 this initialization is needed. (Bug#8211)
5f58e762
PE
12383 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
12384 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
12385 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
12386 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
12387 Remove unused macros.
f38b440c 12388
232b38b9 12389 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 12390 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 12391 * character.c (string_count_byte8): Likewise.
232b38b9 12392
fb90da1b
PE
12393 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
12394 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
12395
fb93dbc2
PE
12396 * chartab.c (copy_sub_char_table): Now static, since it's not used
12397 elsewhere.
5c156ace
PE
12398 (sub_char_table_ref_and_range, char_table_ref_and_range):
12399 Rename locals to avoid shadowing.
bbcd0949 12400 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 12401
7d3b3862 12402 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 12403 (BIDI_BOB): Remove unused macro.
7d3b3862 12404
6be7d3da
PE
12405 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
12406 deduce are never used uninitialized.
c2ed9c8b 12407 * term.c (encode_terminal_code): Likewise.
6be7d3da 12408
75f8807f 12409 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 12410
50938595
PE
12411 * tparam.h: New file.
12412 * term.c, tparam.h: Include it.
12413 * deps.mk (term.o, tparam.o): Depend on tparam.h.
12414 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
12415 Move these decls to tparam.h, and make them agree with what
12416 is actually in tparam.c. The previous trick of using incompatible
12417 decls in different modules does not conform to the C standard.
12418 All callers of tparam changed to use tparam's actual API.
12419 * tparam.c (tparam1, tparam, tgoto):
12420 Use const pointers where appropriate.
12421
fbceeba2
PE
12422 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
12423 * cm.h (struct cm): Likewise.
12424 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
12425 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
12426 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
12427 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
12428 (turn_on_face, init_tty): Likewise.
12429 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 12430
7f3f1250
PE
12431 * term.c (term_mouse_position): Rename local to avoid shadowing.
12432
e6ca6543
PE
12433 * alloc.c (mark_ttys): Move decl from here ...
12434 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
12435
c40f8d15
AS
124362011-03-11 Andreas Schwab <schwab@linux-m68k.org>
12437
12438 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
12439
cfe0661d
JB
124402011-03-09 Juanma Barranquero <lekktu@gmail.com>
12441
12442 * search.c (compile_pattern_1): Remove argument regp, unused since
12443 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
12444 (compile_pattern): Don't pass it.
12445
0afb4571
J
124462011-03-08 Jan Djärv <jan.h.d@swipnet.se>
12447
12448 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
12449 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
12450 for ! HAVE_GTK3.
12451 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
12452
12453 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
12454
12455 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
12456 gdk_window_get_screen, gdk_window_get_geometry,
12457 gdk_x11_window_lookup_for_display and GDK_KEY_g.
12458 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
12459 (xg_get_pixbuf_from_pixmap): New function.
12460 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
12461 to Pixmap, take frame as parameter, remove GdkColormap parameter.
12462 Call xg_get_pixbuf_from_pixmap instead of
12463 gdk_pixbuf_get_from_drawable.
12464 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
12465 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
12466 (xg_check_special_colors): Use GtkStyleContext and its functions
12467 for HAVE_GTK3.
12468 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
12469 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
12470 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
12471 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
12472 Call gtk_widget_get_preferred_size.
0afb4571
J
12473 (xg_frame_resized): gdk_window_get_geometry only takes 5
12474 parameters.
44f230aa
SM
12475 (xg_win_to_widget, xg_event_is_for_menubar):
12476 Call gdk_x11_window_lookup_for_display.
0afb4571
J
12477 (xg_set_widget_bg): New function.
12478 (delete_cb): New function.
895009e1 12479 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 12480 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
12481 (xg_set_background_color): Call xg_set_widget_bg.
12482 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
12483 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
12484 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
12485 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
12486 if ! HAVE_GTK3.
12487 (update_frame_tool_bar): Call gtk_widget_hide.
12488 (xg_initialize): Use GDK_KEY_g.
12489
12490 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
12491 if ! HAVE_GTK3
12492 (x_session_initialize): Call gdk_x11_set_sm_client_id.
12493
12494 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
12495 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
12496 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
12497
1c2cc4ef
JB
124982011-03-08 Juanma Barranquero <lekktu@gmail.com>
12499
12500 * w32xfns.c (select_palette): Check success of RealizePalette against
12501 GDI_ERROR, not zero.
12502
33383987 12503See ChangeLog.11 for earlier changes.
aac0c6e3
MR
12504
12505;; Local Variables:
12506;; coding: utf-8
aac0c6e3
MR
12507;; End:
12508
2f097256 12509 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
12510
12511 This file is part of GNU Emacs.
12512
12513 GNU Emacs is free software: you can redistribute it and/or modify
12514 it under the terms of the GNU General Public License as published by
12515 the Free Software Foundation, either version 3 of the License, or
12516 (at your option) any later version.
12517
12518 GNU Emacs is distributed in the hope that it will be useful,
12519 but WITHOUT ANY WARRANTY; without even the implied warranty of
12520 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12521 GNU General Public License for more details.
12522
12523 You should have received a copy of the GNU General Public License
12524 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.