]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* alloc.c (allocate_string): Omit intervals initialization.
[gnu-emacs] / src / ChangeLog
1 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * alloc.c (allocate_string): Omit intervals initialization.
4 * alloc.c (make_uninit_multibyte_string): Initialize intervals
5 as in make_pure_string and make_pure_c_string.
6
7 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
8
9 * alloc.c (allocate_string): Fix last change.
10
11 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12
13 * alloc.c (allocate_string): Remove two redundant calls
14 to memset, add explicit initialization where appropriate.
15
16 2012-06-27 Glenn Morris <rgm@gnu.org>
17
18 * lisp.mk (lisp): Remove paths.elc.
19
20 2012-06-27 Chong Yidong <cyd@gnu.org>
21
22 * doc.c (Fsubstitute_command_keys): Fix punctuation.
23
24 2012-06-26 John Wiegley <johnw@newartisans.com>
25
26 * unexmacosx.c (copy_data_segment): Added two section names used
27 on Mac OS X Lion: __mod_init_func and __mod_term_func.
28
29 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
30 when building with Clang.
31
32 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
33
34 * eval.c (Fapply): Allow calling it with a single argument.
35
36 2012-06-26 Eli Zaretskii <eliz@gnu.org>
37
38 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
39 _stricmp and _strnicmp.
40 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
41
42 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
43
44 * alloc.c (allocate_window): Zero out non-Lisp part of newly
45 allocated window.
46 (allocate_process): Likewise for new process.
47 (allocate_terminal): Change to use offsetof.
48 (allocate_frame): Likewise.
49 * frame.c (make_frame): Omit redundant initialization.
50 * window.c (make_parent_window): Use memset.
51 (make_window): Omit redundant initialization.
52 * process.c (make_process): Omit redundant initialization.
53 * terminal.c (create_terminal): Likewise.
54
55 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
56
57 * term.c (delete_tty): Remove redundant call to memset.
58
59 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
60
61 * alloc.c: Remove build_string.
62 * lisp.h: Define build_string as static inline. This provides
63 a better opportunity to optimize away calls to strlen when the
64 function is called with compile-time constant argument.
65 * image.c (imagemagick_error): Convert to build_string.
66 * w32proc.c (sys_spawnve): Likewise.
67 * xterm.c (x_term_init): Likewise.
68
69 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
70
71 Use sprintf return value instead of invoking strlen on result.
72 In the old days this wasn't portable, since some sprintf
73 implementations returned char *. But they died out years ago and
74 Emacs already assumes sprintf returns int.
75 Similarly for float_to_string.
76 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
77 * ccl.c (ccl_driver):
78 * character.c (string_escape_byte8):
79 * data.c (Fnumber_to_string):
80 * doprnt.c (doprnt):
81 * print.c (print_object):
82 * xdisp.c (message_dolog):
83 * xfns.c (syms_of_xfns):
84 Use sprintf or float_to_string result to avoid need to call strlen.
85 * data.c (Fnumber_to_string):
86 Use make_unibyte_string, since the string must be ASCII.
87 * lisp.h, print.c (float_to_string): Now returns int length.
88 * term.c (produce_glyphless_glyph):
89 Use sprintf result rather than recomputing it.
90
91 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
92 * Makefile.in (ALL_CFLAGS):
93 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
94 * gmalloc.c, regex.c: Include <config.h> unconditionally.
95
96 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
97
98 * dispextern.h (xstrcasecmp): Define to library function
99 strcasecmp if available.
100 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
101
102 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
103
104 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
105 Avoid comma operator.
106 * menu.c (push_submenu_start, push_submenu_end)
107 (push_left_right_boundary, push_menu_pane): Likewise.
108 * msdos.c (dos_rawgetc): Likewise.
109
110 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
111
112 * xfns.c (xic_create_fontsetname): Remove redundant calls
113 to memset.
114
115 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
116
117 * gtkutil.c (get_utf8_string): Remove redundant assignment.
118 sprintf already null-terminates its output.
119
120 * xfns.c (x_window): Remove redundant cast.
121
122 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
123
124 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
125 `const char *' to `char *' to avoid compiler warning.
126
127 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
128
129 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
130 instead of truncating it to 63 (admittedly a generous limit).
131
132 * process.c: Fix spelling and caps in comments.
133
134 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
135
136 * emacs.c (setpgrp): Remove definition, unused.
137 * sysdep.c (setpgrp): Remove definition, not used in this file.
138
139 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
140
141 * makefile.w32-in: Update dependencies.
142
143 2012-06-24 Eli Zaretskii <eliz@gnu.org>
144
145 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
146 (SYSTIME_H): Add nt/inc/sys/time.h.
147
148 * systime.h [WINDOWSNT]: Include sys/time.h.
149
150 * s/ms-w32.h (struct timespec): Definition moved from
151 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
152
153 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
154
155 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
156 * buffer.h (buffer_slot_type_mismatch):
157 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
158 * eval.c (unwind_to_catch):
159 * image.c (my_png_error, my_error_exit):
160 * keyboard.c (quit_throw_to_read_char, user_error)
161 (Fexit_recursive_edit, Fabort_recursive_edit):
162 * lisp.h (die, args_out_of_range, args_out_of_range_3)
163 (wrong_type_argument, buffer_overflow, __executable_start)
164 (memory_full, buffer_memory_full, string_overflow, Fthrow)
165 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
166 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
167 (fatal):
168 (child_setup) [!DOS_NT]:
169 * lread.c (end_of_file_error, invalid_syntax):
170 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
171 * puresize.h (pure_write_error):
172 * search.c (matcher_overflow):
173 * sound.c (sound_perror, alsa_sound_perror):
174 * sysdep.c, syssignal.h (croak):
175 * term.c (maybe_fatal, vfatal):
176 * textprop.c (text_read_only):
177 * undo.c (user_error):
178 * unexmacosx.c (unexec_error):
179 * xterm.c (x_ins_del_lines, x_delete_glyphs):
180 Use _Noreturn rather than NO_RETURN.
181 No need for separate decl merely because of _Noreturn.
182 * sound.c (sound_warning, parse_sound):
183 Remove unnecessary forward decls.
184
185 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
186
187 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
188 * lisp.h (WAIT_READING_MAX): New macro.
189 * dispnew.c (Fsleep_for, sit_for):
190 * keyboard.c (kbd_buffer_get_event):
191 * process.c (Faccept_process_output):
192 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
193 This improves on the previous patch, which introduced a bug
194 when time_t is unsigned and as wide as intmax_t.
195 See <http://bugs.gnu.org/9000#51>.
196
197 2012-06-23 Eli Zaretskii <eliz@gnu.org>
198
199 * dispnew.c (sit_for, Fsleep_for):
200 * keyboard.c (kbd_buffer_get_event):
201 * process.c (Faccept_process_output): Avoid compiler warnings when
202 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
203
204 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
205
206 * makefile.w32-in: Update dependencies.
207
208 * w32.c (ltime): Add return type and declare static.
209 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
210
211 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
212
213 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
214 Privately reported by Herbert J. Skuhra.
215 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
216 All uses changed.
217 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
218 not make_lisp_timeval, when the argument is of type EMACS_TIME.
219
220 2012-06-23 Eli Zaretskii <eliz@gnu.org>
221
222 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
223 last argument of make_unibyte_string.
224
225 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
226 language ID in the event parameters.
227
228 * w32term.c (w32_read_socket): Put the new keyboard codepage into
229 event.code, not the obscure "character set ID".
230
231 2012-06-23 Chong Yidong <cyd@gnu.org>
232
233 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
234
235 2012-06-23 Eli Zaretskii <eliz@gnu.org>
236
237 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
238 * w32.c (fdutimens): New function.
239
240 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
241
242 * s/ms-w32.h (pselect): Redirect to sys_select.
243
244 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
245
246 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
247 in the logic of incrementing and decrementing the value of
248 use_relocatable_buffers.
249
250 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
251
252 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
253 Privately reported by Herbert J. Skuhra.
254 [__FreeBSD__]: Remove "*/" typo after "#include".
255 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
256 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
257 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
258 Don't assume EMACS_TIME and struct timeval are the same type.
259
260 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
261
262 Support higher-resolution time stamps (Bug#9000).
263 The time stamps are only nanosecond-resolution at the C level,
264 since that's the best that any real-world system supports now.
265 But they are picosecond-resolution at the Lisp level, as that's
266 easy, and leaves room for future OS improvements.
267
268 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
269 (LIBES): Use it.
270
271 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
272 Don't get current time unless it's needed.
273
274 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
275 now provides it if it's absent.
276 (start_atimer): Port to higher-res time stamps.
277 Check for time stamp overflow. Don't get current time more
278 often than is needed.
279
280 * buffer.h (struct buffer): Buffer modtime now has high resolution.
281 Include systime.h, not time.h.
282 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
283
284 * dired.c: Include stat-time.h.
285 (Ffile-attributes): File times now have higher resolution.
286
287 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
288 (struct image): Timestamp now has higher resolution.
289
290 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
291 has at least microseconds now. All uses removed.
292 (update_frame, update_single_window, update_window, update_frame_1)
293 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
294
295 * editfns.c (time_overflow): Now extern.
296 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
297 (float-time, Fformat_time_string, Fcurrent_time_string)
298 (Fcurrent_time_zone): Accept and generate higher-resolution
299 time stamps.
300 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
301 (decode_time_components, lisp_seconds_argument): New functions.
302 (make_time): Now static.
303 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
304 Report an error if the time is invalid, rather than having the caller
305 do that.
306
307 * fileio.c: Include <stat-time.h>
308 (Fcopy_file): Copy higher-resolution time stamps.
309 Prefer to set the time stamp via a file descriptor if that works.
310 (Fset_file_times, Finsert_file_contents, Fwrite_region)
311 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
312 (Fvisited_file_modtime, Fset_visited_file_modtime):
313 Support higher-resolution time stamps.
314
315 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
316
317 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
318
319 * image.c (prepare_image_for_display, clear_image_cache)
320 (lookup_image): Port to higer-resolution time stamps.
321
322 * keyboard.c (start_polling, bind_polling_period):
323 Check for time stamp overflow.
324 (read_char, kbd_buffer_get_event, timer_start_idle)
325 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
326 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
327 Port to higher-resolution time stamps. Do not assume time_t is signed.
328 (decode_timer): New function. Timers are now vectors of length 9,
329 not 8, to accommodate the picosecond component.
330 (timer_check_2): Use it.
331
332 * nsterm.m (select_timeout, timeval_subtract): Remove.
333 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
334 as they're a bit more accurate and handle overflow better.
335 (ns_select): Change prototype to be compatible with pselect.
336 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
337 * nsterm.h (ns_select): Adjust prototype.
338
339 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
340 us-resolution time stamps.
341 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
342
343 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
344
345 * lisp.h (time_overflow): New decl.
346 (wait_reading_process_output): First arg is now intmax_t, not int,
347 to accommodate larger waits.
348
349 * process.h (struct Lisp_Process.read_output_delay):
350 Now counts nanoseconds, not microseconds.
351 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
352 EMACS_HAS_USECS.
353 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
354 (wait_reading_process_output):
355 Port to ns-resolution time stamps.
356 (Faccept_process_output, wait_reading_process_output):
357 Check for time stamp overflow. Do not assume time_t is signed.
358 (select_wrapper): Remove; we now use pselect.
359 (Fprocess_attributes): Now generates ns-resolution time stamps.
360
361 * sysdep.c: Include utimens.h. Don't include utime.h
362 or worry about struct utimbuf; gnulib does that for us now.
363 (gettimeofday): Remove; gnulib provides a substitute.
364 (make_timeval): New function.
365 (set_file_times): Now sets ns-resolution time stamps.
366 New arg FD; all uses changed.
367 (time_from_jiffies, ltime_from_jiffies, get_up_time)
368 (system_process_attributes):
369 Now returns ns-resolution time stamp. All uses changed.
370 Check for time stamp overflow.
371
372 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
373 provides a substitute now.
374
375 * systime.h: Include timespec.h rather than sys/time.h and time.h,
376 since it guarantees struct timespec.
377 (EMACS_TIME): Now struct timespec, so that we can support
378 ns-resolution time stamps.
379 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
380 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
381 (EMACS_USECS): Remove.
382 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
383 so multiply the arg by 1000 before storing it.
384 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
385 New macros.
386 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
387 Port to ns-resolution time stamps.
388 (EMACS_TIME_NEG_P): Remove; replaced by....
389 (EMACS_TIME_SIGN): New macro.
390 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
391 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
392 (set_file_times, make_time, lisp_time_argument): Adjust signature.
393 (make_timeval, make_lisp_time, decode_time_components): New decls.
394 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
395 that it mishandled time_t overflow. You can't compare by subtracting!
396 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
397 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
398
399 * term.c: Include <sys/time.h>.
400 (timeval_to_Time): New function, for proper overflow wraparound.
401 (term_mouse_position, term_mouse_click): Use it.
402
403 * undo.c (record_first_change): Support higher-resolution time stamps
404 in the undo buffer.
405 (Fprimitive_undo): Use them when restoring time stamps.
406
407 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
408 (w32_get_internal_run_time):
409 Port to higher-resolution Emacs time stamps.
410 (ltime): Now accepts single 64-bit integer, as that's more convenient
411 for callers.
412
413 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
414
415 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
416 for compatibility with pselect. Support ns-resolution time stamps.
417
418 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
419
420 * xselect.c (wait_for_property_change, x_get_foreign_selection):
421 Check for time stamp overflow, and support ns-resolution time stamps.
422
423 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
424 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
425 (timeval_subtract): Remove; no longer needed.
426 (XTflash, XTring_bell, x_wait_for_event):
427 Port to ns-resolution time stamps. Don't assume time_t is signed.
428
429 2012-06-22 Chong Yidong <cyd@gnu.org>
430
431 * xdisp.c (x_consider_frame_title): Revert last change.
432
433 2012-06-22 Eli Zaretskii <eliz@gnu.org>
434
435 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
436 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
437 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
438 staticidx goes up to 1597 out of 1600 = 0x640.)
439
440 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
441
442 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
443 Otherwise, the umask might be mistakenly 0 while handling input signals.
444
445 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
446
447 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
448
449 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
450
451 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
452 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
453 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
454 access to `contents' member of Lisp_Vector objects with AREF and ASET
455 where appropriate.
456
457 2012-06-19 Chong Yidong <cyd@gnu.org>
458
459 * frame.c (delete_frame): When selecting a frame on a different
460 text terminal, do not alter the terminal's top-frame.
461
462 * xdisp.c (format_mode_line_unwind_data): Record the target
463 frame's selected window and its terminal's top-frame.
464 (unwind_format_mode_line): Restore them.
465 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
466 Callers changed.
467 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
468 since tty frames can be explicitly named.
469 (prepare_menu_bars): Likewise.
470
471 * term.c (Ftty_top_frame): New function.
472
473 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
474
475 Port byte-code-meter to modern targets.
476 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
477 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
478 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
479 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
480 (METER_1, METER_2): Simplify.
481
482 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
483
484 * data.c (Fdefalias): Return `symbol' (bug#11686).
485
486 2012-06-18 Martin Rudalics <rudalics@gmx.at>
487
488 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
489 gets killed during executing of this function (Bug#11665).
490 Try to always return Qt when the buffer has been actually killed.
491 (Vkill_buffer_query_functions): In doc-string say that functions
492 run by this hook should not change the current buffer.
493
494 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
495
496 Fix recently-introduced process.c problems found by static checking.
497 * process.c (write_queue_push, write_queue_pop, send_process):
498 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
499 (write_queue_pop): Fix pointer signedness problem.
500 (send_process): Remove unused local.
501
502 2012-06-17 Chong Yidong <cyd@gnu.org>
503
504 * xdisp.c (redisplay_internal): No need to redisplay terminal
505 frames that are not on top.
506
507 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
508
509 * process.c (make_process): Initialize write_queue.
510 (write_queue_push, write_queue_pop): New functions.
511 (send_process): Use them to maintain correct ordering of process
512 writes (Bug#10815).
513
514 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
515
516 * lisp.h (eassert): Assume C89 or later.
517 This removes the need for CHECK.
518 (CHECK): Remove. Its comments about always evaluating its
519 argument were confusing, as 'eassert' typically does not evaluate
520 its argument.
521
522 * coding.c (produce_chars): Use ptrdiff_t, not int.
523
524 * xterm.c (x_draw_underwave): Check for integer overflow.
525 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
526
527 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
528
529 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
530 referenced (Bug#11583).
531
532 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
533
534 Implement wave-style variant of underlining.
535 * dispextern.h (face_underline_type): New enum.
536 (face): Add field for underline type.
537 * nsterm.m (ns_draw_underwave): New function.
538 (ns_draw_text_decoration): Use it.
539 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
540 New functions.
541 (x_draw_glyph_string): Use them.
542 * xfaces.c (Qline, Qwave): New Lisp objects.
543 (check_lface_attrs, merge_face_ref)
544 (Finternal_set_lisp_face_attribute, realize_x_face):
545 Handle wave-style underline face attributes.
546 * xterm.c (x_draw_underwave): New function.
547 (x_draw_glyph_string): Use it.
548
549 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
550
551 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
552 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
553 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
554 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
555 ($(BLD)/w32select.$(O)): Update dependencies.
556
557 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
558
559 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
560 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
561 * character.c (_fetch_multibyte_char_p): Remove.
562 * alloc.c: Include "character.h" before "buffer.h".
563 * bidi.c: Likewise.
564 * buffer.c: Likewise.
565 * bytecode.c: Likewise.
566 * callint.c: Likewise.
567 * callproc.c: Likewise.
568 * casefiddle.c: Likewise.
569 * casetab.c: Likewise.
570 * category.c: Likewise.
571 * cmds.c: Likewise.
572 * coding.c: Likewise.
573 * composite.c: Likewise.
574 * dired.c: Likewise.
575 * dispnew.c: Likewise.
576 * doc.c: Likewise.
577 * dosfns.c: Likewise.
578 * editfns.c: Likewise.
579 * emacs.c: Likewise.
580 * fileio.c: Likewise.
581 * filelock.c: Likewise.
582 * font.c: Likewise.
583 * fontset.c: Likewise.
584 * fringe.c: Likewise.
585 * indent.c: Likewise.
586 * insdel.c: Likewise.
587 * intervals.c: Likewise.
588 * keyboard.c: Likewise.
589 * keymap.c: Likewise.
590 * lread.c: Likewise.
591 * macros.c: Likewise.
592 * marker.c: Likewise.
593 * minibuf.c: Likewise.
594 * nsfns.m: Likewise.
595 * nsmenu.m: Likewise.
596 * print.c: Likewise.
597 * process.c: Likewise.
598 * regex.c: Likewise.
599 * region-cache.c: Likewise.
600 * search.c: Likewise.
601 * syntax.c: Likewise.
602 * term.c: Likewise.
603 * textprop.c: Likewise.
604 * undo.c: Likewise.
605 * unexsol.c: Likewise.
606 * w16select.c: Likewise.
607 * w32fns.c: Likewise.
608 * w32menu.c: Likewise.
609 * window.c: Likewise.
610 * xdisp.c: Likewise.
611 * xfns.c: Likewise.
612 * xmenu.c: Likewise.
613 * xml.c: Likewise.
614 * xselect.c: Likewise.
615
616 2012-06-16 Eli Zaretskii <eliz@gnu.org>
617
618 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
619 If all the glyphs of the glyph row came from strings, and we have no
620 cursor positioning clues, put the cursor on the first glyph of the
621 row.
622 (handle_face_prop): Use chunk-relative overlay string index when
623 indexing into it->string_overlays array. (Bug#11653)
624 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
625 the rightmost. (Bug#11720)
626
627 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
628
629 * category.h (CHAR_HAS_CATEGORY): Define as inline.
630 (CATEGORY_MEMBER): Enforce 1/0 value.
631 * category.c (_temp_category_set): Remove.
632
633 2012-06-16 Eli Zaretskii <eliz@gnu.org>
634
635 * window.c (Fdelete_other_windows_internal)
636 (Fdelete_window_internal): Don't access frame's mouse highlight
637 info of the initial frame. (Bug#11677)
638
639 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
640
641 * .gdbinit (xgetint): Fix recently-introduced paren typo.
642 Assume USE_2_TAGS_FOR_INTS.
643 (xreload): Adjust $tagmask width to match recent lisp.h change.
644
645 Simplify lisp.h in minor ways that should not affect code.
646 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
647 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
648 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
649 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
650 (INTTYPEBITS): New macro, for clarity.
651 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
652 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
653 Simplify now that USE_LSB_TAG is always defined.
654 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
655 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
656
657 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
658
659 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
660
661 2012-06-13 Glenn Morris <rgm@gnu.org>
662
663 * s/bsd-common.h (BSD4_3):
664 * s/usg5-4-common.h (USG5_4): No longer define; unused.
665
666 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
667
668 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
669 instead of union.
670 (XLI, XIL): Define.
671 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
672 Use them.
673 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
674 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
675 * alloc.c (widen_to_Lisp_Object): Remove.
676 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
677 * frame.c (delete_frame): Remove outdated comment.
678 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
679 USE_LISP_UNION_TYPE.
680 (Fw32_unregister_hot_key): Likewise.
681 (Fw32_toggle_lock_key): Likewise.
682 * w32menu.c (add_menu_item): Likewise.
683 (w32_menu_display_help): Use XIL instead of checking
684 USE_LISP_UNION_TYPE.
685 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
686 (init_heap): Likewise.
687 * w32term.c (w32_read_socket): Update comment.
688
689 2012-06-13 Glenn Morris <rgm@gnu.org>
690
691 * s/usg5-4-common.h, src/s/unixware.h:
692 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
693
694 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
695
696 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
697
698 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
699 * alloc.c (make_number) [!defined make_number]:
700 Remove, as lisp.h always defines this now.
701 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
702 (roundup_size): Verify that it is a power of 2.
703 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
704 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
705 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
706 -DUSE_LSB_TAG=0, to override the automatically-selected default.
707 USE_LSB_TAG now is always defined to be either 0 or 1.
708 All uses changed.
709 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
710 code works fine either way, and efficiency is not a concern here,
711 as the union type is for debugging, not for production.
712 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
713 Use an inline function on all platforms when using the union type,
714 since this is simpler and 'static inline' can be used portably
715 within Emacs now.
716 (LISP_INITIALLY_ZERO): New macro.
717 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
718 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
719
720 2012-06-12 Glenn Morris <rgm@gnu.org>
721
722 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
723
724 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
725
726 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
727 Move BROKEN_SIGIO to configure.
728
729 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
730 Move NO_TERMIO to configure.
731
732 2012-06-12 Chong Yidong <cyd@gnu.org>
733
734 * image.c (imagemagick_load_image): Use MagickFlattenImage if
735 MagickMergeImageLayers is undefined. Use pixel pusher loop if
736 MagickExportImagePixels is undefined.
737
738 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
739
740 * image.c (imagemagick_load_image): Remove unused label.
741
742 2012-06-11 Glenn Morris <rgm@gnu.org>
743
744 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
745 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
746 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
747 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
748
749 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
750
751 * alloc.c (make_byte_code): New function.
752 (Fmake_byte_code): Use it. Don't purify here.
753 * lread.c (read1): Use it as well to avoid extra allocation.
754
755 2012-06-11 Chong Yidong <cyd@gnu.org>
756
757 * image.c (imagemagick_load_image): Implement transparency.
758
759 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
760
761 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
762 account for preceding backslashes. (Bug#11663)
763
764 2012-06-09 Chong Yidong <cyd@gnu.org>
765
766 * term.c: Support italics in capable terminals (Bug#9652).
767 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
768 (turn_on_face): Output using TS_enter_italic_mode if available.
769 Don't handle unused blinking and alt-charset cases.
770 (turn_off_face): Handle italic case; discard unused tty_blinking_p
771 and tty_alt_charset_p cases.
772 (tty_capable_p, init_tty): Support italics.
773
774 * termchar.h (struct tty_display_info): Add field for italics.
775 Remove unused blink field.
776
777 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
778 Handle slant.
779
780 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
781 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
782 tty_alt_charset_p. Add tty_italic_p.
783
784 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
785
786 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
787 dbus_type_is_basic if available.
788 (xd_extract_signed, xd_extract_unsigned): Rename from
789 extract_signed and extract_unsigned, respectively. Adapt callers.
790
791 2012-06-09 Chong Yidong <cyd@gnu.org>
792
793 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
794
795 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
796 case (Bug#9752).
797
798 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
799
800 * xdisp.c (vmessage): Treat frame message as multibyte.
801 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
802 would generate the diagnostic "Making \302\247 buffer-local while
803 let-bound!".
804
805 2012-06-08 Eli Zaretskii <eliz@gnu.org>
806
807 * dispnew.c (showing_window_margins_p): Undo last change, which
808 was done due to an inadvertent commit.
809 (adjust_frame_glyphs_for_frame_redisplay): Do call
810 showing_window_margins_p.
811
812 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
813
814 * eval.c (Fmake_var_non_special): New primitive.
815 (syms_of_eval): Defsubr it.
816 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
817
818 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
819
820 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
821 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
822
823 2012-06-08 Eli Zaretskii <eliz@gnu.org>
824
825 * alloc.c (allocate_vectorlike): Fix last change.
826
827 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
828
829 Block-based vector allocation of small vectors.
830 * lisp.h (struct vectorlike_header): New field `nbytes',
831 adjust comment accordingly.
832 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
833 to denote vector blocks. Adjust users (live_vector_p,
834 mark_maybe_pointer, valid_lisp_object_p) accordingly.
835 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
836 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
837 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
838 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
839 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
840 (roundup_size): New constant.
841 (struct vector_block): New data type.
842 (vector_blocks, vector_free_lists, zero_vector): New variables.
843 (all_vectors): Rename to `large_vectors'.
844 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
845 (sweep_vectors): New functions.
846 (allocate_vectorlike): Return `zero_vector' as the only vector of
847 0 items. Allocate new vector from block if vector size is less than
848 or equal to VBLOCK_BYTES_MAX.
849 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
850 (init_alloc_once): Add call to init_vectors.
851
852 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
853
854 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
855
856 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
857
858 * doprnt.c (doprnt): Truncate multibyte char correctly.
859 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
860 would mishandle a string argument "Xc" if X was a multibyte
861 character of length 2: it would truncate after X's first byte
862 rather than including all of X.
863
864 2012-06-06 Chong Yidong <cyd@gnu.org>
865
866 * buffer.c (word_wrap): Doc fix.
867
868 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
869
870 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
871
872 2012-06-03 Glenn Morris <rgm@gnu.org>
873
874 * xdisp.c (tool-bar-style): Doc fix.
875
876 2012-06-03 Ulrich Müller <ulm@gentoo.org>
877
878 * Makefile.in (PAXCTL): Define.
879 (temacs$(EXEEXT)): Disable memory randomization for the temacs
880 binary via PaX flags if the paxctl utility is available.
881 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
882 Restore PaX flags to their default. (Bug#11398)
883
884 2012-06-03 Chong Yidong <cyd@gnu.org>
885
886 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
887 buffer (Bug#11226).
888
889 2012-06-03 Chong Yidong <cyd@gnu.org>
890
891 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
892 (note_mode_line_or_margin_highlight): If there is no help echo,
893 use mode-line-default-help-echo. Handle the case where the mouse
894 position is past the end of the mode line string.
895
896 * buffer.c (buffer_local_value_1): New function, split from
897 Fbuffer_local_value; can return Qunbound.
898 (Fbuffer_local_value): Use it.
899 (Vmode_line_format): Docstring tweaks.
900
901 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
902
903 * sysdep.c (system_process_attributes): Improve comment.
904
905 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
906
907 * keyboard.c: Export real-this-command to Elisp.
908 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
909 and DEFVAR it. Update all users.
910
911 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
912
913 * minibuf.c (Fassoc_string): Remove duplicate declaration.
914
915 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
916 Convert pctcpu and pctmem to Lisp float properly.
917 Let the compiler fold better, as 100.0/0x8000 is exact.
918
919 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
920
921 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
922 cons_block.
923
924 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
925
926 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
927
928 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
929
930 For a 'struct window', replace some Lisp_Object fields to
931 bitfields where appropriate, remove unused fields.
932 * window.h (struct window): Remove unused 'last_mark_x' and
933 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
934 change it's type from Lisp_Object to bitfield.
935 Change type of 'force_start', 'optional_new_start',
936 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
937 fields from Lisp_Object to bitfield. Adjust users accordingly.
938
939 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
940
941 Pacify gcc -Wdouble-precision when using Xaw.
942 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
943 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
944 Use 'float' consistently, rather than 'float' in most places
945 and 'double' in a couple of places.
946
947 2012-05-31 Eli Zaretskii <eliz@gnu.org>
948
949 * xdisp.c (handle_stop): Detect whether we have overlay strings
950 loaded by testing it->current.overlay_string_index to be
951 non-negative, instead of checking whether n_overlay_strings is
952 positive. (Bug#11587)
953
954 2012-05-31 Chong Yidong <cyd@gnu.org>
955
956 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
957
958 * doc.c (Fsubstitute_command_keys): Doc fix.
959
960 2012-05-31 Eli Zaretskii <eliz@gnu.org>
961
962 * search.c (search_buffer): Remove calls to
963 r_alloc_inhibit_buffer_relocation, as it is now called by
964 maybe_unify_char, which was the cause of relocation of buffer text
965 in bug#11519.
966
967 2012-05-31 Eli Zaretskii <eliz@gnu.org>
968
969 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
970 for the duration of call to load_charset, to avoid problems with
971 callers of maybe_unify_char that access buffer text through C
972 pointers.
973
974 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
975 decrement the inhibition flag, instead of just setting or
976 resetting it.
977
978 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
979
980 Remove obsolete '#define static' cruft.
981 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
982 This #undef was "temporary" in 2000; it is no longer needed
983 now that '#define static' has gone away.
984 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
985 (gray_bitmap_bits): Remove; no longer needed.
986 All uses replaced with definiens.
987 * xterm.c: Include "bitmaps/gray.xbm".
988
989 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
990
991 Clean up __executable_start, monstartup when --enable-profiling.
992 The following changes affect the code only when profiling.
993 * dispnew.c (__executable_start): Rename from safe_bcopy.
994 Define only on platforms that need it.
995 * emacs.c: Include <sys/gmon.h> when profiling.
996 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
997 (__executable_start): Remove decl, since lisp.h does it now.
998 (safe_bcopy): Remove decl; no longer has that name.
999 (main): Coalesce #if into single bit of code, for simplicity.
1000 Cast pointers to uintptr_t, since standard libraries want integers
1001 and not pointers.
1002 * lisp.h (__executable_start): New decl.
1003
1004 2012-05-31 Glenn Morris <rgm@gnu.org>
1005
1006 * image.c (Fimagemagick_types): Doc fix.
1007
1008 2012-05-30 Jim Meyering <meyering@redhat.com>
1009
1010 * callproc.c (Fcall_process_region): Include directory component
1011 in mkstemp error message (Bug#11586).
1012
1013 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
1014
1015 * alloc.c, lisp.h (make_pure_vector): Now static.
1016
1017 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
1018
1019 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
1020 Move to byte-run.el.
1021 (Fautoload): Do the hash-doc more carefully.
1022 * data.c (Fdefalias): Purify definition, except for keymaps.
1023 (Qdefun): Move from eval.c.
1024 * lisp.h (Qdefun): Remove.
1025 * lread.c (read1): Tiny simplification.
1026
1027 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
1028
1029 Do not create empty overlays with the evaporate property (Bug#9642).
1030 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
1031 Bug#9642, but explicitly check that the buffer the overlay would
1032 be moved to is live and rearrange lines to make sure that errors
1033 will not put the overlay in an inconsistent state.
1034 (Fdelete_overlay): Cosmetics.
1035
1036 2012-05-28 Eli Zaretskii <eliz@gnu.org>
1037
1038 * w32term.c (my_bring_window_to_top): New function.
1039 (x_raise_frame): Use handle returned by DeferWindowPos, which
1040 could be different from the original one.
1041 Call my_bring_window_to_top instead of my_set_foreground_window.
1042 (Bug#11513)
1043
1044 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
1045 by calling BringWindowToTop.
1046
1047 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
1048 (WM_EMACS_END): Increase by one.
1049
1050 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
1051
1052 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
1053 This avoids undefined behavior that might cause the eassert
1054 to not catch an out-of-range value.
1055
1056 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
1057
1058 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
1059 Update dependencies.
1060
1061 2012-05-27 Eli Zaretskii <eliz@gnu.org>
1062
1063 * bidi.c (bidi_mirror_char): Fix last change.
1064
1065 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
1066
1067 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
1068 when referring to sectname field in printf format.
1069
1070 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
1071
1072 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
1073 Only r_alloc_inhibit_buffer_relocation needed to be added;
1074 the others were already declared.
1075
1076 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
1077 before checking whether it's out of range. Put the check inside
1078 eassert. See
1079 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
1080
1081 2012-05-27 Ken Brown <kbrown@cornell.edu>
1082
1083 * callproc.c (Fcall_process): Restore a line that was accidentally
1084 commented out in the 2011-02-13 change (bug#11547).
1085
1086 2012-05-27 Eli Zaretskii <eliz@gnu.org>
1087
1088 * lisp.h [REL_ALLOC]: Add prototypes for external functions
1089 defined on ralloc.c.
1090
1091 * buffer.c [REL_ALLOC]: Remove prototypes of
1092 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
1093 they are now on lisp.h.
1094
1095 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
1096
1097 * search.c (search_buffer): Use it to inhibit relocation of buffer
1098 text while re_search_2 is doing its job, because re_search_2 is
1099 passed C pointers to buffer text. (Bug#11519)
1100
1101 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
1102 Update value to 24.
1103
1104 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
1105 state after an additional call to move_it_in_display_line_to, keep
1106 the values of it->max_ascent and it->max_descent found for the
1107 entire line.
1108 (pos_visible_p): Revert the comparison against bottom_y to what it
1109 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
1110 (Bug#11464)
1111
1112 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1113
1114 Fix coding-related core dumps with gcc -ftrapv.
1115 The code was computing A - B, where A and B are pointers, and B is
1116 random garbage. This can lead to core dumps on platforms that
1117 have special pointer registers, and it also leads to core dumps on
1118 x86-64 when compiled with gcc -ftrapv. The fix is to compute
1119 A - B only when B is initialized properly.
1120 * coding.c (coding_set_source, coding_set_destination): Return void.
1121 (coding_change_source, coding_change_destinations): New functions,
1122 with the old behaviors of coding_set_source and coding_set_destination.
1123 All callers that need an offset changed to use these new functions.
1124
1125 2012-05-26 Glenn Morris <rgm@gnu.org>
1126
1127 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
1128
1129 2012-05-26 Eli Zaretskii <eliz@gnu.org>
1130
1131 Extend mouse support on W32 text-mode console.
1132 * xdisp.c (draw_row_with_mouse_face):
1133 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
1134
1135 * w32console.c: Include window.h.
1136 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
1137 New functions.
1138 (initialize_w32_display): Initialize mouse-highlight data.
1139
1140 * w32inevt.c: Include termchar.h and window.h.
1141 (do_mouse_event): Support mouse-autoselect-window. When the mouse
1142 moves, call note_mouse_highlight. If help_echo changed, call
1143 gen_help_event to produce help-echo message in the echo area.
1144 Call clear_mouse_face if mouse_face_hidden is set in the mouse
1145 highlight info.
1146
1147 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 * lread.c (read1): Simplify slightly to avoid an overflow warning
1150 with GCC 4.7.0 on x86-64.
1151
1152 2012-05-26 Eli Zaretskii <eliz@gnu.org>
1153
1154 * bidi.c (bidi_mirror_char): Revert last change: an int is
1155 definitely wide enough here.
1156
1157 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
1158
1159 Fix integer width and related bugs (Bug#9874).
1160 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
1161 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
1162 (string_bytes, check_sblock, allocate_string_data):
1163 (compact_small_strings, Fmake_bool_vector, make_string)
1164 (make_unibyte_string, make_multibyte_string)
1165 (make_string_from_bytes, make_specified_string)
1166 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
1167 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
1168 (mark_vectorlike):
1169 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1170 (allocate_pseudovector):
1171 Use int, not EMACS_INT, where int is wide enough.
1172 (inhibit_garbage_collection, Fgarbage_collect):
1173 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1174 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
1175 int might not be wide enough.
1176 (bidi_cache_search, bidi_cache_find, bidi_init_it)
1177 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1178 (bidi_at_paragraph_end, bidi_find_paragraph_start)
1179 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
1180 (bidi_level_of_next_char, bidi_move_to_visually_next):
1181 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1182 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
1183 (Fkill_buffer, Fset_buffer_major_mode)
1184 (advance_to_char_boundary, Fbuffer_swap_text)
1185 (Fset_buffer_multibyte, overlays_at, overlays_in)
1186 (overlay_touches_p, struct sortvec, record_overlay_string)
1187 (overlay_strings, recenter_overlay_lists)
1188 (adjust_overlays_for_insert, adjust_overlays_for_delete)
1189 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
1190 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
1191 (Foverlay_recenter, last_overlay_modification_hooks_used)
1192 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
1193 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1194 (validate_region): Omit unnecessary test for b <= e,
1195 since that's guaranteed by the previous test.
1196 (adjust_overlays_for_delete): Avoid pos + length overflow.
1197 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
1198 (report_overlay_modification):
1199 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1200 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
1201 Omit pointer cast, which isn't needed anyway, and doesn't work
1202 after the EMACS_INT -> ptrdiff_t change.
1203 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
1204 * buffer.h: Adjust decls to match defn changes elsewhere.
1205 (struct buffer_text, struct buffer):
1206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1207 Use EMACS_INT, not int, where int might not be wide enough.
1208 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
1209 not int, to avoid needless 32-bit limit on 64-bit hosts.
1210 (exec_byte_code): Use tighter memory-full test, one that checks
1211 for alloca overflow. Don't compute the address of the object just
1212 before an array, as that's not portable. Use EMACS_INT, not
1213 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
1214 * callint.c (Fcall_interactively):
1215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1216 * callproc.c (call_process_kill, Fcall_process):
1217 Don't assume pid_t fits into an Emacs fixnum.
1218 (call_process_cleanup, Fcall_process, child_setup):
1219 Don't assume pid_t fits into int.
1220 (call_process_cleanup, Fcall_process, delete_temp_file)
1221 (Fcall_process_region):
1222 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1223 (Fcall_process): Simplify handling of volatile integers.
1224 Use int, not EMACS_INT, where int will do.
1225 * casefiddle.c (casify_object, casify_region, operate_on_word)
1226 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
1227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1228 (casify_object): Avoid integer overflow when overallocating buffer.
1229 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
1230 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
1231 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
1232 * category.h (CATEGORYP): Don't assume arg is nonnegative.
1233 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
1234 integers are now checked earlier. All uses replaced with XINT.
1235 (ccl_driver):
1236 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1237 For CCL_MapSingle, check that content and value are in int range.
1238 (ccl_driver, Fregister_code_conversion_map):
1239 Check that Vcode_version_map_vector is a vector.
1240 (resolve_symbol_ccl_program): Check that vector header is in range.
1241 Always copy the vector, so that we can check its contents reliably
1242 now rather than having to recheck each instruction as it's being
1243 executed. Check that vector words fit in 'int'.
1244 (ccl_get_compiled_code, Fregister_ccl_program)
1245 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
1246 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
1247 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
1248 contents are in range.
1249 (Fccl_execute_on_string): Check that status is in range.
1250 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
1251 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
1252 Accept and return EMACS_INT, not int, because callers can pass values
1253 out of 'int' range.
1254 (c_string_width, strwidth, lisp_string_width, chars_in_text)
1255 (multibyte_chars_in_text, parse_str_as_multibyte)
1256 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
1257 (str_as_unibyte, str_to_unibyte, string_count_byte8)
1258 (string_escape_byte8, Fget_byte):
1259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1260 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
1261 avoid mishandling large integers.
1262 * character.h: Adjust decls to match defn changes elsewhere.
1263 * charset.c (load_charset_map_from_file, find_charsets_in_text)
1264 (Ffind_charset_region):
1265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1266 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
1267 (load_charset_map_from_vector, Fdefine_charset_internal):
1268 Don't assume fixnum fits in int.
1269 (load_charset_map_from_vector, Fmap_charset_chars):
1270 Remove now-unnecessary CHECK_NATNUMs.
1271 (Fdefine_charset_internal): Check ranges here, more carefully.
1272 Don't rely on undefined behavior with signed left shift overflow.
1273 Don't assume unsigned int fits into fixnum, or that fixnum fits
1274 into unsigned int. Don't require max_code to be a valid fixnum;
1275 that's not true for gb10830 4-byte on a 32-bit host. Allow
1276 invalid_code to be a cons, for the same reason. Require code_offset
1277 to be a character. Avoid int overflow if max_char is close
1278 to INT_MAX.
1279 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
1280 this is intended anyway and avoids some undefined behavior.
1281 (load_charset_map): Pass unsigned, not int, as 2nd arg of
1282 INDEX_TO_CODE_POINT, as that's what it expects.
1283 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
1284 * charset.h (DECODE_CHAR): Return int, not unsigned;
1285 this is what was intended anyway, and it avoids undefined behavior.
1286 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
1287 integer-overflow issues.
1288 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
1289 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
1290 where the argument is EMACS_INT, and this behavior is not intended.
1291 * chartab.c (Fmake_char_table, Fset_char_table_range)
1292 (uniprop_get_decoder, uniprop_get_encoder):
1293 Don't assume fixnum fits in int.
1294 * cmds.c (move_point): New function, that does the gist of
1295 Fforward_char and Fbackward_char, but does so while checking
1296 for integer overflow more accurately.
1297 (Fforward_char, Fbackward_char): Use it.
1298 (Fforward_line, Fend_of_line, internal_self_insert)
1299 (internal_self_insert):
1300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1301 Fix a FIXME, by checking for integer overflow when calculating
1302 target_clm and actual_clm.
1303 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
1304 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
1305 (ASSURE_DESTINATION, coding_alloc_by_realloc)
1306 (coding_alloc_by_making_gap, alloc_destination)
1307 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
1308 (encode_coding_utf_16, detect_coding_emacs_mule)
1309 (decode_coding_emacs_mule, encode_coding_emacs_mule)
1310 (detect_coding_iso_2022, decode_coding_iso_2022)
1311 (encode_invocation_designation, encode_designation_at_bol)
1312 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1313 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
1314 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
1315 (encode_coding_ccl, encode_coding_raw_text)
1316 (detect_coding_charset, decode_coding_charset)
1317 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
1318 (produce_composition, produce_charset, produce_annotation)
1319 (decode_coding, handle_composition_annotation)
1320 (handle_charset_annotation, consume_chars, decode_coding_gap)
1321 (decode_coding_object, encode_coding_object, detect_coding_system)
1322 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
1323 (code_convert_region, code_convert_string)
1324 (Fdefine_coding_system_internal)
1325 (coding_set_source, coding_set_destination):
1326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1327 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
1328 (Fdefine_coding_system_internal):
1329 Don't assume fixnums fit in int.
1330 (decode_coding_gap, decode_coding_object, encode_coding_object)
1331 (Fread_coding_system, Fdetect_coding_region)
1332 (Funencodable_char_position, Fcheck_coding_systems_region)
1333 (get_translation, handle_composition_annotation, consume_chars):
1334 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1335 (consume_chars): Rewrite to not calculate an address outside buffer.
1336 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
1337 Don't access memory outside of the args array.
1338 (Fdefine_coding_system_internal): Check for charset-id overflow.
1339 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
1340 result of ENCODE_CHAR.
1341 * coding.h: Adjust decls to match defn changes elsewhere.
1342 (struct coding_system):
1343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1344 * composite.c (get_composition_id, find_composition)
1345 (run_composition_function, update_compositions)
1346 (compose_text, composition_gstring_put_cache)
1347 (composition_gstring_p, composition_gstring_width)
1348 (fill_gstring_header, fill_gstring_body, autocmp_chars)
1349 (composition_compute_stop_pos, composition_reseat_it)
1350 (composition_update_it, struct position_record)
1351 (find_automatic_composition, composition_adjust_point)
1352 (Fcomposition_get_gstring, Ffind_composition_internal):
1353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1354 (update_compositions):
1355 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1356 * composite.h: Adjust decls to match defn changes elsewhere.
1357 (struct composition):
1358 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1359 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1360 Do not attempt to compute the address of the object just before a
1361 buffer; this is not portable.
1362 (Faref, Faset):
1363 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1364 (Faset): Use int, not EMACS_INT, where int is wide enough.
1365 (Fstring_to_number): Don't assume fixnums fit in int.
1366 (Frem): Don't assume arg is nonnegative.
1367 * dbusbind.c (xd_append_arg): Check for integers out of range.
1368 (Fdbus_call_method): Don't overflow the timeout int.
1369 (extract_signed, extract_unsigned): New functions.
1370 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
1371 (xd_get_connection_references): Return ptrdiff_t, not int.
1372 All uses changed.
1373 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
1374 (xd_read_message_1):
1375 Use int, not unsigned, where the dbus API uses int.
1376 (Fdbus_message_internal): Don't overflow mtype.
1377 (syms_of_dbusbind): Allocate right-sized buffer for integers.
1378 * dired.c (directory_files_internal, file_name_completion, scmp)
1379 (file_name_completion_stat):
1380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1381 (file_name_completion): Don't overflow matchcount.
1382 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
1383 * dispextern.h: Adjust decls to match defn changes elsewhere.
1384 (struct text_pos, struct glyph, struct bidi_saved_info)
1385 (struct bidi_string_data, struct bidi_it, struct composition_it)
1386 (struct it):
1387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1388 (struct display_pos, struct composition_it, struct it):
1389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1390 * dispnew.c (increment_matrix_positions)
1391 (increment_row_positions, mode_line_string)
1392 (marginal_area_string):
1393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1394 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
1395 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1396 (duration_to_sec_usec): New function, to check for overflow better.
1397 (Fsleep_for, sit_for): Use it.
1398 * doc.c (get_doc_string, store_function_docstring):
1399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1400 (get_doc_string, Fsnarf_documentation):
1401 Use int, not EMACS_INT, where int is wide enough.
1402 (get_doc_string):
1403 Use SAFE_ALLOCA, not alloca.
1404 Check for overflow when converting EMACS_INT to off_t.
1405 * doprnt.c (doprnt):
1406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1407 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
1408 Don't assume uid_t fits into fixnum.
1409 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
1410 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
1411 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
1412 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
1413 (general_insert_function)
1414 (Finsert_char, make_buffer_string, make_buffer_string_both)
1415 (update_buffer_properties, Fbuffer_substring)
1416 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
1417 (Fsubst_char_in_region, check_translation)
1418 (Ftranslate_region_internal, save_restriction_restore, Fformat)
1419 (transpose_markers, Ftranspose_regions):
1420 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1421 (clip_to_bounds): Move to lisp.h as an inline function).
1422 (Fconstrain_to_field): Don't assume integers are nonnegative.
1423 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
1424 (Fsubst_char_in_region, Fsave_restriction):
1425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1426 (Femacs_pid): Don't assume pid_t fits into fixnum.
1427 (lo_time): Use int, not EMACS_INT, when int suffices.
1428 (lisp_time_argument): Check for usec out of range.
1429 (Fencode_time): Don't assume fixnum fits in int.
1430 (Fuser_login_name, Fuser_full_name): Signal an error
1431 if a uid argument is out of range, rather than relying on
1432 undefined behavior.
1433 (Fformat_time_string): Remove now-unnecessary check.
1434 lisp_time_argument checks for out-of-range usec now.
1435 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
1436 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
1437 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
1438 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
1439 (init_cmdargs, Fdump_emacs):
1440 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1441 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
1442 the bottom (typically) 32 bits of the fixnum.
1443 * eval.c (specpdl_size, call_debugger):
1444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1445 (when_entered_debugger, Fbacktrace_debug):
1446 Don't assume fixnum can fit in int.
1447 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
1448 the object just before a buffer; this is not portable.
1449 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
1450 (grow_specpdl, unbind_to):
1451 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1452 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
1453 (grow_specpdl): Simplify allocation by using xpalloc.
1454 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
1455 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
1456 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
1457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1458 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
1459 (a_write, e_write):
1460 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1461 (Fcopy_file, non_regular_nbytes, read_non_regular)
1462 (Finsert_file_contents):
1463 Use int, not EMACS_INT, where int is wide enough.
1464 (READ_BUF_SIZE): Verify that it fits in int.
1465 (Finsert_file_contents): Check that counts are in proper range,
1466 rather than assuming fixnums fit into ptrdiff_t etc.
1467 Don't assume fixnums fit into int.
1468 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
1469 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
1470 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
1471 (string_char_to_byte, string_byte_to_char)
1472 (string_make_multibyte, string_to_multibyte)
1473 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
1474 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
1475 (substring_both, Fdelete, internal_equal, Ffillarray)
1476 (Fclear_string, mapcar1)
1477 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
1478 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
1479 (larger_vector, make_hash_table, maybe_resize_hash_table)
1480 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
1481 (Fmaphash, secure_hash):
1482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1483 (concat): Check for string index and length overflow.
1484 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
1485 (Frequire):
1486 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1487 (larger_vector): New API (vec, incr_min, size_max) replaces old
1488 one (vec, new_size, init). This catches size overflow.
1489 INIT was removed because it was always Qnil.
1490 All callers changed.
1491 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
1492 the upper bound on a hash table index size.
1493 (make_hash_table, maybe_resize_hash_table): Use it.
1494 (secure_hash): Computer start_byte and end_byte only after
1495 they're known to be in ptrdiff_t range.
1496 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
1497 (Ffont_get_glyphs, Ffont_at):
1498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1499 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
1500 (Flist_fonts, Fopen_font):
1501 Don't assume fixnum can fit in int.
1502 (check_gstring): Don't assume index can fit in int.
1503 (font_match_p): Check that fixnum is a character, not a nonnegative
1504 fixnum, since the later code needs to stuff it into an int.
1505 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
1506 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
1507 conversion overflow issues.
1508 (Fopen_font): Check for integer out of range.
1509 (Ffont_get_glyphs): Don't assume index can fit in int.
1510 * font.h: Adjust decls to match defn changes elsewhere.
1511 * fontset.c (reorder_font_vector): Redo score calculation to avoid
1512 integer overflow.
1513 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
1514 printmax_t, where ptrdiff_t is wide enough.
1515 (Finternal_char_font):
1516 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1517 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
1518 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
1519 (Fset_frame_position, x_set_frame_parameters)
1520 (x_set_line_spacing, x_set_border_width)
1521 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
1522 Check that fixnums are in proper range for system types.
1523 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
1524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1525 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
1526 Use SAFE_ALLOCA_LISP, not alloca.
1527 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
1528 intptr_t is wide enough.
1529 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
1530 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
1531 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
1532 Check for fixnum out of range.
1533 * ftfont.c (ftfont_list): Don't assume index fits in int.
1534 Check that fixnums are in proper range for system types.
1535 (ftfont_shape_by_flt):
1536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1537 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
1538 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1539 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
1540 Check that fixnums are in proper range for system types.
1541 * gnutls.h: Adjust decls to match defn changes elsewhere.
1542 * gtkutil.c (xg_dialog_run):
1543 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1544 (update_frame_tool_bar):
1545 Check that fixnums are in proper range for system types.
1546 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
1547 (lookup_image): Check that fixnums are in range for system types.
1548 * indent.c (last_known_column, last_known_column_point):
1549 (current_column_bol_cache):
1550 (skip_invisible, current_column, check_display_width):
1551 (check_display_width, scan_for_column, current_column_1)
1552 (Findent_to, Fcurrent_indentation, position_indentation)
1553 (indented_beyond_p, Fmove_to_column, compute_motion):
1554 (Fcompute_motion, Fvertical_motion):
1555 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1556 (last_known_column_modified): Use EMACS_INT, not int.
1557 (check_display_width):
1558 (Fcompute_motion):
1559 Check that fixnums and floats are in proper range for system types.
1560 (compute_motion): Don't assume index or fixnum fits in int.
1561 (compute_motion, Fcompute_motion):
1562 Use int, not EMACS_INT, when it is wide enough.
1563 (vmotion): Omit local var start_hpos that is always 0; that way
1564 we don't need to worry about overflow in expressions involving it.
1565 * indent.h: Adjust decls to match defn changes elsewhere.
1566 (struct position):
1567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1568 Use int, not EMACS_INT, where int is wide enough.
1569 Remove unused members ovstring_chars_done and tab_offset;
1570 all uses removed.
1571 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
1572 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
1573 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
1574 (make_gap, copy_text, insert, insert_and_inherit)
1575 (insert_before_markers, insert_before_markers_and_inherit)
1576 (insert_1, count_combining_before, count_combining_after)
1577 (insert_1_both, insert_from_string)
1578 (insert_from_string_before_markers, insert_from_string_1)
1579 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
1580 (adjust_after_replace, adjust_after_insert, replace_range)
1581 (replace_range_2, del_range, del_range_1, del_range_byte)
1582 (del_range_both, del_range_2, modify_region)
1583 (prepare_to_modify_buffer, signal_before_change)
1584 (signal_after_change, Fcombine_after_change_execute):
1585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1586 * intervals.c (traverse_intervals, rotate_right, rotate_left)
1587 (balance_an_interval, split_interval_right, split_interval_left)
1588 (find_interval, next_interval, update_interval)
1589 (adjust_intervals_for_insertion, delete_node, delete_interval)
1590 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1591 (static_offset_intervals, offset_intervals)
1592 (merge_interval_right, merge_interval_left, make_new_interval)
1593 (graft_intervals_into_buffer, temp_set_point_both)
1594 (temp_set_point, set_point, adjust_for_invis_intang)
1595 (set_point_both, move_if_not_intangible, get_property_and_range)
1596 (get_local_map, copy_intervals, copy_intervals_to_string)
1597 (compare_string_intervals, set_intervals_multibyte_1):
1598 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1599 * intervals.h: Adjust decls to match defn changes elsewhere.
1600 (struct interval):
1601 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1602 * keyboard.c (this_command_key_count, this_single_command_key_start)
1603 (before_command_key_count, before_command_echo_length, echo_now)
1604 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
1605 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
1606 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
1607 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
1608 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1609 (last_non_minibuf_size, last_point_position, echo_truncate)
1610 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
1611 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
1612 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
1613 (stuff_buffered_input):
1614 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1615 (last_auto_save, command_loop_1, read_char):
1616 Use EMACS_INT, not int, to avoid integer overflow.
1617 (record_char): Avoid overflow in total_keys computation.
1618 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
1619 * keyboard.h: Adjust decls to match defn changes elsewhere.
1620 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
1621 (Fkey_description, Fdescribe_vector, Flookup_key):
1622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1623 (click_position): New function, to check that positions are in range.
1624 (Fcurrent_active_maps):
1625 (describe_command):
1626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1627 (Faccessible_keymaps, Fkey_description):
1628 (preferred_sequence_p):
1629 Don't assume fixnum can fit into int.
1630 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
1631 Check for integer overflow in size calculations.
1632 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
1633 avoid mishandling large integers.
1634 * lisp.h: Adjust decls to match defn changes elsewhere.
1635 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
1636 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
1637 (struct Lisp_Marker):
1638 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1639 (clip_to_bounds): Now an inline function, moved here from editfns.c.
1640 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
1641 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
1642 All callers changed.
1643 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
1644 Assume the arg has valid form, since it always does.
1645 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
1646 unsigned integer system type.
1647 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
1648 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
1649 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1650 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
1651 (duration_to_sec_usec): New decl.
1652 * lread.c (read_from_string_index, read_from_string_index_byte)
1653 (read_from_string_limit, readchar, unreadchar, openp)
1654 (read_internal_start, read1, oblookup):
1655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1656 (Fload, readevalloop, Feval_buffer, Feval_region):
1657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1658 (openp): Check for out-of-range argument to 'access'.
1659 (read1): Use int, not EMACS_INT, where int is wide enough.
1660 Don't assume fixnum fits into int.
1661 Fix off-by-one error that can read outside a buffer.
1662 (read_filtered_event): Use duration_to_sec_usec
1663 to do proper overflow checking on durations.
1664 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
1665 in size calculation.
1666 (Fexecute_kbd_macro):
1667 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1668 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
1669 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
1670 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
1671 (set_marker_both, set_marker_restricted_both, marker_position)
1672 (marker_byte_position, Fbuffer_has_markers_at):
1673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1674 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
1675 * menu.c (ensure_menu_items): Rename from grow_menu_items.
1676 It now merely ensures that the menu is large enough, without
1677 necessarily growing it, as this avoids some integer overflow issues.
1678 All callers changed.
1679 (keymap_panes, parse_single_submenu, Fx_popup_menu):
1680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1681 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
1682 Use SAFE_ALLOCA_LISP, not alloca.
1683 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
1684 to EMACS_INT. Check that fixnums are in proper range for system types.
1685 * minibuf.c (minibuf_prompt_width, string_to_object)
1686 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
1687 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
1688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1689 (get_minibuffer, read_minibuf_unwind):
1690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1691 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
1692 this simplifies overflow checking. All callers changed.
1693 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
1694 (Ftest_completion):
1695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1696 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
1697 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
1698 Check that fixnums are in proper range for system types.
1699 (Fx_create_frame, Fx_show_tip):
1700 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1701 * nsfont.m (ns_findfonts, nsfont_list_family):
1702 Don't assume fixnum fits in long.
1703 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
1704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1705 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
1706 wide enough.
1707 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
1708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1709 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
1710 (PRINTDECLARE, PRINTPREPARE):
1711 (strout, print_string):
1712 (print, print_preprocess, print_check_string_charset_prop)
1713 (print_object):
1714 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1715 (PRINTDECLARE):
1716 (temp_output_buffer_setup, Fprin1_to_string, print_object):
1717 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1718 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
1719 (printchar, strout): Use xpalloc to catch size calculation overflow.
1720 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
1721 (print_error_message): Use SAFE_ALLOCA, not alloca.
1722 (print_object): Use int, not EMACS_INT, where int is wide enough.
1723 (print_depth, new_backquote_output, print_number_index):
1724 Use ptrdiff_t, not int, where int might not be wide enough.
1725 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
1726 (Fset_process_window_size, Fformat_network_address)
1727 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
1728 (sigchld_handler):
1729 Check that fixnums are in proper range for system types.
1730 (Fsignal_process): Simplify by avoiding a goto.
1731 Check for process-ids out of pid_t range rather than relying on
1732 undefined behavior.
1733 (process_tick, update_tick): Use EMACS_INT, not int.
1734 (Fformat_network_address, read_process_output, send_process)
1735 (Fprocess_send_region, status_notify):
1736 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1737 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
1738 (wait_reading_process_output, read_process_output, exec_sentinel):
1739 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1740 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
1741 (Faccept_process_output): Use duration_to_sec_usec to do proper
1742 overflow checking on durations.
1743 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
1744 Don't assume pid_t fits in int.
1745 * process.h (struct Lisp_Process): Members tick and update_tick
1746 are now of type EMACS_INT, not int.
1747 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
1748 configured --with-wide-int.
1749 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
1750 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
1751 * search.c (looking_at_1, string_match_1):
1752 (fast_string_match, fast_c_string_match_ignore_case)
1753 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
1754 (scan_newline, find_before_next_newline, search_command)
1755 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
1756 (set_search_regs, wordify):
1757 (Freplace_match):
1758 (Fmatch_data):
1759 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1760 (string_match_1, search_buffer, set_search_regs):
1761 (Fmatch_data):
1762 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1763 (wordify): Check for overflow in size calculation.
1764 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
1765 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
1766 Check that fixnums are in proper range for system types.
1767 * sound.c (struct sound_device)
1768 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
1769 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1770 (Fplay_sound_internal):
1771 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1772 * syntax.c (struct lisp_parse_state, find_start_modiff)
1773 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
1774 (Fparse_partial_sexp):
1775 Don't assume fixnums can fit in int.
1776 (struct lisp_parse_state, find_start_pos, find_start_value)
1777 (find_start_value_byte, find_start_begv)
1778 (update_syntax_table, char_quoted, dec_bytepos)
1779 (find_defun_start, prev_char_comend_first, back_comment):
1780 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
1781 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
1782 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1783 (Finternal_describe_syntax_value): Check that match_lisp is a
1784 character, not an integer, since the code stuffs it into int.
1785 (scan_words, scan_sexps_forward):
1786 Check that fixnums are in proper range for system types.
1787 (Fforward_word):
1788 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1789 (scan_sexps_forward):
1790 Use CHARACTERP, not INTEGERP, since the value must fit into int.
1791 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
1792 * syntax.h: Adjust decls to match defn changes elsewhere.
1793 (struct gl_state_s):
1794 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1795 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
1796 MOST_POSITIVE_FIXNUM.
1797 * sysdep.c (wait_for_termination_1, wait_for_termination)
1798 (interruptible_wait_for_termination, mkdir):
1799 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
1800 (emacs_read, emacs_write):
1801 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1802 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
1803 and double all fit in int.
1804 * term.c (set_tty_color_mode):
1805 Check that fixnums are in proper range for system types.
1806 * termhooks.h (struct input_event):
1807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1808 * textprop.c (validate_interval_range, interval_of)
1809 (Fadd_text_properties, set_text_properties_1)
1810 (Fremove_text_properties, Fremove_list_of_text_properties)
1811 (Ftext_property_any, Ftext_property_not_all)
1812 (copy_text_properties, text_property_list, extend_property_ranges)
1813 (verify_interval_modification):
1814 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1815 (Fnext_single_char_property_change)
1816 (Fprevious_single_char_property_change):
1817 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1818 (copy_text_properties):
1819 Check for integer overflow in index calculation.
1820 * undo.c (last_boundary_position, record_point, record_insert)
1821 (record_delete, record_marker_adjustment, record_change)
1822 (record_property_change):
1823 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1824 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
1825 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1826 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1827 (Fx_hide_tip, Fx_file_dialog):
1828 * w32menu.c (set_frame_menubar):
1829 Use ptrdiff_t, not int, for consistency with rest of code.
1830 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
1831 (select_window, Fdelete_other_windows_internal)
1832 (window_scroll_pixel_based, window_scroll_line_based)
1833 (Frecenter, Fset_window_configuration):
1834 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1835 (Fset_window_hscroll, run_window_configuration_change_hook)
1836 (set_window_buffer, temp_output_buffer_show, scroll_command)
1837 (Fscroll_other_window, Frecenter):
1838 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1839 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
1840 Don't assume fixnum fits in int.
1841 (Fset_window_scroll_bars):
1842 Check that fixnums are in proper range for system types.
1843 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
1844 (string_pos, c_string_pos, number_of_chars, init_iterator)
1845 (in_ellipses_for_invisible_text_p, init_from_display_pos)
1846 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
1847 (compute_display_string_end, handle_face_prop)
1848 (face_before_or_after_it_pos, handle_invisible_prop)
1849 (handle_display_prop, handle_display_spec, handle_single_display_spec)
1850 (display_prop_intangible_p, string_buffer_position_lim)
1851 (string_buffer_position, handle_composition_prop, load_overlay_strings)
1852 (get_overlay_strings_1, get_overlay_strings)
1853 (iterate_out_of_display_property, forward_to_next_line_start)
1854 (back_to_previous_visible_line_start, reseat, reseat_to_string)
1855 (get_next_display_element, set_iterator_to_next)
1856 (get_visually_first_element, compute_stop_pos_backwards)
1857 (handle_stop_backwards, next_element_from_buffer)
1858 (move_it_in_display_line_to, move_it_in_display_line)
1859 (move_it_to, move_it_vertically_backward, move_it_by_lines)
1860 (add_to_log, message_dolog, message_log_check_duplicate)
1861 (message2, message2_nolog, message3, message3_nolog
1862 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
1863 (current_message_1, truncate_echo_area, truncate_message_1)
1864 (set_message, set_message_1, store_mode_line_noprop)
1865 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
1866 (text_outside_line_unchanged_p, check_point_in_composition)
1867 (reconsider_clip_changes)
1868 (redisplay_internal, set_cursor_from_row, try_scrolling)
1869 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
1870 (redisplay_window, find_last_unchanged_at_beg_row)
1871 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
1872 (trailing_whitespace_p, find_row_edges, display_line)
1873 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
1874 (display_mode_element, store_mode_line_string)
1875 (pint2str, pint2hrstr, decode_mode_spec)
1876 (display_count_lines, display_string, draw_glyphs)
1877 (x_produce_glyphs, x_insert_glyphs)
1878 (rows_from_pos_range, mouse_face_from_buffer_pos)
1879 (fast_find_string_pos, mouse_face_from_string_pos)
1880 (note_mode_line_or_margin_highlight, note_mouse_highlight):
1881 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1882 (safe_call, init_from_display_pos, handle_fontified_prop)
1883 (handle_single_display_spec, load_overlay_strings)
1884 (with_echo_area_buffer, setup_echo_area_for_printing)
1885 (display_echo_area, echo_area_display)
1886 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
1887 (update_tool_bar, hscroll_window_tree, redisplay_internal)
1888 (redisplay_window, dump_glyph_row, display_mode_line)
1889 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
1890 (handle_display_spec, display_prop_string_p):
1891 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1892 (handle_single_display_spec, build_desired_tool_bar_string)
1893 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
1894 (get_specified_cursor_type):
1895 Check that fixnums are in proper range for system types.
1896 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
1897 (Flookup_image_map):
1898 Don't assume fixnums fit in int.
1899 (compare_overlay_entries):
1900 Avoid mishandling comparisons due to subtraction overflow.
1901 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
1902 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
1903 (handle_tool_bar_click):
1904 Use int, not unsigned, since we prefer signed and the signedness
1905 doesn't matter here.
1906 (get_next_display_element, next_element_from_display_vector):
1907 Use int, not EMACS_INT, when int is wide enough.
1908 (start_hourglass): Use duration_to_sec_usec to do proper
1909 overflow checking on durations.
1910 * xfaces.c (Fbitmap_spec_p):
1911 Check that fixnums are in proper range for system types.
1912 (compare_fonts_by_sort_order):
1913 Avoid mishandling comparisons due to subtraction overflow.
1914 (Fx_family_fonts, realize_basic_faces):
1915 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1916 (Fx_family_fonts):
1917 Don't assume fixnum fits in int.
1918 Use SAFE_ALLOCA_LISP, not alloca.
1919 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
1920 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
1921 (face_at_buffer_position, face_for_overlay_string)
1922 (face_at_string_position):
1923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1924 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
1925 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
1926 (Fx_show_tip):
1927 Check that fixnums are in proper range for system types.
1928 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1929 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
1930 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1931 (Fx_change_window_property): Don't assume fixnums fit in int.
1932 * xfont.c (xfont_chars_supported):
1933 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1934 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
1935 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
1936 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1937 * xml.c (parse_region):
1938 * xrdb.c (magic_file_p):
1939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1940 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
1941 (x_get_local_selection, x_reply_selection_request)
1942 (x_handle_selection_request, wait_for_property_change):
1943 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1944 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
1945 short is wide enough.
1946 (x_send_client_event): Don't assume fixnum fits in int.
1947 * xterm.c (x_x_to_emacs_modifiers):
1948 Don't assume EMACS_INT overflows nicely into int.
1949 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
1950 may come from Lisp.
1951 (handle_one_xevent): NATNUMP can eval its arg twice.
1952 (x_connection_closed):
1953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1954 * xterm.h: Adjust decls to match defn changes elsewhere.
1955 (struct scroll_bar): Use struct vectorlike_header
1956 rather than rolling our own approximation.
1957 (SCROLL_BAR_VEC_SIZE): Remove; not used.
1958
1959 2012-05-25 Glenn Morris <rgm@gnu.org>
1960
1961 * lisp.mk (lisp): Update for more files being compiled now.
1962
1963 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
1964
1965 * lread.c: Remove `read_pure' which makes no difference.
1966 (read_pure): Remove var.
1967 (unreadpure): Remove function.
1968 (readevalloop): Don't call read_list with -1 flag.
1969 (read1, read_vector): Don't test read_pure any more.
1970 (read_list): Simplify.
1971
1972 * fileio.c, character.h: Minor style tweaks.
1973
1974 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
1975
1976 * window.h (clip_changed): Remove useless declaration.
1977
1978 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
1979
1980 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
1981 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
1982
1983 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
1984
1985 Remove src/m/*.
1986 This directory predates autoconf and is no longer needed nowadays.
1987 Move its few remaining bits of functionality to where they're needed.
1988 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
1989 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
1990 * m/template.h: Remove.
1991 * Makefile.in (M_FILE): Remove. All uses removed.
1992 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
1993 * lisp.h (USE_LSB_TAG):
1994 * mem-limits.h (EXCEEDS_LISP_PTR):
1995 Use VAL_MAX, not VALBITS, in #if.
1996 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
1997 (EMACS_UINT): Define unconditionally now.
1998 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
1999 (BITS_PER_EMACS_INT): New constants, replacing
2000 what used to be in config.h, but not useful in #if.
2001 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
2002 define them any more.
2003 (VAL_MAX): New macro.
2004 (VALMASK): Use it.
2005 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
2006 BITS_PER_EMACS_INT, in #if.
2007 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2008 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
2009 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
2010 * s/ms-w32.h (DATA_START):
2011 Move here from removed file m/intel386.h.
2012 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
2013 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
2014
2015 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
2016
2017 Assume C89 or later.
2018 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
2019 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
2020 (xrealloc):
2021 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
2022 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
2023 * textprop.c, tparam.c (NULL): Remove.
2024 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
2025 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
2026 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
2027 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
2028 * xterm.c (input_signal_count): Assume volatile works.
2029
2030 2012-05-21 Ken Brown <kbrown@cornell.edu>
2031
2032 * xgselect.c (xg_select): Fix first argument in call to 'select'
2033 (bug#11508).
2034
2035 2012-05-20 Ken Brown <kbrown@cornell.edu>
2036
2037 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
2038 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
2039
2040 2012-05-19 Ken Brown <kbrown@cornell.edu>
2041
2042 * xfns.c (x_in_use): Remove `static' qualifier.
2043 * xterm.h (x_in_use): Declare.
2044 * xgselect.c: Include xterm.h.
2045 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
2046 and `display_arg' (bug#9754).
2047
2048 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
2049
2050 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
2051
2052 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
2053 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
2054
2055 2012-05-18 Eli Zaretskii <eliz@gnu.org>
2056
2057 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
2058
2059 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
2060 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
2061
2062 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
2063 reference to image_cache->refcount.
2064 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
2065
2066 2012-05-17 Juri Linkov <juri@jurta.org>
2067
2068 * search.c (Fword_search_regexp, Fword_search_backward)
2069 (Fword_search_forward, Fword_search_backward_lax)
2070 (Fword_search_forward_lax): Move functions to isearch.el
2071 (bug#10145, bug#11381).
2072
2073 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
2074
2075 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
2076
2077 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2078
2079 * lread.c (init_obarray): Declare Qt and Qnil as special.
2080
2081 2012-05-14 Glenn Morris <rgm@gnu.org>
2082
2083 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
2084 Put "libexec" before "bin", for the sake of init_callproc_1.
2085
2086 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2087
2088 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
2089
2090 * unexaix.c: Port to more-recent AIX compilers.
2091 (report_error, report_error_1, make_hdr, copy_sym)
2092 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
2093 Make arguments const char *, not char *, to avoid violations of C
2094 standard and to fix some AIX warnings reported by Gilles Pion.
2095
2096 2012-05-14 Eli Zaretskii <eliz@gnu.org>
2097
2098 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
2099 already have overlays loaded.
2100 (handle_single_display_spec): Before returning without displaying
2101 fringe bitmap, synchronize the bidi iterator with the main display
2102 iterator, by calling iterate_out_of_display_property.
2103 (iterate_out_of_display_property): Detect buffer iteration by
2104 testing that it->string is a Lisp string.
2105 (get_next_display_element): When the current object is exhausted,
2106 and there's something on it->stack, call set_iterator_to_next to
2107 proceed with what's on the stack, instead of returning zero.
2108 (set_iterator_to_next): If called at the end of a Lisp string,
2109 proceed to consider_string_end without incrementing string
2110 position. Don't increment display vector index past the end of
2111 the display vector. (Bug#11417)
2112 (pos_visible_p): Don't report a position visible when move_it_to
2113 stopped at the last line of window, which happens to be scanned
2114 backwards by the bidi iteration. (Bug#11464)
2115
2116 2012-05-14 Eli Zaretskii <eliz@gnu.org>
2117
2118 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
2119 and right-margin display specs even if the spec is invalid or we
2120 are on a TTY, and thus unable to display on the fringes.
2121 That's because the text with the property will not be displayed anyway,
2122 so we need to signal to the caller that this is a "replacing"
2123 display spec. This fixes display when the spec is invalid or we
2124 are on a TTY.
2125
2126 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2127
2128 * unexaix.c (make_hdr): Fix typo in prototype.
2129 This bug broke the build on AIX. Problem reported by Gilles Pion.
2130
2131 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
2132
2133 * keyboard.c (kbd_buffer_get_event): Read special events also in
2134 batch mode. (Bug#11415)
2135
2136 2012-05-12 Glenn Morris <rgm@gnu.org>
2137
2138 * ns.mk: Update for ns_appbindir no longer having trailing "/".
2139
2140 2012-05-12 Eli Zaretskii <eliz@gnu.org>
2141
2142 * lisp.mk (lisp): Add newcomment.elc.
2143
2144 2012-05-12 Glenn Morris <rgm@gnu.org>
2145
2146 * Makefile.in (MKDIR_P): New, set by configure.
2147 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
2148
2149 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
2150
2151 Remove unused function hourglass_started.
2152 * dispextern.h (hourglass_started):
2153 * w32fns.c (hourglass_started):
2154 * xdisp.c (hourglass_started): Remove.
2155
2156 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
2157
2158 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
2159 Update dependencies.
2160
2161 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
2162
2163 * xgselect.c (xg_select): Put maxfds+1 into a var.
2164 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
2165
2166 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
2167
2168 2012-05-10 Dave Abrahams <dave@boostpro.com>
2169
2170 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
2171 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
2172
2173 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
2174
2175 * dbusbind.c (xd_registered_buses): New internal Lisp object.
2176 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
2177 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
2178 Initialize xd_registered_buses.
2179
2180 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
2181
2182 Untag more efficiently if USE_LSB_TAG.
2183 This is based on a proposal by YAMAMOTO Mitsuharu in
2184 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
2185 For an admittedly artificial (nth 8000 longlist) benchmark on
2186 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
2187 Emacs's overall text size by 1%.
2188 * lisp.h (XUNTAG): New macro.
2189 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
2190 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
2191 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
2192 * eval.c (Fautoload):
2193 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
2194 * frame.h (XFRAME): Use XUNTAG.
2195
2196 Port recent dbusbind.c changes to 32-bit --with-wide-int.
2197 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
2198 Remove unportable assumptions about print widths of types like
2199 dbus_uint32_t.
2200 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
2201 intptr_t when converting between pointer and integer, to avoid GCC
2202 warnings about wrong width.
2203
2204 2012-05-09 Eli Zaretskii <eliz@gnu.org>
2205
2206 * w32proc.c (new_child): Force Windows to reserve only 64KB of
2207 stack for each reader_thread, instead of defaulting to 8MB
2208 determined by the linker. This avoids failures in creating
2209 subprocesses on Windows 7, see the discussion in this thread:
2210 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
2211
2212 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
2213
2214 Fix up display of the *Minibuf-0* buffer in the mini window.
2215 * keyboard.c (read_char): Don't clear the echo area if there's no
2216 message to clear.
2217 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2218 contents of *Minibuf-0*) if there's no message displayed in its stead.
2219
2220 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
2221
2222 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
2223 batch mode.
2224
2225 2012-05-06 Chong Yidong <cyd@gnu.org>
2226
2227 * lisp.mk (lisp): Update.
2228
2229 2012-05-05 Jim Meyering <meyering@redhat.com>
2230
2231 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
2232
2233 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2234
2235 * data.c (PUT_ERROR): New macro.
2236 (syms_of_data): Use it. Add new error type `user-error'.
2237 * undo.c (user_error): New function.
2238 (Fprimitive_undo): Use it.
2239 * print.c (print_error_message): Adjust print style for `user-error'.
2240 * keyboard.c (user_error): New function.
2241 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2242
2243 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
2244
2245 Do not limit current-time-string to years 1000..9999.
2246 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
2247 (Fcurrent_time_string): Support any year that is supported by the
2248 underlying localtime representation. Don't use asctime, as it
2249 has undefined behavior for years outside the range -999..9999.
2250
2251 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2252
2253 Fix race conditions involving setenv, gmtime, localtime, asctime.
2254 Without this fix, interrupts could mess up code that uses these
2255 nonreentrant functions, since setting TZ invalidates existing
2256 tm_zone or tzname values, and since most of these functions return
2257 pointers to static storage.
2258 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
2259 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
2260 Grow the critical sections to include not just invoking
2261 localtime/gmtime, but also accessing these functions' results
2262 including their tm_zone values if any, and any related TZ setting.
2263 (format_time_string): Last arg is now struct tm *, not struct tm **,
2264 so that the struct tm is saved in the critical section.
2265 All callers changed. Simplify allocation of initial buffer, partly
2266 motivated by the fact that memory allocation needs to be outside
2267 the critical section.
2268
2269 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2270
2271 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
2272 with RESET_INTERVAL.
2273
2274 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2275 Remove duplicated buffer name initialization.
2276
2277 2012-05-02 Jim Meyering <jim@meyering.net>
2278
2279 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
2280
2281 * xfns.c (x_window): Use xstrdup (Bug#11375).
2282
2283 2012-05-02 Eli Zaretskii <eliz@gnu.org>
2284
2285 * xdisp.c (pos_visible_p): If already at a newline from the
2286 display string before the 'while' loop, don't walk back the glyphs
2287 from it3.glyph_row. Solves assertion violation when the display
2288 string begins with a newline (egg.el). (Bug#11367)
2289
2290 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
2291
2292 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
2293 Move to simple.el.
2294
2295 2012-05-01 Glenn Morris <rgm@gnu.org>
2296
2297 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
2298 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
2299 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
2300 All were removed before 23.1.
2301
2302 * dispnew.c: Remove HAVE_LIBNCURSES test;
2303 it is always true on relevant platforms.
2304
2305 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
2306 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
2307
2308 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
2309
2310 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
2311
2312 * .gdbinit (xpr): Remove checks for no longer existing misc types.
2313 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
2314 Remove.
2315
2316 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
2317
2318 Do not avoid creating empty evaporating overlays (Bug#9642).
2319 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
2320 That is, do not delete an evaporating overlay if it becomes
2321 empty after its bounds are adjusted to fit within its buffer.
2322 This fix caused other problems, and I'm reverting it until we get
2323 to the bottom of them.
2324
2325 2012-04-27 Chong Yidong <cyd@gnu.org>
2326
2327 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
2328
2329 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2330
2331 * xdisp.c (pos_visible_p): If the window start position is beyond
2332 ZV, start the display from buffer beginning. Prevents assertion
2333 violation in init_iterator when the minibuffer window is scrolled
2334 via the scroll bar.
2335
2336 * window.c (window_scroll_pixel_based): Likewise.
2337
2338 2012-04-27 Chong Yidong <cyd@gnu.org>
2339
2340 * keymap.c (where_is_internal): Doc fix (Bug#10872).
2341
2342 2012-04-27 Glenn Morris <rgm@gnu.org>
2343
2344 * fileio.c (Fcopy_file, Fset_file_selinux_context):
2345 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
2346
2347 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2348
2349 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
2350 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
2351
2352 2012-04-26 Eli Zaretskii <eliz@gnu.org>
2353
2354 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
2355 display element, check also the underlying string or buffer
2356 character. (Bug#11341)
2357
2358 * w32menu.c: Include w32heap.h.
2359 (add_menu_item): If the call to AppendMenuW (via
2360 unicode_append_menu) fails, disable Unicode menus only if we are
2361 running on Windows 9X/Me.
2362
2363 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
2364
2365 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
2366 (xgetint): Add missing shift for LSB tags.
2367
2368 2012-04-24 Martin Rudalics <rudalics@gmx.at>
2369
2370 * keyboard.c (read_char): Don't wipe echo area for select window
2371 events: These might get delayed via `mouse-autoselect-window'
2372 (Bug#11304).
2373
2374 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
2375
2376 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
2377 manipulation of :loaded-from data.
2378
2379 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
2380
2381 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
2382 now a cons (bug#11311).
2383
2384 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
2385
2386 Do not create empty overlays with the evaporate property (Bug#9642).
2387 * buffer.c (Fmove_overlay): Delete an evaporating overlay
2388 if it becomes empty after its bounds are adjusted to fit within
2389 its buffer. Without this fix, in a nonempty buffer (let ((o
2390 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
2391 yields an empty overlay that has the evaporate property, which is
2392 not supposed to happen.
2393
2394 Fix minor GTK3 problems found by static checking.
2395 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2396 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2397 (struct _EmacsFixedClass, emacs_fixed_get_type):
2398 Move decls here from emacsgtkfixed.h, since they needn't be public.
2399 (emacs_fixed_get_type): Now static.
2400 (emacs_fixed_class_init): Omit unused local.
2401 (emacs_fixed_child_type): Remove; unused.
2402 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2403 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2404 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
2405 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
2406 (EMACS_FIXED_GET_CLASS): Remove; unused.
2407 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
2408
2409 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
2410 Problem reported by Juanma Barranquero for Windows -Wunused-function.
2411
2412 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2413
2414 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
2415 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
2416 (__malloc_size_t, __malloc_ptrdiff_t):
2417 Remove. All uses removed, replaced by the definiens if needed,
2418 since we can assume C89 or better now.
2419 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
2420 (protect_malloc_state, align, get_contiguous_space)
2421 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
2422 (malloc_atfork_handler_child, malloc_enable_thread)
2423 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
2424 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
2425 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
2426 (special_realloc, _realloc_internal_nolock, _realloc_internal)
2427 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
2428 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
2429 Define using prototypes, not old style.
2430 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
2431 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
2432 (align): Don't assume that signed integer overflow wraps around.
2433 Omit unused local var.
2434 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
2435 (_free_internal_nolock, memalign, mallochook, reallochook):
2436 Omit no-longer-needed casts.
2437 (valloc): Use getpagesize, not __getpagesize.
2438 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
2439 (struct hdr): The 'magic' member is now size_t, not unsigned long.
2440
2441 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
2442
2443 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
2444
2445 Move functions from C to Lisp. Make non-blocking method calls
2446 the default. Implement further D-Bus standard interfaces.
2447
2448 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
2449 (QCdbus_request_name_allow_replacement)
2450 (QCdbus_request_name_replace_existing)
2451 (QCdbus_request_name_do_not_queue)
2452 (QCdbus_request_name_reply_primary_owner)
2453 (QCdbus_request_name_reply_in_queue)
2454 (QCdbus_request_name_reply_exists)
2455 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
2456 (QCdbus_registered_serial, QCdbus_registered_method)
2457 (QCdbus_registered_signal): New Lisp objects.
2458 (XD_DEBUG_MESSAGE): Use sizeof.
2459 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
2460 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
2461 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
2462 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
2463 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
2464 (xd_signature, xd_append_arg): Allow float for integer types.
2465 (xd_get_connection_references): New function.
2466 (xd_get_connection_address): Rename from xd_initialize.
2467 Return cached address.
2468 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
2469 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
2470 level.
2471 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
2472 Return number of refcounts.
2473 (Fdbus_get_unique_name): Make stronger parameter check.
2474 (Fdbus_message_internal): New defun.
2475 (Fdbus_call_method, Fdbus_call_method_asynchronously)
2476 (Fdbus_method_return_internal, Fdbus_method_error_internal)
2477 (Fdbus_send_signal, Fdbus_register_service)
2478 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
2479 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
2480 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
2481 (Vdbus_compiled_version, Vdbus_runtime_version)
2482 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
2483 (Vdbus_message_type_method_return, Vdbus_message_type_error)
2484 (Vdbus_message_type_signal): New defvars.
2485 (Vdbus_registered_buses, Vdbus_registered_objects_table):
2486 Adapt docstring.
2487
2488 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2489
2490 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
2491 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
2492 Do not assume ptrdiff_t is the same width as 'int'.
2493
2494 * alloc.c: Handle unusual debugging option combinations.
2495 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
2496 since the two debugging options are incompatible.
2497 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
2498 is defined.
2499 (mem_init, mem_insert, mem_insert_fixup):
2500 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
2501 (NEED_MEM_INSERT): Remove; no longer needed.
2502
2503 2012-04-22 Leo Liu <sdl.web@gmail.com>
2504
2505 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
2506
2507 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2508
2509 * sysdep.c [__FreeBSD__]: Minor cleanups.
2510 (list_system_processes, system_process_attributes) [__FreeBSD__]:
2511 Use Emacs indenting style more consistently. Avoid some casts.
2512 Use 'double' consistently rather than mixing 'float' and 'double'.
2513
2514 2012-04-21 Eduard Wiebe <usenet@pusto.de>
2515
2516 * sysdep.c (list_system_processes, system_process_attributes):
2517 Add implementation for FreeBSD (Bug#5243).
2518
2519 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
2520
2521 * lisp.mk (lisp): Update.
2522
2523 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
2524
2525 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
2526 It is never used otherwise.
2527
2528 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
2529
2530 * print.c (print_preprocess): Only check print_depth if print-circle
2531 is nil.
2532 (print_object): Check for cycles even when print-circle is nil and
2533 print-gensym is t, but only check print_depth if print-circle is nil.
2534
2535 2012-04-20 Chong Yidong <cyd@gnu.org>
2536
2537 * process.c (wait_reading_process_output): If EIO occurs on a pty,
2538 set the status to "failed" and ensure that sentinel is run.
2539
2540 2012-04-20 Glenn Morris <rgm@gnu.org>
2541
2542 * process.c (Fset_process_inherit_coding_system_flag)
2543 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
2544 (Fmake_network_process, Fmake_serial_process): Doc fix.
2545
2546 2012-04-20 Eli Zaretskii <eliz@gnu.org>
2547
2548 * xdisp.c (string_buffer_position_lim): Limit starting position to
2549 BEGV.
2550 (set_cursor_from_row): If called for a mode-line or header-line
2551 row, return zero immediately.
2552 (try_cursor_movement): If inside continuation line, don't back up
2553 farther than the first row after the header line, if any.
2554 Don't consider the header-line row as "partially visible", even if
2555 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
2556
2557 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
2558
2559 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
2560 (bug#11238).
2561
2562 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
2563 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
2564
2565 configure: new option --enable-gcc-warnings (Bug#11207)
2566 * Makefile.in (C_WARNINGS_SWITCH): Remove.
2567 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
2568 (ALL_CFLAGS): Use new macros rather than old.
2569 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
2570 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
2571 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
2572 -Wunused-result, -Wunused-variable. This should go away once
2573 the Emacs and Gnulib regex code is merged.
2574 (xmalloc, xrealloc): Now static.
2575
2576 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
2577
2578 * dired.c (Fsystem_groups): Remove unused local.
2579
2580 2012-04-17 Glenn Morris <rgm@gnu.org>
2581
2582 * dired.c (Fsystem_users): Doc fix.
2583
2584 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
2585
2586 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
2587 (syms_of_dired): Add them.
2588
2589 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
2590
2591 Fix minor alloc.c problems found by static checking.
2592 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
2593 New extern decls, to avoid calling undeclared functions.
2594 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
2595 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
2596 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
2597 (NEED_MEM_INSERT): New macro.
2598 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
2599 Remove one incorrect comment and fix another.
2600
2601 Fix minor ralloc.c problems found by static checking.
2602 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2603 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
2604 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
2605 (r_alloc_sbrk): Now static.
2606
2607 Improve ralloc.c interface checking.
2608 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2609 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
2610 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
2611 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
2612 [REL_ALLOC]: ... to here, to check interface.
2613 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
2614 Remove decls. This fixes an "It stinks!".
2615
2616 * alloc.c (which_symbols): Fix alignment issue / type clash.
2617
2618 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
2619
2620 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
2621 (struct Lisp_Misc_Any): Likewise.
2622 (struct Lisp_Free): Likewise.
2623 * alloc.c (union aligned_Lisp_Symbol): Define.
2624 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
2625 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
2626 (union aligned_Lisp_Misc): Define.
2627 (MARKER_BLOCK_SIZE, struct marker_block): Use union
2628 aligned_Lisp_Misc instead of union Lisp_Misc.
2629 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
2630
2631 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
2632
2633 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
2634 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
2635 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
2636 * s/netbsd.h, s/sol2-6.h:
2637 Remove definition of GC_MARK_STACK, since the default now works.
2638 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
2639 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
2640 no longer the default.
2641 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
2642
2643 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
2644
2645 * lread.c (lisp_file_lexically_bound_p):
2646 Fix hang at ";-*-\n" (bug#11238).
2647
2648 2012-04-14 Eli Zaretskii <eliz@gnu.org>
2649
2650 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
2651 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
2652
2653 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
2654
2655 * nsterm.m (constrainFrameRect): Always constrain when there is only
2656 one screen (Bug#10962).
2657
2658 2012-04-13 Ken Brown <kbrown@cornell.edu>
2659
2660 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
2661
2662 2012-04-13 Reuben Thomas <rrt@sc3d.org>
2663
2664 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
2665
2666 2012-04-11 Daniel Colascione <dancol@dancol.org>
2667
2668 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
2669 against is gone. It's better to use vfork now so that when Cygwin
2670 gains a new, working vfork, we use it automatically (bug#10398).
2671
2672 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2673
2674 * window.c (save_window_save): Obey window-point-insertion-type.
2675
2676 2012-04-11 Glenn Morris <rgm@gnu.org>
2677
2678 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
2679
2680 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2681
2682 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
2683
2684 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
2685
2686 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
2687 (force_quit_count): New var.
2688 (handle_interrupt): Use it.
2689
2690 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
2691
2692 * w32.c (w32_delayed_load): Record the full path of the library
2693 being loaded (bug#10424).
2694
2695 2012-04-09 Glenn Morris <rgm@gnu.org>
2696
2697 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
2698 not just in the obarray, before snarfing them. (Bug#11036)
2699
2700 * Makefile.in ($(leimdir)/leim-list.el):
2701 Pass EMACS rather than BUILT_EMACS.
2702
2703 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
2704
2705 * process.c (make_process):
2706 * process.h: Add integer `gnutls_handshakes_tried' member to
2707 process struct.
2708
2709 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
2710 Add convenience `GNUTLS_LOG2i' macro.
2711
2712 * gnutls.c (gnutls_log_function2i): Convenience log function.
2713 (emacs_gnutls_read): Use new log functions,
2714 `gnutls_handshakes_tried' process member, and
2715 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
2716 attempts per process (connection).
2717
2718 2012-04-09 Chong Yidong <cyd@gnu.org>
2719
2720 * eval.c (Fuser_variable_p, user_variable_p_eh)
2721 (lisp_indirect_variable): Functions deleted.
2722 (Fdefvar): Caller changed.
2723
2724 * callint.c (Finteractive, Fcall_interactively):
2725 * minibuf.c (Fread_variable): Callers changed.
2726
2727 2012-04-09 Eli Zaretskii <eliz@gnu.org>
2728
2729 * xdisp.c (set_cursor_from_row): If the display string appears in
2730 the buffer at position that is closer to point than the position
2731 after the display string, display the cursor on the first glyph of
2732 the display string. Fixes cursor display when a 'display' text
2733 property immediately follows invisible text. (Bug#11094)
2734
2735 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
2736
2737 composite.c: use 'double' consistently
2738 * composite.c (get_composition_id): Use 'double' consistently
2739 instead of converting 'float' to 'double' and vice versa; this is
2740 easier to understand and avoids a GCC warning.
2741
2742 2012-04-09 Glenn Morris <rgm@gnu.org>
2743
2744 * Makefile.in: Generate leim-list with bootstrap-emacs, in
2745 preparation for dumping it with emacs. (Bug#4789)
2746 (leimdir): New variable.
2747 ($(leimdir)/leim-list.el): New rule.
2748 (emacs$(EXEEXT)): Depend on leim-list.el.
2749
2750 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
2751 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
2752 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
2753
2754 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
2755
2756 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
2757 proper alignment.
2758
2759 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
2760
2761 * xml.c (init_libxml2_functions) [WINDOWSNT]:
2762 Remove unused local variable.
2763
2764 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2765
2766 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
2767 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
2768 (mark_memory): Mark Lisp_Objects only if pointers might hide in
2769 objects, as mark_maybe_pointer will catch them otherwise.
2770 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
2771 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
2772
2773 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2774
2775 Fix typo that broke non-Windows builds.
2776 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
2777
2778 2012-04-07 Eli Zaretskii <eliz@gnu.org>
2779
2780 Support building on MS-Windows with libxml2.
2781
2782 * makefile.w32-in (OBJ2): Add xml.$(O).
2783 (GLOBAL_SOURCES): Add xml.c.
2784 ($(BLD)/xml.$(O)): New dependency list.
2785
2786 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
2787 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
2788 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
2789 [!WINDOWSNT]: New macros.
2790 (init_libxml2_functions, libxml2_loaded_p): New functions.
2791 (parse_region): Call fn_xmlCheckVersion instead of using the macro
2792 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
2793 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
2794 Calls xmlCleanupParser only if libxml2 was loaded (or statically
2795 linked in).
2796 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
2797 Call init_libxml2_functions before calling libxml2 functions.
2798 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
2799
2800 * emacs.c: Don't include libxml/parser.h.
2801 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
2802 xmlCleanupParser directly.
2803
2804 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
2805
2806 2012-04-07 Eli Zaretskii <eliz@gnu.org>
2807
2808 * indent.c (Fvertical_motion): If there is a display string at
2809 point, use it.vpos to compute how many lines to backtrack after
2810 move_it_to point. (Bug#11133)
2811
2812 2012-04-06 Eli Zaretskii <eliz@gnu.org>
2813
2814 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
2815 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
2816 about subtle differences between FETCH_CHAR* and STRING_CHAR*
2817 macros related to unification of CJK characters. For the details,
2818 see the discussion following the message here:
2819 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
2820
2821 2012-04-04 Chong Yidong <cyd@gnu.org>
2822
2823 * keyboard.c (Vdelayed_warnings_list): Doc fix.
2824
2825 2012-04-01 Eli Zaretskii <eliz@gnu.org>
2826
2827 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
2828 instead of alloca. (Bug#11138)
2829
2830 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
2831
2832 * w32menu.c (is_simple_dialog): Properly check lisp types.
2833 (Bug#11141)
2834
2835 2012-03-31 Eli Zaretskii <eliz@gnu.org>
2836
2837 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
2838 position we get to after a call to move_it_to fails the
2839 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
2840 only if we wind up in a string from display property. (Bug#11063)
2841
2842 * window.c (Fdelete_other_windows_internal): Invalidate the row
2843 and column information about mouse highlight, so that redisplay
2844 restores it after reallocating the glyph matrices. (Bug#7464)
2845
2846 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
2847 string comes from a `display' text property, use the buffer
2848 position of that property as if we actually saw that position in
2849 the row's glyphs.
2850 (move_it_by_lines): Remove the assertion that
2851 "it->current_x == 0 && it->hpos == 0" which can be legitimately
2852 violated when there's a before-string at the beginning of a line.
2853 (Bug#11063)
2854
2855 2012-03-30 Eli Zaretskii <eliz@gnu.org>
2856
2857 * xdisp.c (append_space_for_newline): If the default face was
2858 remapped, use the remapped face for the appended newline.
2859 (extend_face_to_end_of_line): Use the remapped default face for
2860 extending the face to the end of the line.
2861 (display_line): Call extend_face_to_end_of_line when the default
2862 face was remapped. (Bug#11068)
2863
2864 2012-03-29 Eli Zaretskii <eliz@gnu.org>
2865
2866 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
2867
2868 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
2869
2870 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
2871
2872 2012-03-27 Glenn Morris <rgm@gnu.org>
2873
2874 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
2875 Doc fixes.
2876
2877 2012-03-26 Kenichi Handa <handa@m17n.org>
2878
2879 * dispextern.h (struct glyph): Fix previous change. Change the
2880 bit length of glyphless.ch to 25 (Bug#11082).
2881
2882 2012-03-26 Chong Yidong <cyd@gnu.org>
2883
2884 * keyboard.c (Vselection_inhibit_update_commands): New variable.
2885 (command_loop_1): Use it; inhibit selection update for
2886 handle-select-window too (Bug#8996).
2887
2888 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
2889
2890 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
2891
2892 2012-03-25 Kenichi Handa <handa@m17n.org>
2893
2894 * dispextern.h (struct glyph): Change the bit length of
2895 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
2896
2897 2012-03-24 Eli Zaretskii <eliz@gnu.org>
2898
2899 * s/ms-w32.h (tzname): Include time.h before redirecting to
2900 _tzname. Fixes the MSVC build. (Bug#9960)
2901
2902 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
2903
2904 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
2905 characters.
2906
2907 * xterm.c (XTread_socket): Only modify handling_signal if
2908 !SYNC_INPUT. (Bug#11080)
2909
2910 2012-03-23 Eli Zaretskii <eliz@gnu.org>
2911
2912 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
2913 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
2914 when fetching a multibyte character consumes more bytes than
2915 CHAR_BYTES returns, due to unification of CJK characters in
2916 string_char. (Bug#11073)
2917
2918 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
2919
2920 * process.c (wait_reading_process_output): Handle pty disconnect
2921 by refraining from sending oneself a SIGCHLD (bug#10933).
2922
2923 2012-03-22 Chong Yidong <cyd@gnu.org>
2924
2925 * dispextern.h (struct it): New member string_from_prefix_prop_p.
2926
2927 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
2928 Mark string as coming from a prefix property.
2929 (handle_face_prop): Use default face for prefix strings (Bug#4281).
2930 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
2931
2932 2012-03-21 Chong Yidong <cyd@gnu.org>
2933
2934 * xfaces.c (Vface_remapping_alist): Doc fix.
2935
2936 2012-03-20 Eli Zaretskii <eliz@gnu.org>
2937
2938 * w32proc.c (Fw32_set_console_codepage)
2939 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
2940 Doc fixes.
2941
2942 2012-03-20 Chong Yidong <cyd@gnu.org>
2943
2944 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
2945 to reflect default non-nil value of redisplay-dont-pause.
2946
2947 2012-03-19 Kenichi Handa <handa@m17n.org>
2948
2949 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
2950 it fit in a valid range (Bug#11003).
2951
2952 2012-03-18 Eli Zaretskii <eliz@gnu.org>
2953
2954 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
2955 that is not from display property, accept the row as a "cursor
2956 row" if one of the string's character has a non-nil `cursor'
2957 property. Fixes cursor positioning when there are newlines in
2958 overlay strings, e.g. in icomplete.el. (Bug#11035)
2959
2960 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
2961
2962 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
2963
2964 2012-03-12 Chong Yidong <cyd@gnu.org>
2965
2966 * eval.c (inhibit_lisp_code): Rename from
2967 inhibit_window_configuration_change_hook; move from window.c.
2968
2969 * xfns.c (unwind_create_frame_1, Fx_create_frame):
2970 * window.c (run_window_configuration_change_hook)
2971 (syms_of_window): Callers changed.
2972
2973 2012-03-11 Chong Yidong <cyd@gnu.org>
2974
2975 * keymap.c (Fkey_description): Doc fix (Bug#9700).
2976
2977 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
2978
2979 2012-03-10 Chong Yidong <cyd@gnu.org>
2980
2981 * frame.c (other_visible_frames): Don't assume the selected frame
2982 is visible (Bug#10955).
2983
2984 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
2985
2986 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
2987
2988 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
2989
2990 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
2991 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
2992 zero (Bug#10954).
2993
2994 2012-03-03 Glenn Morris <rgm@gnu.org>
2995
2996 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
2997
2998 2012-03-02 Eli Zaretskii <eliz@gnu.org>
2999
3000 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
3001 position past the first glyph_row that ends at ZV. (Bug#10902)
3002 (redisplay_window, next_element_from_string): Fix typos in
3003 comments.
3004 (redisplay_window): Pass to move_it_vertically the margin in
3005 pixels, not in screen lines.
3006
3007 2012-03-02 Glenn Morris <rgm@gnu.org>
3008
3009 * buffer.c (buffer-list-update-hook): Doc fix.
3010
3011 2012-02-29 Eli Zaretskii <eliz@gnu.org>
3012
3013 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
3014 push_it before setting up the iterator for the first overlay
3015 string, even if we have an empty string loaded.
3016 (next_overlay_string): If there's an empty string on the iterator
3017 stack, pop the stack. (Bug#10903)
3018
3019 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
3020
3021 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
3022 Suggested by Stefan Monnier in
3023 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
3024 * alloc.c (widen_to_Lisp_Object): New static function.
3025 (mark_memory): Also mark Lisp_Objects by fetching pointer words
3026 and widening them to Lisp_Objects. This would work even if
3027 USE_LSB_TAG is defined and wide integers are used, which might
3028 happen in a future version of Emacs.
3029
3030 2012-02-25 Chong Yidong <cyd@gnu.org>
3031
3032 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
3033 Doc fix.
3034
3035 * xselect.c (Fx_selection_exists_p): Doc fix.
3036 (x_clipboard_manager_save_all): Print an informative message
3037 before saving to clipboard manager.
3038
3039 2012-02-24 Chong Yidong <cyd@gnu.org>
3040
3041 * keyboard.c (process_special_events): Handle all X selection
3042 requests in kbd_buffer, not just the next one (Bug#8869).
3043
3044 2012-02-23 Chong Yidong <cyd@gnu.org>
3045
3046 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
3047 call when setting menu-bar-lines and tool-bar-lines parameters.
3048 (unwind_create_frame_1): New helper function.
3049
3050 * window.c (inhibit_window_configuration_change_hook): New var.
3051 (run_window_configuration_change_hook): Obey it.
3052 (syms_of_window): Initialize it.
3053
3054 2012-02-22 Chong Yidong <cyd@gnu.org>
3055
3056 * xterm.c (x_draw_image_relief): Add missing type check for
3057 Vtool_bar_button_margin (Bug#10743).
3058
3059 2012-02-21 Chong Yidong <cyd@gnu.org>
3060
3061 * fileio.c (Vfile_name_handler_alist): Doc fix.
3062
3063 * buffer.c (Fget_file_buffer): Protect against invalid file
3064 handler return value.
3065
3066 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
3067
3068 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
3069 when computing $valmask.
3070
3071 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
3072 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
3073 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
3074 It's useless in that case, and it can cause problems on hosts
3075 that allocate halves of EMACS_INT values separately.
3076 Reported by Dan Horák. Diagnosed by Andreas Schwab in
3077 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
3078 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
3079 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
3080 it avoids undefined behavior on hosts where shifting right by more
3081 than the word width has undefined behavior.
3082
3083 2012-02-19 Chong Yidong <cyd@gnu.org>
3084
3085 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
3086 (Funhandled_file_name_directory, Ffile_name_as_directory)
3087 (Fdirectory_file_name, Fexpand_file_name)
3088 (Fsubstitute_in_file_name): Protect against invalid file handler
3089 return values (Bug#10845).
3090
3091 2012-02-18 Eli Zaretskii <eliz@gnu.org>
3092
3093 * .gdbinit (pitx): Fix incorrect references to fields of the
3094 iterator stack.
3095
3096 2012-02-17 Chong Yidong <cyd@gnu.org>
3097
3098 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
3099
3100 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
3103 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
3104
3105 2012-02-15 Chong Yidong <cyd@gnu.org>
3106
3107 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
3108 marked as special. Also, starting docstrings with * is obsolete.
3109
3110 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
3111
3112 * gnutls.c (emacs_gnutls_write): Fix last change.
3113
3114 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
3115
3116 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
3117 send_process.
3118
3119 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
3120
3121 * keymap.c (Fsingle_key_description): Handle char ranges.
3122
3123 2012-02-12 Chong Yidong <cyd@gnu.org>
3124
3125 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
3126 as that creates a dangerous corner case.
3127
3128 * window.c (Fdelete_window_internal): Invalidate the mouse
3129 highlight (Bug#9904).
3130
3131 2012-02-12 Glenn Morris <rgm@gnu.org>
3132
3133 * xselect.c (Fx_own_selection_internal)
3134 (Fx_get_selection_internal, Fx_disown_selection_internal)
3135 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
3136 * nsselect.m (Fx_own_selection_internal)
3137 (Fx_disown_selection_internal, Fx_selection_exists_p)
3138 (Fx_selection_owner_p, Fx_get_selection_internal):
3139 Sync docs and argument specs with the xselect.c versions.
3140
3141 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
3142
3143 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
3144
3145 2012-02-11 Eli Zaretskii <eliz@gnu.org>
3146
3147 * w32select.c (Fx_selection_exists_p): Sync doc string and
3148 argument list with xselect.c. (Bug#10783)
3149
3150 * w16select.c (Fx_selection_exists_p): Sync doc string and
3151 argument list with xselect.c. (Bug#10783)
3152
3153 2012-02-10 Glenn Morris <rgm@gnu.org>
3154
3155 * fns.c (Fsecure_hash): Doc fix.
3156
3157 2012-02-09 Kenichi Handa <handa@m17n.org>
3158
3159 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
3160
3161 2012-02-07 Chong Yidong <cyd@gnu.org>
3162
3163 * buffer.c (Fbuffer_local_variables)
3164 (buffer_lisp_local_variables): Handle unbound vars correctly;
3165 don't let Qunbound leak into Lisp.
3166
3167 2012-02-07 Glenn Morris <rgm@gnu.org>
3168
3169 * image.c (Fimagemagick_types): Doc fix.
3170
3171 * image.c (imagemagick-render-type): Change it from a lisp object
3172 to an integer. Move the doc here from the lisp manual.
3173 Treat all values not equal to 0 the same.
3174
3175 2012-02-06 Chong Yidong <cyd@gnu.org>
3176
3177 * doc.c (store_function_docstring): Avoid applying docstring of
3178 alias to base function (Bug#2603).
3179
3180 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
3181
3182 * .gdbinit (pp1, pv1): Remove redundant defines.
3183 (pr): Use pp.
3184
3185 2012-02-04 Chong Yidong <cyd@gnu.org>
3186
3187 * nsterm.m: Declare a global (Bug#10694).
3188
3189 2012-02-04 Eli Zaretskii <eliz@gnu.org>
3190
3191 * w32.c (get_emacs_configuration_options):
3192 Include --enable-checking, if specified, in the return value.
3193
3194 2012-02-04 Martin Rudalics <rudalics@gmx.at>
3195
3196 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
3197 after rounding frame sizes. (Bug#9723)
3198
3199 2012-02-04 Eli Zaretskii <eliz@gnu.org>
3200
3201 * keyboard.c (adjust_point_for_property): Don't position point
3202 before BEGV. (Bug#10696)
3203
3204 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
3205
3206 Handle overflow when computing char display width (Bug#9496).
3207 * character.c (char_width): Return EMACS_INT, not int.
3208 (char_width, c_string_width): Check for overflow when
3209 computing the width; this is possible now that individual
3210 characters can have unbounded width. Problem introduced
3211 by merge from Emacs 23 on 2012-01-19.
3212
3213 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
3214
3215 * dbusbind.c (Fdbus_register_method): Mention the return value
3216 :ignore in the docstring.
3217
3218 2012-02-02 Glenn Morris <rgm@gnu.org>
3219
3220 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
3221
3222 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3223 Unconditionally set to t. (Bug#10673)
3224 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3225 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3226 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
3227
3228 2012-02-02 Kenichi Handa <handa@m17n.org>
3229
3230 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
3231 0, do not call append_composite_glyph.
3232
3233 2012-02-02 Kenichi Handa <handa@m17n.org>
3234
3235 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
3236 NULL (Bug#6988).
3237 (x_produce_glyphs): If the component of a composition is a null
3238 string, set it->pixel_width to 1 to avoid zero-width glyph.
3239
3240 2012-02-01 Eli Zaretskii <eliz@gnu.org>
3241
3242 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
3243 first 2 arguments are identical. This makes inserting large
3244 output from a subprocess an order of magnitude faster on
3245 MS-Windows, where all sbrk'ed memory is always contiguous.
3246
3247 2012-01-31 Glenn Morris <rgm@gnu.org>
3248
3249 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3250 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3251 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
3252
3253 2012-01-29 Glenn Morris <rgm@gnu.org>
3254
3255 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
3256
3257 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
3258
3259 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
3260
3261 2012-01-28 Chong Yidong <cyd@gnu.org>
3262
3263 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
3264
3265 2012-01-26 Chong Yidong <cyd@gnu.org>
3266
3267 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
3268
3269 * search.c (Fsearch_forward, Fsearch_backward): Document negative
3270 repeat counts (Bug#10507).
3271
3272 2012-01-26 Glenn Morris <rgm@gnu.org>
3273
3274 * lread.c (syms_of_lread): Doc fix.
3275
3276 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
3277
3278 * coding.c (encode_designation_at_bol): Change return value to
3279 EMACS_INT.
3280
3281 2012-01-25 Chong Yidong <cyd@gnu.org>
3282
3283 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
3284
3285 2012-01-21 Chong Yidong <cyd@gnu.org>
3286
3287 * floatfns.c (Fcopysign): Make the second argument non-optional,
3288 since nil is not allowed anyway.
3289
3290 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
3291
3292 * process.c (read_process_output): Use p instead of XPROCESS (proc).
3293 (send_process): Likewise.
3294
3295 2012-01-19 Martin Rudalics <rudalics@gmx.at>
3296
3297 * window.c (save_window_save, Fcurrent_window_configuration)
3298 (Vwindow_persistent_parameters): Do not use Qstate.
3299 Rewrite doc-strings.
3300
3301 2012-01-19 Kenichi Handa <handa@m17n.org>
3302
3303 * character.c (char_width): New function.
3304 (Fchar_width, c_string_width, lisp_string_width):
3305 Use char_width (Bug#9496).
3306
3307 2012-01-16 Martin Rudalics <rudalics@gmx.at>
3308
3309 * window.c (Vwindow_persistent_parameters): New variable.
3310 (Fset_window_configuration, save_window_save): Handle persistent
3311 window parameters.
3312
3313 2012-01-14 Eli Zaretskii <eliz@gnu.org>
3314
3315 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
3316 thrashing the stack of the thread. (Bug#9087)
3317
3318 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
3319
3320 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
3321
3322 2012-01-11 Eli Zaretskii <eliz@gnu.org>
3323
3324 * xdisp.c (rows_from_pos_range): Handle the case where the
3325 highlight ends on a newline. (Bug#10464)
3326 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
3327 he end column for display of highlight that ends on a newline
3328 before a R2L line.
3329
3330 2012-01-11 Glenn Morris <rgm@gnu.org>
3331
3332 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
3333 from load-path also when installation-directory is nil. (Bug#10208)
3334
3335 2012-01-10 Glenn Morris <rgm@gnu.org>
3336
3337 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
3338
3339 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
3340 Update template values to be closer to their typical values these days.
3341
3342 2012-01-09 Eli Zaretskii <eliz@gnu.org>
3343
3344 * xdisp.c (rows_from_pos_range): Accept additional argument
3345 DISP_STRING, and accept any glyph in a row whose object is that
3346 string as eligible for mouse highlight. Fixes mouse highlight of
3347 display strings from overlays. (Bug#10464)
3348
3349 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
3350
3351 emacs: fix an auto-save permissions race condition (Bug#10400)
3352 * fileio.c (auto_saving_dir_umask): New static var.
3353 (Fmake_directory_internal): Use it.
3354 (do_auto_save_make_dir): Set it, instead of invoking chmod after
3355 creating the directory. The old code temporarily assigns
3356 too-generous permissions to the directory.
3357 (do_auto_save_eh): Clear it.
3358 (Fdo_auto_save): Catch all errors, not just file errors, so
3359 that the var is always cleared.
3360
3361 2012-01-07 Eli Zaretskii <eliz@gnu.org>
3362
3363 * search.c (scan_buffer): Pass character positions to
3364 know_region_cache, not byte positions. (Bug#6540)
3365
3366 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
3367
3368 * w32.c (sys_rename): Report EXDEV when rename of a directory
3369 fails because the target is on another logical disk. (Bug#10284)
3370
3371 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
3372
3373 * xterm.c (x_embed_request_focus): New function.
3374
3375 * xterm.h: Add prototype.
3376
3377 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
3378
3379 2012-01-05 Glenn Morris <rgm@gnu.org>
3380
3381 * emacs.c (emacs_copyright): Update short copyright year to 2012.
3382
3383 2012-01-01 Eli Zaretskii <eliz@gnu.org>
3384
3385 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
3386 Load gnutls_transport_set_lowat only if GnuTLS version is below
3387 2.11.1.
3388 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
3389 GnuTLS versions below 2.11.1.
3390
3391 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
3392
3393 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
3394 to the doc string advising against its use for altering the way
3395 windows are scrolled.
3396
3397 2011-12-28 Kenichi Handa <handa@m17n.org>
3398
3399 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
3400 coding-system ASCII compatible only when it does not produce BOM
3401 on encoding (Bug#10383).
3402
3403 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
3404
3405 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
3406 can scroll.
3407 (create_and_show_popup_menu): Always use menu_position_func for
3408 Gtk3 (Bug#10361).
3409
3410 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
3411
3412 * callint.c (Fcall_interactively): Don't truncate prompt string.
3413
3414 2011-12-23 Eli Zaretskii <eliz@gnu.org>
3415
3416 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
3417 property that ends at ZV, so that the bidi iteration could be
3418 resumed from there (after widening). (Bug#10360)
3419
3420 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
3421
3422 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
3423
3424 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
3425
3426 * nsterm.m (x_free_frame_resources):
3427 Release f->output_data.ns->miniimage.
3428 (ns_index_color): Fix indentation. Do not retain
3429 color_table->colors[i].
3430
3431 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
3432 before returning.
3433
3434 * nsfns.m (x_set_background_color): Assign return value from
3435 ns_index_color to face-background instead of NSColor*.
3436 (ns_implicitly_set_icon_type): Fix indentation.
3437 Change assignment in for loop to comparison.
3438
3439 * emacs.c (ns_pool): New variable.
3440 (main): Assign ns_pool.
3441 (Fkill_emacs): Call ns_release_autorelease_pool.
3442
3443 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
3444 autorelease fdesc, release fdAttrs and tdict.
3445 (ns_get_covering_families): Release charset.
3446 (ns_findfonts): Release NSFontDescriptor created with new.
3447 (ns_uni_to_glyphs): Fix indentation.
3448 (setString): Release attrStr before assigning new value.
3449
3450 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3451
3452 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
3453 and NS_IMPL_COCOA.
3454 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
3455 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
3456
3457 2011-12-18 David Reitter <reitter@cmu.edu>
3458
3459 * nsterm.m (ns_term_init): Subscribe for notifications
3460 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
3461 to method trackingNotification in EmacsMenu.
3462
3463 * nsmenu.m (trackingMenu): New variable.
3464 (trackingNotification): New method (from Aquamacs).
3465 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3466 from Aquamacs (Bug#7030).
3467
3468 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3469
3470 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
3471 (symbol_to_nsstring): Fix indentation.
3472 (ns_symbol_to_pb): New function.
3473 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
3474 (Fns_rotate_cut_buffers_internal): Remove.
3475 (Fns_store_selection_internal): Rename from
3476 Fns_store_cut_buffer_internal.
3477 (ns_get_foreign_selection, Fx_own_selection_internal)
3478 (Fx_disown_selection_internal, Fx_selection_exists_p)
3479 (Fns_get_selection_internal, Fns_store_selection_internal):
3480 Use ns_symbol_to_pb and check if return value is nil.
3481 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
3482 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
3483 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
3484 renamed to Sns_store_selection_internal.
3485 (ns_handle_selection_request): Move code to Fx_own_selection_internal
3486 and remove this function.
3487 (ns_handle_selection_clear): Remove, never used.
3488 (Fx_own_selection_internal): Move code from ns_handle_selection_request
3489 here.
3490
3491 2011-12-17 Ken Brown <kbrown@cornell.edu>
3492
3493 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
3494 GID is unknown (Bug#10257).
3495
3496 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
3497
3498 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
3499 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
3500 which caused a build failure on GNU/Linux IA-64. This problem was
3501 introduced by my 2011-10-07 patch.
3502
3503 2011-12-15 Juri Linkov <juri@jurta.org>
3504
3505 * image.c (imagemagick_error): New function. (Bug#10112)
3506 (imagemagick_load_image): Comment out `MagickSetResolution' call.
3507 Use `imagemagick_error' where ImageMagick functions return
3508 `MagickFalse'.
3509 (Fimagemagick_types): Add `Fnreverse' to return the list in the
3510 proper order.
3511
3512 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3513
3514 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
3515 fill background (Bug#8992).
3516
3517 2011-12-13 Martin Rudalics <rudalics@gmx.at>
3518
3519 * window.c (Vwindow_combination_resize)
3520 (Vwindow_combination_limit): Use t instead of non-nil in
3521 doc-strings.
3522 (Vrecenter_redisplay): Add first sentence of doc-string on
3523 separate line.
3524 (Frecenter): Fix doc-string typo.
3525
3526 2011-12-11 Kenichi Handa <handa@m17n.org>
3527
3528 * coding.c (Funencodable_char_position): Pay attention to the
3529 buffer text relocation (Bug#9389).
3530
3531 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3532
3533 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
3534 gtk_init (Bug#10100).
3535
3536 2011-12-10 Eli Zaretskii <eliz@gnu.org>
3537
3538 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
3539 IT->string is nil. (Bug#10263)
3540
3541 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3542
3543 * nsterm.h (x_free_frame_resources): Declare.
3544
3545 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
3546 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
3547
3548 * nsterm.h (ns_get_defaults_value): Declare.
3549
3550 * nsterm.m (ns_default): Call ns_get_defaults_value.
3551
3552 2011-12-09 Eli Zaretskii <eliz@gnu.org>
3553
3554 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
3555 (Bug#10170)
3556
3557 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3558
3559 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
3560 that where the value of an _OBJC_* symbol points to is in the .bss
3561 section (Bug#10240).
3562
3563 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3564
3565 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
3566 after the loop to call ccl_driver at least once (Bug#8619).
3567
3568 2011-12-08 Kenichi Handa <handa@m17n.org>
3569
3570 * ftfont.c (get_adstyle_property): Fix previous change
3571 (Bug#10233).
3572
3573 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
3574
3575 * w32.c (init_environment): If no_site_lisp, remove site-lisp
3576 dirs from the default value of EMACSLOADPATH (bug#10208).
3577
3578 2011-12-07 Glenn Morris <rgm@gnu.org>
3579
3580 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
3581 installation and source directories as well. (Bug#10208)
3582
3583 2011-12-06 Chong Yidong <cyd@gnu.org>
3584
3585 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
3586
3587 2011-12-06 Glenn Morris <rgm@gnu.org>
3588
3589 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
3590 as an error, not just -1. (Bug#10217)
3591
3592 2011-12-05 Chong Yidong <cyd@gnu.org>
3593
3594 * keyboard.c (process_special_events): New function.
3595 (swallow_events, Finput_pending_p): Use it (Bug#10195).
3596
3597 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
3598
3599 * coding.c (encode_designation_at_bol): Don't use uninitialized
3600 local variable (Bug#9318).
3601
3602 2011-12-05 Kenichi Handa <handa@m17n.org>
3603
3604 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
3605 return Qnil (Bug#8046, Bug#10193).
3606
3607 2011-12-05 Kenichi Handa <handa@m17n.org>
3608
3609 * coding.c (encode_designation_at_bol): New args charbuf_end and
3610 dst. Return the number of produced bytes. Callers changed.
3611 (coding_set_source): Return how many bytes coding->source was
3612 relocated.
3613 (coding_set_destination): Return how many bytes
3614 coding->destination was relocated.
3615 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
3616 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
3617
3618 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3619
3620 * coding.c (CODING_CHAR_CHARSET_P): New macro.
3621 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
3622 macro (Bug#9318).
3623
3624 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
3625
3626 The following changes are to fix Bug#9318.
3627
3628 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
3629 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
3630 (encode_coding_iso_2022, encode_coding_sjis)
3631 (encode_coding_big5, encode_coding_charset): Use the above macros.
3632
3633 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
3634
3635 * lisp.h (process_quit_flag): Fix external declaration.
3636
3637 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
3638
3639 Don't macro-inline non-performance-critical code.
3640 * eval.c (process_quit_flag): New function.
3641 * lisp.h (QUIT): Use it.
3642
3643 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
3644
3645 * nsfns.m (get_geometry_from_preferences): New function.
3646 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
3647
3648 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
3649
3650 * emacs.c (Qkill_emacs): Define.
3651 (syms_of_emacs): Initialize it.
3652 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
3653 Qquit_flag to `kill-emacs' instead.
3654 (quit_throw_to_read_char): Add parameter `from_signal'.
3655 All callers changed. Call Fkill_emacs if requested and safe.
3656 * lisp.h (QUIT): Call Fkill_emacs if requested.
3657
3658 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
3659
3660 * widget.c (update_wm_hints): Return if wmshell is null.
3661 (widget_update_wm_size_hints): New function.
3662
3663 * widget.h (widget_update_wm_size_hints): Declare.
3664
3665 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
3666 widget_update_wm_size_hints (Bug#10104).
3667
3668 2011-12-03 Eli Zaretskii <eliz@gnu.org>
3669
3670 * xdisp.c (handle_invisible_prop): If the invisible text ends just
3671 before a newline, prepare the bidi iterator for consuming the
3672 newline, and keep the current paragraph direction. (Bug#10183)
3673 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
3674
3675 2011-12-02 Juri Linkov <juri@jurta.org>
3676
3677 * search.c (Fword_search_regexp): New Lisp function created from
3678 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
3679 (Fword_search_backward, Fword_search_forward)
3680 (Fword_search_backward_lax, Fword_search_forward_lax):
3681 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
3682 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
3683
3684 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
3685
3686 * fileio.c (Finsert_file_contents): Move after-change-function call
3687 to before the "handled:" label, since all "goto handled" appear in
3688 cases where the *-change-functions have already been properly called
3689 (bug#10117).
3690
3691 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
3692
3693 * keyboard.c (interrupt_signal): Don't call kill-emacs when
3694 waiting for input. (Bug#10169)
3695
3696 2011-11-30 Eli Zaretskii <eliz@gnu.org>
3697
3698 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
3699 verifies glyph row's hash code--we have just reallocated the
3700 glyphs, so their contents can be complete garbage. (Bug#10164)
3701
3702 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
3703
3704 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
3705
3706 2011-11-30 Eli Zaretskii <eliz@gnu.org>
3707
3708 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
3709 attributes are tested _before_ calling verify_row_hash, to protect
3710 against GCC re-ordering of the tests. (Bug#10164)
3711
3712 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
3713
3714 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
3715
3716 * xterm.c (handle_one_xevent): Only set async_visible and friends
3717 if net_wm_state_hidden_seen is non-zero (Bug#10002)
3718 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
3719 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
3720
3721 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
3722
3723 Remove GCPRO-related macros that exist only to avoid shadowing locals.
3724 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
3725 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
3726 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3727 All uses changed to use GCPRO1 etc.
3728 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
3729 Revert to old implementation (i.e., before 2011-03-11).
3730
3731 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3732
3733 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
3734 of scroll runs so as to avoid assigning disabled bogus rows and
3735 unnecessary graphics copy operations.
3736
3737 2011-11-27 Eli Zaretskii <eliz@gnu.org>
3738
3739 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
3740 (snprintf) [_MSC_VER]: Redirect to _snprintf.
3741 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
3742 (malloc, free, realloc, calloc): Redirect to e_* only when
3743 compiling Emacs.
3744
3745 * lisp.h (GCTYPEBITS): Move before first use.
3746 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
3747 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
3748 this macro definition.
3749
3750 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
3751 _MSC_VER.
3752
3753 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
3754
3755 * gtkutil.c (xg_create_frame_widgets):
3756 Call gtk_window_set_has_resize_grip (FALSE) if that function is
3757 present with Gtk+ 2.0.
3758
3759 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3760
3761 * fileio.c (Finsert_file_contents): Undo previous change; see
3762 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3763
3764 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3765
3766 Rename locals to avoid shadowing.
3767 * fileio.c (Finsert_file_contents):
3768 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
3769 * process.c (wait_reading_process_output):
3770 Rename inner 'proc' to 'p' to avoid shadowing.
3771 Indent for consistency with usual Emacs style.
3772
3773 2011-11-25 Eli Zaretskii <eliz@gnu.org>
3774
3775 * xdisp.c (redisplay_window): If cursor row is not fully visible
3776 after recentering, and scroll-conservatively is set to a large
3777 number, scroll window by a few more lines to make the cursor fully
3778 visible and out of scroll-margin. (Bug#10105)
3779 (start_display): Don't move to the next line if the display should
3780 start at a newline that is part of a display vector or an overlay
3781 string. (Bug#10119)
3782
3783 2011-11-24 Juri Linkov <juri@jurta.org>
3784
3785 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
3786 after the `MagickPingImage' call. (Bug#10112)
3787
3788 2011-11-23 Chong Yidong <cyd@gnu.org>
3789
3790 * window.c (Fcoordinates_in_window_p): Accept only live windows.
3791
3792 2011-11-23 Martin Rudalics <rudalics@gmx.at>
3793
3794 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
3795 making another buffer current. (Bug#10114)
3796
3797 2011-11-23 Glenn Morris <rgm@gnu.org>
3798
3799 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
3800
3801 2011-11-23 Chong Yidong <cyd@gnu.org>
3802
3803 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
3804 using it (Bug#5984).
3805
3806 2011-11-22 Eli Zaretskii <eliz@gnu.org>
3807
3808 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
3809 and header-lines, as they don't have one computed for them.
3810 (Bug#10098)
3811
3812 * .gdbinit (prow): Make displayed values more self-explaining.
3813 Add row's hash code.
3814
3815 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
3816
3817 * process.c (wait_reading_process_output): Fix asynchrounous
3818 GnuTLS socket handling on some versions of the GnuTLS library.
3819 (wait_reading_process_output): Add comment and URL.
3820
3821 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
3822
3823 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
3824
3825 2011-11-21 Chong Yidong <cyd@gnu.org>
3826
3827 * window.c (Fnext_window, Fprevious_window): Doc fix.
3828
3829 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3830
3831 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
3832
3833 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
3834
3835 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
3836
3837 2011-11-20 Martin Rudalics <rudalics@gmx.at>
3838
3839 * window.c (Fset_window_combination_limit): Rename argument
3840 STATUS to LIMIT.
3841 (Vwindow_combination_limit): Remove "status" from doc-string.
3842
3843 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
3844
3845 * m/ibms390.h: Remove.
3846 * m/ibms390x.h: Don't include "ibms390.h".
3847
3848 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3849
3850 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
3851 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
3852
3853 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
3854
3855 * casetab.c (Fset_case_table):
3856 * charset.c (Fcharset_after): Fix typos.
3857
3858 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
3859
3860 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
3861 Otherwise, valgrind does not work on some platforms.
3862 Problem reported by Andreas Schwab in
3863 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
3864 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
3865 is set, removing the need for VIRT_ADDRESS_VARIES.
3866 (PURE_P): Use a more-efficient implementation that needs just one
3867 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
3868 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
3869 to 4 (xorl, subq, cmpq, setbe).
3870 * alloc.c (pure): Always extern now, since that's the
3871 VIRT_ADDR_VARIES behavior.
3872 (PURE_POINTER_P): Use a single comparison, not two, for
3873 consistency with the new puresize.h.
3874 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
3875 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
3876 Remove VIRT_ADDR_VARIES no longer needed.
3877
3878 2011-11-19 Eli Zaretskii <eliz@gnu.org>
3879
3880 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
3881 (erase_phys_cursor, update_window_cursor, show_mouse_face)
3882 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
3883 behave as if the cursor position were at the window margin.
3884
3885 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
3886 and the cursor position is out of bounds, behave as if the cursor
3887 position were at the window margin. (Bug#10075)
3888
3889 2011-11-18 Chong Yidong <cyd@gnu.org>
3890
3891 * window.c (Fwindow_combination_limit): Make first argument
3892 non-optional, since it is meaningless for live windows like the
3893 selected window.
3894
3895 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
3896
3897 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
3898
3899 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
3900
3901 * intervals.c: Fix grafting over the whole buffer (bug#10071).
3902 (graft_intervals_into_buffer): Simplify.
3903
3904 2011-11-18 Eli Zaretskii <eliz@gnu.org>
3905
3906 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
3907 hash values of the two rows.
3908 (copy_row_except_pointers): Preserve the used[] arrays and the
3909 hash values of the two rows. (Bug#10035)
3910 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
3911
3912 * xdisp.c (row_hash): New function, body extracted from
3913 compute_line_metrics.
3914 (compute_line_metrics): Call row_hash, instead of computing the
3915 hash code inline.
3916
3917 * dispnew.c (verify_row_hash): Call row_hash for computing the
3918 hash code of a row, instead of duplicating code from xdisp.c.
3919
3920 * dispextern.h (row_hash): Add prototype.
3921
3922 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
3923
3924 * frame.c (delete_frame): Don't delete the terminal when the last
3925 X frame is closed if emacs is built with GTK toolkit.
3926
3927 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
3928
3929 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
3930
3931 2011-11-17 Martin Rudalics <rudalics@gmx.at>
3932
3933 * window.c (Vwindow_splits): Rename to
3934 Vwindow_combination_resize. Suggested by Juri Linkov.
3935 (Fsplit_window_internal): Use Vwindow_combination_resize instead
3936 of Vwindow_splits.
3937
3938 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
3939
3940 * nsfns.m (Fns_font_name):
3941 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
3942
3943 2011-11-16 Martin Rudalics <rudalics@gmx.at>
3944
3945 * window.h (window): Rename slot "nest" to "combination_limit".
3946 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
3947 (Fset_window_nest): Rename to Fset_window_combination_limit.
3948 (Vwindow_nest): Rename to Vwindow_combination_limit.
3949 (recombine_windows, make_parent_window, make_window)
3950 (Fsplit_window_internal, saved_window)
3951 (Fset_window_configuration, save_window_save): Rename all
3952 occurrences of window_nest to window_combination_limit.
3953
3954 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
3955
3956 * image.c (imagemagick_load_image): Fix typo.
3957
3958 2011-11-14 Eli Zaretskii <eliz@gnu.org>
3959
3960 * xdisp.c (display_line): Move the call to
3961 highlight_trailing_whitespace before the call to
3962 compute_line_metrics, since the latter needs to see the final
3963 faces of all the glyphs to compute ROW's hash value.
3964 Fixes assertion violations in row_equal_p. (Bug#10035)
3965
3966 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
3967
3968 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
3969 just return (bug#10044).
3970
3971 2011-11-12 Eli Zaretskii <eliz@gnu.org>
3972
3973 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
3974 with user-defined heap size. Bump the default size of the temacs
3975 heap to 27MB, to avoid memory warning when running temacs.
3976 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
3977
3978 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
3979 current_matrix and desired_matrix. (Bug#9990)
3980 (verify_row_hash) [XASSERTS]: New function.
3981 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
3982 that the hash value of glyph rows is correct.
3983
3984 2011-11-12 Martin Rudalics <rudalics@gmx.at>
3985
3986 * window.h (window): Remove splits slot.
3987 * window.c (Fwindow_splits, Fset_window_splits): Remove.
3988 (Fdelete_other_windows_internal, make_parent_window)
3989 (make_window, Fsplit_window_internal, Fdelete_window_internal)
3990 (Fset_window_configuration, save_window_save): Don't deal with
3991 split status of windows.
3992 (saved_window): Remove splits slot.
3993 (Vwindow_splits): Rewrite doc-string.
3994
3995 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
3996
3997 * xfns.c (unwind_create_frame):
3998 * nsfns.m (unwind_create_frame):
3999 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
4000 Vframe_list (Bug#9999).
4001
4002 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
4003
4004 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
4005
4006 2011-11-11 Kenichi Handa <handa@m17n.org>
4007
4008 * callproc.c (Fcall_process): Set the member dst_multibyte of
4009 process_coding.
4010
4011 2011-11-11 Johan Bockgård <bojohan@gnu.org>
4012
4013 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
4014 avoid a crash (bug#9496).
4015
4016 2011-11-09 Chong Yidong <cyd@gnu.org>
4017
4018 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4019 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
4020
4021 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4022
4023 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
4024
4025 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4026
4027 Avoid some portability problems by eschewing 'extern inline' functions.
4028 The trivial performance wins aren't worth the portability hassles; see
4029 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
4030 et seq.
4031 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4032 (window_box_width, window_box_left, window_box_left_offset)
4033 (window_box_right, window_box_right_offset): Undo previous change,
4034 by removing the "extern"s.
4035 * intervals.c (adjust_intervals_for_insertion)
4036 (adjust_intervals_for_deletion): Undo previous change,
4037 making these static again.
4038 (offset_intervals, temp_set_point_both, temp_set_point)
4039 (copy_intervals_to_string): No longer inline.
4040 * xdisp.c (window_text_bottom_y, window_box_width)
4041 (window_box_height, window_box_left_offset)
4042 (window_box_right_offset, window_box_left, window_box_right)
4043 (window_box): No longer inline.
4044
4045 2011-11-08 Chong Yidong <cyd@gnu.org>
4046
4047 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
4048 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
4049 Signal an error if not a live window.
4050 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
4051 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
4052
4053 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
4054
4055 * lisp.h (syms_of_abbrev): Remove declaration.
4056 Reported by CHENG Gao <chenggao@royau.me>.
4057
4058 2011-11-07 Eli Zaretskii <eliz@gnu.org>
4059
4060 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
4061 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
4062 of temacs in GUI mode.
4063
4064 2011-11-07 Martin Rudalics <rudalics@gmx.at>
4065
4066 * window.h: Declare delete_all_child_windows instead of
4067 delete_all_subwindows.
4068 * window.c (Fwindow_nest, Fset_window_nest)
4069 (Fset_window_new_total, Fset_window_new_normal)
4070 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
4071 (delete_all_subwindows): Rename to delete_all_child_windows.
4072 (Fdelete_other_windows_internal, Fset_window_configuration):
4073 Call delete_all_child_windows instead of delete_all_subwindows.
4074 * frame.c (delete_frame): Call delete_all_child_windows instead
4075 of delete_all_subwindows.
4076
4077 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
4078
4079 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
4080 This is also needed for porting to any host where GC_MARK_STACK is
4081 not GC_MAKE_GCPROS_NOOPS.
4082 (which_symbols): Use it.
4083
4084 2011-11-07 Kenichi Handa <handa@m17n.org>
4085
4086 * coding.c (coding_set_destination): Check coding->src_pos only
4087 when coding->src_object is a buffer (bug#9910).
4088
4089 * process.c (send_process): Set the member src_multibyte of coding
4090 to 0 (bug#9911) when sending a unibyte text.
4091
4092 * callproc.c (Fcall_process): Set the member src_multibyte of
4093 process_coding to 0 (bug#9912).
4094
4095 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4096
4097 * xmenu.c (cleanup_widget_value_tree): New function.
4098 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
4099 calling free_menubar_widget_value_tree directly (Bug#9830).
4100
4101 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
4102
4103 Fix some portability problems with 'inline'.
4104 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4105 (window_box_width, window_box_left, window_box_left_offset)
4106 (window_box_right, window_box_right_offset): Declare extern.
4107 Otherwise, these inline functions do not conform to C99 and
4108 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
4109 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
4110 * intervals.c (adjust_intervals_for_insertion)
4111 (adjust_intervals_for_deletion): Now extern, because otherwise the
4112 extern inline functions 'offset_intervals' couldn't refer to it.
4113 (static_offset_intervals): Remove.
4114 (offset_intervals): Rewrite using the old contents of
4115 static_offset_intervals. The old version didn't conform to C99
4116 because an extern inline function contained a reference to an
4117 identifier with static linkage.
4118
4119 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
4120
4121 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
4122 GC.
4123
4124 2011-11-06 Eli Zaretskii <eliz@gnu.org>
4125
4126 * xdisp.c (init_iterator, reseat_to_string): Don't set the
4127 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
4128 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
4129 return Qleft_to_right.
4130
4131 2011-11-06 Chong Yidong <cyd@gnu.org>
4132
4133 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
4134 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
4135 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
4136 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
4137 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
4138 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
4139 (Fwindow_vscroll): Doc fix.
4140 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
4141 argument, since it makes no sense to pass a live window and for
4142 consistency with window-child.
4143
4144 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
4145
4146 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
4147 support MSVC.
4148
4149 2011-11-05 Jason Rumney <jasonr@gnu.org>
4150
4151 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
4152 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
4153 fonts (Bug#6029).
4154 (add_font_entity_to_list): Fix logic errors in mixed boolean and
4155 bitwise arithmetic preventing use of unicode-sip and non-truetype
4156 opentype fonts.
4157
4158 2011-11-05 Eli Zaretskii <eliz@gnu.org>
4159
4160 * s/ms-w32.h (fstat, stat, utime): Move redirections to
4161 "emacs"-only part.
4162
4163 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
4164 initialization code to keep similarity to xfns.c after changes
4165 from 2011-11-05.
4166
4167 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
4168
4169 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
4170 (unwind_create_frame): New function (Bug#9943).
4171 (Fx_create_frame): Restructure code to be more similar to the one in
4172 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
4173 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
4174 Move terminal->reference_count++ just before making the frame official
4175 (Bug#9943).
4176
4177 * nsterm.m (x_free_frame_resources): New function.
4178 (x_destroy_window): Move code to x_free_frame_resources.
4179
4180 * xfns.c (unwind_create_frame): Fix comment.
4181 (Fx_create_frame, x_create_tip_frame):
4182 Move terminal->reference_count++ just before making the frame
4183 official. Move initialization of image_cache_refcount and
4184 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
4185
4186 2011-11-05 Eli Zaretskii <eliz@gnu.org>
4187
4188 Support MSVC build with newer versions of Visual Studio.
4189 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
4190 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
4191 nt/gmake.defs.
4192
4193 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
4194 which are not supported by MSVC.
4195 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
4196 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
4197 bitfields.
4198 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
4199 types in bitfields.
4200 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
4201
4202 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
4203
4204 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
4205
4206 Support MSVC build with newer versions of Visual Studio.
4207 * w32.c: Don't include w32api.h for MSVC.
4208 (init_environment) [_MSC_VER]: Call sys_access, not _access.
4209
4210 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
4211 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
4212 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
4213 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
4214 e_* cousins.
4215 (alloca) [_MSC_VER]: Define to _alloca.
4216
4217 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
4218
4219 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
4220
4221 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4222
4223 * xdisp.c (note_mouse_highlight): If either of
4224 previous/next-single-property-change returns nil, treat that as
4225 the beginning or the end of the buffer. (Bug#9955)
4226
4227 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
4228
4229 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
4230 label is not null (Bug#9951).
4231 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
4232 may be NULL.
4233
4234 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4235
4236 * window.c (Fwindow_body_size): Mention in the doc string that the
4237 return value is in frame's canonical units. (Bug#9949)
4238
4239 2011-11-03 Eli Zaretskii <eliz@gnu.org>
4240
4241 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
4242
4243 * w32fns.c (unwind_create_frame): If needed, free the glyph
4244 matrices of the partially constructed frame. (Bug#9943)
4245 * xfns.c (unwind_create_frame): Likewise.
4246
4247 2011-11-01 Eli Zaretskii <eliz@gnu.org>
4248
4249 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
4250 Don't stop backward scan on the continuation glyph, even though
4251 its CHARPOS is positive.
4252 (mouse_face_from_buffer_pos, note_mouse_highlight):
4253 Rename cover_string to disp_string.
4254
4255 2011-11-01 Martin Rudalics <rudalics@gmx.at>
4256
4257 * window.c (temp_output_buffer_show): Don't use
4258 Vtemp_buffer_show_specifiers.
4259 (Vtemp_buffer_show_specifiers): Remove unused variable.
4260
4261 2011-10-30 Eli Zaretskii <eliz@gnu.org>
4262
4263 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
4264 past the beginning of the current glyph matrix.
4265
4266 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
4267
4268 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
4269 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
4270 HAVE_GTK3 (Bug#9869).
4271
4272 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
4273 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
4274
4275 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
4276
4277 * xterm.c: Declare x_handle_net_wm_state to return int.
4278 (handle_one_xevent): Check if we are iconified but don't have
4279 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
4280 (get_current_wm_state): Return non-zero if not hidden,
4281 check for _NET_WM_STATE_HIDDEN (Bug#9893).
4282 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
4283 (x_handle_net_wm_state): Return what get_current_wm_state returns.
4284 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
4285
4286 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
4287
4288 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
4289 so that this new function doesn't get optimized away by a
4290 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
4291
4292 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4293
4294 * frame.h (MOUSE_HL_INFO): Remove excess parens.
4295
4296 2011-10-29 Eli Zaretskii <eliz@gnu.org>
4297
4298 Fix the `xbytecode' command.
4299 * .gdbinit (xprintbytestr): New command.
4300 (xwhichsymbols): Rename from `which'; all callers changed.
4301 (xbytecode): Print the byte-code string as well.
4302
4303 2011-10-29 Kim Storm <storm@cua.dk>
4304
4305 * alloc.c (which_symbols): New function.
4306
4307 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4308
4309 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
4310 line. (Bug#9903)
4311
4312 2011-10-29 Glenn Morris <rgm@gnu.org>
4313
4314 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
4315 Not clear what it was for, and it causes various bugs. (Bug#9839)
4316
4317 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4318
4319 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4320 possible random value that matches one of those tested as
4321 condition to clear the mouse face.
4322
4323 2011-10-28 Chong Yidong <cyd@gnu.org>
4324
4325 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
4326
4327 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
4328
4329 * window.c (make_window): Initialize phys_cursor_on_p.
4330
4331 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4332
4333 * lisp.h (struct Lisp_Symbol): Update comments.
4334
4335 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
4336
4337 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
4338
4339 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4340
4341 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
4342 <oslsachem@gmail.com> for helping to debug this.
4343
4344 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
4345 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
4346 (g_b_init_get_glyph_outline_w): New static variables.
4347 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
4348 (GetGlyphOutlineW_Proc): New typedefs.
4349 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
4350 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
4351 New functions.
4352 (w32font_open_internal, compute_metrics):
4353 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
4354 instead of calling the "wide" APIs directly.
4355
4356 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
4357
4358 * w32.h (syms_of_w32font): Add prototype.
4359
4360 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
4361
4362 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
4363 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
4364 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
4365 (Fmove_to_window_line): Doc fix.
4366
4367 2011-10-27 Chong Yidong <cyd@gnu.org>
4368
4369 * process.c (make_process): Set gnutls_state to NULL.
4370
4371 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
4372 non-NULL, regardless of GNUTLS_INITSTAGE.
4373 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
4374 an error. Set process slots as soon as we allocate them.
4375
4376 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
4377
4378 2011-10-27 Chong Yidong <cyd@gnu.org>
4379
4380 * gnutls.c (emacs_gnutls_deinit): New function.
4381 Deallocate credentials structures as well as calling gnutls_deinit.
4382 (Fgnutls_deinit, Fgnutls_boot): Use it.
4383
4384 * process.c (make_process): Initialize GnuTLS credentials to NULL.
4385 (deactivate_process): Call emacs_gnutls_deinit.
4386
4387 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
4388
4389 * image.c (x_create_x_image_and_pixmap):
4390 * w32.c (sys_rename, w32_delayed_load):
4391 * w32font.c (fill_in_logfont):
4392 * w32reg.c (x_get_string_resource): Silence compiler warnings.
4393
4394 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
4395
4396 * w32fns.c (w32_default_color_map): New function,
4397 extracted from Fw32_default_color_map.
4398 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
4399
4400 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
4401
4402 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
4403
4404 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
4405
4406 * keyboard.c (test_undefined): New function (bug#9751).
4407 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
4408
4409 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
4410
4411 * sysdep.c (init_sys_modes): Fix the check for the controlling
4412 terminal (Bug#6649).
4413
4414 2011-10-20 Eli Zaretskii <eliz@gnu.org>
4415
4416 * dispextern.h (struct bidi_it): New member next_en_type.
4417
4418 * bidi.c (bidi_line_init): Initialize the next_en_type member.
4419 (bidi_resolve_explicit_1): When next_en_pos is valid for the
4420 current character, check also for next_en_type being WEAK_EN.
4421 (bidi_resolve_weak): Don't enter the expensive loop if the current
4422 position is before next_en_pos. Record the bidi type of the first
4423 non-ET, non-BN character we find, in addition to its position.
4424 (bidi_level_of_next_char): Invalidate next_en_type when
4425 next_en_pos is over-stepped.
4426
4427 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
4428
4429 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
4430 * editfns.c: Rewrite current-time-zone so that it invokes
4431 the equivalent of (format-time-string "%Z") to get the time zone name.
4432 This fixes a bug when the time zone name contains characters that
4433 need converting from the system time locale to Emacs internal format.
4434 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
4435 that patch fixed format-time-string to do the conversion, but
4436 I forgot to fix current-time-zone.
4437 (format_time_string): New function, containing most of
4438 what Fformat_time_string used to contain.
4439 (Fformat_time_string): Rewrite in terms of format_time_string.
4440 This doesn't change this function's behavior.
4441 (current-time-zone): Rewrite to use format_time_string.
4442 This fixes the bug reported by Michael Schierl in
4443 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
4444 Jason Rumney's 2007-06-07 change worked around this bug, but
4445 didn't fix it.
4446 * systime.h (tzname, timezone): Remove no-longer-used declarations.
4447
4448 2011-10-19 Eli Zaretskii <eliz@gnu.org>
4449
4450 * xdisp.c (start_display): If the character at POS is displayed
4451 via a display vector, reset IT->current.dpvec_index to zero.
4452 (try_window_reusing_current_matrix): If a line ends in a display
4453 vector or the next line starts in a display vector, continue
4454 redrawing the window even though the character position of
4455 start_row was reached.
4456 (Bug#9771, part 2)
4457
4458 2011-10-18 Chong Yidong <cyd@gnu.org>
4459
4460 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
4461 with nobreak-char-display too.
4462
4463 2011-10-18 Eli Zaretskii <eliz@gnu.org>
4464
4465 Fix part 3 of bug#9771.
4466 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
4467 (bidi_resolve_neutral): Don't enter the expensive loop looking for
4468 non-neutral characters if the current character is a paragraph
4469 separator (a.k.a. Newline). This avoids running the same
4470 expensive loop twice, once when we consume the preceding newline
4471 and the other time when the line actually needs to be displayed.
4472 Avoid the loop when we see neutrals on the base embedding level
4473 following a character whose directionality is the same as the
4474 paragraph's. This avoids running the expensive loop when a line
4475 ends in a long sequence of neutrals, like control characters.
4476 Add assertion against STRONG_AL type. Slightly rearrange code
4477 that determines the type of a neutral given the first non-neutral
4478 that follows it.
4479 (bidi_level_of_next_char): Set next_en_pos to zero when
4480 invalidating its info.
4481
4482 2011-10-17 Eli Zaretskii <eliz@gnu.org>
4483
4484 * xdisp.c (push_display_prop): Determine whether to record string
4485 or buffer position by IT->string, not by IT->method. Allow
4486 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
4487 (move_it_vertically_backward): Don't look for character position
4488 immediately after the newline when in a continuation line.
4489 (Bug#9771, part 1)
4490
4491 2011-10-15 Martin Rudalics <rudalics@gmx.at>
4492
4493 * window.c (coordinates_in_window): Rewrite and delabelize
4494 vertical border check. (Bug#5357) (Bug#9618)
4495
4496 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
4497
4498 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
4499 errors in XSetWindowBorder (bug#9310).
4500
4501 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
4502
4503 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
4504 avoid crash when xmalloc overrun checking is enabled.
4505
4506 2011-10-13 Eli Zaretskii <eliz@gnu.org>
4507
4508 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
4509 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
4510 cursor motion with <left> and <right> arrow keys.
4511
4512 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
4513 some callers set that themselves.
4514
4515 2011-10-12 Eli Zaretskii <eliz@gnu.org>
4516
4517 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
4518 display string and the previous row comes from the same string and
4519 is empty. (Bug#9739) (Bug#9738)
4520
4521 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4522
4523 * doc.c (get_doc_string): Encode file name (bug#9735).
4524
4525 2011-10-12 Eli Zaretskii <eliz@gnu.org>
4526
4527 * bidi.c (bidi_level_of_next_char):
4528 * xdisp.c (get_visually_first_element): Remove old incorrect
4529 comments regarding the Unicode Line Separator character.
4530
4531 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
4532
4533 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
4534
4535 * alloc.c (Fgc_status): Do not access beyond zombies array
4536 boundary if nzombies > MAX_ZOMBIES.
4537 * alloc.c (dump_zombies): Add missing format specifier.
4538
4539 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
4540
4541 * xdisp.c (set_cursor_from_row): Simplify conditionals,
4542 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
4543
4544 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
4545 Some packages use them to denote characters with modifiers.
4546
4547 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
4548
4549 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
4550 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
4551 matching a pp-number. Rename parameter var to var1.
4552
4553 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4554
4555 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
4556
4557 2011-10-08 Glenn Morris <rgm@gnu.org>
4558
4559 * callint.c (Fcall_interactively): Give a more explicit error for the
4560 'c' case with a non-character input. (Bug#8479)
4561
4562 2011-10-08 Eli Zaretskii <eliz@gnu.org>
4563
4564 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
4565 lines.
4566 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
4567 lines that are hscrolled on the left.
4568
4569 * dispnew.c (buffer_posn_from_coords): Account for a possible
4570 presence of header-line. (Bug#4426)
4571
4572 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
4573
4574 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
4575 Don't advertise functionality which we discourage or doesn't work.
4576
4577 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
4578
4579 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
4580 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
4581 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
4582 this makes Emacs dump core during garbage collection on rare
4583 occasions. sizeof is obviously inferior to offsetof here, so
4584 stick with offsetof.
4585 (GC_POINTER_ALIGNMENT): New macro.
4586 (mark_memory): Omit 3rd (offset) arg; caller changed.
4587 Don't assume EMACS_INT alignment is the same as pointer alignment.
4588
4589 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
4590
4591 * keyboard.c (read_key_sequence_remapped): New var.
4592 (read_key_sequence): Compute remapping in the right buffer.
4593 (command_loop_1): Use read_key_sequence's remapping directly.
4594
4595 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4596
4597 * dired.c (file_name_completion): Don't expand file name.
4598 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
4599 before checking file name handler.
4600
4601 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
4602 they've been requested explicitly (bug#9591).
4603
4604 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
4605
4606 * keymap.c (Fsingle_key_description): Use make_specified_string
4607 instead of build_string to build string from push_key_description.
4608 (Bug#5193)
4609
4610 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4611
4612 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
4613 This fixes a Y2038 bug on 64-bit hosts.
4614 * buffer.c (reset_buffer):
4615 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
4616 (Fclear_buffer_auto_save_failure):
4617 Use 0, not -1, to represent an unset failure time, since time_t
4618 might not be signed.
4619
4620 Remove dependency on glibc malloc internals.
4621 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4622 Move back here from lisp.h, but with their new implementations.
4623 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4624 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
4625 * charset.c (charset_table_init): New static var.
4626 (syms_of_charset): Use it instead of xmalloc. This removes a
4627 dependency on glibc malloc internals. See Eli Zaretskii's comment in
4628 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
4629 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4630 Move back to alloc.c.
4631 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4632 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
4633
4634 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
4635
4636 * nsterm.m (windowDidResize): Call x_set_window_size only when
4637 ns_in_resize is true. Otherwise set pixelwidth/height and
4638 call change_frame_size (Bug#9628).
4639
4640 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4641
4642 Port --enable-checking=all to Fedora 14 x86-64.
4643 * charset.c (syms_of_charset): Also account for glibc malloc's
4644 internal overhead when calculating the initial malloc maximum.
4645
4646 Port --enable-checking=all to Fedora 14 x86.
4647 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4648 Move to lisp.h.
4649 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
4650 (overrun_check_realloc, overrun_check_free):
4651 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
4652 That way, xmalloc returns a properly-aligned pointer even if
4653 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
4654 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
4655 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
4656 into account when calculating the initial malloc maximum.
4657 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4658 Move here from alloc.c, so that charset.c can use it too.
4659 Properly align; the old code wasn't right for common 32-bit hosts
4660 when configured with --enable-checking=all.
4661 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4662 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
4663
4664 2011-09-29 Eli Zaretskii <eliz@gnu.org>
4665
4666 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
4667 use EDOM.
4668
4669 2011-09-28 Eli Zaretskii <eliz@gnu.org>
4670
4671 * xdisp.c (compute_display_string_end): If there's no display
4672 string at CHARPOS, return -1.
4673
4674 * bidi.c (bidi_fetch_char): When compute_display_string_end
4675 returns a negative value, treat the character as a normal
4676 character not covered by a display string. (Bug#9624)
4677
4678 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
4679
4680 * lread.c (Fread_from_string): Fix typo in docstring.
4681
4682 2011-09-27 Eli Zaretskii <eliz@gnu.org>
4683
4684 * xdisp.c (handle_invisible_prop): If invisible text ends on a
4685 newline, reseat the iterator instead of bidi-iterating there one
4686 character at a time. (Bug#9610)
4687 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
4688 TO_CHARPOS if the bidi iterator is at base embedding level.
4689
4690 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
4691
4692 * lread.c (readevalloop): Use correct code for NBSP.
4693 (read1): Likewise. (Bug#9608)
4694
4695 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
4696
4697 * dbusbind.c (Fdbus_register_signal): When service is not
4698 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
4699
4700 2011-09-25 Glenn Morris <rgm@gnu.org>
4701
4702 * buffer.c (truncate-lines): Doc fix.
4703
4704 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
4705
4706 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
4707 (Fset_window_next_buffers): Doc fix.
4708
4709 2011-09-24 Glenn Morris <rgm@gnu.org>
4710
4711 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
4712
4713 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
4714
4715 Fix minor problems found by static checking.
4716 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
4717 * indent.c (Fvertical_motion): Fix == vs = typo.
4718
4719 2011-09-24 Eli Zaretskii <eliz@gnu.org>
4720
4721 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
4722 Default value is now t. Doc fix.
4723
4724 * indent.c (Fvertical_motion): Compute and apply the overshoot
4725 logic when moving up, not only when moving down. Fix the
4726 confusing name and values of the it_overshoot_expected variable;
4727 logic changes accordingly. (Bug#9254) (Bug#9549)
4728
4729 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
4730 CHARPOS is covered by a display string which includes newlines.
4731 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
4732 is covered by a display string with embedded newlines.
4733
4734 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
4735
4736 * dbusbind.c (Fdbus_register_signal): Add match rule to
4737 Vdbus_registered_objects_table. (Bug#9581)
4738 (Fdbus_register_method, Vdbus_registered_objects_table):
4739 Fix docstring.
4740
4741 2011-09-24 Jim Meyering <meyering@redhat.com>
4742
4743 do not ignore write error for any output size
4744 The previous change was incomplete.
4745 While it makes emacs --batch detect the vast majority of stdout
4746 write failures, errors were still ignored whenever the output size is
4747 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
4748 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
4749 && echo FAIL: ignored write error
4750 FAIL: ignored write error
4751 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
4752 && echo FAIL: ignored write error
4753 FAIL: ignored write error
4754 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
4755
4756 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
4757
4758 * emacs.c (Fkill_emacs): In noninteractive mode exit
4759 non-successfully if a write error occurred on stdout. (Bug#9574)
4760
4761 2011-09-21 Eli Zaretskii <eliz@gnu.org>
4762
4763 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
4764 the xassert test.
4765
4766 * dispextern.h (struct it): Update the comment documenting what
4767 can it->OBJECT be.
4768
4769 2011-09-20 Eli Zaretskii <eliz@gnu.org>
4770
4771 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
4772 a display string, extend search for cursor position to end of row.
4773 (find_row_edges): If the row ends in a newline from a display
4774 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
4775 Handle the case of a display string with multiple newlines.
4776 (Fcurrent_bidi_paragraph_direction): Fix search for previous
4777 non-empty line. Fixes confusing cursor motion with arrow keys at
4778 the beginning of a line that starts with whitespace.
4779
4780 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4781
4782 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
4783 (bug#9493).
4784
4785 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
4786
4787 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
4788 boolean (Bug#9154).
4789
4790 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4791
4792 * xdisp.c (display_line): Record maximum and minimum buffer
4793 positions even if no glyphs were produced (e.g., by a zero-width
4794 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
4795 buffer positions that will be removed from the glyph row because
4796 they don't fit.
4797 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
4798 column is beyond frame width: don't subtract 1 "pixel" when
4799 computing width of the stretch.
4800 (reseat_at_next_visible_line_start): Undo the change made on
4801 2011-09-17 that saved paragraph information and restored it after
4802 the call to `reseat'. (Bug#9545)
4803
4804 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4805
4806 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
4807 and turn window cursor on if cleared (Bug#9415).
4808
4809 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
4810
4811 * search.c (boyer_moore): Take unibyte characters from pattern
4812 literally. (Bug#9458)
4813
4814 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4815
4816 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
4817
4818 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 Fix minor problem found by static checking.
4821 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
4822 initialized, to pacify gcc -Wuninitialized.
4823
4824 * fileio.c: Report proper errno when syscall falls.
4825 (Finsert_file_contents): Save and restore errno,
4826 so that report_file_error outputs the correct diagnostic.
4827 (Fwrite_region) [CLASH_DETECTION]: Likewise.
4828
4829 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4830
4831 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
4832
4833 2011-09-17 Eli Zaretskii <eliz@gnu.org>
4834
4835 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
4836 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
4837
4838 2011-09-17 Eli Zaretskii <eliz@gnu.org>
4839
4840 * xdisp.c (reseat_at_next_visible_line_start): Keep information
4841 about the current paragraph and restore it after the call to reseat.
4842
4843 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
4844 (bidi_find_paragraph_start): Search back for paragraph beginning
4845 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
4846 (bidi_move_to_visually_next): Only trigger paragraph-related
4847 computations when the last character is a newline or at EOB, not
4848 just any NEUTRAL_B. (Bug#9470)
4849
4850 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
4851 truncated lines if point is covered by a display string. (Bug#9524)
4852
4853 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
4854
4855 * xselect.c: Relax test for outgoing X longs (Bug#9498).
4856 (cons_to_x_long): New function.
4857 (lisp_data_to_selection_data): Use it. Correct the test for
4858 short-versus-long data; it was negated. Break out of vector
4859 loop, for efficiency, when a long datum is discovered.
4860
4861 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
4862
4863 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
4864
4865 2011-09-16 Eli Zaretskii <eliz@gnu.org>
4866
4867 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
4868 GCC PR/17406) by declaring this function with external scope.
4869
4870 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4871
4872 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
4873 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
4874
4875 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
4876
4877 * editfns.c (Fformat): Correctly handle text properties on "%%".
4878
4879 2011-09-15 Eli Zaretskii <eliz@gnu.org>
4880
4881 * xterm.c (x_draw_composite_glyph_string_foreground):
4882 * w32term.c (x_draw_composite_glyph_string_foreground):
4883 * term.c (encode_terminal_code):
4884 * composite.c (composition_update_it, get_composition_id):
4885 * xdisp.c (get_next_display_element)
4886 (fill_composite_glyph_string): Add comments about special meaning
4887 of TAB characters in a composition.
4888
4889 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4892 This occurs when processing a multibyte format.
4893 Problem reported by Wolfgang Jenker.
4894
4895 2011-09-15 Johan Bockgård <bojohan@gnu.org>
4896
4897 * xdisp.c (try_cursor_movement): Only check for exact match if
4898 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
4899
4900 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4901
4902 Remove unused external symbols.
4903 * dispextern.h (calc_pixel_width_or_height): Remove decl.
4904 * xdisp.c (calc_pixel_width_or_height): Now static.
4905 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
4906 * indent.c (check_display_width):
4907 * w32term.c: Fix comment to match code.
4908 * xterm.c, xterm.h (x_catching_errors): Remove.
4909
4910 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4911
4912 * xselect.c: Use signed conversions more consistently (Bug#9498).
4913 (selection_data_to_lisp_data): Assume incoming selection data are
4914 signed integers, not unsigned. This is to be consistent with
4915 outgoing selection data, which was modified to use signed integers
4916 in as part of the fix to Bug#9196 in response to Jan D.'s comment
4917 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
4918 expects long, not unsigned long.
4919
4920 2011-09-14 Eli Zaretskii <eliz@gnu.org>
4921
4922 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
4923 computation of loop end. Reported by Johan Bockgård
4924 <bojohan@gnu.org>.
4925
4926 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
4927
4928 * frame.c (Fother_visible_frames_p): Function deleted.
4929
4930 2011-09-12 Eli Zaretskii <eliz@gnu.org>
4931
4932 * indent.c (compute_motion): Process display vector front to back
4933 rather than the other way around. (Bug#2496)
4934
4935 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4936
4937 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
4938
4939 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
4940
4941 * minibuf.c (Fread_from_minibuffer): Doc fix.
4942
4943 2011-09-11 Eli Zaretskii <eliz@gnu.org>
4944
4945 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
4946 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
4947
4948 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4949
4950 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
4951 value for non-existent files.
4952
4953 2011-09-11 Eli Zaretskii <eliz@gnu.org>
4954
4955 * fileio.c (Finsert_file_contents): If the file cannot be opened,
4956 set its "size" to -1. This will set the modtime_size field of
4957 the corresponding buffer to -1, which is what
4958 verify-visited-file-modtime expects for files that do not exist.
4959 (Bug#9139)
4960
4961 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
4962
4963 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
4964 here ...
4965 * lisp.h: ... from here. push_key_description is no longer
4966 defined in keyboard.c, so its declaration should not be in
4967 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
4968 logically belongs with push_key_description.
4969
4970 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
4971
4972 * buffer.h: Include <sys/types.h> instead of <time.h>.
4973 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
4974 Problem reported by Herbert J. Skuhra.
4975
4976 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
4977
4978 * xml.c (parse_region): Make the parsing work for
4979 non-comment-starting XML files again (bug#9144).
4980
4981 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
4982
4983 * image.c (gif_load): Fix calculation of bottom and right corner.
4984 (Bug#9468)
4985
4986 2011-09-10 Eli Zaretskii <eliz@gnu.org>
4987
4988 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
4989 redisplay in small windows.
4990
4991 2011-09-09 Eli Zaretskii <eliz@gnu.org>
4992
4993 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
4994
4995 2011-09-08 Martin Rudalics <rudalics@gmx.at>
4996
4997 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
4998 Operate on live windows only.
4999
5000 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
5001
5002 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
5003
5004 2011-09-07 Eli Zaretskii <eliz@gnu.org>
5005
5006 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
5007 only under bidi iteration.
5008
5009 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
5010
5011 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
5012
5013 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5014
5015 isnan: Fix porting problem to Solaris 10 with bundled gcc.
5016 Without this fix, the command to link temacs failed due to an
5017 undefined symbol __builtin_isnan. This is because
5018 /usr/include/iso/math_c99.h #defines isnan(x) to
5019 __builtin_isnan(x), but the bundled gcc, which identifies itself
5020 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
5021 a __builtin_isnan.
5022 * floatfns.c (isnan): #undef, and then #define to a clone of
5023 what's in data.c.
5024 (Fisnan): Always define, since it's always available now.
5025 (syms_of_floatfns): Always define isnan at the Lisp level.
5026
5027 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5028
5029 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
5030
5031 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 * fileio.c: Fix bugs with large file offsets (Bug#9428).
5034 The previous code assumed that file offsets (off_t values) fit in
5035 EMACS_INT variables, which is not true on typical 32-bit hosts.
5036 The code messed up by falsely reporting buffer overflow in cases
5037 such as (insert-file-contents "big" nil 1 2) into an empty buffer
5038 when "big" contains more than 2**29 bytes, even though this
5039 inserts just one byte and does not overflow the buffer.
5040 (Finsert_file_contents): Store file offsets as off_t
5041 values, not as EMACS_INT values. Check for overflow when
5042 converting between EMACS_INT and off_t. When checking for
5043 buffer overflow or for overlap, take the offsets into account.
5044 Don't use EMACS_INT for small values where int suffices.
5045 When checking for overlap, fix a typo: ZV was used where
5046 ZV_BYTE was intended.
5047 (Fwrite_region): Don't assume off_t fits into 'long'.
5048 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
5049
5050 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
5051
5052 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
5053
5054 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5055
5056 sprintf-related integer and memory overflow issues (Bug#9412).
5057
5058 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
5059 (esprintf, exprintf, evxprintf): New functions.
5060 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
5061 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
5062 (modify_event_symbol): Do not assume that the length of
5063 name_alist_or_stem is safe to alloca and fits in int.
5064 (Fexecute_extended_command): Likewise for function name and binding.
5065 (Frecursion_depth): Wrap around reliably on integer overflow.
5066 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
5067 since some callers pass EMACS_INT values.
5068 (Fsingle_key_description): Don't crash if symbol name contains more
5069 than MAX_ALLOCA bytes.
5070 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
5071 (get_minibuffer): Arg is now EMACS_INT, not int.
5072 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
5073 (esprintf, exprintf, evxprintf): New decls.
5074 * window.h (command_loop_level, minibuf_level): Reflect API changes.
5075
5076 * dbusbind.c (signature_cat): New function.
5077 (xd_signature, Fdbus_register_signal):
5078 Do not overrun buffer; instead, report string overflow.
5079
5080 * dispnew.c (add_window_display_history): Don't overrun buffer.
5081 Truncate instead; this is OK since it's just a log.
5082
5083 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
5084 even if the time zone offset is outlandishly large.
5085 Don't mishandle offset == INT_MIN.
5086
5087 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
5088 when creating daemon; the previous buffer-overflow check was incorrect.
5089
5090 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
5091 which has the guts of the old verror function.
5092
5093 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
5094 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
5095
5096 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
5097 (font_unparse_xlfd): Don't blindly alloca long strings.
5098 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
5099 fits in int, when using sprintf. Use single snprintf to count
5100 length of string rather than counting it via multiple sprintfs;
5101 that's simpler and more reliable.
5102 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
5103 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
5104 sprintf, in case result does not fit in int.
5105
5106 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
5107 (fontset_from_font): Print it.
5108
5109 * frame.c (tty_frame_count): Now printmax_t, not int.
5110 (make_terminal_frame, set_term_frame_name): Print it.
5111 (x_report_frame_params): In X, window IDs are unsigned long,
5112 not signed long, so print them as unsigned.
5113 (validate_x_resource_name): Check for implausibly long names,
5114 and don't assume name length fits in 'int'.
5115 (x_get_resource_string): Don't blindly alloca invocation name;
5116 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
5117 not fit in int.
5118
5119 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
5120 (xg_check_special_colors, xg_set_geometry):
5121 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
5122
5123 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
5124 Use esprintf, not sprintf, in case result does not fit in int.
5125
5126 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5127 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
5128 it as a large positive number.
5129 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
5130 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5131
5132 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
5133 in case result does not fit in int.
5134
5135 * print.c (float_to_string): Detect width overflow more reliably.
5136 (print_object): Make sprintf buffer a bit bigger, to avoid potential
5137 buffer overrun. Don't assume list length fits in 'int'. Treat
5138 print length of 0 as 0, not as infinity; to be consistent with other
5139 uses of print length in this function. Don't overflow print length
5140 index. Don't assume hash table size fits in 'long', or that
5141 vectorlike size fits in 'unsigned long'.
5142
5143 * process.c (make_process): Use printmax_t, not int, to format
5144 process-name gensyms.
5145
5146 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
5147
5148 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
5149 to avoid potential buffer overrun.
5150
5151 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
5152 if X resource line is longer than 512 bytes.
5153
5154 * xfns.c (x_window): Make sprintf buffer a bit bigger
5155 to avoid potential buffer overrun.
5156
5157 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
5158
5159 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
5160
5161 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5162
5163 Integer overflow fixes for scrolling, etc.
5164 Without these, Emacs silently mishandles large integers sometimes.
5165 For example, "C-u 4294967297 M-x recenter" was treated as if
5166 it were "C-u 1 M-x recenter" on a typical 64-bit host.
5167
5168 * xdisp.c (try_window_id): Check Emacs fixnum range before
5169 converting to 'int'.
5170
5171 * window.c (window_scroll_line_based, Frecenter):
5172 Check that an Emacs fixnum is in range before assigning it to 'int'.
5173 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
5174 values converted from Emacs fixnums.
5175 (Frecenter): Don't wrap around a line count if it is out of 'int'
5176 range; instead, treat it as an extreme value.
5177 (Fset_window_configuration, compare_window_configurations):
5178 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
5179
5180 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
5181 that can exceed INT_MAX. Check that EMACS_INT value is in range
5182 before assigning it to the (possibly-narrower) index.
5183 (match_limit): Don't assume that a fixnum can fit in 'int'.
5184
5185 * print.c (print_object): Use ptrdiff_t, not int, for index that can
5186 exceed INT_MAX.
5187
5188 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
5189 (Fvertical_motion): Don't wrap around LINES values that don't fit
5190 in 'int'. Instead, treat them as extreme values. This is good
5191 enough for windows, which can't have more than INT_MAX lines anyway.
5192
5193 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5194
5195 * Require libxml/parser.h to avoid compilation warning.
5196
5197 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
5198
5199 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
5200 since this reportedly can destroy thread storage.
5201
5202 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
5203
5204 * syntax.c (find_defun_start): Update all cache variables if
5205 exiting early (Bug#9401).
5206
5207 2011-08-30 Eli Zaretskii <eliz@gnu.org>
5208
5209 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
5210
5211 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
5212 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
5213 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
5214
5215 * term.c (tty_append_glyph): New function.
5216 (produce_stretch_glyph): Static function and its prototype deleted.
5217
5218 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
5219 Add prototypes.
5220
5221 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 * image.c (parse_image_spec): Check for nonnegative, not for positive,
5224 when checking :margin (Bug#9390).
5225 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
5226 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
5227 so that the name doesn't mislead. All uses changed.
5228
5229 2011-08-28 Johan Bockgård <bojohan@gnu.org>
5230
5231 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
5232 set_tty_hooks.
5233
5234 2011-08-27 Eli Zaretskii <eliz@gnu.org>
5235
5236 * xdisp.c (move_it_to): Don't bail out early when reaching
5237 position beyond to_charpos, if we are scanning backwards.
5238 (move_it_vertically_backward): When DY == 0, make sure we get to
5239 the first character in the line after the newline.
5240
5241 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
5242
5243 * ccl.c: Improve and simplify overflow checking (Bug#9196).
5244 (ccl_driver): Do not generate an out-of-range pointer.
5245 (Fccl_execute_on_string): Remove unnecessary check for
5246 integer overflow, noted by Stefan Monnier in
5247 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
5248 Remove a FIXME that didn't need fixing.
5249 Simplify the newly-introduced buffer reallocation code.
5250
5251 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
5252
5253 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
5254
5255 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
5256
5257 Integer and memory overflow issues (Bug#9196).
5258
5259 * doc.c (get_doc_string): Rework so that
5260 get_doc_string_buffer_size is the actual buffer size, rather than
5261 being 1 less than the actual buffer size; this makes xpalloc more
5262 convenient.
5263
5264 * image.c (x_allocate_bitmap_record, cache_image):
5265 * xselect.c (Fx_register_dnd_atom):
5266 Simplify previous changes by using xpalloc.
5267
5268 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
5269 since either will do and ptrdiff_t is convenient with xpalloc.
5270
5271 * charset.c (charset_table_size)
5272 (struct charset_sort_data.priority): Now ptrdiff_t.
5273 (charset_compare): Don't overflow if priorities differ greatly.
5274 (Fsort_charsets): Don't assume list length fits in int.
5275 Check for size-calculation overflow when allocating sort data.
5276 (syms_of_charset): Allocate an initial charset table that is
5277 just under 64 KiB, to avoid problems with glibc malloc and mmap.
5278
5279 * cmds.c (internal_self_insert): Check for size-calculation overflow.
5280
5281 * composite.h (struct composition.glyph_len): Now int, not unsigned.
5282 The actual value is always <= INT_MAX, and leaving it unsigned made
5283 overflow checking harder.
5284
5285 * dispextern.h (struct glyph_matrix.rows_allocated)
5286 (struct face_cache.size): Now ptrdiff_t, for convenience in use
5287 with xpalloc. The values are still always <= INT_MAX.
5288
5289 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
5290
5291 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
5292 (SAFE_NALLOCA): New macro.
5293
5294 * region-cache.c (struct boundary.pos, find_cache_boundary)
5295 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
5296 (set_cache_region, invalidate_region_cache)
5297 (revalidate_region_cache, know_region_cache, region_cache_forward)
5298 (region_cache_backward, pp_cache):
5299 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
5300 so that ptrdiff_t * can be passed to xpalloc.
5301 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
5302 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
5303 (pp_cache): Don't assume cache_len fits in int.
5304 * region-cache.h: Adjust extern decls to match.
5305
5306 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
5307 EMACS_INT, since either will do, for xpalloc.
5308
5309 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
5310 (xnmalloc, xnrealloc, xpalloc): New functions.
5311
5312 * bidi.c (bidi_shelve_header_size): New constant.
5313 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
5314 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
5315
5316 * bidi.c (bidi_cache_shrink):
5317 * buffer.c (overlays_at, overlays_in, record_overlay_string)
5318 (overlay_strings):
5319 Don't update size of array until after memory allocation succeeds,
5320 because xmalloc/xrealloc may not return.
5321 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
5322 now that we have proper integer overflow checking.
5323 (record_overlay_string, overlay_strings): Catch overflows when
5324 calculating size of overlay_str_buf.
5325
5326 * callproc.c (Fcall_process): Check for size overflow when
5327 calculating size of args2.
5328 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
5329 Normally we prefer signed values, but sticking with ptrdiff_t would
5330 require adding more-complicated checks.
5331
5332 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
5333 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
5334 Redo buffer-overflow calculations to avoid integer overflow.
5335 Add a FIXME comment where memory seems to be over-allocated.
5336
5337 * character.c (Fstring): Check for size-calculation overflow.
5338
5339 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
5340 unnecessary integer overflow. Check for size overflow.
5341 (encode_coding_object): Don't update size until xmalloc succeeds.
5342
5343 * composite.c (get_composition_id): Check for overflow in glyph
5344 length calculations.
5345
5346 Integer and memory overflow fixes for display code.
5347 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
5348 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
5349 (scrolling_window): Check for overflow in size calculations.
5350 (line_draw_cost, realloc_glyph_pool, add_row_entry):
5351 Don't assume glyph table len fits in int.
5352 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
5353 (row_table_size): Now ptrdiff_t, not int.
5354 (scrolling_window): Avoid overflow in size calculations.
5355 Don't update size until allocation succeeds.
5356 * fns.c (concat): Check for overflow in size calculations.
5357 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
5358 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5359 (NEXT_ALMOST_PRIME_LIMIT): New constant.
5360
5361 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
5362 (get_doc_string): Check for size calculation overflow.
5363 Don't update size until allocation succeeds.
5364 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
5365 EMACS_INT, where ptrdiff_t will do.
5366 (Fsubstitute_command_keys): Check for string overflow.
5367
5368 * editfns.c (set_time_zone_rule): Don't assume environment length
5369 fits in int.
5370 (message_length): Now ptrdiff_t, not int.
5371 (Fmessage_box): Don't update size until allocation succeeds.
5372 Don't assume message length fits in int.
5373 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
5374
5375 * emacs.c (main): Do not reallocate argv, since there is a null at
5376 the end that can be overwritten, and this way there's no need to
5377 worry about size-calculation overflow.
5378 (sort_args): Check for size-calculation overflow.
5379
5380 * eval.c (init_eval_once, grow_specpdl): Don't update size until
5381 alloc succeeds.
5382 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
5383
5384 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
5385 (x_set_scroll_bar_width, x_figure_window_size):
5386 Check for integer overflow.
5387 (x_set_alpha): Do not assume XINT fits in int.
5388
5389 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
5390 This is for the members text_lines, text_cols, total_lines, total_cols,
5391 where the system imposes an 'int' limit.
5392
5393 * fringe.c (Fdefine_fringe_bitmap):
5394 Don't update size until alloc works.
5395
5396 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
5397 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
5398
5399 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
5400 Check for size-calculation overflow.
5401 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
5402 do, as we prefer signed integers.
5403 (id_to_widget.max_size, id_to_widget.used)
5404 (xg_store_widget_in_map, xg_remove_widget_from_map)
5405 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
5406 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
5407 Use and return ptrdiff_t, not int.
5408 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
5409 * gtkutil.h: Change prototypes to match the above.
5410
5411 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
5412 are duplicate now that they've been promoted to lisp.h.
5413 (x_allocate_bitmap_record, x_alloc_image_color)
5414 (make_image_cache, cache_image, xpm_load):
5415 Don't update size until alloc is done.
5416 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
5417 (x_detect_edges):
5418 Check for size calculation overflow.
5419 (ct_colors_allocated_max): New constant.
5420 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
5421 overflow.
5422
5423 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
5424 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
5425 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
5426 Use ptrdiff_t, not int, to count maps.
5427 (read_char_minibuf_menu_prompt): Check for overflow in size
5428 calculations. Don't update size until allocation succeeds.
5429 Redo calculations to avoid overflow.
5430 * keyboard.h: Change prototypes to match the above.
5431
5432 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
5433 to count maps.
5434 (current_minor_maps): Check for size calculation overflow.
5435 * keymap.h: Change prototypes to match the above.
5436
5437 * lread.c (read1, init_obarray): Don't update size until alloc done.
5438
5439 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
5440 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
5441
5442 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
5443 Now ptrdiff_t, not int.
5444 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
5445 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
5446
5447 * process.c (Fnetwork_interface_list): Check for overflow
5448 in size calculation.
5449
5450 * region-cache.c (move_cache_gap): Check for size calculation overflow.
5451
5452 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
5453 overflow. Don't bother calling xmalloc when xrealloc will do.
5454
5455 * search.c (Freplace_match): Check for size calculation overflow.
5456 (Fset_match_data): Don't assume list lengths fit in 'int'.
5457
5458 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
5459 for command line length. Do not attempt to address one before the
5460 beginning of an array, as that's not portable.
5461
5462 * term.c (max_frame_lines): Remove; unused.
5463 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
5464 not int.
5465 (encode_terminal_code, calculate_costs): Check for size
5466 calculation overflow.
5467 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
5468 table lengths and related sizes. Don't update size until alloc
5469 done. Redo calculations to avoid overflow.
5470 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
5471
5472 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
5473 subtracting pointers.
5474 (gobble_line): Check for overflow more carefully. Don't update size
5475 until alloc done.
5476
5477 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
5478 Don't update size until alloc done.
5479 Redo size calculations to avoid overflow.
5480 Check for size calculation overflow.
5481 (main) [DEBUG]: Fix typo in invoking tparam1.
5482
5483 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
5484 Use ptrdiff_t, not int, for sizes.
5485 (store_mode_line_noprop_char): Don't update size until alloc done.
5486
5487 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
5488 Use ptrdiff_t, not int, for sizes.
5489 (Finternal_make_lisp_face, cache_face):
5490 Check for size calculation overflow.
5491 (cache_face): Treat size calculation overflows as if they were
5492 memory exhaustion (the usual treatment), rather than aborting.
5493
5494 * xfns.c (x_encode_text, x_set_name_internal)
5495 (Fx_change_window_property): Use ptrdiff_t, not int, to count
5496 sizes, since they can exceed INT_MAX in size. Check for size
5497 calculation overflow.
5498
5499 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
5500 (xg_select): Check for size calculation overflow.
5501 Don't update size until alloc done.
5502
5503 * xrdb.c (get_environ_db): Don't assume path length fits in int,
5504 as sprintf is limited to int lengths.
5505
5506 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
5507 (X_LONG_MIN): New macros.
5508 Use them to make the following changes clearer.
5509 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
5510 This change doesn't affect the value now, but it may help remind
5511 future maintainers not to raise the value too much later.
5512 (SELECTION_QUANTUM): Remove, replacing with ...
5513 (selection_quantum): ... new function, which avoids overflow.
5514 All uses changed.
5515 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
5516 assumption that selection length fits in 'int'.
5517 (x_reply_selection_request, x_handle_selection_request)
5518 (x_get_window_property, receive_incremental_selection)
5519 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
5520 (lisp_data_to_selection_data, clean_local_selection_data):
5521 Use ptrdiff_t, not int, to record length of selection.
5522 (x_reply_selection_request, x_get_window_property)
5523 (receive_incremental_selection, x_property_data_to_lisp):
5524 Redo calculations to avoid overflow.
5525 (x_reply_selection_request): When sending hint, ceiling it at
5526 X_LONG_MAX rather than relying on wraparound overflow to send
5527 something.
5528 (x_get_window_property, receive_incremental_selection)
5529 (lisp_data_to_selection_data, x_property_data_to_lisp):
5530 Check for size-calculation overflow.
5531 (x_get_window_property, receive_incremental_selection)
5532 (lisp_data_to_selection_data, Fx_register_dnd_atom):
5533 Don't store size until memory allocation succeeds.
5534 (x_get_window_property): Plug memory leak on memory exhaustion.
5535 Don't double-block input; malloc is safe here. Don't assume 2**34
5536 - 4 fits in unsigned long. Add an xassert to check
5537 XGetWindowProperty overflow. Be more careful about overflow
5538 calculations, and distinguish size from memory overflow better.
5539 (receive_incremental_selection): When tracing, don't assume
5540 unsigned int is less than INT_MAX.
5541 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
5542 harmful) conversions of unsigned short to int.
5543 (lisp_data_to_selection_data): Don't assume that integers
5544 in the range -65535 through -1 fit in an X unsigned short.
5545 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
5546 result parameters unless successful. Rely on cons_to_unsigned
5547 to report problems with elements; the old code wasn't right anyway.
5548 (x_check_property_data): Check for int overflow; we cannot use
5549 a wider type due to X limits.
5550 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
5551
5552 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
5553
5554 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
5555 (x_term_init): Check for size calculation overflow.
5556 (x_color_cells): Don't store size until memory allocation succeeds.
5557 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
5558 Don't assume alloca size is less than MAX_ALLOCA.
5559 (x_term_init): Don't assume length fits in int (sprintf is limited
5560 to int size).
5561
5562 Use ptrdiff_t for composition IDs.
5563 * character.c (lisp_string_width):
5564 * composite.c (composition_table_size, n_compositions)
5565 (get_composition_id, composition_gstring_from_id):
5566 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
5567 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
5568 * window.c (Frecenter):
5569 Use ptrdiff_t, not int, for composition IDs.
5570 * composite.c (get_composition_id): Check for integer overflow.
5571 * composite.h: Adjust prototypes to match the above changes.
5572
5573 Use ptrdiff_t for hash table indexes.
5574 * category.c (hash_get_category_set):
5575 * ccl.c (ccl_driver):
5576 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
5577 * coding.c (coding_system_charset_list, detect_coding_system):
5578 * coding.h (struct coding_system.id):
5579 * composite.c (get_composition_id, gstring_lookup_cache):
5580 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
5581 * image.c (xpm_get_color_table_h):
5582 * lisp.h (hash_lookup, hash_put):
5583 * minibuf.c (Ftest_completion):
5584 Use ptrdiff_t for hash table indexes, not int (which is too
5585 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
5586 32-bit --with-wide-int hosts).
5587
5588 * charset.c (Fdefine_charset_internal): Check for integer overflow.
5589 Add a FIXME comment about memory leaks.
5590 (syms_of_charset): Don't assume xmalloc returns.
5591
5592 Don't assume that stated character widths fit in int.
5593 * character.c (Fchar_width, c_string_width, lisp_string_width):
5594 * character.h (CHAR_WIDTH):
5595 * indent.c (MULTIBYTE_BYTES_WIDTH):
5596 Use sanitize_char_width to avoid undefined and/or bad behavior
5597 with outlandish widths.
5598 * character.h (sanitize_tab_width): Rename from sanitize_width,
5599 now that we have two such functions. All uses changed.
5600 (sanitize_char_width): New inline function.
5601
5602 Don't assume that tab-width fits in int.
5603 * character.h (sanitize_width): New inline function.
5604 (SANE_TAB_WIDTH): New macro.
5605 (ASCII_CHAR_WIDTH): Use it.
5606 * indent.c (sane_tab_width): Remove. All uses replaced by
5607 SANE_TAB_WIDTH (current_buffer).
5608 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
5609
5610 * fileio.c: Integer overflow issues with file modes.
5611 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
5612
5613 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
5614 Remove unreachable code.
5615 (read_hex, load_charset_map_from_file): Check for integer overflow.
5616
5617 * xterm.c: Don't go over XClientMessageEvent limit.
5618 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
5619 (x_send_scroll_bar_event): Likewise. Check that the size does not
5620 exceed limits imposed by XClientMessageEvent, as well as the usual
5621 ptrdiff_t and size_t limits.
5622
5623 * keyboard.c: Overflow, signedness and related fixes.
5624 (make_lispy_movement): Use same integer type in forward decl
5625 that is used in the definition.
5626 (read_key_sequence, keyremap_step):
5627 Change bufsize argument back to int, undoing my 2011-03-30 change.
5628 We prefer signed types, and int is wide enough here.
5629 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
5630 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
5631 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
5632 length, not size_t. Use ptrdiff_t for index, not int.
5633 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
5634 possibility of integer overflow.
5635
5636 Overflow, signedness and related fixes for images.
5637
5638 * dispextern.h (struct it.stack[0].u.image.image_id)
5639 (struct_it.image_id, struct image.id, struct image_cache.size)
5640 (struct image_cache.used, struct image_cache.ref_count):
5641 * gtkutil.c (update_frame_tool_bar):
5642 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
5643 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
5644 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
5645 * nsmenu.m (update_frame_tool_bar):
5646 * xdisp.c (calc_pixel_width_or_height):
5647 * xfns.c (image_cache_refcount):
5648 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
5649 on typical 64-bit hosts.
5650
5651 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5652 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
5653 Omit unnecessary casts to int.
5654 (parse_image_spec): Check that integers fall into 'int' range
5655 when the callers expect that.
5656 (image_ascent): Redo ascent calculation to avoid int overflow.
5657 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
5658 (lookup_image): Remove unnecessary tests.
5659 (xbm_image_p): Locals are now of int, not EMACS_INT,
5660 since parse_image_check makes sure they fit into int.
5661 (png_load, gif_load, svg_load_image):
5662 Prefer int to unsigned where either will do.
5663 (tiff_handler): New function, combining the cores of the
5664 old tiff_error_handler and tiff_warning_handler.
5665 This function is rewritten to use vsnprintf and thereby avoid
5666 stack buffer overflows. It uses only the features of vsnprintf
5667 that are common to both POSIX and native Microsoft.
5668 (tiff_error_handler, tiff_warning_handler): Use it.
5669 (tiff_load, gif_load, imagemagick_load_image):
5670 Don't assume :index value fits in 'int'.
5671 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
5672 (imagemagick_load_image): Check that crop parameters fit into
5673 the integer types that MagickCropImage accepts. Don't assume
5674 Vimagemagick_render_type has a nonnegative value. Don't assume
5675 size_t fits in 'long'.
5676 (gs_load): Use printmax_t to print the widest integers possible.
5677 Check for integer overflow when computing image height and width.
5678
5679 2011-08-26 Eli Zaretskii <eliz@gnu.org>
5680
5681 * xdisp.c (redisplay_window): Don't force window start if point
5682 will be invisible in the resulting window. (Bug#9324)
5683
5684 2011-08-25 Eli Zaretskii <eliz@gnu.org>
5685
5686 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
5687 the display spec is of the form `(space ...)'.
5688 (handle_display_spec): Return the value returned by
5689 handle_single_display_spec, not just 1 or zero.
5690 (handle_single_display_spec): If the display spec is of the form
5691 `(space ...)', and specifies display in the text area, return 2
5692 rather than 1.
5693 (try_cursor_movement): Check for the need to scroll more
5694 accurately, and prefer exact match for point under bidi.
5695 Don't advance `row' beyond the last row of the window.
5696
5697 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
5698 into disp_prop; all users changed.
5699
5700 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
5701 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
5702 for the text covered by the display property.
5703
5704 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
5705
5706 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
5707 Change return value to nil.
5708 (Frecord_buffer): Delete unused function.
5709
5710 2011-08-24 Eli Zaretskii <eliz@gnu.org>
5711
5712 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
5713 buffers, return left-to-right.
5714 (set_cursor_from_row): Consider candidate row a win if its glyph
5715 represents a newline and point is on that newline. Fixes cursor
5716 positioning on the newline at EOL of R2L text within L2R
5717 paragraph, and vice versa.
5718 (try_cursor_movement): Check continued rows, in addition to
5719 continuation rows. Fixes unwarranted scroll when point enters a
5720 continued line of R2L text within an L2R paragraph, or vice versa.
5721 (cursor_row_p): Consider the case of point being equal to
5722 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
5723 from the end of a short line to the beginning of a continued line
5724 of R2L text within L2R paragraph.
5725 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
5726 composed characters.
5727
5728 * bidi.c (bidi_check_type): Use xassert.
5729 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
5730 members.
5731
5732 2011-08-23 Eli Zaretskii <eliz@gnu.org>
5733
5734 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
5735 a character.
5736
5737 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
5738
5739 * nsfont.m (ns_otf_to_script): Fix typo.
5740
5741 2011-08-22 Kenichi Handa <handa@m17n.org>
5742
5743 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
5744 extra slot even if the purpose is char-code-property-table.
5745
5746 2011-08-23 Eli Zaretskii <eliz@gnu.org>
5747
5748 * xdisp.c (redisplay_window): When computing centering_position,
5749 account for the height of the header line. (Bug#8874)
5750
5751 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
5752 instead of CHAR_TO_BYTE. Fixes a crash when a completion
5753 candidate is selected by the mouse, and that candidate has a
5754 composed character under the mouse.
5755
5756 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
5757 coordinates reported by pos-visible-in-window-p for a composed
5758 character in column zero.
5759
5760 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
5761
5762 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
5763
5764 2011-08-22 Eli Zaretskii <eliz@gnu.org>
5765
5766 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
5767 consider it a hit if to_charpos is anywhere in the range of the
5768 composed buffer positions.
5769
5770 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
5771
5772 * image.c (gif_load): Don't assume that each subimage has the same
5773 dimensions as the base image. Handle disposal method that is
5774 "undefined" by the gif spec (Bug#9335).
5775
5776 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
5777
5778 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
5779 (Fcondition_case): Document `debug' symbol in error handler.
5780
5781 2011-08-19 Eli Zaretskii <eliz@gnu.org>
5782
5783 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
5784 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
5785 from an Org mode buffer to a Speedbar frame.
5786
5787 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
5788 a composition, take its buffer position from IT->cmp_it.charpos.
5789 Fixes cursor positioning at the beginning of a line that begins
5790 with a composed character.
5791
5792 2011-08-18 Eli Zaretskii <eliz@gnu.org>
5793
5794 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
5795 character bidirectional type, use STRONG_L instead. Fixes crashes
5796 in a buffer produced by `describe-categories'.
5797
5798 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
5799 members before the level stack, so they would be saved and
5800 restored when copying iterator state. Fixes incorrect reordering
5801 around TABs covered by display properties.
5802
5803 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
5804
5805 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
5806
5807 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
5808
5809 * eval.c (internal_condition_case, internal_condition_case_1)
5810 (internal_condition_case_2, internal_condition_case_n):
5811 Remove unnecessary aborts (Bug#9081).
5812
5813 2011-08-17 Eli Zaretskii <eliz@gnu.org>
5814
5815 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
5816 has no `load' handler, try opening the file locally. (Bug#9311)
5817
5818 2011-08-16 Ken Brown <kbrown@cornell.edu>
5819
5820 * gmalloc.c: Expand comment.
5821
5822 2011-08-16 Eli Zaretskii <eliz@gnu.org>
5823
5824 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
5825 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
5826
5827 2011-08-16 Ken Brown <kbrown@cornell.edu>
5828
5829 Fix memory allocation problems in Cygwin build (Bug#9273).
5830
5831 * unexcw.c ( __malloc_initialized): Declare external variable.
5832 (fixup_executable): Force the dumped emacs to reinitialize malloc.
5833
5834 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
5835 New variables.
5836 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
5837 dumped emacs.
5838 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
5839 in the static heap.
5840 [CYGWIN] (special_realloc): New function.
5841 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
5842 requests to realloc storage in the static heap.
5843
5844 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
5845
5846 * bidi.c (bidi_initialize): Remove unused local.
5847
5848 2011-08-15 Eli Zaretskii <eliz@gnu.org>
5849
5850 * bidimirror.h:
5851 * biditype.h: Remove file.
5852 * makefile.w32-in ($(BLD)/bidi.$(O)):
5853 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
5854
5855 * dispextern.h: Fix a typo in the comment to bidi_type_t.
5856
5857 * chartab.c: Improve commentary for the uniprop_table API.
5858
5859 * bidi.c (bidi_paragraph_init): Support zero value of
5860 bidi_ignore_explicit_marks_for_paragraph_level.
5861 (bidi_initialize): Use uniprop_table instead of including
5862 biditype.h and bidimirror.h.
5863
5864 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
5865 coordinates of the iterator when restoring from ppos_it.
5866 (Bug#9296)
5867
5868 2011-08-14 Kenichi Handa <handa@m17n.org>
5869
5870 * process.c (create_process): Call setup_process_coding_systems
5871 after the pid of the process is set to -1 (Bug#8162).
5872
5873 2011-08-14 Eli Zaretskii <eliz@gnu.org>
5874
5875 * xdisp.c (move_it_in_display_line_to): Don't invoke
5876 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
5877 ppos_it. Fixes vertical cursor motion when line beginning is
5878 covered by an image. (Bug#9296)
5879
5880 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
5881
5882 * nsterm.h (ns_run_ascript): Declare.
5883 (NSAPP_DATA2_RUNASSCRIPT): Define.
5884
5885 * nsfns.m (as_script, as_result, as_status): New static variables.
5886 (ns_run_ascript): New function.
5887 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
5888 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
5889 the event loop. Get status from as_status (Bug#7276).
5890
5891 * nsterm.m (sendEvent): If event is NSApplicationDefined and
5892 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
5893 the event loop (Bug#7276).
5894
5895 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
5896
5897 * gnutls.c (QCgnutls_bootprop_priority)
5898 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
5899 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
5900 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
5901 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
5902 (QCgnutls_bootprop_verify_hostname_error)
5903 (QCgnutls_bootprop_callbacks_verify): Rename from
5904 Qgnutls_bootprop_..., all uses changed.
5905
5906 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
5907 uses changed.
5908
5909 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
5910
5911 * xfaces.c (Qframe_set_background_mode): Now static.
5912 * dispextern.h (Qframe_set_background_mode): Remove decl.
5913
5914 * process.c (Fnetwork_interface_info): Declare local only if needed.
5915
5916 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
5917
5918 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
5919 (Fnetwork_interface_list): Allocate in increments of bytes instead
5920 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
5921 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
5922 sockaddr.
5923 (struct ifflag_def): notrailers is smart on OSX.
5924 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
5925 Get hardware address with getifaddrs if available.
5926
5927 2011-08-12 Eli Zaretskii <eliz@gnu.org>
5928
5929 * xdisp.c (iterate_out_of_display_property): xassert that
5930 IT->position is set to within IT->object's boundaries. Break from
5931 the loop as soon as EOB is reached; avoids infloops in redisplay
5932 when IT->position is set up wrongly due to some bug.
5933 Set IT->current to match the bidi iterator unconditionally.
5934 (push_display_prop): Allow GET_FROM_STRING as IT->method on
5935 entry. Force push_it to save on the stack the current
5936 buffer/string position, to be restored by pop_it. Fix flags in
5937 the iterator structure wrt the object coming from a display
5938 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
5939 properties. (Bug#9284)
5940
5941 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
5942
5943 * fontset.c (fontset_get_font_group): Add proper type checks.
5944 (Bug#9172)
5945
5946 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5947
5948 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
5949 and LC_VERSION_MIN_MACOSX.
5950 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
5951 (dump_it) [LC_FUNCTION_STARTS]: Use it.
5952
5953 2011-08-08 Eli Zaretskii <eliz@gnu.org>
5954
5955 * xdisp.c (forward_to_next_line_start): Allow to use the
5956 no-display-properties-and-no-overlays under bidi display.
5957 Set disp_pos in the bidi iterator to avoid searches for display
5958 properties and overlays.
5959
5960 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
5961
5962 * editfns.c (Fset_time_zone_rule): Document relationship with the
5963 setenv function.
5964
5965 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
5966 the font entity extracted from the cache (Bug#8109).
5967
5968 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
5969
5970 * composite.c (autocmp_chars): Don't reset point. That is done by
5971 restore_point_unwind (Bug#5984).
5972
5973 2011-08-07 Juri Linkov <juri@jurta.org>
5974
5975 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
5976 to show the arg `TIME' instead of `TIMEVAL'.
5977
5978 2011-08-06 Eli Zaretskii <eliz@gnu.org>
5979
5980 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
5981 display property strides EOL and includes a newline, as in
5982 longlines-mode. (Bug#9254)
5983 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
5984 word-wrap under bidirectional display. (Bug#9224)
5985
5986 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
5987 is non-zero, even if the data buffer is NULL. Fixes a crash in
5988 vertical-motion with longlines-mode. (Bug#9254)
5989
5990 2011-08-05 Eli Zaretskii <eliz@gnu.org>
5991
5992 * bidi.c <bidi_cache_total_alloc>: Now static.
5993 (bidi_initialize): Initialize bidi_cache_total_alloc.
5994
5995 * xdisp.c (display_line): Release buffer allocated for shelved bidi
5996 cache. (Bug#9221)
5997
5998 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
5999 amount allocated this far in `bidi_cache_total_alloc'.
6000 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
6001 non-zero, only free the data buffer without restoring the cache
6002 contents. All callers changed.
6003
6004 * dispextern.h (bidi_unshelve_cache): Update prototype.
6005
6006 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
6007 (move_it_in_display_line, move_it_to)
6008 (move_it_vertically_backward, move_it_by_lines): Replace the call
6009 to xfree to an equivalent call to bidi_unshelve_cache.
6010 (move_it_in_display_line_to): Fix logic of returning
6011 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
6012
6013 2011-08-05 Eli Zaretskii <eliz@gnu.org>
6014
6015 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
6016 came from a string character with a `cursor' property. (Bug#9229)
6017
6018 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6019
6020 * Makefile.in (LIB_PTHREAD): New variable.
6021 (LIBES): Add LIB_PTHREAD (Bug#9216).
6022
6023 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
6024 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
6025
6026 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
6027
6028 * regex.c (re_iswctype): Remove some redundant boolean conversions.
6029
6030 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6031
6032 * xterm.c (x_find_topmost_parent): New function.
6033 (x_set_frame_alpha): Find topmost parent window with
6034 x_find_topmost_parent and set the property there also (bug#9181).
6035 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
6036
6037 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
6038
6039 * callproc.c (Fcall_process): Avoid vfork clobbering
6040 the local vars buffer, coding_systems, current_dir.
6041
6042 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
6043
6044 * keymap.c (Fmake_composed_keymap): Move to subr.el.
6045
6046 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
6047
6048 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
6049 so that it is not optimized away.
6050
6051 * xdisp.c (compute_display_string_pos): Remove unused local.
6052
6053 2011-08-02 Eli Zaretskii <eliz@gnu.org>
6054
6055 Fix slow cursor motion and scrolling in large buffers with
6056 selective display, like Org Mode buffers. (Bug#9218)
6057
6058 * dispextern.h (struct bidi_it): New member disp_prop_p.
6059
6060 * xdisp.c: Remove one-slot cache of display string positions.
6061 (compute_display_string_pos): Accept an additional argument
6062 DISP_PROP_P; callers changed. Scan at most 5K characters forward
6063 for a display string or property. If found, set DISP_PROP_P
6064 non-zero.
6065
6066 * bidi.c (bidi_fetch_char): Accept an additional argument
6067 DISP_PROP_P, and pass it to compute_display_string_pos.
6068 Only handle text covered by a display string if DISP_PROP_P is returned
6069 non-zero. All callers of bidi_fetch_char changed.
6070
6071 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
6072
6073 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
6074
6075 2010-12-03 Don March <don@ohspite.net>
6076
6077 * keymap.c (Fdefine_key): Fix non-prefix key error message when
6078 last character M-[char] is translated to ESC [char] (bug#7541).
6079
6080 2011-08-02 Kenichi Handa <handa@m17n.org>
6081
6082 * lisp.h (uniprop_table): Extern it.
6083
6084 * chartab.c (uniprop_table): Make it non-static.
6085
6086 2011-08-01 Eli Zaretskii <eliz@gnu.org>
6087
6088 * xdisp.c (forward_to_next_line_start): Accept additional argument
6089 BIDI_IT_PREV, and store into it the state of the bidi iterator had
6090 on the newline.
6091 (reseat_at_next_visible_line_start): Use the bidi iterator state
6092 returned by forward_to_next_line_start to restore the state of
6093 it->bidi_it after backing up to previous newline. (Bug#9212)
6094
6095 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
6096
6097 * regex.c (re_comp): Protoize.
6098 (re_exec): Fix return type.
6099 (regexec): Fix type of `ret'. (Bug#9203)
6100
6101 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6102
6103 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
6104 This is needed if max-image-size is a floating-point number.
6105
6106 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6107
6108 * print.c (print_object): Print empty symbol as ##.
6109
6110 * lread.c (read1): Read ## as empty symbol.
6111
6112 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6113
6114 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
6115 setting frame foreground color (Bug#9175).
6116 (x_set_background_color): Likewise.
6117
6118 * nsmenu.m (-setText): Size tooltip dimensions precisely to
6119 contents (Bug#9176).
6120 (EmacsTooltip -init): Remove bezels and add shadows to
6121 tooltip windows.
6122
6123 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
6124 or scroll bar (Bug#8470).
6125
6126 * nsfont.m (nsfont_open): Remove assignment to voffset and
6127 unnecessary vars hshink, expand, hd, full_height, min_height.
6128 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
6129
6130 * nsterm.h (nsfont_info): Remove voffset field.
6131
6132 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6133
6134 Implement strike-through and overline on NextStep (Bug#8863).
6135
6136 * nsfont.m (nsfont_open): Use underline position provided by font,
6137 instead of hard-coded value of 2.
6138 (nsfont_draw): Call ns_draw_text_decoration instead.
6139
6140 * nsterm.h: Add declaration for ns_draw_text_decoration.
6141
6142 * nsterm.m (ns_draw_text_decoration): New function for drawing
6143 underline, overline, and strike-through.
6144 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
6145 ns_draw_text_decoration. Change treatment of cursor drawing to
6146 accommodate underlining, etc.
6147
6148 2011-07-28 Eli Zaretskii <eliz@gnu.org>
6149
6150 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
6151 default.
6152
6153 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6154
6155 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
6156 Without this fix, if a signal arrives just after memory fills up,
6157 'malloc' might be invoked reentrantly.
6158
6159 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
6160 In other words, assume that every image size is allowed, on non-X
6161 hosts. This assumption is probably wrong, but it lets Emacs compile.
6162
6163 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6164
6165 * regex.c (re_iswctype): Convert return values to boolean.
6166
6167 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
6168
6169 * xdisp.c (compute_display_string_pos): Don't use cached display
6170 string position if the buffer had its restriction changed.
6171 (Bug#9184)
6172
6173 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6174
6175 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
6176
6177 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6178
6179 Integer signedness and overflow and related fixes. (Bug#9079)
6180
6181 * bidi.c: Integer size and overflow fixes.
6182 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
6183 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
6184 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6185 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
6186 (bidi_find_other_level_edge):
6187 Use ptrdiff_t instead of EMACS_INT where either will do.
6188 This works better on 32-bit hosts configured --with-wide-int.
6189 (bidi_cache_ensure_space): Check for size-calculation overflow.
6190 Use % rather than repeated addition, for better worst-case speed.
6191 Don't set bidi_cache_size until after xrealloc returns, because it
6192 might not return.
6193 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
6194 (bidi_cache_ensure_space): Also check that the bidi cache size
6195 does not exceed that of the largest Lisp string or buffer. See Eli
6196 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
6197
6198 * alloc.c (__malloc_size_t): Remove.
6199 All uses replaced by size_t. See Andreas Schwab's note
6200 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
6201
6202 * image.c: Improve checking for integer overflow.
6203 (check_image_size): Assume that f is nonnull, since
6204 it is always nonnull in practice. This is one less thing to
6205 worry about when checking for integer overflow later.
6206 (x_check_image_size): New function, which checks for integer
6207 overflow issues inside X.
6208 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
6209 This removes the need for a memory_full check.
6210 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
6211 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
6212 (xbm_read_bitmap_data): Change locals back to 'int', since
6213 their values must fit in 'int'.
6214 (xpm_load_image, png_load, tiff_load):
6215 Invoke x_create_x_image_and_pixmap earlier,
6216 to avoid much needless work if the image is too large.
6217 (tiff_load): Treat overly large images as if
6218 x_create_x_image_and_pixmap failed, not as malloc failures.
6219 (gs_load): Use x_check_image_size.
6220
6221 * gtkutil.c: Omit integer casts.
6222 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
6223 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
6224
6225 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
6226
6227 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
6228 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
6229 would wrongly return t on a 64-bit host.
6230
6231 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
6232 The plain *_OVERFLOW macros run afoul of GCC bug 49705
6233 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
6234 and therefore cause GCC to emit a bogus diagnostic in some cases.
6235
6236 * image.c: Integer signedness and overflow and related fixes.
6237 This is not an exhaustive set of fixes, but it's time to
6238 record what I've got.
6239 (lookup_pixel_color, check_image_size): Remove redundant decls.
6240 (check_image_size): Don't assume that arbitrary EMACS_INT values
6241 fit in 'int', or that arbitrary 'double' values fit in 'int'.
6242 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
6243 (tiff_load, imagemagick_load_image):
6244 Check for overflow in size calculations.
6245 (x_create_x_image_and_pixmap): Remove unnecessary test for
6246 xmalloc returning NULL; that can't happen.
6247 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
6248 (xpm_color_bucket): Use better integer hashing function.
6249 (xpm_cache_color): Don't possibly over-allocate memory.
6250 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
6251 (gif_memory_source):
6252 Use ptrdiff_t, not int or size_t, to record sizes.
6253 (png_load): Don't assume values greater than 2**31 fit in 'int'.
6254 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
6255 either works, as we prefer signed integers.
6256 (tiff_read_from_memory, tiff_write_from_memory):
6257 Return tsize_t, not size_t, since that's what the TIFF API wants.
6258 (tiff_read_from_memory): Don't fail simply because the read would
6259 go past EOF; instead, return a short read.
6260 (tiff_load): Omit no-longer-needed casts.
6261 (Fimagemagick_types): Don't assume size fits into 'int'.
6262
6263 Improve hashing quality when configured --with-wide-int.
6264 * fns.c (hash_string): New function, taken from sxhash_string.
6265 Do not discard information about ASCII character case; this
6266 discarding is no longer needed.
6267 (sxhash-string): Use it. Change sig to match it. Caller changed.
6268 * lisp.h: Declare it.
6269 * lread.c (hash_string): Remove, since we now use fns.c's version.
6270 The fns.c version returns a wider integer if --with-wide-int is
6271 specified, so this should help the quality of the hashing a bit.
6272
6273 * emacs.c: Integer overflow minor fix.
6274 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
6275 Define only if GNU_LINUX.
6276 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
6277
6278 * dispnew.c: Integer signedness and overflow fixes.
6279 Remove unnecessary forward decls, that were a maintenance hassle.
6280 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
6281 All uses changed.
6282 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
6283 (scrolling_window): Use ptrdiff_t, not int, for byte count.
6284 (prepare_desired_row, line_draw_cost):
6285 Use int, not unsigned, where either works.
6286 (save_current_matrix, restore_current_matrix):
6287 Use ptrdiff_t, not size_t, where either works.
6288 (init_display): Check for overflow more accurately, and without
6289 relying on undefined behavior.
6290
6291 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
6292 Remove, replacing with the new symbols in lisp.h. All uses changed.
6293 * fileio.c (make_temp_name):
6294 * filelock.c (lock_file_1, lock_file):
6295 * xdisp.c (message_dolog):
6296 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
6297 Use pMd etc. instead.
6298 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
6299 replacing the pWIDE etc. symbols removed from editfns.c.
6300
6301 * keyboard.h (num_input_events): Now uintmax_t.
6302 This is (very slightly) less likely to mess up due to wraparound.
6303 All uses changed.
6304
6305 * buffer.c: Integer signedness fixes.
6306 (alloc_buffer_text, enlarge_buffer_text):
6307 Use ptrdiff_t rather than size_t when either will do, as we prefer
6308 signed integers.
6309
6310 * alloc.c: Integer signedness and overflow fixes.
6311 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
6312 (__malloc_size_t): Default to size_t, not to int.
6313 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
6314 (Fgarbage_collect, mark_object_loop_halt, mark_object):
6315 Prefer ptrdiff_t to size_t when either would do, as we prefer
6316 signed integers.
6317 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
6318 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
6319 Now const. Initialize with values that are in range even if char
6320 is signed.
6321 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
6322 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
6323 These functions do the right thing with sizes > 2**32.
6324 (check_depth): Now ptrdiff_t, not int.
6325 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
6326 Adjust to new way of storing sizes. Check for size overflow bugs
6327 in rest of code.
6328 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
6329 slightly wrong anyway, as it missed one instance of
6330 XMALLOC_OVERRUN_CHECK_OVERHEAD.
6331 (refill_memory_reserve): Omit needless cast to size_t.
6332 (mark_object_loop_halt): Mark as externally visible.
6333
6334 * xselect.c: Integer signedness and overflow fixes.
6335 (Fx_register_dnd_atom, x_handle_dnd_message):
6336 Use ptrdiff_t, not size_t, since we prefer signed.
6337 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
6338 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
6339 x_dnd_atoms_size and x_dnd_atoms_length.
6340
6341 * doprnt.c: Prefer signed to unsigned when either works.
6342 * eval.c (verror):
6343 * doprnt.c (doprnt):
6344 * lisp.h (doprnt):
6345 * xdisp.c (vmessage):
6346 Use ptrdiff_t, not size_t, when using or implementing doprnt,
6347 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
6348 prefer signed arithmetic to avoid comparison confusion.
6349 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
6350 but is a bit tricky.
6351
6352 Assume freestanding C89 headers, string.h, stdlib.h.
6353 * data.c, doprnt.c, floatfns.c, print.c:
6354 Include float.h unconditionally.
6355 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
6356 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
6357 * regex.c: Likewise for stddef.h, string.h.
6358 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
6359 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
6360 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
6361 (STDC_HEADERS): Remove obsolete defines.
6362 * sysdep.c: Include limits.h unconditionally.
6363
6364 Assume support for memcmp, memcpy, memmove, memset.
6365 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
6366 * regex.c (memcmp, memcpy):
6367 Remove; we assume C89 now.
6368
6369 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
6370 (__malloc_safe_bcopy): Remove; no longer needed.
6371
6372 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6373 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
6374 well either way, and we prefer signed to unsigned.
6375
6376 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
6377
6378 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
6379 closes the connection while we're reading (bug#9182).
6380
6381 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
6382
6383 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
6384 are specified (Bug#9168).
6385
6386 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
6387
6388 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
6389 Found by GCC static checking and --with-wide-int on a 32-bit host.
6390
6391 2011-07-25 Eli Zaretskii <eliz@gnu.org>
6392
6393 * xdisp.c (compute_display_string_pos): Fix logic of caching
6394 previous display string position. Initialize cached_prev_pos to
6395 -1. Fixes slow-down at the beginning of a buffer.
6396
6397 2011-07-24 Eli Zaretskii <eliz@gnu.org>
6398
6399 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
6400 for attrs[LFACE_FONTSET_INDEX].
6401
6402 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
6403
6404 * xml.c (parse_region): Remove unused local
6405 that was recently introduced.
6406
6407 2011-07-23 Eli Zaretskii <eliz@gnu.org>
6408
6409 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
6410 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
6411
6412 * xdisp.c (move_it_in_display_line_to): Record the best matching
6413 position for TO_CHARPOS while scanning the line, and restore it on
6414 exit if none of the characters scanned was an exact match.
6415 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
6416 when exact match is impossible due to invisible text, and the
6417 lines are truncated.
6418
6419 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
6420
6421 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
6422 for OSX >= 10.7.
6423
6424 2011-07-22 Eli Zaretskii <eliz@gnu.org>
6425
6426 Fix a significant slow-down of cursor motion with C-n, C-p,
6427 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
6428 auto-repeat under bidi redisplay in fontified buffers.
6429 * xdisp.c (compute_stop_pos_backwards): New function.
6430 (next_element_from_buffer): Call compute_stop_pos_backwards to
6431 find a suitable prev_stop when we find ourselves before
6432 base_level_stop.
6433 (reseat): Don't look for prev_stop, as that could mean a very long
6434 run.
6435 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
6436 <cached_disp_overlay_modiff>: Cache for last found display string
6437 position.
6438 (compute_display_string_pos): Return the cached position if asked
6439 about the same buffer in the same area of character positions, and
6440 the buffer wasn't changed since the time the display string
6441 position was cached.
6442
6443 2011-07-22 Eli Zaretskii <eliz@gnu.org>
6444
6445 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
6446 is an integer, which is important for empty lines. (Bug#9149)
6447
6448 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
6449
6450 * frame.c (Fmodify_frame_parameters): In tty case, update the
6451 default face if necessary (Bug#4238).
6452
6453 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
6454
6455 * editfns.c (Fstring_to_char): No need to explain what a character
6456 is in the docstring (Bug#6576).
6457
6458 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6459
6460 * xml.c (parse_region): Make sure we always return a tree.
6461
6462 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
6463
6464 * xml.c (parse_region): If a document contains only comments,
6465 return that, too.
6466
6467 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6468
6469 * xml.c (make_dom): Return comments, too.
6470
6471 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 Port to OpenBSD.
6474 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
6475 and the surrounding thread.
6476 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
6477 rather than fgets, and retry after EINTR. Otherwise, 'emacs
6478 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
6479 timer goes off.
6480 * s/openbsd.h (BROKEN_SIGIO): Define.
6481 * unexelf.c (unexec) [__OpenBSD__]:
6482 Don't update the .mdebug section of the Alpha COFF symbol table.
6483
6484 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6485
6486 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
6487 (bug#8460).
6488
6489 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
6490
6491 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
6492 This fixes some race conditions on the permissions of any newly
6493 created file.
6494
6495 * alloc.c (valid_pointer_p): Use pipe, not open.
6496 This fixes some permissions issues when debugging.
6497
6498 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
6499 If fchown fails to set both uid and gid, try to set just gid,
6500 as that is sometimes allowed. Adjust the file's mode to eliminate
6501 setuid or setgid bits that are inappropriate if fchown fails.
6502
6503 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6504
6505 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
6506 to compare Lisp_Objects.
6507 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
6508 global_gnutls_log_level, don't mistake it for a Lisp_Object.
6509 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
6510
6511 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
6512
6513 * lread.c (read_integer): Unread even EOF character.
6514 (read1): Likewise. Properly record start position of symbol.
6515
6516 * lread.c (read1): Read `#:' as empty uninterned symbol if no
6517 symbol character follows.
6518
6519 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
6520
6521 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
6522 This works around a problem with the previous change to Fcopy_file.
6523 Recent glibc declares fchown with __attribute__((warn_unused_result)),
6524 and without this change, GCC might complain about discarding
6525 fchown's return value.
6526
6527 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
6528
6529 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
6530
6531 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
6532
6533 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
6534
6535 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
6536
6537 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
6538 it's used from the C level.
6539
6540 * process.c: Use the same condition for POLL_FOR_INPUT in both
6541 keyboard.c and process.c (bug#1858).
6542
6543 2011-07-09 Lawrence Mitchell <wence@gmx.li>
6544
6545 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
6546 (Fgnutls_boot): Use it.
6547
6548 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
6549
6550 * doc.c (Fsubstitute_command_keys): Revert last change.
6551
6552 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
6553
6554 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
6555 quotes the next character, and doesn't affect other longer
6556 sequences (bug#8935).
6557
6558 * lread.c (syms_of_lread): Clarify that is isn't only
6559 `eval-buffer' and `eval-defun' that's affected by
6560 `lexical-binding' (bug#8460).
6561
6562 2011-07-15 Eli Zaretskii <eliz@gnu.org>
6563
6564 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6565 bidi redisplay when a line includes both an image and is truncated.
6566
6567 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
6568
6569 Fix minor problems found by static checking.
6570 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
6571 (elsz): Now a signed constant, not a size_t var. We prefer signed
6572 types to unsigned, to avoid integer comparison confusion. Without
6573 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
6574 "cannot optimize loop, the loop counter may overflow", a symptom
6575 of the confusion.
6576 * indent.c (Fvertical_motion): Mark locals as initialized.
6577 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
6578
6579 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6580
6581 * search.c (Fre_search_backward): Mention `case-fold-search' in
6582 all the re_search_* functions (bug#8138).
6583
6584 * keyboard.c (Fopen_dribble_file): Document when the file is
6585 closed (bug#8056).
6586
6587 2011-07-14 Eli Zaretskii <eliz@gnu.org>
6588
6589 * bidi.c (bidi_dump_cached_states): Fix format of displaying
6590 bidi_cache_idx.
6591
6592 Support bidi reordering of display and overlay strings.
6593 * xdisp.c (compute_display_string_pos)
6594 (compute_display_string_end): Accept additional argument STRING.
6595 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
6596 (reseat_to_string): Initialize bidi_it->string.s and
6597 bidi_it->string.schars.
6598 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
6599 NULL (avoids a crash in bidi_paragraph_init).
6600 Initialize itb.string.lstring.
6601 (init_iterator): Call bidi_init_it only of a valid
6602 buffer position was specified. Initialize paragraph_embedding to
6603 L2R.
6604 (reseat_to_string): Initialize the bidi iterator.
6605 (display_string): If we need to ignore text properties of
6606 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
6607 original value of -1 will not work with bidi.)
6608 (compute_display_string_pos): First arg is now struct
6609 `text_pos *'; all callers changed. Support display properties on
6610 Lisp strings.
6611 (compute_display_string_end): Support display properties on Lisp
6612 strings.
6613 (init_iterator, reseat_1, reseat_to_string): Initialize the
6614 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
6615 when iterating on a string not from display properties).
6616 (compute_display_string_pos, compute_display_string_end):
6617 Fix calculation of the object to scan. Fixes an error when using
6618 arrow keys.
6619 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
6620 base_level_stop; instead, set base_level_stop to BEGV.
6621 Fixes crashes in vertical-motion.
6622 (next_element_from_buffer): Improve commentary for when
6623 the iterator is before prev_stop.
6624 (init_iterator): Initialize bidi_p from the default value of
6625 bidi-display-reordering, not from buffer-local value. Use the
6626 buffer-local value only if initializing for buffer iteration.
6627 (handle_invisible_prop): Support invisible properties on strings
6628 that are being bidi-reordered.
6629 (set_iterator_to_next): Support bidi reordering of C strings and
6630 Lisp strings.
6631 (next_element_from_string): Support bidi reordering of Lisp
6632 strings.
6633 (handle_stop_backwards): Support Lisp strings as well.
6634 (display_string): Support display of R2L glyph rows.
6635 Use IT_STRING_CHARPOS when displaying from a Lisp string.
6636 (init_iterator): Don't initialize it->bidi_p for strings
6637 here.
6638 (reseat_to_string): Initialize it->bidi_p for strings here.
6639 (next_element_from_string, next_element_from_c_string)
6640 (next_element_from_buffer): Add xassert's for correspondence
6641 between IT's object being iterated and it->bidi_it.string
6642 structure.
6643 (face_before_or_after_it_pos): Support bidi iteration.
6644 (next_element_from_c_string): Handle the case of the first string
6645 character that is not the first one in the visual order.
6646 (get_visually_first_element): New function, refactored from common
6647 parts of next_element_from_buffer, next_element_from_string, and
6648 next_element_from_c_string.
6649 (tool_bar_lines_needed, redisplay_tool_bar)
6650 (display_menu_bar): Force left-to-right direction. Add a FIXME
6651 comment for making that be controlled by a user option.
6652 (push_it, pop_it): Save and restore the state of the
6653 bidi iterator. Save and restore the bidi_p flag.
6654 (pop_it): Iterate out of display property for string iteration as
6655 well.
6656 (iterate_out_of_display_property): Support iteration over strings.
6657 (handle_single_display_spec): Set up it->bidi_it for iteration
6658 over a display string, and call bidi_init_it.
6659 (handle_single_display_spec, next_overlay_string)
6660 (get_overlay_strings_1, push_display_prop): Set up the bidi
6661 iterator for displaying display or overlay strings.
6662 (forward_to_next_line_start): Don't use the shortcut if
6663 bidi-iterating.
6664 (back_to_previous_visible_line_start): If handle_display_prop
6665 pushed the iterator stack, restore the internal state of the bidi
6666 iterator by calling bidi_pop_it same number of times.
6667 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
6668 and we are bidi-iterating, don't decrement the iterator position;
6669 instead, set the first_elt flag in the bidi iterator, to produce
6670 the same effect.
6671 (reseat_1): Remove redundant setting of string_from_display_prop_p.
6672 (push_display_prop): xassert that we are iterating a buffer.
6673 (push_it, pop_it): Save and restore paragraph_embedding member.
6674 (handle_single_display_spec, next_overlay_string)
6675 (get_overlay_strings_1, reseat_1, reseat_to_string)
6676 (push_display_prop): Set up the `unibyte' member of bidi_it.string
6677 correctly. Don't assume unibyte strings are not bidi-reordered.
6678 (compute_display_string_pos)
6679 (compute_display_string_end): Fix handling the case of C string.
6680 (push_it, pop_it): Save and restore from_disp_prop_p.
6681 (handle_single_display_spec, push_display_prop): Set the
6682 from_disp_prop_p flag.
6683 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
6684 (pop_it): Call iterate_out_of_display_property only if we are
6685 popping after iteration over a string that came from a display
6686 property. Fix a typo in popping stretch info. Add an assertion
6687 for verifying that the iterator position is in sync with the bidi
6688 iterator.
6689 (handle_single_display_spec, get_overlay_strings_1)
6690 (push_display_prop): Fix initialization of paragraph direction for
6691 string when that of the parent object is not yet determined.
6692 (reseat_1): Call bidi_init_it to resync the bidi
6693 iterator with IT's position. (Bug#7616)
6694 (find_row_edges): If ROW->start.pos gives position
6695 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
6696 (handle_stop, back_to_previous_visible_line_start, reseat_1):
6697 Reset the from_disp_prop_p flag.
6698 (SAVE_IT, RESTORE_IT): New macros.
6699 (pos_visible_p, face_before_or_after_it_pos)
6700 (back_to_previous_visible_line_start)
6701 (move_it_in_display_line_to, move_it_in_display_line)
6702 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6703 (try_scrolling, redisplay_window, display_line): Use them when
6704 saving a temporary copy of the iterator and restoring it back.
6705 (back_to_previous_visible_line_start, reseat_1)
6706 (init_iterator): Empty the bidi cache "stack".
6707 (move_it_in_display_line_to): If iterator ended up at
6708 EOL, but we never saw any buffer positions smaller than
6709 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
6710 motion in bidi-reordered lines.
6711 (move_it_in_display_line_to): Record prev_method and prev_pos
6712 immediately before the call to set_iterator_to_next. Fixes cursor
6713 motion in bidi-reordered lines with stretch glyphs and strings
6714 displayed in margins. (Bug#8133) (Bug#8867)
6715 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
6716 TO_CHARPOS.
6717 (pos_visible_p): Support positions in bidi-reordered lines.
6718 Save and restore bidi cache.
6719
6720 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
6721 (bidi_paragraph_info): Delete unused struct.
6722 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
6723 (bidi_cache_start): New variable.
6724 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
6725 to zero.
6726 (bidi_cache_fetch_state, bidi_cache_search)
6727 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6728 (bidi_cache_find, bidi_peek_at_next_level)
6729 (bidi_level_of_next_char, bidi_find_other_level_edge)
6730 (bidi_move_to_visually_next): Compare cache index with
6731 bidi_cache_start rather than with zero.
6732 (bidi_fetch_char): Accept new argument STRING; all callers
6733 changed. Support iteration over a string. Support strings with
6734 display properties. Support unibyte strings. Fix the type of
6735 `len' according to what STRING_CHAR_AND_LENGTH expects.
6736 (bidi_paragraph_init, bidi_resolve_explicit_1)
6737 (bidi_resolve_explicit, bidi_resolve_weak)
6738 (bidi_level_of_next_char, bidi_move_to_visually_next):
6739 Support iteration over a string.
6740 (bidi_set_sor_type, bidi_resolve_explicit_1)
6741 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
6742 can now be zero (for strings); special values 0 and -1 were
6743 changed to -1 and -2, respectively.
6744 (bidi_char_at_pos): New function.
6745 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
6746 Call it instead of FETCH_MULTIBYTE_CHAR.
6747 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
6748 initialized to valid values.
6749 (bidi_init_it): Don't initialize charpos and bytepos with invalid
6750 values.
6751 (bidi_level_of_next_char): Allow the sentinel "position" to pass
6752 the test for valid cached positions. Fix the logic for looking up
6753 the sentinel state in the cache. GCPRO the Lisp string we are
6754 iterating.
6755 (bidi_push_it, bidi_pop_it): New functions.
6756 (bidi_initialize): Initialize the bidi cache start stack pointer.
6757 (bidi_cache_ensure_space): New function, refactored from part of
6758 bidi_cache_iterator_state. Don't assume the required size is just
6759 one BIDI_CACHE_CHUNK away.
6760 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
6761 (bidi_count_bytes, bidi_char_at_pos): New functions.
6762 (bidi_cache_search): Don't assume bidi_cache_last_idx is
6763 always valid if bidi_cache_idx is valid.
6764 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
6765 is valid if it's going to be used.
6766 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
6767 (bidi_cache_fetch_state, bidi_cache_search)
6768 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6769 (bidi_cache_iterator_state, bidi_cache_find)
6770 (bidi_find_other_level_edge, bidi_cache_start_stack):
6771 All variables related to cache indices are now EMACS_INT.
6772
6773 * dispextern.h (struct bidi_string_data): New structure.
6774 (struct bidi_it): New member `string'. Make flag members be 1-bit
6775 fields, and put them last in the struct.
6776 (compute_display_string_pos, compute_display_string_end):
6777 Update prototypes.
6778 (bidi_push_it, bidi_pop_it): Add prototypes.
6779 (struct iterator_stack_entry): New members bidi_p,
6780 paragraph_embedding, and from_disp_prop_p.
6781 (struct it): Member bidi_p is now a bit field 1 bit wide.
6782 (bidi_shelve_cache, bidi_unshelve_cache):
6783 Declare prototypes.
6784
6785 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
6786 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
6787 and vector-like objects.
6788
6789 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
6790 cache around display iteration.
6791
6792 * window.c (Fwindow_end, window_scroll_pixel_based)
6793 (displayed_window_lines, Frecenter): Save and restore the bidi
6794 cache around display iteration.
6795
6796 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6797
6798 * editfns.c (Fdelete_region): Clarify the use of the named
6799 parameters (bug#6788).
6800
6801 2011-07-14 Martin Rudalics <rudalics@gmx.at>
6802
6803 * indent.c (Fvertical_motion): Set and restore w->pointm when
6804 saving and restoring the window's buffer (Bug#9006).
6805
6806 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
6807
6808 * editfns.c (Fstring_to_char): Clarify just what is returned
6809 (bug#6576). Text by Eli Zaretskii.
6810
6811 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
6812
6813 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
6814
6815 2011-07-13 Eli Zaretskii <eliz@gnu.org>
6816
6817 * buffer.c (mmap_find): Fix a typo.
6818
6819 2011-07-13 Johan Bockgård <bojohan@gnu.org>
6820
6821 Fix execution of x selection hooks.
6822 * xselect.c (Qx_lost_selection_functions)
6823 (Qx_sent_selection_functions): New vars.
6824 (syms_of_xselect): DEFSYM them.
6825 (x_handle_selection_request): Pass Qx_sent_selection_functions
6826 rather than Vx_sent_selection_functions to Frun_hook_with_args.
6827 (x_handle_selection_clear,x_clear_frame_selections):
6828 Pass Qx_lost_selection_functions rather than
6829 Vx_lost_selection_functions to Frun_hook_with_args.
6830
6831 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
6832
6833 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
6834 The old code sometimes used this field without initializing it.
6835
6836 * alloc.c (gc_sweep): Don't read past end of array.
6837 In theory, the old code could also have corrupted Emacs internals,
6838 though it'd be very unlikely.
6839
6840 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
6841
6842 * character.c (Fcharacterp): Don't advertise optional ignored
6843 argument. (Bug#4026)
6844
6845 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
6846
6847 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
6848 key" (bug#4257).
6849
6850 * window.c (Fset_window_start): Doc fix (bug#4199).
6851 (Fset_window_hscroll): Ditto.
6852
6853 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 Fix minor new problems caught by GCC 4.6.1.
6856 * term.c (init_tty): Remove unused local.
6857 * xsettings.c (store_monospaced_changed): Define this function only
6858 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
6859 not used otherwise.
6860
6861 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
6862
6863 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
6864
6865 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6866
6867 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
6868 are the mini-buffer and the echo area (bug#3320).
6869
6870 * term.c (init_tty): Remove support for supdup, c10 and perq
6871 terminals, which are no longer supported (bug#1482).
6872
6873 2011-07-10 Johan Bockgård <bojohan@gnu.org>
6874
6875 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
6876
6877 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
6878
6879 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
6880 for non-popups (Bug#3642).
6881
6882 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
6883
6884 * alloc.c (reset_malloc_hooks): Protoize.
6885 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
6886 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
6887 * cm.c (losecursor): Likewise.
6888 * data.c (fmod): Likewise.
6889 * dispnew.c (swap_glyphs_in_rows): Likewise.
6890 * emacs.c (memory_warning_signal): Likewise.
6891 * floatfns.c (float_error): Likewise.
6892 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
6893 (otf_open, font_otf_capability, generate_otf_features)
6894 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
6895 Likewise.
6896 * image.c (pbm_read_file): Likewise.
6897 * indent.c (string_display_width): Likewise.
6898 * intervals.c (check_for_interval, search_for_interval)
6899 (inc_interval_count, count_intervals, root_interval)
6900 (adjust_intervals_for_insertion, make_new_interval): Likewise.
6901 * lread.c (defalias): Likewise.
6902 * ralloc.c (r_alloc_check): Likewise.
6903 * regex.c (set_image_of_range_1, set_image_of_range)
6904 (regex_grow_registers): Likewise.
6905 * sysdep.c (strerror): Likewise.
6906 * termcap.c (valid_filename_p, tprint, main): Likewise.
6907 * tparam.c (main): Likewise.
6908 * unexhp9k800.c (run_time_remap, save_data_space)
6909 (update_file_ptrs, read_header, write_header, calculate_checksum)
6910 (copy_file, copy_rest, display_header): Likewise.
6911 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
6912 Likewise.
6913 * xdisp.c (check_it): Likewise.
6914 * xfaces.c (register_color, unregister_color, unregister_colors):
6915 Likewise.
6916 * xfns.c (print_fontset_result): Likewise.
6917 * xrdb.c (member, fatal, main): Likewise.
6918
6919 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
6920
6921 Fix minor problems found by static checking (Bug#9031).
6922 * chartab.c (char_table_set_range, map_sub_char_table):
6923 Remove unused locals.
6924 (uniprop_table): Now static.
6925 * composite.c (_work_char): Remove unused static var.
6926
6927 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
6928
6929 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
6930
6931 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
6932
6933 * gtkutil.c (qttip_cb): Remove code without function.
6934
6935 2011-07-09 Eli Zaretskii <eliz@gnu.org>
6936
6937 * w32.c (pthread_sigmask): New stub.
6938
6939 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
6940
6941 Use pthread_sigmask, not sigprocmask (Bug#9010).
6942 sigprocmask is portable only for single-threaded applications, and
6943 Emacs can be multi-threaded when it uses GTK.
6944 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
6945 (LIBES): Use it.
6946 * callproc.c (Fcall_process):
6947 * process.c (create_process):
6948 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
6949 Use pthread_sigmask, not sigprocmask.
6950
6951 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6952
6953 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
6954 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
6955 wrong (Bug#8591).
6956
6957 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6958
6959 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
6960 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
6961 (xg_hide_tooltip): Fix comment.
6962
6963 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
6964 in registerServicesMenuSendTypes.
6965 (validRequestorForSendType): Don't check ns_return_types.
6966
6967 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
6968 ns_return_type.
6969
6970 2011-07-08 Jason Rumney <jasonr@gnu.org>
6971
6972 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
6973 SH_SHOW for hidden windows (Bug#5482).
6974
6975 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
6976 frame struct members of non-existent frames (Bug#6284).
6977
6978 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6979
6980 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
6981 variable firstTime not needed on OSX >= 10.6.
6982 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
6983 >= 10.5. Use setKnobProportion, setDoubleValue.
6984
6985 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
6986 (MAC_OS_X_VERSION_10_5): Define if not defined.
6987 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
6988 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
6989 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
6990
6991 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
6992 cString and lossyCString on OSX >= 10.4
6993
6994 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
6995 sizeToFit on OSX >= 10.2.
6996
6997 * nsimage.m (allocInitFromFile): Don't use deprecated method
6998 bestRepresentationForDevice on OSX >= 10.6.
6999
7000 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
7001 to avoid warning.
7002
7003 * emacs.c: Declare unexec_init_emacs_zone.
7004
7005 * nsgui.h: Fix compiler warning about gnulib redefining verify.
7006
7007 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
7008
7009 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
7010 on svcsMenu (Bug#8842).
7011
7012 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
7013 ns_return_types.
7014 (Fns_list_services): Just return Qnil on 10.6, code not working there.
7015
7016 * nsterm.m (QUTF8_STRING): Declare.
7017 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
7018 (validRequestorForSendType): Return type is (id).
7019 Change indexOfObjectIdenticalTo to indexOfObject.
7020 Check if we have local selection before returning self (Bug#8842).
7021 (writeSelectionToPasteboard): Put local selection into paste board
7022 if we have a local selection (Bug#8842).
7023 (syms_of_nsterm): DEFSYM QUTF8_STRING.
7024
7025 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
7026 (ns_get_local_selection): Declare.
7027
7028 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
7029
7030 * keymap.c (describe_map_tree): Don't insert a double newline at
7031 the end of the buffer (bug#1169) and return whether we inserted
7032 something.
7033
7034 * callint.c (Fcall_interactively): Change "reading args" to
7035 "providing args" to try to clarify what it does (bug#1010).
7036
7037 2011-07-07 Kenichi Handa <handa@m17n.org>
7038
7039 * composite.c (composition_compute_stop_pos): Ignore a static
7040 composition starting before CHARPOS (Bug#8915).
7041
7042 * xdisp.c (handle_composition_prop): Likewise.
7043
7044 2011-07-07 Eli Zaretskii <eliz@gnu.org>
7045
7046 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
7047 (Bug#9015)
7048
7049 2011-07-07 Kenichi Handa <handa@m17n.org>
7050
7051 * character.h (unicode_category_t): New enum type.
7052
7053 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
7054 (Qchar_code_property_table): New variable.
7055 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
7056 (UNIPROP_COMPRESSED_FORM_P): New macros.
7057 (char_table_ascii): Uncompress the compressed values.
7058 (sub_char_table_ref): New arg is_uniprop. Callers changed.
7059 Uncompress the compressed values.
7060 (sub_char_table_ref_and_range): Likewise.
7061 (char_table_ref_and_range): Uncompress the compressed values.
7062 (sub_char_table_set): New arg is_uniprop. Callers changed.
7063 Uncompress the compressed values.
7064 (sub_char_table_set_range): Args changed. Callers changed.
7065 (char_table_set_range): Adjuted for the above change.
7066 (map_sub_char_table): Delete args default_val and parent. Add arg
7067 top. Give decoded values to a Lisp function.
7068 (map_char_table): Adjust for the above change. Give decoded
7069 values to a Lisp function. Gcpro more variables.
7070 (uniprop_table_uncompress)
7071 (uniprop_decode_value_run_length): New functions.
7072 (uniprop_decoder, uniprop_decoder_count): New variables.
7073 (uniprop_get_decoder, uniprop_encode_value_character)
7074 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
7075 New functions.
7076 (uniprop_encoder, uniprop_encoder_count): New variables.
7077 (uniprop_get_encoder, uniprop_table)
7078 (Funicode_property_table_internal, Fget_unicode_property_internal)
7079 (Fput_unicode_property_internal): New functions.
7080 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
7081 Sunicode_property_table_internal, Sget_unicode_property_internal,
7082 and Sput_unicode_property_internal. Defvar_lisp
7083 char-code-property-alist.
7084
7085 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
7086 Vunicode_category_table.
7087
7088 * font.c (font_range): Adjust for the change of
7089 Vunicode_category_table.
7090
7091 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
7092
7093 * m/iris4d.h: Remove file, move contents ...
7094 * s/irix6-5.h: ... here.
7095
7096 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
7097
7098 Remove unportable assumption about struct layout (Bug#8884).
7099 * alloc.c (mark_buffer):
7100 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
7101 (clone_per_buffer_values): Don't assume that
7102 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
7103 This isn't true in general, and it's particularly not true
7104 if Emacs is configured with --with-wide-int.
7105 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
7106 New macros, used in the buffer.c change.
7107
7108 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
7109
7110 * xsettings.c: Use both GConf and GSettings if both are available.
7111 (store_config_changed_event): Add comment.
7112 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
7113 (store_tool_bar_style_changed): New functions.
7114 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
7115 (struct xsettings): Move font inside HAVE_XFT.
7116 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
7117 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
7118 Move inside HAVE_XFT.
7119 (something_changed_gsettingsCB): Rename from something_changedCB.
7120 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
7121 also.
7122 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
7123 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
7124 (something_changed_gconfCB): Rename from something_changedCB.
7125 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
7126 (parse_settings): Move check for font inside HAVE_XFT.
7127 (read_settings, apply_xft_settings): Add comment.
7128 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
7129 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
7130 call store_font_name_changed.
7131 (xft_settings_event): Add comment.
7132 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
7133 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
7134 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
7135 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
7136 (xsettings_initialize): Call init_gsettings last.
7137 (xsettings_get_system_font, xsettings_get_system_normal_font):
7138 Add comment.
7139
7140 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
7141
7142 Random fixes. E.g., (random) never returned negative values.
7143 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
7144 subseconds part to the entropy, as that's a bit more random.
7145 Prefer signed to unsigned, since the signedness doesn't matter and
7146 in general we prefer signed. When given a limit, use a
7147 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
7148 latter isn't right if USE_2_TAGS_FOR_INTS.
7149 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
7150 not 0..VALMASK. Don't discard "excess" bits that random () returns.
7151
7152 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7153
7154 * textprop.c (text_property_stickiness):
7155 Obey Vtext_property_default_nonsticky.
7156 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
7157 * w32fns.c (syms_of_w32fns):
7158 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
7159
7160 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7161
7162 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
7163 This is more efficient than Ffile_directory_p and avoids a minor race.
7164
7165 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
7166
7167 * buffer.c (Foverlay_put): Say what the return value is
7168 (bug#7835).
7169
7170 * fileio.c (barf_or_query_if_file_exists): Check first if the file
7171 is a directory before asking whether to use the file name
7172 (bug#7564).
7173 (barf_or_query_if_file_exists): Make the "File is a directory"
7174 error be more correct.
7175
7176 * fns.c (Frequire): Remove the mention of the .gz files, since
7177 that's installation-specific, but keep the mention of
7178 `get-load-suffixes'.
7179
7180 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7181
7182 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
7183 Report string overflow if the output is too long.
7184
7185 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
7186
7187 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
7188 (syms_of_gnutls): Remove duplicate DEFSYM for
7189 Qgnutls_bootprop_verify_hostname_error, an error for
7190 Qgnutls_bootprop_verify_error (which is no longer used).
7191
7192 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
7193 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
7194 Also (re)move comments that are misplaced or no longer relevant.
7195
7196 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7197
7198 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
7199
7200 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
7201
7202 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
7203 and background color parameters if they have been changed.
7204
7205 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7206
7207 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
7208
7209 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
7210
7211 * xsettings.c (SYSTEM_FONT): Define only when used.
7212 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
7213
7214 * keymap.c (access_keymap_1): Now static.
7215
7216 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
7217
7218 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
7219 leave any prefix arg for the up event (Bug#1586).
7220
7221 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
7222
7223 * lread.c (syms_of_lread): Mention single symbols defined by
7224 `defvar' or `defconst' (bug#7154).
7225
7226 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7227 (Frequire): Mention get-load-suffixes.
7228
7229 2011-07-02 Martin Rudalics <rudalics@gmx.at>
7230
7231 * window.h (window): Remove clone_number slot.
7232 * window.c (Fwindow_clone_number, Fset_window_clone_number):
7233 Remove.
7234 (make_parent_window, make_window, saved_window)
7235 (Fset_window_configuration, save_window_save): Don't deal with
7236 clone numbers.
7237 * buffer.c (Qclone_number): Remove declaration.
7238 (sort_overlays, overlay_strings): Don't deal with clone numbers.
7239
7240 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
7241
7242 Add multiple inheritance to keymaps.
7243 * keymap.c (Fmake_composed_keymap): New function.
7244 (Fset_keymap_parent): Simplify.
7245 (fix_submap_inheritance): Remove.
7246 (access_keymap_1): New function extracted from access_keymap to handle
7247 embedded parents and handle lists of maps.
7248 (access_keymap): Use it.
7249 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
7250 (Fcopy_keymap): Handle embedded parents.
7251 (Fcommand_remapping, define_as_prefix): Simplify.
7252 (Fkey_binding): Simplify.
7253 (syms_of_keymap): Move minibuffer-local-completion-map,
7254 minibuffer-local-filename-completion-map,
7255 minibuffer-local-must-match-map, and
7256 minibuffer-local-filename-must-match-map to Elisp.
7257 (syms_of_keymap): Defsubr make-composed-keymap.
7258 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
7259 (parse_menu_item): Trivial simplification.
7260
7261 2011-07-01 Glenn Morris <rgm@gnu.org>
7262
7263 * Makefile.in (SETTINGS_LIBS): Fix typo.
7264
7265 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
7266
7267 * coding.c (Fencode_coding_string): Record the last coding system
7268 used, as the function doc string says (bug#8738).
7269
7270 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
7271
7272 * xsettings.c (store_monospaced_changed): Take new font as arg and
7273 check for change against current_mono_font.
7274 (EMACS_TYPE_SETTINGS): Remove this and related defines.
7275 (emacs_settings_constructor, emacs_settings_get_property)
7276 (emacs_settings_set_property, emacs_settings_class_init)
7277 (emacs_settings_init, gsettings_obj): Remove.
7278 (something_changedCB): New function for HAVE_GSETTINGS.
7279 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
7280 with value as argument.
7281 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
7282 g_settings_new (Bug#8967). Do not create gsettings_obj.
7283 Remove calls to g_settings_bind. Connect something_changedCB to
7284 "changed".
7285
7286 * xgselect.c: Add defined (HAVE_GSETTINGS).
7287 (xgselect_initialize): Ditto.
7288
7289 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
7290 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
7291 xg_select.
7292
7293 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 * eval.c (struct backtrace): Simplify and port the data structure.
7296 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
7297 signed bit field, as this assumption is not portable and it makes
7298 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
7299 "char debug_on_exit : 1" as this is not portable either; instead,
7300 use the portable "unsigned int debug_on_exit : 1". Remove unused
7301 member evalargs. Remove obsolete comments about cc bombing out.
7302
7303 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
7304
7305 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
7306 Let HAVE_GSETTINGS override HAVE_GCONF.
7307 (store_monospaced_changed): New function.
7308 (EMACS_SETTINGS): A new type derived from GObject to handle
7309 GSettings notifications.
7310 (emacs_settings_constructor, emacs_settings_get_property)
7311 (emacs_settings_set_property, emacs_settings_class_init):
7312 New functions.
7313 (gsettings_client, gsettings_obj): New variables.
7314 (GSETTINGS_SCHEMA): New define.
7315 (something_changedCB): Call store_monospaced_changed.
7316 (init_gsettings): New function.
7317 (xsettings_initialize): Call init_gsettings.
7318 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
7319 to NULL.
7320
7321 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
7322 GCONF_CFLAGS/LIBS.
7323
7324 2011-06-29 Martin Rudalics <rudalics@gmx.at>
7325
7326 * window.c (resize_root_window, grow_mini_window)
7327 (shrink_mini_window): Rename Qresize_root_window to
7328 Qwindow_resize_root_window and Qresize_root_window_vertically to
7329 Qwindow_resize_root_window_vertically.
7330
7331 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
7332
7333 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
7334
7335 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
7336
7337 * makefile.w32-in: Redesign dependencies so they reflect more
7338 clearly which files are directly included by each source file,
7339 and not through other includes.
7340
7341 2011-06-27 Martin Rudalics <rudalics@gmx.at>
7342
7343 * buffer.c (Qclone_number): Declare static and DEFSYM it.
7344 (sort_overlays, overlay_strings): When an overlay's clone number
7345 matches the window's clone number process the overlay even if
7346 the overlay's window property doesn't match the current window.
7347
7348 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
7349 (Fwindow_hchild): Rename to Fwindow_left_child.
7350 (Fwindow_next): Rename to Fwindow_next_sibling.
7351 (Fwindow_prev): Rename to Fwindow_prev_sibling.
7352 (resize_window_check): Rename to window_resize_check.
7353 (resize_window_apply): Rename to window_resize_apply.
7354 (Fresize_window_apply): Rename to Fwindow_resize_apply.
7355 (Fdelete_other_windows_internal, resize_frame_windows)
7356 (Fsplit_window_internal, Fdelete_window_internal)
7357 (grow_mini_window, shrink_mini_window)
7358 (Fresize_mini_window_internal): Fix callers accordingly.
7359
7360 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
7361
7362 * emacsgtkfixed.h: State that this is only used with Gtk+3.
7363 (emacs_fixed_set_min_size): Remove.
7364 (emacs_fixed_new): Take frame as argument.
7365
7366 * emacsgtkfixed.c: State that this is only used with Gtk+3.
7367 (_EmacsFixedPrivate): Remove minwidth/height.
7368 Add struct frame *f.
7369 (emacs_fixed_init): Initialize priv->f.
7370 (get_parent_class, emacs_fixed_set_min_size): Remove.
7371 (emacs_fixed_new): Set priv->f to argument.
7372 (emacs_fixed_get_preferred_width)
7373 (emacs_fixed_get_preferred_height): Use min_width/height from
7374 frames size_hint to set minimum and natural (Bug#8919).
7375 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
7376 and use min_width/height from frames size_hint to set
7377 min_width/height (Bug#8919).
7378
7379 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
7380 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
7381 Fix indentation.
7382
7383 2011-06-26 Eli Zaretskii <eliz@gnu.org>
7384
7385 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
7386 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
7387 called at ZV.
7388
7389 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
7390
7391 * process.c (wait_reading_process_output): Bypass select if
7392 waiting for a cell while ignoring keyboard input, and input is
7393 pending. Suggested by Jan Djärv (Bug#8869).
7394
7395 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
7396
7397 Use gnulib's dup2 module instead of rolling our own.
7398 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
7399
7400 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7401
7402 * dispnew.c (scrolling_window): Before scrolling, turn off a
7403 mouse-highlight in the window being scrolled.
7404
7405 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
7406
7407 Move DEFSYM to lisp.h and use everywhere.
7408
7409 * character.h (DEFSYM): Move declaration...
7410 * lisp.h (DEFSYM): ...here.
7411
7412 * gnutls.c:
7413 * minibuf.c:
7414 * w32menu.c:
7415 * w32proc.c:
7416 * w32select.c: Don't include character.h.
7417
7418 * alloc.c (syms_of_alloc):
7419 * buffer.c (syms_of_buffer):
7420 * bytecode.c (syms_of_bytecode):
7421 * callint.c (syms_of_callint):
7422 * casefiddle.c (syms_of_casefiddle):
7423 * casetab.c (init_casetab_once):
7424 * category.c (init_category_once, syms_of_category):
7425 * ccl.c (syms_of_ccl):
7426 * cmds.c (syms_of_cmds):
7427 * composite.c (syms_of_composite):
7428 * dbusbind.c (syms_of_dbusbind):
7429 * dired.c (syms_of_dired):
7430 * dispnew.c (syms_of_display):
7431 * doc.c (syms_of_doc):
7432 * editfns.c (syms_of_editfns):
7433 * emacs.c (syms_of_emacs):
7434 * eval.c (syms_of_eval):
7435 * fileio.c (syms_of_fileio):
7436 * fns.c (syms_of_fns):
7437 * frame.c (syms_of_frame):
7438 * fringe.c (syms_of_fringe):
7439 * insdel.c (syms_of_insdel):
7440 * keymap.c (syms_of_keymap):
7441 * lread.c (init_obarray, syms_of_lread):
7442 * macros.c (syms_of_macros):
7443 * msdos.c (syms_of_msdos):
7444 * print.c (syms_of_print):
7445 * process.c (syms_of_process):
7446 * search.c (syms_of_search):
7447 * sound.c (syms_of_sound):
7448 * syntax.c (init_syntax_once, syms_of_syntax):
7449 * terminal.c (syms_of_terminal):
7450 * textprop.c (syms_of_textprop):
7451 * undo.c (syms_of_undo):
7452 * w32.c (globals_of_w32):
7453 * window.c (syms_of_window):
7454 * xdisp.c (syms_of_xdisp):
7455 * xfaces.c (syms_of_xfaces):
7456 * xfns.c (syms_of_xfns):
7457 * xmenu.c (syms_of_xmenu):
7458 * xsettings.c (syms_of_xsettings):
7459 * xterm.c (syms_of_xterm): Use DEFSYM.
7460
7461 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
7462
7463 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
7464
7465 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
7466
7467 Integer and buffer overflow fixes (Bug#8873).
7468
7469 * print.c (printchar, strout): Check for string overflow.
7470 (PRINTPREPARE, printchar, strout):
7471 Don't set size unless allocation succeeds.
7472
7473 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
7474 for sizes. Check for string overflow more accurately.
7475 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
7476
7477 * macros.c: Integer and buffer overflow fixes.
7478 * keyboard.h (struct keyboard.kbd_macro_bufsize):
7479 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
7480 Use ptrdiff_t, not int, for sizes.
7481 Don't increment bufsize until after realloc succeeds.
7482 Check for size-calculation overflow.
7483 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
7484
7485 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
7486
7487 * lread.c: Integer overflow fixes.
7488 (read_integer): Radix is now EMACS_INT, not int,
7489 to improve quality of diagnostics for out-of-range radices.
7490 Calculate buffer size correctly for out-of-range radices.
7491 (read1): Check for integer overflow in radices, and in
7492 read-circle numbers.
7493 (read_escape): Avoid int overflow.
7494 (Fload, openp, read_buffer_size, read1)
7495 (substitute_object_recurse, read_vector, read_list, map_obarray):
7496 Use ptrdiff_t, not int, for sizes.
7497 (read1): Use EMACS_INT, not int, for sizes.
7498 Check for size overflow.
7499
7500 * image.c (cache_image): Check for size arithmetic overflow.
7501
7502 * lread.c: Integer overflow issues.
7503 (saved_doc_string_size, saved_doc_string_length)
7504 (prev_saved_doc_string_size, prev_saved_doc_string_length):
7505 Now ptrdiff_t, not int.
7506 (read1): Don't assume doc string length fits in int. Check for
7507 out-of-range doc string lengths.
7508 (read_list): Don't assume file position fits in int.
7509 (read_escape): Check for hex character overflow.
7510
7511 2011-06-22 Leo Liu <sdl.web@gmail.com>
7512
7513 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
7514 Move to minibuffer.el.
7515
7516 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7517
7518 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
7519 The following patches are for when GLYPH_DEBUG && !XASSERT.
7520 * dispextern.h (trace_redisplay_p, dump_glyph_string):
7521 * dispnew.c (flush_stdout):
7522 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
7523 Mark as externally visible.
7524 * dispnew.c (check_window_matrix_pointers): Now static.
7525 * dispnew.c (window_to_frame_vpos):
7526 * xfns.c (unwind_create_frame):
7527 * xterm.c (x_check_font): Remove unused local.
7528 * scroll.c (CHECK_BOUNDS):
7529 * xfaces.c (cache_fache): Rename local to avoid shadowing.
7530 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
7531 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
7532 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
7533 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
7534 Now static.
7535 (debug_method_add): Use va_list and vsprintf rather than relying
7536 on undefined behavior with wrong number of arguments.
7537 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
7538 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
7539 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
7540 since we're not interested in debugging glyphs with old libraries.
7541 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
7542 GCC 4.6.0's static checking.
7543
7544 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7545
7546 Integer overflow and signedness fixes (Bug#8873).
7547 A few related buffer overrun fixes, too.
7548
7549 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
7550
7551 * dispextern.h (struct face.stipple):
7552 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
7553 (x_bitmap_mask, x_allocate_bitmap_record)
7554 (x_create_bitmap_from_data, x_create_bitmap_from_file)
7555 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
7556 (x_create_bitmap_from_xpm_data):
7557 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
7558 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
7559 (.bitmaps_last):
7560 * xfaces.c (load_pixmap):
7561 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
7562 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
7563 (.bitmaps_last, struct x_output.icon_bitmap):
7564 Use ptrdiff_t, not int, for bitmap indexes.
7565 (x_allocate_bitmap_record): Check for size overflow.
7566 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
7567
7568 Use ptrdiff_t, not int, for overlay counts.
7569 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
7570 * editfns.c (overlays_around, get_pos_property):
7571 * textprop.c (get_char_property_and_overlay):
7572 * xdisp.c (next_overlay_change, note_mouse_highlight):
7573 * xfaces.c (face_at_buffer_position):
7574 * buffer.c (OVERLAY_COUNT_MAX): New macro.
7575 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
7576 (Fnext_overlay_change, Fprevious_overlay_change)
7577 (mouse_face_overlay_overlaps, Foverlays_in):
7578 Use ptrdiff_t, not int, for sizes.
7579 (overlays_at, overlays_in): Check for size-calculation overflow.
7580
7581 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
7582
7583 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
7584 (x_session_initialize): Do not assume string length fits in int.
7585
7586 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
7587 This is unlikely, but can occur if DPI is outlandish.
7588
7589 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
7590 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
7591
7592 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
7593 * xrdb.c (magic_file_p, search_magic_path):
7594 Omit last arg SUFFIX; it was always 0. All callers changed.
7595 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
7596
7597 * xfont.c (xfont_match): Avoid need for strlen.
7598
7599 * xfns.c: Don't assume strlen fits in int.
7600 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
7601
7602 * xdisp.c (message_log_check_duplicate): Return intmax_t,
7603 not unsigned long, as we prefer signed integers. All callers changed.
7604 Detect integer overflow in repeat count.
7605 (message_dolog): Don't assume print length fits in 39 bytes.
7606 (display_mode_element): Don't assume strlen fits in int.
7607
7608 * termcap.c: Don't assume sizes fit in int and never overflow.
7609 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
7610 (gobble_line): Check for size-calculation overflow.
7611
7612 * minibuf.c (Fread_buffer):
7613 * lread.c (intern, intern_c_string):
7614 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
7615 Don't assume string length fits in int.
7616
7617 * keyboard.c (parse_tool_bar_item):
7618 * gtkutil.c (style_changed_cb): Avoid need for strlen.
7619
7620 * font.c: Don't assume string length fits in int.
7621 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
7622 Use ptrdiff_t, not int.
7623 (font_intern_prop): Don't assume string length fits in int.
7624 Don't assume integer property fits in fixnum.
7625 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
7626
7627 * filelock.c: Fix some buffer overrun and integer overflow issues.
7628 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
7629 Reformulate so as not to need the command string.
7630 Invoke gzip -cd rather than gunzip, as it's more portable.
7631 (lock_info_type, lock_file_1, lock_file):
7632 Don't assume pid_t and time_t fit in unsigned long.
7633 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
7634 (current_lock_owner): Prefer signed type for sizes.
7635 Use memcpy, not strncpy, where memcpy is what is really wanted.
7636 Don't assume (via atoi) that time_t and pid_t fit in int.
7637 Check for time_t and/or pid_t out of range, e.g., via a network share.
7638 Don't alloca where an auto var works fine.
7639
7640 * fileio.c: Fix some integer overflow issues.
7641 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
7642 Don't assume string length fits in int.
7643 (directory_file_name): Don't assume string length fits in long.
7644 (make_temp_name): Don't assume pid fits in int, or that its print
7645 length is less than 20.
7646
7647 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
7648
7649 * coding.c (make_subsidiaries): Don't assume string length fits in int.
7650
7651 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
7652
7653 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
7654 We prefer signed integers, even for size calculations.
7655
7656 * emacs.c: Don't assume string length fits in 'int'.
7657 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
7658 (main): Don't invoke strlen when not needed.
7659
7660 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
7661 (XD_DEBUG_MESSAGE): Don't waste a byte.
7662
7663 * callproc.c (getenv_internal_1, getenv_internal)
7664 (Fgetenv_internal):
7665 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
7666
7667 * lread.c (invalid_syntax): Omit length argument.
7668 All uses changed. This doesn't fix a bug, but it simplifies the
7669 code away from its former Hollerith-constant appearance, and it's
7670 one less 'int' to worry about when looking at integer-overflow issues.
7671 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
7672
7673 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
7674 This didn't break anything, but it didn't help either.
7675 It's confusing to put a bogus integer in a place where the actual
7676 value does not matter.
7677 (LIST_END_P): Remove unused macro and its bogus comment.
7678 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
7679
7680 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
7681 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
7682 implementation.
7683 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
7684 We prefer signed types, and the value cannot exceed the EMACS_INT
7685 range anyway (because otherwise the length would not be representable).
7686 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
7687 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
7688 This avoids a GCC warning when WIDE_EMACS_INT.
7689
7690 * indent.c (sane_tab_width): New function.
7691 (current_column, scan_for_column, Findent_to, position_indentation)
7692 (compute_motion): Use it. This is just for clarity.
7693 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
7694
7695 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
7696
7697 * lisp.h (lint_assume): New macro.
7698 * composite.c (composition_gstring_put_cache):
7699 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
7700
7701 * editfns.c, insdel.c:
7702 Omit unnecessary forward decls, to simplify future changes.
7703
7704 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
7705
7706 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
7707
7708 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
7709 Use much-faster test for byte-length change.
7710 Don't assume string byte-length fits in 'int'.
7711 Check that character arg fits in 'int'.
7712 (mapcar1): Declare byte as byte, for clarity.
7713
7714 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
7715
7716 * fns.c (concat): Catch string overflow earlier.
7717 Do not rely on integer wraparound.
7718
7719 * dispextern.h (struct it.overlay_strings_charpos)
7720 (struct it.selective): Now EMACS_INT, not int.
7721 * xdisp.c (forward_to_next_line_start)
7722 (back_to_previous_visible_line_start)
7723 (reseat_at_next_visible_line_start, next_element_from_buffer):
7724 Don't arbitrarily truncate the value of 'selective' to int.
7725
7726 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
7727
7728 * composite.c: Don't truncate sizes to 'int'.
7729 (composition_gstring_p, composition_reseat_it)
7730 (composition_adjust_point): Use EMACS_INT, not int.
7731 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
7732 not EMACS_UINT, for indexes.
7733
7734 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
7735
7736 * buffer.c: Include <verify.h>.
7737 (struct sortvec.priority, struct sortstr.priority):
7738 Now EMACS_INT, not int.
7739 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
7740 (struct sortstr.size, record_overlay_string)
7741 (struct sortstrlist.size, struct sortlist.used):
7742 Don't truncate size to int.
7743 (record_overlay_string): Check for size-calculation overflow.
7744 (init_buffer_once): Check at compile-time, not run-time.
7745
7746 2011-06-22 Jim Meyering <meyering@redhat.com>
7747
7748 Don't leak an XBM-image-sized buffer
7749 * image.c (xbm_load): Free the image buffer after using it.
7750
7751 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
7752
7753 Port to Sun C.
7754 * composite.c (find_automatic_composition): Omit needless 'return 0;'
7755 that Sun C diagnosed.
7756 * fns.c (secure_hash): Fix pointer signedness issue.
7757 * intervals.c (static_offset_intervals): New function.
7758 (offset_intervals): Use it.
7759
7760 2011-06-21 Leo Liu <sdl.web@gmail.com>
7761
7762 * deps.mk (fns.o):
7763 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
7764 sha512.h.
7765
7766 * fns.c (secure_hash): Rename from crypto_hash_function and change
7767 the first arg to accept symbols.
7768 (Fsecure_hash): New primitive.
7769 (syms_of_fns): New symbols.
7770
7771 2011-06-20 Deniz Dogan <deniz@dogan.se>
7772
7773 * process.c (Fset_process_buffer): Clarify return value in
7774 docstring.
7775
7776 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
7777
7778 * dispnew.c (add_window_display_history): Use BVAR.
7779
7780 * xdisp.c (debug_method_add): Use BVAR.
7781 (check_window_end, dump_glyph_matrix, dump_glyph)
7782 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
7783
7784 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
7785 Likewise.
7786
7787 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
7788 check till after the cache is created in init_frame_faces.
7789
7790 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
7791
7792 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
7793
7794 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
7795
7796 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
7797 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
7798 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
7799
7800 Improve buffer-overflow checking (Bug#8873).
7801 * fileio.c (Finsert_file_contents):
7802 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
7803 Remove the old (too-loose) buffer overflow checks.
7804 They weren't needed, since make_gap checks for buffer overflow.
7805 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
7806 The old code merely checked for Emacs fixnum overflow, and relied
7807 on undefined (wraparound) behavior. The new code avoids undefined
7808 behavior, and also checks for ptrdiff_t and/or size_t overflow.
7809
7810 * editfns.c (Finsert_char): Don't dump core with very negative counts.
7811 Tune. Don't use wider integers than needed. Don't use alloca.
7812 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
7813
7814 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
7815
7816 * insdel.c, lisp.h (buffer_overflow): New function.
7817 (insert_from_buffer_1, replace_range, replace_range_2):
7818 * insdel.c (make_gap_larger):
7819 * editfns.c (Finsert_char):
7820 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
7821
7822 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
7823
7824 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
7825
7826 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
7827
7828 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
7829 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
7830
7831 * fileio.c: Don't assume EMACS_INT fits in off_t.
7832 (emacs_lseek): New static function.
7833 (Finsert_file_contents, Fwrite_region): Use it.
7834 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
7835
7836 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
7837
7838 * fns.c: Don't overflow int when computing a list length.
7839 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
7840 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
7841 truncation on 64-bit hosts. Check for QUIT every
7842 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
7843 faster and is responsive enough.
7844 (Flength): Report an error instead of overflowing an integer.
7845 (Fsafe_length): Return a float if the value is not representable
7846 as a fixnum. This shouldn't happen except in contrived situations.
7847 (Fnthcdr, Fsort): Don't assume list length fits in int.
7848 (Fcopy_sequence): Don't assume vector length fits in int.
7849
7850 * alloc.c: Check that resized vectors' lengths fit in fixnums.
7851 (header_size, word_size): New constants.
7852 (allocate_vectorlike): Don't check size overflow here.
7853 (allocate_vector): Check it here instead, since this is the only
7854 caller of allocate_vectorlike that could cause overflow.
7855 Check that the new vector's length is representable as a fixnum.
7856
7857 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
7858 The previous code was bogus. For example, next_almost_prime (32)
7859 returned 39, which is undesirable as it is a multiple of 3; and
7860 next_almost_prime (24) returned 25, which is a multiple of 5 so
7861 why was the code bothering to check for multiples of 7?
7862
7863 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
7864
7865 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
7866
7867 Variadic C functions now count arguments with ptrdiff_t.
7868 This partly undoes my 2011-03-30 change, which replaced int with size_t.
7869 Back then I didn't know that the Emacs coding style prefers signed int.
7870 Also, in the meantime I found a few more instances where arguments
7871 were being counted with int, which may truncate counts on 64-bit
7872 machines, or EMACS_INT, which may be unnecessarily wide.
7873 * lisp.h (struct Lisp_Subr.function.aMANY)
7874 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
7875 Arg counts are now ptrdiff_t, not size_t.
7876 All variadic functions and their callers changed accordingly.
7877 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
7878 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
7879 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
7880 * callint.c (Fcall_interactively): Check arg count for overflow,
7881 to avoid potential buffer overrun. Use signed char, not 'int',
7882 for 'varies' array, so that we needn't bother to check its size
7883 calculation for overflow.
7884 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
7885 * eval.c (apply_lambda):
7886 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
7887 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
7888 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
7889
7890 * callint.c (Fcall_interactively): Don't use index var as event count.
7891
7892 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
7893 * mem-limits.h (SIZE): Remove; no longer used.
7894
7895 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
7896
7897 Remove unnecessary casts.
7898 * xterm.c (x_term_init):
7899 * xfns.c (x_set_border_pixel):
7900 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
7901 These aren't needed now that we assume ANSI C.
7902
7903 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
7904 It's more likely to cause problems (due to unsigned overflow)
7905 than to cure them.
7906
7907 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
7908
7909 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
7910
7911 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
7912
7913 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
7914
7915 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
7916
7917 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
7918
7919 GLYPH_CODE_FACE returns EMACS_INT, not int.
7920 * dispextern.h (merge_faces):
7921 * xfaces.c (merge_faces):
7922 * xdisp.c (get_next_display_element, next_element_from_display_vector):
7923 Don't assume EMACS_INT fits in int.
7924
7925 * character.h (CHAR_VALID_P): Remove unused parameter.
7926 * fontset.c, lisp.h, xdisp.c: All uses changed.
7927
7928 * editfns.c (Ftranslate_region_internal): Omit redundant test.
7929
7930 * fns.c (concat): Minor tuning based on overflow analysis.
7931 This doesn't fix any bugs. Use int to hold character, instead
7932 of constantly refetching from Emacs object. Use XFASTINT, not
7933 XINT, for value known to be a character. Don't bother comparing
7934 a single byte to 0400, as it's always less.
7935
7936 * floatfns.c (Fexpt):
7937 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
7938
7939 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
7940 for characters.
7941
7942 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
7943
7944 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
7945 Without this fix, on a 64-bit host (aset S 0 4294967386) would
7946 incorrectly succeed when S was a string, because 4294967386 was
7947 truncated before it was used.
7948
7949 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
7950 Otherwise, an out-of-range integer could cause undefined behavior
7951 on a 64-bit host.
7952
7953 * composite.c: Use int, not EMACS_INT, for characters.
7954 (fill_gstring_body, composition_compute_stop_pos): Use int, not
7955 EMACS_INT, for values that are known to be in character range.
7956 This doesn't fix any bugs but is the usual style inside Emacs and
7957 may generate better code on 32-bit machines.
7958
7959 Make sure a 64-bit char is never passed to ENCODE_CHAR.
7960 This is for reasons similar to the recent CHAR_STRING fix.
7961 * charset.c (Fencode_char): Check that character arg is actually
7962 a character. Pass an int to ENCODE_CHAR.
7963 * charset.h (ENCODE_CHAR): Verify that the character argument is no
7964 wider than 'int', as a compile-time check to prevent future regressions
7965 in this area.
7966
7967 * character.c (char_string): Remove unnecessary casts.
7968
7969 Make sure a 64-bit char is never passed to CHAR_STRING.
7970 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
7971 by silently ignoring the top 32 bits, allowing some values
7972 that were far too large to be valid characters.
7973 * character.h: Include <verify.h>.
7974 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
7975 arguments are no wider than unsigned, as a compile-time check
7976 to prevent future regressions in this area.
7977 * data.c (Faset):
7978 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
7979 (Fsubst_char_in_region):
7980 * fns.c (concat):
7981 * xdisp.c (decode_mode_spec_coding):
7982 Adjust to CHAR_STRING's new requirement.
7983 * editfns.c (Finsert_char, Fsubst_char_in_region):
7984 * fns.c (concat): Check that character args are actually
7985 characters. Without this test, these functions did the wrong
7986 thing with wildly out-of-range values on 64-bit hosts.
7987
7988 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
7989 These casts should not be needed on 32-bit hosts, either.
7990 * keyboard.c (read_char):
7991 * lread.c (Fload): Remove casts to unsigned.
7992
7993 * lisp.h (UNSIGNED_CMP): New macro.
7994 This fixes comparison bugs on 64-bit hosts.
7995 (ASCII_CHAR_P): Use it.
7996 * casefiddle.c (casify_object):
7997 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
7998 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
7999 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
8000 * dispextern.h (FACE_FROM_ID):
8001 * keyboard.c (read_char): Use UNSIGNED_CMP.
8002
8003 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
8004 not to EMACS_INT, to avoid GCC warning.
8005
8006 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
8007
8008 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
8009 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
8010 isn't needed on 32-bit machines.
8011
8012 * buffer.c (Fgenerate_new_buffer_name):
8013 Use EMACS_INT for count, not int.
8014 (advance_to_char_boundary): Return EMACS_INT, not int.
8015
8016 * data.c (Qcompiled_function): Now static.
8017
8018 * window.c (window_body_lines): Now static.
8019
8020 * image.c (gif_load): Rename local to avoid shadowing.
8021
8022 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
8023 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
8024 * alloc.c (make_save_value): Integer argument is now of type
8025 ptrdiff_t, not int.
8026 (mark_object): Use ptrdiff_t, not int.
8027 * lisp.h (pD): New macro.
8028 * print.c (print_object): Use it.
8029
8030 * alloc.c: Use EMACS_INT, not int, to count objects.
8031 (total_conses, total_markers, total_symbols, total_vector_size)
8032 (total_free_conses, total_free_markers, total_free_symbols)
8033 (total_free_floats, total_floats, total_free_intervals)
8034 (total_intervals, total_strings, total_free_strings):
8035 Now EMACS_INT, not int. All uses changed.
8036 (Fgarbage_collect): Compute overall total using a double, so that
8037 integer overflow is less likely to be a problem. Check for overflow
8038 when converting back to an integer.
8039 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
8040 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
8041 These were 'int' variables that could overflow on 64-bit hosts;
8042 they were never used, so remove them instead of repairing them.
8043 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
8044 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
8045 Previously, this ceilinged at INT_MAX, but that doesn't work on
8046 64-bit machines.
8047 (allocate_pseudovector): Don't use EMACS_INT when int would do.
8048
8049 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
8050 (allocate_vectorlike): Check for ptrdiff_t overflow.
8051 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
8052 when a (possibly-narrower) signed value would do just as well.
8053 We prefer using signed arithmetic, to avoid comparison confusion.
8054
8055 * alloc.c: Catch some string size overflows that we were missing.
8056 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
8057 for convenience in STRING_BYTES_MAX.
8058 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
8059 The definition here is exact; the one in lisp.h was approximate.
8060 (allocate_string_data): Check for string overflow. This catches
8061 some instances we weren't catching before. Also, it catches
8062 size_t overflow on (unusual) hosts where SIZE_MAX <= min
8063 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
8064 and ptrdiff_t and EMACS_INT are both 64 bits.
8065
8066 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
8067 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
8068 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
8069
8070 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
8071
8072 * alloc.c (Fmake_string): Check for out-of-range init.
8073
8074 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
8075
8076 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
8077
8078 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
8079
8080 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
8081 xg_get_default_scrollbar_width.
8082
8083 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
8084 (int_gtk_range_get_value): Move to the scroll bar part of the file.
8085 (style_changed_cb): Call update_theme_scrollbar_width and call
8086 x_set_scroll_bar_default_width and xg_frame_set_char_size for
8087 all frames (Bug#8505).
8088 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
8089 Call gtk_window_set_resizable if HAVE_GTK3.
8090 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
8091 and height if HAVE_GTK3 (Bug#8505).
8092 (scroll_bar_width_for_theme): New variable.
8093 (update_theme_scrollbar_width): New function.
8094 (xg_get_default_scrollbar_width): Move code to
8095 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
8096 (xg_initialize): Call update_theme_scrollbar_width.
8097
8098 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
8099
8100 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
8101
8102 2011-06-12 Martin Rudalics <rudalics@gmx.at>
8103
8104 * frame.c (make_frame): Call other_buffer_safely instead of
8105 other_buffer.
8106
8107 * window.c (temp_output_buffer_show): Call display_buffer with
8108 second argument Vtemp_buffer_show_specifiers and reset latter
8109 immediately after the call.
8110 (Vtemp_buffer_show_specifiers): New variable.
8111 (auto_window_vscroll_p, next_screen_context_lines)
8112 (Vscroll_preserve_screen_position): Remove leading asterisks from
8113 doc-strings.
8114
8115 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
8116
8117 Fix minor problems found by GCC 4.6.0 static checking.
8118 * buffer.c (Qclone_number): Remove for now, as it's unused.
8119 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
8120 (record_buffer): Remove unused local.
8121 * frame.c (other_visible_frames, frame_buffer_list): Now static.
8122 (set_frame_buffer_list): Remove; unused.
8123 * frame.h (other_visible_frames): Remove decl.
8124 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
8125 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
8126 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
8127 if HAVE_GPM.
8128 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
8129 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
8130 Define only if HAVE_GPM.
8131 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
8132 (update_hints_inhibit): Remove; never set. All uses removed.
8133 * widgetprv.h (emacsFrameClassRec): Remove decl.
8134 * window.c (delete_deletable_window): Now returns void, since it
8135 wasn't returning anything.
8136 (compare_window_configurations): Remove unused locals.
8137 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
8138 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
8139 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
8140 the same widths as pointers. This follows up on the 2011-05-06 patch.
8141 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
8142 * xterm.h: Likewise.
8143 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
8144
8145 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
8146
8147 * makefile.w32-in: Update dependencies.
8148 (LISP_H): Add lib/intprops.h.
8149
8150 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
8151
8152 * image.c (gif_load): Add animation frame delay to the metadata.
8153 (syms_of_image): Use DEFSYM. New symbol `delay'.
8154
8155 2011-06-11 Martin Rudalics <rudalics@gmx.at>
8156
8157 * window.c (delete_deletable_window): Re-add.
8158 (Fset_window_configuration): Rewrite to handle dead buffers and
8159 consequently deletable windows.
8160 (window_tree, Fwindow_tree): Remove. Supply functionality in
8161 window.el.
8162 (compare_window_configurations): Simplify code.
8163
8164 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
8165
8166 * image.c (imagemagick_load_image): Fix type mismatch.
8167 (Fimagemagick_types): Likewise.
8168
8169 * window.h (replace_buffer_in_windows): Declare.
8170
8171 2011-06-11 Martin Rudalics <rudalics@gmx.at>
8172
8173 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
8174 Qclone_number. Remove external declaration of Qdelete_window.
8175 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
8176 code.
8177 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
8178 Run Qbuffer_list_update_hook if allowed.
8179 (Fother_buffer): Rewrite doc-string. Major rewrite for new
8180 buffer list implementation.
8181 (other_buffer_safely): New function.
8182 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
8183 calls to replace_buffer_in_windows and
8184 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
8185 if allowed.
8186 (record_buffer): Inhibit quitting and rewrite using quittable
8187 functions. Run Qbuffer_list_update_hook if allowed.
8188 (Frecord_buffer, Funrecord_buffer): New functions.
8189 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
8190 Move switch-to-buffer to window.el.
8191 (bury-buffer): Move to window.el.
8192 (Vbuffer_list_update_hook): New variable.
8193
8194 * lisp.h (other_buffer_safely): Add prototype in buffer.c
8195 section.
8196
8197 * window.h (resize_frame_windows): Move up in code.
8198 (Fwindow_frame): Remove EXFUN.
8199 (replace_buffer_in_all_windows): Remove prototype.
8200 (replace_buffer_in_windows_safely): Add prototype.
8201
8202 * window.c: Declare Qdelete_window static again. Move down
8203 declaration of select_count.
8204 (Fnext_window, Fprevious_window): Rewrite doc-strings.
8205 (Fother_window): Move to window.el.
8206 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
8207 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
8208 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
8209 window.el.
8210 (replace_buffer_in_windows): Implement by calling
8211 Qreplace_buffer_in_windows.
8212 (replace_buffer_in_all_windows): Remove with some functionality
8213 moved into replace_buffer_in_windows_safely.
8214 (replace_buffer_in_windows_safely): New function.
8215 (select_window_norecord, select_frame_norecord): Move in front
8216 of run_window_configuration_change_hook. Remove now obsolete
8217 declarations.
8218 (Fset_window_buffer): Rewrite doc-string.
8219 Call Qrecord_window_buffer.
8220 (keys_of_window): Move binding for other-window to window.el.
8221
8222 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
8223
8224 * dispextern.h (struct image): Replace data member, whose int_val
8225 and ptr_val fields were not used by anything, with a single
8226 lisp_val object.
8227
8228 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
8229 (gif_clear_image, gif_load, imagemagick_load_image)
8230 (gs_clear_image, gs_load): Callers changed.
8231
8232 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
8233
8234 * buffer.h: Include <time.h>, for time_t.
8235 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
8236
8237 Fix minor problems found by static checking.
8238
8239 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
8240
8241 Make identifiers static if they are not used in other modules.
8242 * data.c (Qcompiled_function, Qframe, Qvector):
8243 * image.c (QimageMagick, Qsvg):
8244 * minibuf.c (Qmetadata):
8245 * window.c (resize_window_check, resize_root_window): Now static.
8246 * window.h (resize_window_check, resize_root_window): Remove decls.
8247
8248 * window.c (window_deletion_count, delete_deletable_window):
8249 Remove; unused.
8250 (window_body_lines): Now static.
8251 (Fdelete_other_windows_internal): Mark vars as initialized.
8252 Make sure 'resize_failed' is initialized.
8253 (run_window_configuration_change_hook): Rename local to avoid shadowing.
8254 (resize_window_apply): Remove unused local.
8255 * window.h (delete_deletable_window): Remove decl.
8256
8257 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
8258 (imagemagick_load_image): Fix pointer signedness problem by changing
8259 last arg from unsigned char * to char *. All uses changed.
8260 Also, fix a local for similar reasons.
8261 Remove unused locals. Remove locals to avoid shadowing.
8262 (fn_rsvg_handle_free): Remove; unused.
8263 (svg_load, svg_load_image): Fix pointer signedness problem.
8264 (imagemagick_load_image): Don't use garbage pointer image_wand.
8265
8266 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
8267
8268 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
8269
8270 * image.c (gif_load): Fix omitted cast error introduced by
8271 2011-06-06 change.
8272
8273 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8274
8275 * window.h (resize_proportionally, orig_total_lines)
8276 (orig_top_line): Remove from window structure.
8277 (set_window_height, set_window_width, change_window_heights)
8278 (Fdelete_window): Remove prototypes.
8279 (resize_frame_windows): Remove duplicate declaration.
8280
8281 2011-06-10 Eli Zaretskii <eliz@gnu.org>
8282
8283 * window.h (resize_frame_windows, resize_window_check)
8284 (delete_deletable_window, resize_root_window)
8285 (resize_frame_windows): Declare prototypes.
8286
8287 * window.c (resize_window_apply): Make definition be "static" to
8288 match the prototype.
8289
8290 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8291
8292 * window.c: Remove declarations of Qwindow_size_fixed,
8293 window_min_size_1, window_min_size_2, window_min_size,
8294 size_window, window_fixed_size_p, enlarge_window, delete_window.
8295 Remove static from declaration of Qdelete_window, it's
8296 temporarily needed by Fbury_buffer.
8297 (replace_window): Don't assign orig_top_line and
8298 orig_total_lines.
8299 (Fdelete_window, delete_window): Remove. Window deletion is
8300 handled by window.el.
8301 (window_loop): Remove DELETE_OTHER_WINDOWS case.
8302 Replace Fdelete_window calls with calls to Qdelete_window.
8303 (Fdelete_other_windows): Remove. Deleting other windows is
8304 handled by window.el.
8305 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
8306 handled in window.el.
8307 (window_min_size_2, window_min_size_1, window_min_size): Remove.
8308 Window minimum sizes are handled in window.el.
8309 (shrink_windows, size_window, set_window_height)
8310 (set_window_width, change_window_heights, window_height)
8311 (window_width, CURBEG, CURSIZE, enlarge_window)
8312 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
8313 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
8314 handled in window.el.
8315 (make_dummy_parent): Rename to make_parent_window and give it a
8316 second argument horflag.
8317 (make_window): Don't set resize_proportionally any more.
8318 (Fsplit_window): Remove. Windows are split in window.el.
8319 (save_restore_action, save_restore_orig_size)
8320 (shrink_window_lowest_first, save_restore_orig_size): Remove.
8321 Resize mini windows in window.el.
8322 (grow_mini_window, shrink_mini_window): Implement by calling
8323 Qresize_root_window_vertically, resize_window_check and
8324 resize_window_apply.
8325 (saved_window, Fset_window_configuration, save_window_save):
8326 Do not handle orig_top_line, orig_total_lines, and
8327 resize_proportionally.
8328 (window_min_height, window_min_width): Move to window.el.
8329 (keys_of_window): Move bindings for delete-other-windows,
8330 split-window, delete-window and enlarge-window to window.el.
8331
8332 * buffer.c: Temporarily extern Qdelete_window.
8333 (Fbury_buffer): Temporarily call Qdelete_window instead of
8334 Fdelete_window (Fbury_buffer will move to window.el soon).
8335
8336 * frame.c (set_menu_bar_lines_1): Remove code handling
8337 orig_top_line and orig_total_lines.
8338
8339 * dispnew.c (adjust_frame_glyphs_initially): Don't use
8340 set_window_height but set heights directly.
8341 (change_frame_size_1): Use resize_frame_windows.
8342
8343 * xdisp.c (init_xdisp): Don't use set_window_height but set
8344 heights directly.
8345
8346 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
8347 Use resize_frame_windows instead of change_window_heights and run
8348 run_window_configuration_change_hook.
8349
8350 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
8351 instead of change_window_heights and run
8352 run_window_configuration_change_hook.
8353
8354 2011-06-09 Martin Rudalics <rudalics@gmx.at>
8355
8356 * window.c (replace_window): Rename second argument REPLACEMENT to
8357 NEW. New third argument SETFLAG. Rewrite.
8358 (delete_window, make_dummy_parent): Call replace_window with
8359 third argument 1.
8360 (window_list_1): Move down in code.
8361 (run_window_configuration_change_hook): Move set_buffer part
8362 before select_frame_norecord part in order to unwind correctly.
8363 Rename count1 to count.
8364 (recombine_windows, delete_deletable_window, resize_root_window)
8365 (Fdelete_other_windows_internal)
8366 (Frun_window_configuration_change_hook, make_parent_window)
8367 (resize_window_check, resize_window_apply, Fresize_window_apply)
8368 (resize_frame_windows, Fsplit_window_internal)
8369 (Fdelete_window_internal, Fresize_mini_window_internal):
8370 New functions.
8371 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
8372
8373 2011-06-08 Martin Rudalics <rudalics@gmx.at>
8374
8375 * window.h (window): Add some new members to window structure -
8376 normal_lines, normal_cols, new_total, new_normal, clone_number,
8377 splits, nest, prev_buffers, next_buffers.
8378 (WINDOW_TOTAL_SIZE): Move here from window.c.
8379 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
8380
8381 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
8382 Remove.
8383 (make_dummy_parent): Set new members of windows structure.
8384 (make_window): Move down in code. Handle new members of window
8385 structure.
8386 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
8387 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
8388 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
8389 (Fset_window_prev_buffers, Fwindow_next_buffers)
8390 (Fset_window_next_buffers, Fset_window_clone_number):
8391 New functions.
8392 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
8393 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
8394 Doc-string fixes.
8395 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
8396 Argument WINDOW can be now internal window too.
8397 (Fwindow_use_time): Move up in code.
8398 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
8399 Rewrite doc-string.
8400 (Fset_window_configuration, saved_window)
8401 (Fcurrent_window_configuration, save_window_save): Handle new
8402 members of window structure.
8403 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
8404 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
8405 (syms_of_window): New Lisp objects Qrecord_window_buffer,
8406 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
8407 Qget_mru_window, Qresize_root_window,
8408 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
8409 Qauto_buffer_name; staticpro them.
8410
8411 2011-06-07 Martin Rudalics <rudalics@gmx.at>
8412
8413 * window.c (Fwindow_total_size, Fwindow_left_column)
8414 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
8415 (Fwindow_list_1): New functions.
8416 (window_box_text_cols): Replace with window_body_cols.
8417 (Fwindow_width, Fscroll_left, Fscroll_right):
8418 Use window_body_cols instead of window_box_text_cols.
8419 (delete_window, Fset_window_configuration):
8420 Call delete_all_subwindows with window as argument.
8421 (delete_all_subwindows): Take a window as argument and not a
8422 structure. Rewrite.
8423 (window_loop): Remove handling of GET_LRU_WINDOW and
8424 GET_LARGEST_WINDOW.
8425 (Fget_lru_window, Fget_largest_window): Move to window.el.
8426
8427 * window.h: Extern window_body_cols instead of
8428 window_box_text_cols. delete_all_subwindows now takes a
8429 Lisp_Object as argument.
8430
8431 * indent.c (compute_motion, Fcompute_motion):
8432 Use window_body_cols instead of window_box_text_cols.
8433
8434 * frame.c (delete_frame): Call delete_all_subwindows with root
8435 window as argument.
8436
8437 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
8438
8439 * fns.c (Fputhash): Document return value.
8440
8441 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
8442
8443 * image.c (gif_load): Implement gif89a spec "no disposal" method.
8444
8445 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8446
8447 Cons<->int and similar integer overflow fixes (Bug#8794).
8448
8449 Check for overflow when converting integer to cons and back.
8450 * charset.c (Fdefine_charset_internal, Fdecode_char):
8451 Use cons_to_unsigned to catch overflow.
8452 (Fencode_char): Use INTEGER_TO_CONS.
8453 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
8454 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
8455 * data.c (long_to_cons, cons_to_long): Remove.
8456 (cons_to_unsigned, cons_to_signed): New functions.
8457 These signal an error for invalid or out-of-range values.
8458 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
8459 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
8460 * font.c (Ffont_variation_glyphs):
8461 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
8462 * lisp.h: Include <intprops.h>.
8463 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
8464 (cons_to_signed, cons_to_unsigned): New decls.
8465 (long_to_cons, cons_to_long): Remove decls.
8466 * undo.c (record_first_change): Use INTEGER_TO_CONS.
8467 (Fprimitive_undo): Use CONS_TO_INTEGER.
8468 * xfns.c (Fx_window_property): Likewise.
8469 * xselect.c: Include <limits.h>.
8470 (x_own_selection, selection_data_to_lisp_data):
8471 Use INTEGER_TO_CONS.
8472 (x_handle_selection_request, x_handle_selection_clear)
8473 (x_get_foreign_selection, Fx_disown_selection_internal)
8474 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
8475 (lisp_data_to_selection_data): Use cons_to_unsigned.
8476 (x_fill_property_data): Use cons_to_signed.
8477 Report values out of range.
8478
8479 Check for buffer and string overflow more precisely.
8480 * buffer.h (BUF_BYTES_MAX): New macro.
8481 * lisp.h (STRING_BYTES_MAX): New macro.
8482 * alloc.c (Fmake_string):
8483 * character.c (string_escape_byte8):
8484 * coding.c (coding_alloc_by_realloc):
8485 * doprnt.c (doprnt):
8486 * editfns.c (Fformat):
8487 * eval.c (verror):
8488 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
8489 since they may not be the same number.
8490 * editfns.c (Finsert_char):
8491 * fileio.c (Finsert_file_contents):
8492 Likewise for BUF_BYTES_MAX.
8493
8494 * image.c: Use ptrdiff_t, not int, for sizes.
8495 (slurp_file): Switch from int to ptrdiff_t.
8496 All uses changed.
8497 (slurp_file): Check that file size fits in both size_t (for
8498 malloc) and ptrdiff_t (for sanity and safety).
8499
8500 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
8501 if b->modtime has its maximal value.
8502
8503 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
8504
8505 Don't assume time_t can fit into int.
8506 * buffer.h (struct buffer.modtime): Now time_t, not int.
8507 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
8508 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
8509
8510 Minor fixes for signed vs unsigned integers.
8511 * character.h (MAYBE_UNIFY_CHAR):
8512 * charset.c (maybe_unify_char):
8513 * keyboard.c (read_char, reorder_modifiers):
8514 XINT -> XFASTINT, since the integer must be nonnegative.
8515 * ftfont.c (ftfont_spec_pattern):
8516 * keymap.c (access_keymap, silly_event_symbol_error):
8517 XUINT -> XFASTINT, since the integer must be nonnegative.
8518 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
8519 since it makes no difference and we prefer signed.
8520 * keyboard.c (record_char): Use XUINT when all the neighbors do.
8521 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
8522 nonnegative.
8523
8524 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
8525
8526 * window.h (Fwindow_frame): Declare.
8527
8528 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8529
8530 * alloc.c: Simplify handling of large-request failures (Bug#8800).
8531 (SPARE_MEMORY): Always define.
8532 (LARGE_REQUEST): Remove.
8533 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
8534
8535 2011-06-06 Martin Rudalics <rudalics@gmx.at>
8536
8537 * lisp.h: Move EXFUNS for Fframe_root_window,
8538 Fframe_first_window and Fset_frame_selected_window to window.h.
8539
8540 * window.h: Move EXFUNS for Fframe_root_window,
8541 Fframe_first_window and Fset_frame_selected_window here from
8542 lisp.h.
8543
8544 * frame.c (Fwindow_frame, Fframe_first_window)
8545 (Fframe_root_window, Fframe_selected_window)
8546 (Fset_frame_selected_window): Move to window.c.
8547 (Factive_minibuffer_window): Move to minibuf.c.
8548 (Fother_visible_frames_p): New function.
8549
8550 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
8551
8552 * window.c (decode_window, decode_any_window): Move up in code.
8553 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
8554 (inhibit_frame_unsplittable): Remove unused variable.
8555 (Fwindow_buffer): Move up and rewrite doc-string.
8556 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
8557 (Fwindow_prev): New functions.
8558 (Fwindow_frame): Move here from frame.c. Accept any window as
8559 argument.
8560 (Fframe_root_window, Fframe_first_window)
8561 (Fframe_selected_window): Move here from frame.c. Accept frame
8562 or arbitrary window as argument. Update doc-strings.
8563 (Fminibuffer_window): Move up in code.
8564 (Fwindow_minibuffer_p): Move up in code and simplify.
8565 (Fset_frame_selected_window): Move here from frame.c.
8566 Marginal rewrite.
8567 (Fselected_window, select_window, Fselect_window): Move up in
8568 code. Minor doc-string fixes.
8569
8570 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8571
8572 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
8573 Do not assume that spare memory exists; that assumption is valid
8574 only if SYSTEM_MALLOC.
8575 (LARGE_REQUEST): New macro, so that the issue of large requests
8576 is separated from the issue of spare memory.
8577
8578 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
8579
8580 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
8581 format. (Bug#8806)
8582
8583 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
8584
8585 * xfns.c (x_set_scroll_bar_default_width): Move declarations
8586 before statements.
8587
8588 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
8589
8590 * gtkutil.c (xg_get_default_scrollbar_width): New function.
8591
8592 * gtkutil.h: Declare xg_get_default_scrollbar_width.
8593
8594 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
8595 min width by calling x_set_scroll_bar_default_width (Bug#8505).
8596
8597 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
8598
8599 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
8600
8601 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
8602
8603 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
8604 (x_clipboard_manager_save): Add return value.
8605 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
8606 New error handlers.
8607 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
8608 Obey Vx_select_enable_clipboard_manager. Catch errors in
8609 x_clipboard_manager_save (Bug#8779).
8610 (Vx_select_enable_clipboard_manager): New variable.
8611 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
8612
8613 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8614
8615 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
8616
8617 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8618
8619 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
8620 in the current matrix if keep_current_p is non-zero.
8621
8622 2011-06-04 Eli Zaretskii <eliz@gnu.org>
8623
8624 * bidi.c (bidi_level_of_next_char): Fix last change.
8625
8626 2011-06-03 Eli Zaretskii <eliz@gnu.org>
8627
8628 Support bidi reordering of text covered by display properties.
8629
8630 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
8631 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
8632 (bidi_cache_search, bidi_cache_iterator_state)
8633 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8634 (bidi_level_of_next_char, bidi_move_to_visually_next):
8635 Support character positions inside a run of characters covered by a
8636 display string.
8637 (bidi_paragraph_init, bidi_resolve_explicit_1)
8638 (bidi_level_of_next_char): Call bidi_fetch_char and
8639 bidi_fetch_char_advance instead of FETCH_CHAR and
8640 FETCH_CHAR_ADVANCE.
8641 (bidi_init_it): Initialize new members.
8642 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
8643 definitions.
8644 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
8645 instead of using explicit *_CHAR codes.
8646 (bidi_resolve_explicit, bidi_resolve_weak):
8647 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
8648 bidirectional text is supported only in multibyte buffers.
8649 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
8650 it to initialize the frame_window_p member of struct bidi_it.
8651 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
8652 (bidi_resolve_explicit, bidi_resolve_weak)
8653 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
8654 bidi_it->nchars is non-positive.
8655 (bidi_level_of_next_char): Don't try to lookup the cache for the
8656 next/previous character if nothing is cached there yet, or if we
8657 were just reseat()'ed to a new position.
8658
8659 * xdisp.c (set_cursor_from_row): Set start and stop points
8660 according to the row's direction when priming the loop that looks
8661 for the glyph on which to display cursor.
8662 (single_display_spec_intangible_p): Function deleted.
8663 (display_prop_intangible_p): Reimplement to call
8664 handle_display_spec instead of single_display_spec_intangible_p.
8665 Accept 3 additional arguments needed by handle_display_spec.
8666 This fixes incorrect cursor motion across display property with complex
8667 values: lists, `(when COND...)' forms, etc.
8668 (single_display_spec_string_p): Support property values that are
8669 lists with the argument STRING its top-level element.
8670 (display_prop_string_p): Fix the condition for processing a
8671 property that is a list to be consistent with handle_display_spec.
8672 (handle_display_spec): New function, refactored from the
8673 last portion of handle_display_prop.
8674 (compute_display_string_pos): Accept additional argument
8675 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
8676 value of a `display' property is a "replacing spec".
8677 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
8678 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
8679 the display property, but just return a value indicating whether
8680 the display property will replace the characters it covers.
8681 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
8682 frame_window_p members of struct bidi_it.
8683 (compute_display_string_pos, compute_display_string_end):
8684 New functions.
8685 (push_it): Accept second argument POSITION, where pop_it should
8686 jump to continue iteration.
8687 (reseat_1): Initialize bidi_it.disp_pos.
8688
8689 * keyboard.c (adjust_point_for_property): Adjust the call to
8690 display_prop_intangible_p to its new signature.
8691
8692 * dispextern.h (struct bidi_it): New member frame_window_p.
8693 (bidi_init_it): Update prototypes.
8694 (display_prop_intangible_p): Update prototype.
8695 (compute_display_string_pos, compute_display_string_end):
8696 Declare prototypes.
8697 (struct bidi_it): New members nchars and disp_pos. ch_len is now
8698 EMACS_INT.
8699
8700 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
8701
8702 Malloc failure behavior now depends on size of allocation.
8703 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
8704 * lisp.h: Change signatures accordingly.
8705 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
8706 All callers changed. (Bug#8762)
8707
8708 * gnutls.c: Use Emacs's memory allocators.
8709 Without this change, the gnutls library would invoke malloc etc.
8710 directly, which causes problems on non-SYNC_INPUT hosts, and which
8711 runs afoul of improving memory_full behavior. (Bug#8761)
8712 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
8713 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
8714 xfree instead of the default malloc, realloc, free.
8715 (Fgnutls_boot): No need to check for memory allocation failure,
8716 since xmalloc does that for us.
8717
8718 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
8719 * category.c (hash_get_category_set):
8720 * ccl.c (ccl_driver):
8721 * charset.c (Fdefine_charset_internal):
8722 * charset.h (struct charset.hash_index):
8723 * composite.c (get_composition_id, gstring_lookup_cache)
8724 (composition_gstring_put_cache):
8725 * composite.h (struct composition.hash_index):
8726 * dispextern.h (struct image.hash):
8727 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
8728 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
8729 (hashfn_equal, hashfn_user_defined, make_hash_table)
8730 (maybe_resize_hash_table, hash_lookup, hash_put)
8731 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
8732 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
8733 (Fsxhash, Fgethash, Fputhash, Fmaphash):
8734 * image.c (make_image, search_image_cache, lookup_image)
8735 (xpm_put_color_table_h):
8736 * lisp.h (struct Lisp_Hash_Table):
8737 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
8738 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
8739 for hashes and hash indexes, instead of 'unsigned' and 'int'.
8740 * alloc.c (allocate_vectorlike):
8741 Check for overflow in vector size calculations.
8742 * ccl.c (ccl_driver):
8743 Check for overflow when converting EMACS_INT to int.
8744 * fns.c, image.c: Remove unnecessary static decls that would otherwise
8745 need to be updated by these changes.
8746 * fns.c (make_hash_table, maybe_resize_hash_table):
8747 Check for integer overflow with large hash tables.
8748 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
8749 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
8750 (SXHASH_REDUCE): New macro.
8751 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
8752 Use it instead of discarding useful hash info with large hash values.
8753 (sxhash_float): New function.
8754 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
8755 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
8756 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
8757 Rewrite to use FIXNUM_BITS, as this simplifies things.
8758 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
8759 Adjust signatures to match updated version of code.
8760 (consing_since_gc): Now EMACS_INT, since a single hash table can
8761 use more than INT_MAX bytes.
8762
8763 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
8764
8765 Make it possible to build with GCC-4.6+ -O2 -flto.
8766
8767 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
8768
8769 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
8770
8771 * minibuf.c (get_minibuffer, read_minibuf_unwind):
8772 Call minibuffer-inactive-mode.
8773
8774 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
8775
8776 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
8777 Update dependencies.
8778
8779 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8780
8781 * data.c (init_data): Remove code for UTS, this system is not
8782 supported anymore.
8783
8784 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8785
8786 Don't force ./temacs to start in terminal mode.
8787
8788 * frame.c (make_initial_frame): Initialize faces in all cases, not
8789 only when CANNOT_DUMP is defined.
8790 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
8791
8792 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8793
8794 * dispnew.c (add_window_display_history): Use const for the string
8795 pointer. Remove declaration, not needed.
8796
8797 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8798
8799 Use 'inline', not 'INLINE'.
8800 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
8801 * alloc.c, fontset.c (INLINE): Remove.
8802 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
8803 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
8804 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
8805 * gmalloc.c (register_heapinfo): Use inline unconditionally.
8806 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
8807
8808 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8809
8810 Make it possible to run ./temacs.
8811
8812 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
8813 syms_of_callproc does the same thing. Remove test for
8814 "initialized", do it in the caller.
8815 * emacs.c (main): Avoid calling set_initial_environment when dumping.
8816
8817 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
8818
8819 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
8820 (read_minibuf): Use get_minibuffer.
8821 (syms_of_minibuf): Use DEFSYM.
8822 (Qmetadata): New var.
8823 * data.c (Qbuffer): Don't make it static.
8824 (syms_of_data): Use DEFSYM.
8825
8826 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8827
8828 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
8829 (CCL_CODE_MIN): New macro.
8830
8831 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
8832
8833 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
8834
8835 * eval.c (Qdebug): Now static.
8836 * lisp.h (Qdebug): Remove decl. This reverts a part of the
8837 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
8838 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
8839
8840 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
8841
8842 * image.c: Various fixes to ImageMagick code comments.
8843 (Fimagemagick_types): Doc fix.
8844
8845 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
8846
8847 Minor fixes prompted by GCC 4.6.0 warnings.
8848
8849 * xselect.c (converted_selections, conversion_fail_tag): Now static.
8850
8851 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
8852 (x_clipboard_manager_save_all): Move extern decl to ...
8853 * xterm.h: ... here, so that it can be checked for consistency.
8854
8855 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
8856
8857 * xselect.c (x_clipboard_manager_save_frame)
8858 (x_clipboard_manager_save_all): New functions.
8859 (Fx_clipboard_manager_save): Lisp function deleted.
8860
8861 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
8862 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
8863
8864 * xterm.h: Update prototype.
8865
8866 2011-05-28 William Xu <william.xwl@gmail.com>
8867
8868 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
8869 exiting (Bug#8239).
8870
8871 2011-05-28 Jim Meyering <meyering@redhat.com>
8872
8873 Avoid a sign-extension bug in crypto_hash_function.
8874 * fns.c (to_uchar): Define.
8875 (crypto_hash_function): Use it to convert some newly-signed
8876 variables to unsigned, to avoid sign-extension bugs. For example,
8877 without this change, (md5 "truc") would evaluate to
8878 45723a2aff78ff4fff7fff1114760e62 rather than the expected
8879 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
8880 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
8881
8882 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8883
8884 Integer overflow fixes.
8885
8886 * dbusbind.c: Serial number integer overflow fixes.
8887 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
8888 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
8889 to hold a serial number that is too large for a fixnum.
8890 (Fdbus_method_return_internal, Fdbus_method_error_internal):
8891 Check for serial numbers out of range. Decode any serial number
8892 that was so large that it became a float. (Bug#8722)
8893
8894 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
8895 (Fdbus_call_method, Fdbus_call_method_asynchronously):
8896 Use XFASTINT rather than XUINT when numbers are nonnegative.
8897 (xd_append_arg, Fdbus_method_return_internal):
8898 (Fdbus_method_error_internal): Likewise. Also, for unsigned
8899 arguments, check that Lisp number is nonnegative, rather than
8900 silently wrapping negative numbers around. (Bug#8722)
8901 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
8902 (Bug#8722)
8903
8904 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
8905
8906 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
8907
8908 ccl: Add integer overflow checks.
8909 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
8910 (IN_INT_RANGE): New macros.
8911 (ccl_driver): Use them to check for integer overflow when
8912 decoding a CCL program. Many of the new checks are whether XINT (x)
8913 fits in int; it doesn't always, on 64-bit hosts. The new version
8914 doesn't catch all possible integer overflows, but it's an
8915 improvement. (Bug#8719)
8916
8917 * alloc.c (make_event_array): Use XINT, not XUINT.
8918 There's no need for unsigned here.
8919
8920 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
8921 This follows up to the 2011-05-06 change that substituted uintptr_t
8922 for EMACS_INT. This case wasn't caught back then.
8923
8924 Rework Fformat to avoid integer overflow issues.
8925 * editfns.c: Include <float.h> unconditionally, as it's everywhere
8926 now (part of C89). Include <verify.h>.
8927 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
8928 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
8929 (Fformat): Avoid the prepass trying to compute sizes; it was only
8930 approximate and thus did not catch overflow reliably. Instead, walk
8931 through the format just once, formatting and computing sizes as we go,
8932 checking for integer overflow at every step, and allocating a larger
8933 buffer as needed. Keep track separately whether the format is
8934 multibyte. Keep only the most-recently calculated precision, rather
8935 than them all. Record whether each argument has been converted to
8936 string. Use EMACS_INT, not int, for byte and char and arg counts.
8937 Support field widths and precisions larger than INT_MAX. Avoid
8938 sprintf's undefined behavior with conversion specifications such as %#d
8939 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
8940 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
8941 formatting out-of-range floating point numbers with int
8942 formats. (Bug#8668)
8943
8944 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
8945
8946 * data.c: Avoid integer truncation in expressions involving floats.
8947 * data.c: Include <intprops.h>.
8948 (arith_driver): When there's an integer overflow in an expression
8949 involving floating point, convert the integers to floating point
8950 so that the resulting value does not suffer from catastrophic
8951 integer truncation. For example, on a 64-bit host (* 4
8952 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
8953 Do not rely on undefined behavior after integer overflow.
8954
8955 merge count_size_as_multibyte, parse_str_to_multibyte
8956 * character.c, character.h (count_size_as_multibyte):
8957 Rename from parse_str_to_multibyte; all uses changed.
8958 Check for integer overflow.
8959 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
8960 since it's now a duplicate of the other. This is more of
8961 a character than a buffer op, so better that it's in character.c.
8962 * fns.c, print.c: Adjust to above changes.
8963
8964 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
8965
8966 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
8967
8968 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8969
8970 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8971 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
8972 (x_clipboard_manager_save): Now static.
8973 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
8974
8975 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8976 (crypto_hash_function): Now static.
8977 Fix pointer signedness problems. Avoid unnecessary initializations.
8978
8979 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
8980
8981 * termhooks.h (Vselection_alist): Make it terminal-local.
8982
8983 * terminal.c (create_terminal): Initialize it.
8984
8985 * xselect.c: Support for clipboard managers.
8986 (Vselection_alist): Move to termhooks.h as terminal-local var.
8987 (LOCAL_SELECTION): New macro.
8988 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
8989 (symbol_to_x_atom): Remove gratuitous arg.
8990 (x_handle_selection_request, lisp_data_to_selection_data)
8991 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
8992 (x_own_selection, x_get_local_selection, x_convert_selection):
8993 New arg, specifying work frame. Use terminal-local Vselection_alist.
8994 (some_frame_on_display): Delete unused function.
8995 (Fx_own_selection_internal, Fx_get_selection_internal)
8996 (Fx_disown_selection_internal, Fx_selection_owner_p)
8997 (Fx_selection_exists_p): New optional frame arg.
8998 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
8999 (x_handle_selection_clear): Don't treat other terminals with the
9000 same keyboard specially. Use the terminal-local Vselection_alist.
9001 (x_clear_frame_selections): Use Frun_hook_with_args.
9002
9003 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
9004
9005 * xterm.h: Add support for those atoms.
9006
9007 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
9008
9009 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
9010 (converted_selections, conversion_fail_tag): New global variables.
9011 (x_selection_request_lisp_error): Free the above.
9012 (x_get_local_selection): Remove unnecessary code.
9013 (x_reply_selection_request): Args changed; handle arbitrary array
9014 of converted selections stored in converted_selections.
9015 Separate the XChangeProperty and SelectionNotify steps.
9016 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
9017 (x_convert_selection): New function.
9018 (x_handle_selection_event): Simplify.
9019 (x_get_foreign_selection): Don't ignore incoming requests while
9020 waiting for an answer; this will fail when we implement
9021 SAVE_TARGETS, and seems unnecessary anyway.
9022 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
9023 (Vx_sent_selection_functions): Doc fix.
9024
9025 2011-05-26 Leo Liu <sdl.web@gmail.com>
9026
9027 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
9028
9029 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9030
9031 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
9032
9033 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
9034 for fringe update if it has periodic bitmap.
9035 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
9036 and fringe_bitmap_periodic_p.
9037
9038 * fringe.c (get_fringe_bitmap_data): New function.
9039 (draw_fringe_bitmap_1, update_window_fringes): Use it.
9040 (update_window_fringes): Record periodicity of fringe bitmap in glyph
9041 row. Mark glyph row for fringe update if periodicity changed.
9042
9043 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
9044 for fringe update unless it has periodic bitmap.
9045
9046 2011-05-25 Kenichi Handa <handa@m17n.org>
9047
9048 * xdisp.c (get_next_display_element): Set correct it->face_id for
9049 a static composition.
9050
9051 2011-05-24 Leo Liu <sdl.web@gmail.com>
9052
9053 * deps.mk (fns.o):
9054 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
9055
9056 * fns.c (crypto_hash_function, Fsha1): New function.
9057 (Fmd5): Use crypto_hash_function.
9058 (syms_of_fns): Add Ssha1.
9059
9060 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9061
9062 * gnutls.c: Remove unused macros.
9063 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
9064 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
9065 Remove macros that are defined and never used.
9066 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
9067
9068 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
9069
9070 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
9071 (Fx_get_selection_internal): Minor cleanup.
9072 (Fx_own_selection_internal): Rename arguments for consistency with
9073 select.el.
9074
9075 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
9078
9079 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
9080
9081 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
9082
9083 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9084
9085 * dispnew.c (scrolling_window): Don't exclude the case that the
9086 last enabled row in the desired matrix touches the bottom boundary.
9087
9088 2011-05-21 Glenn Morris <rgm@gnu.org>
9089
9090 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
9091 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
9092 and add some more files.
9093
9094 2011-05-20 Eli Zaretskii <eliz@gnu.org>
9095
9096 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
9097 report_file_error introduced by the change from 2011-05-07.
9098
9099 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
9100
9101 * systime.h (Time): Define only if emacs is defined.
9102 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
9103 where the include path doesn't have X11/X.h by default. See
9104 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
9105
9106 2011-05-20 Kenichi Handa <handa@m17n.org>
9107
9108 * composite.c (find_automatic_composition): Fix previous change.
9109
9110 2011-05-20 Glenn Morris <rgm@gnu.org>
9111
9112 * lisp.mk: New file, split from Makefile.in.
9113 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
9114 (shortlisp): Remove.
9115 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
9116
9117 2011-05-19 Glenn Morris <rgm@gnu.org>
9118
9119 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
9120 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
9121 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
9122 (lisp): Set the order to that of loadup.el.
9123 (shortlisp): Make it a copy of $lisp.
9124 (SOME_MACHINE_LISP): Remove.
9125 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
9126 Use just $shortlisp, not $SOME_MACHINE_LISP too.
9127
9128 2011-05-18 Kenichi Handa <handa@m17n.org>
9129
9130 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
9131 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
9132 (find_automatic_composition): Mostly rewrite for efficiency.
9133
9134 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
9135
9136 * makefile.w32-in: Update dependencies.
9137
9138 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
9139
9140 * menu.c: Include limits.h (fixes the MS-Windows build broken by
9141 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
9142
9143 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
9144
9145 Fix some integer overflow issues, such as string length overflow.
9146
9147 * insdel.c (count_size_as_multibyte): Check for string overflow.
9148
9149 * character.c (lisp_string_width): Check for string overflow.
9150 Use EMACS_INT, not int, for string indexes and lengths; in
9151 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
9152 the resulting string length overflows an EMACS_INT; instead,
9153 report a string overflow if no precision given. When checking for
9154 precision exhaustion, use a check that cannot possibly have
9155 integer overflow. (Bug#8675)
9156 * character.h (lisp_string_width): Adjust to new signature.
9157
9158 * alloc.c (string_overflow): New function.
9159 (Fmake_string): Use it. This doesn't change behavior, but saves
9160 a few bytes and will simplify future changes.
9161 * character.c (string_escape_byte8): Likewise.
9162 * lisp.h (string_overflow): New decl.
9163
9164 Fixups, following up to the user-interface timestamp change.
9165 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
9166 for UI timestamps, instead of unsigned long.
9167 * msdos.c (mouse_get_pos): Likewise.
9168 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
9169 * w32gui.h (Time): Define by including "systime.h" rather than by
9170 declaring it ourselves. (Bug#8664)
9171
9172 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
9173 * image.c (clear_image_cache): Likewise.
9174
9175 * term.c (term_mouse_position): Don't assume time_t wraparound.
9176
9177 Be more systematic about user-interface timestamps.
9178 Before, the code sometimes used 'Time', sometimes 'unsigned long',
9179 and sometimes 'EMACS_UINT', to represent these timestamps.
9180 This change causes it to use 'Time' uniformly, as that's what X uses.
9181 This makes the code easier to follow, and makes it easier to catch
9182 integer overflow bugs such as Bug#8664.
9183 * frame.c (Fmouse_position, Fmouse_pixel_position):
9184 Use Time, not unsigned long, for user-interface timestamps.
9185 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
9186 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
9187 * keyboard.h (last_event_timestamp): Likewise.
9188 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
9189 * menu.h (xmenu_show): Likewise.
9190 * term.c (term_mouse_position): Likewise.
9191 * termhooks.h (struct input_event.timestamp): Likewise.
9192 (struct terminal.mouse_position_hook): Likewise.
9193 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
9194 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
9195 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
9196 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
9197 what it was before.
9198 * menu.h, termhooks.h: Include "systime.h", for Time.
9199
9200 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
9201 Don't assume that the difference between two unsigned long values
9202 can fit into an integer. At this point, we know button_down_time
9203 <= event->timestamp, so the difference must be nonnegative, so
9204 there's no need to cast the result if double-click-time is
9205 nonnegative, as it should be; check that it's nonnegative, just in
9206 case. This bug is triggered when events are more than 2**31 ms
9207 apart (about 25 days). (Bug#8664)
9208
9209 * xselect.c (last_event_timestamp): Remove duplicate decl.
9210 (x_own_selection): Remove needless cast to unsigned long.
9211
9212 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
9213 that always fit in int. Use a sentinel instead of a counter, to
9214 avoid a temp and to allay GCC's concerns about possible int overflow.
9215 * frame.h (struct frame): Use int for menu_bar_items_used
9216 instead of EMACS_INT, since it always fits in int.
9217
9218 * menu.c (grow_menu_items): Check for int overflow.
9219
9220 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
9221
9222 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
9223 Before, the code was not consistent. These values cannot exceed
9224 2**31 - 1 so there's no need to make them unsigned.
9225 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
9226 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
9227 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
9228 as modifiers.
9229 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
9230
9231 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
9232 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
9233 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
9234 presumably because the widths might not match.
9235
9236 * window.c (size_window): Avoid needless test at loop start.
9237
9238 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
9239
9240 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
9241
9242 2011-05-12 Drew Adams <drew.adams@oracle.com>
9243
9244 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
9245
9246 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9247
9248 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
9249 `width' to `bar_area_x' and `bar_area_width', respectively.
9250 (x_scroll_run): Take account of fringe background extension.
9251
9252 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
9253 Rename local vars `left' and `width' to `bar_area_x' and
9254 `bar_area_width', respectively.
9255 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
9256 background extension.
9257
9258 2011-05-10 Jim Meyering <meyering@redhat.com>
9259
9260 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
9261
9262 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
9263
9264 * image.c (Finit_image_library): Return t for built-in image types,
9265 like pbm and xbm. (Bug#8640)
9266
9267 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
9268
9269 * w32menu.c (set_frame_menubar): Fix submenu allocation.
9270
9271 2011-05-07 Eli Zaretskii <eliz@gnu.org>
9272
9273 * w32console.c (Fset_screen_color): Doc fix.
9274 (Fget_screen_color): New function.
9275 (syms_of_ntterm): Defsubr it.
9276
9277 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
9278 unlink the temporary file if Fcall_process didn't create it in the
9279 first place.
9280 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
9281 child process will be redirected to a file specified with `:file'.
9282 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
9283 cue to call_process_cleanup not to close that handle.
9284
9285 2011-05-07 Ben Key <bkey76@gmail.com>
9286
9287 * makefile.w32-in: The bootstrap-temacs rule now makes use of
9288 one of two shell specific rules, either bootstrap-temacs-CMD or
9289 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
9290 to the previous implementation of the bootstrap-temacs rule.
9291 The bootstrap-temacs-CMD rule is similar to the previous
9292 implementation of the bootstrap-temacs rule except that it
9293 makes use of the ESC_CFLAGS variable instead of the CFLAGS
9294 variable.
9295
9296 These changes, along with some changes to nt/configure.bat,
9297 nt/gmake.defs, and nt/nmake.defs, are required to extend my
9298 earlier fix to add support for --cflags and --ldflags options
9299 that include quotes so that it works whether make uses cmd or
9300 sh as the shell.
9301
9302 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
9303
9304 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
9305 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
9306 is a constant.
9307 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
9308 a string. Handle both cases.
9309 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
9310 (Fdbus_register_method): Use Qinvalid_function.
9311
9312 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
9313
9314 * makefile.w32-in: Update dependencies.
9315 (LISP_H): Add inttypes.h and stdin.h.
9316 (PROCESS_H): Add unistd.h.
9317
9318 2011-05-06 Eli Zaretskii <eliz@gnu.org>
9319
9320 * lread.c: Include limits.h (fixes the MS-Windows build broken by
9321 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
9322
9323 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
9324
9325 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
9326
9327 * term.c (vfatal): Remove stray call to va_end.
9328 It's not needed and the C Standard doesn't allow it here anyway.
9329
9330 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
9331 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
9332
9333 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
9334 bytes.
9335
9336 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
9337
9338 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9339
9340 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
9341
9342 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
9343
9344 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
9345
9346 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
9347 * charset.c (Fdefine_charset_internal): Don't initialize
9348 charset.code_space[15]. The value was garbage, on hosts with
9349 32-bit int (Bug#8600).
9350
9351 * lread.c (read_integer): Be more consistent with string-to-number.
9352 Use string_to_number to do the actual conversion; this avoids
9353 rounding errors and fixes some other screwups. Without this fix,
9354 for example, #x1fffffffffffffff was misread as -2305843009213693952.
9355 (digit_to_number): Move earlier, for benefit of read_integer.
9356 Return -1 if the digit is out of range for the base, -2 if it is
9357 not a digit in any supported base. (Bug#8602)
9358
9359 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
9360
9361 * dispnew.c (scrolling_window): Return 1 if we scrolled,
9362 to match comment at start of function. This also removes a
9363 GCC warning about overflow in a 32+64-bit port.
9364
9365 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
9366
9367 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
9368 Reported by Stefan Monnier in
9369 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
9370 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9371 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
9372
9373 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
9374 (EMACS_UINTPTR): Likewise, with uintptr_t.
9375
9376 * lisp.h: Prefer 64-bit EMACS_INT if available.
9377 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
9378 on 32-bit hosts that have 64-bit int, so that they can access
9379 large files.
9380 However, temporarily disable this change unless the temporary
9381 symbol WIDE_EMACS_INT is defined.
9382
9383 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
9384
9385 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
9386 This removes an assumption that EMACS_INT and long are the same
9387 width as pointers. The assumption is true for Emacs porting targets
9388 now, but we want to make other targets possible.
9389 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
9390 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
9391 In the rest of the code, change types of integers that hold casted
9392 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
9393 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
9394 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
9395 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
9396 No need to cast type when ORing.
9397 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
9398 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
9399 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
9400 assume EMACS_INT is the same width as char *.
9401 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
9402 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
9403 Remove no-longer-needed casts.
9404 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
9405 (xg_tool_bar_help_callback, xg_make_tool_item):
9406 Use EMACS_INTPTR to hold an integer
9407 that will be cast to void *; this can avoid a GCC warning
9408 if EMACS_INT is not the same width as void *.
9409 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
9410 * xdisp.c (display_echo_area_1, resize_mini_window_1):
9411 (current_message_1, set_message_1):
9412 Use a local to convert to proper width without a cast.
9413 * xmenu.c (dialog_selection_callback): Likewise.
9414
9415 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
9416 Also, don't assume VALBITS / RAND_BITS is less than 5,
9417 and don't rely on undefined behavior when shifting a 1 left into
9418 the sign bit.
9419 * lisp.h (get_random): Change signature to match.
9420
9421 * lread.c (hash_string): Use size_t, not int, for hash computation.
9422 Normally we prefer signed values; but hashing is special, because
9423 it's better to use unsigned division on hash table sizes so that
9424 the remainder is nonnegative. Also, size_t is the natural width
9425 for hashing into memory. The previous code used 'int', which doesn't
9426 retain enough info to hash well into very large tables.
9427 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
9428
9429 * dbusbind.c: Don't possibly lose pointer info when converting.
9430 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9431 Use XPNTR rather than XHASH, so that the high-order bits of
9432 the pointer aren't lost when converting through void *.
9433
9434 * eval.c (Fautoload): Don't double-shift a pointer.
9435
9436 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
9437
9438 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
9439
9440 * gnutls.c (DEF_GNUTLS_FN):
9441 * image.c (DEF_IMGLIB_FN): Make function pointers static.
9442
9443 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
9444
9445 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
9446 marker. (Bug#8610)
9447
9448 2011-05-05 Eli Zaretskii <eliz@gnu.org>
9449
9450 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
9451 New version that can reserve upto 2GB of heap space.
9452
9453 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
9454
9455 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
9456
9457 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
9458
9459 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
9460 `gnutls_certificate_set_x509_key_file'.
9461
9462 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
9463
9464 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
9465 Update dependencies.
9466
9467 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9468
9469 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
9470 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9471 Remove unused parameter `fildes'.
9472 * process.c (read_process_output, send_process): Don't pass it.
9473
9474 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9475
9476 Fix previous change: the library cache is defined in w32.c.
9477 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
9478 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
9479
9480 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9481
9482 Implement dynamic loading of GnuTLS on Windows.
9483
9484 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
9485 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
9486 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9487 Declare.
9488
9489 * gnutls.c (Qgnutls_dll): Define.
9490 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
9491 (gnutls_*): Declare function pointers.
9492 (init_gnutls_functions): New function to initialize function pointers.
9493 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
9494 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
9495 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9496 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
9497 (emacs_gnutls_write, emacs_gnutls_read)
9498 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
9499 (Fgnutls_available_p): New function.
9500 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
9501 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
9502 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
9503
9504 * image.c: Include w32.h.
9505 (Vimage_type_cache): Delete.
9506 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
9507 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
9508 (w32_delayed_load): Move to w32.c.
9509
9510 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
9511
9512 * w32.c (QCloaded_from, Vlibrary_cache): Define.
9513 (w32_delayed_load): Move from image.c. When loading a library, record
9514 its filename in the :loaded-from property of the library id.
9515 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
9516 Initialize and staticpro them.
9517 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
9518
9519 * process.c: Include lisp.h before w32.h, not after.
9520 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
9521 instead of gnutls_record_check_pending.
9522
9523 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
9524
9525 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
9526
9527 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
9528 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
9529 as passed in.
9530
9531 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
9532
9533 * xterm.c (x_set_frame_alpha): Do not set property on anything
9534 else than FRAME_X_OUTER_WINDOW (Bug#8608).
9535
9536 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
9537
9538 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
9539
9540 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
9541
9542 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
9543 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
9544 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
9545 (gnutls_global_initialized, Qgnutls_bootprop_priority)
9546 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
9547 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
9548 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
9549 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
9550 (Qgnutls_bootprop_callbacks_verify): Make static.
9551
9552 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
9553
9554 * callproc.c: Indentation fixup.
9555
9556 * sysdep.c (wait_for_termination_1): Make static.
9557 (wait_for_termination, interruptible_wait_for_termination):
9558 Move after wait_for_termination_1.
9559
9560 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
9561
9562 * sysdep.c (interruptible_wait_for_termination): New function
9563 which is like wait_for_termination, but allows keyboard
9564 interruptions.
9565
9566 * callproc.c (Fcall_process): Add (:file "file") as an option for
9567 the STDOUT buffer.
9568 (Fcall_process_region): Ditto.
9569
9570 2011-04-30 Eli Zaretskii <eliz@gnu.org>
9571
9572 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
9573 rather than `XVECTOR (FOO)->size'.
9574
9575 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
9576 inttypes.h, as a gnulib replacement is used if it not available in
9577 system headers.
9578
9579 2011-04-21 Eli Zaretskii <eliz@gnu.org>
9580
9581 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
9582 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
9583 of MOST_POSITIVE_FIXNUM. (Bug#8528)
9584
9585 * coding.c (coding_alloc_by_realloc): Error out if destination
9586 will grow beyond MOST_POSITIVE_FIXNUM.
9587 (decode_coding_emacs_mule): Abort if there isn't enough place in
9588 charbuf for the composition carryover bytes. Reserve an extra
9589 space for up to 2 characters produced in a loop.
9590 (decode_coding_iso_2022): Abort if there isn't enough place in
9591 charbuf for the composition carryover bytes.
9592
9593 2011-04-21 Eli Zaretskii <eliz@gnu.org>
9594
9595 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
9596 aborting when %lld or %lll format is passed.
9597 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
9598 %llo or %llx format is passed. (Bug#8545)
9599
9600 * window.c (window_scroll_line_based): Use a marker instead of
9601 simple variables to record original value of point. (Bug#7952)
9602
9603 * doprnt.c (doprnt): Fix the case where a multibyte sequence
9604 produced by %s or %c overflows available buffer space. (Bug#8545)
9605
9606 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
9607
9608 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
9609 (SIZE_MAX): Move defn after all includes, as they might #define it.
9610
9611 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9612
9613 * w32.c (init_environment): Warn about defaulting HOME to C:\.
9614
9615 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9616
9617 * keyboard.c (Qdelayed_warnings_hook): Define.
9618 (command_loop_1): Run `delayed-warnings-hook'
9619 if Vdelayed_warnings_list is non-nil.
9620 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
9621 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
9622
9623 2011-04-28 Eli Zaretskii <eliz@gnu.org>
9624
9625 * doprnt.c (doprnt): Don't return value smaller than the buffer
9626 size if the message was truncated. (Bug#8545).
9627
9628 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9629
9630 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
9631 (Fx_window_property): #if-0 the whole functions, not just the bodies.
9632
9633 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9634
9635 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
9636
9637 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
9638
9639 * makefile.w32-in: Update dependencies.
9640
9641 2011-04-27 Eli Zaretskii <eliz@gnu.org>
9642
9643 Improve `doprnt' and its usage. (Bug#8545)
9644 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
9645 `format_end'. Remove support for %l as a conversion specifier.
9646 Don't use xrealloc. Improve diagnostics when the %l size modifier
9647 is used. Update the commentary.
9648
9649 * eval.c (verror): Simplify calculation of size_t.
9650
9651 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
9652 messages.
9653
9654 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
9655
9656 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
9657 change.
9658
9659 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9660
9661 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
9662 This makes this file independent of the recent pseudovector change.
9663
9664 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
9665
9666 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
9667
9668 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
9669 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
9670 Remove unused local.
9671 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
9672
9673 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
9674 GCC 4.6.0 optimizes based on type-based alias analysis.
9675 For example, if b is of type struct buffer * and v of type struct
9676 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
9677 != &v->size, and therefore "v->size = 1; b->size = 2; return
9678 v->size;" must therefore return 1. This assumption is incorrect
9679 for Emacs, since it type-puns struct Lisp_Vector * with many other
9680 types. To fix this problem, this patch adds a new type struct
9681 vectorlike_header that documents the constraints on layout of vectors
9682 and pseudovectors, and helps optimizing compilers not get fooled
9683 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
9684 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
9685 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
9686 the size member.
9687 (XSETPVECTYPE): Rewrite in terms of new macro.
9688 (XSETPVECTYPESIZE): New macro, specifying both type and size.
9689 This is a bit clearer, and further avoids the possibility of
9690 undesirable aliasing.
9691 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
9692 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
9693 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
9694 since Lisp_Subr is a special case (no "next" field).
9695 (ASIZE): Now uses header.size rather than size.
9696 All previous uses of XVECTOR (foo)->size replaced to use this macro,
9697 to avoid the hassle of writing XVECTOR (foo)->header.size.
9698 (struct vectorlike_header): New type.
9699 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
9700 object, to help avoid aliasing.
9701 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
9702 (SUBRP): Likewise, since Lisp_Subr is a special case.
9703 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
9704 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
9705 (struct Lisp_Hash_Table): Combine first two members into a single
9706 struct vectorlike_header member. All uses of "size" and "next" members
9707 changed to be "header.size" and "header.next".
9708 * buffer.h (struct buffer): Likewise.
9709 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
9710 * frame.h (struct frame): Likewise.
9711 * process.h (struct Lisp_Process): Likewise.
9712 * termhooks.h (struct terminal): Likewise.
9713 * window.c (struct save_window_data, struct saved_window): Likewise.
9714 * window.h (struct window): Likewise.
9715 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
9716 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
9717 * buffer.c (init_buffer_once): Likewise.
9718 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
9719 special case.
9720 * process.c (Fformat_network_address): Use local var for size,
9721 for brevity.
9722
9723 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
9724
9725 Make the Lisp reader and string-to-float more consistent (Bug#8525)
9726 * data.c (atof): Remove decl; no longer used or needed.
9727 (digit_to_number): Move to lread.c.
9728 (Fstring_to_number): Use new string_to_number function, to be
9729 consistent with how the Lisp reader treats infinities and NaNs.
9730 Do not assume that floating-point numbers represent EMACS_INT
9731 without losing information; this is not true on most 64-bit hosts.
9732 Avoid double-rounding errors, by insisting on integers when
9733 parsing non-base-10 numbers, as the documentation specifies.
9734 * lisp.h (string_to_number): New decl, replacing ...
9735 (isfloat_string): Remove.
9736 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
9737 (read1): Do not accept +. and -. as integers; this
9738 appears to have been a coding error. Similarly, do not accept
9739 strings like +-1e0 as floating point numbers. Do not report
9740 overflow for integer overflows unless the base is not 10 which
9741 means we have no simple and reliable way to continue.
9742 Break out the floating-point parsing into a new
9743 function string_to_number, so that Fstring_to_number parses
9744 floating point numbers consistently with the Lisp reader.
9745 (digit_to_number): Move here from data.c. Make it static inline.
9746 (E_CHAR, EXP_INT): Remove, replacing with ...
9747 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
9748 (string_to_number): New function, replacing isfloat_string.
9749 This function checks for valid syntax and produces the resulting
9750 Lisp float number too. Rework it so that string-to-number
9751 no longer mishandles examples like "1.0e+". Use strtoumax,
9752 so that overflow for non-base-10 numbers is reported only when
9753 there's no portable and simple way to convert to floating point.
9754
9755 * textprop.c (set_text_properties_1): Rewrite for clarity,
9756 and to avoid GCC warning about integer overflow.
9757
9758 * intervals.h (struct interval): Use EMACS_INT for members
9759 where EMACS_UINT might cause problems. See
9760 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
9761 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
9762 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
9763 All uses changed.
9764 (offset_intervals): Tell GCC not to worry about length overflow
9765 when negating a negative length.
9766
9767 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
9768 (overrun_check_free): Likewise.
9769
9770 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
9771 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
9772 word size.
9773
9774 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9775 (gnutls_make_error): Rename local to avoid shadowing.
9776 (gnutls_emacs_global_deinit): ifdef out; not used.
9777 (Fgnutls_boot): Use const for pointer to readonly storage.
9778 Comment out unused local. Fix pointer signedness problems.
9779
9780 * lread.c (openp): Don't stuff size_t into an 'int'.
9781 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
9782 about possible signed overflow.
9783
9784 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9785 (GDK_KEY_g): Don't define if already defined.
9786 (xg_prepare_tooltip): Avoid pointer signedness problem.
9787 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
9788
9789 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
9790 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
9791
9792 * xfns.c (Fx_window_property): Simplify a bit,
9793 to make a bit faster and to avoid GCC 4.6.0 warning.
9794 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
9795
9796 * fns.c (internal_equal): Don't assume size_t fits in int.
9797
9798 * alloc.c (compact_small_strings): Tighten assertion a little.
9799
9800 Replace pEd with more-general pI, and fix some printf arg casts.
9801 * lisp.h (pI): New macro, generalizing old pEd macro to other
9802 conversion specifiers. For example, use "...%"pI"d..." rather
9803 than "...%"pEd"...".
9804 (pEd): Remove. All uses replaced with similar uses of pI.
9805 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
9806 * alloc.c (check_pure_size): Don't overflow by converting size to int.
9807 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
9808 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
9809 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
9810 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
9811 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
9812 64-bit hosts.
9813 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
9814 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
9815 * print.c (safe_debug_print, print_object): Likewise.
9816 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
9817 to int.
9818 Use pI instead of if-then-else-abort. Use %p to avoid casts,
9819 avoiding the 0 flag, which is not portable.
9820 * process.c (Fmake_network_process): Use pI to avoid cast.
9821 * region-cache.c (pp_cache): Likewise.
9822 * xdisp.c (decode_mode_spec): Likewise.
9823 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
9824 behavior on 64-bit hosts with printf arg.
9825 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
9826 (x_stop_queuing_selection_requests): Likewise.
9827 (x_get_window_property): Don't truncate byte count to an 'int'
9828 when tracing.
9829
9830 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
9831 here, since it parses constructs like leading '-' and spaces,
9832 which are not wanted; and it overflows with large numbers.
9833 Instead, simply match F[0-9]+, which is what is wanted anyway.
9834
9835 * alloc.c: Remove unportable assumptions about struct layout.
9836 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
9837 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
9838 (allocate_vectorlike, make_pure_vector): Use the new macros,
9839 plus offsetof, to remove unportable assumptions about struct layout.
9840 These assumptions hold on all porting targets that I know of, but
9841 they are not guaranteed, they're easy to remove, and removing them
9842 makes further changes easier.
9843
9844 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
9845 This doesn't fix a bug but makes the code clearer.
9846 (string_overrun_cookie): Now const. Use initializers that
9847 don't formally overflow signed char, to avoid warnings.
9848 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
9849 can cause Emacs to crash when string overrun checking is enabled.
9850 (allocate_buffer): Don't assume sizeof (struct buffer) is a
9851 multiple of sizeof (EMACS_INT); it need not be, if
9852 alignof(EMACS_INT) < sizeof (EMACS_INT).
9853 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
9854
9855 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
9856
9857 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
9858
9859 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
9860
9861 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
9862 supposed to be handshaking. (Bug#8556)
9863 Reported by Paul Eggert <eggert@cs.ucla.edu>.
9864
9865 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
9866
9867 * lisp.h (Qdebug): List symbol.
9868 * eval.c (Qdebug): Restore global linkage.
9869 * keyboard.c (debug-on-event): New variable.
9870 (handle_user_signal): Break into debugger when debug-on-event
9871 matches the current signal symbol.
9872
9873 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
9874
9875 * alloc.c (check_sblock, check_string_bytes)
9876 (check_string_free_list): Convert to standard C.
9877
9878 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
9879
9880 * w32.c (emacs_gnutls_push): Fix typo.
9881
9882 2011-04-25 Eli Zaretskii <eliz@gnu.org>
9883
9884 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
9885 "cast to pointer from integer of different size".
9886
9887 Improve doprnt and its use in verror. (Bug#8545)
9888 * doprnt.c (doprnt): Document the set of format control sequences
9889 supported by the function. Use SAFE_ALLOCA instead of always
9890 using `alloca'.
9891
9892 * eval.c (verror): Don't limit the buffer size at size_max-1, that
9893 is one byte too soon. Don't use xrealloc; instead xfree and
9894 xmalloc anew.
9895
9896 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
9897
9898 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
9899 callbacks stage.
9900
9901 * gnutls.c: Renamed global_initialized to
9902 gnutls_global_initialized. Added internals for the
9903 :verify-hostname-error, :verify-error, and :verify-flags
9904 parameters of `gnutls-boot' and documented those parameters in the
9905 docstring. Start callback support.
9906 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
9907 unless a fatal error occurred. Call gnutls_alert_send_appropriate
9908 on error. Return error code.
9909 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
9910 (emacs_gnutls_read): Likewise.
9911 (Fgnutls_boot): Return handshake error code.
9912 (emacs_gnutls_handle_error): New function.
9913 (wsaerror_to_errno): Likewise.
9914
9915 * w32.h (emacs_gnutls_pull): Add prototype.
9916 (emacs_gnutls_push): Likewise.
9917
9918 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
9919 (emacs_gnutls_push): Likewise.
9920
9921 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
9922
9923 * process.c (wait_reading_process_output): Check if GnuTLS
9924 buffered some data internally if no FDs are set for TLS
9925 connections.
9926
9927 * makefile.w32-in (OBJ2): Add gnutls.$(O).
9928 (LIBS): Link to USER_LIBS.
9929 ($(BLD)/gnutls.$(0)): New target.
9930
9931 2011-04-24 Eli Zaretskii <eliz@gnu.org>
9932
9933 * xdisp.c (handle_single_display_spec): Rename the
9934 display_replaced_before_p argument into display_replaced_p, to
9935 make it consistent with the commentary. Fix typos in the
9936 commentary.
9937
9938 * textprop.c (syms_of_textprop): Remove dead code.
9939 (copy_text_properties): Delete obsolete commentary about an
9940 interface that was deleted long ago. Fix typos in the description
9941 of arguments.
9942
9943 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
9944 to changes in oldXMenu/XMenu.h from 2011-04-16.
9945 <menu_help_message, prev_menu_help_message>: Constify.
9946 (IT_menu_make_room): menu->help_text is now `const char **';
9947 adjust.
9948
9949 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
9950 to changes in oldXMenu/XMenu.h from 2011-04-16.
9951 (struct XMenu): Declare `help_text' `const char **'.
9952
9953 * xfaces.c <Qunspecified>: Make extern again.
9954
9955 * syntax.c: Include sys/types.h before including regex.h, as
9956 required by POSIX.
9957
9958 * doc.c (get_doc_string): Improve the format passed to `error'.
9959
9960 * doprnt.c (doprnt): Improve commentary.
9961
9962 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
9963
9964 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
9965 them with etags.
9966
9967 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
9968 changes in globals.h immediately force recompilation.
9969 (TAGS): Depend on $(CURDIR)/m/intel386.h and
9970 $(CURDIR)/s/ms-w32.h.
9971 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
9972
9973 * character.c (Fchar_direction): Function deleted.
9974 (syms_of_character): Don't defsubr it.
9975 <char-direction-table>: Deleted.
9976
9977 2011-04-23 Eli Zaretskii <eliz@gnu.org>
9978
9979 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
9980 * doprnt.c: Include limits.h.
9981 (SIZE_MAX): New macro.
9982 (doprnt): Return a size_t value. 2nd arg is now size_t.
9983 Many local variables are now size_t instead of int or unsigned.
9984 Improve overflow protection. Support `l' modifier for integer
9985 conversions. Support %l conversion. Don't assume an EMACS_INT
9986 argument for integer conversions and for %c.
9987
9988 * lisp.h (doprnt): Restore prototype.
9989
9990 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
9991 $(SRC)/character.h.
9992
9993 * Makefile.in (base_obj): Add back doprnt.o.
9994
9995 * deps.mk (doprnt.o): Add back prerequisites.
9996 (callint.o): Depend on character.h.
9997
9998 * eval.c (internal_lisp_condition_case): Include the handler
9999 representation in the error message.
10000 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
10001 when breaking from the loop.
10002
10003 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
10004
10005 * callint.c (Fcall_interactively): When displaying error message
10006 about invalid control letter, pass the character's codepoint, not
10007 a pointer to its multibyte form. Improve display of the character
10008 in octal and display also its hex code.
10009
10010 * character.c (char_string): Use %x to display the (unsigned)
10011 codepoint of an invalid character, to avoid displaying a bogus
10012 negative value.
10013
10014 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
10015 `error', not SYMBOL_NAME itself.
10016
10017 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
10018 character arguments to `error'.
10019
10020 * charset.c (check_iso_charset_parameter): Fix incorrect argument
10021 to `error' in error message about FINAL_CHAR argument. Make sure
10022 FINAL_CHAR is a character, and use %c when it is passed as
10023 argument to `error'.
10024
10025 2011-04-23 Eli Zaretskii <eliz@gnu.org>
10026
10027 * s/ms-w32.h (localtime): Redirect to sys_localtime.
10028
10029 * w32.c: Include <time.h>.
10030 (sys_localtime): New function.
10031
10032 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
10033
10034 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
10035
10036 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
10037
10038 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
10039
10040 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
10041 zombies (Bug#8467).
10042
10043 2011-04-19 Eli Zaretskii <eliz@gnu.org>
10044
10045 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
10046 gl_state.e_property when gl_state.object is Qt.
10047
10048 * insdel.c (make_gap_larger): Remove limitation of buffer size
10049 to <= INT_MAX.
10050
10051 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
10052
10053 * xdisp.c (lookup_glyphless_char_display)
10054 (produce_glyphless_glyph): Handle cons cell entry in
10055 glyphless-char-display.
10056 (Vglyphless_char_display): Document it.
10057
10058 * term.c (produce_glyphless_glyph): Handle cons cell entry in
10059 glyphless-char-display.
10060
10061 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
10062
10063 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
10064
10065 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
10066
10067 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
10068 definition for no-X builds.
10069
10070 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
10071
10072 Static checks with GCC 4.6.0 and non-default toolkits.
10073
10074 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
10075
10076 * process.c (keyboard_bit_set): Define only if SIGIO.
10077 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
10078 (send_process): Repair possible setjmp clobbering.
10079
10080 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
10081
10082 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
10083
10084 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
10085
10086 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
10087 Define only if needed.
10088
10089 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
10090 by pacifying GCC about it. Maybe it's time to retire it?
10091 * xfaces.c (USG, __TIMEVAL__): Likewise.
10092
10093 * dispextern.h (struct redisplay_interface): Rename param
10094 to avoid shadowing.
10095 * termhooks.h (struct terminal): Likewise.
10096 * xterm.c (xembed_send_message): Likewise.
10097
10098 * insdel.c (make_gap_smaller): Define only if
10099 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
10100
10101 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
10102 it.
10103
10104 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
10105 so that we aren't warned about unused symbols.
10106
10107 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
10108
10109 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
10110
10111 * xfns.c (x_real_positions): Mark locals as initialized.
10112
10113 * xmenu.c (xmenu_show): Don't use uninitialized vars.
10114
10115 * xterm.c: Fix problems found by static analysis with other toolkits.
10116 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
10117 (x_dispatch_event): Declare static if USE_GTK, and
10118 define if USE_GTK || USE_X_TOOLKIT.
10119 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
10120 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
10121 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
10122 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
10123
10124 * xmenu.c (menu_help_callback): Pointer type fixes.
10125 Use const pointers when pointing at readonly data. Avoid pointer
10126 signedness clashes.
10127 (FALSE): Remove unused macro.
10128 (update_frame_menubar): Remove unused decl.
10129
10130 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
10131
10132 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
10133 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
10134 (single_menu_item): Rename local to avoid shadowing.
10135
10136 * keyboard.c (make_lispy_event): Remove unused local var.
10137
10138 * frame.c, frame.h (x_get_resource_string): Bring this back, but
10139 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
10140
10141 * bitmaps: Change bitmaps from unsigned char back to the X11
10142 compatible char. Avoid the old compiler warnings about
10143 out-of-range initializers by using, for example, '\xab' rather
10144 than 0xab.
10145
10146 * xgselect.c (xgselect_initialize): Check vs interface
10147 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
10148
10149 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
10150
10151 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
10152 to read-only memory.
10153
10154 * fns.c (vector): Remove; this old hack is no longer needed.
10155
10156 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
10157 Remove unused var.
10158 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
10159
10160 * xrdb.c (x_load_resources): Omit unused local.
10161
10162 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
10163 (x_window): Rename locals to avoid shadowing.
10164 (USG): Use the kludged USG macro, to pacify gcc.
10165
10166 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
10167 (x_term_init): Remove local to avoid shadowing.
10168
10169 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
10170
10171 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
10172 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
10173
10174 2011-04-16 Eli Zaretskii <eliz@gnu.org>
10175
10176 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
10177
10178 Fix regex.c, syntax.c and friends for buffers > 2GB.
10179 * syntax.h (struct gl_state_s): Declare character position members
10180 EMACS_INT.
10181
10182 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
10183
10184 * textprop.c (verify_interval_modification, interval_of):
10185 Declare arguments EMACS_INT.
10186
10187 * intervals.c (adjust_intervals_for_insertion): Declare arguments
10188 EMACS_INT.
10189
10190 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
10191
10192 * indent.c (Fvertical_motion): Local variable it_start is now
10193 EMACS_INT.
10194
10195 * regex.c (re_match, re_match_2, re_match_2_internal)
10196 (bcmp_translate, regcomp, regexec, print_double_string)
10197 (group_in_compile_stack, re_search, re_search_2, regex_compile)
10198 (re_compile_pattern, re_exec): Declare arguments and local
10199 variables `size_t' and `ssize_t' and return values `regoff_t', as
10200 appropriate.
10201 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
10202 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
10203 <compile_stack_type>: `size' and `avail' are now `size_t'.
10204
10205 * regex.h <regoff_t>: Use ssize_t, not int.
10206 (re_search, re_search_2, re_match, re_match_2): Arguments that
10207 specify buffer/string position and length are now ssize_t and
10208 size_t. Return type is regoff_t.
10209
10210 2011-04-16 Ben Key <bkey76@gmail.com>
10211
10212 * nsfont.m: Fixed bugs in ns_get_family and
10213 ns_descriptor_to_entity that were caused by using free to
10214 deallocate memory blocks that were allocated by xmalloc (via
10215 xstrdup). This caused Emacs to crash when compiled with
10216 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
10217 --enable-checking=xmallocoverrun). xfree is now used to
10218 deallocate these memory blocks.
10219
10220 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
10221
10222 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
10223
10224 emacs_write: Accept and return EMACS_INT for sizes.
10225 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
10226 et seq.
10227 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
10228 Accept and return EMACS_INT.
10229 (emacs_gnutls_write): Return the number of bytes written on
10230 partial writes.
10231 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
10232 (emacs_read, emacs_write): Remove check for negative size, as the
10233 Emacs source code has been audited now.
10234 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
10235 (emacs_read, emacs_write): Use it.
10236 * process.c (send_process): Adjust to the new signatures of
10237 emacs_write and emacs_gnutls_write. Do not attempt to store
10238 a byte offset into an 'int'; it might overflow.
10239 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
10240
10241 * sound.c: Don't assume sizes fit in 'int'.
10242 (struct sound_device.period_size, alsa_period_size):
10243 Return EMACS_INT, not int.
10244 (struct sound_device.write, vox_write, alsa_write):
10245 Accept EMACS_INT, not int.
10246 (wav_play, au_play): Use EMACS_INT to store sizes and to
10247 record read return values.
10248
10249 2011-04-15 Ben Key <bkey76@gmail.com>
10250
10251 * keyboard.c (Qundefined): Don't declare static since it is used
10252 in nsfns.m.
10253 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
10254 static since they are used in nsfont.m.
10255
10256 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
10257
10258 * process.c (Qprocessp): Don't declare static.
10259 * lisp.h (Qprocessp): Declare again.
10260
10261 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
10262
10263 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
10264
10265 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
10266
10267 Improve C-level modularity by making more things 'static'.
10268
10269 Don't publish debugger-only interfaces to other modules.
10270 * lisp.h (safe_debug_print, debug_output_compilation_hack):
10271 (verify_bytepos, count_markers): Move decls to the only modules
10272 that need them.
10273 * region-cache.h (pp_cache): Likewise.
10274 * window.h (check_all_windows): Likewise.
10275 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
10276
10277 * sysdep.c (croak): Now static, if
10278 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
10279 * syssignal.h (croak): Declare only if not static.
10280
10281 * alloc.c (refill_memory_reserve): Now static if
10282 !defined REL_ALLOC || defined SYSTEM_MALLOC.
10283 * lisp.h (refill_memory_reserve): Declare only if not static.
10284
10285 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
10286 Define only if USE_LUCID.
10287
10288 * xrdb.c (x_customization_string, x_rm_string): Now static.
10289
10290 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
10291 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
10292
10293 * xdisp.c (draw_row_with_mouse_face): Now static.
10294 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
10295
10296 * window.h (check_all_windows): Mark externally visible.
10297
10298 * window.c (window_deletion_count): Now static.
10299
10300 * undo.c: Make symbols static if they're not exported.
10301 (last_undo_buffer, last_boundary_position, pending_boundary):
10302 Now static.
10303
10304 * textprop.c (interval_insert_behind_hooks): Now static.
10305 (interval_insert_in_front_hooks): Likewise.
10306
10307 * term.c: Make symbols static if they're not exported.
10308 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
10309 (max_frame_lines, tty_set_terminal_modes):
10310 (tty_reset_terminal_modes, tty_turn_off_highlight):
10311 (get_tty_terminal): Now static.
10312 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
10313 * termhooks.h (term_mouse_moveto): Do not declare if
10314 HAVE_WINDOW_SYSTEM.
10315 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
10316 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
10317
10318 * sysdep.c: Make symbols static if they're not exported.
10319 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
10320 Now static.
10321 (sigprocmask_set, full_mask): Remove; unused.
10322 (wait_debugging): Mark as visible.
10323 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
10324 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
10325
10326 * syntax.c (syntax_temp): Define only if !__GNUC__.
10327
10328 * sound.c (current_sound_device, current_sound): Now static.
10329
10330 * search.c (searchbufs, searchbuf_head): Now static.
10331
10332 * scroll.c (scroll_cost): Remove; unused.
10333 * dispextern.h (scroll_cost): Remove decl.
10334
10335 * region-cache.h (pp_cache): Mark as externally visible.
10336
10337 * process.c: Make symbols static if they're not exported.
10338 (process_tick, update_tick, create_process, chan_process):
10339 (Vprocess_alist, proc_buffered_char, datagram_access):
10340 (fd_callback_data, send_process_frame, process_sent_to): Now static.
10341 (deactivate_process): Mark defn as static, as well as decl.
10342 * lisp.h (create_process): Remove decl.
10343 * process.h (chan_process, Vprocess_alist): Remove decls.
10344
10345 * print.c: Make symbols static if they're not exported.
10346 (print_depth, new_backquote_output, being_printed, print_buffer):
10347 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
10348 (print_interval, print_number_index, initial_stderr_stream):
10349 Now static.
10350 * lisp.h (Fprinc): Remove decl.
10351 (debug_output_compilation_hack): Mark as externally visible.
10352
10353 * sysdep.c (croak): Move decl from here to syssignal.h.
10354 * syssignal.h (croak): Put it here, so the API can be checked when
10355 'croak' is called from dissociate_if_controlling_tty.
10356
10357 * minibuf.c: Make symbols static if they're not exported.
10358 (minibuf_save_list, choose_minibuf_frame): Now static.
10359 * lisp.h (choose_minibuf_frame): Remove decl.
10360
10361 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
10362
10363 * lread.c: Make symbols static if they're not exported.
10364 (read_objects, initial_obarray, oblookup_last_bucket_number):
10365 Now static.
10366 (make_symbol): Remove; unused.
10367 * lisp.h (initial_obarray, make_symbol): Remove decls.
10368
10369 * keyboard.c: Make symbols static if they're not exported.
10370 (single_kboard, recent_keys_index, total_keys, recent_keys):
10371 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
10372 (this_single_command_key_start, echoing, last_auto_save):
10373 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
10374 (command_loop, echo_now, keyboard_init_hook, help_char_p):
10375 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10376 (Vlispy_mouse_stem, double_click_count):
10377 Now static.
10378 (force_auto_save_soon): Define only if SIGDANGER.
10379 (ignore_mouse_drag_p): Now static if
10380 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
10381 (print_help): Remove; unused.
10382 (stop_character, last_timer_event): Mark as externally visible.
10383 * keyboard.h (ignore_mouse_drag_p): Declare only if
10384 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
10385 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
10386 * lisp.h (echoing): Remove decl.
10387 (force_auto_save_soon): Declare only if SIGDANGER.
10388 * xdisp.c (redisplay_window): Simplify code, to make it more
10389 obvious that ignore_mouse_drag_p is not accessed if !defined
10390 USE_GTK && !defined HAVE_NS.
10391
10392 * intervals.c: Make symbols static if they're not exported.
10393 (merge_properties_sticky, merge_interval_right, delete_interval):
10394 Now static.
10395 * intervals.h (merge_interval_right, delete_interval): Remove decls.
10396
10397 * insdel.c: Make symbols static if they're not exported.
10398 However, leave prepare_to_modify_buffer alone. It's never
10399 called from outside this function, but that appears to be a bug.
10400 (combine_after_change_list, combine_after_change_buffer):
10401 (adjust_after_replace, signal_before_change): Now static.
10402 (adjust_after_replace_noundo): Remove; unused.
10403 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
10404 (signal_before_change): Remove decls.
10405
10406 * indent.c (val_compute_motion, val_vmotion): Now static.
10407
10408 * image.c: Make symbols static if they're not exported.
10409 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
10410 if USE_GTK.
10411 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
10412 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
10413
10414 * fringe.c (standard_bitmaps): Now static.
10415 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
10416
10417 * frame.c: Make symbols static if they're not exported.
10418 (x_report_frame_params, make_terminal_frame): Now static.
10419 (get_frame_param): Now static, unless HAVE_NS.
10420 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
10421 (x_get_resource_string): Remove; not used.
10422 * frame.h (make_terminal_frame, x_report_frame_params):
10423 (x_get_resource_string); Remove decls.
10424 (x_fullscreen_adjust): Declare only if WINDOWSNT.
10425 * lisp.h (get_frame_param): Declare only if HAVE_NS.
10426
10427 * font.c, fontset.c: Make symbols static if they're not exported.
10428 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
10429 (FACE_SUITABLE_FOR_CHAR_P): Use it.
10430 * font.c (font_close_object): Now static.
10431 * font.h (font_close_object): Remove.
10432 * fontset.c (FONTSET_OBJLIST): Remove.
10433 (free_realized_fontset) #if-0 the body, which does nothing.
10434 (face_suitable_for_char_p): #if-0, as it's never called.
10435 * fontset.h (face_suitable_for_char_p): Remove decl.
10436 * xfaces.c (face_at_string_position):
10437 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
10438 since 0 is always ASCII.
10439
10440 * fns.c (weak_hash_tables): Now static.
10441
10442 * fileio.c: Make symbols static if they're not exported.
10443 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
10444 (Vwrite_region_annotation_buffers): Now static.
10445
10446 * eval.c: Make symbols static if they're not exported.
10447 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
10448 * lisp.h (backtrace_list): Remove decl.
10449
10450 * emacs.c: Make symbols static if they're not exported.
10451 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
10452 (fatal_error_code, fatal_error_signal_hook, standard_args):
10453 Now static.
10454 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
10455 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
10456 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
10457 * lisp.h (fatal_error_signal_hook): Remove decl.
10458 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
10459
10460 * editfns.c: Move a (normally-unused) function to its only use.
10461 * editfns.c, lisp.h (get_operating_system_release): Remove.
10462 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
10463 worth the hassle of breaking this out.
10464
10465 * xterm.c: Make symbols static if they're not exported.
10466 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
10467 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
10468 (x_destroy_window, x_delete_display):
10469 Now static.
10470 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
10471 (x_mouse_leave): Remove; unused.
10472 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
10473 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
10474 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
10475 Remove decls.
10476 (x_mouse_leave): Declare only if WINDOWSNT.
10477 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
10478 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
10479 USE_X_TOOLKIT.
10480
10481 * ftxfont.c: Make symbols static if they're not exported.
10482 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
10483 HAVE_FREETYPE.
10484 * font.h (ftxfont_driver): Likewise.
10485
10486 * xfns.c: Make symbols static if they're not exported.
10487 (x_last_font_name, x_display_info_for_name):
10488 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
10489 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
10490 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
10491 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
10492 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
10493 (last_show_tip_args): Now static.
10494 (xic_defaut_fontset, xic_create_fontsetname): Define only if
10495 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
10496 (x_screen_planes): Remove; unused.
10497 * dispextern.h (x_screen_planes): Remove decl.
10498
10499 * dispnew.c: Make symbols static if they're not exported.
10500 * dispextern.h (redraw_garbaged_frames, scrolling):
10501 (increment_row_positions): Remove.
10502 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
10503 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
10504 Now static.
10505 (redraw_garbaged_frames): Remove; unused.
10506
10507 * xfaces.c: Make symbols static if they're not exported.
10508 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
10509 Remove decls.
10510 * xterm.h (defined_color): Remove decls.
10511 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
10512 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
10513 (menu_face_changed_default, defined_color, free_realized_face):
10514 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
10515 (ascii_face_of_lisp_face): Remove; unused.
10516
10517 * xdisp.c: Make symbols static if they're not exported.
10518 * dispextern.h (scratch_glyph_row, window_box_edges):
10519 (glyph_to_pixel_coords, set_cursor_from_row):
10520 (get_next_display_element, set_iterator_to_next):
10521 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
10522 (show_mouse_face): Remove decls
10523 * frame.h (message_buf_print): Likewise.
10524 * lisp.h (pop_message, set_message, check_point_in_composition):
10525 Likewise.
10526 * xterm.h (set_vertical_scroll_bar): Likewise.
10527 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
10528 (message_buf_print, scratch_glyph_row, displayed_buffer):
10529 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
10530 (get_next_display_element, show_mouse_face, window_box_edges):
10531 (frame_to_window_pixel_xy, check_point_in_composition):
10532 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
10533 (glyph_to_pixel_coords): Remove; unused.
10534
10535 * dired.c (file_name_completion): Now static.
10536
10537 * dbusbind.c (xd_in_read_queued_messages): Now static.
10538
10539 * lisp.h (circular_list_error, FOREACH): Remove; unused.
10540 * data.c (circular_list_error): Remove.
10541
10542 * commands.h (last_point_position, last_point_position_buffer):
10543 (last_point_position_window): Remove decls.
10544 * keyboard.c: Make these variables static.
10545
10546 * coding.h (coding, code_convert_region, encode_coding_gap):
10547 Remove decls.
10548 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
10549 (iso_code_class, detect_coding, code_convert_region): Now static.
10550 (encode_coding_gap): Remove; unused.
10551
10552 * chartab.c (chartab_chars, chartab_bits): Now static.
10553
10554 * charset.h (charset_iso_8859_1): Remove decl.
10555 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
10556 Now static.
10557
10558 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
10559 * ccl.c (Vccl_program_table): Now static.
10560 (check_ccl_update): Remove; unused.
10561
10562 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
10563 * category.h: ... from here.
10564 * category.c (check_category_table, set_category_set): Now static.
10565
10566 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
10567 * lisp.h: Remove these decls.
10568
10569 * buffer.c (buffer_count): Remove unused var.
10570
10571 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
10572 so that it's not optimized away.
10573 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
10574 * dispextern.h (bidi_dump_cached_states): Remove, since it's
10575 exported only to the debugger.
10576
10577 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
10578 * atimer.h (run_all_atimers): Remove; not exported.
10579
10580 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
10581 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
10582 was inaccessible from Lisp.
10583 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
10584 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
10585
10586 alloc.c: Import and export fewer symbols, and remove unused items.
10587 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
10588 is defined.
10589 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
10590 it's not optimized away by whole-program optimization.
10591 (message_enable_multibyte, free_misc): Remove.
10592 (catchlist, handlerlist, mark_backtrace):
10593 Declare only if BYTE_MARK_STACK.
10594 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
10595 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
10596 (message_enable_multibyte): Remove decl.
10597 (free_misc, interval_free_list, float_block, float_block_index):
10598 (n_float_blocks, float_free_list, cons_block, cons_block_index):
10599 (cons_free_list, last_marked_index):
10600 Now static.
10601 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
10602 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
10603 (mark_backtrace): Define only if BYTE_MARK_STACK.
10604 * xdisp.c (message_enable_multibyte): Now static.
10605
10606 Declare Lisp_Object Q* variables to be 'static' if not exported.
10607 This makes it easier for human readers (and static analyzers)
10608 to see whether these variables are used from other modules.
10609 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
10610 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
10611 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
10612 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
10613 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
10614 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
10615 * xmenu.c, xselect.c:
10616 Declare Q* vars static if they are not used in other modules.
10617 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
10618 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
10619 Remove decls of unexported vars.
10620 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
10621
10622 * lisp.h (DEFINE_FUNC): Make sname 'static'.
10623
10624 Make Emacs functions such as Fatom 'static' by default.
10625 This makes it easier for human readers (and static analyzers)
10626 to see whether these functions can be called from other modules.
10627 DEFUN now defines a static function. To make the function external
10628 so that it can be used in other C modules, use the new macro DEFUE.
10629 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
10630 (Finit_image_library):
10631 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
10632 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
10633 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
10634 Remove decls, since these functions are now static.
10635 (Funintern, Fget_internal_run_time): New decls, since these functions
10636 were already external.
10637
10638 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
10639 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
10640 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
10641 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
10642 * keyboard.c, keymap.c, lread.c:
10643 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
10644 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
10645 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
10646 Mark functions with DEFUE instead of DEFUN,
10647 if they are used in other modules.
10648 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
10649 decls for now-static functions.
10650 * buffer.h (Fdelete_overlay): Remove decl.
10651 * callproc.c (Fgetenv_internal): Mark as internal.
10652 * composite.c (Fremove_list_of_text_properties): Remove decl.
10653 (Fcomposition_get_gstring): New forward static decl.
10654 * composite.h (Fcomposite_get_gstring): Remove decl.
10655 * dired.c (Ffile_attributes): New forward static decl.
10656 * doc.c (Fdocumntation_property): New forward static decl.
10657 * eval.c (Ffetch_bytecode): New forward static decl.
10658 (Funintern): Remove extern decl; now in .h file where it belongs.
10659 * fileio.c (Fmake_symbolic_link): New forward static decl.
10660 * image.c (Finit_image_library): New forward static decl.
10661 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
10662 * intervals.h (Fprevious_property_change):
10663 (Fremove_list_of_text_properties): Remove decls.
10664 * keyboard.c (Fthis_command_keys): Remove decl.
10665 (Fcommand_execute): New forward static decl.
10666 * keymap.c (Flookup_key): New forward static decl.
10667 (Fcopy_keymap): Now static.
10668 * keymap.h (Flookup_key): Remove decl.
10669 * process.c (Fget_process): New forward static decl.
10670 (Fprocess_datagram_address): Mark as internal.
10671 * syntax.c (Fsyntax_table_p): New forward static decl.
10672 (skip_chars): Remove duplicate decl.
10673 * textprop.c (Fprevious_property_change): New forward static decl.
10674 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
10675 Now internal.
10676 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
10677 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
10678
10679 * editfns.c (Fformat): Remove unreachable code.
10680
10681 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
10682
10683 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
10684 change. (Bug#8496)
10685
10686 2011-04-13 Eli Zaretskii <eliz@gnu.org>
10687
10688 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
10689 when at ZV. (Bug#8487)
10690
10691 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
10692
10693 * charset.c (Fclear_charset_maps): Use xfree instead of free.
10694 (Bug#8437)
10695 * keyboard.c (parse_tool_bar_item): Likewise.
10696 * sound.c (sound_cleanup, alsa_close): Likewise.
10697 * termcap.c (tgetent): Likewise.
10698 * xfns.c (x_default_font_parameter): Likewise.
10699 * xsettings.c (read_and_apply_settings): Likewise.
10700
10701 * alloc.c (overrun_check_malloc, overrun_check_realloc)
10702 (overrun_check_free): Protoize.
10703
10704 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
10705
10706 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
10707 since callers should never pass a negative size.
10708 Change the signature to match that of plain 'read' and 'write'; see
10709 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
10710 * lisp.h: Update prototypes of emacs_write and emacs_read.
10711
10712 2011-04-11 Eli Zaretskii <eliz@gnu.org>
10713
10714 * xdisp.c (redisplay_window): Don't try to determine the character
10715 position of the scroll margin if the window start point w->startp
10716 is outside the buffer's accessible region. (Bug#8468)
10717
10718 2011-04-10 Eli Zaretskii <eliz@gnu.org>
10719
10720 Fix write-region and its subroutines for buffers > 2GB.
10721 * fileio.c (a_write, e_write): Modify declaration of arguments and
10722 local variables to support buffers larger than 2GB.
10723 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
10724
10725 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
10726 argument, local variables, and return value.
10727
10728 * lisp.h: Update prototypes of emacs_write and emacs_read.
10729
10730 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
10731
10732 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
10733
10734 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
10735
10736 Fix more problems found by GCC 4.6.0's static checks.
10737
10738 * xdisp.c (vmessage): Use a better test for character truncation.
10739
10740 * charset.c (load_charset_map): <, not <=, for optimization,
10741 and to avoid potential problems with integer overflow.
10742 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
10743 * casetab.c (set_identity, shuffle): Likewise.
10744 * editfns.c (Fformat): Likewise.
10745 * syntax.c (skip_chars): Likewise.
10746
10747 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
10748 This also lets GCC 4.6.0 generate slightly better loop code.
10749
10750 * callint.c (Fcall_interactively): <, not <=, for optimization.
10751 (Fcall_interactively): Count the number of arguments produced,
10752 not the number of arguments given. This is simpler and lets GCC
10753 4.6.0 generate slightly better code.
10754
10755 * ftfont.c: Distingish more carefully between FcChar8 and char.
10756 The previous code passed unsigned char * to a functions like
10757 strlen and xstrcasecmp that expect char *, which does not
10758 conform to the C standard.
10759 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
10760 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
10761 char * when the C standard requires it.
10762
10763 * keyboard.c (read_char): Remove unused var.
10764
10765 * eval.c: Port to Windows vsnprintf (Bug#8435).
10766 Include <limits.h>.
10767 (SIZE_MAX): Define if the headers do not.
10768 (verror): Do not give up if vsnprintf returns a negative count.
10769 Instead, grow the buffer. This ports to Windows vsnprintf, which
10770 does not conform to C99. Problem reported by Eli Zaretskii.
10771 Also, simplify the allocation scheme, by avoiding the need for
10772 calling realloc, and removing the ALLOCATED variable.
10773
10774 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
10775
10776 Remove invocations of doprnt, as Emacs now uses vsnprintf.
10777 But keep the doprint source code for now, as we might revamp it
10778 and use it again (Bug#8435).
10779 * lisp.h (doprnt): Remove.
10780 * Makefile.in (base_obj): Remove doprnt.o.
10781 * deps.mk (doprnt.o): Remove.
10782
10783 error: Print 32- and 64-bit integers portably (Bug#8435).
10784 Without this change, on typical 64-bit hosts error ("...%d...", N)
10785 was used to print both 32- and 64-bit integers N, which relied on
10786 undefined behavior.
10787 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
10788 * lisp.h (error, verror): Mark as printf-like functions.
10789 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
10790 Report overflow in size calculations when allocating printf buffer.
10791 Do not truncate output string at its first null byte.
10792 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
10793 Truncate the output at a character boundary, since vsnprintf does not
10794 do that.
10795 * charset.c (check_iso_charset_parameter): Convert internal
10796 character to string before calling 'error', since %c now has the
10797 printf meaning.
10798 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
10799 overflow when computing char to be passed to 'error'. Do not
10800 pass Lisp_Object to 'error'; pass the integer instead.
10801 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
10802 formatted with plain %d.
10803
10804 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
10805
10806 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
10807
10808 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
10809
10810 * xterm.c (x_catch_errors): Remove duplicate declaration.
10811
10812 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
10813
10814 * xdisp.c, lisp.h (message_nolog): Remove; unused.
10815
10816 2011-04-10 Jim Meyering <meyering@redhat.com>
10817
10818 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
10819 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
10820 return ssize_t not "int", and use size_t as the buffer length.
10821 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
10822 * gnutls.h: Update declarations.
10823 * process.c (read_process_output): Use ssize_t, to match.
10824 (send_process): Likewise.
10825
10826 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
10827
10828 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
10829
10830 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
10831
10832 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
10833 Use unsigned char, to match FcChar8 type definition.
10834
10835 * xterm.c (handle_one_xevent):
10836 * xmenu.c (create_and_show_popup_menu):
10837 * xselect.c (x_decline_selection_request)
10838 (x_reply_selection_request): Avoid type-punned deref of X events.
10839
10840 2011-04-09 Eli Zaretskii <eliz@gnu.org>
10841
10842 Fix some uses of `int' instead of EMACS_INT.
10843 * search.c (string_match_1, fast_string_match)
10844 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
10845 (scan_buffer, find_next_newline_no_quit)
10846 (find_before_next_newline, search_command, Freplace_match)
10847 (Fmatch_data): Make some `int' variables be EMACS_INT.
10848
10849 * xdisp.c (display_count_lines): 3rd argument and return value now
10850 EMACS_INT. All callers changed.
10851 (pint2hrstr): Last argument is now EMACS_INT.
10852
10853 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
10854 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10855 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
10856 (decode_coding_utf_16, decode_coding_emacs_mule)
10857 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
10858 (decode_coding_ccl, decode_coding_charset)
10859 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
10860 (decode_coding_iso_2022, decode_coding_emacs_mule)
10861 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
10862 <char_offset, last_offset>: Declare EMACS_INT.
10863 (encode_coding_utf_8, encode_coding_utf_16)
10864 (encode_coding_emacs_mule, encode_invocation_designation)
10865 (encode_designation_at_bol, encode_coding_iso_2022)
10866 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
10867 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
10868 Declare EMACS_INT.
10869 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
10870 (encode_invocation_designation): Last argument P_NCHARS is now
10871 EMACS_INT.
10872 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
10873 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
10874
10875 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
10876 All users changed.
10877
10878 * ccl.c (Fccl_execute_on_string): Declare some variables
10879 EMACS_INT.
10880
10881 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
10882
10883 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
10884
10885 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
10886
10887 * process.c (Fformat_network_address): Doc fix.
10888
10889 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
10890
10891 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
10892
10893 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
10894
10895 * keyboard.c (read_char): Call Lisp function help-form-show,
10896 instead of using internal_with_output_to_temp_buffer.
10897 (Qhelp_form_show): New var.
10898 (syms_of_keyboard): Use DEFSYM macro.
10899
10900 * print.c (internal_with_output_to_temp_buffer): Function deleted.
10901
10902 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
10903
10904 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
10905
10906 * process.c (Flist_processes): Remove to Lisp.
10907 (list_processes_1): Delete.
10908
10909 2011-04-06 Eli Zaretskii <eliz@gnu.org>
10910
10911 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
10912
10913 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
10914
10915 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
10916
10917 Fix more problems found by GCC 4.6.0's static checks.
10918
10919 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
10920
10921 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
10922
10923 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
10924
10925 * xdisp.c (vmessage): Mark as a printf-like function.
10926
10927 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
10928
10929 * sound.c (sound_warning): Don't crash if arg contains a printf format.
10930
10931 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
10932 printf-like functions.
10933 (tiff_load): Add casts to remove these marks before passing them
10934 to system-supplied API.
10935
10936 * eval.c (Fsignal): Remove excess argument to 'fatal'.
10937
10938 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
10939 This avoids several warnings with gcc -Wstrict-overflow.
10940 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
10941 directly, rather than having caller test rule sign. This avoids
10942 some unnecessary tests.
10943 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
10944 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
10945 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
10946
10947 * xfont.c (xfont_text_extents): Remove var that was set but not used.
10948 (xfont_open): Avoid unnecessary tests.
10949
10950 * composite.c (composition_gstring_put_cache): Use unsigned integer.
10951
10952 * composite.h, composite.c (composition_gstring_put_cache):
10953 Use EMACS_INT, not int, for length.
10954
10955 * composite.h (COMPOSITION_DECODE_REFS): New macro,
10956 breaking out part of COMPOSITION_DECODE_RULE.
10957 (COMPOSITION_DECODE_RULE): Use it.
10958 * composite.c (get_composition_id): Remove unused local vars,
10959 by using the new macro.
10960
10961 * textprop.c (set_text_properties_1): Change while to do-while,
10962 since the condition is always true at first.
10963
10964 * intervals.c (graft_intervals_into_buffer): Mark var as used.
10965 (interval_deletion_adjustment): Return unsigned value.
10966 All uses changed.
10967
10968 * process.c (list_processes_1, create_pty, read_process_output):
10969 (exec_sentinel): Remove vars that were set but not used.
10970 (create_pty): Remove unnecessary "volatile"s.
10971 (Fnetwork_interface_info): Avoid possibility of int overflow.
10972 (read_process_output): Do adaptive read buffering even if carryover.
10973 (read_process_output): Simplify nbytes computation if buffered.
10974
10975 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
10976
10977 * syntax.c (scan_words): Remove var that was set but not used.
10978 (update_syntax_table): Use unsigned instead of int.
10979
10980 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
10981 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
10982 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
10983
10984 * print.c (print_error_message): Avoid int overflow.
10985
10986 * font.c (font_list_entities): Redo for clarity,
10987 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
10988
10989 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
10990 (font_score): Avoid potential overflow in diff calculation.
10991
10992 * fns.c (substring_both): Remove var that is set but not used.
10993 (sxhash): Redo loop for clarity and to avoid wraparound warning.
10994
10995 * eval.c (funcall_lambda): Rename local to avoid shadowing.
10996
10997 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
10998 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
10999 can always succeed if overflow has undefined behavior.
11000
11001 * search.c (boyer_moore, wordify): Remove vars set but not used.
11002 (wordify): Omit three unnecessary tests.
11003
11004 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
11005 All callers changed. This avoids the need for an unused var.
11006
11007 * casefiddle.c (casify_region): Remove var that is set but not used.
11008
11009 * dired.c (file_name_completion): Remove var that is set but not used.
11010
11011 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
11012
11013 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
11014 (Finsert_file_contents): Remove unnecessary code checking fd.
11015
11016 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
11017 Check for integer overflow on size calculations.
11018
11019 * buffer.c (Fprevious_overlay_change): Remove var that is set
11020 but not used.
11021
11022 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
11023 Remove vars that are set but not used.
11024 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
11025 (timer_check_2): Mark vars as initialized.
11026
11027 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
11028
11029 * image.c (lookup_image): Remove var that is set but not used.
11030 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
11031
11032 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
11033 that are set but not used.
11034
11035 * xfns.c (make_invisible_cursor): Don't return garbage
11036 if XCreateBitmapFromData fails (Bug#8410).
11037
11038 * xselect.c (x_get_local_selection, x_handle_property_notify):
11039 Remove vars that are set but not used.
11040
11041 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
11042 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
11043
11044 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
11045 Remove var that is set but not used.
11046 (scroll_bar_windows_size): Now size_t, not int.
11047 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
11048 Check for overflow.
11049
11050 * xfaces.c (realize_named_face): Remove vars that are set but not used.
11051 (map_tty_color) [!defined MSDOS]: Likewise.
11052
11053 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
11054
11055 * coding.c: Remove vars that are set but not used.
11056 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
11057 All callers changed.
11058 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
11059 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
11060 (decode_coding_charset): Remove vars that are set but not used.
11061
11062 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
11063 that is set but not used.
11064
11065 * print.c (print_object): Remove var that is set but not used.
11066
11067 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
11068 The gnulib version avoids calling malloc in the usual case,
11069 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
11070 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
11071 * filelock.c (current_lock_owner): Likewise.
11072 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
11073 * sysdep.c: Include allocator.h, careadlinkat.h.
11074 (emacs_no_realloc_allocator): New static constant.
11075 (emacs_readlink): New function.
11076 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
11077 ../lib/careadlinkat.h.
11078
11079 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
11080
11081 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
11082 first non-nil return value).
11083
11084 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
11085
11086 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
11087 if not defined (Bug#8403).
11088
11089 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
11090
11091 * xdisp.c (display_count_lines): Remove parameter `start',
11092 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11093 (get_char_face_and_encoding): Remove parameter `multibyte_p',
11094 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11095 (fill_stretch_glyph_string): Remove parameters `row' and `area',
11096 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
11097 and thereabouts. All callers changed.
11098 (get_per_char_metric): Remove parameter `f', unused since
11099 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11100
11101 2011-04-02 Jim Meyering <meyering@redhat.com>
11102
11103 do not dereference NULL upon failed strdup
11104 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
11105 (ns_get_family): Likewise.
11106
11107 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
11108
11109 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
11110
11111 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
11112
11113 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
11114 later (Bug#8403).
11115
11116 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
11117
11118 Add lexical binding.
11119
11120 * window.c (Ftemp_output_buffer_show): New fun.
11121 (Fsave_window_excursion):
11122 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
11123
11124 * lread.c (lisp_file_lexically_bound_p): New function.
11125 (Fload): Bind Qlexical_binding.
11126 (readevalloop): Remove `evalfun' arg.
11127 Bind Qinternal_interpreter_environment.
11128 (Feval_buffer): Bind Qlexical_binding.
11129 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
11130 Mark as dynamic.
11131 (syms_of_lread): Declare `lexical-binding'.
11132
11133 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
11134
11135 * keyboard.c (eval_dyn): New fun.
11136 (menu_item_eval_property): Use it.
11137
11138 * image.c (parse_image_spec): Use Ffunctionp.
11139
11140 * fns.c (concat, mapcar1): Accept byte-code-functions.
11141
11142 * eval.c (Fsetq): Handle lexical vars.
11143 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
11144 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
11145 (FletX, Flet): Obey lexical binding.
11146 (Fcommandp): Handle closures.
11147 (Feval): New `lexical' arg.
11148 (eval_sub): New function extracted from Feval. Use it almost
11149 everywhere where Feval was used. Look up vars in lexical env.
11150 Handle closures.
11151 (Ffunctionp): Move from subr.el.
11152 (Ffuncall): Handle closures.
11153 (apply_lambda): Remove `eval_flags'.
11154 (funcall_lambda): Handle closures and new byte-code-functions.
11155 (Fspecial_variable_p): New function.
11156 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
11157 but without exporting it to Lisp.
11158
11159 * doc.c (Fdocumentation, store_function_docstring):
11160 * data.c (Finteractive_form): Handle closures.
11161
11162 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
11163 interactive spec.
11164
11165 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
11166 New byte-codes.
11167 (exec_byte_code): New function extracted from Fbyte_code to handle new
11168 calling convention for byte-code-functions. Add new byte-codes.
11169
11170 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
11171
11172 * alloc.c (Fmake_symbol): Init new `declared_special' field.
11173
11174 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
11175
11176 * xdisp.c (redisplay_internal): Fix prototype.
11177
11178 2011-03-31 Eli Zaretskii <eliz@gnu.org>
11179
11180 * xdisp.c (SCROLL_LIMIT): New macro.
11181 (try_scrolling): Use it when setting scroll_limit.
11182 Limit scrolling to 100 screen lines.
11183 (redisplay_window): Even when falling back on "recentering",
11184 position point in the window according to scroll-conservatively,
11185 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
11186
11187 (try_scrolling): When point is above the window, allow searching
11188 as far as scroll_max, or one screenful, to compute vertical
11189 distance from PT to the scroll margin position. This prevents
11190 try_scrolling from unnecessarily failing when
11191 scroll-conservatively is set to a value slightly larger than the
11192 window height. Clean up the case of PT below the margin at bottom
11193 of window: scroll_max can no longer be INT_MAX. When aggressive
11194 scrolling is in use, don't let point enter the opposite scroll
11195 margin as result of the scroll.
11196 (syms_of_xdisp) <scroll-conservatively>: Document the
11197 threshold of 100 lines for never-recentering scrolling.
11198
11199 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
11200
11201 * dispextern.h (move_it_by_lines):
11202 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
11203 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
11204 (message_log_check_duplicate): Remove parameters `prev_bol' and
11205 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11206 (redisplay_internal): Remove parameter `preserve_echo_area',
11207 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
11208
11209 * indent.c (Fvertical_motion):
11210 * window.c (window_scroll_pixel_based, Frecenter):
11211 Don't pass `need_y_p' to `move_it_by_lines'.
11212
11213 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
11214
11215 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
11216 steal a few bits to be more compact.
11217 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
11218 Remove unneeded casts.
11219
11220 * bytecode.c (Fbyte_code): CAR and CDR can GC.
11221
11222 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
11223
11224 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
11225 binding" message (bug#7967).
11226
11227 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 Fix more problems found by GCC 4.6.0's static checks.
11230
11231 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
11232 Remove unused local var.
11233
11234 * editfns.c (Fmessage_box): Remove unused local var.
11235
11236 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11237 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11238 Omit unused local vars.
11239 * window.c (shrink_windows): Omit unused local var.
11240 * menu.c (digest_single_submenu): Omit unused local var.
11241 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
11242 Omit unused local var.
11243
11244 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
11245 Don't assume string length fits in int.
11246 (keyremap_step, read_key_sequence): Use size_t for sizes.
11247 (read_key_sequence): Don't check last_real_key_start redundantly.
11248
11249 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
11250 instead of alloca (Bug#8344).
11251
11252 * eval.c (Fbacktrace): Don't assume nargs fits in int.
11253 (Fbacktrace_frame): Don't assume nframes fits in int.
11254
11255 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
11256
11257 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
11258 concerns.
11259
11260 * term.c (produce_glyphless_glyph): Remove unnecessary test.
11261
11262 * cm.c (calccost): Turn while-do into do-while, for clarity.
11263
11264 * keyboard.c (syms_of_keyboard): Use the same style as later
11265 in this function when indexing through an array. This also
11266 works around GCC bug 48267.
11267
11268 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
11269
11270 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
11271
11272 * chartab.c (sub_char_table_ref_and_range): Redo for slight
11273 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
11274
11275 * keyboard.c, keyboard.h (num_input_events): Now size_t.
11276 This avoids undefined behavior on integer overflow, and is a bit
11277 more convenient anyway since it is compared to a size_t variable.
11278
11279 Variadic C functions now count arguments with size_t, not int.
11280 This avoids an unnecessary limitation on 64-bit machines, which
11281 caused (substring ...) to crash on large vectors (Bug#8344).
11282 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
11283 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
11284 All variadic functions and their callers changed accordingly.
11285 (struct gcpro.nvars): Now size_t, not int. All uses changed.
11286 * data.c (arith_driver, float_arith_driver): Likewise.
11287 * editfns.c (general_insert_function): Likewise.
11288 * eval.c (struct backtrace.nargs, interactive_p)
11289 (internal_condition_case_n, run_hook_with_args, apply_lambda)
11290 (funcall_lambda, mark_backtrace): Likewise.
11291 * fns.c (concat): Likewise.
11292 * frame.c (x_set_frame_parameters): Likewise.
11293 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
11294 0 if not found, not -1. All callers changed.
11295
11296 * alloc.c (garbage_collect): Don't assume stack size fits in int.
11297 (stack_copy_size): Now size_t, not int.
11298 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
11299
11300 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11301
11302 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
11303 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11304 All callers changed.
11305
11306 * lisp.h (multibyte_char_to_unibyte):
11307 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
11308 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11309 * character.h (CHAR_TO_BYTE8):
11310 * cmds.c (internal_self_insert):
11311 * editfns.c (general_insert_function):
11312 * keymap.c (push_key_description):
11313 * search.c (Freplace_match):
11314 * xdisp.c (message_dolog, set_message_1): All callers changed.
11315
11316 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11317
11318 * keyboard.c (safe_run_hook_funcall): New function.
11319 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
11320 don't set the hook to nil, but remove the offending function instead.
11321 (Qcommand_hook_internal): Remove, unused.
11322 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
11323 Vcommand_hook_internal.
11324
11325 * eval.c (enum run_hooks_condition): Remove.
11326 (funcall_nil, funcall_not): New functions.
11327 (run_hook_with_args): Call each function through a `funcall' argument.
11328 Remove `cond' argument, now redundant.
11329 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
11330 (Frun_hook_with_args_until_failure): Adjust accordingly.
11331 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
11332
11333 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11334
11335 * dispextern.h (string_buffer_position): Remove declaration.
11336
11337 * print.c (strout): Remove parameter `multibyte', unused since
11338 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
11339
11340 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
11341 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
11342 All callers changed.
11343
11344 * w32.c (_wsa_errlist): Use braces for struct initializers.
11345
11346 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
11347 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
11348 All callers changed.
11349 (string_buffer_position): Likewise. Also, make static (it's never
11350 used outside xdisp.c).
11351 (cursor_row_p): Remove parameter `w', unused since
11352 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
11353 (decode_mode_spec): Remove parameter `precision', introduced during
11354 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
11355 All callers changed.
11356
11357 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11358
11359 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
11360
11361 2011-03-27 Anders Lindgren <andlind@gmail.com>
11362
11363 * nsterm.m (ns_menu_bar_is_hidden): New variable.
11364 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
11365 (ns_update_auto_hide_menu_bar): New functions.
11366 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
11367 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
11368 ns_constrain_all_frames.
11369 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
11370 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
11371
11372 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11373
11374 * nsmenu.m (runDialogAt): Remove argument to timer_check.
11375
11376 2011-03-27 Glenn Morris <rgm@gnu.org>
11377
11378 * syssignal.h: Replace RETSIGTYPE with void.
11379 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
11380 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
11381 Replace SIGTYPE with void everywhere.
11382 * s/usg5-4-common.h (SIGTYPE): Remove definition.
11383 * s/template.h (SIGTYPE): Remove commented out definition.
11384
11385 2011-03-26 Eli Zaretskii <eliz@gnu.org>
11386
11387 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
11388 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
11389
11390 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
11391
11392 * w32.c (read_unc_volume): Use parameter `henum', instead of
11393 global variable `wget_enum_handle'.
11394
11395 * keymap.c (describe_vector): Remove parameters `indices' and
11396 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
11397 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
11398
11399 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
11400
11401 * keyboard.c (timer_check): Remove parameter `do_it_now',
11402 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
11403 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
11404 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
11405
11406 * keyboard.c (read_char):
11407 * w32menu.c (w32_menu_display_help):
11408 * xmenu.c (show_help_event, menu_help_callback):
11409 Adjust calls to `show_help_echo'.
11410
11411 * gtkutil.c (xg_maybe_add_timer):
11412 * keyboard.c (readable_events):
11413 * process.c (wait_reading_process_output):
11414 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
11415
11416 * insdel.c (adjust_markers_gap_motion):
11417 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
11418 (gap_left, gap_right): Don't call it.
11419
11420 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
11421
11422 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
11423 incurred during fontification.
11424
11425 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
11426
11427 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
11428 (DEFVAR_PER_BUFFER): Don't pass it.
11429
11430 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
11431 (scrolling_window): Don't pass it.
11432
11433 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
11434
11435 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
11436
11437 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
11438 and `suffix'.
11439 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
11440 of variables specific to SELinux and computation of `encoded_absname'.
11441
11442 * image.c (XPutPixel): Remove unused variable `height'.
11443
11444 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
11445
11446 * unexw32.c (get_section_info): Remove unused variable `section'.
11447
11448 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
11449 (system_process_attributes): Remove unused variable `sess'.
11450 (sys_read): Remove unused variable `err'.
11451
11452 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
11453 (w32_wnd_proc): Remove unused variable `isdead'.
11454 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
11455 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
11456 (x_create_tip_frame): Remove unused variable `tem'.
11457
11458 * w32inevt.c (w32_console_read_socket):
11459 Remove unused variable `no_events'.
11460
11461 * w32term.c (x_draw_composite_glyph_string_foreground):
11462 Remove unused variable `width'.
11463
11464 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
11465
11466 * w32term.c (x_set_glyph_string_clipping):
11467 Don't pass uninitialized region to CombineRgn.
11468
11469 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
11470
11471 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
11472 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
11473 (Fx_close_connection): Remove unused variable `i'.
11474
11475 * w32font.c (w32font_draw): Return number of glyphs.
11476 (w32font_open_internal): Remove unused variable `i'.
11477 (w32font_driver): Add missing initializer.
11478
11479 * w32menu.c (utf8to16): Remove unused variable `utf16'.
11480 (fill_in_menu): Remove unused variable `items_added'.
11481
11482 * w32term.c (last_mouse_press_frame): Remove static global variable.
11483 (w32_clip_to_row): Remove unused variable `f'.
11484 (x_delete_terminal): Remove unused variable `i'.
11485
11486 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
11487 (NOTHING): Remove unused static global variable.
11488 (uniscribe_check_otf): Remove unused variable `table'.
11489 (uniscribe_font_driver): Add missing initializers.
11490
11491 2011-03-23 Julien Danjou <julien@danjou.info>
11492
11493 * term.c (Fsuspend_tty, Fresume_tty):
11494 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
11495 * window.c (temp_output_buffer_show):
11496 * insdel.c (signal_before_change):
11497 * frame.c (Fhandle_switch_frame):
11498 * fileio.c (Fdo_auto_save):
11499 * emacs.c (Fkill_emacs):
11500 * editfns.c (save_excursion_restore):
11501 * cmds.c (internal_self_insert):
11502 * callint.c (Fcall_interactively):
11503 * buffer.c (Fkill_all_local_variables):
11504 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
11505 Use Frun_hooks.
11506 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
11507 unconditionally since it does the check itself.
11508
11509 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
11510
11511 Fix more problems found by GCC 4.5.2's static checks.
11512
11513 * coding.c (encode_coding_raw_text): Avoid unnecessary test
11514 the first time through the loop, since we know p0 < p1 then.
11515 This also avoids a gcc -Wstrict-overflow warning.
11516
11517 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
11518 leading to a memory leak, possible in functions like
11519 load_charset_map_from_file that can allocate an unbounded number
11520 of objects (Bug#8318).
11521
11522 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
11523 that could (at least in theory) be that large.
11524
11525 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
11526 This is less likely to overflow, and avoids undefined behavior if
11527 overflow does occur. All callers changed. Use strtoul to scan
11528 for the unsigned long integer.
11529 (pint2hrstr): Simplify and tune code slightly.
11530 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
11531
11532 * scroll.c (do_scrolling): Work around GCC bug 48228.
11533 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
11534
11535 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
11536 This also avoids a warning with gcc -Wstrict-overflow.
11537 (validate_x_resource_name): Simplify count usage.
11538 This also avoids a warning with gcc -Wstrict-overflow.
11539
11540 * fileio.c (Fcopy_file): Report error if fchown or fchmod
11541 fail (Bug#8306).
11542
11543 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
11544
11545 * process.c (Fmake_network_process): Use socklen_t, not int,
11546 where POSIX says socklen_t is required in portable programs.
11547 This fixes a porting bug on hosts like 64-bit HP-UX, where
11548 socklen_t is wider than int (Bug#8277).
11549 (Fmake_network_process, server_accept_connection):
11550 (wait_reading_process_output, read_process_output):
11551 Likewise.
11552
11553 * process.c: Rename or move locals to avoid shadowing.
11554 (list_processes_1, Fmake_network_process):
11555 (read_process_output_error_handler, exec_sentinel_error_handler):
11556 Rename or move locals.
11557 (Fmake_network_process): Define label "retry_connect" only if needed.
11558 (Fnetwork_interface_info): Fix pointer signedness.
11559 (process_send_signal): Add cast to avoid pointer signedness problem.
11560 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
11561 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
11562
11563 Make tparam.h and terminfo.c consistent.
11564 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
11565 Include tparam.h instead, since it declares them.
11566 * cm.h (PC): Remove extern decl; tparam.h now does this.
11567 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
11568 * terminfo.c: Include tparam.h, to check interfaces.
11569 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
11570 (tparam): Adjust signature to match interface in tparam.h;
11571 this removes some undefined behavior. Check that outstring and len
11572 are zero, which they always are with Emacs.
11573 * tparam.h (PC, BC, UP): New extern decls.
11574
11575 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
11576 (xftfont_open): Rename locals to avoid shadowing.
11577
11578 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
11579 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
11580 (OTF_TAG_SYM): Omit macro if not needed.
11581 (ftfont_list): Remove unused local.
11582 (get_adstyle_property, ftfont_pattern_entity):
11583 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
11584 Rename locals to avoid shadowing.
11585
11586 * xfont.c (xfont_list_family): Mark var as initialized.
11587
11588 * xml.c (make_dom): Now static.
11589
11590 * composite.c (composition_compute_stop_pos): Rename local to
11591 avoid shadowing.
11592 (composition_reseat_it): Remove unused locals.
11593 (find_automatic_composition, composition_adjust_point): Likewise.
11594 (composition_update_it): Mark var as initialized.
11595 (find_automatic_composition): Mark vars as initialized,
11596 with a FIXME (Bug#8290).
11597
11598 character.h: Rename locals to avoid shadowing.
11599 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
11600 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
11601 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
11602 (BUF_DEC_POS): Be more systematic about renaming local temporaries
11603 to avoid shadowing.
11604
11605 * textprop.c (property_change_between_p): Remove; unused.
11606
11607 * intervals.c (interval_start_pos): Now static.
11608
11609 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
11610
11611 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
11612 Rename locals to avoid shadowing.
11613
11614 * sound.c (wav_play, au_play, Fplay_sound_internal):
11615 Fix pointer signedness.
11616 (alsa_choose_format): Remove unused local var.
11617 (wav_play): Initialize a variable to 0, to prevent undefined
11618 behavior (Bug#8278).
11619
11620 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
11621
11622 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
11623
11624 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
11625 clobbering (Bug#8298).
11626 * sysdep.c (sys_subshell): Likewise.
11627 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
11628
11629 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
11630 This should get cleaned up, so that child_setup has the
11631 same signature on all platforms.
11632
11633 * callproc.c (call_process_cleanup): Now static.
11634 (relocate_fd): Rename locals to avoid shadowing.
11635
11636 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
11637
11638 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
11639 not to be necessary, and produces flickering.
11640
11641 2011-03-20 Glenn Morris <rgm@gnu.org>
11642
11643 * config.in: Remove file.
11644
11645 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
11646
11647 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
11648 are now in src/globals.h.
11649 (syms_of_minibuf): Remove spurious & from previous change.
11650
11651 2011-03-20 Leo Liu <sdl.web@gmail.com>
11652
11653 * minibuf.c (completing-read-function): New variable.
11654 (completing-read-default): Rename from completing-read.
11655 (completing-read): Call completing-read-function.
11656
11657 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
11658
11659 * xfaces.c (Fx_load_color_file):
11660 Read color file from absolute filename (bug#8250).
11661
11662 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
11663
11664 * makefile.w32-in: Update dependencies.
11665
11666 2011-03-17 Eli Zaretskii <eliz@gnu.org>
11667
11668 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
11669
11670 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
11671
11672 Fix more problems found by GCC 4.5.2's static checks.
11673
11674 * process.c (make_serial_process_unwind, send_process_trap):
11675 (sigchld_handler): Now static.
11676
11677 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
11678 That way, the code declares only the vars that it needs.
11679 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
11680 * s/cygwin.h (PTY_ITERATION): Likewise.
11681 * s/darwin.h (PTY_ITERATION): Likewise.
11682 * s/gnu-linux.h (PTY_ITERATION): Likewise.
11683
11684 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
11685 * process.c (allocate_pty): Don't declare stb unless it's needed.
11686
11687 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
11688 (CONSTANTLIM): Remove; unused.
11689 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
11690 Define only if needed.
11691
11692 * unexelf.c (unexec): Name an expression,
11693 to avoid gcc -Wbad-function-cast warning.
11694 Use a different way to cause a compilation error if anyone uses
11695 n rather than nn, a way that does not involve shadowing.
11696 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
11697
11698 * deps.mk (unexalpha.o): Remove; unused.
11699
11700 New file unexec.h, the (simple) interface for unexec (Bug#8267).
11701 * unexec.h: New file.
11702 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
11703 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
11704 Depend on unexec.h.
11705 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
11706 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
11707 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
11708 Change as necessary to match prototype in unexec.h.
11709
11710 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
11711 shadowing.
11712 (back_comment, skip_chars): Mark vars as initialized.
11713
11714 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
11715 Rename locals to avoid shadowing.
11716
11717 * lread.c (read1): Rewrite so as not to use empty "else".
11718 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
11719
11720 * print.c (Fredirect_debugging_output): Fix pointer signedess.
11721
11722 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
11723 warning when compiling print.c.
11724
11725 * font.c (font_unparse_fcname): Abort in an "impossible" situation
11726 instead of using an uninitialized var.
11727 (font_sort_entities): Mark var as initialized.
11728
11729 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
11730
11731 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
11732 pointers to constants.
11733 (font_parse_fcname): Remove unused vars.
11734 (font_delete_unmatched): Now static.
11735 (font_get_spec): Remove; unused.
11736 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
11737 (font_update_drivers, Ffont_get_glyphs, font_add_log):
11738 Rename or move locals to avoid shadowing.
11739
11740 * fns.c (require_nesting_list, require_unwind): Now static.
11741 (Ffillarray): Rename locals to avoid shadowing.
11742
11743 * floatfns.c (domain_error2): Define only if needed.
11744 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
11745
11746 * alloc.c (mark_backtrace): Move decl from here ...
11747 * lisp.h: ... to here, so that it can be checked.
11748
11749 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
11750 (Fdefvar): Rewrite so as not to use empty "else".
11751 (lisp_indirect_variable): Name an expression,
11752 to avoid gcc -Wbad-function-cast warning.
11753 (Fdefvar): Rename locals to avoid shadowing.
11754
11755 * callint.c (quotify_arg, quotify_args): Now static.
11756 (Fcall_interactively): Rename locals to avoid shadowing.
11757 Use const pointer when appropriate.
11758
11759 * lisp.h (get_system_name, get_operating_system_release):
11760 Move decls here, to check interfaces.
11761 * process.c (get_operating_system_release): Move decl to lisp.h.
11762 * xrdb.c (get_system_name): Likewise.
11763 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
11764 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
11765 some of which prompt warnings from gcc -Wbad-function-cast.
11766 (Fformat_time_string, Fencode_time, Finsert_char):
11767 (Ftranslate_region_internal, Fformat):
11768 Rename or remove local vars to avoid shadowing.
11769 (Ftranslate_region_internal): Mark var as initialized.
11770
11771 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
11772 avoid shadowing.
11773
11774 * lisp.h (eassert): Check that the argument compiles, even if
11775 ENABLE_CHECKING is not defined.
11776
11777 * data.c (Findirect_variable): Name an expression, to avoid
11778 gcc -Wbad-function-cast warning.
11779 (default_value, arithcompare, arith_driver, arith_error): Now static.
11780 (store_symval_forwarding): Rename local to avoid shadowing.
11781 (Fmake_variable_buffer_local, Fmake_local_variable):
11782 Mark variables as initialized.
11783 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
11784
11785 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
11786 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
11787 Rename locals to avoid shadowing.
11788 (mark_stack): Move local variables into the #ifdef region where
11789 they're used.
11790 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
11791 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
11792 needed otherwise.
11793 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
11794 (GC_STRING_CHARS): Remove; not used.
11795 (Fmemory_limit): Cast sbrk's returned value to char *.
11796
11797 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
11798 avoids undefined behavior in theory.
11799
11800 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
11801
11802 Use functions, not macros, for up- and down-casing (Bug#8254).
11803 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11804 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
11805 to use the following functions instead of these macros.
11806 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
11807 EMACS_INT, since callers assume the returned value fits in int.
11808 (upcase1): Likewise, for UPCASE_TABLE.
11809 (uppercasep, lowercasep, upcase): New static inline functions.
11810 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
11811 the race-condition problem in the old DOWNCASE.
11812
11813 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
11814 Rename locals to avoid shadowing.
11815 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
11816 (regex_compile, re_search_2, re_match_2_internal):
11817 Remove unused local vars.
11818 (FREE_VAR): Rewrite so as not to use empty "else",
11819 which gcc can warn about.
11820 (regex_compile, re_match_2_internal): Mark locals as initialized.
11821 (RETALLOC_IF): Define only if needed.
11822 (WORDCHAR_P): Likewise. This one is never needed, but is used
11823 only in a comment talking about a compiler bug, so put inside
11824 the #if 0 of that comment.
11825 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
11826 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
11827 Remove; unused.
11828
11829 * search.c (boyer_moore): Rename locals to avoid shadowing.
11830 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
11831 (PREV_CHAR_BOUNDARY): Likewise.
11832
11833 * search.c (simple_search): Remove unused var.
11834
11835 * dired.c (compile_pattern): Move decl from here ...
11836 * lisp.h: ... to here, so that it can be checked.
11837 (struct re_registers): New forward decl.
11838
11839 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
11840
11841 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
11842 All uses changed.
11843 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
11844 Rename locals to avoid shadowing.
11845 (Fvertical_motion): Mark locals as initialized.
11846
11847 * casefiddle.c (casify_object, casify_region): Now static.
11848 (casify_region): Mark local as initialized.
11849
11850 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
11851
11852 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
11853 New macros, so that the caller can use some names other than
11854 gcpro1, gcpro2, etc.
11855 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
11856 of the new macros.
11857 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
11858 argument, for consistency with GCPRO2_VAR, etc: it is now the
11859 prefix of the variable, not the variable itself. All uses
11860 changed.
11861 * dired.c (directory_files_internal, file_name_completion):
11862 Rename locals to avoid shadowing.
11863
11864 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
11865 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
11866 dired.c's scmp function, had undefined behavior.
11867 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11868 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
11869 * buffer.h: ... to here, because these macros use current_buffer,
11870 and the new implementation with inline functions needs to have
11871 current_buffer in scope now, rather than later when the macros
11872 are used.
11873 (downcase, upcase1): New static inline functions.
11874 (DOWNCASE, UPCASE1): Reimplement using these functions.
11875 This avoids undefined behavior in expressions like
11876 DOWNCASE (x) == DOWNCASE (y), which previously suffered
11877 from race conditions in accessing the global variables
11878 case_temp1 and case_temp2.
11879 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
11880 * lisp.h (case_temp1, case_temp2): Remove their decls.
11881 * character.h (ASCII_CHAR_P): Move from here ...
11882 * lisp.h: ... to here, so that the inline functions mentioned
11883 above can use them.
11884
11885 * dired.c (directory_files_internal_unwind): Now static.
11886
11887 * fileio.c (file_name_as_directory, directory_file_name):
11888 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
11889 Now static.
11890 (file_name_as_directory): Use const pointers when appropriate.
11891 (Fexpand_file_name): Likewise. In particular, newdir might
11892 point at constant storage, so make it a const pointer.
11893 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
11894 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
11895 signedness issues.
11896 (Fset_file_times, Finsert_file_contents, auto_save_error):
11897 Rename locals to avoid shadowing.
11898
11899 * minibuf.c (choose_minibuf_frame_1): Now static.
11900 (Ftry_completion, Fall_completions): Rename or remove locals
11901 to avoid shadowing.
11902
11903 * marker.c (bytepos_to_charpos): Remove; unused.
11904
11905 * lisp.h (verify_bytepos, count_markers): New decls,
11906 so that gcc does not warn that these functions aren't declared.
11907
11908 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
11909 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
11910 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
11911 (copy_text): Remove unused local var.
11912
11913 * filelock.c (within_one_second): Now static.
11914 (lock_file_1): Rename local to avoid shadowing.
11915
11916 * buffer.c (fix_overlays_before): Mark locals as initialized.
11917 (fix_start_end_in_overlays): Likewise. This function should be
11918 simplified by using pointers-to-pointers, but that's a different
11919 matter.
11920 (switch_to_buffer_1): Now static.
11921 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
11922 (report_overlay_modification): Rename locals to avoid shadowing.
11923
11924 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
11925 Fix pointer signedness issue.
11926 (sys_subshell): Mark local as volatile if checking for lint,
11927 to suppress a gcc -Wclobbered warning that does not seem to be right.
11928 (MAXPATHLEN): Define only if needed.
11929
11930 * process.c (serial_open, serial_configure): Move decls from here ...
11931 * systty.h: ... to here, so that they can be checked.
11932
11933 * fns.c (get_random, seed_random): Move extern decls from here ...
11934 * lisp.h: ... to here, so that they can be checked.
11935
11936 * sysdep.c (reset_io): Now static.
11937 (wait_for_termination_signal): Remove; unused.
11938
11939 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
11940 (copy_keymap_item, append_key, push_text_char_description):
11941 Now static.
11942 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
11943 (DENSE_TABLE_SIZE): Remove; unused.
11944 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
11945 (describe_map_tree):
11946 Rename locals to avoid shadowing.
11947
11948 * keyboard.c: Declare functions static if they are not used elsewhere.
11949 (echo_char, echo_dash, cmd_error, top_level_2):
11950 (poll_for_input, handle_async_input): Now static.
11951 (read_char, kbd_buffer_get_event, make_lispy_position):
11952 (make_lispy_event, make_lispy_movement, apply_modifiers):
11953 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
11954 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
11955 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
11956 (read_key_sequence, read_char): Mark locals as initialized.
11957 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
11958
11959 * keyboard.h (make_ctrl_char): New decl.
11960 (mark_kboards): Move decl here ...
11961 * alloc.c (mark_kboards): ... from here.
11962
11963 * lisp.h (force_auto_save_soon): New decl.
11964
11965 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
11966 (DEFINE_DUMMY_FUNCTION): New macro.
11967 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
11968 Use it.
11969 (main): Add casts to avoid warnings
11970 if GCC considers string literals to be constants.
11971
11972 * lisp.h (fatal_error_signal): Add decl, since it's exported.
11973
11974 * dbusbind.c: Pointer signedness fixes.
11975 (xd_signature, xd_append_arg, xd_initialize):
11976 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11977 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11978 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
11979 (Fdbus_register_signal): Use SSDATA when the context wants char *.
11980
11981 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
11982 if GCC considers string literals to be constants.
11983 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
11984
11985 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
11986
11987 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
11988 (print_preprocess, print_object): New macro to fix last change.
11989
11990 * print.c (print_preprocess): Don't forget font objects.
11991
11992 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
11993
11994 * emacs.c (USAGE3): Doc fixes.
11995
11996 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
11997
11998 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
11999 structure.
12000
12001 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
12002
12003 * lisp.h (VWindow_system, Qfile_name_history):
12004 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
12005 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
12006 (w32_system_caret_x, w32_system_caret_y): Declare extern.
12007
12008 * w32select.c: Don't #include "keyboard.h".
12009 (run_protected): Add extern declaration for waiting_for_input.
12010
12011 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
12012 * w32console.c (detect_input_pending, read_input_pending)
12013 (encode_terminal_code):
12014 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
12015 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
12016 (w32_system_caret_y, Qfile_name_history):
12017 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
12018 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
12019 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
12020 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
12021 * w32proc.c (Qlocal, report_file_error):
12022 * w32term.c (Vwindow_system, updating_frame):
12023 * w32uniscribe.c (initialized, uniscribe_font_driver):
12024 Remove unneeded extern declarations.
12025
12026 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
12027
12028 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
12029
12030 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
12031
12032 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
12033 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
12034 These macros can no longer be used for assignment.
12035
12036 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12037 Assign struct members directly, instead of using BUF_BEGV etc.
12038 (record_buffer_markers, fetch_buffer_markers): New functions for
12039 recording and fetching special buffer markers.
12040 (set_buffer_internal_1, set_buffer_temp): Use them.
12041
12042 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
12043
12044 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
12045
12046 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
12047 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
12048
12049 * xdisp.c (hscroll_window_tree):
12050 (reconsider_clip_changes): Use PT instead of BUF_PT.
12051
12052 2011-03-13 Eli Zaretskii <eliz@gnu.org>
12053
12054 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
12055 $(EMACS_ROOT)/lib/intprops.h.
12056
12057 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
12058
12059 Fix more problems found by GCC 4.5.2's static checks.
12060
12061 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
12062 to unsigned char * to avoid compiler diagnostic.
12063 (xg_free_frame_widgets): Make it clear that a local variable is
12064 needed only if USE_GTK_TOOLTIP.
12065 (gdk_window_get_screen): Make it clear that this macro is needed
12066 only if USE_GTK_TOOLTIP.
12067 (int_gtk_range_get_value): New function, which avoids a diagnostic
12068 from gcc -Wbad-function-cast.
12069 (xg_set_toolkit_scroll_bar_thumb): Use it.
12070 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
12071 diagnostic from gcc -Wbad-function-cast.
12072 (get_utf8_string, xg_get_file_with_chooser):
12073 Rename locals to avoid shadowing.
12074 (create_dialog): Move locals to avoid shadowing.
12075
12076 * xgselect.c (xg_select): Remove unused var.
12077
12078 * image.c (four_corners_best): Mark locals as initialized.
12079 (gif_load): Initialize transparent_p to zero (Bug#8238).
12080 Mark another local as initialized.
12081 (my_png_error, my_error_exit): Mark with NO_RETURN.
12082
12083 * image.c (clear_image_cache): Now static.
12084 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
12085 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
12086 (x_edge_detection): Remove unnecessary cast that
12087 gcc -Wbad-function-cast diagnoses.
12088 (gif_load): Fix pointer signedness.
12089 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
12090 (jpeg_load, gif_load): Rename locals to avoid shadowing.
12091
12092 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
12093
12094 Improve quality of tests for time stamp overflow.
12095 For example, without this patch (encode-time 0 0 0 1 1
12096 1152921504606846976) returns the obviously-bogus value (-948597
12097 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
12098 reports time overflow. See
12099 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
12100 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
12101 * editfns.c: Include limits.h and intprops.h.
12102 (TIME_T_MIN, TIME_T_MAX): New macros.
12103 (time_overflow): Move earlier, to before first use.
12104 (hi_time, lo_time): New functions, for an accurate test for
12105 out-of-range times.
12106 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
12107 (Fget_internal_run_time): Don't assume time_t fits in int.
12108 (make_time): Use list2 instead of Fcons twice.
12109 (Fdecode_time): More accurate test for out-of-range times.
12110 (check_tm_member): New function.
12111 (Fencode_time): Use it, to test for out-of-range times.
12112 (lisp_time_argument): Don't rely on undefined left-shift and
12113 right-shift behavior when checking for time stamp overflow.
12114
12115 * editfns.c (time_overflow): New function, refactoring common code.
12116 (Fformat_time_string, Fdecode_time, Fencode_time):
12117 (Fcurrent_time_string): Use it.
12118
12119 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
12120 * dired.c (make_time): Move to ...
12121 * editfns.c (make_time): ... here.
12122 * systime.h: Note the move.
12123
12124 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12125
12126 * fringe.c (update_window_fringes): Remove unused variables.
12127
12128 * unexmacosx.c (copy_data_segment): Also copy __got section.
12129 (Bug#8223)
12130
12131 2011-03-12 Eli Zaretskii <eliz@gnu.org>
12132
12133 * termcap.c [MSDOS]: Include "msdos.h".
12134 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
12135 Constify `char *' arguments and their references according to
12136 prototypes in tparam.h.
12137
12138 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
12139
12140 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
12141 Adapt all references accordingly.
12142
12143 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
12144
12145 2011-03-11 Tom Tromey <tromey@redhat.com>
12146
12147 * buffer.c (syms_of_buffer): Remove obsolete comment.
12148
12149 2011-03-11 Eli Zaretskii <eliz@gnu.org>
12150
12151 * termhooks.h (encode_terminal_code): Declare prototype.
12152
12153 * msdos.c (encode_terminal_code): Don't declare prototype.
12154
12155 * term.c (encode_terminal_code): Now external again, used by
12156 w32console.c and msdos.c.
12157
12158 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
12159 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
12160
12161 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
12162
12163 Fix some minor problems found by GCC 4.5.2's static checks.
12164
12165 * fringe.c (update_window_fringes): Mark locals as initialized
12166 (Bug#8227).
12167 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
12168
12169 * alloc.c (mark_fringe_data): Move decl from here ...
12170 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
12171 to check its interface.
12172 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
12173
12174 * fontset.c (free_realized_fontset): Now static.
12175 (Fset_fontset_font): Rename local to avoid shadowing.
12176 (fontset_font): Mark local as initialized.
12177 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
12178
12179 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
12180
12181 * xselect.c (x_disown_buffer_selections): Remove; not used.
12182 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
12183 (x_own_selection, Fx_disown_selection_internal): Rename locals
12184 to avoid shadowing.
12185 (x_handle_dnd_message): Remove local to avoid shadowing.
12186
12187 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
12188 so that the caller can use some name other than gcpro1.
12189 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
12190 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12191 (Fx_backspace_delete_keys_p):
12192 Use them to avoid shadowing, and rename vars to avoid shadowing.
12193 (x_decode_color, x_set_name, x_window): Now static.
12194 (Fx_create_frame): Add braces to silence GCC warning.
12195 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
12196 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
12197 Remove unused locals.
12198 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12199 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
12200 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
12201 macros.
12202
12203 * xterm.h (x_mouse_leave): New decl.
12204
12205 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
12206 Remove unused functions.
12207 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
12208 (x_calc_absolute_position): Now static.
12209 (XTread_socket): Don't define label "out" unless it's used.
12210 Don't declare local "event" unless it's used.
12211 (x_iconify_frame, x_free_frame_resources): Don't declare locals
12212 unless they are used.
12213 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
12214 (x_fatal_error_signal): Remove; not used.
12215 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
12216 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
12217 (x_error_catcher, x_connection_closed, x_error_handler):
12218 (x_error_quitter, xembed_send_message, x_iconify_frame):
12219 (my_log_handler): Rename locals to avoid shadowing.
12220 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
12221 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
12222
12223 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
12224 Rename or move locals to avoid shadowing.
12225 (tty_defined_color, merge_face_heights): Now static.
12226 (free_realized_faces_for_fontset): Remove; not used.
12227 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
12228 does not deduce is never used uninitialized.
12229 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
12230 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
12231
12232 * terminal.c (store_terminal_param): Now static.
12233
12234 * xmenu.c (menu_highlight_callback): Now static.
12235 (set_frame_menubar): Remove unused local.
12236 (xmenu_show): Rename parameter to avoid shadowing.
12237 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
12238 since they might point to immutable storage.
12239 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
12240 since it's unused otherwise.
12241
12242 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
12243 Add a FIXME, since the code still doesn't look right. (Bug#8215)
12244 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
12245 avoids a gcc -Wuninitialized diagnostic.
12246 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
12247 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
12248 does not deduce are never used uninitialized.
12249
12250 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
12251
12252 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
12253 * window.c (window_loop, size_window):
12254 (run_window_configuration_change_hook, enlarge_window): Likewise.
12255
12256 * window.c (display_buffer): Now static.
12257 (size_window): Mark variables that gcc -Wuninitialized
12258 does not deduce are never used uninitialized.
12259 * window.h (check_all_windows): New decl, to forestall
12260 gcc -Wmissing-prototypes diagnostic.
12261 * dispextern.h (bidi_dump_cached_states): Likewise.
12262
12263 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
12264 shadowing.
12265 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
12266 Include <limits.h>.
12267 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
12268 and to avoid gcc -Wuninitialized warning.
12269 (load_charset_map): Mark variables that gcc -Wuninitialized
12270 does not deduce are never used uninitialized.
12271 (load_charset): Abort instead of using uninitialized var (Bug#8229).
12272
12273 * coding.c (coding_set_source, coding_set_destination):
12274 Use "else { /* comment */ }" rather than "else /* comment */;"
12275 for clarity, and to avoid gcc -Wempty-body warning.
12276 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
12277 a block, when the outer 'i' will do.
12278 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
12279 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
12280 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
12281 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
12282 (Fdecode_sjis_char, Fdefine_coding_system_internal):
12283 Rename locals to avoid shadowing.
12284 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
12285 * coding.c (emacs_mule_char, encode_invocation_designation):
12286 Now static, since they're not used elsewhere.
12287 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
12288 (decode_coding_object, encode_coding_object, detect_coding_system):
12289 (decode_coding_emacs_mule): Mark variables that gcc
12290 -Wuninitialized does not deduce are never used uninitialized.
12291 (detect_coding_iso_2022): Initialize a local variable that might
12292 be used uninitialized. Leave a FIXME because it's not clear that
12293 this initialization is needed. (Bug#8211)
12294 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
12295 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
12296 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
12297 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
12298 Remove unused macros.
12299
12300 * category.c (hash_get_category_set): Remove unused local var.
12301 (copy_category_table): Now static, since it's not used elsewhere.
12302 * character.c (string_count_byte8): Likewise.
12303
12304 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
12305 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
12306
12307 * chartab.c (copy_sub_char_table): Now static, since it's not used
12308 elsewhere.
12309 (sub_char_table_ref_and_range, char_table_ref_and_range):
12310 Rename locals to avoid shadowing.
12311 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
12312
12313 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
12314 (BIDI_BOB): Remove unused macro.
12315
12316 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
12317 deduce are never used uninitialized.
12318 * term.c (encode_terminal_code): Likewise.
12319
12320 * term.c (encode_terminal_code): Now static. Remove unused local.
12321
12322 * tparam.h: New file.
12323 * term.c, tparam.h: Include it.
12324 * deps.mk (term.o, tparam.o): Depend on tparam.h.
12325 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
12326 Move these decls to tparam.h, and make them agree with what
12327 is actually in tparam.c. The previous trick of using incompatible
12328 decls in different modules does not conform to the C standard.
12329 All callers of tparam changed to use tparam's actual API.
12330 * tparam.c (tparam1, tparam, tgoto):
12331 Use const pointers where appropriate.
12332
12333 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
12334 * cm.h (struct cm): Likewise.
12335 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
12336 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
12337 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
12338 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
12339 (turn_on_face, init_tty): Likewise.
12340 * termchar.h (struct tty_display_info): Likewise.
12341
12342 * term.c (term_mouse_position): Rename local to avoid shadowing.
12343
12344 * alloc.c (mark_ttys): Move decl from here ...
12345 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
12346
12347 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
12348
12349 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
12350
12351 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
12352
12353 * search.c (compile_pattern_1): Remove argument regp, unused since
12354 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
12355 (compile_pattern): Don't pass it.
12356
12357 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
12358
12359 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
12360 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
12361 for ! HAVE_GTK3.
12362 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
12363
12364 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
12365
12366 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
12367 gdk_window_get_screen, gdk_window_get_geometry,
12368 gdk_x11_window_lookup_for_display and GDK_KEY_g.
12369 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
12370 (xg_get_pixbuf_from_pixmap): New function.
12371 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
12372 to Pixmap, take frame as parameter, remove GdkColormap parameter.
12373 Call xg_get_pixbuf_from_pixmap instead of
12374 gdk_pixbuf_get_from_drawable.
12375 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
12376 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
12377 (xg_check_special_colors): Use GtkStyleContext and its functions
12378 for HAVE_GTK3.
12379 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
12380 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
12381 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
12382 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
12383 Call gtk_widget_get_preferred_size.
12384 (xg_frame_resized): gdk_window_get_geometry only takes 5
12385 parameters.
12386 (xg_win_to_widget, xg_event_is_for_menubar):
12387 Call gdk_x11_window_lookup_for_display.
12388 (xg_set_widget_bg): New function.
12389 (delete_cb): New function.
12390 (xg_create_frame_widgets): Connect delete-event to delete_cb.
12391 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
12392 (xg_set_background_color): Call xg_set_widget_bg.
12393 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
12394 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
12395 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
12396 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
12397 if ! HAVE_GTK3.
12398 (update_frame_tool_bar): Call gtk_widget_hide.
12399 (xg_initialize): Use GDK_KEY_g.
12400
12401 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
12402 if ! HAVE_GTK3
12403 (x_session_initialize): Call gdk_x11_set_sm_client_id.
12404
12405 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
12406 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
12407 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
12408
12409 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
12410
12411 * w32xfns.c (select_palette): Check success of RealizePalette against
12412 GDI_ERROR, not zero.
12413
12414 See ChangeLog.11 for earlier changes.
12415
12416 ;; Local Variables:
12417 ;; coding: utf-8
12418 ;; End:
12419
12420 Copyright (C) 2011-2012 Free Software Foundation, Inc.
12421
12422 This file is part of GNU Emacs.
12423
12424 GNU Emacs is free software: you can redistribute it and/or modify
12425 it under the terms of the GNU General Public License as published by
12426 the Free Software Foundation, either version 3 of the License, or
12427 (at your option) any later version.
12428
12429 GNU Emacs is distributed in the hope that it will be useful,
12430 but WITHOUT ANY WARRANTY; without even the implied warranty of
12431 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12432 GNU General Public License for more details.
12433
12434 You should have received a copy of the GNU General Public License
12435 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.