unexmacosx.c (copy_data_segment): Added two section names used on Mac
[bpt/emacs.git] / src / ChangeLog
1 2012-06-26 John Wiegley <johnw@newartisans.com>
2
3 * unexmacosx.c (copy_data_segment): Added two section names used
4 on Mac OS X Lion: __mod_init_func and __mod_term_func.
5
6 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7 when building with Clang.
8
9 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10
11 * eval.c (Fapply): Allow calling it with a single argument.
12
13 2012-06-26 Eli Zaretskii <eliz@gnu.org>
14
15 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
16 _stricmp and _strnicmp.
17 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
18
19 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
20
21 * alloc.c (allocate_window): Zero out non-Lisp part of newly
22 allocated window.
23 (allocate_process): Likewise for new process.
24 (allocate_terminal): Change to use offsetof.
25 (allocate_frame): Likewise.
26 * frame.c (make_frame): Omit redundant initialization.
27 * window.c (make_parent_window): Use memset.
28 (make_window): Omit redundant initialization.
29 * process.c (make_process): Omit redundant initialization.
30 * terminal.c (create_terminal): Likewise.
31
32 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
33
34 * term.c (delete_tty): Remove redundant call to memset.
35
36 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
37
38 * alloc.c: Remove build_string.
39 * lisp.h: Define build_string as static inline. This provides
40 a better opportunity to optimize away calls to strlen when the
41 function is called with compile-time constant argument.
42 * image.c (imagemagick_error): Convert to build_string.
43 * w32proc.c (sys_spawnve): Likewise.
44 * xterm.c (x_term_init): Likewise.
45
46 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
47
48 Use sprintf return value instead of invoking strlen on result.
49 In the old days this wasn't portable, since some sprintf
50 implementations returned char *. But they died out years ago and
51 Emacs already assumes sprintf returns int.
52 Similarly for float_to_string.
53 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
54 * ccl.c (ccl_driver):
55 * character.c (string_escape_byte8):
56 * data.c (Fnumber_to_string):
57 * doprnt.c (doprnt):
58 * print.c (print_object):
59 * xdisp.c (message_dolog):
60 * xfns.c (syms_of_xfns):
61 Use sprintf or float_to_string result to avoid need to call strlen.
62 * data.c (Fnumber_to_string):
63 Use make_unibyte_string, since the string must be ASCII.
64 * lisp.h, print.c (float_to_string): Now returns int length.
65 * term.c (produce_glyphless_glyph):
66 Use sprintf result rather than recomputing it.
67
68 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
69 * Makefile.in (ALL_CFLAGS):
70 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
71 * gmalloc.c, regex.c: Include <config.h> unconditionally.
72
73 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
74
75 * dispextern.h (xstrcasecmp): Define to library function
76 strcasecmp if available.
77 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
78
79 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
80
81 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
82 Avoid comma operator.
83 * menu.c (push_submenu_start, push_submenu_end)
84 (push_left_right_boundary, push_menu_pane): Likewise.
85 * msdos.c (dos_rawgetc): Likewise.
86
87 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
88
89 * xfns.c (xic_create_fontsetname): Remove redundant calls
90 to memset.
91
92 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
93
94 * gtkutil.c (get_utf8_string): Remove redundant assignment.
95 sprintf already null-terminates its output.
96
97 * xfns.c (x_window): Remove redundant cast.
98
99 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
100
101 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
102 `const char *' to `char *' to avoid compiler warning.
103
104 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
105
106 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
107 instead of truncating it to 63 (admittedly a generous limit).
108
109 * process.c: Fix spelling and caps in comments.
110
111 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
112
113 * emacs.c (setpgrp): Remove definition, unused.
114 * sysdep.c (setpgrp): Remove definition, not used in this file.
115
116 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
117
118 * makefile.w32-in: Update dependencies.
119
120 2012-06-24 Eli Zaretskii <eliz@gnu.org>
121
122 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
123 (SYSTIME_H): Add nt/inc/sys/time.h.
124
125 * systime.h [WINDOWSNT]: Include sys/time.h.
126
127 * s/ms-w32.h (struct timespec): Definition moved from
128 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
129
130 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
131
132 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
133 * buffer.h (buffer_slot_type_mismatch):
134 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
135 * eval.c (unwind_to_catch):
136 * image.c (my_png_error, my_error_exit):
137 * keyboard.c (quit_throw_to_read_char, user_error)
138 (Fexit_recursive_edit, Fabort_recursive_edit):
139 * lisp.h (die, args_out_of_range, args_out_of_range_3)
140 (wrong_type_argument, buffer_overflow, __executable_start)
141 (memory_full, buffer_memory_full, string_overflow, Fthrow)
142 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
143 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
144 (fatal):
145 (child_setup) [!DOS_NT]:
146 * lread.c (end_of_file_error, invalid_syntax):
147 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
148 * puresize.h (pure_write_error):
149 * search.c (matcher_overflow):
150 * sound.c (sound_perror, alsa_sound_perror):
151 * sysdep.c, syssignal.h (croak):
152 * term.c (maybe_fatal, vfatal):
153 * textprop.c (text_read_only):
154 * undo.c (user_error):
155 * unexmacosx.c (unexec_error):
156 * xterm.c (x_ins_del_lines, x_delete_glyphs):
157 Use _Noreturn rather than NO_RETURN.
158 No need for separate decl merely because of _Noreturn.
159 * sound.c (sound_warning, parse_sound):
160 Remove unnecessary forward decls.
161
162 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
163
164 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
165 * lisp.h (WAIT_READING_MAX): New macro.
166 * dispnew.c (Fsleep_for, sit_for):
167 * keyboard.c (kbd_buffer_get_event):
168 * process.c (Faccept_process_output):
169 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
170 This improves on the previous patch, which introduced a bug
171 when time_t is unsigned and as wide as intmax_t.
172 See <http://bugs.gnu.org/9000#51>.
173
174 2012-06-26 Andreas Schwab <schwab@linux-m68k.org>
175
176 * gnutls.c (emacs_gnutls_handshake): Only retry if
177 GNUTLS_E_INTERRUPTED.
178
179 2012-06-23 Eli Zaretskii <eliz@gnu.org>
180
181 * dispnew.c (sit_for, Fsleep_for):
182 * keyboard.c (kbd_buffer_get_event):
183 * process.c (Faccept_process_output): Avoid compiler warnings when
184 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
185
186 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
187
188 * makefile.w32-in: Update dependencies.
189
190 * w32.c (ltime): Add return type and declare static.
191 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
192
193 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
194
195 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
196 Privately reported by Herbert J. Skuhra.
197 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
198 All uses changed.
199 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
200 not make_lisp_timeval, when the argument is of type EMACS_TIME.
201
202 2012-06-23 Eli Zaretskii <eliz@gnu.org>
203
204 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
205 last argument of make_unibyte_string.
206
207 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
208 language ID in the event parameters.
209
210 * w32term.c (w32_read_socket): Put the new keyboard codepage into
211 event.code, not the obscure "character set ID".
212
213 2012-06-23 Chong Yidong <cyd@gnu.org>
214
215 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
216
217 2012-06-23 Eli Zaretskii <eliz@gnu.org>
218
219 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
220 * w32.c (fdutimens): New function.
221
222 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
223
224 * s/ms-w32.h (pselect): Redirect to sys_select.
225
226 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
227
228 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
229 in the logic of incrementing and decrementing the value of
230 use_relocatable_buffers.
231
232 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
233
234 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
235 Privately reported by Herbert J. Skuhra.
236 [__FreeBSD__]: Remove "*/" typo after "#include".
237 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
238 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
239 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
240 Don't assume EMACS_TIME and struct timeval are the same type.
241
242 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
243
244 Support higher-resolution time stamps (Bug#9000).
245 The time stamps are only nanosecond-resolution at the C level,
246 since that's the best that any real-world system supports now.
247 But they are picosecond-resolution at the Lisp level, as that's
248 easy, and leaves room for future OS improvements.
249
250 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
251 (LIBES): Use it.
252
253 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
254 Don't get current time unless it's needed.
255
256 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
257 now provides it if it's absent.
258 (start_atimer): Port to higher-res time stamps.
259 Check for time stamp overflow. Don't get current time more
260 often than is needed.
261
262 * buffer.h (struct buffer): Buffer modtime now has high resolution.
263 Include systime.h, not time.h.
264 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
265
266 * dired.c: Include stat-time.h.
267 (Ffile-attributes): File times now have higher resolution.
268
269 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
270 (struct image): Timestamp now has higher resolution.
271
272 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
273 has at least microseconds now. All uses removed.
274 (update_frame, update_single_window, update_window, update_frame_1)
275 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
276
277 * editfns.c (time_overflow): Now extern.
278 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
279 (float-time, Fformat_time_string, Fcurrent_time_string)
280 (Fcurrent_time_zone): Accept and generate higher-resolution
281 time stamps.
282 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
283 (decode_time_components, lisp_seconds_argument): New functions.
284 (make_time): Now static.
285 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
286 Report an error if the time is invalid, rather than having the caller
287 do that.
288
289 * fileio.c: Include <stat-time.h>
290 (Fcopy_file): Copy higher-resolution time stamps.
291 Prefer to set the time stamp via a file descriptor if that works.
292 (Fset_file_times, Finsert_file_contents, Fwrite_region)
293 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
294 (Fvisited_file_modtime, Fset_visited_file_modtime):
295 Support higher-resolution time stamps.
296
297 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
298
299 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
300
301 * image.c (prepare_image_for_display, clear_image_cache)
302 (lookup_image): Port to higer-resolution time stamps.
303
304 * keyboard.c (start_polling, bind_polling_period):
305 Check for time stamp overflow.
306 (read_char, kbd_buffer_get_event, timer_start_idle)
307 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
308 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
309 Port to higher-resolution time stamps. Do not assume time_t is signed.
310 (decode_timer): New function. Timers are now vectors of length 9,
311 not 8, to accommodate the picosecond component.
312 (timer_check_2): Use it.
313
314 * nsterm.m (select_timeout, timeval_subtract): Remove.
315 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
316 as they're a bit more accurate and handle overflow better.
317 (ns_select): Change prototype to be compatible with pselect.
318 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
319 * nsterm.h (ns_select): Adjust prototype.
320
321 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
322 us-resolution time stamps.
323 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
324
325 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
326
327 * lisp.h (time_overflow): New decl.
328 (wait_reading_process_output): First arg is now intmax_t, not int,
329 to accommodate larger waits.
330
331 * process.h (struct Lisp_Process.read_output_delay):
332 Now counts nanoseconds, not microseconds.
333 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
334 EMACS_HAS_USECS.
335 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
336 (wait_reading_process_output):
337 Port to ns-resolution time stamps.
338 (Faccept_process_output, wait_reading_process_output):
339 Check for time stamp overflow. Do not assume time_t is signed.
340 (select_wrapper): Remove; we now use pselect.
341 (Fprocess_attributes): Now generates ns-resolution time stamps.
342
343 * sysdep.c: Include utimens.h. Don't include utime.h
344 or worry about struct utimbuf; gnulib does that for us now.
345 (gettimeofday): Remove; gnulib provides a substitute.
346 (make_timeval): New function.
347 (set_file_times): Now sets ns-resolution time stamps.
348 New arg FD; all uses changed.
349 (time_from_jiffies, ltime_from_jiffies, get_up_time)
350 (system_process_attributes):
351 Now returns ns-resolution time stamp. All uses changed.
352 Check for time stamp overflow.
353
354 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
355 provides a substitute now.
356
357 * systime.h: Include timespec.h rather than sys/time.h and time.h,
358 since it guarantees struct timespec.
359 (EMACS_TIME): Now struct timespec, so that we can support
360 ns-resolution time stamps.
361 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
362 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
363 (EMACS_USECS): Remove.
364 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
365 so multiply the arg by 1000 before storing it.
366 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
367 New macros.
368 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
369 Port to ns-resolution time stamps.
370 (EMACS_TIME_NEG_P): Remove; replaced by....
371 (EMACS_TIME_SIGN): New macro.
372 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
373 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
374 (set_file_times, make_time, lisp_time_argument): Adjust signature.
375 (make_timeval, make_lisp_time, decode_time_components): New decls.
376 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
377 that it mishandled time_t overflow. You can't compare by subtracting!
378 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
379 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
380
381 * term.c: Include <sys/time.h>.
382 (timeval_to_Time): New function, for proper overflow wraparound.
383 (term_mouse_position, term_mouse_click): Use it.
384
385 * undo.c (record_first_change): Support higher-resolution time stamps
386 in the undo buffer.
387 (Fprimitive_undo): Use them when restoring time stamps.
388
389 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
390 (w32_get_internal_run_time):
391 Port to higher-resolution Emacs time stamps.
392 (ltime): Now accepts single 64-bit integer, as that's more convenient
393 for callers.
394
395 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
396
397 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
398 for compatibility with pselect. Support ns-resolution time stamps.
399
400 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
401
402 * xselect.c (wait_for_property_change, x_get_foreign_selection):
403 Check for time stamp overflow, and support ns-resolution time stamps.
404
405 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
406 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
407 (timeval_subtract): Remove; no longer needed.
408 (XTflash, XTring_bell, x_wait_for_event):
409 Port to ns-resolution time stamps. Don't assume time_t is signed.
410
411 2012-06-22 Chong Yidong <cyd@gnu.org>
412
413 * xdisp.c (x_consider_frame_title): Revert last change.
414
415 2012-06-22 Eli Zaretskii <eliz@gnu.org>
416
417 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
418 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
419 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
420 staticidx goes up to 1597 out of 1600 = 0x640.)
421
422 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
423
424 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
425 Otherwise, the umask might be mistakenly 0 while handling input signals.
426
427 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
428
429 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
430
431 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
432
433 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
434 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
435 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
436 access to `contents' member of Lisp_Vector objects with AREF and ASET
437 where appropriate.
438
439 2012-06-19 Chong Yidong <cyd@gnu.org>
440
441 * frame.c (delete_frame): When selecting a frame on a different
442 text terminal, do not alter the terminal's top-frame.
443
444 * xdisp.c (format_mode_line_unwind_data): Record the target
445 frame's selected window and its terminal's top-frame.
446 (unwind_format_mode_line): Restore them.
447 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
448 Callers changed.
449 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
450 since tty frames can be explicitly named.
451 (prepare_menu_bars): Likewise.
452
453 * term.c (Ftty_top_frame): New function.
454
455 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
456
457 Port byte-code-meter to modern targets.
458 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
459 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
460 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
461 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
462 (METER_1, METER_2): Simplify.
463
464 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
465
466 * data.c (Fdefalias): Return `symbol' (bug#11686).
467
468 2012-06-18 Martin Rudalics <rudalics@gmx.at>
469
470 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
471 gets killed during executing of this function (Bug#11665).
472 Try to always return Qt when the buffer has been actually killed.
473 (Vkill_buffer_query_functions): In doc-string say that functions
474 run by this hook should not change the current buffer.
475
476 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
477
478 Fix recently-introduced process.c problems found by static checking.
479 * process.c (write_queue_push, write_queue_pop, send_process):
480 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
481 (write_queue_pop): Fix pointer signedness problem.
482 (send_process): Remove unused local.
483
484 2012-06-17 Chong Yidong <cyd@gnu.org>
485
486 * xdisp.c (redisplay_internal): No need to redisplay terminal
487 frames that are not on top.
488
489 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
490
491 * process.c (make_process): Initialize write_queue.
492 (write_queue_push, write_queue_pop): New functions.
493 (send_process): Use them to maintain correct ordering of process
494 writes (Bug#10815).
495
496 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
497
498 * lisp.h (eassert): Assume C89 or later.
499 This removes the need for CHECK.
500 (CHECK): Remove. Its comments about always evaluating its
501 argument were confusing, as 'eassert' typically does not evaluate
502 its argument.
503
504 * coding.c (produce_chars): Use ptrdiff_t, not int.
505
506 * xterm.c (x_draw_underwave): Check for integer overflow.
507 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
508
509 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
510
511 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
512 referenced (Bug#11583).
513
514 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
515
516 Implement wave-style variant of underlining.
517 * dispextern.h (face_underline_type): New enum.
518 (face): Add field for underline type.
519 * nsterm.m (ns_draw_underwave): New function.
520 (ns_draw_text_decoration): Use it.
521 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
522 New functions.
523 (x_draw_glyph_string): Use them.
524 * xfaces.c (Qline, Qwave): New Lisp objects.
525 (check_lface_attrs, merge_face_ref)
526 (Finternal_set_lisp_face_attribute, realize_x_face):
527 Handle wave-style underline face attributes.
528 * xterm.c (x_draw_underwave): New function.
529 (x_draw_glyph_string): Use it.
530
531 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
532
533 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
534 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
535 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
536 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
537 ($(BLD)/w32select.$(O)): Update dependencies.
538
539 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
540
541 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
542 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
543 * character.c (_fetch_multibyte_char_p): Remove.
544 * alloc.c: Include "character.h" before "buffer.h".
545 * bidi.c: Likewise.
546 * buffer.c: Likewise.
547 * bytecode.c: Likewise.
548 * callint.c: Likewise.
549 * callproc.c: Likewise.
550 * casefiddle.c: Likewise.
551 * casetab.c: Likewise.
552 * category.c: Likewise.
553 * cmds.c: Likewise.
554 * coding.c: Likewise.
555 * composite.c: Likewise.
556 * dired.c: Likewise.
557 * dispnew.c: Likewise.
558 * doc.c: Likewise.
559 * dosfns.c: Likewise.
560 * editfns.c: Likewise.
561 * emacs.c: Likewise.
562 * fileio.c: Likewise.
563 * filelock.c: Likewise.
564 * font.c: Likewise.
565 * fontset.c: Likewise.
566 * fringe.c: Likewise.
567 * indent.c: Likewise.
568 * insdel.c: Likewise.
569 * intervals.c: Likewise.
570 * keyboard.c: Likewise.
571 * keymap.c: Likewise.
572 * lread.c: Likewise.
573 * macros.c: Likewise.
574 * marker.c: Likewise.
575 * minibuf.c: Likewise.
576 * nsfns.m: Likewise.
577 * nsmenu.m: Likewise.
578 * print.c: Likewise.
579 * process.c: Likewise.
580 * regex.c: Likewise.
581 * region-cache.c: Likewise.
582 * search.c: Likewise.
583 * syntax.c: Likewise.
584 * term.c: Likewise.
585 * textprop.c: Likewise.
586 * undo.c: Likewise.
587 * unexsol.c: Likewise.
588 * w16select.c: Likewise.
589 * w32fns.c: Likewise.
590 * w32menu.c: Likewise.
591 * window.c: Likewise.
592 * xdisp.c: Likewise.
593 * xfns.c: Likewise.
594 * xmenu.c: Likewise.
595 * xml.c: Likewise.
596 * xselect.c: Likewise.
597
598 2012-06-16 Eli Zaretskii <eliz@gnu.org>
599
600 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
601 If all the glyphs of the glyph row came from strings, and we have no
602 cursor positioning clues, put the cursor on the first glyph of the
603 row.
604 (handle_face_prop): Use chunk-relative overlay string index when
605 indexing into it->string_overlays array. (Bug#11653)
606 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
607 the rightmost. (Bug#11720)
608
609 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
610
611 * category.h (CHAR_HAS_CATEGORY): Define as inline.
612 (CATEGORY_MEMBER): Enforce 1/0 value.
613 * category.c (_temp_category_set): Remove.
614
615 2012-06-16 Eli Zaretskii <eliz@gnu.org>
616
617 * window.c (Fdelete_other_windows_internal)
618 (Fdelete_window_internal): Don't access frame's mouse highlight
619 info of the initial frame. (Bug#11677)
620
621 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
622
623 * .gdbinit (xgetint): Fix recently-introduced paren typo.
624 Assume USE_2_TAGS_FOR_INTS.
625 (xreload): Adjust $tagmask width to match recent lisp.h change.
626
627 Simplify lisp.h in minor ways that should not affect code.
628 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
629 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
630 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
631 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
632 (INTTYPEBITS): New macro, for clarity.
633 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
634 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
635 Simplify now that USE_LSB_TAG is always defined.
636 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
637 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
638
639 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
640
641 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
642
643 2012-06-13 Glenn Morris <rgm@gnu.org>
644
645 * s/bsd-common.h (BSD4_3):
646 * s/usg5-4-common.h (USG5_4): No longer define; unused.
647
648 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
649
650 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
651 instead of union.
652 (XLI, XIL): Define.
653 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
654 Use them.
655 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
656 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
657 * alloc.c (widen_to_Lisp_Object): Remove.
658 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
659 * frame.c (delete_frame): Remove outdated comment.
660 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
661 USE_LISP_UNION_TYPE.
662 (Fw32_unregister_hot_key): Likewise.
663 (Fw32_toggle_lock_key): Likewise.
664 * w32menu.c (add_menu_item): Likewise.
665 (w32_menu_display_help): Use XIL instead of checking
666 USE_LISP_UNION_TYPE.
667 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
668 (init_heap): Likewise.
669 * w32term.c (w32_read_socket): Update comment.
670
671 2012-06-13 Glenn Morris <rgm@gnu.org>
672
673 * s/usg5-4-common.h, src/s/unixware.h:
674 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
675
676 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
677
678 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
679
680 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
681 * alloc.c (make_number) [!defined make_number]:
682 Remove, as lisp.h always defines this now.
683 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
684 (roundup_size): Verify that it is a power of 2.
685 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
686 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
687 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
688 -DUSE_LSB_TAG=0, to override the automatically-selected default.
689 USE_LSB_TAG now is always defined to be either 0 or 1.
690 All uses changed.
691 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
692 code works fine either way, and efficiency is not a concern here,
693 as the union type is for debugging, not for production.
694 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
695 Use an inline function on all platforms when using the union type,
696 since this is simpler and 'static inline' can be used portably
697 within Emacs now.
698 (LISP_INITIALLY_ZERO): New macro.
699 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
700 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
701
702 2012-06-12 Glenn Morris <rgm@gnu.org>
703
704 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
705
706 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
707
708 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
709 Move BROKEN_SIGIO to configure.
710
711 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
712 Move NO_TERMIO to configure.
713
714 2012-06-12 Chong Yidong <cyd@gnu.org>
715
716 * image.c (imagemagick_load_image): Use MagickFlattenImage if
717 MagickMergeImageLayers is undefined. Use pixel pusher loop if
718 MagickExportImagePixels is undefined.
719
720 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
721
722 * image.c (imagemagick_load_image): Remove unused label.
723
724 2012-06-11 Glenn Morris <rgm@gnu.org>
725
726 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
727 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
728 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
729 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
730
731 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
732
733 * alloc.c (make_byte_code): New function.
734 (Fmake_byte_code): Use it. Don't purify here.
735 * lread.c (read1): Use it as well to avoid extra allocation.
736
737 2012-06-11 Chong Yidong <cyd@gnu.org>
738
739 * image.c (imagemagick_load_image): Implement transparency.
740
741 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
742
743 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
744 account for preceding backslashes. (Bug#11663)
745
746 2012-06-09 Chong Yidong <cyd@gnu.org>
747
748 * term.c: Support italics in capable terminals (Bug#9652).
749 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
750 (turn_on_face): Output using TS_enter_italic_mode if available.
751 Don't handle unused blinking and alt-charset cases.
752 (turn_off_face): Handle italic case; discard unused tty_blinking_p
753 and tty_alt_charset_p cases.
754 (tty_capable_p, init_tty): Support italics.
755
756 * termchar.h (struct tty_display_info): Add field for italics.
757 Remove unused blink field.
758
759 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
760 Handle slant.
761
762 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
763 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
764 tty_alt_charset_p. Add tty_italic_p.
765
766 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
767
768 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
769 dbus_type_is_basic if available.
770 (xd_extract_signed, xd_extract_unsigned): Rename from
771 extract_signed and extract_unsigned, respectively. Adapt callers.
772
773 2012-06-09 Chong Yidong <cyd@gnu.org>
774
775 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
776
777 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
778 case (Bug#9752).
779
780 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
781
782 * xdisp.c (vmessage): Treat frame message as multibyte.
783 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
784 would generate the diagnostic "Making \302\247 buffer-local while
785 let-bound!".
786
787 2012-06-08 Eli Zaretskii <eliz@gnu.org>
788
789 * dispnew.c (showing_window_margins_p): Undo last change, which
790 was done due to an inadvertent commit.
791 (adjust_frame_glyphs_for_frame_redisplay): Do call
792 showing_window_margins_p.
793
794 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
795
796 * eval.c (Fmake_var_non_special): New primitive.
797 (syms_of_eval): Defsubr it.
798 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
799
800 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
801
802 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
803 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
804
805 2012-06-08 Eli Zaretskii <eliz@gnu.org>
806
807 * alloc.c (allocate_vectorlike): Fix last change.
808
809 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
810
811 Block-based vector allocation of small vectors.
812 * lisp.h (struct vectorlike_header): New field `nbytes',
813 adjust comment accordingly.
814 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
815 to denote vector blocks. Adjust users (live_vector_p,
816 mark_maybe_pointer, valid_lisp_object_p) accordingly.
817 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
818 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
819 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
820 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
821 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
822 (roundup_size): New constant.
823 (struct vector_block): New data type.
824 (vector_blocks, vector_free_lists, zero_vector): New variables.
825 (all_vectors): Rename to `large_vectors'.
826 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
827 (sweep_vectors): New functions.
828 (allocate_vectorlike): Return `zero_vector' as the only vector of
829 0 items. Allocate new vector from block if vector size is less than
830 or equal to VBLOCK_BYTES_MAX.
831 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
832 (init_alloc_once): Add call to init_vectors.
833
834 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
835
836 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
837
838 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
839
840 * doprnt.c (doprnt): Truncate multibyte char correctly.
841 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
842 would mishandle a string argument "Xc" if X was a multibyte
843 character of length 2: it would truncate after X's first byte
844 rather than including all of X.
845
846 2012-06-06 Chong Yidong <cyd@gnu.org>
847
848 * buffer.c (word_wrap): Doc fix.
849
850 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
851
852 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
853
854 2012-06-03 Glenn Morris <rgm@gnu.org>
855
856 * xdisp.c (tool-bar-style): Doc fix.
857
858 2012-06-03 Ulrich Müller <ulm@gentoo.org>
859
860 * Makefile.in (PAXCTL): Define.
861 (temacs$(EXEEXT)): Disable memory randomization for the temacs
862 binary via PaX flags if the paxctl utility is available.
863 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
864 Restore PaX flags to their default. (Bug#11398)
865
866 2012-06-03 Chong Yidong <cyd@gnu.org>
867
868 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
869 buffer (Bug#11226).
870
871 2012-06-03 Chong Yidong <cyd@gnu.org>
872
873 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
874 (note_mode_line_or_margin_highlight): If there is no help echo,
875 use mode-line-default-help-echo. Handle the case where the mouse
876 position is past the end of the mode line string.
877
878 * buffer.c (buffer_local_value_1): New function, split from
879 Fbuffer_local_value; can return Qunbound.
880 (Fbuffer_local_value): Use it.
881 (Vmode_line_format): Docstring tweaks.
882
883 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
884
885 * sysdep.c (system_process_attributes): Improve comment.
886
887 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
888
889 * keyboard.c: Export real-this-command to Elisp.
890 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
891 and DEFVAR it. Update all users.
892
893 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
894
895 * minibuf.c (Fassoc_string): Remove duplicate declaration.
896
897 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
898 Convert pctcpu and pctmem to Lisp float properly.
899 Let the compiler fold better, as 100.0/0x8000 is exact.
900
901 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
902
903 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
904 cons_block.
905
906 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
907
908 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
909
910 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
911
912 For a 'struct window', replace some Lisp_Object fields to
913 bitfields where appropriate, remove unused fields.
914 * window.h (struct window): Remove unused 'last_mark_x' and
915 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
916 change it's type from Lisp_Object to bitfield.
917 Change type of 'force_start', 'optional_new_start',
918 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
919 fields from Lisp_Object to bitfield. Adjust users accordingly.
920
921 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
922
923 Pacify gcc -Wdouble-precision when using Xaw.
924 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
925 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
926 Use 'float' consistently, rather than 'float' in most places
927 and 'double' in a couple of places.
928
929 2012-05-31 Eli Zaretskii <eliz@gnu.org>
930
931 * xdisp.c (handle_stop): Detect whether we have overlay strings
932 loaded by testing it->current.overlay_string_index to be
933 non-negative, instead of checking whether n_overlay_strings is
934 positive. (Bug#11587)
935
936 2012-05-31 Chong Yidong <cyd@gnu.org>
937
938 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
939
940 * doc.c (Fsubstitute_command_keys): Doc fix.
941
942 2012-05-31 Eli Zaretskii <eliz@gnu.org>
943
944 * search.c (search_buffer): Remove calls to
945 r_alloc_inhibit_buffer_relocation, as it is now called by
946 maybe_unify_char, which was the cause of relocation of buffer text
947 in bug#11519.
948
949 2012-05-31 Eli Zaretskii <eliz@gnu.org>
950
951 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
952 for the duration of call to load_charset, to avoid problems with
953 callers of maybe_unify_char that access buffer text through C
954 pointers.
955
956 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
957 decrement the inhibition flag, instead of just setting or
958 resetting it.
959
960 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
961
962 Remove obsolete '#define static' cruft.
963 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
964 This #undef was "temporary" in 2000; it is no longer needed
965 now that '#define static' has gone away.
966 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
967 (gray_bitmap_bits): Remove; no longer needed.
968 All uses replaced with definiens.
969 * xterm.c: Include "bitmaps/gray.xbm".
970
971 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
972
973 Clean up __executable_start, monstartup when --enable-profiling.
974 The following changes affect the code only when profiling.
975 * dispnew.c (__executable_start): Rename from safe_bcopy.
976 Define only on platforms that need it.
977 * emacs.c: Include <sys/gmon.h> when profiling.
978 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
979 (__executable_start): Remove decl, since lisp.h does it now.
980 (safe_bcopy): Remove decl; no longer has that name.
981 (main): Coalesce #if into single bit of code, for simplicity.
982 Cast pointers to uintptr_t, since standard libraries want integers
983 and not pointers.
984 * lisp.h (__executable_start): New decl.
985
986 2012-05-31 Glenn Morris <rgm@gnu.org>
987
988 * image.c (Fimagemagick_types): Doc fix.
989
990 2012-05-30 Jim Meyering <meyering@redhat.com>
991
992 * callproc.c (Fcall_process_region): Include directory component
993 in mkstemp error message (Bug#11586).
994
995 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
996
997 * alloc.c, lisp.h (make_pure_vector): Now static.
998
999 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
1000
1001 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
1002 Move to byte-run.el.
1003 (Fautoload): Do the hash-doc more carefully.
1004 * data.c (Fdefalias): Purify definition, except for keymaps.
1005 (Qdefun): Move from eval.c.
1006 * lisp.h (Qdefun): Remove.
1007 * lread.c (read1): Tiny simplification.
1008
1009 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
1010
1011 Do not create empty overlays with the evaporate property (Bug#9642).
1012 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
1013 Bug#9642, but explicitly check that the buffer the overlay would
1014 be moved to is live and rearrange lines to make sure that errors
1015 will not put the overlay in an inconsistent state.
1016 (Fdelete_overlay): Cosmetics.
1017
1018 2012-05-28 Eli Zaretskii <eliz@gnu.org>
1019
1020 * w32term.c (my_bring_window_to_top): New function.
1021 (x_raise_frame): Use handle returned by DeferWindowPos, which
1022 could be different from the original one.
1023 Call my_bring_window_to_top instead of my_set_foreground_window.
1024 (Bug#11513)
1025
1026 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
1027 by calling BringWindowToTop.
1028
1029 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
1030 (WM_EMACS_END): Increase by one.
1031
1032 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
1033
1034 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
1035 This avoids undefined behavior that might cause the eassert
1036 to not catch an out-of-range value.
1037
1038 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
1039
1040 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
1041 Update dependencies.
1042
1043 2012-05-27 Eli Zaretskii <eliz@gnu.org>
1044
1045 * bidi.c (bidi_mirror_char): Fix last change.
1046
1047 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
1048
1049 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
1050 when referring to sectname field in printf format.
1051
1052 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
1053
1054 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
1055 Only r_alloc_inhibit_buffer_relocation needed to be added;
1056 the others were already declared.
1057
1058 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
1059 before checking whether it's out of range. Put the check inside
1060 eassert. See
1061 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
1062
1063 2012-05-27 Ken Brown <kbrown@cornell.edu>
1064
1065 * callproc.c (Fcall_process): Restore a line that was accidentally
1066 commented out in the 2011-02-13 change (bug#11547).
1067
1068 2012-05-27 Eli Zaretskii <eliz@gnu.org>
1069
1070 * lisp.h [REL_ALLOC]: Add prototypes for external functions
1071 defined on ralloc.c.
1072
1073 * buffer.c [REL_ALLOC]: Remove prototypes of
1074 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
1075 they are now on lisp.h.
1076
1077 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
1078
1079 * search.c (search_buffer): Use it to inhibit relocation of buffer
1080 text while re_search_2 is doing its job, because re_search_2 is
1081 passed C pointers to buffer text. (Bug#11519)
1082
1083 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
1084 Update value to 24.
1085
1086 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
1087 state after an additional call to move_it_in_display_line_to, keep
1088 the values of it->max_ascent and it->max_descent found for the
1089 entire line.
1090 (pos_visible_p): Revert the comparison against bottom_y to what it
1091 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
1092 (Bug#11464)
1093
1094 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1095
1096 Fix coding-related core dumps with gcc -ftrapv.
1097 The code was computing A - B, where A and B are pointers, and B is
1098 random garbage. This can lead to core dumps on platforms that
1099 have special pointer registers, and it also leads to core dumps on
1100 x86-64 when compiled with gcc -ftrapv. The fix is to compute
1101 A - B only when B is initialized properly.
1102 * coding.c (coding_set_source, coding_set_destination): Return void.
1103 (coding_change_source, coding_change_destinations): New functions,
1104 with the old behaviors of coding_set_source and coding_set_destination.
1105 All callers that need an offset changed to use these new functions.
1106
1107 2012-05-26 Glenn Morris <rgm@gnu.org>
1108
1109 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
1110
1111 2012-05-26 Eli Zaretskii <eliz@gnu.org>
1112
1113 Extend mouse support on W32 text-mode console.
1114 * xdisp.c (draw_row_with_mouse_face):
1115 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
1116
1117 * w32console.c: Include window.h.
1118 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
1119 New functions.
1120 (initialize_w32_display): Initialize mouse-highlight data.
1121
1122 * w32inevt.c: Include termchar.h and window.h.
1123 (do_mouse_event): Support mouse-autoselect-window. When the mouse
1124 moves, call note_mouse_highlight. If help_echo changed, call
1125 gen_help_event to produce help-echo message in the echo area.
1126 Call clear_mouse_face if mouse_face_hidden is set in the mouse
1127 highlight info.
1128
1129 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1130
1131 * lread.c (read1): Simplify slightly to avoid an overflow warning
1132 with GCC 4.7.0 on x86-64.
1133
1134 2012-05-26 Eli Zaretskii <eliz@gnu.org>
1135
1136 * bidi.c (bidi_mirror_char): Revert last change: an int is
1137 definitely wide enough here.
1138
1139 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
1140
1141 Fix integer width and related bugs (Bug#9874).
1142 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
1143 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
1144 (string_bytes, check_sblock, allocate_string_data):
1145 (compact_small_strings, Fmake_bool_vector, make_string)
1146 (make_unibyte_string, make_multibyte_string)
1147 (make_string_from_bytes, make_specified_string)
1148 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
1149 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
1150 (mark_vectorlike):
1151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1152 (allocate_pseudovector):
1153 Use int, not EMACS_INT, where int is wide enough.
1154 (inhibit_garbage_collection, Fgarbage_collect):
1155 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1156 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
1157 int might not be wide enough.
1158 (bidi_cache_search, bidi_cache_find, bidi_init_it)
1159 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1160 (bidi_at_paragraph_end, bidi_find_paragraph_start)
1161 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
1162 (bidi_level_of_next_char, bidi_move_to_visually_next):
1163 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1164 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
1165 (Fkill_buffer, Fset_buffer_major_mode)
1166 (advance_to_char_boundary, Fbuffer_swap_text)
1167 (Fset_buffer_multibyte, overlays_at, overlays_in)
1168 (overlay_touches_p, struct sortvec, record_overlay_string)
1169 (overlay_strings, recenter_overlay_lists)
1170 (adjust_overlays_for_insert, adjust_overlays_for_delete)
1171 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
1172 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
1173 (Foverlay_recenter, last_overlay_modification_hooks_used)
1174 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
1175 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1176 (validate_region): Omit unnecessary test for b <= e,
1177 since that's guaranteed by the previous test.
1178 (adjust_overlays_for_delete): Avoid pos + length overflow.
1179 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
1180 (report_overlay_modification):
1181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1182 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
1183 Omit pointer cast, which isn't needed anyway, and doesn't work
1184 after the EMACS_INT -> ptrdiff_t change.
1185 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
1186 * buffer.h: Adjust decls to match defn changes elsewhere.
1187 (struct buffer_text, struct buffer):
1188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1189 Use EMACS_INT, not int, where int might not be wide enough.
1190 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
1191 not int, to avoid needless 32-bit limit on 64-bit hosts.
1192 (exec_byte_code): Use tighter memory-full test, one that checks
1193 for alloca overflow. Don't compute the address of the object just
1194 before an array, as that's not portable. Use EMACS_INT, not
1195 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
1196 * callint.c (Fcall_interactively):
1197 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1198 * callproc.c (call_process_kill, Fcall_process):
1199 Don't assume pid_t fits into an Emacs fixnum.
1200 (call_process_cleanup, Fcall_process, child_setup):
1201 Don't assume pid_t fits into int.
1202 (call_process_cleanup, Fcall_process, delete_temp_file)
1203 (Fcall_process_region):
1204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1205 (Fcall_process): Simplify handling of volatile integers.
1206 Use int, not EMACS_INT, where int will do.
1207 * casefiddle.c (casify_object, casify_region, operate_on_word)
1208 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
1209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1210 (casify_object): Avoid integer overflow when overallocating buffer.
1211 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
1212 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
1213 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
1214 * category.h (CATEGORYP): Don't assume arg is nonnegative.
1215 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
1216 integers are now checked earlier. All uses replaced with XINT.
1217 (ccl_driver):
1218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1219 For CCL_MapSingle, check that content and value are in int range.
1220 (ccl_driver, Fregister_code_conversion_map):
1221 Check that Vcode_version_map_vector is a vector.
1222 (resolve_symbol_ccl_program): Check that vector header is in range.
1223 Always copy the vector, so that we can check its contents reliably
1224 now rather than having to recheck each instruction as it's being
1225 executed. Check that vector words fit in 'int'.
1226 (ccl_get_compiled_code, Fregister_ccl_program)
1227 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
1228 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
1229 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
1230 contents are in range.
1231 (Fccl_execute_on_string): Check that status is in range.
1232 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
1233 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
1234 Accept and return EMACS_INT, not int, because callers can pass values
1235 out of 'int' range.
1236 (c_string_width, strwidth, lisp_string_width, chars_in_text)
1237 (multibyte_chars_in_text, parse_str_as_multibyte)
1238 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
1239 (str_as_unibyte, str_to_unibyte, string_count_byte8)
1240 (string_escape_byte8, Fget_byte):
1241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1242 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
1243 avoid mishandling large integers.
1244 * character.h: Adjust decls to match defn changes elsewhere.
1245 * charset.c (load_charset_map_from_file, find_charsets_in_text)
1246 (Ffind_charset_region):
1247 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1248 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
1249 (load_charset_map_from_vector, Fdefine_charset_internal):
1250 Don't assume fixnum fits in int.
1251 (load_charset_map_from_vector, Fmap_charset_chars):
1252 Remove now-unnecessary CHECK_NATNUMs.
1253 (Fdefine_charset_internal): Check ranges here, more carefully.
1254 Don't rely on undefined behavior with signed left shift overflow.
1255 Don't assume unsigned int fits into fixnum, or that fixnum fits
1256 into unsigned int. Don't require max_code to be a valid fixnum;
1257 that's not true for gb10830 4-byte on a 32-bit host. Allow
1258 invalid_code to be a cons, for the same reason. Require code_offset
1259 to be a character. Avoid int overflow if max_char is close
1260 to INT_MAX.
1261 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
1262 this is intended anyway and avoids some undefined behavior.
1263 (load_charset_map): Pass unsigned, not int, as 2nd arg of
1264 INDEX_TO_CODE_POINT, as that's what it expects.
1265 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
1266 * charset.h (DECODE_CHAR): Return int, not unsigned;
1267 this is what was intended anyway, and it avoids undefined behavior.
1268 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
1269 integer-overflow issues.
1270 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
1271 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
1272 where the argument is EMACS_INT, and this behavior is not intended.
1273 * chartab.c (Fmake_char_table, Fset_char_table_range)
1274 (uniprop_get_decoder, uniprop_get_encoder):
1275 Don't assume fixnum fits in int.
1276 * cmds.c (move_point): New function, that does the gist of
1277 Fforward_char and Fbackward_char, but does so while checking
1278 for integer overflow more accurately.
1279 (Fforward_char, Fbackward_char): Use it.
1280 (Fforward_line, Fend_of_line, internal_self_insert)
1281 (internal_self_insert):
1282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1283 Fix a FIXME, by checking for integer overflow when calculating
1284 target_clm and actual_clm.
1285 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
1286 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
1287 (ASSURE_DESTINATION, coding_alloc_by_realloc)
1288 (coding_alloc_by_making_gap, alloc_destination)
1289 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
1290 (encode_coding_utf_16, detect_coding_emacs_mule)
1291 (decode_coding_emacs_mule, encode_coding_emacs_mule)
1292 (detect_coding_iso_2022, decode_coding_iso_2022)
1293 (encode_invocation_designation, encode_designation_at_bol)
1294 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1295 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
1296 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
1297 (encode_coding_ccl, encode_coding_raw_text)
1298 (detect_coding_charset, decode_coding_charset)
1299 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
1300 (produce_composition, produce_charset, produce_annotation)
1301 (decode_coding, handle_composition_annotation)
1302 (handle_charset_annotation, consume_chars, decode_coding_gap)
1303 (decode_coding_object, encode_coding_object, detect_coding_system)
1304 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
1305 (code_convert_region, code_convert_string)
1306 (Fdefine_coding_system_internal)
1307 (coding_set_source, coding_set_destination):
1308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1309 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
1310 (Fdefine_coding_system_internal):
1311 Don't assume fixnums fit in int.
1312 (decode_coding_gap, decode_coding_object, encode_coding_object)
1313 (Fread_coding_system, Fdetect_coding_region)
1314 (Funencodable_char_position, Fcheck_coding_systems_region)
1315 (get_translation, handle_composition_annotation, consume_chars):
1316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1317 (consume_chars): Rewrite to not calculate an address outside buffer.
1318 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
1319 Don't access memory outside of the args array.
1320 (Fdefine_coding_system_internal): Check for charset-id overflow.
1321 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
1322 result of ENCODE_CHAR.
1323 * coding.h: Adjust decls to match defn changes elsewhere.
1324 (struct coding_system):
1325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1326 * composite.c (get_composition_id, find_composition)
1327 (run_composition_function, update_compositions)
1328 (compose_text, composition_gstring_put_cache)
1329 (composition_gstring_p, composition_gstring_width)
1330 (fill_gstring_header, fill_gstring_body, autocmp_chars)
1331 (composition_compute_stop_pos, composition_reseat_it)
1332 (composition_update_it, struct position_record)
1333 (find_automatic_composition, composition_adjust_point)
1334 (Fcomposition_get_gstring, Ffind_composition_internal):
1335 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1336 (update_compositions):
1337 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1338 * composite.h: Adjust decls to match defn changes elsewhere.
1339 (struct composition):
1340 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1341 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1342 Do not attempt to compute the address of the object just before a
1343 buffer; this is not portable.
1344 (Faref, Faset):
1345 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1346 (Faset): Use int, not EMACS_INT, where int is wide enough.
1347 (Fstring_to_number): Don't assume fixnums fit in int.
1348 (Frem): Don't assume arg is nonnegative.
1349 * dbusbind.c (xd_append_arg): Check for integers out of range.
1350 (Fdbus_call_method): Don't overflow the timeout int.
1351 (extract_signed, extract_unsigned): New functions.
1352 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
1353 (xd_get_connection_references): Return ptrdiff_t, not int.
1354 All uses changed.
1355 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
1356 (xd_read_message_1):
1357 Use int, not unsigned, where the dbus API uses int.
1358 (Fdbus_message_internal): Don't overflow mtype.
1359 (syms_of_dbusbind): Allocate right-sized buffer for integers.
1360 * dired.c (directory_files_internal, file_name_completion, scmp)
1361 (file_name_completion_stat):
1362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1363 (file_name_completion): Don't overflow matchcount.
1364 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
1365 * dispextern.h: Adjust decls to match defn changes elsewhere.
1366 (struct text_pos, struct glyph, struct bidi_saved_info)
1367 (struct bidi_string_data, struct bidi_it, struct composition_it)
1368 (struct it):
1369 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1370 (struct display_pos, struct composition_it, struct it):
1371 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1372 * dispnew.c (increment_matrix_positions)
1373 (increment_row_positions, mode_line_string)
1374 (marginal_area_string):
1375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1376 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
1377 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1378 (duration_to_sec_usec): New function, to check for overflow better.
1379 (Fsleep_for, sit_for): Use it.
1380 * doc.c (get_doc_string, store_function_docstring):
1381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1382 (get_doc_string, Fsnarf_documentation):
1383 Use int, not EMACS_INT, where int is wide enough.
1384 (get_doc_string):
1385 Use SAFE_ALLOCA, not alloca.
1386 Check for overflow when converting EMACS_INT to off_t.
1387 * doprnt.c (doprnt):
1388 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1389 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
1390 Don't assume uid_t fits into fixnum.
1391 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
1392 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
1393 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
1394 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
1395 (general_insert_function)
1396 (Finsert_char, make_buffer_string, make_buffer_string_both)
1397 (update_buffer_properties, Fbuffer_substring)
1398 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
1399 (Fsubst_char_in_region, check_translation)
1400 (Ftranslate_region_internal, save_restriction_restore, Fformat)
1401 (transpose_markers, Ftranspose_regions):
1402 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1403 (clip_to_bounds): Move to lisp.h as an inline function).
1404 (Fconstrain_to_field): Don't assume integers are nonnegative.
1405 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
1406 (Fsubst_char_in_region, Fsave_restriction):
1407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1408 (Femacs_pid): Don't assume pid_t fits into fixnum.
1409 (lo_time): Use int, not EMACS_INT, when int suffices.
1410 (lisp_time_argument): Check for usec out of range.
1411 (Fencode_time): Don't assume fixnum fits in int.
1412 (Fuser_login_name, Fuser_full_name): Signal an error
1413 if a uid argument is out of range, rather than relying on
1414 undefined behavior.
1415 (Fformat_time_string): Remove now-unnecessary check.
1416 lisp_time_argument checks for out-of-range usec now.
1417 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
1418 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
1419 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
1420 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
1421 (init_cmdargs, Fdump_emacs):
1422 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1423 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
1424 the bottom (typically) 32 bits of the fixnum.
1425 * eval.c (specpdl_size, call_debugger):
1426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1427 (when_entered_debugger, Fbacktrace_debug):
1428 Don't assume fixnum can fit in int.
1429 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
1430 the object just before a buffer; this is not portable.
1431 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
1432 (grow_specpdl, unbind_to):
1433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1434 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
1435 (grow_specpdl): Simplify allocation by using xpalloc.
1436 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
1437 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
1438 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
1439 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1440 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
1441 (a_write, e_write):
1442 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1443 (Fcopy_file, non_regular_nbytes, read_non_regular)
1444 (Finsert_file_contents):
1445 Use int, not EMACS_INT, where int is wide enough.
1446 (READ_BUF_SIZE): Verify that it fits in int.
1447 (Finsert_file_contents): Check that counts are in proper range,
1448 rather than assuming fixnums fit into ptrdiff_t etc.
1449 Don't assume fixnums fit into int.
1450 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
1451 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
1452 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
1453 (string_char_to_byte, string_byte_to_char)
1454 (string_make_multibyte, string_to_multibyte)
1455 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
1456 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
1457 (substring_both, Fdelete, internal_equal, Ffillarray)
1458 (Fclear_string, mapcar1)
1459 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
1460 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
1461 (larger_vector, make_hash_table, maybe_resize_hash_table)
1462 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
1463 (Fmaphash, secure_hash):
1464 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1465 (concat): Check for string index and length overflow.
1466 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
1467 (Frequire):
1468 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1469 (larger_vector): New API (vec, incr_min, size_max) replaces old
1470 one (vec, new_size, init). This catches size overflow.
1471 INIT was removed because it was always Qnil.
1472 All callers changed.
1473 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
1474 the upper bound on a hash table index size.
1475 (make_hash_table, maybe_resize_hash_table): Use it.
1476 (secure_hash): Computer start_byte and end_byte only after
1477 they're known to be in ptrdiff_t range.
1478 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
1479 (Ffont_get_glyphs, Ffont_at):
1480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1481 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
1482 (Flist_fonts, Fopen_font):
1483 Don't assume fixnum can fit in int.
1484 (check_gstring): Don't assume index can fit in int.
1485 (font_match_p): Check that fixnum is a character, not a nonnegative
1486 fixnum, since the later code needs to stuff it into an int.
1487 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
1488 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
1489 conversion overflow issues.
1490 (Fopen_font): Check for integer out of range.
1491 (Ffont_get_glyphs): Don't assume index can fit in int.
1492 * font.h: Adjust decls to match defn changes elsewhere.
1493 * fontset.c (reorder_font_vector): Redo score calculation to avoid
1494 integer overflow.
1495 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
1496 printmax_t, where ptrdiff_t is wide enough.
1497 (Finternal_char_font):
1498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1499 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
1500 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
1501 (Fset_frame_position, x_set_frame_parameters)
1502 (x_set_line_spacing, x_set_border_width)
1503 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
1504 Check that fixnums are in proper range for system types.
1505 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
1506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1507 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
1508 Use SAFE_ALLOCA_LISP, not alloca.
1509 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
1510 intptr_t is wide enough.
1511 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
1512 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
1513 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
1514 Check for fixnum out of range.
1515 * ftfont.c (ftfont_list): Don't assume index fits in int.
1516 Check that fixnums are in proper range for system types.
1517 (ftfont_shape_by_flt):
1518 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1519 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
1520 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1521 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
1522 Check that fixnums are in proper range for system types.
1523 * gnutls.h: Adjust decls to match defn changes elsewhere.
1524 * gtkutil.c (xg_dialog_run):
1525 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1526 (update_frame_tool_bar):
1527 Check that fixnums are in proper range for system types.
1528 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
1529 (lookup_image): Check that fixnums are in range for system types.
1530 * indent.c (last_known_column, last_known_column_point):
1531 (current_column_bol_cache):
1532 (skip_invisible, current_column, check_display_width):
1533 (check_display_width, scan_for_column, current_column_1)
1534 (Findent_to, Fcurrent_indentation, position_indentation)
1535 (indented_beyond_p, Fmove_to_column, compute_motion):
1536 (Fcompute_motion, Fvertical_motion):
1537 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1538 (last_known_column_modified): Use EMACS_INT, not int.
1539 (check_display_width):
1540 (Fcompute_motion):
1541 Check that fixnums and floats are in proper range for system types.
1542 (compute_motion): Don't assume index or fixnum fits in int.
1543 (compute_motion, Fcompute_motion):
1544 Use int, not EMACS_INT, when it is wide enough.
1545 (vmotion): Omit local var start_hpos that is always 0; that way
1546 we don't need to worry about overflow in expressions involving it.
1547 * indent.h: Adjust decls to match defn changes elsewhere.
1548 (struct position):
1549 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1550 Use int, not EMACS_INT, where int is wide enough.
1551 Remove unused members ovstring_chars_done and tab_offset;
1552 all uses removed.
1553 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
1554 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
1555 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
1556 (make_gap, copy_text, insert, insert_and_inherit)
1557 (insert_before_markers, insert_before_markers_and_inherit)
1558 (insert_1, count_combining_before, count_combining_after)
1559 (insert_1_both, insert_from_string)
1560 (insert_from_string_before_markers, insert_from_string_1)
1561 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
1562 (adjust_after_replace, adjust_after_insert, replace_range)
1563 (replace_range_2, del_range, del_range_1, del_range_byte)
1564 (del_range_both, del_range_2, modify_region)
1565 (prepare_to_modify_buffer, signal_before_change)
1566 (signal_after_change, Fcombine_after_change_execute):
1567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1568 * intervals.c (traverse_intervals, rotate_right, rotate_left)
1569 (balance_an_interval, split_interval_right, split_interval_left)
1570 (find_interval, next_interval, update_interval)
1571 (adjust_intervals_for_insertion, delete_node, delete_interval)
1572 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1573 (static_offset_intervals, offset_intervals)
1574 (merge_interval_right, merge_interval_left, make_new_interval)
1575 (graft_intervals_into_buffer, temp_set_point_both)
1576 (temp_set_point, set_point, adjust_for_invis_intang)
1577 (set_point_both, move_if_not_intangible, get_property_and_range)
1578 (get_local_map, copy_intervals, copy_intervals_to_string)
1579 (compare_string_intervals, set_intervals_multibyte_1):
1580 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1581 * intervals.h: Adjust decls to match defn changes elsewhere.
1582 (struct interval):
1583 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1584 * keyboard.c (this_command_key_count, this_single_command_key_start)
1585 (before_command_key_count, before_command_echo_length, echo_now)
1586 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
1587 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
1588 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
1589 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
1590 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1591 (last_non_minibuf_size, last_point_position, echo_truncate)
1592 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
1593 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
1594 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
1595 (stuff_buffered_input):
1596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1597 (last_auto_save, command_loop_1, read_char):
1598 Use EMACS_INT, not int, to avoid integer overflow.
1599 (record_char): Avoid overflow in total_keys computation.
1600 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
1601 * keyboard.h: Adjust decls to match defn changes elsewhere.
1602 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
1603 (Fkey_description, Fdescribe_vector, Flookup_key):
1604 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1605 (click_position): New function, to check that positions are in range.
1606 (Fcurrent_active_maps):
1607 (describe_command):
1608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1609 (Faccessible_keymaps, Fkey_description):
1610 (preferred_sequence_p):
1611 Don't assume fixnum can fit into int.
1612 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
1613 Check for integer overflow in size calculations.
1614 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
1615 avoid mishandling large integers.
1616 * lisp.h: Adjust decls to match defn changes elsewhere.
1617 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
1618 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
1619 (struct Lisp_Marker):
1620 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1621 (clip_to_bounds): Now an inline function, moved here from editfns.c.
1622 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
1623 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
1624 All callers changed.
1625 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
1626 Assume the arg has valid form, since it always does.
1627 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
1628 unsigned integer system type.
1629 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
1630 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
1631 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1632 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
1633 (duration_to_sec_usec): New decl.
1634 * lread.c (read_from_string_index, read_from_string_index_byte)
1635 (read_from_string_limit, readchar, unreadchar, openp)
1636 (read_internal_start, read1, oblookup):
1637 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1638 (Fload, readevalloop, Feval_buffer, Feval_region):
1639 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1640 (openp): Check for out-of-range argument to 'access'.
1641 (read1): Use int, not EMACS_INT, where int is wide enough.
1642 Don't assume fixnum fits into int.
1643 Fix off-by-one error that can read outside a buffer.
1644 (read_filtered_event): Use duration_to_sec_usec
1645 to do proper overflow checking on durations.
1646 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
1647 in size calculation.
1648 (Fexecute_kbd_macro):
1649 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1650 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
1651 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
1652 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
1653 (set_marker_both, set_marker_restricted_both, marker_position)
1654 (marker_byte_position, Fbuffer_has_markers_at):
1655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1656 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
1657 * menu.c (ensure_menu_items): Rename from grow_menu_items.
1658 It now merely ensures that the menu is large enough, without
1659 necessarily growing it, as this avoids some integer overflow issues.
1660 All callers changed.
1661 (keymap_panes, parse_single_submenu, Fx_popup_menu):
1662 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1663 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
1664 Use SAFE_ALLOCA_LISP, not alloca.
1665 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
1666 to EMACS_INT. Check that fixnums are in proper range for system types.
1667 * minibuf.c (minibuf_prompt_width, string_to_object)
1668 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
1669 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
1670 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1671 (get_minibuffer, read_minibuf_unwind):
1672 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1673 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
1674 this simplifies overflow checking. All callers changed.
1675 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
1676 (Ftest_completion):
1677 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1678 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
1679 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
1680 Check that fixnums are in proper range for system types.
1681 (Fx_create_frame, Fx_show_tip):
1682 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1683 * nsfont.m (ns_findfonts, nsfont_list_family):
1684 Don't assume fixnum fits in long.
1685 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
1686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1687 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
1688 wide enough.
1689 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
1690 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1691 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
1692 (PRINTDECLARE, PRINTPREPARE):
1693 (strout, print_string):
1694 (print, print_preprocess, print_check_string_charset_prop)
1695 (print_object):
1696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1697 (PRINTDECLARE):
1698 (temp_output_buffer_setup, Fprin1_to_string, print_object):
1699 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1700 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
1701 (printchar, strout): Use xpalloc to catch size calculation overflow.
1702 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
1703 (print_error_message): Use SAFE_ALLOCA, not alloca.
1704 (print_object): Use int, not EMACS_INT, where int is wide enough.
1705 (print_depth, new_backquote_output, print_number_index):
1706 Use ptrdiff_t, not int, where int might not be wide enough.
1707 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
1708 (Fset_process_window_size, Fformat_network_address)
1709 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
1710 (sigchld_handler):
1711 Check that fixnums are in proper range for system types.
1712 (Fsignal_process): Simplify by avoiding a goto.
1713 Check for process-ids out of pid_t range rather than relying on
1714 undefined behavior.
1715 (process_tick, update_tick): Use EMACS_INT, not int.
1716 (Fformat_network_address, read_process_output, send_process)
1717 (Fprocess_send_region, status_notify):
1718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1719 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
1720 (wait_reading_process_output, read_process_output, exec_sentinel):
1721 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1722 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
1723 (Faccept_process_output): Use duration_to_sec_usec to do proper
1724 overflow checking on durations.
1725 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
1726 Don't assume pid_t fits in int.
1727 * process.h (struct Lisp_Process): Members tick and update_tick
1728 are now of type EMACS_INT, not int.
1729 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
1730 configured --with-wide-int.
1731 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
1732 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
1733 * search.c (looking_at_1, string_match_1):
1734 (fast_string_match, fast_c_string_match_ignore_case)
1735 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
1736 (scan_newline, find_before_next_newline, search_command)
1737 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
1738 (set_search_regs, wordify):
1739 (Freplace_match):
1740 (Fmatch_data):
1741 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1742 (string_match_1, search_buffer, set_search_regs):
1743 (Fmatch_data):
1744 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1745 (wordify): Check for overflow in size calculation.
1746 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
1747 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
1748 Check that fixnums are in proper range for system types.
1749 * sound.c (struct sound_device)
1750 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
1751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1752 (Fplay_sound_internal):
1753 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1754 * syntax.c (struct lisp_parse_state, find_start_modiff)
1755 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
1756 (Fparse_partial_sexp):
1757 Don't assume fixnums can fit in int.
1758 (struct lisp_parse_state, find_start_pos, find_start_value)
1759 (find_start_value_byte, find_start_begv)
1760 (update_syntax_table, char_quoted, dec_bytepos)
1761 (find_defun_start, prev_char_comend_first, back_comment):
1762 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
1763 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
1764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1765 (Finternal_describe_syntax_value): Check that match_lisp is a
1766 character, not an integer, since the code stuffs it into int.
1767 (scan_words, scan_sexps_forward):
1768 Check that fixnums are in proper range for system types.
1769 (Fforward_word):
1770 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1771 (scan_sexps_forward):
1772 Use CHARACTERP, not INTEGERP, since the value must fit into int.
1773 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
1774 * syntax.h: Adjust decls to match defn changes elsewhere.
1775 (struct gl_state_s):
1776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1777 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
1778 MOST_POSITIVE_FIXNUM.
1779 * sysdep.c (wait_for_termination_1, wait_for_termination)
1780 (interruptible_wait_for_termination, mkdir):
1781 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
1782 (emacs_read, emacs_write):
1783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1784 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
1785 and double all fit in int.
1786 * term.c (set_tty_color_mode):
1787 Check that fixnums are in proper range for system types.
1788 * termhooks.h (struct input_event):
1789 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1790 * textprop.c (validate_interval_range, interval_of)
1791 (Fadd_text_properties, set_text_properties_1)
1792 (Fremove_text_properties, Fremove_list_of_text_properties)
1793 (Ftext_property_any, Ftext_property_not_all)
1794 (copy_text_properties, text_property_list, extend_property_ranges)
1795 (verify_interval_modification):
1796 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1797 (Fnext_single_char_property_change)
1798 (Fprevious_single_char_property_change):
1799 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1800 (copy_text_properties):
1801 Check for integer overflow in index calculation.
1802 * undo.c (last_boundary_position, record_point, record_insert)
1803 (record_delete, record_marker_adjustment, record_change)
1804 (record_property_change):
1805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1806 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
1807 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1808 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1809 (Fx_hide_tip, Fx_file_dialog):
1810 * w32menu.c (set_frame_menubar):
1811 Use ptrdiff_t, not int, for consistency with rest of code.
1812 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
1813 (select_window, Fdelete_other_windows_internal)
1814 (window_scroll_pixel_based, window_scroll_line_based)
1815 (Frecenter, Fset_window_configuration):
1816 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1817 (Fset_window_hscroll, run_window_configuration_change_hook)
1818 (set_window_buffer, temp_output_buffer_show, scroll_command)
1819 (Fscroll_other_window, Frecenter):
1820 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1821 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
1822 Don't assume fixnum fits in int.
1823 (Fset_window_scroll_bars):
1824 Check that fixnums are in proper range for system types.
1825 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
1826 (string_pos, c_string_pos, number_of_chars, init_iterator)
1827 (in_ellipses_for_invisible_text_p, init_from_display_pos)
1828 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
1829 (compute_display_string_end, handle_face_prop)
1830 (face_before_or_after_it_pos, handle_invisible_prop)
1831 (handle_display_prop, handle_display_spec, handle_single_display_spec)
1832 (display_prop_intangible_p, string_buffer_position_lim)
1833 (string_buffer_position, handle_composition_prop, load_overlay_strings)
1834 (get_overlay_strings_1, get_overlay_strings)
1835 (iterate_out_of_display_property, forward_to_next_line_start)
1836 (back_to_previous_visible_line_start, reseat, reseat_to_string)
1837 (get_next_display_element, set_iterator_to_next)
1838 (get_visually_first_element, compute_stop_pos_backwards)
1839 (handle_stop_backwards, next_element_from_buffer)
1840 (move_it_in_display_line_to, move_it_in_display_line)
1841 (move_it_to, move_it_vertically_backward, move_it_by_lines)
1842 (add_to_log, message_dolog, message_log_check_duplicate)
1843 (message2, message2_nolog, message3, message3_nolog
1844 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
1845 (current_message_1, truncate_echo_area, truncate_message_1)
1846 (set_message, set_message_1, store_mode_line_noprop)
1847 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
1848 (text_outside_line_unchanged_p, check_point_in_composition)
1849 (reconsider_clip_changes)
1850 (redisplay_internal, set_cursor_from_row, try_scrolling)
1851 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
1852 (redisplay_window, find_last_unchanged_at_beg_row)
1853 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
1854 (trailing_whitespace_p, find_row_edges, display_line)
1855 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
1856 (display_mode_element, store_mode_line_string)
1857 (pint2str, pint2hrstr, decode_mode_spec)
1858 (display_count_lines, display_string, draw_glyphs)
1859 (x_produce_glyphs, x_insert_glyphs)
1860 (rows_from_pos_range, mouse_face_from_buffer_pos)
1861 (fast_find_string_pos, mouse_face_from_string_pos)
1862 (note_mode_line_or_margin_highlight, note_mouse_highlight):
1863 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1864 (safe_call, init_from_display_pos, handle_fontified_prop)
1865 (handle_single_display_spec, load_overlay_strings)
1866 (with_echo_area_buffer, setup_echo_area_for_printing)
1867 (display_echo_area, echo_area_display)
1868 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
1869 (update_tool_bar, hscroll_window_tree, redisplay_internal)
1870 (redisplay_window, dump_glyph_row, display_mode_line)
1871 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
1872 (handle_display_spec, display_prop_string_p):
1873 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1874 (handle_single_display_spec, build_desired_tool_bar_string)
1875 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
1876 (get_specified_cursor_type):
1877 Check that fixnums are in proper range for system types.
1878 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
1879 (Flookup_image_map):
1880 Don't assume fixnums fit in int.
1881 (compare_overlay_entries):
1882 Avoid mishandling comparisons due to subtraction overflow.
1883 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
1884 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
1885 (handle_tool_bar_click):
1886 Use int, not unsigned, since we prefer signed and the signedness
1887 doesn't matter here.
1888 (get_next_display_element, next_element_from_display_vector):
1889 Use int, not EMACS_INT, when int is wide enough.
1890 (start_hourglass): Use duration_to_sec_usec to do proper
1891 overflow checking on durations.
1892 * xfaces.c (Fbitmap_spec_p):
1893 Check that fixnums are in proper range for system types.
1894 (compare_fonts_by_sort_order):
1895 Avoid mishandling comparisons due to subtraction overflow.
1896 (Fx_family_fonts, realize_basic_faces):
1897 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1898 (Fx_family_fonts):
1899 Don't assume fixnum fits in int.
1900 Use SAFE_ALLOCA_LISP, not alloca.
1901 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
1902 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
1903 (face_at_buffer_position, face_for_overlay_string)
1904 (face_at_string_position):
1905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1906 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
1907 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
1908 (Fx_show_tip):
1909 Check that fixnums are in proper range for system types.
1910 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1911 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
1912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1913 (Fx_change_window_property): Don't assume fixnums fit in int.
1914 * xfont.c (xfont_chars_supported):
1915 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1916 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
1917 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
1918 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1919 * xml.c (parse_region):
1920 * xrdb.c (magic_file_p):
1921 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1922 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
1923 (x_get_local_selection, x_reply_selection_request)
1924 (x_handle_selection_request, wait_for_property_change):
1925 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1926 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
1927 short is wide enough.
1928 (x_send_client_event): Don't assume fixnum fits in int.
1929 * xterm.c (x_x_to_emacs_modifiers):
1930 Don't assume EMACS_INT overflows nicely into int.
1931 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
1932 may come from Lisp.
1933 (handle_one_xevent): NATNUMP can eval its arg twice.
1934 (x_connection_closed):
1935 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1936 * xterm.h: Adjust decls to match defn changes elsewhere.
1937 (struct scroll_bar): Use struct vectorlike_header
1938 rather than rolling our own approximation.
1939 (SCROLL_BAR_VEC_SIZE): Remove; not used.
1940
1941 2012-05-25 Glenn Morris <rgm@gnu.org>
1942
1943 * lisp.mk (lisp): Update for more files being compiled now.
1944
1945 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
1946
1947 * lread.c: Remove `read_pure' which makes no difference.
1948 (read_pure): Remove var.
1949 (unreadpure): Remove function.
1950 (readevalloop): Don't call read_list with -1 flag.
1951 (read1, read_vector): Don't test read_pure any more.
1952 (read_list): Simplify.
1953
1954 * fileio.c, character.h: Minor style tweaks.
1955
1956 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
1957
1958 * window.h (clip_changed): Remove useless declaration.
1959
1960 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
1961
1962 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
1963 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
1964
1965 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
1966
1967 Remove src/m/*.
1968 This directory predates autoconf and is no longer needed nowadays.
1969 Move its few remaining bits of functionality to where they're needed.
1970 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
1971 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
1972 * m/template.h: Remove.
1973 * Makefile.in (M_FILE): Remove. All uses removed.
1974 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
1975 * lisp.h (USE_LSB_TAG):
1976 * mem-limits.h (EXCEEDS_LISP_PTR):
1977 Use VAL_MAX, not VALBITS, in #if.
1978 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
1979 (EMACS_UINT): Define unconditionally now.
1980 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
1981 (BITS_PER_EMACS_INT): New constants, replacing
1982 what used to be in config.h, but not useful in #if.
1983 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
1984 define them any more.
1985 (VAL_MAX): New macro.
1986 (VALMASK): Use it.
1987 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
1988 BITS_PER_EMACS_INT, in #if.
1989 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1990 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
1991 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
1992 * s/ms-w32.h (DATA_START):
1993 Move here from removed file m/intel386.h.
1994 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
1995 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
1996
1997 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
1998
1999 Assume C89 or later.
2000 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
2001 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
2002 (xrealloc):
2003 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
2004 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
2005 * textprop.c, tparam.c (NULL): Remove.
2006 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
2007 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
2008 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
2009 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
2010 * xterm.c (input_signal_count): Assume volatile works.
2011
2012 2012-05-21 Ken Brown <kbrown@cornell.edu>
2013
2014 * xgselect.c (xg_select): Fix first argument in call to 'select'
2015 (bug#11508).
2016
2017 2012-05-20 Ken Brown <kbrown@cornell.edu>
2018
2019 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
2020 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
2021
2022 2012-05-19 Ken Brown <kbrown@cornell.edu>
2023
2024 * xfns.c (x_in_use): Remove `static' qualifier.
2025 * xterm.h (x_in_use): Declare.
2026 * xgselect.c: Include xterm.h.
2027 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
2028 and `display_arg' (bug#9754).
2029
2030 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
2031
2032 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
2033
2034 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
2035 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
2036
2037 2012-05-18 Eli Zaretskii <eliz@gnu.org>
2038
2039 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
2040
2041 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
2042 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
2043
2044 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
2045 reference to image_cache->refcount.
2046 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
2047
2048 2012-05-17 Juri Linkov <juri@jurta.org>
2049
2050 * search.c (Fword_search_regexp, Fword_search_backward)
2051 (Fword_search_forward, Fword_search_backward_lax)
2052 (Fword_search_forward_lax): Move functions to isearch.el
2053 (bug#10145, bug#11381).
2054
2055 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
2056
2057 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
2058
2059 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2060
2061 * lread.c (init_obarray): Declare Qt and Qnil as special.
2062
2063 2012-05-14 Glenn Morris <rgm@gnu.org>
2064
2065 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
2066 Put "libexec" before "bin", for the sake of init_callproc_1.
2067
2068 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2069
2070 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
2071
2072 * unexaix.c: Port to more-recent AIX compilers.
2073 (report_error, report_error_1, make_hdr, copy_sym)
2074 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
2075 Make arguments const char *, not char *, to avoid violations of C
2076 standard and to fix some AIX warnings reported by Gilles Pion.
2077
2078 2012-05-14 Eli Zaretskii <eliz@gnu.org>
2079
2080 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
2081 already have overlays loaded.
2082 (handle_single_display_spec): Before returning without displaying
2083 fringe bitmap, synchronize the bidi iterator with the main display
2084 iterator, by calling iterate_out_of_display_property.
2085 (iterate_out_of_display_property): Detect buffer iteration by
2086 testing that it->string is a Lisp string.
2087 (get_next_display_element): When the current object is exhausted,
2088 and there's something on it->stack, call set_iterator_to_next to
2089 proceed with what's on the stack, instead of returning zero.
2090 (set_iterator_to_next): If called at the end of a Lisp string,
2091 proceed to consider_string_end without incrementing string
2092 position. Don't increment display vector index past the end of
2093 the display vector. (Bug#11417)
2094 (pos_visible_p): Don't report a position visible when move_it_to
2095 stopped at the last line of window, which happens to be scanned
2096 backwards by the bidi iteration. (Bug#11464)
2097
2098 2012-05-14 Eli Zaretskii <eliz@gnu.org>
2099
2100 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
2101 and right-margin display specs even if the spec is invalid or we
2102 are on a TTY, and thus unable to display on the fringes.
2103 That's because the text with the property will not be displayed anyway,
2104 so we need to signal to the caller that this is a "replacing"
2105 display spec. This fixes display when the spec is invalid or we
2106 are on a TTY.
2107
2108 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2109
2110 * unexaix.c (make_hdr): Fix typo in prototype.
2111 This bug broke the build on AIX. Problem reported by Gilles Pion.
2112
2113 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
2114
2115 * keyboard.c (kbd_buffer_get_event): Read special events also in
2116 batch mode. (Bug#11415)
2117
2118 2012-05-12 Glenn Morris <rgm@gnu.org>
2119
2120 * ns.mk: Update for ns_appbindir no longer having trailing "/".
2121
2122 2012-05-12 Eli Zaretskii <eliz@gnu.org>
2123
2124 * lisp.mk (lisp): Add newcomment.elc.
2125
2126 2012-05-12 Glenn Morris <rgm@gnu.org>
2127
2128 * Makefile.in (MKDIR_P): New, set by configure.
2129 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
2130
2131 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
2132
2133 Remove unused function hourglass_started.
2134 * dispextern.h (hourglass_started):
2135 * w32fns.c (hourglass_started):
2136 * xdisp.c (hourglass_started): Remove.
2137
2138 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
2139
2140 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
2141 Update dependencies.
2142
2143 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
2144
2145 * xgselect.c (xg_select): Put maxfds+1 into a var.
2146 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
2147
2148 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
2149
2150 2012-05-10 Dave Abrahams <dave@boostpro.com>
2151
2152 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
2153 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
2154
2155 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
2156
2157 * dbusbind.c (xd_registered_buses): New internal Lisp object.
2158 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
2159 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
2160 Initialize xd_registered_buses.
2161
2162 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
2163
2164 Untag more efficiently if USE_LSB_TAG.
2165 This is based on a proposal by YAMAMOTO Mitsuharu in
2166 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
2167 For an admittedly artificial (nth 8000 longlist) benchmark on
2168 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
2169 Emacs's overall text size by 1%.
2170 * lisp.h (XUNTAG): New macro.
2171 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
2172 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
2173 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
2174 * eval.c (Fautoload):
2175 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
2176 * frame.h (XFRAME): Use XUNTAG.
2177
2178 Port recent dbusbind.c changes to 32-bit --with-wide-int.
2179 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
2180 Remove unportable assumptions about print widths of types like
2181 dbus_uint32_t.
2182 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
2183 intptr_t when converting between pointer and integer, to avoid GCC
2184 warnings about wrong width.
2185
2186 2012-05-09 Eli Zaretskii <eliz@gnu.org>
2187
2188 * w32proc.c (new_child): Force Windows to reserve only 64KB of
2189 stack for each reader_thread, instead of defaulting to 8MB
2190 determined by the linker. This avoids failures in creating
2191 subprocesses on Windows 7, see the discussion in this thread:
2192 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
2193
2194 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
2195
2196 Fix up display of the *Minibuf-0* buffer in the mini window.
2197 * keyboard.c (read_char): Don't clear the echo area if there's no
2198 message to clear.
2199 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2200 contents of *Minibuf-0*) if there's no message displayed in its stead.
2201
2202 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
2203
2204 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
2205 batch mode.
2206
2207 2012-05-06 Chong Yidong <cyd@gnu.org>
2208
2209 * lisp.mk (lisp): Update.
2210
2211 2012-05-05 Jim Meyering <meyering@redhat.com>
2212
2213 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
2214
2215 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2216
2217 * data.c (PUT_ERROR): New macro.
2218 (syms_of_data): Use it. Add new error type `user-error'.
2219 * undo.c (user_error): New function.
2220 (Fprimitive_undo): Use it.
2221 * print.c (print_error_message): Adjust print style for `user-error'.
2222 * keyboard.c (user_error): New function.
2223 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2224
2225 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
2226
2227 Do not limit current-time-string to years 1000..9999.
2228 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
2229 (Fcurrent_time_string): Support any year that is supported by the
2230 underlying localtime representation. Don't use asctime, as it
2231 has undefined behavior for years outside the range -999..9999.
2232
2233 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2234
2235 Fix race conditions involving setenv, gmtime, localtime, asctime.
2236 Without this fix, interrupts could mess up code that uses these
2237 nonreentrant functions, since setting TZ invalidates existing
2238 tm_zone or tzname values, and since most of these functions return
2239 pointers to static storage.
2240 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
2241 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
2242 Grow the critical sections to include not just invoking
2243 localtime/gmtime, but also accessing these functions' results
2244 including their tm_zone values if any, and any related TZ setting.
2245 (format_time_string): Last arg is now struct tm *, not struct tm **,
2246 so that the struct tm is saved in the critical section.
2247 All callers changed. Simplify allocation of initial buffer, partly
2248 motivated by the fact that memory allocation needs to be outside
2249 the critical section.
2250
2251 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2252
2253 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
2254 with RESET_INTERVAL.
2255
2256 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2257 Remove duplicated buffer name initialization.
2258
2259 2012-05-02 Jim Meyering <jim@meyering.net>
2260
2261 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
2262
2263 * xfns.c (x_window): Use xstrdup (Bug#11375).
2264
2265 2012-05-02 Eli Zaretskii <eliz@gnu.org>
2266
2267 * xdisp.c (pos_visible_p): If already at a newline from the
2268 display string before the 'while' loop, don't walk back the glyphs
2269 from it3.glyph_row. Solves assertion violation when the display
2270 string begins with a newline (egg.el). (Bug#11367)
2271
2272 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
2273
2274 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
2275 Move to simple.el.
2276
2277 2012-05-01 Glenn Morris <rgm@gnu.org>
2278
2279 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
2280 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
2281 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
2282 All were removed before 23.1.
2283
2284 * dispnew.c: Remove HAVE_LIBNCURSES test;
2285 it is always true on relevant platforms.
2286
2287 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
2288 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
2289
2290 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
2291
2292 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
2293
2294 * .gdbinit (xpr): Remove checks for no longer existing misc types.
2295 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
2296 Remove.
2297
2298 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
2299
2300 Do not avoid creating empty evaporating overlays (Bug#9642).
2301 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
2302 That is, do not delete an evaporating overlay if it becomes
2303 empty after its bounds are adjusted to fit within its buffer.
2304 This fix caused other problems, and I'm reverting it until we get
2305 to the bottom of them.
2306
2307 2012-04-27 Chong Yidong <cyd@gnu.org>
2308
2309 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
2310
2311 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2312
2313 * xdisp.c (pos_visible_p): If the window start position is beyond
2314 ZV, start the display from buffer beginning. Prevents assertion
2315 violation in init_iterator when the minibuffer window is scrolled
2316 via the scroll bar.
2317
2318 * window.c (window_scroll_pixel_based): Likewise.
2319
2320 2012-04-27 Chong Yidong <cyd@gnu.org>
2321
2322 * keymap.c (where_is_internal): Doc fix (Bug#10872).
2323
2324 2012-04-27 Glenn Morris <rgm@gnu.org>
2325
2326 * fileio.c (Fcopy_file, Fset_file_selinux_context):
2327 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
2328
2329 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2330
2331 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
2332 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
2333
2334 2012-04-26 Eli Zaretskii <eliz@gnu.org>
2335
2336 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
2337 display element, check also the underlying string or buffer
2338 character. (Bug#11341)
2339
2340 * w32menu.c: Include w32heap.h.
2341 (add_menu_item): If the call to AppendMenuW (via
2342 unicode_append_menu) fails, disable Unicode menus only if we are
2343 running on Windows 9X/Me.
2344
2345 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
2346
2347 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
2348 (xgetint): Add missing shift for LSB tags.
2349
2350 2012-04-24 Martin Rudalics <rudalics@gmx.at>
2351
2352 * keyboard.c (read_char): Don't wipe echo area for select window
2353 events: These might get delayed via `mouse-autoselect-window'
2354 (Bug#11304).
2355
2356 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
2357
2358 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
2359 manipulation of :loaded-from data.
2360
2361 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
2362
2363 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
2364 now a cons (bug#11311).
2365
2366 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
2367
2368 Do not create empty overlays with the evaporate property (Bug#9642).
2369 * buffer.c (Fmove_overlay): Delete an evaporating overlay
2370 if it becomes empty after its bounds are adjusted to fit within
2371 its buffer. Without this fix, in a nonempty buffer (let ((o
2372 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
2373 yields an empty overlay that has the evaporate property, which is
2374 not supposed to happen.
2375
2376 Fix minor GTK3 problems found by static checking.
2377 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2378 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2379 (struct _EmacsFixedClass, emacs_fixed_get_type):
2380 Move decls here from emacsgtkfixed.h, since they needn't be public.
2381 (emacs_fixed_get_type): Now static.
2382 (emacs_fixed_class_init): Omit unused local.
2383 (emacs_fixed_child_type): Remove; unused.
2384 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2385 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2386 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
2387 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
2388 (EMACS_FIXED_GET_CLASS): Remove; unused.
2389 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
2390
2391 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
2392 Problem reported by Juanma Barranquero for Windows -Wunused-function.
2393
2394 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
2397 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
2398 (__malloc_size_t, __malloc_ptrdiff_t):
2399 Remove. All uses removed, replaced by the definiens if needed,
2400 since we can assume C89 or better now.
2401 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
2402 (protect_malloc_state, align, get_contiguous_space)
2403 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
2404 (malloc_atfork_handler_child, malloc_enable_thread)
2405 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
2406 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
2407 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
2408 (special_realloc, _realloc_internal_nolock, _realloc_internal)
2409 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
2410 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
2411 Define using prototypes, not old style.
2412 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
2413 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
2414 (align): Don't assume that signed integer overflow wraps around.
2415 Omit unused local var.
2416 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
2417 (_free_internal_nolock, memalign, mallochook, reallochook):
2418 Omit no-longer-needed casts.
2419 (valloc): Use getpagesize, not __getpagesize.
2420 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
2421 (struct hdr): The 'magic' member is now size_t, not unsigned long.
2422
2423 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
2424
2425 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
2426
2427 Move functions from C to Lisp. Make non-blocking method calls
2428 the default. Implement further D-Bus standard interfaces.
2429
2430 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
2431 (QCdbus_request_name_allow_replacement)
2432 (QCdbus_request_name_replace_existing)
2433 (QCdbus_request_name_do_not_queue)
2434 (QCdbus_request_name_reply_primary_owner)
2435 (QCdbus_request_name_reply_in_queue)
2436 (QCdbus_request_name_reply_exists)
2437 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
2438 (QCdbus_registered_serial, QCdbus_registered_method)
2439 (QCdbus_registered_signal): New Lisp objects.
2440 (XD_DEBUG_MESSAGE): Use sizeof.
2441 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
2442 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
2443 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
2444 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
2445 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
2446 (xd_signature, xd_append_arg): Allow float for integer types.
2447 (xd_get_connection_references): New function.
2448 (xd_get_connection_address): Rename from xd_initialize.
2449 Return cached address.
2450 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
2451 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
2452 level.
2453 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
2454 Return number of refcounts.
2455 (Fdbus_get_unique_name): Make stronger parameter check.
2456 (Fdbus_message_internal): New defun.
2457 (Fdbus_call_method, Fdbus_call_method_asynchronously)
2458 (Fdbus_method_return_internal, Fdbus_method_error_internal)
2459 (Fdbus_send_signal, Fdbus_register_service)
2460 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
2461 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
2462 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
2463 (Vdbus_compiled_version, Vdbus_runtime_version)
2464 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
2465 (Vdbus_message_type_method_return, Vdbus_message_type_error)
2466 (Vdbus_message_type_signal): New defvars.
2467 (Vdbus_registered_buses, Vdbus_registered_objects_table):
2468 Adapt docstring.
2469
2470 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2471
2472 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
2473 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
2474 Do not assume ptrdiff_t is the same width as 'int'.
2475
2476 * alloc.c: Handle unusual debugging option combinations.
2477 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
2478 since the two debugging options are incompatible.
2479 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
2480 is defined.
2481 (mem_init, mem_insert, mem_insert_fixup):
2482 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
2483 (NEED_MEM_INSERT): Remove; no longer needed.
2484
2485 2012-04-22 Leo Liu <sdl.web@gmail.com>
2486
2487 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
2488
2489 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2490
2491 * sysdep.c [__FreeBSD__]: Minor cleanups.
2492 (list_system_processes, system_process_attributes) [__FreeBSD__]:
2493 Use Emacs indenting style more consistently. Avoid some casts.
2494 Use 'double' consistently rather than mixing 'float' and 'double'.
2495
2496 2012-04-21 Eduard Wiebe <usenet@pusto.de>
2497
2498 * sysdep.c (list_system_processes, system_process_attributes):
2499 Add implementation for FreeBSD (Bug#5243).
2500
2501 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
2502
2503 * lisp.mk (lisp): Update.
2504
2505 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
2506
2507 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
2508 It is never used otherwise.
2509
2510 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
2511
2512 * print.c (print_preprocess): Only check print_depth if print-circle
2513 is nil.
2514 (print_object): Check for cycles even when print-circle is nil and
2515 print-gensym is t, but only check print_depth if print-circle is nil.
2516
2517 2012-04-20 Chong Yidong <cyd@gnu.org>
2518
2519 * process.c (wait_reading_process_output): If EIO occurs on a pty,
2520 set the status to "failed" and ensure that sentinel is run.
2521
2522 2012-04-20 Glenn Morris <rgm@gnu.org>
2523
2524 * process.c (Fset_process_inherit_coding_system_flag)
2525 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
2526 (Fmake_network_process, Fmake_serial_process): Doc fix.
2527
2528 2012-04-20 Eli Zaretskii <eliz@gnu.org>
2529
2530 * xdisp.c (string_buffer_position_lim): Limit starting position to
2531 BEGV.
2532 (set_cursor_from_row): If called for a mode-line or header-line
2533 row, return zero immediately.
2534 (try_cursor_movement): If inside continuation line, don't back up
2535 farther than the first row after the header line, if any.
2536 Don't consider the header-line row as "partially visible", even if
2537 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
2538
2539 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
2540
2541 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
2542 (bug#11238).
2543
2544 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
2545 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
2546
2547 configure: new option --enable-gcc-warnings (Bug#11207)
2548 * Makefile.in (C_WARNINGS_SWITCH): Remove.
2549 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
2550 (ALL_CFLAGS): Use new macros rather than old.
2551 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
2552 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
2553 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
2554 -Wunused-result, -Wunused-variable. This should go away once
2555 the Emacs and Gnulib regex code is merged.
2556 (xmalloc, xrealloc): Now static.
2557
2558 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
2559
2560 * dired.c (Fsystem_groups): Remove unused local.
2561
2562 2012-04-17 Glenn Morris <rgm@gnu.org>
2563
2564 * dired.c (Fsystem_users): Doc fix.
2565
2566 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
2567
2568 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
2569 (syms_of_dired): Add them.
2570
2571 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 Fix minor alloc.c problems found by static checking.
2574 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
2575 New extern decls, to avoid calling undeclared functions.
2576 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
2577 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
2578 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
2579 (NEED_MEM_INSERT): New macro.
2580 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
2581 Remove one incorrect comment and fix another.
2582
2583 Fix minor ralloc.c problems found by static checking.
2584 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2585 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
2586 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
2587 (r_alloc_sbrk): Now static.
2588
2589 Improve ralloc.c interface checking.
2590 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2591 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
2592 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
2593 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
2594 [REL_ALLOC]: ... to here, to check interface.
2595 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
2596 Remove decls. This fixes an "It stinks!".
2597
2598 * alloc.c (which_symbols): Fix alignment issue / type clash.
2599
2600 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
2601
2602 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
2603 (struct Lisp_Misc_Any): Likewise.
2604 (struct Lisp_Free): Likewise.
2605 * alloc.c (union aligned_Lisp_Symbol): Define.
2606 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
2607 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
2608 (union aligned_Lisp_Misc): Define.
2609 (MARKER_BLOCK_SIZE, struct marker_block): Use union
2610 aligned_Lisp_Misc instead of union Lisp_Misc.
2611 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
2612
2613 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
2614
2615 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
2616 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
2617 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
2618 * s/netbsd.h, s/sol2-6.h:
2619 Remove definition of GC_MARK_STACK, since the default now works.
2620 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
2621 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
2622 no longer the default.
2623 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
2624
2625 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
2626
2627 * lread.c (lisp_file_lexically_bound_p):
2628 Fix hang at ";-*-\n" (bug#11238).
2629
2630 2012-04-14 Eli Zaretskii <eliz@gnu.org>
2631
2632 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
2633 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
2634
2635 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
2636
2637 * nsterm.m (constrainFrameRect): Always constrain when there is only
2638 one screen (Bug#10962).
2639
2640 2012-04-13 Ken Brown <kbrown@cornell.edu>
2641
2642 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
2643
2644 2012-04-13 Reuben Thomas <rrt@sc3d.org>
2645
2646 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
2647
2648 2012-04-11 Daniel Colascione <dancol@dancol.org>
2649
2650 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
2651 against is gone. It's better to use vfork now so that when Cygwin
2652 gains a new, working vfork, we use it automatically (bug#10398).
2653
2654 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2655
2656 * window.c (save_window_save): Obey window-point-insertion-type.
2657
2658 2012-04-11 Glenn Morris <rgm@gnu.org>
2659
2660 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
2661
2662 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2663
2664 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
2665
2666 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
2667
2668 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
2669 (force_quit_count): New var.
2670 (handle_interrupt): Use it.
2671
2672 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
2673
2674 * w32.c (w32_delayed_load): Record the full path of the library
2675 being loaded (bug#10424).
2676
2677 2012-04-09 Glenn Morris <rgm@gnu.org>
2678
2679 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
2680 not just in the obarray, before snarfing them. (Bug#11036)
2681
2682 * Makefile.in ($(leimdir)/leim-list.el):
2683 Pass EMACS rather than BUILT_EMACS.
2684
2685 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
2686
2687 * process.c (make_process):
2688 * process.h: Add integer `gnutls_handshakes_tried' member to
2689 process struct.
2690
2691 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
2692 Add convenience `GNUTLS_LOG2i' macro.
2693
2694 * gnutls.c (gnutls_log_function2i): Convenience log function.
2695 (emacs_gnutls_read): Use new log functions,
2696 `gnutls_handshakes_tried' process member, and
2697 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
2698 attempts per process (connection).
2699
2700 2012-04-09 Chong Yidong <cyd@gnu.org>
2701
2702 * eval.c (Fuser_variable_p, user_variable_p_eh)
2703 (lisp_indirect_variable): Functions deleted.
2704 (Fdefvar): Caller changed.
2705
2706 * callint.c (Finteractive, Fcall_interactively):
2707 * minibuf.c (Fread_variable): Callers changed.
2708
2709 2012-04-09 Eli Zaretskii <eliz@gnu.org>
2710
2711 * xdisp.c (set_cursor_from_row): If the display string appears in
2712 the buffer at position that is closer to point than the position
2713 after the display string, display the cursor on the first glyph of
2714 the display string. Fixes cursor display when a 'display' text
2715 property immediately follows invisible text. (Bug#11094)
2716
2717 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 composite.c: use 'double' consistently
2720 * composite.c (get_composition_id): Use 'double' consistently
2721 instead of converting 'float' to 'double' and vice versa; this is
2722 easier to understand and avoids a GCC warning.
2723
2724 2012-04-09 Glenn Morris <rgm@gnu.org>
2725
2726 * Makefile.in: Generate leim-list with bootstrap-emacs, in
2727 preparation for dumping it with emacs. (Bug#4789)
2728 (leimdir): New variable.
2729 ($(leimdir)/leim-list.el): New rule.
2730 (emacs$(EXEEXT)): Depend on leim-list.el.
2731
2732 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
2733 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
2734 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
2735
2736 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
2737
2738 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
2739 proper alignment.
2740
2741 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
2742
2743 * xml.c (init_libxml2_functions) [WINDOWSNT]:
2744 Remove unused local variable.
2745
2746 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2747
2748 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
2749 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
2750 (mark_memory): Mark Lisp_Objects only if pointers might hide in
2751 objects, as mark_maybe_pointer will catch them otherwise.
2752 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
2753 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
2754
2755 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2756
2757 Fix typo that broke non-Windows builds.
2758 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
2759
2760 2012-04-07 Eli Zaretskii <eliz@gnu.org>
2761
2762 Support building on MS-Windows with libxml2.
2763
2764 * makefile.w32-in (OBJ2): Add xml.$(O).
2765 (GLOBAL_SOURCES): Add xml.c.
2766 ($(BLD)/xml.$(O)): New dependency list.
2767
2768 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
2769 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
2770 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
2771 [!WINDOWSNT]: New macros.
2772 (init_libxml2_functions, libxml2_loaded_p): New functions.
2773 (parse_region): Call fn_xmlCheckVersion instead of using the macro
2774 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
2775 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
2776 Calls xmlCleanupParser only if libxml2 was loaded (or statically
2777 linked in).
2778 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
2779 Call init_libxml2_functions before calling libxml2 functions.
2780 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
2781
2782 * emacs.c: Don't include libxml/parser.h.
2783 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
2784 xmlCleanupParser directly.
2785
2786 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
2787
2788 2012-04-07 Eli Zaretskii <eliz@gnu.org>
2789
2790 * indent.c (Fvertical_motion): If there is a display string at
2791 point, use it.vpos to compute how many lines to backtrack after
2792 move_it_to point. (Bug#11133)
2793
2794 2012-04-06 Eli Zaretskii <eliz@gnu.org>
2795
2796 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
2797 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
2798 about subtle differences between FETCH_CHAR* and STRING_CHAR*
2799 macros related to unification of CJK characters. For the details,
2800 see the discussion following the message here:
2801 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
2802
2803 2012-04-04 Chong Yidong <cyd@gnu.org>
2804
2805 * keyboard.c (Vdelayed_warnings_list): Doc fix.
2806
2807 2012-04-01 Eli Zaretskii <eliz@gnu.org>
2808
2809 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
2810 instead of alloca. (Bug#11138)
2811
2812 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
2813
2814 * w32menu.c (is_simple_dialog): Properly check lisp types.
2815 (Bug#11141)
2816
2817 2012-03-31 Eli Zaretskii <eliz@gnu.org>
2818
2819 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
2820 position we get to after a call to move_it_to fails the
2821 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
2822 only if we wind up in a string from display property. (Bug#11063)
2823
2824 * window.c (Fdelete_other_windows_internal): Invalidate the row
2825 and column information about mouse highlight, so that redisplay
2826 restores it after reallocating the glyph matrices. (Bug#7464)
2827
2828 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
2829 string comes from a `display' text property, use the buffer
2830 position of that property as if we actually saw that position in
2831 the row's glyphs.
2832 (move_it_by_lines): Remove the assertion that
2833 "it->current_x == 0 && it->hpos == 0" which can be legitimately
2834 violated when there's a before-string at the beginning of a line.
2835 (Bug#11063)
2836
2837 2012-03-30 Eli Zaretskii <eliz@gnu.org>
2838
2839 * xdisp.c (append_space_for_newline): If the default face was
2840 remapped, use the remapped face for the appended newline.
2841 (extend_face_to_end_of_line): Use the remapped default face for
2842 extending the face to the end of the line.
2843 (display_line): Call extend_face_to_end_of_line when the default
2844 face was remapped. (Bug#11068)
2845
2846 2012-03-29 Eli Zaretskii <eliz@gnu.org>
2847
2848 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
2849
2850 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
2851
2852 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
2853
2854 2012-03-27 Glenn Morris <rgm@gnu.org>
2855
2856 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
2857 Doc fixes.
2858
2859 2012-03-26 Kenichi Handa <handa@m17n.org>
2860
2861 * dispextern.h (struct glyph): Fix previous change. Change the
2862 bit length of glyphless.ch to 25 (Bug#11082).
2863
2864 2012-03-26 Chong Yidong <cyd@gnu.org>
2865
2866 * keyboard.c (Vselection_inhibit_update_commands): New variable.
2867 (command_loop_1): Use it; inhibit selection update for
2868 handle-select-window too (Bug#8996).
2869
2870 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
2871
2872 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
2873
2874 2012-03-25 Kenichi Handa <handa@m17n.org>
2875
2876 * dispextern.h (struct glyph): Change the bit length of
2877 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
2878
2879 2012-03-24 Eli Zaretskii <eliz@gnu.org>
2880
2881 * s/ms-w32.h (tzname): Include time.h before redirecting to
2882 _tzname. Fixes the MSVC build. (Bug#9960)
2883
2884 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
2885
2886 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
2887 characters.
2888
2889 * xterm.c (XTread_socket): Only modify handling_signal if
2890 !SYNC_INPUT. (Bug#11080)
2891
2892 2012-03-23 Eli Zaretskii <eliz@gnu.org>
2893
2894 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
2895 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
2896 when fetching a multibyte character consumes more bytes than
2897 CHAR_BYTES returns, due to unification of CJK characters in
2898 string_char. (Bug#11073)
2899
2900 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
2901
2902 * process.c (wait_reading_process_output): Handle pty disconnect
2903 by refraining from sending oneself a SIGCHLD (bug#10933).
2904
2905 2012-03-22 Chong Yidong <cyd@gnu.org>
2906
2907 * dispextern.h (struct it): New member string_from_prefix_prop_p.
2908
2909 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
2910 Mark string as coming from a prefix property.
2911 (handle_face_prop): Use default face for prefix strings (Bug#4281).
2912 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
2913
2914 2012-03-21 Chong Yidong <cyd@gnu.org>
2915
2916 * xfaces.c (Vface_remapping_alist): Doc fix.
2917
2918 2012-03-20 Eli Zaretskii <eliz@gnu.org>
2919
2920 * w32proc.c (Fw32_set_console_codepage)
2921 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
2922 Doc fixes.
2923
2924 2012-03-20 Chong Yidong <cyd@gnu.org>
2925
2926 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
2927 to reflect default non-nil value of redisplay-dont-pause.
2928
2929 2012-03-19 Kenichi Handa <handa@m17n.org>
2930
2931 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
2932 it fit in a valid range (Bug#11003).
2933
2934 2012-03-18 Eli Zaretskii <eliz@gnu.org>
2935
2936 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
2937 that is not from display property, accept the row as a "cursor
2938 row" if one of the string's character has a non-nil `cursor'
2939 property. Fixes cursor positioning when there are newlines in
2940 overlay strings, e.g. in icomplete.el. (Bug#11035)
2941
2942 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
2943
2944 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
2945
2946 2012-03-12 Chong Yidong <cyd@gnu.org>
2947
2948 * eval.c (inhibit_lisp_code): Rename from
2949 inhibit_window_configuration_change_hook; move from window.c.
2950
2951 * xfns.c (unwind_create_frame_1, Fx_create_frame):
2952 * window.c (run_window_configuration_change_hook)
2953 (syms_of_window): Callers changed.
2954
2955 2012-03-11 Chong Yidong <cyd@gnu.org>
2956
2957 * keymap.c (Fkey_description): Doc fix (Bug#9700).
2958
2959 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
2960
2961 2012-03-10 Chong Yidong <cyd@gnu.org>
2962
2963 * frame.c (other_visible_frames): Don't assume the selected frame
2964 is visible (Bug#10955).
2965
2966 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
2967
2968 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
2969
2970 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
2971
2972 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
2973 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
2974 zero (Bug#10954).
2975
2976 2012-03-03 Glenn Morris <rgm@gnu.org>
2977
2978 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
2979
2980 2012-03-02 Eli Zaretskii <eliz@gnu.org>
2981
2982 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
2983 position past the first glyph_row that ends at ZV. (Bug#10902)
2984 (redisplay_window, next_element_from_string): Fix typos in
2985 comments.
2986 (redisplay_window): Pass to move_it_vertically the margin in
2987 pixels, not in screen lines.
2988
2989 2012-03-02 Glenn Morris <rgm@gnu.org>
2990
2991 * buffer.c (buffer-list-update-hook): Doc fix.
2992
2993 2012-02-29 Eli Zaretskii <eliz@gnu.org>
2994
2995 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
2996 push_it before setting up the iterator for the first overlay
2997 string, even if we have an empty string loaded.
2998 (next_overlay_string): If there's an empty string on the iterator
2999 stack, pop the stack. (Bug#10903)
3000
3001 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
3004 Suggested by Stefan Monnier in
3005 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
3006 * alloc.c (widen_to_Lisp_Object): New static function.
3007 (mark_memory): Also mark Lisp_Objects by fetching pointer words
3008 and widening them to Lisp_Objects. This would work even if
3009 USE_LSB_TAG is defined and wide integers are used, which might
3010 happen in a future version of Emacs.
3011
3012 2012-02-25 Chong Yidong <cyd@gnu.org>
3013
3014 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
3015 Doc fix.
3016
3017 * xselect.c (Fx_selection_exists_p): Doc fix.
3018 (x_clipboard_manager_save_all): Print an informative message
3019 before saving to clipboard manager.
3020
3021 2012-02-24 Chong Yidong <cyd@gnu.org>
3022
3023 * keyboard.c (process_special_events): Handle all X selection
3024 requests in kbd_buffer, not just the next one (Bug#8869).
3025
3026 2012-02-23 Chong Yidong <cyd@gnu.org>
3027
3028 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
3029 call when setting menu-bar-lines and tool-bar-lines parameters.
3030 (unwind_create_frame_1): New helper function.
3031
3032 * window.c (inhibit_window_configuration_change_hook): New var.
3033 (run_window_configuration_change_hook): Obey it.
3034 (syms_of_window): Initialize it.
3035
3036 2012-02-22 Chong Yidong <cyd@gnu.org>
3037
3038 * xterm.c (x_draw_image_relief): Add missing type check for
3039 Vtool_bar_button_margin (Bug#10743).
3040
3041 2012-02-21 Chong Yidong <cyd@gnu.org>
3042
3043 * fileio.c (Vfile_name_handler_alist): Doc fix.
3044
3045 * buffer.c (Fget_file_buffer): Protect against invalid file
3046 handler return value.
3047
3048 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
3049
3050 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
3051 when computing $valmask.
3052
3053 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
3054 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
3055 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
3056 It's useless in that case, and it can cause problems on hosts
3057 that allocate halves of EMACS_INT values separately.
3058 Reported by Dan Horák. Diagnosed by Andreas Schwab in
3059 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
3060 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
3061 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
3062 it avoids undefined behavior on hosts where shifting right by more
3063 than the word width has undefined behavior.
3064
3065 2012-02-19 Chong Yidong <cyd@gnu.org>
3066
3067 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
3068 (Funhandled_file_name_directory, Ffile_name_as_directory)
3069 (Fdirectory_file_name, Fexpand_file_name)
3070 (Fsubstitute_in_file_name): Protect against invalid file handler
3071 return values (Bug#10845).
3072
3073 2012-02-18 Eli Zaretskii <eliz@gnu.org>
3074
3075 * .gdbinit (pitx): Fix incorrect references to fields of the
3076 iterator stack.
3077
3078 2012-02-17 Chong Yidong <cyd@gnu.org>
3079
3080 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
3081
3082 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
3083
3084 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
3085 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
3086
3087 2012-02-15 Chong Yidong <cyd@gnu.org>
3088
3089 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
3090 marked as special. Also, starting docstrings with * is obsolete.
3091
3092 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
3093
3094 * gnutls.c (emacs_gnutls_write): Fix last change.
3095
3096 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
3097
3098 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
3099 send_process.
3100
3101 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
3102
3103 * keymap.c (Fsingle_key_description): Handle char ranges.
3104
3105 2012-02-12 Chong Yidong <cyd@gnu.org>
3106
3107 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
3108 as that creates a dangerous corner case.
3109
3110 * window.c (Fdelete_window_internal): Invalidate the mouse
3111 highlight (Bug#9904).
3112
3113 2012-02-12 Glenn Morris <rgm@gnu.org>
3114
3115 * xselect.c (Fx_own_selection_internal)
3116 (Fx_get_selection_internal, Fx_disown_selection_internal)
3117 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
3118 * nsselect.m (Fx_own_selection_internal)
3119 (Fx_disown_selection_internal, Fx_selection_exists_p)
3120 (Fx_selection_owner_p, Fx_get_selection_internal):
3121 Sync docs and argument specs with the xselect.c versions.
3122
3123 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
3124
3125 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
3126
3127 2012-02-11 Eli Zaretskii <eliz@gnu.org>
3128
3129 * w32select.c (Fx_selection_exists_p): Sync doc string and
3130 argument list with xselect.c. (Bug#10783)
3131
3132 * w16select.c (Fx_selection_exists_p): Sync doc string and
3133 argument list with xselect.c. (Bug#10783)
3134
3135 2012-02-10 Glenn Morris <rgm@gnu.org>
3136
3137 * fns.c (Fsecure_hash): Doc fix.
3138
3139 2012-02-09 Kenichi Handa <handa@m17n.org>
3140
3141 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
3142
3143 2012-02-07 Chong Yidong <cyd@gnu.org>
3144
3145 * buffer.c (Fbuffer_local_variables)
3146 (buffer_lisp_local_variables): Handle unbound vars correctly;
3147 don't let Qunbound leak into Lisp.
3148
3149 2012-02-07 Glenn Morris <rgm@gnu.org>
3150
3151 * image.c (Fimagemagick_types): Doc fix.
3152
3153 * image.c (imagemagick-render-type): Change it from a lisp object
3154 to an integer. Move the doc here from the lisp manual.
3155 Treat all values not equal to 0 the same.
3156
3157 2012-02-06 Chong Yidong <cyd@gnu.org>
3158
3159 * doc.c (store_function_docstring): Avoid applying docstring of
3160 alias to base function (Bug#2603).
3161
3162 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
3163
3164 * .gdbinit (pp1, pv1): Remove redundant defines.
3165 (pr): Use pp.
3166
3167 2012-02-04 Chong Yidong <cyd@gnu.org>
3168
3169 * nsterm.m: Declare a global (Bug#10694).
3170
3171 2012-02-04 Eli Zaretskii <eliz@gnu.org>
3172
3173 * w32.c (get_emacs_configuration_options):
3174 Include --enable-checking, if specified, in the return value.
3175
3176 2012-02-04 Martin Rudalics <rudalics@gmx.at>
3177
3178 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
3179 after rounding frame sizes. (Bug#9723)
3180
3181 2012-02-04 Eli Zaretskii <eliz@gnu.org>
3182
3183 * keyboard.c (adjust_point_for_property): Don't position point
3184 before BEGV. (Bug#10696)
3185
3186 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
3187
3188 Handle overflow when computing char display width (Bug#9496).
3189 * character.c (char_width): Return EMACS_INT, not int.
3190 (char_width, c_string_width): Check for overflow when
3191 computing the width; this is possible now that individual
3192 characters can have unbounded width. Problem introduced
3193 by merge from Emacs 23 on 2012-01-19.
3194
3195 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
3196
3197 * dbusbind.c (Fdbus_register_method): Mention the return value
3198 :ignore in the docstring.
3199
3200 2012-02-02 Glenn Morris <rgm@gnu.org>
3201
3202 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
3203
3204 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3205 Unconditionally set to t. (Bug#10673)
3206 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3207 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3208 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
3209
3210 2012-02-02 Kenichi Handa <handa@m17n.org>
3211
3212 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
3213 0, do not call append_composite_glyph.
3214
3215 2012-02-02 Kenichi Handa <handa@m17n.org>
3216
3217 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
3218 NULL (Bug#6988).
3219 (x_produce_glyphs): If the component of a composition is a null
3220 string, set it->pixel_width to 1 to avoid zero-width glyph.
3221
3222 2012-02-01 Eli Zaretskii <eliz@gnu.org>
3223
3224 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
3225 first 2 arguments are identical. This makes inserting large
3226 output from a subprocess an order of magnitude faster on
3227 MS-Windows, where all sbrk'ed memory is always contiguous.
3228
3229 2012-01-31 Glenn Morris <rgm@gnu.org>
3230
3231 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3232 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3233 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
3234
3235 2012-01-29 Glenn Morris <rgm@gnu.org>
3236
3237 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
3238
3239 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
3240
3241 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
3242
3243 2012-01-28 Chong Yidong <cyd@gnu.org>
3244
3245 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
3246
3247 2012-01-26 Chong Yidong <cyd@gnu.org>
3248
3249 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
3250
3251 * search.c (Fsearch_forward, Fsearch_backward): Document negative
3252 repeat counts (Bug#10507).
3253
3254 2012-01-26 Glenn Morris <rgm@gnu.org>
3255
3256 * lread.c (syms_of_lread): Doc fix.
3257
3258 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
3259
3260 * coding.c (encode_designation_at_bol): Change return value to
3261 EMACS_INT.
3262
3263 2012-01-25 Chong Yidong <cyd@gnu.org>
3264
3265 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
3266
3267 2012-01-21 Chong Yidong <cyd@gnu.org>
3268
3269 * floatfns.c (Fcopysign): Make the second argument non-optional,
3270 since nil is not allowed anyway.
3271
3272 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
3273
3274 * process.c (read_process_output): Use p instead of XPROCESS (proc).
3275 (send_process): Likewise.
3276
3277 2012-01-19 Martin Rudalics <rudalics@gmx.at>
3278
3279 * window.c (save_window_save, Fcurrent_window_configuration)
3280 (Vwindow_persistent_parameters): Do not use Qstate.
3281 Rewrite doc-strings.
3282
3283 2012-01-19 Kenichi Handa <handa@m17n.org>
3284
3285 * character.c (char_width): New function.
3286 (Fchar_width, c_string_width, lisp_string_width):
3287 Use char_width (Bug#9496).
3288
3289 2012-01-16 Martin Rudalics <rudalics@gmx.at>
3290
3291 * window.c (Vwindow_persistent_parameters): New variable.
3292 (Fset_window_configuration, save_window_save): Handle persistent
3293 window parameters.
3294
3295 2012-01-14 Eli Zaretskii <eliz@gnu.org>
3296
3297 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
3298 thrashing the stack of the thread. (Bug#9087)
3299
3300 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
3301
3302 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
3303
3304 2012-01-11 Eli Zaretskii <eliz@gnu.org>
3305
3306 * xdisp.c (rows_from_pos_range): Handle the case where the
3307 highlight ends on a newline. (Bug#10464)
3308 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
3309 he end column for display of highlight that ends on a newline
3310 before a R2L line.
3311
3312 2012-01-11 Glenn Morris <rgm@gnu.org>
3313
3314 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
3315 from load-path also when installation-directory is nil. (Bug#10208)
3316
3317 2012-01-10 Glenn Morris <rgm@gnu.org>
3318
3319 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
3320
3321 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
3322 Update template values to be closer to their typical values these days.
3323
3324 2012-01-09 Eli Zaretskii <eliz@gnu.org>
3325
3326 * xdisp.c (rows_from_pos_range): Accept additional argument
3327 DISP_STRING, and accept any glyph in a row whose object is that
3328 string as eligible for mouse highlight. Fixes mouse highlight of
3329 display strings from overlays. (Bug#10464)
3330
3331 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
3332
3333 emacs: fix an auto-save permissions race condition (Bug#10400)
3334 * fileio.c (auto_saving_dir_umask): New static var.
3335 (Fmake_directory_internal): Use it.
3336 (do_auto_save_make_dir): Set it, instead of invoking chmod after
3337 creating the directory. The old code temporarily assigns
3338 too-generous permissions to the directory.
3339 (do_auto_save_eh): Clear it.
3340 (Fdo_auto_save): Catch all errors, not just file errors, so
3341 that the var is always cleared.
3342
3343 2012-01-07 Eli Zaretskii <eliz@gnu.org>
3344
3345 * search.c (scan_buffer): Pass character positions to
3346 know_region_cache, not byte positions. (Bug#6540)
3347
3348 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
3349
3350 * w32.c (sys_rename): Report EXDEV when rename of a directory
3351 fails because the target is on another logical disk. (Bug#10284)
3352
3353 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
3354
3355 * xterm.c (x_embed_request_focus): New function.
3356
3357 * xterm.h: Add prototype.
3358
3359 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
3360
3361 2012-01-05 Glenn Morris <rgm@gnu.org>
3362
3363 * emacs.c (emacs_copyright): Update short copyright year to 2012.
3364
3365 2012-01-01 Eli Zaretskii <eliz@gnu.org>
3366
3367 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
3368 Load gnutls_transport_set_lowat only if GnuTLS version is below
3369 2.11.1.
3370 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
3371 GnuTLS versions below 2.11.1.
3372
3373 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
3374
3375 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
3376 to the doc string advising against its use for altering the way
3377 windows are scrolled.
3378
3379 2011-12-28 Kenichi Handa <handa@m17n.org>
3380
3381 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
3382 coding-system ASCII compatible only when it does not produce BOM
3383 on encoding (Bug#10383).
3384
3385 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
3386
3387 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
3388 can scroll.
3389 (create_and_show_popup_menu): Always use menu_position_func for
3390 Gtk3 (Bug#10361).
3391
3392 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
3393
3394 * callint.c (Fcall_interactively): Don't truncate prompt string.
3395
3396 2011-12-23 Eli Zaretskii <eliz@gnu.org>
3397
3398 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
3399 property that ends at ZV, so that the bidi iteration could be
3400 resumed from there (after widening). (Bug#10360)
3401
3402 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
3403
3404 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
3405
3406 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
3407
3408 * nsterm.m (x_free_frame_resources):
3409 Release f->output_data.ns->miniimage.
3410 (ns_index_color): Fix indentation. Do not retain
3411 color_table->colors[i].
3412
3413 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
3414 before returning.
3415
3416 * nsfns.m (x_set_background_color): Assign return value from
3417 ns_index_color to face-background instead of NSColor*.
3418 (ns_implicitly_set_icon_type): Fix indentation.
3419 Change assignment in for loop to comparison.
3420
3421 * emacs.c (ns_pool): New variable.
3422 (main): Assign ns_pool.
3423 (Fkill_emacs): Call ns_release_autorelease_pool.
3424
3425 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
3426 autorelease fdesc, release fdAttrs and tdict.
3427 (ns_get_covering_families): Release charset.
3428 (ns_findfonts): Release NSFontDescriptor created with new.
3429 (ns_uni_to_glyphs): Fix indentation.
3430 (setString): Release attrStr before assigning new value.
3431
3432 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3433
3434 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
3435 and NS_IMPL_COCOA.
3436 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
3437 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
3438
3439 2011-12-18 David Reitter <reitter@cmu.edu>
3440
3441 * nsterm.m (ns_term_init): Subscribe for notifications
3442 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
3443 to method trackingNotification in EmacsMenu.
3444
3445 * nsmenu.m (trackingMenu): New variable.
3446 (trackingNotification): New method (from Aquamacs).
3447 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3448 from Aquamacs (Bug#7030).
3449
3450 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3451
3452 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
3453 (symbol_to_nsstring): Fix indentation.
3454 (ns_symbol_to_pb): New function.
3455 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
3456 (Fns_rotate_cut_buffers_internal): Remove.
3457 (Fns_store_selection_internal): Rename from
3458 Fns_store_cut_buffer_internal.
3459 (ns_get_foreign_selection, Fx_own_selection_internal)
3460 (Fx_disown_selection_internal, Fx_selection_exists_p)
3461 (Fns_get_selection_internal, Fns_store_selection_internal):
3462 Use ns_symbol_to_pb and check if return value is nil.
3463 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
3464 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
3465 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
3466 renamed to Sns_store_selection_internal.
3467 (ns_handle_selection_request): Move code to Fx_own_selection_internal
3468 and remove this function.
3469 (ns_handle_selection_clear): Remove, never used.
3470 (Fx_own_selection_internal): Move code from ns_handle_selection_request
3471 here.
3472
3473 2011-12-17 Ken Brown <kbrown@cornell.edu>
3474
3475 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
3476 GID is unknown (Bug#10257).
3477
3478 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
3481 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
3482 which caused a build failure on GNU/Linux IA-64. This problem was
3483 introduced by my 2011-10-07 patch.
3484
3485 2011-12-15 Juri Linkov <juri@jurta.org>
3486
3487 * image.c (imagemagick_error): New function. (Bug#10112)
3488 (imagemagick_load_image): Comment out `MagickSetResolution' call.
3489 Use `imagemagick_error' where ImageMagick functions return
3490 `MagickFalse'.
3491 (Fimagemagick_types): Add `Fnreverse' to return the list in the
3492 proper order.
3493
3494 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3495
3496 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
3497 fill background (Bug#8992).
3498
3499 2011-12-13 Martin Rudalics <rudalics@gmx.at>
3500
3501 * window.c (Vwindow_combination_resize)
3502 (Vwindow_combination_limit): Use t instead of non-nil in
3503 doc-strings.
3504 (Vrecenter_redisplay): Add first sentence of doc-string on
3505 separate line.
3506 (Frecenter): Fix doc-string typo.
3507
3508 2011-12-11 Kenichi Handa <handa@m17n.org>
3509
3510 * coding.c (Funencodable_char_position): Pay attention to the
3511 buffer text relocation (Bug#9389).
3512
3513 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3514
3515 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
3516 gtk_init (Bug#10100).
3517
3518 2011-12-10 Eli Zaretskii <eliz@gnu.org>
3519
3520 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
3521 IT->string is nil. (Bug#10263)
3522
3523 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3524
3525 * nsterm.h (x_free_frame_resources): Declare.
3526
3527 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
3528 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
3529
3530 * nsterm.h (ns_get_defaults_value): Declare.
3531
3532 * nsterm.m (ns_default): Call ns_get_defaults_value.
3533
3534 2011-12-09 Eli Zaretskii <eliz@gnu.org>
3535
3536 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
3537 (Bug#10170)
3538
3539 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3540
3541 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
3542 that where the value of an _OBJC_* symbol points to is in the .bss
3543 section (Bug#10240).
3544
3545 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3546
3547 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
3548 after the loop to call ccl_driver at least once (Bug#8619).
3549
3550 2011-12-08 Kenichi Handa <handa@m17n.org>
3551
3552 * ftfont.c (get_adstyle_property): Fix previous change
3553 (Bug#10233).
3554
3555 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
3556
3557 * w32.c (init_environment): If no_site_lisp, remove site-lisp
3558 dirs from the default value of EMACSLOADPATH (bug#10208).
3559
3560 2011-12-07 Glenn Morris <rgm@gnu.org>
3561
3562 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
3563 installation and source directories as well. (Bug#10208)
3564
3565 2011-12-06 Chong Yidong <cyd@gnu.org>
3566
3567 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
3568
3569 2011-12-06 Glenn Morris <rgm@gnu.org>
3570
3571 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
3572 as an error, not just -1. (Bug#10217)
3573
3574 2011-12-05 Chong Yidong <cyd@gnu.org>
3575
3576 * keyboard.c (process_special_events): New function.
3577 (swallow_events, Finput_pending_p): Use it (Bug#10195).
3578
3579 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
3580
3581 * coding.c (encode_designation_at_bol): Don't use uninitialized
3582 local variable (Bug#9318).
3583
3584 2011-12-05 Kenichi Handa <handa@m17n.org>
3585
3586 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
3587 return Qnil (Bug#8046, Bug#10193).
3588
3589 2011-12-05 Kenichi Handa <handa@m17n.org>
3590
3591 * coding.c (encode_designation_at_bol): New args charbuf_end and
3592 dst. Return the number of produced bytes. Callers changed.
3593 (coding_set_source): Return how many bytes coding->source was
3594 relocated.
3595 (coding_set_destination): Return how many bytes
3596 coding->destination was relocated.
3597 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
3598 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
3599
3600 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3601
3602 * coding.c (CODING_CHAR_CHARSET_P): New macro.
3603 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
3604 macro (Bug#9318).
3605
3606 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
3607
3608 The following changes are to fix Bug#9318.
3609
3610 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
3611 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
3612 (encode_coding_iso_2022, encode_coding_sjis)
3613 (encode_coding_big5, encode_coding_charset): Use the above macros.
3614
3615 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
3616
3617 * lisp.h (process_quit_flag): Fix external declaration.
3618
3619 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
3620
3621 Don't macro-inline non-performance-critical code.
3622 * eval.c (process_quit_flag): New function.
3623 * lisp.h (QUIT): Use it.
3624
3625 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
3626
3627 * nsfns.m (get_geometry_from_preferences): New function.
3628 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
3629
3630 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
3631
3632 * emacs.c (Qkill_emacs): Define.
3633 (syms_of_emacs): Initialize it.
3634 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
3635 Qquit_flag to `kill-emacs' instead.
3636 (quit_throw_to_read_char): Add parameter `from_signal'.
3637 All callers changed. Call Fkill_emacs if requested and safe.
3638 * lisp.h (QUIT): Call Fkill_emacs if requested.
3639
3640 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
3641
3642 * widget.c (update_wm_hints): Return if wmshell is null.
3643 (widget_update_wm_size_hints): New function.
3644
3645 * widget.h (widget_update_wm_size_hints): Declare.
3646
3647 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
3648 widget_update_wm_size_hints (Bug#10104).
3649
3650 2011-12-03 Eli Zaretskii <eliz@gnu.org>
3651
3652 * xdisp.c (handle_invisible_prop): If the invisible text ends just
3653 before a newline, prepare the bidi iterator for consuming the
3654 newline, and keep the current paragraph direction. (Bug#10183)
3655 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
3656
3657 2011-12-02 Juri Linkov <juri@jurta.org>
3658
3659 * search.c (Fword_search_regexp): New Lisp function created from
3660 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
3661 (Fword_search_backward, Fword_search_forward)
3662 (Fword_search_backward_lax, Fword_search_forward_lax):
3663 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
3664 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
3665
3666 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
3667
3668 * fileio.c (Finsert_file_contents): Move after-change-function call
3669 to before the "handled:" label, since all "goto handled" appear in
3670 cases where the *-change-functions have already been properly called
3671 (bug#10117).
3672
3673 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
3674
3675 * keyboard.c (interrupt_signal): Don't call kill-emacs when
3676 waiting for input. (Bug#10169)
3677
3678 2011-11-30 Eli Zaretskii <eliz@gnu.org>
3679
3680 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
3681 verifies glyph row's hash code--we have just reallocated the
3682 glyphs, so their contents can be complete garbage. (Bug#10164)
3683
3684 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
3685
3686 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
3687
3688 2011-11-30 Eli Zaretskii <eliz@gnu.org>
3689
3690 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
3691 attributes are tested _before_ calling verify_row_hash, to protect
3692 against GCC re-ordering of the tests. (Bug#10164)
3693
3694 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
3695
3696 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
3697
3698 * xterm.c (handle_one_xevent): Only set async_visible and friends
3699 if net_wm_state_hidden_seen is non-zero (Bug#10002)
3700 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
3701 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
3702
3703 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
3704
3705 Remove GCPRO-related macros that exist only to avoid shadowing locals.
3706 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
3707 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
3708 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3709 All uses changed to use GCPRO1 etc.
3710 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
3711 Revert to old implementation (i.e., before 2011-03-11).
3712
3713 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3714
3715 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
3716 of scroll runs so as to avoid assigning disabled bogus rows and
3717 unnecessary graphics copy operations.
3718
3719 2011-11-27 Eli Zaretskii <eliz@gnu.org>
3720
3721 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
3722 (snprintf) [_MSC_VER]: Redirect to _snprintf.
3723 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
3724 (malloc, free, realloc, calloc): Redirect to e_* only when
3725 compiling Emacs.
3726
3727 * lisp.h (GCTYPEBITS): Move before first use.
3728 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
3729 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
3730 this macro definition.
3731
3732 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
3733 _MSC_VER.
3734
3735 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
3736
3737 * gtkutil.c (xg_create_frame_widgets):
3738 Call gtk_window_set_has_resize_grip (FALSE) if that function is
3739 present with Gtk+ 2.0.
3740
3741 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3742
3743 * fileio.c (Finsert_file_contents): Undo previous change; see
3744 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3745
3746 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3747
3748 Rename locals to avoid shadowing.
3749 * fileio.c (Finsert_file_contents):
3750 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
3751 * process.c (wait_reading_process_output):
3752 Rename inner 'proc' to 'p' to avoid shadowing.
3753 Indent for consistency with usual Emacs style.
3754
3755 2011-11-25 Eli Zaretskii <eliz@gnu.org>
3756
3757 * xdisp.c (redisplay_window): If cursor row is not fully visible
3758 after recentering, and scroll-conservatively is set to a large
3759 number, scroll window by a few more lines to make the cursor fully
3760 visible and out of scroll-margin. (Bug#10105)
3761 (start_display): Don't move to the next line if the display should
3762 start at a newline that is part of a display vector or an overlay
3763 string. (Bug#10119)
3764
3765 2011-11-24 Juri Linkov <juri@jurta.org>
3766
3767 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
3768 after the `MagickPingImage' call. (Bug#10112)
3769
3770 2011-11-23 Chong Yidong <cyd@gnu.org>
3771
3772 * window.c (Fcoordinates_in_window_p): Accept only live windows.
3773
3774 2011-11-23 Martin Rudalics <rudalics@gmx.at>
3775
3776 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
3777 making another buffer current. (Bug#10114)
3778
3779 2011-11-23 Glenn Morris <rgm@gnu.org>
3780
3781 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
3782
3783 2011-11-23 Chong Yidong <cyd@gnu.org>
3784
3785 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
3786 using it (Bug#5984).
3787
3788 2011-11-22 Eli Zaretskii <eliz@gnu.org>
3789
3790 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
3791 and header-lines, as they don't have one computed for them.
3792 (Bug#10098)
3793
3794 * .gdbinit (prow): Make displayed values more self-explaining.
3795 Add row's hash code.
3796
3797 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
3798
3799 * process.c (wait_reading_process_output): Fix asynchrounous
3800 GnuTLS socket handling on some versions of the GnuTLS library.
3801 (wait_reading_process_output): Add comment and URL.
3802
3803 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
3804
3805 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
3806
3807 2011-11-21 Chong Yidong <cyd@gnu.org>
3808
3809 * window.c (Fnext_window, Fprevious_window): Doc fix.
3810
3811 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3812
3813 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
3814
3815 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
3816
3817 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
3818
3819 2011-11-20 Martin Rudalics <rudalics@gmx.at>
3820
3821 * window.c (Fset_window_combination_limit): Rename argument
3822 STATUS to LIMIT.
3823 (Vwindow_combination_limit): Remove "status" from doc-string.
3824
3825 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
3826
3827 * m/ibms390.h: Remove.
3828 * m/ibms390x.h: Don't include "ibms390.h".
3829
3830 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3831
3832 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
3833 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
3834
3835 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
3836
3837 * casetab.c (Fset_case_table):
3838 * charset.c (Fcharset_after): Fix typos.
3839
3840 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
3841
3842 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
3843 Otherwise, valgrind does not work on some platforms.
3844 Problem reported by Andreas Schwab in
3845 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
3846 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
3847 is set, removing the need for VIRT_ADDRESS_VARIES.
3848 (PURE_P): Use a more-efficient implementation that needs just one
3849 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
3850 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
3851 to 4 (xorl, subq, cmpq, setbe).
3852 * alloc.c (pure): Always extern now, since that's the
3853 VIRT_ADDR_VARIES behavior.
3854 (PURE_POINTER_P): Use a single comparison, not two, for
3855 consistency with the new puresize.h.
3856 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
3857 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
3858 Remove VIRT_ADDR_VARIES no longer needed.
3859
3860 2011-11-19 Eli Zaretskii <eliz@gnu.org>
3861
3862 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
3863 (erase_phys_cursor, update_window_cursor, show_mouse_face)
3864 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
3865 behave as if the cursor position were at the window margin.
3866
3867 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
3868 and the cursor position is out of bounds, behave as if the cursor
3869 position were at the window margin. (Bug#10075)
3870
3871 2011-11-18 Chong Yidong <cyd@gnu.org>
3872
3873 * window.c (Fwindow_combination_limit): Make first argument
3874 non-optional, since it is meaningless for live windows like the
3875 selected window.
3876
3877 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
3878
3879 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
3880
3881 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
3882
3883 * intervals.c: Fix grafting over the whole buffer (bug#10071).
3884 (graft_intervals_into_buffer): Simplify.
3885
3886 2011-11-18 Eli Zaretskii <eliz@gnu.org>
3887
3888 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
3889 hash values of the two rows.
3890 (copy_row_except_pointers): Preserve the used[] arrays and the
3891 hash values of the two rows. (Bug#10035)
3892 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
3893
3894 * xdisp.c (row_hash): New function, body extracted from
3895 compute_line_metrics.
3896 (compute_line_metrics): Call row_hash, instead of computing the
3897 hash code inline.
3898
3899 * dispnew.c (verify_row_hash): Call row_hash for computing the
3900 hash code of a row, instead of duplicating code from xdisp.c.
3901
3902 * dispextern.h (row_hash): Add prototype.
3903
3904 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
3905
3906 * frame.c (delete_frame): Don't delete the terminal when the last
3907 X frame is closed if emacs is built with GTK toolkit.
3908
3909 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
3910
3911 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
3912
3913 2011-11-17 Martin Rudalics <rudalics@gmx.at>
3914
3915 * window.c (Vwindow_splits): Rename to
3916 Vwindow_combination_resize. Suggested by Juri Linkov.
3917 (Fsplit_window_internal): Use Vwindow_combination_resize instead
3918 of Vwindow_splits.
3919
3920 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
3921
3922 * nsfns.m (Fns_font_name):
3923 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
3924
3925 2011-11-16 Martin Rudalics <rudalics@gmx.at>
3926
3927 * window.h (window): Rename slot "nest" to "combination_limit".
3928 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
3929 (Fset_window_nest): Rename to Fset_window_combination_limit.
3930 (Vwindow_nest): Rename to Vwindow_combination_limit.
3931 (recombine_windows, make_parent_window, make_window)
3932 (Fsplit_window_internal, saved_window)
3933 (Fset_window_configuration, save_window_save): Rename all
3934 occurrences of window_nest to window_combination_limit.
3935
3936 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
3937
3938 * image.c (imagemagick_load_image): Fix typo.
3939
3940 2011-11-14 Eli Zaretskii <eliz@gnu.org>
3941
3942 * xdisp.c (display_line): Move the call to
3943 highlight_trailing_whitespace before the call to
3944 compute_line_metrics, since the latter needs to see the final
3945 faces of all the glyphs to compute ROW's hash value.
3946 Fixes assertion violations in row_equal_p. (Bug#10035)
3947
3948 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
3949
3950 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
3951 just return (bug#10044).
3952
3953 2011-11-12 Eli Zaretskii <eliz@gnu.org>
3954
3955 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
3956 with user-defined heap size. Bump the default size of the temacs
3957 heap to 27MB, to avoid memory warning when running temacs.
3958 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
3959
3960 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
3961 current_matrix and desired_matrix. (Bug#9990)
3962 (verify_row_hash) [XASSERTS]: New function.
3963 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
3964 that the hash value of glyph rows is correct.
3965
3966 2011-11-12 Martin Rudalics <rudalics@gmx.at>
3967
3968 * window.h (window): Remove splits slot.
3969 * window.c (Fwindow_splits, Fset_window_splits): Remove.
3970 (Fdelete_other_windows_internal, make_parent_window)
3971 (make_window, Fsplit_window_internal, Fdelete_window_internal)
3972 (Fset_window_configuration, save_window_save): Don't deal with
3973 split status of windows.
3974 (saved_window): Remove splits slot.
3975 (Vwindow_splits): Rewrite doc-string.
3976
3977 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
3978
3979 * xfns.c (unwind_create_frame):
3980 * nsfns.m (unwind_create_frame):
3981 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
3982 Vframe_list (Bug#9999).
3983
3984 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
3985
3986 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
3987
3988 2011-11-11 Kenichi Handa <handa@m17n.org>
3989
3990 * callproc.c (Fcall_process): Set the member dst_multibyte of
3991 process_coding.
3992
3993 2011-11-11 Johan Bockgård <bojohan@gnu.org>
3994
3995 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
3996 avoid a crash (bug#9496).
3997
3998 2011-11-09 Chong Yidong <cyd@gnu.org>
3999
4000 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4001 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
4002
4003 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4004
4005 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
4006
4007 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
4008
4009 Avoid some portability problems by eschewing 'extern inline' functions.
4010 The trivial performance wins aren't worth the portability hassles; see
4011 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
4012 et seq.
4013 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4014 (window_box_width, window_box_left, window_box_left_offset)
4015 (window_box_right, window_box_right_offset): Undo previous change,
4016 by removing the "extern"s.
4017 * intervals.c (adjust_intervals_for_insertion)
4018 (adjust_intervals_for_deletion): Undo previous change,
4019 making these static again.
4020 (offset_intervals, temp_set_point_both, temp_set_point)
4021 (copy_intervals_to_string): No longer inline.
4022 * xdisp.c (window_text_bottom_y, window_box_width)
4023 (window_box_height, window_box_left_offset)
4024 (window_box_right_offset, window_box_left, window_box_right)
4025 (window_box): No longer inline.
4026
4027 2011-11-08 Chong Yidong <cyd@gnu.org>
4028
4029 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
4030 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
4031 Signal an error if not a live window.
4032 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
4033 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
4034
4035 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
4036
4037 * lisp.h (syms_of_abbrev): Remove declaration.
4038 Reported by CHENG Gao <chenggao@royau.me>.
4039
4040 2011-11-07 Eli Zaretskii <eliz@gnu.org>
4041
4042 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
4043 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
4044 of temacs in GUI mode.
4045
4046 2011-11-07 Martin Rudalics <rudalics@gmx.at>
4047
4048 * window.h: Declare delete_all_child_windows instead of
4049 delete_all_subwindows.
4050 * window.c (Fwindow_nest, Fset_window_nest)
4051 (Fset_window_new_total, Fset_window_new_normal)
4052 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
4053 (delete_all_subwindows): Rename to delete_all_child_windows.
4054 (Fdelete_other_windows_internal, Fset_window_configuration):
4055 Call delete_all_child_windows instead of delete_all_subwindows.
4056 * frame.c (delete_frame): Call delete_all_child_windows instead
4057 of delete_all_subwindows.
4058
4059 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
4060
4061 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
4062 This is also needed for porting to any host where GC_MARK_STACK is
4063 not GC_MAKE_GCPROS_NOOPS.
4064 (which_symbols): Use it.
4065
4066 2011-11-07 Kenichi Handa <handa@m17n.org>
4067
4068 * coding.c (coding_set_destination): Check coding->src_pos only
4069 when coding->src_object is a buffer (bug#9910).
4070
4071 * process.c (send_process): Set the member src_multibyte of coding
4072 to 0 (bug#9911) when sending a unibyte text.
4073
4074 * callproc.c (Fcall_process): Set the member src_multibyte of
4075 process_coding to 0 (bug#9912).
4076
4077 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4078
4079 * xmenu.c (cleanup_widget_value_tree): New function.
4080 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
4081 calling free_menubar_widget_value_tree directly (Bug#9830).
4082
4083 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
4084
4085 Fix some portability problems with 'inline'.
4086 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4087 (window_box_width, window_box_left, window_box_left_offset)
4088 (window_box_right, window_box_right_offset): Declare extern.
4089 Otherwise, these inline functions do not conform to C99 and
4090 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
4091 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
4092 * intervals.c (adjust_intervals_for_insertion)
4093 (adjust_intervals_for_deletion): Now extern, because otherwise the
4094 extern inline functions 'offset_intervals' couldn't refer to it.
4095 (static_offset_intervals): Remove.
4096 (offset_intervals): Rewrite using the old contents of
4097 static_offset_intervals. The old version didn't conform to C99
4098 because an extern inline function contained a reference to an
4099 identifier with static linkage.
4100
4101 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
4102
4103 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
4104 GC.
4105
4106 2011-11-06 Eli Zaretskii <eliz@gnu.org>
4107
4108 * xdisp.c (init_iterator, reseat_to_string): Don't set the
4109 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
4110 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
4111 return Qleft_to_right.
4112
4113 2011-11-06 Chong Yidong <cyd@gnu.org>
4114
4115 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
4116 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
4117 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
4118 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
4119 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
4120 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
4121 (Fwindow_vscroll): Doc fix.
4122 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
4123 argument, since it makes no sense to pass a live window and for
4124 consistency with window-child.
4125
4126 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
4127
4128 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
4129 support MSVC.
4130
4131 2011-11-05 Jason Rumney <jasonr@gnu.org>
4132
4133 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
4134 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
4135 fonts (Bug#6029).
4136 (add_font_entity_to_list): Fix logic errors in mixed boolean and
4137 bitwise arithmetic preventing use of unicode-sip and non-truetype
4138 opentype fonts.
4139
4140 2011-11-05 Eli Zaretskii <eliz@gnu.org>
4141
4142 * s/ms-w32.h (fstat, stat, utime): Move redirections to
4143 "emacs"-only part.
4144
4145 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
4146 initialization code to keep similarity to xfns.c after changes
4147 from 2011-11-05.
4148
4149 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
4150
4151 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
4152 (unwind_create_frame): New function (Bug#9943).
4153 (Fx_create_frame): Restructure code to be more similar to the one in
4154 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
4155 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
4156 Move terminal->reference_count++ just before making the frame official
4157 (Bug#9943).
4158
4159 * nsterm.m (x_free_frame_resources): New function.
4160 (x_destroy_window): Move code to x_free_frame_resources.
4161
4162 * xfns.c (unwind_create_frame): Fix comment.
4163 (Fx_create_frame, x_create_tip_frame):
4164 Move terminal->reference_count++ just before making the frame
4165 official. Move initialization of image_cache_refcount and
4166 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
4167
4168 2011-11-05 Eli Zaretskii <eliz@gnu.org>
4169
4170 Support MSVC build with newer versions of Visual Studio.
4171 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
4172 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
4173 nt/gmake.defs.
4174
4175 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
4176 which are not supported by MSVC.
4177 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
4178 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
4179 bitfields.
4180 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
4181 types in bitfields.
4182 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
4183
4184 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
4185
4186 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
4187
4188 Support MSVC build with newer versions of Visual Studio.
4189 * w32.c: Don't include w32api.h for MSVC.
4190 (init_environment) [_MSC_VER]: Call sys_access, not _access.
4191
4192 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
4193 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
4194 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
4195 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
4196 e_* cousins.
4197 (alloca) [_MSC_VER]: Define to _alloca.
4198
4199 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
4200
4201 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
4202
4203 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4204
4205 * xdisp.c (note_mouse_highlight): If either of
4206 previous/next-single-property-change returns nil, treat that as
4207 the beginning or the end of the buffer. (Bug#9955)
4208
4209 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
4210
4211 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
4212 label is not null (Bug#9951).
4213 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
4214 may be NULL.
4215
4216 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4217
4218 * window.c (Fwindow_body_size): Mention in the doc string that the
4219 return value is in frame's canonical units. (Bug#9949)
4220
4221 2011-11-03 Eli Zaretskii <eliz@gnu.org>
4222
4223 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
4224
4225 * w32fns.c (unwind_create_frame): If needed, free the glyph
4226 matrices of the partially constructed frame. (Bug#9943)
4227 * xfns.c (unwind_create_frame): Likewise.
4228
4229 2011-11-01 Eli Zaretskii <eliz@gnu.org>
4230
4231 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
4232 Don't stop backward scan on the continuation glyph, even though
4233 its CHARPOS is positive.
4234 (mouse_face_from_buffer_pos, note_mouse_highlight):
4235 Rename cover_string to disp_string.
4236
4237 2011-11-01 Martin Rudalics <rudalics@gmx.at>
4238
4239 * window.c (temp_output_buffer_show): Don't use
4240 Vtemp_buffer_show_specifiers.
4241 (Vtemp_buffer_show_specifiers): Remove unused variable.
4242
4243 2011-10-30 Eli Zaretskii <eliz@gnu.org>
4244
4245 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
4246 past the beginning of the current glyph matrix.
4247
4248 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
4249
4250 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
4251 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
4252 HAVE_GTK3 (Bug#9869).
4253
4254 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
4255 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
4256
4257 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
4258
4259 * xterm.c: Declare x_handle_net_wm_state to return int.
4260 (handle_one_xevent): Check if we are iconified but don't have
4261 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
4262 (get_current_wm_state): Return non-zero if not hidden,
4263 check for _NET_WM_STATE_HIDDEN (Bug#9893).
4264 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
4265 (x_handle_net_wm_state): Return what get_current_wm_state returns.
4266 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
4267
4268 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
4269
4270 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
4271 so that this new function doesn't get optimized away by a
4272 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
4273
4274 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4275
4276 * frame.h (MOUSE_HL_INFO): Remove excess parens.
4277
4278 2011-10-29 Eli Zaretskii <eliz@gnu.org>
4279
4280 Fix the `xbytecode' command.
4281 * .gdbinit (xprintbytestr): New command.
4282 (xwhichsymbols): Rename from `which'; all callers changed.
4283 (xbytecode): Print the byte-code string as well.
4284
4285 2011-10-29 Kim Storm <storm@cua.dk>
4286
4287 * alloc.c (which_symbols): New function.
4288
4289 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4290
4291 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
4292 line. (Bug#9903)
4293
4294 2011-10-29 Glenn Morris <rgm@gnu.org>
4295
4296 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
4297 Not clear what it was for, and it causes various bugs. (Bug#9839)
4298
4299 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4300
4301 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4302 possible random value that matches one of those tested as
4303 condition to clear the mouse face.
4304
4305 2011-10-28 Chong Yidong <cyd@gnu.org>
4306
4307 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
4308
4309 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
4310
4311 * window.c (make_window): Initialize phys_cursor_on_p.
4312
4313 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4314
4315 * lisp.h (struct Lisp_Symbol): Update comments.
4316
4317 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
4318
4319 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
4320
4321 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4322
4323 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
4324 <oslsachem@gmail.com> for helping to debug this.
4325
4326 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
4327 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
4328 (g_b_init_get_glyph_outline_w): New static variables.
4329 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
4330 (GetGlyphOutlineW_Proc): New typedefs.
4331 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
4332 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
4333 New functions.
4334 (w32font_open_internal, compute_metrics):
4335 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
4336 instead of calling the "wide" APIs directly.
4337
4338 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
4339
4340 * w32.h (syms_of_w32font): Add prototype.
4341
4342 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
4343
4344 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
4345 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
4346 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
4347 (Fmove_to_window_line): Doc fix.
4348
4349 2011-10-27 Chong Yidong <cyd@gnu.org>
4350
4351 * process.c (make_process): Set gnutls_state to NULL.
4352
4353 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
4354 non-NULL, regardless of GNUTLS_INITSTAGE.
4355 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
4356 an error. Set process slots as soon as we allocate them.
4357
4358 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
4359
4360 2011-10-27 Chong Yidong <cyd@gnu.org>
4361
4362 * gnutls.c (emacs_gnutls_deinit): New function.
4363 Deallocate credentials structures as well as calling gnutls_deinit.
4364 (Fgnutls_deinit, Fgnutls_boot): Use it.
4365
4366 * process.c (make_process): Initialize GnuTLS credentials to NULL.
4367 (deactivate_process): Call emacs_gnutls_deinit.
4368
4369 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
4370
4371 * image.c (x_create_x_image_and_pixmap):
4372 * w32.c (sys_rename, w32_delayed_load):
4373 * w32font.c (fill_in_logfont):
4374 * w32reg.c (x_get_string_resource): Silence compiler warnings.
4375
4376 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
4377
4378 * w32fns.c (w32_default_color_map): New function,
4379 extracted from Fw32_default_color_map.
4380 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
4381
4382 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
4383
4384 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
4385
4386 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
4387
4388 * keyboard.c (test_undefined): New function (bug#9751).
4389 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
4390
4391 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
4392
4393 * sysdep.c (init_sys_modes): Fix the check for the controlling
4394 terminal (Bug#6649).
4395
4396 2011-10-20 Eli Zaretskii <eliz@gnu.org>
4397
4398 * dispextern.h (struct bidi_it): New member next_en_type.
4399
4400 * bidi.c (bidi_line_init): Initialize the next_en_type member.
4401 (bidi_resolve_explicit_1): When next_en_pos is valid for the
4402 current character, check also for next_en_type being WEAK_EN.
4403 (bidi_resolve_weak): Don't enter the expensive loop if the current
4404 position is before next_en_pos. Record the bidi type of the first
4405 non-ET, non-BN character we find, in addition to its position.
4406 (bidi_level_of_next_char): Invalidate next_en_type when
4407 next_en_pos is over-stepped.
4408
4409 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
4410
4411 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
4412 * editfns.c: Rewrite current-time-zone so that it invokes
4413 the equivalent of (format-time-string "%Z") to get the time zone name.
4414 This fixes a bug when the time zone name contains characters that
4415 need converting from the system time locale to Emacs internal format.
4416 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
4417 that patch fixed format-time-string to do the conversion, but
4418 I forgot to fix current-time-zone.
4419 (format_time_string): New function, containing most of
4420 what Fformat_time_string used to contain.
4421 (Fformat_time_string): Rewrite in terms of format_time_string.
4422 This doesn't change this function's behavior.
4423 (current-time-zone): Rewrite to use format_time_string.
4424 This fixes the bug reported by Michael Schierl in
4425 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
4426 Jason Rumney's 2007-06-07 change worked around this bug, but
4427 didn't fix it.
4428 * systime.h (tzname, timezone): Remove no-longer-used declarations.
4429
4430 2011-10-19 Eli Zaretskii <eliz@gnu.org>
4431
4432 * xdisp.c (start_display): If the character at POS is displayed
4433 via a display vector, reset IT->current.dpvec_index to zero.
4434 (try_window_reusing_current_matrix): If a line ends in a display
4435 vector or the next line starts in a display vector, continue
4436 redrawing the window even though the character position of
4437 start_row was reached.
4438 (Bug#9771, part 2)
4439
4440 2011-10-18 Chong Yidong <cyd@gnu.org>
4441
4442 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
4443 with nobreak-char-display too.
4444
4445 2011-10-18 Eli Zaretskii <eliz@gnu.org>
4446
4447 Fix part 3 of bug#9771.
4448 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
4449 (bidi_resolve_neutral): Don't enter the expensive loop looking for
4450 non-neutral characters if the current character is a paragraph
4451 separator (a.k.a. Newline). This avoids running the same
4452 expensive loop twice, once when we consume the preceding newline
4453 and the other time when the line actually needs to be displayed.
4454 Avoid the loop when we see neutrals on the base embedding level
4455 following a character whose directionality is the same as the
4456 paragraph's. This avoids running the expensive loop when a line
4457 ends in a long sequence of neutrals, like control characters.
4458 Add assertion against STRONG_AL type. Slightly rearrange code
4459 that determines the type of a neutral given the first non-neutral
4460 that follows it.
4461 (bidi_level_of_next_char): Set next_en_pos to zero when
4462 invalidating its info.
4463
4464 2011-10-17 Eli Zaretskii <eliz@gnu.org>
4465
4466 * xdisp.c (push_display_prop): Determine whether to record string
4467 or buffer position by IT->string, not by IT->method. Allow
4468 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
4469 (move_it_vertically_backward): Don't look for character position
4470 immediately after the newline when in a continuation line.
4471 (Bug#9771, part 1)
4472
4473 2011-10-15 Martin Rudalics <rudalics@gmx.at>
4474
4475 * window.c (coordinates_in_window): Rewrite and delabelize
4476 vertical border check. (Bug#5357) (Bug#9618)
4477
4478 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
4479
4480 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
4481 errors in XSetWindowBorder (bug#9310).
4482
4483 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
4484
4485 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
4486 avoid crash when xmalloc overrun checking is enabled.
4487
4488 2011-10-13 Eli Zaretskii <eliz@gnu.org>
4489
4490 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
4491 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
4492 cursor motion with <left> and <right> arrow keys.
4493
4494 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
4495 some callers set that themselves.
4496
4497 2011-10-12 Eli Zaretskii <eliz@gnu.org>
4498
4499 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
4500 display string and the previous row comes from the same string and
4501 is empty. (Bug#9739) (Bug#9738)
4502
4503 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4504
4505 * doc.c (get_doc_string): Encode file name (bug#9735).
4506
4507 2011-10-12 Eli Zaretskii <eliz@gnu.org>
4508
4509 * bidi.c (bidi_level_of_next_char):
4510 * xdisp.c (get_visually_first_element): Remove old incorrect
4511 comments regarding the Unicode Line Separator character.
4512
4513 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
4514
4515 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
4516
4517 * alloc.c (Fgc_status): Do not access beyond zombies array
4518 boundary if nzombies > MAX_ZOMBIES.
4519 * alloc.c (dump_zombies): Add missing format specifier.
4520
4521 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
4522
4523 * xdisp.c (set_cursor_from_row): Simplify conditionals,
4524 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
4525
4526 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
4527 Some packages use them to denote characters with modifiers.
4528
4529 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
4530
4531 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
4532 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
4533 matching a pp-number. Rename parameter var to var1.
4534
4535 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4536
4537 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
4538
4539 2011-10-08 Glenn Morris <rgm@gnu.org>
4540
4541 * callint.c (Fcall_interactively): Give a more explicit error for the
4542 'c' case with a non-character input. (Bug#8479)
4543
4544 2011-10-08 Eli Zaretskii <eliz@gnu.org>
4545
4546 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
4547 lines.
4548 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
4549 lines that are hscrolled on the left.
4550
4551 * dispnew.c (buffer_posn_from_coords): Account for a possible
4552 presence of header-line. (Bug#4426)
4553
4554 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
4555
4556 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
4557 Don't advertise functionality which we discourage or doesn't work.
4558
4559 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
4560
4561 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
4562 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
4563 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
4564 this makes Emacs dump core during garbage collection on rare
4565 occasions. sizeof is obviously inferior to offsetof here, so
4566 stick with offsetof.
4567 (GC_POINTER_ALIGNMENT): New macro.
4568 (mark_memory): Omit 3rd (offset) arg; caller changed.
4569 Don't assume EMACS_INT alignment is the same as pointer alignment.
4570
4571 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
4572
4573 * keyboard.c (read_key_sequence_remapped): New var.
4574 (read_key_sequence): Compute remapping in the right buffer.
4575 (command_loop_1): Use read_key_sequence's remapping directly.
4576
4577 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4578
4579 * dired.c (file_name_completion): Don't expand file name.
4580 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
4581 before checking file name handler.
4582
4583 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
4584 they've been requested explicitly (bug#9591).
4585
4586 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
4587
4588 * keymap.c (Fsingle_key_description): Use make_specified_string
4589 instead of build_string to build string from push_key_description.
4590 (Bug#5193)
4591
4592 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4593
4594 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
4595 This fixes a Y2038 bug on 64-bit hosts.
4596 * buffer.c (reset_buffer):
4597 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
4598 (Fclear_buffer_auto_save_failure):
4599 Use 0, not -1, to represent an unset failure time, since time_t
4600 might not be signed.
4601
4602 Remove dependency on glibc malloc internals.
4603 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4604 Move back here from lisp.h, but with their new implementations.
4605 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4606 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
4607 * charset.c (charset_table_init): New static var.
4608 (syms_of_charset): Use it instead of xmalloc. This removes a
4609 dependency on glibc malloc internals. See Eli Zaretskii's comment in
4610 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
4611 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4612 Move back to alloc.c.
4613 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4614 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
4615
4616 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
4617
4618 * nsterm.m (windowDidResize): Call x_set_window_size only when
4619 ns_in_resize is true. Otherwise set pixelwidth/height and
4620 call change_frame_size (Bug#9628).
4621
4622 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4623
4624 Port --enable-checking=all to Fedora 14 x86-64.
4625 * charset.c (syms_of_charset): Also account for glibc malloc's
4626 internal overhead when calculating the initial malloc maximum.
4627
4628 Port --enable-checking=all to Fedora 14 x86.
4629 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4630 Move to lisp.h.
4631 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
4632 (overrun_check_realloc, overrun_check_free):
4633 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
4634 That way, xmalloc returns a properly-aligned pointer even if
4635 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
4636 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
4637 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
4638 into account when calculating the initial malloc maximum.
4639 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4640 Move here from alloc.c, so that charset.c can use it too.
4641 Properly align; the old code wasn't right for common 32-bit hosts
4642 when configured with --enable-checking=all.
4643 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4644 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
4645
4646 2011-09-29 Eli Zaretskii <eliz@gnu.org>
4647
4648 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
4649 use EDOM.
4650
4651 2011-09-28 Eli Zaretskii <eliz@gnu.org>
4652
4653 * xdisp.c (compute_display_string_end): If there's no display
4654 string at CHARPOS, return -1.
4655
4656 * bidi.c (bidi_fetch_char): When compute_display_string_end
4657 returns a negative value, treat the character as a normal
4658 character not covered by a display string. (Bug#9624)
4659
4660 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
4661
4662 * lread.c (Fread_from_string): Fix typo in docstring.
4663
4664 2011-09-27 Eli Zaretskii <eliz@gnu.org>
4665
4666 * xdisp.c (handle_invisible_prop): If invisible text ends on a
4667 newline, reseat the iterator instead of bidi-iterating there one
4668 character at a time. (Bug#9610)
4669 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
4670 TO_CHARPOS if the bidi iterator is at base embedding level.
4671
4672 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
4673
4674 * lread.c (readevalloop): Use correct code for NBSP.
4675 (read1): Likewise. (Bug#9608)
4676
4677 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
4678
4679 * dbusbind.c (Fdbus_register_signal): When service is not
4680 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
4681
4682 2011-09-25 Glenn Morris <rgm@gnu.org>
4683
4684 * buffer.c (truncate-lines): Doc fix.
4685
4686 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
4687
4688 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
4689 (Fset_window_next_buffers): Doc fix.
4690
4691 2011-09-24 Glenn Morris <rgm@gnu.org>
4692
4693 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
4694
4695 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
4696
4697 Fix minor problems found by static checking.
4698 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
4699 * indent.c (Fvertical_motion): Fix == vs = typo.
4700
4701 2011-09-24 Eli Zaretskii <eliz@gnu.org>
4702
4703 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
4704 Default value is now t. Doc fix.
4705
4706 * indent.c (Fvertical_motion): Compute and apply the overshoot
4707 logic when moving up, not only when moving down. Fix the
4708 confusing name and values of the it_overshoot_expected variable;
4709 logic changes accordingly. (Bug#9254) (Bug#9549)
4710
4711 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
4712 CHARPOS is covered by a display string which includes newlines.
4713 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
4714 is covered by a display string with embedded newlines.
4715
4716 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
4717
4718 * dbusbind.c (Fdbus_register_signal): Add match rule to
4719 Vdbus_registered_objects_table. (Bug#9581)
4720 (Fdbus_register_method, Vdbus_registered_objects_table):
4721 Fix docstring.
4722
4723 2011-09-24 Jim Meyering <meyering@redhat.com>
4724
4725 do not ignore write error for any output size
4726 The previous change was incomplete.
4727 While it makes emacs --batch detect the vast majority of stdout
4728 write failures, errors were still ignored whenever the output size is
4729 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
4730 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
4731 && echo FAIL: ignored write error
4732 FAIL: ignored write error
4733 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
4734 && echo FAIL: ignored write error
4735 FAIL: ignored write error
4736 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
4737
4738 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
4739
4740 * emacs.c (Fkill_emacs): In noninteractive mode exit
4741 non-successfully if a write error occurred on stdout. (Bug#9574)
4742
4743 2011-09-21 Eli Zaretskii <eliz@gnu.org>
4744
4745 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
4746 the xassert test.
4747
4748 * dispextern.h (struct it): Update the comment documenting what
4749 can it->OBJECT be.
4750
4751 2011-09-20 Eli Zaretskii <eliz@gnu.org>
4752
4753 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
4754 a display string, extend search for cursor position to end of row.
4755 (find_row_edges): If the row ends in a newline from a display
4756 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
4757 Handle the case of a display string with multiple newlines.
4758 (Fcurrent_bidi_paragraph_direction): Fix search for previous
4759 non-empty line. Fixes confusing cursor motion with arrow keys at
4760 the beginning of a line that starts with whitespace.
4761
4762 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4763
4764 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
4765 (bug#9493).
4766
4767 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
4768
4769 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
4770 boolean (Bug#9154).
4771
4772 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4773
4774 * xdisp.c (display_line): Record maximum and minimum buffer
4775 positions even if no glyphs were produced (e.g., by a zero-width
4776 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
4777 buffer positions that will be removed from the glyph row because
4778 they don't fit.
4779 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
4780 column is beyond frame width: don't subtract 1 "pixel" when
4781 computing width of the stretch.
4782 (reseat_at_next_visible_line_start): Undo the change made on
4783 2011-09-17 that saved paragraph information and restored it after
4784 the call to `reseat'. (Bug#9545)
4785
4786 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4787
4788 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
4789 and turn window cursor on if cleared (Bug#9415).
4790
4791 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
4792
4793 * search.c (boyer_moore): Take unibyte characters from pattern
4794 literally. (Bug#9458)
4795
4796 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4797
4798 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
4799
4800 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
4801
4802 Fix minor problem found by static checking.
4803 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
4804 initialized, to pacify gcc -Wuninitialized.
4805
4806 * fileio.c: Report proper errno when syscall falls.
4807 (Finsert_file_contents): Save and restore errno,
4808 so that report_file_error outputs the correct diagnostic.
4809 (Fwrite_region) [CLASH_DETECTION]: Likewise.
4810
4811 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4812
4813 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
4814
4815 2011-09-17 Eli Zaretskii <eliz@gnu.org>
4816
4817 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
4818 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
4819
4820 2011-09-17 Eli Zaretskii <eliz@gnu.org>
4821
4822 * xdisp.c (reseat_at_next_visible_line_start): Keep information
4823 about the current paragraph and restore it after the call to reseat.
4824
4825 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
4826 (bidi_find_paragraph_start): Search back for paragraph beginning
4827 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
4828 (bidi_move_to_visually_next): Only trigger paragraph-related
4829 computations when the last character is a newline or at EOB, not
4830 just any NEUTRAL_B. (Bug#9470)
4831
4832 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
4833 truncated lines if point is covered by a display string. (Bug#9524)
4834
4835 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
4836
4837 * xselect.c: Relax test for outgoing X longs (Bug#9498).
4838 (cons_to_x_long): New function.
4839 (lisp_data_to_selection_data): Use it. Correct the test for
4840 short-versus-long data; it was negated. Break out of vector
4841 loop, for efficiency, when a long datum is discovered.
4842
4843 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
4844
4845 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
4846
4847 2011-09-16 Eli Zaretskii <eliz@gnu.org>
4848
4849 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
4850 GCC PR/17406) by declaring this function with external scope.
4851
4852 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4853
4854 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
4855 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
4856
4857 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
4858
4859 * editfns.c (Fformat): Correctly handle text properties on "%%".
4860
4861 2011-09-15 Eli Zaretskii <eliz@gnu.org>
4862
4863 * xterm.c (x_draw_composite_glyph_string_foreground):
4864 * w32term.c (x_draw_composite_glyph_string_foreground):
4865 * term.c (encode_terminal_code):
4866 * composite.c (composition_update_it, get_composition_id):
4867 * xdisp.c (get_next_display_element)
4868 (fill_composite_glyph_string): Add comments about special meaning
4869 of TAB characters in a composition.
4870
4871 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4872
4873 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4874 This occurs when processing a multibyte format.
4875 Problem reported by Wolfgang Jenker.
4876
4877 2011-09-15 Johan Bockgård <bojohan@gnu.org>
4878
4879 * xdisp.c (try_cursor_movement): Only check for exact match if
4880 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
4881
4882 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4883
4884 Remove unused external symbols.
4885 * dispextern.h (calc_pixel_width_or_height): Remove decl.
4886 * xdisp.c (calc_pixel_width_or_height): Now static.
4887 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
4888 * indent.c (check_display_width):
4889 * w32term.c: Fix comment to match code.
4890 * xterm.c, xterm.h (x_catching_errors): Remove.
4891
4892 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4893
4894 * xselect.c: Use signed conversions more consistently (Bug#9498).
4895 (selection_data_to_lisp_data): Assume incoming selection data are
4896 signed integers, not unsigned. This is to be consistent with
4897 outgoing selection data, which was modified to use signed integers
4898 in as part of the fix to Bug#9196 in response to Jan D.'s comment
4899 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
4900 expects long, not unsigned long.
4901
4902 2011-09-14 Eli Zaretskii <eliz@gnu.org>
4903
4904 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
4905 computation of loop end. Reported by Johan Bockgård
4906 <bojohan@gnu.org>.
4907
4908 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
4909
4910 * frame.c (Fother_visible_frames_p): Function deleted.
4911
4912 2011-09-12 Eli Zaretskii <eliz@gnu.org>
4913
4914 * indent.c (compute_motion): Process display vector front to back
4915 rather than the other way around. (Bug#2496)
4916
4917 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4918
4919 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
4920
4921 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
4922
4923 * minibuf.c (Fread_from_minibuffer): Doc fix.
4924
4925 2011-09-11 Eli Zaretskii <eliz@gnu.org>
4926
4927 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
4928 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
4929
4930 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4931
4932 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
4933 value for non-existent files.
4934
4935 2011-09-11 Eli Zaretskii <eliz@gnu.org>
4936
4937 * fileio.c (Finsert_file_contents): If the file cannot be opened,
4938 set its "size" to -1. This will set the modtime_size field of
4939 the corresponding buffer to -1, which is what
4940 verify-visited-file-modtime expects for files that do not exist.
4941 (Bug#9139)
4942
4943 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
4946 here ...
4947 * lisp.h: ... from here. push_key_description is no longer
4948 defined in keyboard.c, so its declaration should not be in
4949 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
4950 logically belongs with push_key_description.
4951
4952 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
4953
4954 * buffer.h: Include <sys/types.h> instead of <time.h>.
4955 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
4956 Problem reported by Herbert J. Skuhra.
4957
4958 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
4959
4960 * xml.c (parse_region): Make the parsing work for
4961 non-comment-starting XML files again (bug#9144).
4962
4963 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
4964
4965 * image.c (gif_load): Fix calculation of bottom and right corner.
4966 (Bug#9468)
4967
4968 2011-09-10 Eli Zaretskii <eliz@gnu.org>
4969
4970 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
4971 redisplay in small windows.
4972
4973 2011-09-09 Eli Zaretskii <eliz@gnu.org>
4974
4975 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
4976
4977 2011-09-08 Martin Rudalics <rudalics@gmx.at>
4978
4979 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
4980 Operate on live windows only.
4981
4982 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
4983
4984 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
4985
4986 2011-09-07 Eli Zaretskii <eliz@gnu.org>
4987
4988 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
4989 only under bidi iteration.
4990
4991 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
4992
4993 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
4994
4995 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
4996
4997 isnan: Fix porting problem to Solaris 10 with bundled gcc.
4998 Without this fix, the command to link temacs failed due to an
4999 undefined symbol __builtin_isnan. This is because
5000 /usr/include/iso/math_c99.h #defines isnan(x) to
5001 __builtin_isnan(x), but the bundled gcc, which identifies itself
5002 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
5003 a __builtin_isnan.
5004 * floatfns.c (isnan): #undef, and then #define to a clone of
5005 what's in data.c.
5006 (Fisnan): Always define, since it's always available now.
5007 (syms_of_floatfns): Always define isnan at the Lisp level.
5008
5009 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5010
5011 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
5012
5013 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
5014
5015 * fileio.c: Fix bugs with large file offsets (Bug#9428).
5016 The previous code assumed that file offsets (off_t values) fit in
5017 EMACS_INT variables, which is not true on typical 32-bit hosts.
5018 The code messed up by falsely reporting buffer overflow in cases
5019 such as (insert-file-contents "big" nil 1 2) into an empty buffer
5020 when "big" contains more than 2**29 bytes, even though this
5021 inserts just one byte and does not overflow the buffer.
5022 (Finsert_file_contents): Store file offsets as off_t
5023 values, not as EMACS_INT values. Check for overflow when
5024 converting between EMACS_INT and off_t. When checking for
5025 buffer overflow or for overlap, take the offsets into account.
5026 Don't use EMACS_INT for small values where int suffices.
5027 When checking for overlap, fix a typo: ZV was used where
5028 ZV_BYTE was intended.
5029 (Fwrite_region): Don't assume off_t fits into 'long'.
5030 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
5031
5032 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
5033
5034 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
5035
5036 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5037
5038 sprintf-related integer and memory overflow issues (Bug#9412).
5039
5040 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
5041 (esprintf, exprintf, evxprintf): New functions.
5042 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
5043 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
5044 (modify_event_symbol): Do not assume that the length of
5045 name_alist_or_stem is safe to alloca and fits in int.
5046 (Fexecute_extended_command): Likewise for function name and binding.
5047 (Frecursion_depth): Wrap around reliably on integer overflow.
5048 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
5049 since some callers pass EMACS_INT values.
5050 (Fsingle_key_description): Don't crash if symbol name contains more
5051 than MAX_ALLOCA bytes.
5052 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
5053 (get_minibuffer): Arg is now EMACS_INT, not int.
5054 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
5055 (esprintf, exprintf, evxprintf): New decls.
5056 * window.h (command_loop_level, minibuf_level): Reflect API changes.
5057
5058 * dbusbind.c (signature_cat): New function.
5059 (xd_signature, Fdbus_register_signal):
5060 Do not overrun buffer; instead, report string overflow.
5061
5062 * dispnew.c (add_window_display_history): Don't overrun buffer.
5063 Truncate instead; this is OK since it's just a log.
5064
5065 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
5066 even if the time zone offset is outlandishly large.
5067 Don't mishandle offset == INT_MIN.
5068
5069 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
5070 when creating daemon; the previous buffer-overflow check was incorrect.
5071
5072 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
5073 which has the guts of the old verror function.
5074
5075 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
5076 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
5077
5078 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
5079 (font_unparse_xlfd): Don't blindly alloca long strings.
5080 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
5081 fits in int, when using sprintf. Use single snprintf to count
5082 length of string rather than counting it via multiple sprintfs;
5083 that's simpler and more reliable.
5084 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
5085 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
5086 sprintf, in case result does not fit in int.
5087
5088 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
5089 (fontset_from_font): Print it.
5090
5091 * frame.c (tty_frame_count): Now printmax_t, not int.
5092 (make_terminal_frame, set_term_frame_name): Print it.
5093 (x_report_frame_params): In X, window IDs are unsigned long,
5094 not signed long, so print them as unsigned.
5095 (validate_x_resource_name): Check for implausibly long names,
5096 and don't assume name length fits in 'int'.
5097 (x_get_resource_string): Don't blindly alloca invocation name;
5098 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
5099 not fit in int.
5100
5101 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
5102 (xg_check_special_colors, xg_set_geometry):
5103 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
5104
5105 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
5106 Use esprintf, not sprintf, in case result does not fit in int.
5107
5108 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5109 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
5110 it as a large positive number.
5111 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
5112 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5113
5114 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
5115 in case result does not fit in int.
5116
5117 * print.c (float_to_string): Detect width overflow more reliably.
5118 (print_object): Make sprintf buffer a bit bigger, to avoid potential
5119 buffer overrun. Don't assume list length fits in 'int'. Treat
5120 print length of 0 as 0, not as infinity; to be consistent with other
5121 uses of print length in this function. Don't overflow print length
5122 index. Don't assume hash table size fits in 'long', or that
5123 vectorlike size fits in 'unsigned long'.
5124
5125 * process.c (make_process): Use printmax_t, not int, to format
5126 process-name gensyms.
5127
5128 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
5129
5130 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
5131 to avoid potential buffer overrun.
5132
5133 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
5134 if X resource line is longer than 512 bytes.
5135
5136 * xfns.c (x_window): Make sprintf buffer a bit bigger
5137 to avoid potential buffer overrun.
5138
5139 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
5140
5141 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
5142
5143 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5144
5145 Integer overflow fixes for scrolling, etc.
5146 Without these, Emacs silently mishandles large integers sometimes.
5147 For example, "C-u 4294967297 M-x recenter" was treated as if
5148 it were "C-u 1 M-x recenter" on a typical 64-bit host.
5149
5150 * xdisp.c (try_window_id): Check Emacs fixnum range before
5151 converting to 'int'.
5152
5153 * window.c (window_scroll_line_based, Frecenter):
5154 Check that an Emacs fixnum is in range before assigning it to 'int'.
5155 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
5156 values converted from Emacs fixnums.
5157 (Frecenter): Don't wrap around a line count if it is out of 'int'
5158 range; instead, treat it as an extreme value.
5159 (Fset_window_configuration, compare_window_configurations):
5160 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
5161
5162 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
5163 that can exceed INT_MAX. Check that EMACS_INT value is in range
5164 before assigning it to the (possibly-narrower) index.
5165 (match_limit): Don't assume that a fixnum can fit in 'int'.
5166
5167 * print.c (print_object): Use ptrdiff_t, not int, for index that can
5168 exceed INT_MAX.
5169
5170 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
5171 (Fvertical_motion): Don't wrap around LINES values that don't fit
5172 in 'int'. Instead, treat them as extreme values. This is good
5173 enough for windows, which can't have more than INT_MAX lines anyway.
5174
5175 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5176
5177 * Require libxml/parser.h to avoid compilation warning.
5178
5179 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
5180
5181 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
5182 since this reportedly can destroy thread storage.
5183
5184 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
5185
5186 * syntax.c (find_defun_start): Update all cache variables if
5187 exiting early (Bug#9401).
5188
5189 2011-08-30 Eli Zaretskii <eliz@gnu.org>
5190
5191 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
5192
5193 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
5194 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
5195 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
5196
5197 * term.c (tty_append_glyph): New function.
5198 (produce_stretch_glyph): Static function and its prototype deleted.
5199
5200 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
5201 Add prototypes.
5202
5203 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
5204
5205 * image.c (parse_image_spec): Check for nonnegative, not for positive,
5206 when checking :margin (Bug#9390).
5207 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
5208 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
5209 so that the name doesn't mislead. All uses changed.
5210
5211 2011-08-28 Johan Bockgård <bojohan@gnu.org>
5212
5213 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
5214 set_tty_hooks.
5215
5216 2011-08-27 Eli Zaretskii <eliz@gnu.org>
5217
5218 * xdisp.c (move_it_to): Don't bail out early when reaching
5219 position beyond to_charpos, if we are scanning backwards.
5220 (move_it_vertically_backward): When DY == 0, make sure we get to
5221 the first character in the line after the newline.
5222
5223 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
5224
5225 * ccl.c: Improve and simplify overflow checking (Bug#9196).
5226 (ccl_driver): Do not generate an out-of-range pointer.
5227 (Fccl_execute_on_string): Remove unnecessary check for
5228 integer overflow, noted by Stefan Monnier in
5229 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
5230 Remove a FIXME that didn't need fixing.
5231 Simplify the newly-introduced buffer reallocation code.
5232
5233 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
5234
5235 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
5236
5237 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 Integer and memory overflow issues (Bug#9196).
5240
5241 * doc.c (get_doc_string): Rework so that
5242 get_doc_string_buffer_size is the actual buffer size, rather than
5243 being 1 less than the actual buffer size; this makes xpalloc more
5244 convenient.
5245
5246 * image.c (x_allocate_bitmap_record, cache_image):
5247 * xselect.c (Fx_register_dnd_atom):
5248 Simplify previous changes by using xpalloc.
5249
5250 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
5251 since either will do and ptrdiff_t is convenient with xpalloc.
5252
5253 * charset.c (charset_table_size)
5254 (struct charset_sort_data.priority): Now ptrdiff_t.
5255 (charset_compare): Don't overflow if priorities differ greatly.
5256 (Fsort_charsets): Don't assume list length fits in int.
5257 Check for size-calculation overflow when allocating sort data.
5258 (syms_of_charset): Allocate an initial charset table that is
5259 just under 64 KiB, to avoid problems with glibc malloc and mmap.
5260
5261 * cmds.c (internal_self_insert): Check for size-calculation overflow.
5262
5263 * composite.h (struct composition.glyph_len): Now int, not unsigned.
5264 The actual value is always <= INT_MAX, and leaving it unsigned made
5265 overflow checking harder.
5266
5267 * dispextern.h (struct glyph_matrix.rows_allocated)
5268 (struct face_cache.size): Now ptrdiff_t, for convenience in use
5269 with xpalloc. The values are still always <= INT_MAX.
5270
5271 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
5272
5273 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
5274 (SAFE_NALLOCA): New macro.
5275
5276 * region-cache.c (struct boundary.pos, find_cache_boundary)
5277 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
5278 (set_cache_region, invalidate_region_cache)
5279 (revalidate_region_cache, know_region_cache, region_cache_forward)
5280 (region_cache_backward, pp_cache):
5281 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
5282 so that ptrdiff_t * can be passed to xpalloc.
5283 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
5284 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
5285 (pp_cache): Don't assume cache_len fits in int.
5286 * region-cache.h: Adjust extern decls to match.
5287
5288 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
5289 EMACS_INT, since either will do, for xpalloc.
5290
5291 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
5292 (xnmalloc, xnrealloc, xpalloc): New functions.
5293
5294 * bidi.c (bidi_shelve_header_size): New constant.
5295 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
5296 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
5297
5298 * bidi.c (bidi_cache_shrink):
5299 * buffer.c (overlays_at, overlays_in, record_overlay_string)
5300 (overlay_strings):
5301 Don't update size of array until after memory allocation succeeds,
5302 because xmalloc/xrealloc may not return.
5303 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
5304 now that we have proper integer overflow checking.
5305 (record_overlay_string, overlay_strings): Catch overflows when
5306 calculating size of overlay_str_buf.
5307
5308 * callproc.c (Fcall_process): Check for size overflow when
5309 calculating size of args2.
5310 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
5311 Normally we prefer signed values, but sticking with ptrdiff_t would
5312 require adding more-complicated checks.
5313
5314 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
5315 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
5316 Redo buffer-overflow calculations to avoid integer overflow.
5317 Add a FIXME comment where memory seems to be over-allocated.
5318
5319 * character.c (Fstring): Check for size-calculation overflow.
5320
5321 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
5322 unnecessary integer overflow. Check for size overflow.
5323 (encode_coding_object): Don't update size until xmalloc succeeds.
5324
5325 * composite.c (get_composition_id): Check for overflow in glyph
5326 length calculations.
5327
5328 Integer and memory overflow fixes for display code.
5329 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
5330 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
5331 (scrolling_window): Check for overflow in size calculations.
5332 (line_draw_cost, realloc_glyph_pool, add_row_entry):
5333 Don't assume glyph table len fits in int.
5334 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
5335 (row_table_size): Now ptrdiff_t, not int.
5336 (scrolling_window): Avoid overflow in size calculations.
5337 Don't update size until allocation succeeds.
5338 * fns.c (concat): Check for overflow in size calculations.
5339 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
5340 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5341 (NEXT_ALMOST_PRIME_LIMIT): New constant.
5342
5343 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
5344 (get_doc_string): Check for size calculation overflow.
5345 Don't update size until allocation succeeds.
5346 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
5347 EMACS_INT, where ptrdiff_t will do.
5348 (Fsubstitute_command_keys): Check for string overflow.
5349
5350 * editfns.c (set_time_zone_rule): Don't assume environment length
5351 fits in int.
5352 (message_length): Now ptrdiff_t, not int.
5353 (Fmessage_box): Don't update size until allocation succeeds.
5354 Don't assume message length fits in int.
5355 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
5356
5357 * emacs.c (main): Do not reallocate argv, since there is a null at
5358 the end that can be overwritten, and this way there's no need to
5359 worry about size-calculation overflow.
5360 (sort_args): Check for size-calculation overflow.
5361
5362 * eval.c (init_eval_once, grow_specpdl): Don't update size until
5363 alloc succeeds.
5364 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
5365
5366 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
5367 (x_set_scroll_bar_width, x_figure_window_size):
5368 Check for integer overflow.
5369 (x_set_alpha): Do not assume XINT fits in int.
5370
5371 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
5372 This is for the members text_lines, text_cols, total_lines, total_cols,
5373 where the system imposes an 'int' limit.
5374
5375 * fringe.c (Fdefine_fringe_bitmap):
5376 Don't update size until alloc works.
5377
5378 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
5379 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
5380
5381 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
5382 Check for size-calculation overflow.
5383 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
5384 do, as we prefer signed integers.
5385 (id_to_widget.max_size, id_to_widget.used)
5386 (xg_store_widget_in_map, xg_remove_widget_from_map)
5387 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
5388 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
5389 Use and return ptrdiff_t, not int.
5390 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
5391 * gtkutil.h: Change prototypes to match the above.
5392
5393 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
5394 are duplicate now that they've been promoted to lisp.h.
5395 (x_allocate_bitmap_record, x_alloc_image_color)
5396 (make_image_cache, cache_image, xpm_load):
5397 Don't update size until alloc is done.
5398 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
5399 (x_detect_edges):
5400 Check for size calculation overflow.
5401 (ct_colors_allocated_max): New constant.
5402 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
5403 overflow.
5404
5405 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
5406 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
5407 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
5408 Use ptrdiff_t, not int, to count maps.
5409 (read_char_minibuf_menu_prompt): Check for overflow in size
5410 calculations. Don't update size until allocation succeeds.
5411 Redo calculations to avoid overflow.
5412 * keyboard.h: Change prototypes to match the above.
5413
5414 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
5415 to count maps.
5416 (current_minor_maps): Check for size calculation overflow.
5417 * keymap.h: Change prototypes to match the above.
5418
5419 * lread.c (read1, init_obarray): Don't update size until alloc done.
5420
5421 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
5422 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
5423
5424 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
5425 Now ptrdiff_t, not int.
5426 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
5427 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
5428
5429 * process.c (Fnetwork_interface_list): Check for overflow
5430 in size calculation.
5431
5432 * region-cache.c (move_cache_gap): Check for size calculation overflow.
5433
5434 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
5435 overflow. Don't bother calling xmalloc when xrealloc will do.
5436
5437 * search.c (Freplace_match): Check for size calculation overflow.
5438 (Fset_match_data): Don't assume list lengths fit in 'int'.
5439
5440 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
5441 for command line length. Do not attempt to address one before the
5442 beginning of an array, as that's not portable.
5443
5444 * term.c (max_frame_lines): Remove; unused.
5445 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
5446 not int.
5447 (encode_terminal_code, calculate_costs): Check for size
5448 calculation overflow.
5449 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
5450 table lengths and related sizes. Don't update size until alloc
5451 done. Redo calculations to avoid overflow.
5452 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
5453
5454 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
5455 subtracting pointers.
5456 (gobble_line): Check for overflow more carefully. Don't update size
5457 until alloc done.
5458
5459 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
5460 Don't update size until alloc done.
5461 Redo size calculations to avoid overflow.
5462 Check for size calculation overflow.
5463 (main) [DEBUG]: Fix typo in invoking tparam1.
5464
5465 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
5466 Use ptrdiff_t, not int, for sizes.
5467 (store_mode_line_noprop_char): Don't update size until alloc done.
5468
5469 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
5470 Use ptrdiff_t, not int, for sizes.
5471 (Finternal_make_lisp_face, cache_face):
5472 Check for size calculation overflow.
5473 (cache_face): Treat size calculation overflows as if they were
5474 memory exhaustion (the usual treatment), rather than aborting.
5475
5476 * xfns.c (x_encode_text, x_set_name_internal)
5477 (Fx_change_window_property): Use ptrdiff_t, not int, to count
5478 sizes, since they can exceed INT_MAX in size. Check for size
5479 calculation overflow.
5480
5481 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
5482 (xg_select): Check for size calculation overflow.
5483 Don't update size until alloc done.
5484
5485 * xrdb.c (get_environ_db): Don't assume path length fits in int,
5486 as sprintf is limited to int lengths.
5487
5488 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
5489 (X_LONG_MIN): New macros.
5490 Use them to make the following changes clearer.
5491 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
5492 This change doesn't affect the value now, but it may help remind
5493 future maintainers not to raise the value too much later.
5494 (SELECTION_QUANTUM): Remove, replacing with ...
5495 (selection_quantum): ... new function, which avoids overflow.
5496 All uses changed.
5497 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
5498 assumption that selection length fits in 'int'.
5499 (x_reply_selection_request, x_handle_selection_request)
5500 (x_get_window_property, receive_incremental_selection)
5501 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
5502 (lisp_data_to_selection_data, clean_local_selection_data):
5503 Use ptrdiff_t, not int, to record length of selection.
5504 (x_reply_selection_request, x_get_window_property)
5505 (receive_incremental_selection, x_property_data_to_lisp):
5506 Redo calculations to avoid overflow.
5507 (x_reply_selection_request): When sending hint, ceiling it at
5508 X_LONG_MAX rather than relying on wraparound overflow to send
5509 something.
5510 (x_get_window_property, receive_incremental_selection)
5511 (lisp_data_to_selection_data, x_property_data_to_lisp):
5512 Check for size-calculation overflow.
5513 (x_get_window_property, receive_incremental_selection)
5514 (lisp_data_to_selection_data, Fx_register_dnd_atom):
5515 Don't store size until memory allocation succeeds.
5516 (x_get_window_property): Plug memory leak on memory exhaustion.
5517 Don't double-block input; malloc is safe here. Don't assume 2**34
5518 - 4 fits in unsigned long. Add an xassert to check
5519 XGetWindowProperty overflow. Be more careful about overflow
5520 calculations, and distinguish size from memory overflow better.
5521 (receive_incremental_selection): When tracing, don't assume
5522 unsigned int is less than INT_MAX.
5523 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
5524 harmful) conversions of unsigned short to int.
5525 (lisp_data_to_selection_data): Don't assume that integers
5526 in the range -65535 through -1 fit in an X unsigned short.
5527 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
5528 result parameters unless successful. Rely on cons_to_unsigned
5529 to report problems with elements; the old code wasn't right anyway.
5530 (x_check_property_data): Check for int overflow; we cannot use
5531 a wider type due to X limits.
5532 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
5533
5534 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
5535
5536 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
5537 (x_term_init): Check for size calculation overflow.
5538 (x_color_cells): Don't store size until memory allocation succeeds.
5539 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
5540 Don't assume alloca size is less than MAX_ALLOCA.
5541 (x_term_init): Don't assume length fits in int (sprintf is limited
5542 to int size).
5543
5544 Use ptrdiff_t for composition IDs.
5545 * character.c (lisp_string_width):
5546 * composite.c (composition_table_size, n_compositions)
5547 (get_composition_id, composition_gstring_from_id):
5548 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
5549 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
5550 * window.c (Frecenter):
5551 Use ptrdiff_t, not int, for composition IDs.
5552 * composite.c (get_composition_id): Check for integer overflow.
5553 * composite.h: Adjust prototypes to match the above changes.
5554
5555 Use ptrdiff_t for hash table indexes.
5556 * category.c (hash_get_category_set):
5557 * ccl.c (ccl_driver):
5558 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
5559 * coding.c (coding_system_charset_list, detect_coding_system):
5560 * coding.h (struct coding_system.id):
5561 * composite.c (get_composition_id, gstring_lookup_cache):
5562 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
5563 * image.c (xpm_get_color_table_h):
5564 * lisp.h (hash_lookup, hash_put):
5565 * minibuf.c (Ftest_completion):
5566 Use ptrdiff_t for hash table indexes, not int (which is too
5567 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
5568 32-bit --with-wide-int hosts).
5569
5570 * charset.c (Fdefine_charset_internal): Check for integer overflow.
5571 Add a FIXME comment about memory leaks.
5572 (syms_of_charset): Don't assume xmalloc returns.
5573
5574 Don't assume that stated character widths fit in int.
5575 * character.c (Fchar_width, c_string_width, lisp_string_width):
5576 * character.h (CHAR_WIDTH):
5577 * indent.c (MULTIBYTE_BYTES_WIDTH):
5578 Use sanitize_char_width to avoid undefined and/or bad behavior
5579 with outlandish widths.
5580 * character.h (sanitize_tab_width): Rename from sanitize_width,
5581 now that we have two such functions. All uses changed.
5582 (sanitize_char_width): New inline function.
5583
5584 Don't assume that tab-width fits in int.
5585 * character.h (sanitize_width): New inline function.
5586 (SANE_TAB_WIDTH): New macro.
5587 (ASCII_CHAR_WIDTH): Use it.
5588 * indent.c (sane_tab_width): Remove. All uses replaced by
5589 SANE_TAB_WIDTH (current_buffer).
5590 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
5591
5592 * fileio.c: Integer overflow issues with file modes.
5593 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
5594
5595 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
5596 Remove unreachable code.
5597 (read_hex, load_charset_map_from_file): Check for integer overflow.
5598
5599 * xterm.c: Don't go over XClientMessageEvent limit.
5600 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
5601 (x_send_scroll_bar_event): Likewise. Check that the size does not
5602 exceed limits imposed by XClientMessageEvent, as well as the usual
5603 ptrdiff_t and size_t limits.
5604
5605 * keyboard.c: Overflow, signedness and related fixes.
5606 (make_lispy_movement): Use same integer type in forward decl
5607 that is used in the definition.
5608 (read_key_sequence, keyremap_step):
5609 Change bufsize argument back to int, undoing my 2011-03-30 change.
5610 We prefer signed types, and int is wide enough here.
5611 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
5612 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
5613 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
5614 length, not size_t. Use ptrdiff_t for index, not int.
5615 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
5616 possibility of integer overflow.
5617
5618 Overflow, signedness and related fixes for images.
5619
5620 * dispextern.h (struct it.stack[0].u.image.image_id)
5621 (struct_it.image_id, struct image.id, struct image_cache.size)
5622 (struct image_cache.used, struct image_cache.ref_count):
5623 * gtkutil.c (update_frame_tool_bar):
5624 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
5625 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
5626 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
5627 * nsmenu.m (update_frame_tool_bar):
5628 * xdisp.c (calc_pixel_width_or_height):
5629 * xfns.c (image_cache_refcount):
5630 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
5631 on typical 64-bit hosts.
5632
5633 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5634 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
5635 Omit unnecessary casts to int.
5636 (parse_image_spec): Check that integers fall into 'int' range
5637 when the callers expect that.
5638 (image_ascent): Redo ascent calculation to avoid int overflow.
5639 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
5640 (lookup_image): Remove unnecessary tests.
5641 (xbm_image_p): Locals are now of int, not EMACS_INT,
5642 since parse_image_check makes sure they fit into int.
5643 (png_load, gif_load, svg_load_image):
5644 Prefer int to unsigned where either will do.
5645 (tiff_handler): New function, combining the cores of the
5646 old tiff_error_handler and tiff_warning_handler.
5647 This function is rewritten to use vsnprintf and thereby avoid
5648 stack buffer overflows. It uses only the features of vsnprintf
5649 that are common to both POSIX and native Microsoft.
5650 (tiff_error_handler, tiff_warning_handler): Use it.
5651 (tiff_load, gif_load, imagemagick_load_image):
5652 Don't assume :index value fits in 'int'.
5653 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
5654 (imagemagick_load_image): Check that crop parameters fit into
5655 the integer types that MagickCropImage accepts. Don't assume
5656 Vimagemagick_render_type has a nonnegative value. Don't assume
5657 size_t fits in 'long'.
5658 (gs_load): Use printmax_t to print the widest integers possible.
5659 Check for integer overflow when computing image height and width.
5660
5661 2011-08-26 Eli Zaretskii <eliz@gnu.org>
5662
5663 * xdisp.c (redisplay_window): Don't force window start if point
5664 will be invisible in the resulting window. (Bug#9324)
5665
5666 2011-08-25 Eli Zaretskii <eliz@gnu.org>
5667
5668 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
5669 the display spec is of the form `(space ...)'.
5670 (handle_display_spec): Return the value returned by
5671 handle_single_display_spec, not just 1 or zero.
5672 (handle_single_display_spec): If the display spec is of the form
5673 `(space ...)', and specifies display in the text area, return 2
5674 rather than 1.
5675 (try_cursor_movement): Check for the need to scroll more
5676 accurately, and prefer exact match for point under bidi.
5677 Don't advance `row' beyond the last row of the window.
5678
5679 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
5680 into disp_prop; all users changed.
5681
5682 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
5683 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
5684 for the text covered by the display property.
5685
5686 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
5687
5688 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
5689 Change return value to nil.
5690 (Frecord_buffer): Delete unused function.
5691
5692 2011-08-24 Eli Zaretskii <eliz@gnu.org>
5693
5694 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
5695 buffers, return left-to-right.
5696 (set_cursor_from_row): Consider candidate row a win if its glyph
5697 represents a newline and point is on that newline. Fixes cursor
5698 positioning on the newline at EOL of R2L text within L2R
5699 paragraph, and vice versa.
5700 (try_cursor_movement): Check continued rows, in addition to
5701 continuation rows. Fixes unwarranted scroll when point enters a
5702 continued line of R2L text within an L2R paragraph, or vice versa.
5703 (cursor_row_p): Consider the case of point being equal to
5704 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
5705 from the end of a short line to the beginning of a continued line
5706 of R2L text within L2R paragraph.
5707 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
5708 composed characters.
5709
5710 * bidi.c (bidi_check_type): Use xassert.
5711 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
5712 members.
5713
5714 2011-08-23 Eli Zaretskii <eliz@gnu.org>
5715
5716 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
5717 a character.
5718
5719 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
5720
5721 * nsfont.m (ns_otf_to_script): Fix typo.
5722
5723 2011-08-22 Kenichi Handa <handa@m17n.org>
5724
5725 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
5726 extra slot even if the purpose is char-code-property-table.
5727
5728 2011-08-23 Eli Zaretskii <eliz@gnu.org>
5729
5730 * xdisp.c (redisplay_window): When computing centering_position,
5731 account for the height of the header line. (Bug#8874)
5732
5733 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
5734 instead of CHAR_TO_BYTE. Fixes a crash when a completion
5735 candidate is selected by the mouse, and that candidate has a
5736 composed character under the mouse.
5737
5738 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
5739 coordinates reported by pos-visible-in-window-p for a composed
5740 character in column zero.
5741
5742 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
5743
5744 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
5745
5746 2011-08-22 Eli Zaretskii <eliz@gnu.org>
5747
5748 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
5749 consider it a hit if to_charpos is anywhere in the range of the
5750 composed buffer positions.
5751
5752 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
5753
5754 * image.c (gif_load): Don't assume that each subimage has the same
5755 dimensions as the base image. Handle disposal method that is
5756 "undefined" by the gif spec (Bug#9335).
5757
5758 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
5759
5760 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
5761 (Fcondition_case): Document `debug' symbol in error handler.
5762
5763 2011-08-19 Eli Zaretskii <eliz@gnu.org>
5764
5765 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
5766 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
5767 from an Org mode buffer to a Speedbar frame.
5768
5769 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
5770 a composition, take its buffer position from IT->cmp_it.charpos.
5771 Fixes cursor positioning at the beginning of a line that begins
5772 with a composed character.
5773
5774 2011-08-18 Eli Zaretskii <eliz@gnu.org>
5775
5776 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
5777 character bidirectional type, use STRONG_L instead. Fixes crashes
5778 in a buffer produced by `describe-categories'.
5779
5780 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
5781 members before the level stack, so they would be saved and
5782 restored when copying iterator state. Fixes incorrect reordering
5783 around TABs covered by display properties.
5784
5785 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
5786
5787 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
5788
5789 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
5790
5791 * eval.c (internal_condition_case, internal_condition_case_1)
5792 (internal_condition_case_2, internal_condition_case_n):
5793 Remove unnecessary aborts (Bug#9081).
5794
5795 2011-08-17 Eli Zaretskii <eliz@gnu.org>
5796
5797 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
5798 has no `load' handler, try opening the file locally. (Bug#9311)
5799
5800 2011-08-16 Ken Brown <kbrown@cornell.edu>
5801
5802 * gmalloc.c: Expand comment.
5803
5804 2011-08-16 Eli Zaretskii <eliz@gnu.org>
5805
5806 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
5807 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
5808
5809 2011-08-16 Ken Brown <kbrown@cornell.edu>
5810
5811 Fix memory allocation problems in Cygwin build (Bug#9273).
5812
5813 * unexcw.c ( __malloc_initialized): Declare external variable.
5814 (fixup_executable): Force the dumped emacs to reinitialize malloc.
5815
5816 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
5817 New variables.
5818 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
5819 dumped emacs.
5820 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
5821 in the static heap.
5822 [CYGWIN] (special_realloc): New function.
5823 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
5824 requests to realloc storage in the static heap.
5825
5826 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
5827
5828 * bidi.c (bidi_initialize): Remove unused local.
5829
5830 2011-08-15 Eli Zaretskii <eliz@gnu.org>
5831
5832 * bidimirror.h:
5833 * biditype.h: Remove file.
5834 * makefile.w32-in ($(BLD)/bidi.$(O)):
5835 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
5836
5837 * dispextern.h: Fix a typo in the comment to bidi_type_t.
5838
5839 * chartab.c: Improve commentary for the uniprop_table API.
5840
5841 * bidi.c (bidi_paragraph_init): Support zero value of
5842 bidi_ignore_explicit_marks_for_paragraph_level.
5843 (bidi_initialize): Use uniprop_table instead of including
5844 biditype.h and bidimirror.h.
5845
5846 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
5847 coordinates of the iterator when restoring from ppos_it.
5848 (Bug#9296)
5849
5850 2011-08-14 Kenichi Handa <handa@m17n.org>
5851
5852 * process.c (create_process): Call setup_process_coding_systems
5853 after the pid of the process is set to -1 (Bug#8162).
5854
5855 2011-08-14 Eli Zaretskii <eliz@gnu.org>
5856
5857 * xdisp.c (move_it_in_display_line_to): Don't invoke
5858 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
5859 ppos_it. Fixes vertical cursor motion when line beginning is
5860 covered by an image. (Bug#9296)
5861
5862 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
5863
5864 * nsterm.h (ns_run_ascript): Declare.
5865 (NSAPP_DATA2_RUNASSCRIPT): Define.
5866
5867 * nsfns.m (as_script, as_result, as_status): New static variables.
5868 (ns_run_ascript): New function.
5869 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
5870 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
5871 the event loop. Get status from as_status (Bug#7276).
5872
5873 * nsterm.m (sendEvent): If event is NSApplicationDefined and
5874 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
5875 the event loop (Bug#7276).
5876
5877 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
5878
5879 * gnutls.c (QCgnutls_bootprop_priority)
5880 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
5881 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
5882 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
5883 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
5884 (QCgnutls_bootprop_verify_hostname_error)
5885 (QCgnutls_bootprop_callbacks_verify): Rename from
5886 Qgnutls_bootprop_..., all uses changed.
5887
5888 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
5889 uses changed.
5890
5891 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
5892
5893 * xfaces.c (Qframe_set_background_mode): Now static.
5894 * dispextern.h (Qframe_set_background_mode): Remove decl.
5895
5896 * process.c (Fnetwork_interface_info): Declare local only if needed.
5897
5898 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
5899
5900 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
5901 (Fnetwork_interface_list): Allocate in increments of bytes instead
5902 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
5903 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
5904 sockaddr.
5905 (struct ifflag_def): notrailers is smart on OSX.
5906 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
5907 Get hardware address with getifaddrs if available.
5908
5909 2011-08-12 Eli Zaretskii <eliz@gnu.org>
5910
5911 * xdisp.c (iterate_out_of_display_property): xassert that
5912 IT->position is set to within IT->object's boundaries. Break from
5913 the loop as soon as EOB is reached; avoids infloops in redisplay
5914 when IT->position is set up wrongly due to some bug.
5915 Set IT->current to match the bidi iterator unconditionally.
5916 (push_display_prop): Allow GET_FROM_STRING as IT->method on
5917 entry. Force push_it to save on the stack the current
5918 buffer/string position, to be restored by pop_it. Fix flags in
5919 the iterator structure wrt the object coming from a display
5920 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
5921 properties. (Bug#9284)
5922
5923 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
5924
5925 * fontset.c (fontset_get_font_group): Add proper type checks.
5926 (Bug#9172)
5927
5928 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5929
5930 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
5931 and LC_VERSION_MIN_MACOSX.
5932 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
5933 (dump_it) [LC_FUNCTION_STARTS]: Use it.
5934
5935 2011-08-08 Eli Zaretskii <eliz@gnu.org>
5936
5937 * xdisp.c (forward_to_next_line_start): Allow to use the
5938 no-display-properties-and-no-overlays under bidi display.
5939 Set disp_pos in the bidi iterator to avoid searches for display
5940 properties and overlays.
5941
5942 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
5943
5944 * editfns.c (Fset_time_zone_rule): Document relationship with the
5945 setenv function.
5946
5947 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
5948 the font entity extracted from the cache (Bug#8109).
5949
5950 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
5951
5952 * composite.c (autocmp_chars): Don't reset point. That is done by
5953 restore_point_unwind (Bug#5984).
5954
5955 2011-08-07 Juri Linkov <juri@jurta.org>
5956
5957 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
5958 to show the arg `TIME' instead of `TIMEVAL'.
5959
5960 2011-08-06 Eli Zaretskii <eliz@gnu.org>
5961
5962 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
5963 display property strides EOL and includes a newline, as in
5964 longlines-mode. (Bug#9254)
5965 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
5966 word-wrap under bidirectional display. (Bug#9224)
5967
5968 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
5969 is non-zero, even if the data buffer is NULL. Fixes a crash in
5970 vertical-motion with longlines-mode. (Bug#9254)
5971
5972 2011-08-05 Eli Zaretskii <eliz@gnu.org>
5973
5974 * bidi.c <bidi_cache_total_alloc>: Now static.
5975 (bidi_initialize): Initialize bidi_cache_total_alloc.
5976
5977 * xdisp.c (display_line): Release buffer allocated for shelved bidi
5978 cache. (Bug#9221)
5979
5980 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
5981 amount allocated this far in `bidi_cache_total_alloc'.
5982 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
5983 non-zero, only free the data buffer without restoring the cache
5984 contents. All callers changed.
5985
5986 * dispextern.h (bidi_unshelve_cache): Update prototype.
5987
5988 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
5989 (move_it_in_display_line, move_it_to)
5990 (move_it_vertically_backward, move_it_by_lines): Replace the call
5991 to xfree to an equivalent call to bidi_unshelve_cache.
5992 (move_it_in_display_line_to): Fix logic of returning
5993 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
5994
5995 2011-08-05 Eli Zaretskii <eliz@gnu.org>
5996
5997 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
5998 came from a string character with a `cursor' property. (Bug#9229)
5999
6000 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6001
6002 * Makefile.in (LIB_PTHREAD): New variable.
6003 (LIBES): Add LIB_PTHREAD (Bug#9216).
6004
6005 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
6006 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
6007
6008 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
6009
6010 * regex.c (re_iswctype): Remove some redundant boolean conversions.
6011
6012 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6013
6014 * xterm.c (x_find_topmost_parent): New function.
6015 (x_set_frame_alpha): Find topmost parent window with
6016 x_find_topmost_parent and set the property there also (bug#9181).
6017 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
6018
6019 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
6020
6021 * callproc.c (Fcall_process): Avoid vfork clobbering
6022 the local vars buffer, coding_systems, current_dir.
6023
6024 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
6025
6026 * keymap.c (Fmake_composed_keymap): Move to subr.el.
6027
6028 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
6029
6030 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
6031 so that it is not optimized away.
6032
6033 * xdisp.c (compute_display_string_pos): Remove unused local.
6034
6035 2011-08-02 Eli Zaretskii <eliz@gnu.org>
6036
6037 Fix slow cursor motion and scrolling in large buffers with
6038 selective display, like Org Mode buffers. (Bug#9218)
6039
6040 * dispextern.h (struct bidi_it): New member disp_prop_p.
6041
6042 * xdisp.c: Remove one-slot cache of display string positions.
6043 (compute_display_string_pos): Accept an additional argument
6044 DISP_PROP_P; callers changed. Scan at most 5K characters forward
6045 for a display string or property. If found, set DISP_PROP_P
6046 non-zero.
6047
6048 * bidi.c (bidi_fetch_char): Accept an additional argument
6049 DISP_PROP_P, and pass it to compute_display_string_pos.
6050 Only handle text covered by a display string if DISP_PROP_P is returned
6051 non-zero. All callers of bidi_fetch_char changed.
6052
6053 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
6054
6055 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
6056
6057 2010-12-03 Don March <don@ohspite.net>
6058
6059 * keymap.c (Fdefine_key): Fix non-prefix key error message when
6060 last character M-[char] is translated to ESC [char] (bug#7541).
6061
6062 2011-08-02 Kenichi Handa <handa@m17n.org>
6063
6064 * lisp.h (uniprop_table): Extern it.
6065
6066 * chartab.c (uniprop_table): Make it non-static.
6067
6068 2011-08-01 Eli Zaretskii <eliz@gnu.org>
6069
6070 * xdisp.c (forward_to_next_line_start): Accept additional argument
6071 BIDI_IT_PREV, and store into it the state of the bidi iterator had
6072 on the newline.
6073 (reseat_at_next_visible_line_start): Use the bidi iterator state
6074 returned by forward_to_next_line_start to restore the state of
6075 it->bidi_it after backing up to previous newline. (Bug#9212)
6076
6077 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
6078
6079 * regex.c (re_comp): Protoize.
6080 (re_exec): Fix return type.
6081 (regexec): Fix type of `ret'. (Bug#9203)
6082
6083 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6084
6085 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
6086 This is needed if max-image-size is a floating-point number.
6087
6088 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6089
6090 * print.c (print_object): Print empty symbol as ##.
6091
6092 * lread.c (read1): Read ## as empty symbol.
6093
6094 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6095
6096 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
6097 setting frame foreground color (Bug#9175).
6098 (x_set_background_color): Likewise.
6099
6100 * nsmenu.m (-setText): Size tooltip dimensions precisely to
6101 contents (Bug#9176).
6102 (EmacsTooltip -init): Remove bezels and add shadows to
6103 tooltip windows.
6104
6105 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
6106 or scroll bar (Bug#8470).
6107
6108 * nsfont.m (nsfont_open): Remove assignment to voffset and
6109 unnecessary vars hshink, expand, hd, full_height, min_height.
6110 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
6111
6112 * nsterm.h (nsfont_info): Remove voffset field.
6113
6114 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6115
6116 Implement strike-through and overline on NextStep (Bug#8863).
6117
6118 * nsfont.m (nsfont_open): Use underline position provided by font,
6119 instead of hard-coded value of 2.
6120 (nsfont_draw): Call ns_draw_text_decoration instead.
6121
6122 * nsterm.h: Add declaration for ns_draw_text_decoration.
6123
6124 * nsterm.m (ns_draw_text_decoration): New function for drawing
6125 underline, overline, and strike-through.
6126 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
6127 ns_draw_text_decoration. Change treatment of cursor drawing to
6128 accommodate underlining, etc.
6129
6130 2011-07-28 Eli Zaretskii <eliz@gnu.org>
6131
6132 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
6133 default.
6134
6135 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6136
6137 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
6138 Without this fix, if a signal arrives just after memory fills up,
6139 'malloc' might be invoked reentrantly.
6140
6141 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
6142 In other words, assume that every image size is allowed, on non-X
6143 hosts. This assumption is probably wrong, but it lets Emacs compile.
6144
6145 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6146
6147 * regex.c (re_iswctype): Convert return values to boolean.
6148
6149 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
6150
6151 * xdisp.c (compute_display_string_pos): Don't use cached display
6152 string position if the buffer had its restriction changed.
6153 (Bug#9184)
6154
6155 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6156
6157 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
6158
6159 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6160
6161 Integer signedness and overflow and related fixes. (Bug#9079)
6162
6163 * bidi.c: Integer size and overflow fixes.
6164 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
6165 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
6166 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6167 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
6168 (bidi_find_other_level_edge):
6169 Use ptrdiff_t instead of EMACS_INT where either will do.
6170 This works better on 32-bit hosts configured --with-wide-int.
6171 (bidi_cache_ensure_space): Check for size-calculation overflow.
6172 Use % rather than repeated addition, for better worst-case speed.
6173 Don't set bidi_cache_size until after xrealloc returns, because it
6174 might not return.
6175 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
6176 (bidi_cache_ensure_space): Also check that the bidi cache size
6177 does not exceed that of the largest Lisp string or buffer. See Eli
6178 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
6179
6180 * alloc.c (__malloc_size_t): Remove.
6181 All uses replaced by size_t. See Andreas Schwab's note
6182 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
6183
6184 * image.c: Improve checking for integer overflow.
6185 (check_image_size): Assume that f is nonnull, since
6186 it is always nonnull in practice. This is one less thing to
6187 worry about when checking for integer overflow later.
6188 (x_check_image_size): New function, which checks for integer
6189 overflow issues inside X.
6190 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
6191 This removes the need for a memory_full check.
6192 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
6193 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
6194 (xbm_read_bitmap_data): Change locals back to 'int', since
6195 their values must fit in 'int'.
6196 (xpm_load_image, png_load, tiff_load):
6197 Invoke x_create_x_image_and_pixmap earlier,
6198 to avoid much needless work if the image is too large.
6199 (tiff_load): Treat overly large images as if
6200 x_create_x_image_and_pixmap failed, not as malloc failures.
6201 (gs_load): Use x_check_image_size.
6202
6203 * gtkutil.c: Omit integer casts.
6204 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
6205 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
6206
6207 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
6208
6209 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
6210 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
6211 would wrongly return t on a 64-bit host.
6212
6213 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
6214 The plain *_OVERFLOW macros run afoul of GCC bug 49705
6215 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
6216 and therefore cause GCC to emit a bogus diagnostic in some cases.
6217
6218 * image.c: Integer signedness and overflow and related fixes.
6219 This is not an exhaustive set of fixes, but it's time to
6220 record what I've got.
6221 (lookup_pixel_color, check_image_size): Remove redundant decls.
6222 (check_image_size): Don't assume that arbitrary EMACS_INT values
6223 fit in 'int', or that arbitrary 'double' values fit in 'int'.
6224 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
6225 (tiff_load, imagemagick_load_image):
6226 Check for overflow in size calculations.
6227 (x_create_x_image_and_pixmap): Remove unnecessary test for
6228 xmalloc returning NULL; that can't happen.
6229 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
6230 (xpm_color_bucket): Use better integer hashing function.
6231 (xpm_cache_color): Don't possibly over-allocate memory.
6232 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
6233 (gif_memory_source):
6234 Use ptrdiff_t, not int or size_t, to record sizes.
6235 (png_load): Don't assume values greater than 2**31 fit in 'int'.
6236 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
6237 either works, as we prefer signed integers.
6238 (tiff_read_from_memory, tiff_write_from_memory):
6239 Return tsize_t, not size_t, since that's what the TIFF API wants.
6240 (tiff_read_from_memory): Don't fail simply because the read would
6241 go past EOF; instead, return a short read.
6242 (tiff_load): Omit no-longer-needed casts.
6243 (Fimagemagick_types): Don't assume size fits into 'int'.
6244
6245 Improve hashing quality when configured --with-wide-int.
6246 * fns.c (hash_string): New function, taken from sxhash_string.
6247 Do not discard information about ASCII character case; this
6248 discarding is no longer needed.
6249 (sxhash-string): Use it. Change sig to match it. Caller changed.
6250 * lisp.h: Declare it.
6251 * lread.c (hash_string): Remove, since we now use fns.c's version.
6252 The fns.c version returns a wider integer if --with-wide-int is
6253 specified, so this should help the quality of the hashing a bit.
6254
6255 * emacs.c: Integer overflow minor fix.
6256 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
6257 Define only if GNU_LINUX.
6258 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
6259
6260 * dispnew.c: Integer signedness and overflow fixes.
6261 Remove unnecessary forward decls, that were a maintenance hassle.
6262 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
6263 All uses changed.
6264 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
6265 (scrolling_window): Use ptrdiff_t, not int, for byte count.
6266 (prepare_desired_row, line_draw_cost):
6267 Use int, not unsigned, where either works.
6268 (save_current_matrix, restore_current_matrix):
6269 Use ptrdiff_t, not size_t, where either works.
6270 (init_display): Check for overflow more accurately, and without
6271 relying on undefined behavior.
6272
6273 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
6274 Remove, replacing with the new symbols in lisp.h. All uses changed.
6275 * fileio.c (make_temp_name):
6276 * filelock.c (lock_file_1, lock_file):
6277 * xdisp.c (message_dolog):
6278 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
6279 Use pMd etc. instead.
6280 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
6281 replacing the pWIDE etc. symbols removed from editfns.c.
6282
6283 * keyboard.h (num_input_events): Now uintmax_t.
6284 This is (very slightly) less likely to mess up due to wraparound.
6285 All uses changed.
6286
6287 * buffer.c: Integer signedness fixes.
6288 (alloc_buffer_text, enlarge_buffer_text):
6289 Use ptrdiff_t rather than size_t when either will do, as we prefer
6290 signed integers.
6291
6292 * alloc.c: Integer signedness and overflow fixes.
6293 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
6294 (__malloc_size_t): Default to size_t, not to int.
6295 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
6296 (Fgarbage_collect, mark_object_loop_halt, mark_object):
6297 Prefer ptrdiff_t to size_t when either would do, as we prefer
6298 signed integers.
6299 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
6300 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
6301 Now const. Initialize with values that are in range even if char
6302 is signed.
6303 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
6304 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
6305 These functions do the right thing with sizes > 2**32.
6306 (check_depth): Now ptrdiff_t, not int.
6307 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
6308 Adjust to new way of storing sizes. Check for size overflow bugs
6309 in rest of code.
6310 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
6311 slightly wrong anyway, as it missed one instance of
6312 XMALLOC_OVERRUN_CHECK_OVERHEAD.
6313 (refill_memory_reserve): Omit needless cast to size_t.
6314 (mark_object_loop_halt): Mark as externally visible.
6315
6316 * xselect.c: Integer signedness and overflow fixes.
6317 (Fx_register_dnd_atom, x_handle_dnd_message):
6318 Use ptrdiff_t, not size_t, since we prefer signed.
6319 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
6320 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
6321 x_dnd_atoms_size and x_dnd_atoms_length.
6322
6323 * doprnt.c: Prefer signed to unsigned when either works.
6324 * eval.c (verror):
6325 * doprnt.c (doprnt):
6326 * lisp.h (doprnt):
6327 * xdisp.c (vmessage):
6328 Use ptrdiff_t, not size_t, when using or implementing doprnt,
6329 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
6330 prefer signed arithmetic to avoid comparison confusion.
6331 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
6332 but is a bit tricky.
6333
6334 Assume freestanding C89 headers, string.h, stdlib.h.
6335 * data.c, doprnt.c, floatfns.c, print.c:
6336 Include float.h unconditionally.
6337 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
6338 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
6339 * regex.c: Likewise for stddef.h, string.h.
6340 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
6341 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
6342 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
6343 (STDC_HEADERS): Remove obsolete defines.
6344 * sysdep.c: Include limits.h unconditionally.
6345
6346 Assume support for memcmp, memcpy, memmove, memset.
6347 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
6348 * regex.c (memcmp, memcpy):
6349 Remove; we assume C89 now.
6350
6351 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
6352 (__malloc_safe_bcopy): Remove; no longer needed.
6353
6354 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6355 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
6356 well either way, and we prefer signed to unsigned.
6357
6358 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
6359
6360 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
6361 closes the connection while we're reading (bug#9182).
6362
6363 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
6364
6365 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
6366 are specified (Bug#9168).
6367
6368 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
6369
6370 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
6371 Found by GCC static checking and --with-wide-int on a 32-bit host.
6372
6373 2011-07-25 Eli Zaretskii <eliz@gnu.org>
6374
6375 * xdisp.c (compute_display_string_pos): Fix logic of caching
6376 previous display string position. Initialize cached_prev_pos to
6377 -1. Fixes slow-down at the beginning of a buffer.
6378
6379 2011-07-24 Eli Zaretskii <eliz@gnu.org>
6380
6381 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
6382 for attrs[LFACE_FONTSET_INDEX].
6383
6384 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
6385
6386 * xml.c (parse_region): Remove unused local
6387 that was recently introduced.
6388
6389 2011-07-23 Eli Zaretskii <eliz@gnu.org>
6390
6391 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
6392 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
6393
6394 * xdisp.c (move_it_in_display_line_to): Record the best matching
6395 position for TO_CHARPOS while scanning the line, and restore it on
6396 exit if none of the characters scanned was an exact match.
6397 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
6398 when exact match is impossible due to invisible text, and the
6399 lines are truncated.
6400
6401 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
6402
6403 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
6404 for OSX >= 10.7.
6405
6406 2011-07-22 Eli Zaretskii <eliz@gnu.org>
6407
6408 Fix a significant slow-down of cursor motion with C-n, C-p,
6409 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
6410 auto-repeat under bidi redisplay in fontified buffers.
6411 * xdisp.c (compute_stop_pos_backwards): New function.
6412 (next_element_from_buffer): Call compute_stop_pos_backwards to
6413 find a suitable prev_stop when we find ourselves before
6414 base_level_stop.
6415 (reseat): Don't look for prev_stop, as that could mean a very long
6416 run.
6417 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
6418 <cached_disp_overlay_modiff>: Cache for last found display string
6419 position.
6420 (compute_display_string_pos): Return the cached position if asked
6421 about the same buffer in the same area of character positions, and
6422 the buffer wasn't changed since the time the display string
6423 position was cached.
6424
6425 2011-07-22 Eli Zaretskii <eliz@gnu.org>
6426
6427 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
6428 is an integer, which is important for empty lines. (Bug#9149)
6429
6430 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
6431
6432 * frame.c (Fmodify_frame_parameters): In tty case, update the
6433 default face if necessary (Bug#4238).
6434
6435 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
6436
6437 * editfns.c (Fstring_to_char): No need to explain what a character
6438 is in the docstring (Bug#6576).
6439
6440 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6441
6442 * xml.c (parse_region): Make sure we always return a tree.
6443
6444 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
6445
6446 * xml.c (parse_region): If a document contains only comments,
6447 return that, too.
6448
6449 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6450
6451 * xml.c (make_dom): Return comments, too.
6452
6453 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
6454
6455 Port to OpenBSD.
6456 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
6457 and the surrounding thread.
6458 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
6459 rather than fgets, and retry after EINTR. Otherwise, 'emacs
6460 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
6461 timer goes off.
6462 * s/openbsd.h (BROKEN_SIGIO): Define.
6463 * unexelf.c (unexec) [__OpenBSD__]:
6464 Don't update the .mdebug section of the Alpha COFF symbol table.
6465
6466 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6467
6468 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
6469 (bug#8460).
6470
6471 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
6474 This fixes some race conditions on the permissions of any newly
6475 created file.
6476
6477 * alloc.c (valid_pointer_p): Use pipe, not open.
6478 This fixes some permissions issues when debugging.
6479
6480 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
6481 If fchown fails to set both uid and gid, try to set just gid,
6482 as that is sometimes allowed. Adjust the file's mode to eliminate
6483 setuid or setgid bits that are inappropriate if fchown fails.
6484
6485 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6486
6487 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
6488 to compare Lisp_Objects.
6489 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
6490 global_gnutls_log_level, don't mistake it for a Lisp_Object.
6491 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
6492
6493 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
6494
6495 * lread.c (read_integer): Unread even EOF character.
6496 (read1): Likewise. Properly record start position of symbol.
6497
6498 * lread.c (read1): Read `#:' as empty uninterned symbol if no
6499 symbol character follows.
6500
6501 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
6502
6503 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
6504 This works around a problem with the previous change to Fcopy_file.
6505 Recent glibc declares fchown with __attribute__((warn_unused_result)),
6506 and without this change, GCC might complain about discarding
6507 fchown's return value.
6508
6509 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
6510
6511 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
6512
6513 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
6514
6515 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
6516
6517 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
6518
6519 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
6520 it's used from the C level.
6521
6522 * process.c: Use the same condition for POLL_FOR_INPUT in both
6523 keyboard.c and process.c (bug#1858).
6524
6525 2011-07-09 Lawrence Mitchell <wence@gmx.li>
6526
6527 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
6528 (Fgnutls_boot): Use it.
6529
6530 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
6531
6532 * doc.c (Fsubstitute_command_keys): Revert last change.
6533
6534 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
6535
6536 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
6537 quotes the next character, and doesn't affect other longer
6538 sequences (bug#8935).
6539
6540 * lread.c (syms_of_lread): Clarify that is isn't only
6541 `eval-buffer' and `eval-defun' that's affected by
6542 `lexical-binding' (bug#8460).
6543
6544 2011-07-15 Eli Zaretskii <eliz@gnu.org>
6545
6546 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6547 bidi redisplay when a line includes both an image and is truncated.
6548
6549 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
6550
6551 Fix minor problems found by static checking.
6552 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
6553 (elsz): Now a signed constant, not a size_t var. We prefer signed
6554 types to unsigned, to avoid integer comparison confusion. Without
6555 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
6556 "cannot optimize loop, the loop counter may overflow", a symptom
6557 of the confusion.
6558 * indent.c (Fvertical_motion): Mark locals as initialized.
6559 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
6560
6561 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6562
6563 * search.c (Fre_search_backward): Mention `case-fold-search' in
6564 all the re_search_* functions (bug#8138).
6565
6566 * keyboard.c (Fopen_dribble_file): Document when the file is
6567 closed (bug#8056).
6568
6569 2011-07-14 Eli Zaretskii <eliz@gnu.org>
6570
6571 * bidi.c (bidi_dump_cached_states): Fix format of displaying
6572 bidi_cache_idx.
6573
6574 Support bidi reordering of display and overlay strings.
6575 * xdisp.c (compute_display_string_pos)
6576 (compute_display_string_end): Accept additional argument STRING.
6577 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
6578 (reseat_to_string): Initialize bidi_it->string.s and
6579 bidi_it->string.schars.
6580 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
6581 NULL (avoids a crash in bidi_paragraph_init).
6582 Initialize itb.string.lstring.
6583 (init_iterator): Call bidi_init_it only of a valid
6584 buffer position was specified. Initialize paragraph_embedding to
6585 L2R.
6586 (reseat_to_string): Initialize the bidi iterator.
6587 (display_string): If we need to ignore text properties of
6588 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
6589 original value of -1 will not work with bidi.)
6590 (compute_display_string_pos): First arg is now struct
6591 `text_pos *'; all callers changed. Support display properties on
6592 Lisp strings.
6593 (compute_display_string_end): Support display properties on Lisp
6594 strings.
6595 (init_iterator, reseat_1, reseat_to_string): Initialize the
6596 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
6597 when iterating on a string not from display properties).
6598 (compute_display_string_pos, compute_display_string_end):
6599 Fix calculation of the object to scan. Fixes an error when using
6600 arrow keys.
6601 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
6602 base_level_stop; instead, set base_level_stop to BEGV.
6603 Fixes crashes in vertical-motion.
6604 (next_element_from_buffer): Improve commentary for when
6605 the iterator is before prev_stop.
6606 (init_iterator): Initialize bidi_p from the default value of
6607 bidi-display-reordering, not from buffer-local value. Use the
6608 buffer-local value only if initializing for buffer iteration.
6609 (handle_invisible_prop): Support invisible properties on strings
6610 that are being bidi-reordered.
6611 (set_iterator_to_next): Support bidi reordering of C strings and
6612 Lisp strings.
6613 (next_element_from_string): Support bidi reordering of Lisp
6614 strings.
6615 (handle_stop_backwards): Support Lisp strings as well.
6616 (display_string): Support display of R2L glyph rows.
6617 Use IT_STRING_CHARPOS when displaying from a Lisp string.
6618 (init_iterator): Don't initialize it->bidi_p for strings
6619 here.
6620 (reseat_to_string): Initialize it->bidi_p for strings here.
6621 (next_element_from_string, next_element_from_c_string)
6622 (next_element_from_buffer): Add xassert's for correspondence
6623 between IT's object being iterated and it->bidi_it.string
6624 structure.
6625 (face_before_or_after_it_pos): Support bidi iteration.
6626 (next_element_from_c_string): Handle the case of the first string
6627 character that is not the first one in the visual order.
6628 (get_visually_first_element): New function, refactored from common
6629 parts of next_element_from_buffer, next_element_from_string, and
6630 next_element_from_c_string.
6631 (tool_bar_lines_needed, redisplay_tool_bar)
6632 (display_menu_bar): Force left-to-right direction. Add a FIXME
6633 comment for making that be controlled by a user option.
6634 (push_it, pop_it): Save and restore the state of the
6635 bidi iterator. Save and restore the bidi_p flag.
6636 (pop_it): Iterate out of display property for string iteration as
6637 well.
6638 (iterate_out_of_display_property): Support iteration over strings.
6639 (handle_single_display_spec): Set up it->bidi_it for iteration
6640 over a display string, and call bidi_init_it.
6641 (handle_single_display_spec, next_overlay_string)
6642 (get_overlay_strings_1, push_display_prop): Set up the bidi
6643 iterator for displaying display or overlay strings.
6644 (forward_to_next_line_start): Don't use the shortcut if
6645 bidi-iterating.
6646 (back_to_previous_visible_line_start): If handle_display_prop
6647 pushed the iterator stack, restore the internal state of the bidi
6648 iterator by calling bidi_pop_it same number of times.
6649 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
6650 and we are bidi-iterating, don't decrement the iterator position;
6651 instead, set the first_elt flag in the bidi iterator, to produce
6652 the same effect.
6653 (reseat_1): Remove redundant setting of string_from_display_prop_p.
6654 (push_display_prop): xassert that we are iterating a buffer.
6655 (push_it, pop_it): Save and restore paragraph_embedding member.
6656 (handle_single_display_spec, next_overlay_string)
6657 (get_overlay_strings_1, reseat_1, reseat_to_string)
6658 (push_display_prop): Set up the `unibyte' member of bidi_it.string
6659 correctly. Don't assume unibyte strings are not bidi-reordered.
6660 (compute_display_string_pos)
6661 (compute_display_string_end): Fix handling the case of C string.
6662 (push_it, pop_it): Save and restore from_disp_prop_p.
6663 (handle_single_display_spec, push_display_prop): Set the
6664 from_disp_prop_p flag.
6665 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
6666 (pop_it): Call iterate_out_of_display_property only if we are
6667 popping after iteration over a string that came from a display
6668 property. Fix a typo in popping stretch info. Add an assertion
6669 for verifying that the iterator position is in sync with the bidi
6670 iterator.
6671 (handle_single_display_spec, get_overlay_strings_1)
6672 (push_display_prop): Fix initialization of paragraph direction for
6673 string when that of the parent object is not yet determined.
6674 (reseat_1): Call bidi_init_it to resync the bidi
6675 iterator with IT's position. (Bug#7616)
6676 (find_row_edges): If ROW->start.pos gives position
6677 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
6678 (handle_stop, back_to_previous_visible_line_start, reseat_1):
6679 Reset the from_disp_prop_p flag.
6680 (SAVE_IT, RESTORE_IT): New macros.
6681 (pos_visible_p, face_before_or_after_it_pos)
6682 (back_to_previous_visible_line_start)
6683 (move_it_in_display_line_to, move_it_in_display_line)
6684 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6685 (try_scrolling, redisplay_window, display_line): Use them when
6686 saving a temporary copy of the iterator and restoring it back.
6687 (back_to_previous_visible_line_start, reseat_1)
6688 (init_iterator): Empty the bidi cache "stack".
6689 (move_it_in_display_line_to): If iterator ended up at
6690 EOL, but we never saw any buffer positions smaller than
6691 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
6692 motion in bidi-reordered lines.
6693 (move_it_in_display_line_to): Record prev_method and prev_pos
6694 immediately before the call to set_iterator_to_next. Fixes cursor
6695 motion in bidi-reordered lines with stretch glyphs and strings
6696 displayed in margins. (Bug#8133) (Bug#8867)
6697 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
6698 TO_CHARPOS.
6699 (pos_visible_p): Support positions in bidi-reordered lines.
6700 Save and restore bidi cache.
6701
6702 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
6703 (bidi_paragraph_info): Delete unused struct.
6704 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
6705 (bidi_cache_start): New variable.
6706 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
6707 to zero.
6708 (bidi_cache_fetch_state, bidi_cache_search)
6709 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6710 (bidi_cache_find, bidi_peek_at_next_level)
6711 (bidi_level_of_next_char, bidi_find_other_level_edge)
6712 (bidi_move_to_visually_next): Compare cache index with
6713 bidi_cache_start rather than with zero.
6714 (bidi_fetch_char): Accept new argument STRING; all callers
6715 changed. Support iteration over a string. Support strings with
6716 display properties. Support unibyte strings. Fix the type of
6717 `len' according to what STRING_CHAR_AND_LENGTH expects.
6718 (bidi_paragraph_init, bidi_resolve_explicit_1)
6719 (bidi_resolve_explicit, bidi_resolve_weak)
6720 (bidi_level_of_next_char, bidi_move_to_visually_next):
6721 Support iteration over a string.
6722 (bidi_set_sor_type, bidi_resolve_explicit_1)
6723 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
6724 can now be zero (for strings); special values 0 and -1 were
6725 changed to -1 and -2, respectively.
6726 (bidi_char_at_pos): New function.
6727 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
6728 Call it instead of FETCH_MULTIBYTE_CHAR.
6729 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
6730 initialized to valid values.
6731 (bidi_init_it): Don't initialize charpos and bytepos with invalid
6732 values.
6733 (bidi_level_of_next_char): Allow the sentinel "position" to pass
6734 the test for valid cached positions. Fix the logic for looking up
6735 the sentinel state in the cache. GCPRO the Lisp string we are
6736 iterating.
6737 (bidi_push_it, bidi_pop_it): New functions.
6738 (bidi_initialize): Initialize the bidi cache start stack pointer.
6739 (bidi_cache_ensure_space): New function, refactored from part of
6740 bidi_cache_iterator_state. Don't assume the required size is just
6741 one BIDI_CACHE_CHUNK away.
6742 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
6743 (bidi_count_bytes, bidi_char_at_pos): New functions.
6744 (bidi_cache_search): Don't assume bidi_cache_last_idx is
6745 always valid if bidi_cache_idx is valid.
6746 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
6747 is valid if it's going to be used.
6748 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
6749 (bidi_cache_fetch_state, bidi_cache_search)
6750 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6751 (bidi_cache_iterator_state, bidi_cache_find)
6752 (bidi_find_other_level_edge, bidi_cache_start_stack):
6753 All variables related to cache indices are now EMACS_INT.
6754
6755 * dispextern.h (struct bidi_string_data): New structure.
6756 (struct bidi_it): New member `string'. Make flag members be 1-bit
6757 fields, and put them last in the struct.
6758 (compute_display_string_pos, compute_display_string_end):
6759 Update prototypes.
6760 (bidi_push_it, bidi_pop_it): Add prototypes.
6761 (struct iterator_stack_entry): New members bidi_p,
6762 paragraph_embedding, and from_disp_prop_p.
6763 (struct it): Member bidi_p is now a bit field 1 bit wide.
6764 (bidi_shelve_cache, bidi_unshelve_cache):
6765 Declare prototypes.
6766
6767 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
6768 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
6769 and vector-like objects.
6770
6771 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
6772 cache around display iteration.
6773
6774 * window.c (Fwindow_end, window_scroll_pixel_based)
6775 (displayed_window_lines, Frecenter): Save and restore the bidi
6776 cache around display iteration.
6777
6778 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6779
6780 * editfns.c (Fdelete_region): Clarify the use of the named
6781 parameters (bug#6788).
6782
6783 2011-07-14 Martin Rudalics <rudalics@gmx.at>
6784
6785 * indent.c (Fvertical_motion): Set and restore w->pointm when
6786 saving and restoring the window's buffer (Bug#9006).
6787
6788 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
6789
6790 * editfns.c (Fstring_to_char): Clarify just what is returned
6791 (bug#6576). Text by Eli Zaretskii.
6792
6793 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
6794
6795 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
6796
6797 2011-07-13 Eli Zaretskii <eliz@gnu.org>
6798
6799 * buffer.c (mmap_find): Fix a typo.
6800
6801 2011-07-13 Johan Bockgård <bojohan@gnu.org>
6802
6803 Fix execution of x selection hooks.
6804 * xselect.c (Qx_lost_selection_functions)
6805 (Qx_sent_selection_functions): New vars.
6806 (syms_of_xselect): DEFSYM them.
6807 (x_handle_selection_request): Pass Qx_sent_selection_functions
6808 rather than Vx_sent_selection_functions to Frun_hook_with_args.
6809 (x_handle_selection_clear,x_clear_frame_selections):
6810 Pass Qx_lost_selection_functions rather than
6811 Vx_lost_selection_functions to Frun_hook_with_args.
6812
6813 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
6814
6815 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
6816 The old code sometimes used this field without initializing it.
6817
6818 * alloc.c (gc_sweep): Don't read past end of array.
6819 In theory, the old code could also have corrupted Emacs internals,
6820 though it'd be very unlikely.
6821
6822 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
6823
6824 * character.c (Fcharacterp): Don't advertise optional ignored
6825 argument. (Bug#4026)
6826
6827 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
6828
6829 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
6830 key" (bug#4257).
6831
6832 * window.c (Fset_window_start): Doc fix (bug#4199).
6833 (Fset_window_hscroll): Ditto.
6834
6835 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
6836
6837 Fix minor new problems caught by GCC 4.6.1.
6838 * term.c (init_tty): Remove unused local.
6839 * xsettings.c (store_monospaced_changed): Define this function only
6840 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
6841 not used otherwise.
6842
6843 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
6844
6845 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
6846
6847 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6848
6849 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
6850 are the mini-buffer and the echo area (bug#3320).
6851
6852 * term.c (init_tty): Remove support for supdup, c10 and perq
6853 terminals, which are no longer supported (bug#1482).
6854
6855 2011-07-10 Johan Bockgård <bojohan@gnu.org>
6856
6857 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
6858
6859 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
6860
6861 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
6862 for non-popups (Bug#3642).
6863
6864 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
6865
6866 * alloc.c (reset_malloc_hooks): Protoize.
6867 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
6868 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
6869 * cm.c (losecursor): Likewise.
6870 * data.c (fmod): Likewise.
6871 * dispnew.c (swap_glyphs_in_rows): Likewise.
6872 * emacs.c (memory_warning_signal): Likewise.
6873 * floatfns.c (float_error): Likewise.
6874 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
6875 (otf_open, font_otf_capability, generate_otf_features)
6876 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
6877 Likewise.
6878 * image.c (pbm_read_file): Likewise.
6879 * indent.c (string_display_width): Likewise.
6880 * intervals.c (check_for_interval, search_for_interval)
6881 (inc_interval_count, count_intervals, root_interval)
6882 (adjust_intervals_for_insertion, make_new_interval): Likewise.
6883 * lread.c (defalias): Likewise.
6884 * ralloc.c (r_alloc_check): Likewise.
6885 * regex.c (set_image_of_range_1, set_image_of_range)
6886 (regex_grow_registers): Likewise.
6887 * sysdep.c (strerror): Likewise.
6888 * termcap.c (valid_filename_p, tprint, main): Likewise.
6889 * tparam.c (main): Likewise.
6890 * unexhp9k800.c (run_time_remap, save_data_space)
6891 (update_file_ptrs, read_header, write_header, calculate_checksum)
6892 (copy_file, copy_rest, display_header): Likewise.
6893 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
6894 Likewise.
6895 * xdisp.c (check_it): Likewise.
6896 * xfaces.c (register_color, unregister_color, unregister_colors):
6897 Likewise.
6898 * xfns.c (print_fontset_result): Likewise.
6899 * xrdb.c (member, fatal, main): Likewise.
6900
6901 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
6902
6903 Fix minor problems found by static checking (Bug#9031).
6904 * chartab.c (char_table_set_range, map_sub_char_table):
6905 Remove unused locals.
6906 (uniprop_table): Now static.
6907 * composite.c (_work_char): Remove unused static var.
6908
6909 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
6910
6911 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
6912
6913 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
6914
6915 * gtkutil.c (qttip_cb): Remove code without function.
6916
6917 2011-07-09 Eli Zaretskii <eliz@gnu.org>
6918
6919 * w32.c (pthread_sigmask): New stub.
6920
6921 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
6922
6923 Use pthread_sigmask, not sigprocmask (Bug#9010).
6924 sigprocmask is portable only for single-threaded applications, and
6925 Emacs can be multi-threaded when it uses GTK.
6926 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
6927 (LIBES): Use it.
6928 * callproc.c (Fcall_process):
6929 * process.c (create_process):
6930 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
6931 Use pthread_sigmask, not sigprocmask.
6932
6933 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6934
6935 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
6936 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
6937 wrong (Bug#8591).
6938
6939 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6940
6941 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
6942 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
6943 (xg_hide_tooltip): Fix comment.
6944
6945 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
6946 in registerServicesMenuSendTypes.
6947 (validRequestorForSendType): Don't check ns_return_types.
6948
6949 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
6950 ns_return_type.
6951
6952 2011-07-08 Jason Rumney <jasonr@gnu.org>
6953
6954 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
6955 SH_SHOW for hidden windows (Bug#5482).
6956
6957 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
6958 frame struct members of non-existent frames (Bug#6284).
6959
6960 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6961
6962 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
6963 variable firstTime not needed on OSX >= 10.6.
6964 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
6965 >= 10.5. Use setKnobProportion, setDoubleValue.
6966
6967 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
6968 (MAC_OS_X_VERSION_10_5): Define if not defined.
6969 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
6970 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
6971 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
6972
6973 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
6974 cString and lossyCString on OSX >= 10.4
6975
6976 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
6977 sizeToFit on OSX >= 10.2.
6978
6979 * nsimage.m (allocInitFromFile): Don't use deprecated method
6980 bestRepresentationForDevice on OSX >= 10.6.
6981
6982 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
6983 to avoid warning.
6984
6985 * emacs.c: Declare unexec_init_emacs_zone.
6986
6987 * nsgui.h: Fix compiler warning about gnulib redefining verify.
6988
6989 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
6990
6991 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
6992 on svcsMenu (Bug#8842).
6993
6994 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
6995 ns_return_types.
6996 (Fns_list_services): Just return Qnil on 10.6, code not working there.
6997
6998 * nsterm.m (QUTF8_STRING): Declare.
6999 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
7000 (validRequestorForSendType): Return type is (id).
7001 Change indexOfObjectIdenticalTo to indexOfObject.
7002 Check if we have local selection before returning self (Bug#8842).
7003 (writeSelectionToPasteboard): Put local selection into paste board
7004 if we have a local selection (Bug#8842).
7005 (syms_of_nsterm): DEFSYM QUTF8_STRING.
7006
7007 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
7008 (ns_get_local_selection): Declare.
7009
7010 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
7011
7012 * keymap.c (describe_map_tree): Don't insert a double newline at
7013 the end of the buffer (bug#1169) and return whether we inserted
7014 something.
7015
7016 * callint.c (Fcall_interactively): Change "reading args" to
7017 "providing args" to try to clarify what it does (bug#1010).
7018
7019 2011-07-07 Kenichi Handa <handa@m17n.org>
7020
7021 * composite.c (composition_compute_stop_pos): Ignore a static
7022 composition starting before CHARPOS (Bug#8915).
7023
7024 * xdisp.c (handle_composition_prop): Likewise.
7025
7026 2011-07-07 Eli Zaretskii <eliz@gnu.org>
7027
7028 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
7029 (Bug#9015)
7030
7031 2011-07-07 Kenichi Handa <handa@m17n.org>
7032
7033 * character.h (unicode_category_t): New enum type.
7034
7035 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
7036 (Qchar_code_property_table): New variable.
7037 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
7038 (UNIPROP_COMPRESSED_FORM_P): New macros.
7039 (char_table_ascii): Uncompress the compressed values.
7040 (sub_char_table_ref): New arg is_uniprop. Callers changed.
7041 Uncompress the compressed values.
7042 (sub_char_table_ref_and_range): Likewise.
7043 (char_table_ref_and_range): Uncompress the compressed values.
7044 (sub_char_table_set): New arg is_uniprop. Callers changed.
7045 Uncompress the compressed values.
7046 (sub_char_table_set_range): Args changed. Callers changed.
7047 (char_table_set_range): Adjuted for the above change.
7048 (map_sub_char_table): Delete args default_val and parent. Add arg
7049 top. Give decoded values to a Lisp function.
7050 (map_char_table): Adjust for the above change. Give decoded
7051 values to a Lisp function. Gcpro more variables.
7052 (uniprop_table_uncompress)
7053 (uniprop_decode_value_run_length): New functions.
7054 (uniprop_decoder, uniprop_decoder_count): New variables.
7055 (uniprop_get_decoder, uniprop_encode_value_character)
7056 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
7057 New functions.
7058 (uniprop_encoder, uniprop_encoder_count): New variables.
7059 (uniprop_get_encoder, uniprop_table)
7060 (Funicode_property_table_internal, Fget_unicode_property_internal)
7061 (Fput_unicode_property_internal): New functions.
7062 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
7063 Sunicode_property_table_internal, Sget_unicode_property_internal,
7064 and Sput_unicode_property_internal. Defvar_lisp
7065 char-code-property-alist.
7066
7067 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
7068 Vunicode_category_table.
7069
7070 * font.c (font_range): Adjust for the change of
7071 Vunicode_category_table.
7072
7073 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
7074
7075 * m/iris4d.h: Remove file, move contents ...
7076 * s/irix6-5.h: ... here.
7077
7078 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 Remove unportable assumption about struct layout (Bug#8884).
7081 * alloc.c (mark_buffer):
7082 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
7083 (clone_per_buffer_values): Don't assume that
7084 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
7085 This isn't true in general, and it's particularly not true
7086 if Emacs is configured with --with-wide-int.
7087 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
7088 New macros, used in the buffer.c change.
7089
7090 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
7091
7092 * xsettings.c: Use both GConf and GSettings if both are available.
7093 (store_config_changed_event): Add comment.
7094 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
7095 (store_tool_bar_style_changed): New functions.
7096 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
7097 (struct xsettings): Move font inside HAVE_XFT.
7098 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
7099 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
7100 Move inside HAVE_XFT.
7101 (something_changed_gsettingsCB): Rename from something_changedCB.
7102 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
7103 also.
7104 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
7105 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
7106 (something_changed_gconfCB): Rename from something_changedCB.
7107 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
7108 (parse_settings): Move check for font inside HAVE_XFT.
7109 (read_settings, apply_xft_settings): Add comment.
7110 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
7111 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
7112 call store_font_name_changed.
7113 (xft_settings_event): Add comment.
7114 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
7115 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
7116 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
7117 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
7118 (xsettings_initialize): Call init_gsettings last.
7119 (xsettings_get_system_font, xsettings_get_system_normal_font):
7120 Add comment.
7121
7122 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
7123
7124 Random fixes. E.g., (random) never returned negative values.
7125 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
7126 subseconds part to the entropy, as that's a bit more random.
7127 Prefer signed to unsigned, since the signedness doesn't matter and
7128 in general we prefer signed. When given a limit, use a
7129 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
7130 latter isn't right if USE_2_TAGS_FOR_INTS.
7131 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
7132 not 0..VALMASK. Don't discard "excess" bits that random () returns.
7133
7134 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7135
7136 * textprop.c (text_property_stickiness):
7137 Obey Vtext_property_default_nonsticky.
7138 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
7139 * w32fns.c (syms_of_w32fns):
7140 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
7141
7142 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7143
7144 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
7145 This is more efficient than Ffile_directory_p and avoids a minor race.
7146
7147 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
7148
7149 * buffer.c (Foverlay_put): Say what the return value is
7150 (bug#7835).
7151
7152 * fileio.c (barf_or_query_if_file_exists): Check first if the file
7153 is a directory before asking whether to use the file name
7154 (bug#7564).
7155 (barf_or_query_if_file_exists): Make the "File is a directory"
7156 error be more correct.
7157
7158 * fns.c (Frequire): Remove the mention of the .gz files, since
7159 that's installation-specific, but keep the mention of
7160 `get-load-suffixes'.
7161
7162 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7163
7164 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
7165 Report string overflow if the output is too long.
7166
7167 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
7168
7169 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
7170 (syms_of_gnutls): Remove duplicate DEFSYM for
7171 Qgnutls_bootprop_verify_hostname_error, an error for
7172 Qgnutls_bootprop_verify_error (which is no longer used).
7173
7174 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
7175 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
7176 Also (re)move comments that are misplaced or no longer relevant.
7177
7178 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7179
7180 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
7181
7182 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
7183
7184 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
7185 and background color parameters if they have been changed.
7186
7187 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7188
7189 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
7190
7191 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
7192
7193 * xsettings.c (SYSTEM_FONT): Define only when used.
7194 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
7195
7196 * keymap.c (access_keymap_1): Now static.
7197
7198 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
7199
7200 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
7201 leave any prefix arg for the up event (Bug#1586).
7202
7203 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
7204
7205 * lread.c (syms_of_lread): Mention single symbols defined by
7206 `defvar' or `defconst' (bug#7154).
7207
7208 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7209 (Frequire): Mention get-load-suffixes.
7210
7211 2011-07-02 Martin Rudalics <rudalics@gmx.at>
7212
7213 * window.h (window): Remove clone_number slot.
7214 * window.c (Fwindow_clone_number, Fset_window_clone_number):
7215 Remove.
7216 (make_parent_window, make_window, saved_window)
7217 (Fset_window_configuration, save_window_save): Don't deal with
7218 clone numbers.
7219 * buffer.c (Qclone_number): Remove declaration.
7220 (sort_overlays, overlay_strings): Don't deal with clone numbers.
7221
7222 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
7223
7224 Add multiple inheritance to keymaps.
7225 * keymap.c (Fmake_composed_keymap): New function.
7226 (Fset_keymap_parent): Simplify.
7227 (fix_submap_inheritance): Remove.
7228 (access_keymap_1): New function extracted from access_keymap to handle
7229 embedded parents and handle lists of maps.
7230 (access_keymap): Use it.
7231 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
7232 (Fcopy_keymap): Handle embedded parents.
7233 (Fcommand_remapping, define_as_prefix): Simplify.
7234 (Fkey_binding): Simplify.
7235 (syms_of_keymap): Move minibuffer-local-completion-map,
7236 minibuffer-local-filename-completion-map,
7237 minibuffer-local-must-match-map, and
7238 minibuffer-local-filename-must-match-map to Elisp.
7239 (syms_of_keymap): Defsubr make-composed-keymap.
7240 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
7241 (parse_menu_item): Trivial simplification.
7242
7243 2011-07-01 Glenn Morris <rgm@gnu.org>
7244
7245 * Makefile.in (SETTINGS_LIBS): Fix typo.
7246
7247 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
7248
7249 * coding.c (Fencode_coding_string): Record the last coding system
7250 used, as the function doc string says (bug#8738).
7251
7252 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
7253
7254 * xsettings.c (store_monospaced_changed): Take new font as arg and
7255 check for change against current_mono_font.
7256 (EMACS_TYPE_SETTINGS): Remove this and related defines.
7257 (emacs_settings_constructor, emacs_settings_get_property)
7258 (emacs_settings_set_property, emacs_settings_class_init)
7259 (emacs_settings_init, gsettings_obj): Remove.
7260 (something_changedCB): New function for HAVE_GSETTINGS.
7261 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
7262 with value as argument.
7263 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
7264 g_settings_new (Bug#8967). Do not create gsettings_obj.
7265 Remove calls to g_settings_bind. Connect something_changedCB to
7266 "changed".
7267
7268 * xgselect.c: Add defined (HAVE_GSETTINGS).
7269 (xgselect_initialize): Ditto.
7270
7271 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
7272 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
7273 xg_select.
7274
7275 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7276
7277 * eval.c (struct backtrace): Simplify and port the data structure.
7278 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
7279 signed bit field, as this assumption is not portable and it makes
7280 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
7281 "char debug_on_exit : 1" as this is not portable either; instead,
7282 use the portable "unsigned int debug_on_exit : 1". Remove unused
7283 member evalargs. Remove obsolete comments about cc bombing out.
7284
7285 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
7286
7287 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
7288 Let HAVE_GSETTINGS override HAVE_GCONF.
7289 (store_monospaced_changed): New function.
7290 (EMACS_SETTINGS): A new type derived from GObject to handle
7291 GSettings notifications.
7292 (emacs_settings_constructor, emacs_settings_get_property)
7293 (emacs_settings_set_property, emacs_settings_class_init):
7294 New functions.
7295 (gsettings_client, gsettings_obj): New variables.
7296 (GSETTINGS_SCHEMA): New define.
7297 (something_changedCB): Call store_monospaced_changed.
7298 (init_gsettings): New function.
7299 (xsettings_initialize): Call init_gsettings.
7300 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
7301 to NULL.
7302
7303 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
7304 GCONF_CFLAGS/LIBS.
7305
7306 2011-06-29 Martin Rudalics <rudalics@gmx.at>
7307
7308 * window.c (resize_root_window, grow_mini_window)
7309 (shrink_mini_window): Rename Qresize_root_window to
7310 Qwindow_resize_root_window and Qresize_root_window_vertically to
7311 Qwindow_resize_root_window_vertically.
7312
7313 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
7314
7315 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
7316
7317 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
7318
7319 * makefile.w32-in: Redesign dependencies so they reflect more
7320 clearly which files are directly included by each source file,
7321 and not through other includes.
7322
7323 2011-06-27 Martin Rudalics <rudalics@gmx.at>
7324
7325 * buffer.c (Qclone_number): Declare static and DEFSYM it.
7326 (sort_overlays, overlay_strings): When an overlay's clone number
7327 matches the window's clone number process the overlay even if
7328 the overlay's window property doesn't match the current window.
7329
7330 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
7331 (Fwindow_hchild): Rename to Fwindow_left_child.
7332 (Fwindow_next): Rename to Fwindow_next_sibling.
7333 (Fwindow_prev): Rename to Fwindow_prev_sibling.
7334 (resize_window_check): Rename to window_resize_check.
7335 (resize_window_apply): Rename to window_resize_apply.
7336 (Fresize_window_apply): Rename to Fwindow_resize_apply.
7337 (Fdelete_other_windows_internal, resize_frame_windows)
7338 (Fsplit_window_internal, Fdelete_window_internal)
7339 (grow_mini_window, shrink_mini_window)
7340 (Fresize_mini_window_internal): Fix callers accordingly.
7341
7342 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
7343
7344 * emacsgtkfixed.h: State that this is only used with Gtk+3.
7345 (emacs_fixed_set_min_size): Remove.
7346 (emacs_fixed_new): Take frame as argument.
7347
7348 * emacsgtkfixed.c: State that this is only used with Gtk+3.
7349 (_EmacsFixedPrivate): Remove minwidth/height.
7350 Add struct frame *f.
7351 (emacs_fixed_init): Initialize priv->f.
7352 (get_parent_class, emacs_fixed_set_min_size): Remove.
7353 (emacs_fixed_new): Set priv->f to argument.
7354 (emacs_fixed_get_preferred_width)
7355 (emacs_fixed_get_preferred_height): Use min_width/height from
7356 frames size_hint to set minimum and natural (Bug#8919).
7357 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
7358 and use min_width/height from frames size_hint to set
7359 min_width/height (Bug#8919).
7360
7361 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
7362 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
7363 Fix indentation.
7364
7365 2011-06-26 Eli Zaretskii <eliz@gnu.org>
7366
7367 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
7368 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
7369 called at ZV.
7370
7371 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
7372
7373 * process.c (wait_reading_process_output): Bypass select if
7374 waiting for a cell while ignoring keyboard input, and input is
7375 pending. Suggested by Jan Djärv (Bug#8869).
7376
7377 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
7378
7379 Use gnulib's dup2 module instead of rolling our own.
7380 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
7381
7382 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7383
7384 * dispnew.c (scrolling_window): Before scrolling, turn off a
7385 mouse-highlight in the window being scrolled.
7386
7387 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
7388
7389 Move DEFSYM to lisp.h and use everywhere.
7390
7391 * character.h (DEFSYM): Move declaration...
7392 * lisp.h (DEFSYM): ...here.
7393
7394 * gnutls.c:
7395 * minibuf.c:
7396 * w32menu.c:
7397 * w32proc.c:
7398 * w32select.c: Don't include character.h.
7399
7400 * alloc.c (syms_of_alloc):
7401 * buffer.c (syms_of_buffer):
7402 * bytecode.c (syms_of_bytecode):
7403 * callint.c (syms_of_callint):
7404 * casefiddle.c (syms_of_casefiddle):
7405 * casetab.c (init_casetab_once):
7406 * category.c (init_category_once, syms_of_category):
7407 * ccl.c (syms_of_ccl):
7408 * cmds.c (syms_of_cmds):
7409 * composite.c (syms_of_composite):
7410 * dbusbind.c (syms_of_dbusbind):
7411 * dired.c (syms_of_dired):
7412 * dispnew.c (syms_of_display):
7413 * doc.c (syms_of_doc):
7414 * editfns.c (syms_of_editfns):
7415 * emacs.c (syms_of_emacs):
7416 * eval.c (syms_of_eval):
7417 * fileio.c (syms_of_fileio):
7418 * fns.c (syms_of_fns):
7419 * frame.c (syms_of_frame):
7420 * fringe.c (syms_of_fringe):
7421 * insdel.c (syms_of_insdel):
7422 * keymap.c (syms_of_keymap):
7423 * lread.c (init_obarray, syms_of_lread):
7424 * macros.c (syms_of_macros):
7425 * msdos.c (syms_of_msdos):
7426 * print.c (syms_of_print):
7427 * process.c (syms_of_process):
7428 * search.c (syms_of_search):
7429 * sound.c (syms_of_sound):
7430 * syntax.c (init_syntax_once, syms_of_syntax):
7431 * terminal.c (syms_of_terminal):
7432 * textprop.c (syms_of_textprop):
7433 * undo.c (syms_of_undo):
7434 * w32.c (globals_of_w32):
7435 * window.c (syms_of_window):
7436 * xdisp.c (syms_of_xdisp):
7437 * xfaces.c (syms_of_xfaces):
7438 * xfns.c (syms_of_xfns):
7439 * xmenu.c (syms_of_xmenu):
7440 * xsettings.c (syms_of_xsettings):
7441 * xterm.c (syms_of_xterm): Use DEFSYM.
7442
7443 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
7444
7445 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
7446
7447 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
7448
7449 Integer and buffer overflow fixes (Bug#8873).
7450
7451 * print.c (printchar, strout): Check for string overflow.
7452 (PRINTPREPARE, printchar, strout):
7453 Don't set size unless allocation succeeds.
7454
7455 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
7456 for sizes. Check for string overflow more accurately.
7457 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
7458
7459 * macros.c: Integer and buffer overflow fixes.
7460 * keyboard.h (struct keyboard.kbd_macro_bufsize):
7461 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
7462 Use ptrdiff_t, not int, for sizes.
7463 Don't increment bufsize until after realloc succeeds.
7464 Check for size-calculation overflow.
7465 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
7466
7467 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
7468
7469 * lread.c: Integer overflow fixes.
7470 (read_integer): Radix is now EMACS_INT, not int,
7471 to improve quality of diagnostics for out-of-range radices.
7472 Calculate buffer size correctly for out-of-range radices.
7473 (read1): Check for integer overflow in radices, and in
7474 read-circle numbers.
7475 (read_escape): Avoid int overflow.
7476 (Fload, openp, read_buffer_size, read1)
7477 (substitute_object_recurse, read_vector, read_list, map_obarray):
7478 Use ptrdiff_t, not int, for sizes.
7479 (read1): Use EMACS_INT, not int, for sizes.
7480 Check for size overflow.
7481
7482 * image.c (cache_image): Check for size arithmetic overflow.
7483
7484 * lread.c: Integer overflow issues.
7485 (saved_doc_string_size, saved_doc_string_length)
7486 (prev_saved_doc_string_size, prev_saved_doc_string_length):
7487 Now ptrdiff_t, not int.
7488 (read1): Don't assume doc string length fits in int. Check for
7489 out-of-range doc string lengths.
7490 (read_list): Don't assume file position fits in int.
7491 (read_escape): Check for hex character overflow.
7492
7493 2011-06-22 Leo Liu <sdl.web@gmail.com>
7494
7495 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
7496 Move to minibuffer.el.
7497
7498 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7499
7500 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
7501 The following patches are for when GLYPH_DEBUG && !XASSERT.
7502 * dispextern.h (trace_redisplay_p, dump_glyph_string):
7503 * dispnew.c (flush_stdout):
7504 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
7505 Mark as externally visible.
7506 * dispnew.c (check_window_matrix_pointers): Now static.
7507 * dispnew.c (window_to_frame_vpos):
7508 * xfns.c (unwind_create_frame):
7509 * xterm.c (x_check_font): Remove unused local.
7510 * scroll.c (CHECK_BOUNDS):
7511 * xfaces.c (cache_fache): Rename local to avoid shadowing.
7512 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
7513 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
7514 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
7515 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
7516 Now static.
7517 (debug_method_add): Use va_list and vsprintf rather than relying
7518 on undefined behavior with wrong number of arguments.
7519 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
7520 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
7521 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
7522 since we're not interested in debugging glyphs with old libraries.
7523 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
7524 GCC 4.6.0's static checking.
7525
7526 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7527
7528 Integer overflow and signedness fixes (Bug#8873).
7529 A few related buffer overrun fixes, too.
7530
7531 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
7532
7533 * dispextern.h (struct face.stipple):
7534 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
7535 (x_bitmap_mask, x_allocate_bitmap_record)
7536 (x_create_bitmap_from_data, x_create_bitmap_from_file)
7537 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
7538 (x_create_bitmap_from_xpm_data):
7539 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
7540 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
7541 (.bitmaps_last):
7542 * xfaces.c (load_pixmap):
7543 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
7544 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
7545 (.bitmaps_last, struct x_output.icon_bitmap):
7546 Use ptrdiff_t, not int, for bitmap indexes.
7547 (x_allocate_bitmap_record): Check for size overflow.
7548 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
7549
7550 Use ptrdiff_t, not int, for overlay counts.
7551 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
7552 * editfns.c (overlays_around, get_pos_property):
7553 * textprop.c (get_char_property_and_overlay):
7554 * xdisp.c (next_overlay_change, note_mouse_highlight):
7555 * xfaces.c (face_at_buffer_position):
7556 * buffer.c (OVERLAY_COUNT_MAX): New macro.
7557 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
7558 (Fnext_overlay_change, Fprevious_overlay_change)
7559 (mouse_face_overlay_overlaps, Foverlays_in):
7560 Use ptrdiff_t, not int, for sizes.
7561 (overlays_at, overlays_in): Check for size-calculation overflow.
7562
7563 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
7564
7565 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
7566 (x_session_initialize): Do not assume string length fits in int.
7567
7568 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
7569 This is unlikely, but can occur if DPI is outlandish.
7570
7571 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
7572 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
7573
7574 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
7575 * xrdb.c (magic_file_p, search_magic_path):
7576 Omit last arg SUFFIX; it was always 0. All callers changed.
7577 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
7578
7579 * xfont.c (xfont_match): Avoid need for strlen.
7580
7581 * xfns.c: Don't assume strlen fits in int.
7582 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
7583
7584 * xdisp.c (message_log_check_duplicate): Return intmax_t,
7585 not unsigned long, as we prefer signed integers. All callers changed.
7586 Detect integer overflow in repeat count.
7587 (message_dolog): Don't assume print length fits in 39 bytes.
7588 (display_mode_element): Don't assume strlen fits in int.
7589
7590 * termcap.c: Don't assume sizes fit in int and never overflow.
7591 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
7592 (gobble_line): Check for size-calculation overflow.
7593
7594 * minibuf.c (Fread_buffer):
7595 * lread.c (intern, intern_c_string):
7596 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
7597 Don't assume string length fits in int.
7598
7599 * keyboard.c (parse_tool_bar_item):
7600 * gtkutil.c (style_changed_cb): Avoid need for strlen.
7601
7602 * font.c: Don't assume string length fits in int.
7603 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
7604 Use ptrdiff_t, not int.
7605 (font_intern_prop): Don't assume string length fits in int.
7606 Don't assume integer property fits in fixnum.
7607 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
7608
7609 * filelock.c: Fix some buffer overrun and integer overflow issues.
7610 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
7611 Reformulate so as not to need the command string.
7612 Invoke gzip -cd rather than gunzip, as it's more portable.
7613 (lock_info_type, lock_file_1, lock_file):
7614 Don't assume pid_t and time_t fit in unsigned long.
7615 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
7616 (current_lock_owner): Prefer signed type for sizes.
7617 Use memcpy, not strncpy, where memcpy is what is really wanted.
7618 Don't assume (via atoi) that time_t and pid_t fit in int.
7619 Check for time_t and/or pid_t out of range, e.g., via a network share.
7620 Don't alloca where an auto var works fine.
7621
7622 * fileio.c: Fix some integer overflow issues.
7623 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
7624 Don't assume string length fits in int.
7625 (directory_file_name): Don't assume string length fits in long.
7626 (make_temp_name): Don't assume pid fits in int, or that its print
7627 length is less than 20.
7628
7629 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
7630
7631 * coding.c (make_subsidiaries): Don't assume string length fits in int.
7632
7633 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
7634
7635 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
7636 We prefer signed integers, even for size calculations.
7637
7638 * emacs.c: Don't assume string length fits in 'int'.
7639 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
7640 (main): Don't invoke strlen when not needed.
7641
7642 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
7643 (XD_DEBUG_MESSAGE): Don't waste a byte.
7644
7645 * callproc.c (getenv_internal_1, getenv_internal)
7646 (Fgetenv_internal):
7647 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
7648
7649 * lread.c (invalid_syntax): Omit length argument.
7650 All uses changed. This doesn't fix a bug, but it simplifies the
7651 code away from its former Hollerith-constant appearance, and it's
7652 one less 'int' to worry about when looking at integer-overflow issues.
7653 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
7654
7655 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
7656 This didn't break anything, but it didn't help either.
7657 It's confusing to put a bogus integer in a place where the actual
7658 value does not matter.
7659 (LIST_END_P): Remove unused macro and its bogus comment.
7660 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
7661
7662 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
7663 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
7664 implementation.
7665 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
7666 We prefer signed types, and the value cannot exceed the EMACS_INT
7667 range anyway (because otherwise the length would not be representable).
7668 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
7669 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
7670 This avoids a GCC warning when WIDE_EMACS_INT.
7671
7672 * indent.c (sane_tab_width): New function.
7673 (current_column, scan_for_column, Findent_to, position_indentation)
7674 (compute_motion): Use it. This is just for clarity.
7675 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
7676
7677 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
7678
7679 * lisp.h (lint_assume): New macro.
7680 * composite.c (composition_gstring_put_cache):
7681 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
7682
7683 * editfns.c, insdel.c:
7684 Omit unnecessary forward decls, to simplify future changes.
7685
7686 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
7687
7688 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
7689
7690 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
7691 Use much-faster test for byte-length change.
7692 Don't assume string byte-length fits in 'int'.
7693 Check that character arg fits in 'int'.
7694 (mapcar1): Declare byte as byte, for clarity.
7695
7696 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
7697
7698 * fns.c (concat): Catch string overflow earlier.
7699 Do not rely on integer wraparound.
7700
7701 * dispextern.h (struct it.overlay_strings_charpos)
7702 (struct it.selective): Now EMACS_INT, not int.
7703 * xdisp.c (forward_to_next_line_start)
7704 (back_to_previous_visible_line_start)
7705 (reseat_at_next_visible_line_start, next_element_from_buffer):
7706 Don't arbitrarily truncate the value of 'selective' to int.
7707
7708 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
7709
7710 * composite.c: Don't truncate sizes to 'int'.
7711 (composition_gstring_p, composition_reseat_it)
7712 (composition_adjust_point): Use EMACS_INT, not int.
7713 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
7714 not EMACS_UINT, for indexes.
7715
7716 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
7717
7718 * buffer.c: Include <verify.h>.
7719 (struct sortvec.priority, struct sortstr.priority):
7720 Now EMACS_INT, not int.
7721 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
7722 (struct sortstr.size, record_overlay_string)
7723 (struct sortstrlist.size, struct sortlist.used):
7724 Don't truncate size to int.
7725 (record_overlay_string): Check for size-calculation overflow.
7726 (init_buffer_once): Check at compile-time, not run-time.
7727
7728 2011-06-22 Jim Meyering <meyering@redhat.com>
7729
7730 Don't leak an XBM-image-sized buffer
7731 * image.c (xbm_load): Free the image buffer after using it.
7732
7733 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
7734
7735 Port to Sun C.
7736 * composite.c (find_automatic_composition): Omit needless 'return 0;'
7737 that Sun C diagnosed.
7738 * fns.c (secure_hash): Fix pointer signedness issue.
7739 * intervals.c (static_offset_intervals): New function.
7740 (offset_intervals): Use it.
7741
7742 2011-06-21 Leo Liu <sdl.web@gmail.com>
7743
7744 * deps.mk (fns.o):
7745 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
7746 sha512.h.
7747
7748 * fns.c (secure_hash): Rename from crypto_hash_function and change
7749 the first arg to accept symbols.
7750 (Fsecure_hash): New primitive.
7751 (syms_of_fns): New symbols.
7752
7753 2011-06-20 Deniz Dogan <deniz@dogan.se>
7754
7755 * process.c (Fset_process_buffer): Clarify return value in
7756 docstring.
7757
7758 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
7759
7760 * dispnew.c (add_window_display_history): Use BVAR.
7761
7762 * xdisp.c (debug_method_add): Use BVAR.
7763 (check_window_end, dump_glyph_matrix, dump_glyph)
7764 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
7765
7766 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
7767 Likewise.
7768
7769 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
7770 check till after the cache is created in init_frame_faces.
7771
7772 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
7773
7774 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
7775
7776 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
7777
7778 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
7779 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
7780 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
7781
7782 Improve buffer-overflow checking (Bug#8873).
7783 * fileio.c (Finsert_file_contents):
7784 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
7785 Remove the old (too-loose) buffer overflow checks.
7786 They weren't needed, since make_gap checks for buffer overflow.
7787 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
7788 The old code merely checked for Emacs fixnum overflow, and relied
7789 on undefined (wraparound) behavior. The new code avoids undefined
7790 behavior, and also checks for ptrdiff_t and/or size_t overflow.
7791
7792 * editfns.c (Finsert_char): Don't dump core with very negative counts.
7793 Tune. Don't use wider integers than needed. Don't use alloca.
7794 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
7795
7796 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
7797
7798 * insdel.c, lisp.h (buffer_overflow): New function.
7799 (insert_from_buffer_1, replace_range, replace_range_2):
7800 * insdel.c (make_gap_larger):
7801 * editfns.c (Finsert_char):
7802 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
7803
7804 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
7805
7806 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
7807
7808 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
7809
7810 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
7811 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
7812
7813 * fileio.c: Don't assume EMACS_INT fits in off_t.
7814 (emacs_lseek): New static function.
7815 (Finsert_file_contents, Fwrite_region): Use it.
7816 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
7817
7818 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
7819
7820 * fns.c: Don't overflow int when computing a list length.
7821 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
7822 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
7823 truncation on 64-bit hosts. Check for QUIT every
7824 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
7825 faster and is responsive enough.
7826 (Flength): Report an error instead of overflowing an integer.
7827 (Fsafe_length): Return a float if the value is not representable
7828 as a fixnum. This shouldn't happen except in contrived situations.
7829 (Fnthcdr, Fsort): Don't assume list length fits in int.
7830 (Fcopy_sequence): Don't assume vector length fits in int.
7831
7832 * alloc.c: Check that resized vectors' lengths fit in fixnums.
7833 (header_size, word_size): New constants.
7834 (allocate_vectorlike): Don't check size overflow here.
7835 (allocate_vector): Check it here instead, since this is the only
7836 caller of allocate_vectorlike that could cause overflow.
7837 Check that the new vector's length is representable as a fixnum.
7838
7839 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
7840 The previous code was bogus. For example, next_almost_prime (32)
7841 returned 39, which is undesirable as it is a multiple of 3; and
7842 next_almost_prime (24) returned 25, which is a multiple of 5 so
7843 why was the code bothering to check for multiples of 7?
7844
7845 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
7846
7847 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
7848
7849 Variadic C functions now count arguments with ptrdiff_t.
7850 This partly undoes my 2011-03-30 change, which replaced int with size_t.
7851 Back then I didn't know that the Emacs coding style prefers signed int.
7852 Also, in the meantime I found a few more instances where arguments
7853 were being counted with int, which may truncate counts on 64-bit
7854 machines, or EMACS_INT, which may be unnecessarily wide.
7855 * lisp.h (struct Lisp_Subr.function.aMANY)
7856 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
7857 Arg counts are now ptrdiff_t, not size_t.
7858 All variadic functions and their callers changed accordingly.
7859 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
7860 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
7861 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
7862 * callint.c (Fcall_interactively): Check arg count for overflow,
7863 to avoid potential buffer overrun. Use signed char, not 'int',
7864 for 'varies' array, so that we needn't bother to check its size
7865 calculation for overflow.
7866 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
7867 * eval.c (apply_lambda):
7868 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
7869 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
7870 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
7871
7872 * callint.c (Fcall_interactively): Don't use index var as event count.
7873
7874 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
7875 * mem-limits.h (SIZE): Remove; no longer used.
7876
7877 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
7878
7879 Remove unnecessary casts.
7880 * xterm.c (x_term_init):
7881 * xfns.c (x_set_border_pixel):
7882 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
7883 These aren't needed now that we assume ANSI C.
7884
7885 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
7886 It's more likely to cause problems (due to unsigned overflow)
7887 than to cure them.
7888
7889 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
7890
7891 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
7892
7893 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
7894
7895 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
7896
7897 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
7898
7899 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
7900
7901 GLYPH_CODE_FACE returns EMACS_INT, not int.
7902 * dispextern.h (merge_faces):
7903 * xfaces.c (merge_faces):
7904 * xdisp.c (get_next_display_element, next_element_from_display_vector):
7905 Don't assume EMACS_INT fits in int.
7906
7907 * character.h (CHAR_VALID_P): Remove unused parameter.
7908 * fontset.c, lisp.h, xdisp.c: All uses changed.
7909
7910 * editfns.c (Ftranslate_region_internal): Omit redundant test.
7911
7912 * fns.c (concat): Minor tuning based on overflow analysis.
7913 This doesn't fix any bugs. Use int to hold character, instead
7914 of constantly refetching from Emacs object. Use XFASTINT, not
7915 XINT, for value known to be a character. Don't bother comparing
7916 a single byte to 0400, as it's always less.
7917
7918 * floatfns.c (Fexpt):
7919 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
7920
7921 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
7922 for characters.
7923
7924 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
7925
7926 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
7927 Without this fix, on a 64-bit host (aset S 0 4294967386) would
7928 incorrectly succeed when S was a string, because 4294967386 was
7929 truncated before it was used.
7930
7931 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
7932 Otherwise, an out-of-range integer could cause undefined behavior
7933 on a 64-bit host.
7934
7935 * composite.c: Use int, not EMACS_INT, for characters.
7936 (fill_gstring_body, composition_compute_stop_pos): Use int, not
7937 EMACS_INT, for values that are known to be in character range.
7938 This doesn't fix any bugs but is the usual style inside Emacs and
7939 may generate better code on 32-bit machines.
7940
7941 Make sure a 64-bit char is never passed to ENCODE_CHAR.
7942 This is for reasons similar to the recent CHAR_STRING fix.
7943 * charset.c (Fencode_char): Check that character arg is actually
7944 a character. Pass an int to ENCODE_CHAR.
7945 * charset.h (ENCODE_CHAR): Verify that the character argument is no
7946 wider than 'int', as a compile-time check to prevent future regressions
7947 in this area.
7948
7949 * character.c (char_string): Remove unnecessary casts.
7950
7951 Make sure a 64-bit char is never passed to CHAR_STRING.
7952 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
7953 by silently ignoring the top 32 bits, allowing some values
7954 that were far too large to be valid characters.
7955 * character.h: Include <verify.h>.
7956 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
7957 arguments are no wider than unsigned, as a compile-time check
7958 to prevent future regressions in this area.
7959 * data.c (Faset):
7960 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
7961 (Fsubst_char_in_region):
7962 * fns.c (concat):
7963 * xdisp.c (decode_mode_spec_coding):
7964 Adjust to CHAR_STRING's new requirement.
7965 * editfns.c (Finsert_char, Fsubst_char_in_region):
7966 * fns.c (concat): Check that character args are actually
7967 characters. Without this test, these functions did the wrong
7968 thing with wildly out-of-range values on 64-bit hosts.
7969
7970 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
7971 These casts should not be needed on 32-bit hosts, either.
7972 * keyboard.c (read_char):
7973 * lread.c (Fload): Remove casts to unsigned.
7974
7975 * lisp.h (UNSIGNED_CMP): New macro.
7976 This fixes comparison bugs on 64-bit hosts.
7977 (ASCII_CHAR_P): Use it.
7978 * casefiddle.c (casify_object):
7979 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
7980 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
7981 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
7982 * dispextern.h (FACE_FROM_ID):
7983 * keyboard.c (read_char): Use UNSIGNED_CMP.
7984
7985 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
7986 not to EMACS_INT, to avoid GCC warning.
7987
7988 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
7989
7990 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
7991 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
7992 isn't needed on 32-bit machines.
7993
7994 * buffer.c (Fgenerate_new_buffer_name):
7995 Use EMACS_INT for count, not int.
7996 (advance_to_char_boundary): Return EMACS_INT, not int.
7997
7998 * data.c (Qcompiled_function): Now static.
7999
8000 * window.c (window_body_lines): Now static.
8001
8002 * image.c (gif_load): Rename local to avoid shadowing.
8003
8004 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
8005 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
8006 * alloc.c (make_save_value): Integer argument is now of type
8007 ptrdiff_t, not int.
8008 (mark_object): Use ptrdiff_t, not int.
8009 * lisp.h (pD): New macro.
8010 * print.c (print_object): Use it.
8011
8012 * alloc.c: Use EMACS_INT, not int, to count objects.
8013 (total_conses, total_markers, total_symbols, total_vector_size)
8014 (total_free_conses, total_free_markers, total_free_symbols)
8015 (total_free_floats, total_floats, total_free_intervals)
8016 (total_intervals, total_strings, total_free_strings):
8017 Now EMACS_INT, not int. All uses changed.
8018 (Fgarbage_collect): Compute overall total using a double, so that
8019 integer overflow is less likely to be a problem. Check for overflow
8020 when converting back to an integer.
8021 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
8022 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
8023 These were 'int' variables that could overflow on 64-bit hosts;
8024 they were never used, so remove them instead of repairing them.
8025 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
8026 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
8027 Previously, this ceilinged at INT_MAX, but that doesn't work on
8028 64-bit machines.
8029 (allocate_pseudovector): Don't use EMACS_INT when int would do.
8030
8031 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
8032 (allocate_vectorlike): Check for ptrdiff_t overflow.
8033 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
8034 when a (possibly-narrower) signed value would do just as well.
8035 We prefer using signed arithmetic, to avoid comparison confusion.
8036
8037 * alloc.c: Catch some string size overflows that we were missing.
8038 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
8039 for convenience in STRING_BYTES_MAX.
8040 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
8041 The definition here is exact; the one in lisp.h was approximate.
8042 (allocate_string_data): Check for string overflow. This catches
8043 some instances we weren't catching before. Also, it catches
8044 size_t overflow on (unusual) hosts where SIZE_MAX <= min
8045 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
8046 and ptrdiff_t and EMACS_INT are both 64 bits.
8047
8048 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
8049 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
8050 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
8051
8052 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
8053
8054 * alloc.c (Fmake_string): Check for out-of-range init.
8055
8056 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
8057
8058 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
8059
8060 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
8061
8062 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
8063 xg_get_default_scrollbar_width.
8064
8065 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
8066 (int_gtk_range_get_value): Move to the scroll bar part of the file.
8067 (style_changed_cb): Call update_theme_scrollbar_width and call
8068 x_set_scroll_bar_default_width and xg_frame_set_char_size for
8069 all frames (Bug#8505).
8070 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
8071 Call gtk_window_set_resizable if HAVE_GTK3.
8072 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
8073 and height if HAVE_GTK3 (Bug#8505).
8074 (scroll_bar_width_for_theme): New variable.
8075 (update_theme_scrollbar_width): New function.
8076 (xg_get_default_scrollbar_width): Move code to
8077 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
8078 (xg_initialize): Call update_theme_scrollbar_width.
8079
8080 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
8081
8082 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
8083
8084 2011-06-12 Martin Rudalics <rudalics@gmx.at>
8085
8086 * frame.c (make_frame): Call other_buffer_safely instead of
8087 other_buffer.
8088
8089 * window.c (temp_output_buffer_show): Call display_buffer with
8090 second argument Vtemp_buffer_show_specifiers and reset latter
8091 immediately after the call.
8092 (Vtemp_buffer_show_specifiers): New variable.
8093 (auto_window_vscroll_p, next_screen_context_lines)
8094 (Vscroll_preserve_screen_position): Remove leading asterisks from
8095 doc-strings.
8096
8097 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
8098
8099 Fix minor problems found by GCC 4.6.0 static checking.
8100 * buffer.c (Qclone_number): Remove for now, as it's unused.
8101 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
8102 (record_buffer): Remove unused local.
8103 * frame.c (other_visible_frames, frame_buffer_list): Now static.
8104 (set_frame_buffer_list): Remove; unused.
8105 * frame.h (other_visible_frames): Remove decl.
8106 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
8107 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
8108 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
8109 if HAVE_GPM.
8110 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
8111 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
8112 Define only if HAVE_GPM.
8113 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
8114 (update_hints_inhibit): Remove; never set. All uses removed.
8115 * widgetprv.h (emacsFrameClassRec): Remove decl.
8116 * window.c (delete_deletable_window): Now returns void, since it
8117 wasn't returning anything.
8118 (compare_window_configurations): Remove unused locals.
8119 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
8120 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
8121 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
8122 the same widths as pointers. This follows up on the 2011-05-06 patch.
8123 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
8124 * xterm.h: Likewise.
8125 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
8126
8127 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
8128
8129 * makefile.w32-in: Update dependencies.
8130 (LISP_H): Add lib/intprops.h.
8131
8132 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
8133
8134 * image.c (gif_load): Add animation frame delay to the metadata.
8135 (syms_of_image): Use DEFSYM. New symbol `delay'.
8136
8137 2011-06-11 Martin Rudalics <rudalics@gmx.at>
8138
8139 * window.c (delete_deletable_window): Re-add.
8140 (Fset_window_configuration): Rewrite to handle dead buffers and
8141 consequently deletable windows.
8142 (window_tree, Fwindow_tree): Remove. Supply functionality in
8143 window.el.
8144 (compare_window_configurations): Simplify code.
8145
8146 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
8147
8148 * image.c (imagemagick_load_image): Fix type mismatch.
8149 (Fimagemagick_types): Likewise.
8150
8151 * window.h (replace_buffer_in_windows): Declare.
8152
8153 2011-06-11 Martin Rudalics <rudalics@gmx.at>
8154
8155 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
8156 Qclone_number. Remove external declaration of Qdelete_window.
8157 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
8158 code.
8159 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
8160 Run Qbuffer_list_update_hook if allowed.
8161 (Fother_buffer): Rewrite doc-string. Major rewrite for new
8162 buffer list implementation.
8163 (other_buffer_safely): New function.
8164 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
8165 calls to replace_buffer_in_windows and
8166 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
8167 if allowed.
8168 (record_buffer): Inhibit quitting and rewrite using quittable
8169 functions. Run Qbuffer_list_update_hook if allowed.
8170 (Frecord_buffer, Funrecord_buffer): New functions.
8171 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
8172 Move switch-to-buffer to window.el.
8173 (bury-buffer): Move to window.el.
8174 (Vbuffer_list_update_hook): New variable.
8175
8176 * lisp.h (other_buffer_safely): Add prototype in buffer.c
8177 section.
8178
8179 * window.h (resize_frame_windows): Move up in code.
8180 (Fwindow_frame): Remove EXFUN.
8181 (replace_buffer_in_all_windows): Remove prototype.
8182 (replace_buffer_in_windows_safely): Add prototype.
8183
8184 * window.c: Declare Qdelete_window static again. Move down
8185 declaration of select_count.
8186 (Fnext_window, Fprevious_window): Rewrite doc-strings.
8187 (Fother_window): Move to window.el.
8188 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
8189 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
8190 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
8191 window.el.
8192 (replace_buffer_in_windows): Implement by calling
8193 Qreplace_buffer_in_windows.
8194 (replace_buffer_in_all_windows): Remove with some functionality
8195 moved into replace_buffer_in_windows_safely.
8196 (replace_buffer_in_windows_safely): New function.
8197 (select_window_norecord, select_frame_norecord): Move in front
8198 of run_window_configuration_change_hook. Remove now obsolete
8199 declarations.
8200 (Fset_window_buffer): Rewrite doc-string.
8201 Call Qrecord_window_buffer.
8202 (keys_of_window): Move binding for other-window to window.el.
8203
8204 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
8205
8206 * dispextern.h (struct image): Replace data member, whose int_val
8207 and ptr_val fields were not used by anything, with a single
8208 lisp_val object.
8209
8210 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
8211 (gif_clear_image, gif_load, imagemagick_load_image)
8212 (gs_clear_image, gs_load): Callers changed.
8213
8214 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
8215
8216 * buffer.h: Include <time.h>, for time_t.
8217 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
8218
8219 Fix minor problems found by static checking.
8220
8221 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
8222
8223 Make identifiers static if they are not used in other modules.
8224 * data.c (Qcompiled_function, Qframe, Qvector):
8225 * image.c (QimageMagick, Qsvg):
8226 * minibuf.c (Qmetadata):
8227 * window.c (resize_window_check, resize_root_window): Now static.
8228 * window.h (resize_window_check, resize_root_window): Remove decls.
8229
8230 * window.c (window_deletion_count, delete_deletable_window):
8231 Remove; unused.
8232 (window_body_lines): Now static.
8233 (Fdelete_other_windows_internal): Mark vars as initialized.
8234 Make sure 'resize_failed' is initialized.
8235 (run_window_configuration_change_hook): Rename local to avoid shadowing.
8236 (resize_window_apply): Remove unused local.
8237 * window.h (delete_deletable_window): Remove decl.
8238
8239 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
8240 (imagemagick_load_image): Fix pointer signedness problem by changing
8241 last arg from unsigned char * to char *. All uses changed.
8242 Also, fix a local for similar reasons.
8243 Remove unused locals. Remove locals to avoid shadowing.
8244 (fn_rsvg_handle_free): Remove; unused.
8245 (svg_load, svg_load_image): Fix pointer signedness problem.
8246 (imagemagick_load_image): Don't use garbage pointer image_wand.
8247
8248 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
8249
8250 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
8251
8252 * image.c (gif_load): Fix omitted cast error introduced by
8253 2011-06-06 change.
8254
8255 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8256
8257 * window.h (resize_proportionally, orig_total_lines)
8258 (orig_top_line): Remove from window structure.
8259 (set_window_height, set_window_width, change_window_heights)
8260 (Fdelete_window): Remove prototypes.
8261 (resize_frame_windows): Remove duplicate declaration.
8262
8263 2011-06-10 Eli Zaretskii <eliz@gnu.org>
8264
8265 * window.h (resize_frame_windows, resize_window_check)
8266 (delete_deletable_window, resize_root_window)
8267 (resize_frame_windows): Declare prototypes.
8268
8269 * window.c (resize_window_apply): Make definition be "static" to
8270 match the prototype.
8271
8272 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8273
8274 * window.c: Remove declarations of Qwindow_size_fixed,
8275 window_min_size_1, window_min_size_2, window_min_size,
8276 size_window, window_fixed_size_p, enlarge_window, delete_window.
8277 Remove static from declaration of Qdelete_window, it's
8278 temporarily needed by Fbury_buffer.
8279 (replace_window): Don't assign orig_top_line and
8280 orig_total_lines.
8281 (Fdelete_window, delete_window): Remove. Window deletion is
8282 handled by window.el.
8283 (window_loop): Remove DELETE_OTHER_WINDOWS case.
8284 Replace Fdelete_window calls with calls to Qdelete_window.
8285 (Fdelete_other_windows): Remove. Deleting other windows is
8286 handled by window.el.
8287 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
8288 handled in window.el.
8289 (window_min_size_2, window_min_size_1, window_min_size): Remove.
8290 Window minimum sizes are handled in window.el.
8291 (shrink_windows, size_window, set_window_height)
8292 (set_window_width, change_window_heights, window_height)
8293 (window_width, CURBEG, CURSIZE, enlarge_window)
8294 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
8295 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
8296 handled in window.el.
8297 (make_dummy_parent): Rename to make_parent_window and give it a
8298 second argument horflag.
8299 (make_window): Don't set resize_proportionally any more.
8300 (Fsplit_window): Remove. Windows are split in window.el.
8301 (save_restore_action, save_restore_orig_size)
8302 (shrink_window_lowest_first, save_restore_orig_size): Remove.
8303 Resize mini windows in window.el.
8304 (grow_mini_window, shrink_mini_window): Implement by calling
8305 Qresize_root_window_vertically, resize_window_check and
8306 resize_window_apply.
8307 (saved_window, Fset_window_configuration, save_window_save):
8308 Do not handle orig_top_line, orig_total_lines, and
8309 resize_proportionally.
8310 (window_min_height, window_min_width): Move to window.el.
8311 (keys_of_window): Move bindings for delete-other-windows,
8312 split-window, delete-window and enlarge-window to window.el.
8313
8314 * buffer.c: Temporarily extern Qdelete_window.
8315 (Fbury_buffer): Temporarily call Qdelete_window instead of
8316 Fdelete_window (Fbury_buffer will move to window.el soon).
8317
8318 * frame.c (set_menu_bar_lines_1): Remove code handling
8319 orig_top_line and orig_total_lines.
8320
8321 * dispnew.c (adjust_frame_glyphs_initially): Don't use
8322 set_window_height but set heights directly.
8323 (change_frame_size_1): Use resize_frame_windows.
8324
8325 * xdisp.c (init_xdisp): Don't use set_window_height but set
8326 heights directly.
8327
8328 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
8329 Use resize_frame_windows instead of change_window_heights and run
8330 run_window_configuration_change_hook.
8331
8332 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
8333 instead of change_window_heights and run
8334 run_window_configuration_change_hook.
8335
8336 2011-06-09 Martin Rudalics <rudalics@gmx.at>
8337
8338 * window.c (replace_window): Rename second argument REPLACEMENT to
8339 NEW. New third argument SETFLAG. Rewrite.
8340 (delete_window, make_dummy_parent): Call replace_window with
8341 third argument 1.
8342 (window_list_1): Move down in code.
8343 (run_window_configuration_change_hook): Move set_buffer part
8344 before select_frame_norecord part in order to unwind correctly.
8345 Rename count1 to count.
8346 (recombine_windows, delete_deletable_window, resize_root_window)
8347 (Fdelete_other_windows_internal)
8348 (Frun_window_configuration_change_hook, make_parent_window)
8349 (resize_window_check, resize_window_apply, Fresize_window_apply)
8350 (resize_frame_windows, Fsplit_window_internal)
8351 (Fdelete_window_internal, Fresize_mini_window_internal):
8352 New functions.
8353 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
8354
8355 2011-06-08 Martin Rudalics <rudalics@gmx.at>
8356
8357 * window.h (window): Add some new members to window structure -
8358 normal_lines, normal_cols, new_total, new_normal, clone_number,
8359 splits, nest, prev_buffers, next_buffers.
8360 (WINDOW_TOTAL_SIZE): Move here from window.c.
8361 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
8362
8363 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
8364 Remove.
8365 (make_dummy_parent): Set new members of windows structure.
8366 (make_window): Move down in code. Handle new members of window
8367 structure.
8368 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
8369 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
8370 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
8371 (Fset_window_prev_buffers, Fwindow_next_buffers)
8372 (Fset_window_next_buffers, Fset_window_clone_number):
8373 New functions.
8374 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
8375 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
8376 Doc-string fixes.
8377 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
8378 Argument WINDOW can be now internal window too.
8379 (Fwindow_use_time): Move up in code.
8380 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
8381 Rewrite doc-string.
8382 (Fset_window_configuration, saved_window)
8383 (Fcurrent_window_configuration, save_window_save): Handle new
8384 members of window structure.
8385 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
8386 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
8387 (syms_of_window): New Lisp objects Qrecord_window_buffer,
8388 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
8389 Qget_mru_window, Qresize_root_window,
8390 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
8391 Qauto_buffer_name; staticpro them.
8392
8393 2011-06-07 Martin Rudalics <rudalics@gmx.at>
8394
8395 * window.c (Fwindow_total_size, Fwindow_left_column)
8396 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
8397 (Fwindow_list_1): New functions.
8398 (window_box_text_cols): Replace with window_body_cols.
8399 (Fwindow_width, Fscroll_left, Fscroll_right):
8400 Use window_body_cols instead of window_box_text_cols.
8401 (delete_window, Fset_window_configuration):
8402 Call delete_all_subwindows with window as argument.
8403 (delete_all_subwindows): Take a window as argument and not a
8404 structure. Rewrite.
8405 (window_loop): Remove handling of GET_LRU_WINDOW and
8406 GET_LARGEST_WINDOW.
8407 (Fget_lru_window, Fget_largest_window): Move to window.el.
8408
8409 * window.h: Extern window_body_cols instead of
8410 window_box_text_cols. delete_all_subwindows now takes a
8411 Lisp_Object as argument.
8412
8413 * indent.c (compute_motion, Fcompute_motion):
8414 Use window_body_cols instead of window_box_text_cols.
8415
8416 * frame.c (delete_frame): Call delete_all_subwindows with root
8417 window as argument.
8418
8419 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
8420
8421 * fns.c (Fputhash): Document return value.
8422
8423 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
8424
8425 * image.c (gif_load): Implement gif89a spec "no disposal" method.
8426
8427 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8428
8429 Cons<->int and similar integer overflow fixes (Bug#8794).
8430
8431 Check for overflow when converting integer to cons and back.
8432 * charset.c (Fdefine_charset_internal, Fdecode_char):
8433 Use cons_to_unsigned to catch overflow.
8434 (Fencode_char): Use INTEGER_TO_CONS.
8435 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
8436 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
8437 * data.c (long_to_cons, cons_to_long): Remove.
8438 (cons_to_unsigned, cons_to_signed): New functions.
8439 These signal an error for invalid or out-of-range values.
8440 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
8441 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
8442 * font.c (Ffont_variation_glyphs):
8443 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
8444 * lisp.h: Include <intprops.h>.
8445 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
8446 (cons_to_signed, cons_to_unsigned): New decls.
8447 (long_to_cons, cons_to_long): Remove decls.
8448 * undo.c (record_first_change): Use INTEGER_TO_CONS.
8449 (Fprimitive_undo): Use CONS_TO_INTEGER.
8450 * xfns.c (Fx_window_property): Likewise.
8451 * xselect.c: Include <limits.h>.
8452 (x_own_selection, selection_data_to_lisp_data):
8453 Use INTEGER_TO_CONS.
8454 (x_handle_selection_request, x_handle_selection_clear)
8455 (x_get_foreign_selection, Fx_disown_selection_internal)
8456 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
8457 (lisp_data_to_selection_data): Use cons_to_unsigned.
8458 (x_fill_property_data): Use cons_to_signed.
8459 Report values out of range.
8460
8461 Check for buffer and string overflow more precisely.
8462 * buffer.h (BUF_BYTES_MAX): New macro.
8463 * lisp.h (STRING_BYTES_MAX): New macro.
8464 * alloc.c (Fmake_string):
8465 * character.c (string_escape_byte8):
8466 * coding.c (coding_alloc_by_realloc):
8467 * doprnt.c (doprnt):
8468 * editfns.c (Fformat):
8469 * eval.c (verror):
8470 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
8471 since they may not be the same number.
8472 * editfns.c (Finsert_char):
8473 * fileio.c (Finsert_file_contents):
8474 Likewise for BUF_BYTES_MAX.
8475
8476 * image.c: Use ptrdiff_t, not int, for sizes.
8477 (slurp_file): Switch from int to ptrdiff_t.
8478 All uses changed.
8479 (slurp_file): Check that file size fits in both size_t (for
8480 malloc) and ptrdiff_t (for sanity and safety).
8481
8482 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
8483 if b->modtime has its maximal value.
8484
8485 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
8486
8487 Don't assume time_t can fit into int.
8488 * buffer.h (struct buffer.modtime): Now time_t, not int.
8489 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
8490 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
8491
8492 Minor fixes for signed vs unsigned integers.
8493 * character.h (MAYBE_UNIFY_CHAR):
8494 * charset.c (maybe_unify_char):
8495 * keyboard.c (read_char, reorder_modifiers):
8496 XINT -> XFASTINT, since the integer must be nonnegative.
8497 * ftfont.c (ftfont_spec_pattern):
8498 * keymap.c (access_keymap, silly_event_symbol_error):
8499 XUINT -> XFASTINT, since the integer must be nonnegative.
8500 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
8501 since it makes no difference and we prefer signed.
8502 * keyboard.c (record_char): Use XUINT when all the neighbors do.
8503 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
8504 nonnegative.
8505
8506 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
8507
8508 * window.h (Fwindow_frame): Declare.
8509
8510 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8511
8512 * alloc.c: Simplify handling of large-request failures (Bug#8800).
8513 (SPARE_MEMORY): Always define.
8514 (LARGE_REQUEST): Remove.
8515 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
8516
8517 2011-06-06 Martin Rudalics <rudalics@gmx.at>
8518
8519 * lisp.h: Move EXFUNS for Fframe_root_window,
8520 Fframe_first_window and Fset_frame_selected_window to window.h.
8521
8522 * window.h: Move EXFUNS for Fframe_root_window,
8523 Fframe_first_window and Fset_frame_selected_window here from
8524 lisp.h.
8525
8526 * frame.c (Fwindow_frame, Fframe_first_window)
8527 (Fframe_root_window, Fframe_selected_window)
8528 (Fset_frame_selected_window): Move to window.c.
8529 (Factive_minibuffer_window): Move to minibuf.c.
8530 (Fother_visible_frames_p): New function.
8531
8532 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
8533
8534 * window.c (decode_window, decode_any_window): Move up in code.
8535 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
8536 (inhibit_frame_unsplittable): Remove unused variable.
8537 (Fwindow_buffer): Move up and rewrite doc-string.
8538 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
8539 (Fwindow_prev): New functions.
8540 (Fwindow_frame): Move here from frame.c. Accept any window as
8541 argument.
8542 (Fframe_root_window, Fframe_first_window)
8543 (Fframe_selected_window): Move here from frame.c. Accept frame
8544 or arbitrary window as argument. Update doc-strings.
8545 (Fminibuffer_window): Move up in code.
8546 (Fwindow_minibuffer_p): Move up in code and simplify.
8547 (Fset_frame_selected_window): Move here from frame.c.
8548 Marginal rewrite.
8549 (Fselected_window, select_window, Fselect_window): Move up in
8550 code. Minor doc-string fixes.
8551
8552 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8553
8554 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
8555 Do not assume that spare memory exists; that assumption is valid
8556 only if SYSTEM_MALLOC.
8557 (LARGE_REQUEST): New macro, so that the issue of large requests
8558 is separated from the issue of spare memory.
8559
8560 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
8561
8562 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
8563 format. (Bug#8806)
8564
8565 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
8566
8567 * xfns.c (x_set_scroll_bar_default_width): Move declarations
8568 before statements.
8569
8570 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
8571
8572 * gtkutil.c (xg_get_default_scrollbar_width): New function.
8573
8574 * gtkutil.h: Declare xg_get_default_scrollbar_width.
8575
8576 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
8577 min width by calling x_set_scroll_bar_default_width (Bug#8505).
8578
8579 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
8580
8581 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
8582
8583 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
8584
8585 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
8586 (x_clipboard_manager_save): Add return value.
8587 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
8588 New error handlers.
8589 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
8590 Obey Vx_select_enable_clipboard_manager. Catch errors in
8591 x_clipboard_manager_save (Bug#8779).
8592 (Vx_select_enable_clipboard_manager): New variable.
8593 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
8594
8595 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8596
8597 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
8598
8599 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8600
8601 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
8602 in the current matrix if keep_current_p is non-zero.
8603
8604 2011-06-04 Eli Zaretskii <eliz@gnu.org>
8605
8606 * bidi.c (bidi_level_of_next_char): Fix last change.
8607
8608 2011-06-03 Eli Zaretskii <eliz@gnu.org>
8609
8610 Support bidi reordering of text covered by display properties.
8611
8612 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
8613 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
8614 (bidi_cache_search, bidi_cache_iterator_state)
8615 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8616 (bidi_level_of_next_char, bidi_move_to_visually_next):
8617 Support character positions inside a run of characters covered by a
8618 display string.
8619 (bidi_paragraph_init, bidi_resolve_explicit_1)
8620 (bidi_level_of_next_char): Call bidi_fetch_char and
8621 bidi_fetch_char_advance instead of FETCH_CHAR and
8622 FETCH_CHAR_ADVANCE.
8623 (bidi_init_it): Initialize new members.
8624 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
8625 definitions.
8626 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
8627 instead of using explicit *_CHAR codes.
8628 (bidi_resolve_explicit, bidi_resolve_weak):
8629 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
8630 bidirectional text is supported only in multibyte buffers.
8631 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
8632 it to initialize the frame_window_p member of struct bidi_it.
8633 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
8634 (bidi_resolve_explicit, bidi_resolve_weak)
8635 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
8636 bidi_it->nchars is non-positive.
8637 (bidi_level_of_next_char): Don't try to lookup the cache for the
8638 next/previous character if nothing is cached there yet, or if we
8639 were just reseat()'ed to a new position.
8640
8641 * xdisp.c (set_cursor_from_row): Set start and stop points
8642 according to the row's direction when priming the loop that looks
8643 for the glyph on which to display cursor.
8644 (single_display_spec_intangible_p): Function deleted.
8645 (display_prop_intangible_p): Reimplement to call
8646 handle_display_spec instead of single_display_spec_intangible_p.
8647 Accept 3 additional arguments needed by handle_display_spec.
8648 This fixes incorrect cursor motion across display property with complex
8649 values: lists, `(when COND...)' forms, etc.
8650 (single_display_spec_string_p): Support property values that are
8651 lists with the argument STRING its top-level element.
8652 (display_prop_string_p): Fix the condition for processing a
8653 property that is a list to be consistent with handle_display_spec.
8654 (handle_display_spec): New function, refactored from the
8655 last portion of handle_display_prop.
8656 (compute_display_string_pos): Accept additional argument
8657 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
8658 value of a `display' property is a "replacing spec".
8659 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
8660 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
8661 the display property, but just return a value indicating whether
8662 the display property will replace the characters it covers.
8663 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
8664 frame_window_p members of struct bidi_it.
8665 (compute_display_string_pos, compute_display_string_end):
8666 New functions.
8667 (push_it): Accept second argument POSITION, where pop_it should
8668 jump to continue iteration.
8669 (reseat_1): Initialize bidi_it.disp_pos.
8670
8671 * keyboard.c (adjust_point_for_property): Adjust the call to
8672 display_prop_intangible_p to its new signature.
8673
8674 * dispextern.h (struct bidi_it): New member frame_window_p.
8675 (bidi_init_it): Update prototypes.
8676 (display_prop_intangible_p): Update prototype.
8677 (compute_display_string_pos, compute_display_string_end):
8678 Declare prototypes.
8679 (struct bidi_it): New members nchars and disp_pos. ch_len is now
8680 EMACS_INT.
8681
8682 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
8683
8684 Malloc failure behavior now depends on size of allocation.
8685 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
8686 * lisp.h: Change signatures accordingly.
8687 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
8688 All callers changed. (Bug#8762)
8689
8690 * gnutls.c: Use Emacs's memory allocators.
8691 Without this change, the gnutls library would invoke malloc etc.
8692 directly, which causes problems on non-SYNC_INPUT hosts, and which
8693 runs afoul of improving memory_full behavior. (Bug#8761)
8694 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
8695 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
8696 xfree instead of the default malloc, realloc, free.
8697 (Fgnutls_boot): No need to check for memory allocation failure,
8698 since xmalloc does that for us.
8699
8700 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
8701 * category.c (hash_get_category_set):
8702 * ccl.c (ccl_driver):
8703 * charset.c (Fdefine_charset_internal):
8704 * charset.h (struct charset.hash_index):
8705 * composite.c (get_composition_id, gstring_lookup_cache)
8706 (composition_gstring_put_cache):
8707 * composite.h (struct composition.hash_index):
8708 * dispextern.h (struct image.hash):
8709 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
8710 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
8711 (hashfn_equal, hashfn_user_defined, make_hash_table)
8712 (maybe_resize_hash_table, hash_lookup, hash_put)
8713 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
8714 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
8715 (Fsxhash, Fgethash, Fputhash, Fmaphash):
8716 * image.c (make_image, search_image_cache, lookup_image)
8717 (xpm_put_color_table_h):
8718 * lisp.h (struct Lisp_Hash_Table):
8719 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
8720 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
8721 for hashes and hash indexes, instead of 'unsigned' and 'int'.
8722 * alloc.c (allocate_vectorlike):
8723 Check for overflow in vector size calculations.
8724 * ccl.c (ccl_driver):
8725 Check for overflow when converting EMACS_INT to int.
8726 * fns.c, image.c: Remove unnecessary static decls that would otherwise
8727 need to be updated by these changes.
8728 * fns.c (make_hash_table, maybe_resize_hash_table):
8729 Check for integer overflow with large hash tables.
8730 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
8731 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
8732 (SXHASH_REDUCE): New macro.
8733 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
8734 Use it instead of discarding useful hash info with large hash values.
8735 (sxhash_float): New function.
8736 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
8737 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
8738 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
8739 Rewrite to use FIXNUM_BITS, as this simplifies things.
8740 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
8741 Adjust signatures to match updated version of code.
8742 (consing_since_gc): Now EMACS_INT, since a single hash table can
8743 use more than INT_MAX bytes.
8744
8745 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
8746
8747 Make it possible to build with GCC-4.6+ -O2 -flto.
8748
8749 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
8750
8751 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
8752
8753 * minibuf.c (get_minibuffer, read_minibuf_unwind):
8754 Call minibuffer-inactive-mode.
8755
8756 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
8757
8758 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
8759 Update dependencies.
8760
8761 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8762
8763 * data.c (init_data): Remove code for UTS, this system is not
8764 supported anymore.
8765
8766 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8767
8768 Don't force ./temacs to start in terminal mode.
8769
8770 * frame.c (make_initial_frame): Initialize faces in all cases, not
8771 only when CANNOT_DUMP is defined.
8772 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
8773
8774 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8775
8776 * dispnew.c (add_window_display_history): Use const for the string
8777 pointer. Remove declaration, not needed.
8778
8779 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8780
8781 Use 'inline', not 'INLINE'.
8782 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
8783 * alloc.c, fontset.c (INLINE): Remove.
8784 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
8785 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
8786 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
8787 * gmalloc.c (register_heapinfo): Use inline unconditionally.
8788 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
8789
8790 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8791
8792 Make it possible to run ./temacs.
8793
8794 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
8795 syms_of_callproc does the same thing. Remove test for
8796 "initialized", do it in the caller.
8797 * emacs.c (main): Avoid calling set_initial_environment when dumping.
8798
8799 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
8800
8801 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
8802 (read_minibuf): Use get_minibuffer.
8803 (syms_of_minibuf): Use DEFSYM.
8804 (Qmetadata): New var.
8805 * data.c (Qbuffer): Don't make it static.
8806 (syms_of_data): Use DEFSYM.
8807
8808 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8809
8810 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
8811 (CCL_CODE_MIN): New macro.
8812
8813 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
8814
8815 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
8816
8817 * eval.c (Qdebug): Now static.
8818 * lisp.h (Qdebug): Remove decl. This reverts a part of the
8819 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
8820 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
8821
8822 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
8823
8824 * image.c: Various fixes to ImageMagick code comments.
8825 (Fimagemagick_types): Doc fix.
8826
8827 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
8828
8829 Minor fixes prompted by GCC 4.6.0 warnings.
8830
8831 * xselect.c (converted_selections, conversion_fail_tag): Now static.
8832
8833 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
8834 (x_clipboard_manager_save_all): Move extern decl to ...
8835 * xterm.h: ... here, so that it can be checked for consistency.
8836
8837 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
8838
8839 * xselect.c (x_clipboard_manager_save_frame)
8840 (x_clipboard_manager_save_all): New functions.
8841 (Fx_clipboard_manager_save): Lisp function deleted.
8842
8843 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
8844 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
8845
8846 * xterm.h: Update prototype.
8847
8848 2011-05-28 William Xu <william.xwl@gmail.com>
8849
8850 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
8851 exiting (Bug#8239).
8852
8853 2011-05-28 Jim Meyering <meyering@redhat.com>
8854
8855 Avoid a sign-extension bug in crypto_hash_function.
8856 * fns.c (to_uchar): Define.
8857 (crypto_hash_function): Use it to convert some newly-signed
8858 variables to unsigned, to avoid sign-extension bugs. For example,
8859 without this change, (md5 "truc") would evaluate to
8860 45723a2aff78ff4fff7fff1114760e62 rather than the expected
8861 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
8862 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
8863
8864 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8865
8866 Integer overflow fixes.
8867
8868 * dbusbind.c: Serial number integer overflow fixes.
8869 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
8870 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
8871 to hold a serial number that is too large for a fixnum.
8872 (Fdbus_method_return_internal, Fdbus_method_error_internal):
8873 Check for serial numbers out of range. Decode any serial number
8874 that was so large that it became a float. (Bug#8722)
8875
8876 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
8877 (Fdbus_call_method, Fdbus_call_method_asynchronously):
8878 Use XFASTINT rather than XUINT when numbers are nonnegative.
8879 (xd_append_arg, Fdbus_method_return_internal):
8880 (Fdbus_method_error_internal): Likewise. Also, for unsigned
8881 arguments, check that Lisp number is nonnegative, rather than
8882 silently wrapping negative numbers around. (Bug#8722)
8883 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
8884 (Bug#8722)
8885
8886 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
8887
8888 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
8889
8890 ccl: Add integer overflow checks.
8891 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
8892 (IN_INT_RANGE): New macros.
8893 (ccl_driver): Use them to check for integer overflow when
8894 decoding a CCL program. Many of the new checks are whether XINT (x)
8895 fits in int; it doesn't always, on 64-bit hosts. The new version
8896 doesn't catch all possible integer overflows, but it's an
8897 improvement. (Bug#8719)
8898
8899 * alloc.c (make_event_array): Use XINT, not XUINT.
8900 There's no need for unsigned here.
8901
8902 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
8903 This follows up to the 2011-05-06 change that substituted uintptr_t
8904 for EMACS_INT. This case wasn't caught back then.
8905
8906 Rework Fformat to avoid integer overflow issues.
8907 * editfns.c: Include <float.h> unconditionally, as it's everywhere
8908 now (part of C89). Include <verify.h>.
8909 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
8910 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
8911 (Fformat): Avoid the prepass trying to compute sizes; it was only
8912 approximate and thus did not catch overflow reliably. Instead, walk
8913 through the format just once, formatting and computing sizes as we go,
8914 checking for integer overflow at every step, and allocating a larger
8915 buffer as needed. Keep track separately whether the format is
8916 multibyte. Keep only the most-recently calculated precision, rather
8917 than them all. Record whether each argument has been converted to
8918 string. Use EMACS_INT, not int, for byte and char and arg counts.
8919 Support field widths and precisions larger than INT_MAX. Avoid
8920 sprintf's undefined behavior with conversion specifications such as %#d
8921 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
8922 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
8923 formatting out-of-range floating point numbers with int
8924 formats. (Bug#8668)
8925
8926 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
8927
8928 * data.c: Avoid integer truncation in expressions involving floats.
8929 * data.c: Include <intprops.h>.
8930 (arith_driver): When there's an integer overflow in an expression
8931 involving floating point, convert the integers to floating point
8932 so that the resulting value does not suffer from catastrophic
8933 integer truncation. For example, on a 64-bit host (* 4
8934 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
8935 Do not rely on undefined behavior after integer overflow.
8936
8937 merge count_size_as_multibyte, parse_str_to_multibyte
8938 * character.c, character.h (count_size_as_multibyte):
8939 Rename from parse_str_to_multibyte; all uses changed.
8940 Check for integer overflow.
8941 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
8942 since it's now a duplicate of the other. This is more of
8943 a character than a buffer op, so better that it's in character.c.
8944 * fns.c, print.c: Adjust to above changes.
8945
8946 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
8947
8948 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
8949
8950 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8951
8952 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8953 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
8954 (x_clipboard_manager_save): Now static.
8955 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
8956
8957 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8958 (crypto_hash_function): Now static.
8959 Fix pointer signedness problems. Avoid unnecessary initializations.
8960
8961 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
8962
8963 * termhooks.h (Vselection_alist): Make it terminal-local.
8964
8965 * terminal.c (create_terminal): Initialize it.
8966
8967 * xselect.c: Support for clipboard managers.
8968 (Vselection_alist): Move to termhooks.h as terminal-local var.
8969 (LOCAL_SELECTION): New macro.
8970 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
8971 (symbol_to_x_atom): Remove gratuitous arg.
8972 (x_handle_selection_request, lisp_data_to_selection_data)
8973 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
8974 (x_own_selection, x_get_local_selection, x_convert_selection):
8975 New arg, specifying work frame. Use terminal-local Vselection_alist.
8976 (some_frame_on_display): Delete unused function.
8977 (Fx_own_selection_internal, Fx_get_selection_internal)
8978 (Fx_disown_selection_internal, Fx_selection_owner_p)
8979 (Fx_selection_exists_p): New optional frame arg.
8980 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
8981 (x_handle_selection_clear): Don't treat other terminals with the
8982 same keyboard specially. Use the terminal-local Vselection_alist.
8983 (x_clear_frame_selections): Use Frun_hook_with_args.
8984
8985 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
8986
8987 * xterm.h: Add support for those atoms.
8988
8989 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
8990
8991 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
8992 (converted_selections, conversion_fail_tag): New global variables.
8993 (x_selection_request_lisp_error): Free the above.
8994 (x_get_local_selection): Remove unnecessary code.
8995 (x_reply_selection_request): Args changed; handle arbitrary array
8996 of converted selections stored in converted_selections.
8997 Separate the XChangeProperty and SelectionNotify steps.
8998 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
8999 (x_convert_selection): New function.
9000 (x_handle_selection_event): Simplify.
9001 (x_get_foreign_selection): Don't ignore incoming requests while
9002 waiting for an answer; this will fail when we implement
9003 SAVE_TARGETS, and seems unnecessary anyway.
9004 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
9005 (Vx_sent_selection_functions): Doc fix.
9006
9007 2011-05-26 Leo Liu <sdl.web@gmail.com>
9008
9009 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
9010
9011 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9012
9013 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
9014
9015 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
9016 for fringe update if it has periodic bitmap.
9017 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
9018 and fringe_bitmap_periodic_p.
9019
9020 * fringe.c (get_fringe_bitmap_data): New function.
9021 (draw_fringe_bitmap_1, update_window_fringes): Use it.
9022 (update_window_fringes): Record periodicity of fringe bitmap in glyph
9023 row. Mark glyph row for fringe update if periodicity changed.
9024
9025 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
9026 for fringe update unless it has periodic bitmap.
9027
9028 2011-05-25 Kenichi Handa <handa@m17n.org>
9029
9030 * xdisp.c (get_next_display_element): Set correct it->face_id for
9031 a static composition.
9032
9033 2011-05-24 Leo Liu <sdl.web@gmail.com>
9034
9035 * deps.mk (fns.o):
9036 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
9037
9038 * fns.c (crypto_hash_function, Fsha1): New function.
9039 (Fmd5): Use crypto_hash_function.
9040 (syms_of_fns): Add Ssha1.
9041
9042 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9043
9044 * gnutls.c: Remove unused macros.
9045 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
9046 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
9047 Remove macros that are defined and never used.
9048 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
9049
9050 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
9051
9052 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
9053 (Fx_get_selection_internal): Minor cleanup.
9054 (Fx_own_selection_internal): Rename arguments for consistency with
9055 select.el.
9056
9057 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9058
9059 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
9060
9061 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
9062
9063 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
9064
9065 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9066
9067 * dispnew.c (scrolling_window): Don't exclude the case that the
9068 last enabled row in the desired matrix touches the bottom boundary.
9069
9070 2011-05-21 Glenn Morris <rgm@gnu.org>
9071
9072 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
9073 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
9074 and add some more files.
9075
9076 2011-05-20 Eli Zaretskii <eliz@gnu.org>
9077
9078 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
9079 report_file_error introduced by the change from 2011-05-07.
9080
9081 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
9082
9083 * systime.h (Time): Define only if emacs is defined.
9084 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
9085 where the include path doesn't have X11/X.h by default. See
9086 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
9087
9088 2011-05-20 Kenichi Handa <handa@m17n.org>
9089
9090 * composite.c (find_automatic_composition): Fix previous change.
9091
9092 2011-05-20 Glenn Morris <rgm@gnu.org>
9093
9094 * lisp.mk: New file, split from Makefile.in.
9095 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
9096 (shortlisp): Remove.
9097 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
9098
9099 2011-05-19 Glenn Morris <rgm@gnu.org>
9100
9101 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
9102 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
9103 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
9104 (lisp): Set the order to that of loadup.el.
9105 (shortlisp): Make it a copy of $lisp.
9106 (SOME_MACHINE_LISP): Remove.
9107 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
9108 Use just $shortlisp, not $SOME_MACHINE_LISP too.
9109
9110 2011-05-18 Kenichi Handa <handa@m17n.org>
9111
9112 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
9113 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
9114 (find_automatic_composition): Mostly rewrite for efficiency.
9115
9116 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
9117
9118 * makefile.w32-in: Update dependencies.
9119
9120 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
9121
9122 * menu.c: Include limits.h (fixes the MS-Windows build broken by
9123 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
9124
9125 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
9126
9127 Fix some integer overflow issues, such as string length overflow.
9128
9129 * insdel.c (count_size_as_multibyte): Check for string overflow.
9130
9131 * character.c (lisp_string_width): Check for string overflow.
9132 Use EMACS_INT, not int, for string indexes and lengths; in
9133 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
9134 the resulting string length overflows an EMACS_INT; instead,
9135 report a string overflow if no precision given. When checking for
9136 precision exhaustion, use a check that cannot possibly have
9137 integer overflow. (Bug#8675)
9138 * character.h (lisp_string_width): Adjust to new signature.
9139
9140 * alloc.c (string_overflow): New function.
9141 (Fmake_string): Use it. This doesn't change behavior, but saves
9142 a few bytes and will simplify future changes.
9143 * character.c (string_escape_byte8): Likewise.
9144 * lisp.h (string_overflow): New decl.
9145
9146 Fixups, following up to the user-interface timestamp change.
9147 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
9148 for UI timestamps, instead of unsigned long.
9149 * msdos.c (mouse_get_pos): Likewise.
9150 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
9151 * w32gui.h (Time): Define by including "systime.h" rather than by
9152 declaring it ourselves. (Bug#8664)
9153
9154 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
9155 * image.c (clear_image_cache): Likewise.
9156
9157 * term.c (term_mouse_position): Don't assume time_t wraparound.
9158
9159 Be more systematic about user-interface timestamps.
9160 Before, the code sometimes used 'Time', sometimes 'unsigned long',
9161 and sometimes 'EMACS_UINT', to represent these timestamps.
9162 This change causes it to use 'Time' uniformly, as that's what X uses.
9163 This makes the code easier to follow, and makes it easier to catch
9164 integer overflow bugs such as Bug#8664.
9165 * frame.c (Fmouse_position, Fmouse_pixel_position):
9166 Use Time, not unsigned long, for user-interface timestamps.
9167 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
9168 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
9169 * keyboard.h (last_event_timestamp): Likewise.
9170 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
9171 * menu.h (xmenu_show): Likewise.
9172 * term.c (term_mouse_position): Likewise.
9173 * termhooks.h (struct input_event.timestamp): Likewise.
9174 (struct terminal.mouse_position_hook): Likewise.
9175 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
9176 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
9177 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
9178 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
9179 what it was before.
9180 * menu.h, termhooks.h: Include "systime.h", for Time.
9181
9182 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
9183 Don't assume that the difference between two unsigned long values
9184 can fit into an integer. At this point, we know button_down_time
9185 <= event->timestamp, so the difference must be nonnegative, so
9186 there's no need to cast the result if double-click-time is
9187 nonnegative, as it should be; check that it's nonnegative, just in
9188 case. This bug is triggered when events are more than 2**31 ms
9189 apart (about 25 days). (Bug#8664)
9190
9191 * xselect.c (last_event_timestamp): Remove duplicate decl.
9192 (x_own_selection): Remove needless cast to unsigned long.
9193
9194 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
9195 that always fit in int. Use a sentinel instead of a counter, to
9196 avoid a temp and to allay GCC's concerns about possible int overflow.
9197 * frame.h (struct frame): Use int for menu_bar_items_used
9198 instead of EMACS_INT, since it always fits in int.
9199
9200 * menu.c (grow_menu_items): Check for int overflow.
9201
9202 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
9203
9204 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
9205 Before, the code was not consistent. These values cannot exceed
9206 2**31 - 1 so there's no need to make them unsigned.
9207 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
9208 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
9209 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
9210 as modifiers.
9211 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
9212
9213 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
9214 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
9215 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
9216 presumably because the widths might not match.
9217
9218 * window.c (size_window): Avoid needless test at loop start.
9219
9220 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
9221
9222 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
9223
9224 2011-05-12 Drew Adams <drew.adams@oracle.com>
9225
9226 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
9227
9228 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9229
9230 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
9231 `width' to `bar_area_x' and `bar_area_width', respectively.
9232 (x_scroll_run): Take account of fringe background extension.
9233
9234 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
9235 Rename local vars `left' and `width' to `bar_area_x' and
9236 `bar_area_width', respectively.
9237 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
9238 background extension.
9239
9240 2011-05-10 Jim Meyering <meyering@redhat.com>
9241
9242 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
9243
9244 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
9245
9246 * image.c (Finit_image_library): Return t for built-in image types,
9247 like pbm and xbm. (Bug#8640)
9248
9249 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
9250
9251 * w32menu.c (set_frame_menubar): Fix submenu allocation.
9252
9253 2011-05-07 Eli Zaretskii <eliz@gnu.org>
9254
9255 * w32console.c (Fset_screen_color): Doc fix.
9256 (Fget_screen_color): New function.
9257 (syms_of_ntterm): Defsubr it.
9258
9259 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
9260 unlink the temporary file if Fcall_process didn't create it in the
9261 first place.
9262 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
9263 child process will be redirected to a file specified with `:file'.
9264 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
9265 cue to call_process_cleanup not to close that handle.
9266
9267 2011-05-07 Ben Key <bkey76@gmail.com>
9268
9269 * makefile.w32-in: The bootstrap-temacs rule now makes use of
9270 one of two shell specific rules, either bootstrap-temacs-CMD or
9271 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
9272 to the previous implementation of the bootstrap-temacs rule.
9273 The bootstrap-temacs-CMD rule is similar to the previous
9274 implementation of the bootstrap-temacs rule except that it
9275 makes use of the ESC_CFLAGS variable instead of the CFLAGS
9276 variable.
9277
9278 These changes, along with some changes to nt/configure.bat,
9279 nt/gmake.defs, and nt/nmake.defs, are required to extend my
9280 earlier fix to add support for --cflags and --ldflags options
9281 that include quotes so that it works whether make uses cmd or
9282 sh as the shell.
9283
9284 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
9285
9286 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
9287 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
9288 is a constant.
9289 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
9290 a string. Handle both cases.
9291 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
9292 (Fdbus_register_method): Use Qinvalid_function.
9293
9294 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
9295
9296 * makefile.w32-in: Update dependencies.
9297 (LISP_H): Add inttypes.h and stdin.h.
9298 (PROCESS_H): Add unistd.h.
9299
9300 2011-05-06 Eli Zaretskii <eliz@gnu.org>
9301
9302 * lread.c: Include limits.h (fixes the MS-Windows build broken by
9303 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
9304
9305 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
9306
9307 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
9308
9309 * term.c (vfatal): Remove stray call to va_end.
9310 It's not needed and the C Standard doesn't allow it here anyway.
9311
9312 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
9313 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
9314
9315 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
9316 bytes.
9317
9318 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
9319
9320 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9321
9322 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
9323
9324 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
9325
9326 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
9327
9328 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
9329 * charset.c (Fdefine_charset_internal): Don't initialize
9330 charset.code_space[15]. The value was garbage, on hosts with
9331 32-bit int (Bug#8600).
9332
9333 * lread.c (read_integer): Be more consistent with string-to-number.
9334 Use string_to_number to do the actual conversion; this avoids
9335 rounding errors and fixes some other screwups. Without this fix,
9336 for example, #x1fffffffffffffff was misread as -2305843009213693952.
9337 (digit_to_number): Move earlier, for benefit of read_integer.
9338 Return -1 if the digit is out of range for the base, -2 if it is
9339 not a digit in any supported base. (Bug#8602)
9340
9341 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
9342
9343 * dispnew.c (scrolling_window): Return 1 if we scrolled,
9344 to match comment at start of function. This also removes a
9345 GCC warning about overflow in a 32+64-bit port.
9346
9347 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
9348
9349 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
9350 Reported by Stefan Monnier in
9351 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
9352 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9353 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
9354
9355 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
9356 (EMACS_UINTPTR): Likewise, with uintptr_t.
9357
9358 * lisp.h: Prefer 64-bit EMACS_INT if available.
9359 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
9360 on 32-bit hosts that have 64-bit int, so that they can access
9361 large files.
9362 However, temporarily disable this change unless the temporary
9363 symbol WIDE_EMACS_INT is defined.
9364
9365 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
9366
9367 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
9368 This removes an assumption that EMACS_INT and long are the same
9369 width as pointers. The assumption is true for Emacs porting targets
9370 now, but we want to make other targets possible.
9371 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
9372 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
9373 In the rest of the code, change types of integers that hold casted
9374 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
9375 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
9376 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
9377 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
9378 No need to cast type when ORing.
9379 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
9380 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
9381 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
9382 assume EMACS_INT is the same width as char *.
9383 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
9384 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
9385 Remove no-longer-needed casts.
9386 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
9387 (xg_tool_bar_help_callback, xg_make_tool_item):
9388 Use EMACS_INTPTR to hold an integer
9389 that will be cast to void *; this can avoid a GCC warning
9390 if EMACS_INT is not the same width as void *.
9391 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
9392 * xdisp.c (display_echo_area_1, resize_mini_window_1):
9393 (current_message_1, set_message_1):
9394 Use a local to convert to proper width without a cast.
9395 * xmenu.c (dialog_selection_callback): Likewise.
9396
9397 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
9398 Also, don't assume VALBITS / RAND_BITS is less than 5,
9399 and don't rely on undefined behavior when shifting a 1 left into
9400 the sign bit.
9401 * lisp.h (get_random): Change signature to match.
9402
9403 * lread.c (hash_string): Use size_t, not int, for hash computation.
9404 Normally we prefer signed values; but hashing is special, because
9405 it's better to use unsigned division on hash table sizes so that
9406 the remainder is nonnegative. Also, size_t is the natural width
9407 for hashing into memory. The previous code used 'int', which doesn't
9408 retain enough info to hash well into very large tables.
9409 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
9410
9411 * dbusbind.c: Don't possibly lose pointer info when converting.
9412 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9413 Use XPNTR rather than XHASH, so that the high-order bits of
9414 the pointer aren't lost when converting through void *.
9415
9416 * eval.c (Fautoload): Don't double-shift a pointer.
9417
9418 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
9419
9420 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
9421
9422 * gnutls.c (DEF_GNUTLS_FN):
9423 * image.c (DEF_IMGLIB_FN): Make function pointers static.
9424
9425 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
9426
9427 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
9428 marker. (Bug#8610)
9429
9430 2011-05-05 Eli Zaretskii <eliz@gnu.org>
9431
9432 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
9433 New version that can reserve upto 2GB of heap space.
9434
9435 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
9436
9437 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
9438
9439 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
9440
9441 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
9442 `gnutls_certificate_set_x509_key_file'.
9443
9444 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
9445
9446 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
9447 Update dependencies.
9448
9449 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9450
9451 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
9452 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9453 Remove unused parameter `fildes'.
9454 * process.c (read_process_output, send_process): Don't pass it.
9455
9456 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9457
9458 Fix previous change: the library cache is defined in w32.c.
9459 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
9460 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
9461
9462 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9463
9464 Implement dynamic loading of GnuTLS on Windows.
9465
9466 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
9467 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
9468 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9469 Declare.
9470
9471 * gnutls.c (Qgnutls_dll): Define.
9472 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
9473 (gnutls_*): Declare function pointers.
9474 (init_gnutls_functions): New function to initialize function pointers.
9475 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
9476 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
9477 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9478 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
9479 (emacs_gnutls_write, emacs_gnutls_read)
9480 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
9481 (Fgnutls_available_p): New function.
9482 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
9483 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
9484 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
9485
9486 * image.c: Include w32.h.
9487 (Vimage_type_cache): Delete.
9488 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
9489 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
9490 (w32_delayed_load): Move to w32.c.
9491
9492 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
9493
9494 * w32.c (QCloaded_from, Vlibrary_cache): Define.
9495 (w32_delayed_load): Move from image.c. When loading a library, record
9496 its filename in the :loaded-from property of the library id.
9497 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
9498 Initialize and staticpro them.
9499 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
9500
9501 * process.c: Include lisp.h before w32.h, not after.
9502 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
9503 instead of gnutls_record_check_pending.
9504
9505 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
9506
9507 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
9508
9509 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
9510 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
9511 as passed in.
9512
9513 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
9514
9515 * xterm.c (x_set_frame_alpha): Do not set property on anything
9516 else than FRAME_X_OUTER_WINDOW (Bug#8608).
9517
9518 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
9519
9520 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
9521
9522 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
9523
9524 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
9525 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
9526 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
9527 (gnutls_global_initialized, Qgnutls_bootprop_priority)
9528 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
9529 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
9530 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
9531 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
9532 (Qgnutls_bootprop_callbacks_verify): Make static.
9533
9534 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
9535
9536 * callproc.c: Indentation fixup.
9537
9538 * sysdep.c (wait_for_termination_1): Make static.
9539 (wait_for_termination, interruptible_wait_for_termination):
9540 Move after wait_for_termination_1.
9541
9542 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
9543
9544 * sysdep.c (interruptible_wait_for_termination): New function
9545 which is like wait_for_termination, but allows keyboard
9546 interruptions.
9547
9548 * callproc.c (Fcall_process): Add (:file "file") as an option for
9549 the STDOUT buffer.
9550 (Fcall_process_region): Ditto.
9551
9552 2011-04-30 Eli Zaretskii <eliz@gnu.org>
9553
9554 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
9555 rather than `XVECTOR (FOO)->size'.
9556
9557 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
9558 inttypes.h, as a gnulib replacement is used if it not available in
9559 system headers.
9560
9561 2011-04-21 Eli Zaretskii <eliz@gnu.org>
9562
9563 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
9564 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
9565 of MOST_POSITIVE_FIXNUM. (Bug#8528)
9566
9567 * coding.c (coding_alloc_by_realloc): Error out if destination
9568 will grow beyond MOST_POSITIVE_FIXNUM.
9569 (decode_coding_emacs_mule): Abort if there isn't enough place in
9570 charbuf for the composition carryover bytes. Reserve an extra
9571 space for up to 2 characters produced in a loop.
9572 (decode_coding_iso_2022): Abort if there isn't enough place in
9573 charbuf for the composition carryover bytes.
9574
9575 2011-04-21 Eli Zaretskii <eliz@gnu.org>
9576
9577 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
9578 aborting when %lld or %lll format is passed.
9579 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
9580 %llo or %llx format is passed. (Bug#8545)
9581
9582 * window.c (window_scroll_line_based): Use a marker instead of
9583 simple variables to record original value of point. (Bug#7952)
9584
9585 * doprnt.c (doprnt): Fix the case where a multibyte sequence
9586 produced by %s or %c overflows available buffer space. (Bug#8545)
9587
9588 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
9589
9590 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
9591 (SIZE_MAX): Move defn after all includes, as they might #define it.
9592
9593 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9594
9595 * w32.c (init_environment): Warn about defaulting HOME to C:\.
9596
9597 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9598
9599 * keyboard.c (Qdelayed_warnings_hook): Define.
9600 (command_loop_1): Run `delayed-warnings-hook'
9601 if Vdelayed_warnings_list is non-nil.
9602 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
9603 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
9604
9605 2011-04-28 Eli Zaretskii <eliz@gnu.org>
9606
9607 * doprnt.c (doprnt): Don't return value smaller than the buffer
9608 size if the message was truncated. (Bug#8545).
9609
9610 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9611
9612 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
9613 (Fx_window_property): #if-0 the whole functions, not just the bodies.
9614
9615 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9616
9617 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
9618
9619 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
9620
9621 * makefile.w32-in: Update dependencies.
9622
9623 2011-04-27 Eli Zaretskii <eliz@gnu.org>
9624
9625 Improve `doprnt' and its usage. (Bug#8545)
9626 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
9627 `format_end'. Remove support for %l as a conversion specifier.
9628 Don't use xrealloc. Improve diagnostics when the %l size modifier
9629 is used. Update the commentary.
9630
9631 * eval.c (verror): Simplify calculation of size_t.
9632
9633 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
9634 messages.
9635
9636 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
9637
9638 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
9639 change.
9640
9641 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9642
9643 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
9644 This makes this file independent of the recent pseudovector change.
9645
9646 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
9647
9648 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
9649
9650 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
9651 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
9652 Remove unused local.
9653 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
9654
9655 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
9656 GCC 4.6.0 optimizes based on type-based alias analysis.
9657 For example, if b is of type struct buffer * and v of type struct
9658 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
9659 != &v->size, and therefore "v->size = 1; b->size = 2; return
9660 v->size;" must therefore return 1. This assumption is incorrect
9661 for Emacs, since it type-puns struct Lisp_Vector * with many other
9662 types. To fix this problem, this patch adds a new type struct
9663 vectorlike_header that documents the constraints on layout of vectors
9664 and pseudovectors, and helps optimizing compilers not get fooled
9665 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
9666 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
9667 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
9668 the size member.
9669 (XSETPVECTYPE): Rewrite in terms of new macro.
9670 (XSETPVECTYPESIZE): New macro, specifying both type and size.
9671 This is a bit clearer, and further avoids the possibility of
9672 undesirable aliasing.
9673 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
9674 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
9675 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
9676 since Lisp_Subr is a special case (no "next" field).
9677 (ASIZE): Now uses header.size rather than size.
9678 All previous uses of XVECTOR (foo)->size replaced to use this macro,
9679 to avoid the hassle of writing XVECTOR (foo)->header.size.
9680 (struct vectorlike_header): New type.
9681 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
9682 object, to help avoid aliasing.
9683 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
9684 (SUBRP): Likewise, since Lisp_Subr is a special case.
9685 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
9686 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
9687 (struct Lisp_Hash_Table): Combine first two members into a single
9688 struct vectorlike_header member. All uses of "size" and "next" members
9689 changed to be "header.size" and "header.next".
9690 * buffer.h (struct buffer): Likewise.
9691 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
9692 * frame.h (struct frame): Likewise.
9693 * process.h (struct Lisp_Process): Likewise.
9694 * termhooks.h (struct terminal): Likewise.
9695 * window.c (struct save_window_data, struct saved_window): Likewise.
9696 * window.h (struct window): Likewise.
9697 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
9698 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
9699 * buffer.c (init_buffer_once): Likewise.
9700 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
9701 special case.
9702 * process.c (Fformat_network_address): Use local var for size,
9703 for brevity.
9704
9705 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
9706
9707 Make the Lisp reader and string-to-float more consistent (Bug#8525)
9708 * data.c (atof): Remove decl; no longer used or needed.
9709 (digit_to_number): Move to lread.c.
9710 (Fstring_to_number): Use new string_to_number function, to be
9711 consistent with how the Lisp reader treats infinities and NaNs.
9712 Do not assume that floating-point numbers represent EMACS_INT
9713 without losing information; this is not true on most 64-bit hosts.
9714 Avoid double-rounding errors, by insisting on integers when
9715 parsing non-base-10 numbers, as the documentation specifies.
9716 * lisp.h (string_to_number): New decl, replacing ...
9717 (isfloat_string): Remove.
9718 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
9719 (read1): Do not accept +. and -. as integers; this
9720 appears to have been a coding error. Similarly, do not accept
9721 strings like +-1e0 as floating point numbers. Do not report
9722 overflow for integer overflows unless the base is not 10 which
9723 means we have no simple and reliable way to continue.
9724 Break out the floating-point parsing into a new
9725 function string_to_number, so that Fstring_to_number parses
9726 floating point numbers consistently with the Lisp reader.
9727 (digit_to_number): Move here from data.c. Make it static inline.
9728 (E_CHAR, EXP_INT): Remove, replacing with ...
9729 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
9730 (string_to_number): New function, replacing isfloat_string.
9731 This function checks for valid syntax and produces the resulting
9732 Lisp float number too. Rework it so that string-to-number
9733 no longer mishandles examples like "1.0e+". Use strtoumax,
9734 so that overflow for non-base-10 numbers is reported only when
9735 there's no portable and simple way to convert to floating point.
9736
9737 * textprop.c (set_text_properties_1): Rewrite for clarity,
9738 and to avoid GCC warning about integer overflow.
9739
9740 * intervals.h (struct interval): Use EMACS_INT for members
9741 where EMACS_UINT might cause problems. See
9742 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
9743 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
9744 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
9745 All uses changed.
9746 (offset_intervals): Tell GCC not to worry about length overflow
9747 when negating a negative length.
9748
9749 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
9750 (overrun_check_free): Likewise.
9751
9752 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
9753 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
9754 word size.
9755
9756 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9757 (gnutls_make_error): Rename local to avoid shadowing.
9758 (gnutls_emacs_global_deinit): ifdef out; not used.
9759 (Fgnutls_boot): Use const for pointer to readonly storage.
9760 Comment out unused local. Fix pointer signedness problems.
9761
9762 * lread.c (openp): Don't stuff size_t into an 'int'.
9763 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
9764 about possible signed overflow.
9765
9766 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9767 (GDK_KEY_g): Don't define if already defined.
9768 (xg_prepare_tooltip): Avoid pointer signedness problem.
9769 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
9770
9771 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
9772 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
9773
9774 * xfns.c (Fx_window_property): Simplify a bit,
9775 to make a bit faster and to avoid GCC 4.6.0 warning.
9776 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
9777
9778 * fns.c (internal_equal): Don't assume size_t fits in int.
9779
9780 * alloc.c (compact_small_strings): Tighten assertion a little.
9781
9782 Replace pEd with more-general pI, and fix some printf arg casts.
9783 * lisp.h (pI): New macro, generalizing old pEd macro to other
9784 conversion specifiers. For example, use "...%"pI"d..." rather
9785 than "...%"pEd"...".
9786 (pEd): Remove. All uses replaced with similar uses of pI.
9787 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
9788 * alloc.c (check_pure_size): Don't overflow by converting size to int.
9789 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
9790 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
9791 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
9792 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
9793 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
9794 64-bit hosts.
9795 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
9796 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
9797 * print.c (safe_debug_print, print_object): Likewise.
9798 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
9799 to int.
9800 Use pI instead of if-then-else-abort. Use %p to avoid casts,
9801 avoiding the 0 flag, which is not portable.
9802 * process.c (Fmake_network_process): Use pI to avoid cast.
9803 * region-cache.c (pp_cache): Likewise.
9804 * xdisp.c (decode_mode_spec): Likewise.
9805 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
9806 behavior on 64-bit hosts with printf arg.
9807 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
9808 (x_stop_queuing_selection_requests): Likewise.
9809 (x_get_window_property): Don't truncate byte count to an 'int'
9810 when tracing.
9811
9812 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
9813 here, since it parses constructs like leading '-' and spaces,
9814 which are not wanted; and it overflows with large numbers.
9815 Instead, simply match F[0-9]+, which is what is wanted anyway.
9816
9817 * alloc.c: Remove unportable assumptions about struct layout.
9818 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
9819 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
9820 (allocate_vectorlike, make_pure_vector): Use the new macros,
9821 plus offsetof, to remove unportable assumptions about struct layout.
9822 These assumptions hold on all porting targets that I know of, but
9823 they are not guaranteed, they're easy to remove, and removing them
9824 makes further changes easier.
9825
9826 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
9827 This doesn't fix a bug but makes the code clearer.
9828 (string_overrun_cookie): Now const. Use initializers that
9829 don't formally overflow signed char, to avoid warnings.
9830 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
9831 can cause Emacs to crash when string overrun checking is enabled.
9832 (allocate_buffer): Don't assume sizeof (struct buffer) is a
9833 multiple of sizeof (EMACS_INT); it need not be, if
9834 alignof(EMACS_INT) < sizeof (EMACS_INT).
9835 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
9836
9837 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
9838
9839 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
9840
9841 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
9842
9843 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
9844 supposed to be handshaking. (Bug#8556)
9845 Reported by Paul Eggert <eggert@cs.ucla.edu>.
9846
9847 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
9848
9849 * lisp.h (Qdebug): List symbol.
9850 * eval.c (Qdebug): Restore global linkage.
9851 * keyboard.c (debug-on-event): New variable.
9852 (handle_user_signal): Break into debugger when debug-on-event
9853 matches the current signal symbol.
9854
9855 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
9856
9857 * alloc.c (check_sblock, check_string_bytes)
9858 (check_string_free_list): Convert to standard C.
9859
9860 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
9861
9862 * w32.c (emacs_gnutls_push): Fix typo.
9863
9864 2011-04-25 Eli Zaretskii <eliz@gnu.org>
9865
9866 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
9867 "cast to pointer from integer of different size".
9868
9869 Improve doprnt and its use in verror. (Bug#8545)
9870 * doprnt.c (doprnt): Document the set of format control sequences
9871 supported by the function. Use SAFE_ALLOCA instead of always
9872 using `alloca'.
9873
9874 * eval.c (verror): Don't limit the buffer size at size_max-1, that
9875 is one byte too soon. Don't use xrealloc; instead xfree and
9876 xmalloc anew.
9877
9878 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
9879
9880 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
9881 callbacks stage.
9882
9883 * gnutls.c: Renamed global_initialized to
9884 gnutls_global_initialized. Added internals for the
9885 :verify-hostname-error, :verify-error, and :verify-flags
9886 parameters of `gnutls-boot' and documented those parameters in the
9887 docstring. Start callback support.
9888 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
9889 unless a fatal error occurred. Call gnutls_alert_send_appropriate
9890 on error. Return error code.
9891 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
9892 (emacs_gnutls_read): Likewise.
9893 (Fgnutls_boot): Return handshake error code.
9894 (emacs_gnutls_handle_error): New function.
9895 (wsaerror_to_errno): Likewise.
9896
9897 * w32.h (emacs_gnutls_pull): Add prototype.
9898 (emacs_gnutls_push): Likewise.
9899
9900 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
9901 (emacs_gnutls_push): Likewise.
9902
9903 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
9904
9905 * process.c (wait_reading_process_output): Check if GnuTLS
9906 buffered some data internally if no FDs are set for TLS
9907 connections.
9908
9909 * makefile.w32-in (OBJ2): Add gnutls.$(O).
9910 (LIBS): Link to USER_LIBS.
9911 ($(BLD)/gnutls.$(0)): New target.
9912
9913 2011-04-24 Eli Zaretskii <eliz@gnu.org>
9914
9915 * xdisp.c (handle_single_display_spec): Rename the
9916 display_replaced_before_p argument into display_replaced_p, to
9917 make it consistent with the commentary. Fix typos in the
9918 commentary.
9919
9920 * textprop.c (syms_of_textprop): Remove dead code.
9921 (copy_text_properties): Delete obsolete commentary about an
9922 interface that was deleted long ago. Fix typos in the description
9923 of arguments.
9924
9925 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
9926 to changes in oldXMenu/XMenu.h from 2011-04-16.
9927 <menu_help_message, prev_menu_help_message>: Constify.
9928 (IT_menu_make_room): menu->help_text is now `const char **';
9929 adjust.
9930
9931 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
9932 to changes in oldXMenu/XMenu.h from 2011-04-16.
9933 (struct XMenu): Declare `help_text' `const char **'.
9934
9935 * xfaces.c <Qunspecified>: Make extern again.
9936
9937 * syntax.c: Include sys/types.h before including regex.h, as
9938 required by POSIX.
9939
9940 * doc.c (get_doc_string): Improve the format passed to `error'.
9941
9942 * doprnt.c (doprnt): Improve commentary.
9943
9944 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
9945
9946 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
9947 them with etags.
9948
9949 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
9950 changes in globals.h immediately force recompilation.
9951 (TAGS): Depend on $(CURDIR)/m/intel386.h and
9952 $(CURDIR)/s/ms-w32.h.
9953 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
9954
9955 * character.c (Fchar_direction): Function deleted.
9956 (syms_of_character): Don't defsubr it.
9957 <char-direction-table>: Deleted.
9958
9959 2011-04-23 Eli Zaretskii <eliz@gnu.org>
9960
9961 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
9962 * doprnt.c: Include limits.h.
9963 (SIZE_MAX): New macro.
9964 (doprnt): Return a size_t value. 2nd arg is now size_t.
9965 Many local variables are now size_t instead of int or unsigned.
9966 Improve overflow protection. Support `l' modifier for integer
9967 conversions. Support %l conversion. Don't assume an EMACS_INT
9968 argument for integer conversions and for %c.
9969
9970 * lisp.h (doprnt): Restore prototype.
9971
9972 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
9973 $(SRC)/character.h.
9974
9975 * Makefile.in (base_obj): Add back doprnt.o.
9976
9977 * deps.mk (doprnt.o): Add back prerequisites.
9978 (callint.o): Depend on character.h.
9979
9980 * eval.c (internal_lisp_condition_case): Include the handler
9981 representation in the error message.
9982 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
9983 when breaking from the loop.
9984
9985 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
9986
9987 * callint.c (Fcall_interactively): When displaying error message
9988 about invalid control letter, pass the character's codepoint, not
9989 a pointer to its multibyte form. Improve display of the character
9990 in octal and display also its hex code.
9991
9992 * character.c (char_string): Use %x to display the (unsigned)
9993 codepoint of an invalid character, to avoid displaying a bogus
9994 negative value.
9995
9996 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
9997 `error', not SYMBOL_NAME itself.
9998
9999 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
10000 character arguments to `error'.
10001
10002 * charset.c (check_iso_charset_parameter): Fix incorrect argument
10003 to `error' in error message about FINAL_CHAR argument. Make sure
10004 FINAL_CHAR is a character, and use %c when it is passed as
10005 argument to `error'.
10006
10007 2011-04-23 Eli Zaretskii <eliz@gnu.org>
10008
10009 * s/ms-w32.h (localtime): Redirect to sys_localtime.
10010
10011 * w32.c: Include <time.h>.
10012 (sys_localtime): New function.
10013
10014 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
10015
10016 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
10017
10018 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
10019
10020 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
10021
10022 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
10023 zombies (Bug#8467).
10024
10025 2011-04-19 Eli Zaretskii <eliz@gnu.org>
10026
10027 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
10028 gl_state.e_property when gl_state.object is Qt.
10029
10030 * insdel.c (make_gap_larger): Remove limitation of buffer size
10031 to <= INT_MAX.
10032
10033 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
10034
10035 * xdisp.c (lookup_glyphless_char_display)
10036 (produce_glyphless_glyph): Handle cons cell entry in
10037 glyphless-char-display.
10038 (Vglyphless_char_display): Document it.
10039
10040 * term.c (produce_glyphless_glyph): Handle cons cell entry in
10041 glyphless-char-display.
10042
10043 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
10044
10045 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
10046
10047 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
10048
10049 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
10050 definition for no-X builds.
10051
10052 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
10053
10054 Static checks with GCC 4.6.0 and non-default toolkits.
10055
10056 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
10057
10058 * process.c (keyboard_bit_set): Define only if SIGIO.
10059 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
10060 (send_process): Repair possible setjmp clobbering.
10061
10062 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
10063
10064 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
10065
10066 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
10067
10068 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
10069 Define only if needed.
10070
10071 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
10072 by pacifying GCC about it. Maybe it's time to retire it?
10073 * xfaces.c (USG, __TIMEVAL__): Likewise.
10074
10075 * dispextern.h (struct redisplay_interface): Rename param
10076 to avoid shadowing.
10077 * termhooks.h (struct terminal): Likewise.
10078 * xterm.c (xembed_send_message): Likewise.
10079
10080 * insdel.c (make_gap_smaller): Define only if
10081 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
10082
10083 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
10084 it.
10085
10086 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
10087 so that we aren't warned about unused symbols.
10088
10089 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
10090
10091 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
10092
10093 * xfns.c (x_real_positions): Mark locals as initialized.
10094
10095 * xmenu.c (xmenu_show): Don't use uninitialized vars.
10096
10097 * xterm.c: Fix problems found by static analysis with other toolkits.
10098 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
10099 (x_dispatch_event): Declare static if USE_GTK, and
10100 define if USE_GTK || USE_X_TOOLKIT.
10101 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
10102 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
10103 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
10104 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
10105
10106 * xmenu.c (menu_help_callback): Pointer type fixes.
10107 Use const pointers when pointing at readonly data. Avoid pointer
10108 signedness clashes.
10109 (FALSE): Remove unused macro.
10110 (update_frame_menubar): Remove unused decl.
10111
10112 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
10113
10114 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
10115 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
10116 (single_menu_item): Rename local to avoid shadowing.
10117
10118 * keyboard.c (make_lispy_event): Remove unused local var.
10119
10120 * frame.c, frame.h (x_get_resource_string): Bring this back, but
10121 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
10122
10123 * bitmaps: Change bitmaps from unsigned char back to the X11
10124 compatible char. Avoid the old compiler warnings about
10125 out-of-range initializers by using, for example, '\xab' rather
10126 than 0xab.
10127
10128 * xgselect.c (xgselect_initialize): Check vs interface
10129 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
10130
10131 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
10132
10133 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
10134 to read-only memory.
10135
10136 * fns.c (vector): Remove; this old hack is no longer needed.
10137
10138 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
10139 Remove unused var.
10140 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
10141
10142 * xrdb.c (x_load_resources): Omit unused local.
10143
10144 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
10145 (x_window): Rename locals to avoid shadowing.
10146 (USG): Use the kludged USG macro, to pacify gcc.
10147
10148 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
10149 (x_term_init): Remove local to avoid shadowing.
10150
10151 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
10152
10153 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
10154 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
10155
10156 2011-04-16 Eli Zaretskii <eliz@gnu.org>
10157
10158 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
10159
10160 Fix regex.c, syntax.c and friends for buffers > 2GB.
10161 * syntax.h (struct gl_state_s): Declare character position members
10162 EMACS_INT.
10163
10164 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
10165
10166 * textprop.c (verify_interval_modification, interval_of):
10167 Declare arguments EMACS_INT.
10168
10169 * intervals.c (adjust_intervals_for_insertion): Declare arguments
10170 EMACS_INT.
10171
10172 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
10173
10174 * indent.c (Fvertical_motion): Local variable it_start is now
10175 EMACS_INT.
10176
10177 * regex.c (re_match, re_match_2, re_match_2_internal)
10178 (bcmp_translate, regcomp, regexec, print_double_string)
10179 (group_in_compile_stack, re_search, re_search_2, regex_compile)
10180 (re_compile_pattern, re_exec): Declare arguments and local
10181 variables `size_t' and `ssize_t' and return values `regoff_t', as
10182 appropriate.
10183 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
10184 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
10185 <compile_stack_type>: `size' and `avail' are now `size_t'.
10186
10187 * regex.h <regoff_t>: Use ssize_t, not int.
10188 (re_search, re_search_2, re_match, re_match_2): Arguments that
10189 specify buffer/string position and length are now ssize_t and
10190 size_t. Return type is regoff_t.
10191
10192 2011-04-16 Ben Key <bkey76@gmail.com>
10193
10194 * nsfont.m: Fixed bugs in ns_get_family and
10195 ns_descriptor_to_entity that were caused by using free to
10196 deallocate memory blocks that were allocated by xmalloc (via
10197 xstrdup). This caused Emacs to crash when compiled with
10198 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
10199 --enable-checking=xmallocoverrun). xfree is now used to
10200 deallocate these memory blocks.
10201
10202 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
10203
10204 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
10205
10206 emacs_write: Accept and return EMACS_INT for sizes.
10207 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
10208 et seq.
10209 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
10210 Accept and return EMACS_INT.
10211 (emacs_gnutls_write): Return the number of bytes written on
10212 partial writes.
10213 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
10214 (emacs_read, emacs_write): Remove check for negative size, as the
10215 Emacs source code has been audited now.
10216 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
10217 (emacs_read, emacs_write): Use it.
10218 * process.c (send_process): Adjust to the new signatures of
10219 emacs_write and emacs_gnutls_write. Do not attempt to store
10220 a byte offset into an 'int'; it might overflow.
10221 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
10222
10223 * sound.c: Don't assume sizes fit in 'int'.
10224 (struct sound_device.period_size, alsa_period_size):
10225 Return EMACS_INT, not int.
10226 (struct sound_device.write, vox_write, alsa_write):
10227 Accept EMACS_INT, not int.
10228 (wav_play, au_play): Use EMACS_INT to store sizes and to
10229 record read return values.
10230
10231 2011-04-15 Ben Key <bkey76@gmail.com>
10232
10233 * keyboard.c (Qundefined): Don't declare static since it is used
10234 in nsfns.m.
10235 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
10236 static since they are used in nsfont.m.
10237
10238 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
10239
10240 * process.c (Qprocessp): Don't declare static.
10241 * lisp.h (Qprocessp): Declare again.
10242
10243 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
10244
10245 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
10246
10247 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
10248
10249 Improve C-level modularity by making more things 'static'.
10250
10251 Don't publish debugger-only interfaces to other modules.
10252 * lisp.h (safe_debug_print, debug_output_compilation_hack):
10253 (verify_bytepos, count_markers): Move decls to the only modules
10254 that need them.
10255 * region-cache.h (pp_cache): Likewise.
10256 * window.h (check_all_windows): Likewise.
10257 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
10258
10259 * sysdep.c (croak): Now static, if
10260 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
10261 * syssignal.h (croak): Declare only if not static.
10262
10263 * alloc.c (refill_memory_reserve): Now static if
10264 !defined REL_ALLOC || defined SYSTEM_MALLOC.
10265 * lisp.h (refill_memory_reserve): Declare only if not static.
10266
10267 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
10268 Define only if USE_LUCID.
10269
10270 * xrdb.c (x_customization_string, x_rm_string): Now static.
10271
10272 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
10273 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
10274
10275 * xdisp.c (draw_row_with_mouse_face): Now static.
10276 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
10277
10278 * window.h (check_all_windows): Mark externally visible.
10279
10280 * window.c (window_deletion_count): Now static.
10281
10282 * undo.c: Make symbols static if they're not exported.
10283 (last_undo_buffer, last_boundary_position, pending_boundary):
10284 Now static.
10285
10286 * textprop.c (interval_insert_behind_hooks): Now static.
10287 (interval_insert_in_front_hooks): Likewise.
10288
10289 * term.c: Make symbols static if they're not exported.
10290 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
10291 (max_frame_lines, tty_set_terminal_modes):
10292 (tty_reset_terminal_modes, tty_turn_off_highlight):
10293 (get_tty_terminal): Now static.
10294 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
10295 * termhooks.h (term_mouse_moveto): Do not declare if
10296 HAVE_WINDOW_SYSTEM.
10297 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
10298 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
10299
10300 * sysdep.c: Make symbols static if they're not exported.
10301 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
10302 Now static.
10303 (sigprocmask_set, full_mask): Remove; unused.
10304 (wait_debugging): Mark as visible.
10305 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
10306 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
10307
10308 * syntax.c (syntax_temp): Define only if !__GNUC__.
10309
10310 * sound.c (current_sound_device, current_sound): Now static.
10311
10312 * search.c (searchbufs, searchbuf_head): Now static.
10313
10314 * scroll.c (scroll_cost): Remove; unused.
10315 * dispextern.h (scroll_cost): Remove decl.
10316
10317 * region-cache.h (pp_cache): Mark as externally visible.
10318
10319 * process.c: Make symbols static if they're not exported.
10320 (process_tick, update_tick, create_process, chan_process):
10321 (Vprocess_alist, proc_buffered_char, datagram_access):
10322 (fd_callback_data, send_process_frame, process_sent_to): Now static.
10323 (deactivate_process): Mark defn as static, as well as decl.
10324 * lisp.h (create_process): Remove decl.
10325 * process.h (chan_process, Vprocess_alist): Remove decls.
10326
10327 * print.c: Make symbols static if they're not exported.
10328 (print_depth, new_backquote_output, being_printed, print_buffer):
10329 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
10330 (print_interval, print_number_index, initial_stderr_stream):
10331 Now static.
10332 * lisp.h (Fprinc): Remove decl.
10333 (debug_output_compilation_hack): Mark as externally visible.
10334
10335 * sysdep.c (croak): Move decl from here to syssignal.h.
10336 * syssignal.h (croak): Put it here, so the API can be checked when
10337 'croak' is called from dissociate_if_controlling_tty.
10338
10339 * minibuf.c: Make symbols static if they're not exported.
10340 (minibuf_save_list, choose_minibuf_frame): Now static.
10341 * lisp.h (choose_minibuf_frame): Remove decl.
10342
10343 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
10344
10345 * lread.c: Make symbols static if they're not exported.
10346 (read_objects, initial_obarray, oblookup_last_bucket_number):
10347 Now static.
10348 (make_symbol): Remove; unused.
10349 * lisp.h (initial_obarray, make_symbol): Remove decls.
10350
10351 * keyboard.c: Make symbols static if they're not exported.
10352 (single_kboard, recent_keys_index, total_keys, recent_keys):
10353 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
10354 (this_single_command_key_start, echoing, last_auto_save):
10355 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
10356 (command_loop, echo_now, keyboard_init_hook, help_char_p):
10357 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10358 (Vlispy_mouse_stem, double_click_count):
10359 Now static.
10360 (force_auto_save_soon): Define only if SIGDANGER.
10361 (ignore_mouse_drag_p): Now static if
10362 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
10363 (print_help): Remove; unused.
10364 (stop_character, last_timer_event): Mark as externally visible.
10365 * keyboard.h (ignore_mouse_drag_p): Declare only if
10366 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
10367 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
10368 * lisp.h (echoing): Remove decl.
10369 (force_auto_save_soon): Declare only if SIGDANGER.
10370 * xdisp.c (redisplay_window): Simplify code, to make it more
10371 obvious that ignore_mouse_drag_p is not accessed if !defined
10372 USE_GTK && !defined HAVE_NS.
10373
10374 * intervals.c: Make symbols static if they're not exported.
10375 (merge_properties_sticky, merge_interval_right, delete_interval):
10376 Now static.
10377 * intervals.h (merge_interval_right, delete_interval): Remove decls.
10378
10379 * insdel.c: Make symbols static if they're not exported.
10380 However, leave prepare_to_modify_buffer alone. It's never
10381 called from outside this function, but that appears to be a bug.
10382 (combine_after_change_list, combine_after_change_buffer):
10383 (adjust_after_replace, signal_before_change): Now static.
10384 (adjust_after_replace_noundo): Remove; unused.
10385 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
10386 (signal_before_change): Remove decls.
10387
10388 * indent.c (val_compute_motion, val_vmotion): Now static.
10389
10390 * image.c: Make symbols static if they're not exported.
10391 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
10392 if USE_GTK.
10393 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
10394 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
10395
10396 * fringe.c (standard_bitmaps): Now static.
10397 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
10398
10399 * frame.c: Make symbols static if they're not exported.
10400 (x_report_frame_params, make_terminal_frame): Now static.
10401 (get_frame_param): Now static, unless HAVE_NS.
10402 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
10403 (x_get_resource_string): Remove; not used.
10404 * frame.h (make_terminal_frame, x_report_frame_params):
10405 (x_get_resource_string); Remove decls.
10406 (x_fullscreen_adjust): Declare only if WINDOWSNT.
10407 * lisp.h (get_frame_param): Declare only if HAVE_NS.
10408
10409 * font.c, fontset.c: Make symbols static if they're not exported.
10410 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
10411 (FACE_SUITABLE_FOR_CHAR_P): Use it.
10412 * font.c (font_close_object): Now static.
10413 * font.h (font_close_object): Remove.
10414 * fontset.c (FONTSET_OBJLIST): Remove.
10415 (free_realized_fontset) #if-0 the body, which does nothing.
10416 (face_suitable_for_char_p): #if-0, as it's never called.
10417 * fontset.h (face_suitable_for_char_p): Remove decl.
10418 * xfaces.c (face_at_string_position):
10419 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
10420 since 0 is always ASCII.
10421
10422 * fns.c (weak_hash_tables): Now static.
10423
10424 * fileio.c: Make symbols static if they're not exported.
10425 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
10426 (Vwrite_region_annotation_buffers): Now static.
10427
10428 * eval.c: Make symbols static if they're not exported.
10429 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
10430 * lisp.h (backtrace_list): Remove decl.
10431
10432 * emacs.c: Make symbols static if they're not exported.
10433 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
10434 (fatal_error_code, fatal_error_signal_hook, standard_args):
10435 Now static.
10436 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
10437 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
10438 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
10439 * lisp.h (fatal_error_signal_hook): Remove decl.
10440 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
10441
10442 * editfns.c: Move a (normally-unused) function to its only use.
10443 * editfns.c, lisp.h (get_operating_system_release): Remove.
10444 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
10445 worth the hassle of breaking this out.
10446
10447 * xterm.c: Make symbols static if they're not exported.
10448 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
10449 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
10450 (x_destroy_window, x_delete_display):
10451 Now static.
10452 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
10453 (x_mouse_leave): Remove; unused.
10454 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
10455 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
10456 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
10457 Remove decls.
10458 (x_mouse_leave): Declare only if WINDOWSNT.
10459 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
10460 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
10461 USE_X_TOOLKIT.
10462
10463 * ftxfont.c: Make symbols static if they're not exported.
10464 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
10465 HAVE_FREETYPE.
10466 * font.h (ftxfont_driver): Likewise.
10467
10468 * xfns.c: Make symbols static if they're not exported.
10469 (x_last_font_name, x_display_info_for_name):
10470 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
10471 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
10472 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
10473 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
10474 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
10475 (last_show_tip_args): Now static.
10476 (xic_defaut_fontset, xic_create_fontsetname): Define only if
10477 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
10478 (x_screen_planes): Remove; unused.
10479 * dispextern.h (x_screen_planes): Remove decl.
10480
10481 * dispnew.c: Make symbols static if they're not exported.
10482 * dispextern.h (redraw_garbaged_frames, scrolling):
10483 (increment_row_positions): Remove.
10484 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
10485 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
10486 Now static.
10487 (redraw_garbaged_frames): Remove; unused.
10488
10489 * xfaces.c: Make symbols static if they're not exported.
10490 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
10491 Remove decls.
10492 * xterm.h (defined_color): Remove decls.
10493 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
10494 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
10495 (menu_face_changed_default, defined_color, free_realized_face):
10496 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
10497 (ascii_face_of_lisp_face): Remove; unused.
10498
10499 * xdisp.c: Make symbols static if they're not exported.
10500 * dispextern.h (scratch_glyph_row, window_box_edges):
10501 (glyph_to_pixel_coords, set_cursor_from_row):
10502 (get_next_display_element, set_iterator_to_next):
10503 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
10504 (show_mouse_face): Remove decls
10505 * frame.h (message_buf_print): Likewise.
10506 * lisp.h (pop_message, set_message, check_point_in_composition):
10507 Likewise.
10508 * xterm.h (set_vertical_scroll_bar): Likewise.
10509 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
10510 (message_buf_print, scratch_glyph_row, displayed_buffer):
10511 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
10512 (get_next_display_element, show_mouse_face, window_box_edges):
10513 (frame_to_window_pixel_xy, check_point_in_composition):
10514 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
10515 (glyph_to_pixel_coords): Remove; unused.
10516
10517 * dired.c (file_name_completion): Now static.
10518
10519 * dbusbind.c (xd_in_read_queued_messages): Now static.
10520
10521 * lisp.h (circular_list_error, FOREACH): Remove; unused.
10522 * data.c (circular_list_error): Remove.
10523
10524 * commands.h (last_point_position, last_point_position_buffer):
10525 (last_point_position_window): Remove decls.
10526 * keyboard.c: Make these variables static.
10527
10528 * coding.h (coding, code_convert_region, encode_coding_gap):
10529 Remove decls.
10530 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
10531 (iso_code_class, detect_coding, code_convert_region): Now static.
10532 (encode_coding_gap): Remove; unused.
10533
10534 * chartab.c (chartab_chars, chartab_bits): Now static.
10535
10536 * charset.h (charset_iso_8859_1): Remove decl.
10537 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
10538 Now static.
10539
10540 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
10541 * ccl.c (Vccl_program_table): Now static.
10542 (check_ccl_update): Remove; unused.
10543
10544 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
10545 * category.h: ... from here.
10546 * category.c (check_category_table, set_category_set): Now static.
10547
10548 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
10549 * lisp.h: Remove these decls.
10550
10551 * buffer.c (buffer_count): Remove unused var.
10552
10553 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
10554 so that it's not optimized away.
10555 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
10556 * dispextern.h (bidi_dump_cached_states): Remove, since it's
10557 exported only to the debugger.
10558
10559 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
10560 * atimer.h (run_all_atimers): Remove; not exported.
10561
10562 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
10563 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
10564 was inaccessible from Lisp.
10565 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
10566 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
10567
10568 alloc.c: Import and export fewer symbols, and remove unused items.
10569 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
10570 is defined.
10571 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
10572 it's not optimized away by whole-program optimization.
10573 (message_enable_multibyte, free_misc): Remove.
10574 (catchlist, handlerlist, mark_backtrace):
10575 Declare only if BYTE_MARK_STACK.
10576 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
10577 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
10578 (message_enable_multibyte): Remove decl.
10579 (free_misc, interval_free_list, float_block, float_block_index):
10580 (n_float_blocks, float_free_list, cons_block, cons_block_index):
10581 (cons_free_list, last_marked_index):
10582 Now static.
10583 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
10584 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
10585 (mark_backtrace): Define only if BYTE_MARK_STACK.
10586 * xdisp.c (message_enable_multibyte): Now static.
10587
10588 Declare Lisp_Object Q* variables to be 'static' if not exported.
10589 This makes it easier for human readers (and static analyzers)
10590 to see whether these variables are used from other modules.
10591 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
10592 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
10593 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
10594 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
10595 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
10596 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
10597 * xmenu.c, xselect.c:
10598 Declare Q* vars static if they are not used in other modules.
10599 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
10600 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
10601 Remove decls of unexported vars.
10602 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
10603
10604 * lisp.h (DEFINE_FUNC): Make sname 'static'.
10605
10606 Make Emacs functions such as Fatom 'static' by default.
10607 This makes it easier for human readers (and static analyzers)
10608 to see whether these functions can be called from other modules.
10609 DEFUN now defines a static function. To make the function external
10610 so that it can be used in other C modules, use the new macro DEFUE.
10611 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
10612 (Finit_image_library):
10613 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
10614 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
10615 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
10616 Remove decls, since these functions are now static.
10617 (Funintern, Fget_internal_run_time): New decls, since these functions
10618 were already external.
10619
10620 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
10621 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
10622 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
10623 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
10624 * keyboard.c, keymap.c, lread.c:
10625 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
10626 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
10627 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
10628 Mark functions with DEFUE instead of DEFUN,
10629 if they are used in other modules.
10630 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
10631 decls for now-static functions.
10632 * buffer.h (Fdelete_overlay): Remove decl.
10633 * callproc.c (Fgetenv_internal): Mark as internal.
10634 * composite.c (Fremove_list_of_text_properties): Remove decl.
10635 (Fcomposition_get_gstring): New forward static decl.
10636 * composite.h (Fcomposite_get_gstring): Remove decl.
10637 * dired.c (Ffile_attributes): New forward static decl.
10638 * doc.c (Fdocumntation_property): New forward static decl.
10639 * eval.c (Ffetch_bytecode): New forward static decl.
10640 (Funintern): Remove extern decl; now in .h file where it belongs.
10641 * fileio.c (Fmake_symbolic_link): New forward static decl.
10642 * image.c (Finit_image_library): New forward static decl.
10643 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
10644 * intervals.h (Fprevious_property_change):
10645 (Fremove_list_of_text_properties): Remove decls.
10646 * keyboard.c (Fthis_command_keys): Remove decl.
10647 (Fcommand_execute): New forward static decl.
10648 * keymap.c (Flookup_key): New forward static decl.
10649 (Fcopy_keymap): Now static.
10650 * keymap.h (Flookup_key): Remove decl.
10651 * process.c (Fget_process): New forward static decl.
10652 (Fprocess_datagram_address): Mark as internal.
10653 * syntax.c (Fsyntax_table_p): New forward static decl.
10654 (skip_chars): Remove duplicate decl.
10655 * textprop.c (Fprevious_property_change): New forward static decl.
10656 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
10657 Now internal.
10658 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
10659 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
10660
10661 * editfns.c (Fformat): Remove unreachable code.
10662
10663 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
10664
10665 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
10666 change. (Bug#8496)
10667
10668 2011-04-13 Eli Zaretskii <eliz@gnu.org>
10669
10670 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
10671 when at ZV. (Bug#8487)
10672
10673 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
10674
10675 * charset.c (Fclear_charset_maps): Use xfree instead of free.
10676 (Bug#8437)
10677 * keyboard.c (parse_tool_bar_item): Likewise.
10678 * sound.c (sound_cleanup, alsa_close): Likewise.
10679 * termcap.c (tgetent): Likewise.
10680 * xfns.c (x_default_font_parameter): Likewise.
10681 * xsettings.c (read_and_apply_settings): Likewise.
10682
10683 * alloc.c (overrun_check_malloc, overrun_check_realloc)
10684 (overrun_check_free): Protoize.
10685
10686 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
10687
10688 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
10689 since callers should never pass a negative size.
10690 Change the signature to match that of plain 'read' and 'write'; see
10691 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
10692 * lisp.h: Update prototypes of emacs_write and emacs_read.
10693
10694 2011-04-11 Eli Zaretskii <eliz@gnu.org>
10695
10696 * xdisp.c (redisplay_window): Don't try to determine the character
10697 position of the scroll margin if the window start point w->startp
10698 is outside the buffer's accessible region. (Bug#8468)
10699
10700 2011-04-10 Eli Zaretskii <eliz@gnu.org>
10701
10702 Fix write-region and its subroutines for buffers > 2GB.
10703 * fileio.c (a_write, e_write): Modify declaration of arguments and
10704 local variables to support buffers larger than 2GB.
10705 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
10706
10707 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
10708 argument, local variables, and return value.
10709
10710 * lisp.h: Update prototypes of emacs_write and emacs_read.
10711
10712 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
10713
10714 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
10715
10716 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
10717
10718 Fix more problems found by GCC 4.6.0's static checks.
10719
10720 * xdisp.c (vmessage): Use a better test for character truncation.
10721
10722 * charset.c (load_charset_map): <, not <=, for optimization,
10723 and to avoid potential problems with integer overflow.
10724 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
10725 * casetab.c (set_identity, shuffle): Likewise.
10726 * editfns.c (Fformat): Likewise.
10727 * syntax.c (skip_chars): Likewise.
10728
10729 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
10730 This also lets GCC 4.6.0 generate slightly better loop code.
10731
10732 * callint.c (Fcall_interactively): <, not <=, for optimization.
10733 (Fcall_interactively): Count the number of arguments produced,
10734 not the number of arguments given. This is simpler and lets GCC
10735 4.6.0 generate slightly better code.
10736
10737 * ftfont.c: Distingish more carefully between FcChar8 and char.
10738 The previous code passed unsigned char * to a functions like
10739 strlen and xstrcasecmp that expect char *, which does not
10740 conform to the C standard.
10741 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
10742 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
10743 char * when the C standard requires it.
10744
10745 * keyboard.c (read_char): Remove unused var.
10746
10747 * eval.c: Port to Windows vsnprintf (Bug#8435).
10748 Include <limits.h>.
10749 (SIZE_MAX): Define if the headers do not.
10750 (verror): Do not give up if vsnprintf returns a negative count.
10751 Instead, grow the buffer. This ports to Windows vsnprintf, which
10752 does not conform to C99. Problem reported by Eli Zaretskii.
10753 Also, simplify the allocation scheme, by avoiding the need for
10754 calling realloc, and removing the ALLOCATED variable.
10755
10756 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
10757
10758 Remove invocations of doprnt, as Emacs now uses vsnprintf.
10759 But keep the doprint source code for now, as we might revamp it
10760 and use it again (Bug#8435).
10761 * lisp.h (doprnt): Remove.
10762 * Makefile.in (base_obj): Remove doprnt.o.
10763 * deps.mk (doprnt.o): Remove.
10764
10765 error: Print 32- and 64-bit integers portably (Bug#8435).
10766 Without this change, on typical 64-bit hosts error ("...%d...", N)
10767 was used to print both 32- and 64-bit integers N, which relied on
10768 undefined behavior.
10769 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
10770 * lisp.h (error, verror): Mark as printf-like functions.
10771 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
10772 Report overflow in size calculations when allocating printf buffer.
10773 Do not truncate output string at its first null byte.
10774 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
10775 Truncate the output at a character boundary, since vsnprintf does not
10776 do that.
10777 * charset.c (check_iso_charset_parameter): Convert internal
10778 character to string before calling 'error', since %c now has the
10779 printf meaning.
10780 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
10781 overflow when computing char to be passed to 'error'. Do not
10782 pass Lisp_Object to 'error'; pass the integer instead.
10783 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
10784 formatted with plain %d.
10785
10786 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
10787
10788 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
10789
10790 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
10791
10792 * xterm.c (x_catch_errors): Remove duplicate declaration.
10793
10794 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
10795
10796 * xdisp.c, lisp.h (message_nolog): Remove; unused.
10797
10798 2011-04-10 Jim Meyering <meyering@redhat.com>
10799
10800 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
10801 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
10802 return ssize_t not "int", and use size_t as the buffer length.
10803 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
10804 * gnutls.h: Update declarations.
10805 * process.c (read_process_output): Use ssize_t, to match.
10806 (send_process): Likewise.
10807
10808 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
10809
10810 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
10811
10812 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
10813
10814 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
10815 Use unsigned char, to match FcChar8 type definition.
10816
10817 * xterm.c (handle_one_xevent):
10818 * xmenu.c (create_and_show_popup_menu):
10819 * xselect.c (x_decline_selection_request)
10820 (x_reply_selection_request): Avoid type-punned deref of X events.
10821
10822 2011-04-09 Eli Zaretskii <eliz@gnu.org>
10823
10824 Fix some uses of `int' instead of EMACS_INT.
10825 * search.c (string_match_1, fast_string_match)
10826 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
10827 (scan_buffer, find_next_newline_no_quit)
10828 (find_before_next_newline, search_command, Freplace_match)
10829 (Fmatch_data): Make some `int' variables be EMACS_INT.
10830
10831 * xdisp.c (display_count_lines): 3rd argument and return value now
10832 EMACS_INT. All callers changed.
10833 (pint2hrstr): Last argument is now EMACS_INT.
10834
10835 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
10836 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10837 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
10838 (decode_coding_utf_16, decode_coding_emacs_mule)
10839 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
10840 (decode_coding_ccl, decode_coding_charset)
10841 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
10842 (decode_coding_iso_2022, decode_coding_emacs_mule)
10843 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
10844 <char_offset, last_offset>: Declare EMACS_INT.
10845 (encode_coding_utf_8, encode_coding_utf_16)
10846 (encode_coding_emacs_mule, encode_invocation_designation)
10847 (encode_designation_at_bol, encode_coding_iso_2022)
10848 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
10849 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
10850 Declare EMACS_INT.
10851 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
10852 (encode_invocation_designation): Last argument P_NCHARS is now
10853 EMACS_INT.
10854 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
10855 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
10856
10857 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
10858 All users changed.
10859
10860 * ccl.c (Fccl_execute_on_string): Declare some variables
10861 EMACS_INT.
10862
10863 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
10864
10865 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
10866
10867 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
10868
10869 * process.c (Fformat_network_address): Doc fix.
10870
10871 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
10872
10873 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
10874
10875 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
10876
10877 * keyboard.c (read_char): Call Lisp function help-form-show,
10878 instead of using internal_with_output_to_temp_buffer.
10879 (Qhelp_form_show): New var.
10880 (syms_of_keyboard): Use DEFSYM macro.
10881
10882 * print.c (internal_with_output_to_temp_buffer): Function deleted.
10883
10884 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
10885
10886 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
10887
10888 * process.c (Flist_processes): Remove to Lisp.
10889 (list_processes_1): Delete.
10890
10891 2011-04-06 Eli Zaretskii <eliz@gnu.org>
10892
10893 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
10894
10895 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
10896
10897 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
10898
10899 Fix more problems found by GCC 4.6.0's static checks.
10900
10901 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
10902
10903 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
10904
10905 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
10906
10907 * xdisp.c (vmessage): Mark as a printf-like function.
10908
10909 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
10910
10911 * sound.c (sound_warning): Don't crash if arg contains a printf format.
10912
10913 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
10914 printf-like functions.
10915 (tiff_load): Add casts to remove these marks before passing them
10916 to system-supplied API.
10917
10918 * eval.c (Fsignal): Remove excess argument to 'fatal'.
10919
10920 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
10921 This avoids several warnings with gcc -Wstrict-overflow.
10922 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
10923 directly, rather than having caller test rule sign. This avoids
10924 some unnecessary tests.
10925 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
10926 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
10927 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
10928
10929 * xfont.c (xfont_text_extents): Remove var that was set but not used.
10930 (xfont_open): Avoid unnecessary tests.
10931
10932 * composite.c (composition_gstring_put_cache): Use unsigned integer.
10933
10934 * composite.h, composite.c (composition_gstring_put_cache):
10935 Use EMACS_INT, not int, for length.
10936
10937 * composite.h (COMPOSITION_DECODE_REFS): New macro,
10938 breaking out part of COMPOSITION_DECODE_RULE.
10939 (COMPOSITION_DECODE_RULE): Use it.
10940 * composite.c (get_composition_id): Remove unused local vars,
10941 by using the new macro.
10942
10943 * textprop.c (set_text_properties_1): Change while to do-while,
10944 since the condition is always true at first.
10945
10946 * intervals.c (graft_intervals_into_buffer): Mark var as used.
10947 (interval_deletion_adjustment): Return unsigned value.
10948 All uses changed.
10949
10950 * process.c (list_processes_1, create_pty, read_process_output):
10951 (exec_sentinel): Remove vars that were set but not used.
10952 (create_pty): Remove unnecessary "volatile"s.
10953 (Fnetwork_interface_info): Avoid possibility of int overflow.
10954 (read_process_output): Do adaptive read buffering even if carryover.
10955 (read_process_output): Simplify nbytes computation if buffered.
10956
10957 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
10958
10959 * syntax.c (scan_words): Remove var that was set but not used.
10960 (update_syntax_table): Use unsigned instead of int.
10961
10962 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
10963 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
10964 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
10965
10966 * print.c (print_error_message): Avoid int overflow.
10967
10968 * font.c (font_list_entities): Redo for clarity,
10969 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
10970
10971 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
10972 (font_score): Avoid potential overflow in diff calculation.
10973
10974 * fns.c (substring_both): Remove var that is set but not used.
10975 (sxhash): Redo loop for clarity and to avoid wraparound warning.
10976
10977 * eval.c (funcall_lambda): Rename local to avoid shadowing.
10978
10979 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
10980 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
10981 can always succeed if overflow has undefined behavior.
10982
10983 * search.c (boyer_moore, wordify): Remove vars set but not used.
10984 (wordify): Omit three unnecessary tests.
10985
10986 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
10987 All callers changed. This avoids the need for an unused var.
10988
10989 * casefiddle.c (casify_region): Remove var that is set but not used.
10990
10991 * dired.c (file_name_completion): Remove var that is set but not used.
10992
10993 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
10994
10995 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
10996 (Finsert_file_contents): Remove unnecessary code checking fd.
10997
10998 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
10999 Check for integer overflow on size calculations.
11000
11001 * buffer.c (Fprevious_overlay_change): Remove var that is set
11002 but not used.
11003
11004 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
11005 Remove vars that are set but not used.
11006 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
11007 (timer_check_2): Mark vars as initialized.
11008
11009 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
11010
11011 * image.c (lookup_image): Remove var that is set but not used.
11012 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
11013
11014 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
11015 that are set but not used.
11016
11017 * xfns.c (make_invisible_cursor): Don't return garbage
11018 if XCreateBitmapFromData fails (Bug#8410).
11019
11020 * xselect.c (x_get_local_selection, x_handle_property_notify):
11021 Remove vars that are set but not used.
11022
11023 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
11024 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
11025
11026 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
11027 Remove var that is set but not used.
11028 (scroll_bar_windows_size): Now size_t, not int.
11029 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
11030 Check for overflow.
11031
11032 * xfaces.c (realize_named_face): Remove vars that are set but not used.
11033 (map_tty_color) [!defined MSDOS]: Likewise.
11034
11035 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
11036
11037 * coding.c: Remove vars that are set but not used.
11038 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
11039 All callers changed.
11040 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
11041 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
11042 (decode_coding_charset): Remove vars that are set but not used.
11043
11044 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
11045 that is set but not used.
11046
11047 * print.c (print_object): Remove var that is set but not used.
11048
11049 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
11050 The gnulib version avoids calling malloc in the usual case,
11051 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
11052 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
11053 * filelock.c (current_lock_owner): Likewise.
11054 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
11055 * sysdep.c: Include allocator.h, careadlinkat.h.
11056 (emacs_no_realloc_allocator): New static constant.
11057 (emacs_readlink): New function.
11058 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
11059 ../lib/careadlinkat.h.
11060
11061 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
11062
11063 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
11064 first non-nil return value).
11065
11066 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
11067
11068 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
11069 if not defined (Bug#8403).
11070
11071 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
11072
11073 * xdisp.c (display_count_lines): Remove parameter `start',
11074 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11075 (get_char_face_and_encoding): Remove parameter `multibyte_p',
11076 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11077 (fill_stretch_glyph_string): Remove parameters `row' and `area',
11078 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
11079 and thereabouts. All callers changed.
11080 (get_per_char_metric): Remove parameter `f', unused since
11081 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11082
11083 2011-04-02 Jim Meyering <meyering@redhat.com>
11084
11085 do not dereference NULL upon failed strdup
11086 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
11087 (ns_get_family): Likewise.
11088
11089 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
11090
11091 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
11092
11093 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
11094
11095 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
11096 later (Bug#8403).
11097
11098 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
11099
11100 Add lexical binding.
11101
11102 * window.c (Ftemp_output_buffer_show): New fun.
11103 (Fsave_window_excursion):
11104 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
11105
11106 * lread.c (lisp_file_lexically_bound_p): New function.
11107 (Fload): Bind Qlexical_binding.
11108 (readevalloop): Remove `evalfun' arg.
11109 Bind Qinternal_interpreter_environment.
11110 (Feval_buffer): Bind Qlexical_binding.
11111 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
11112 Mark as dynamic.
11113 (syms_of_lread): Declare `lexical-binding'.
11114
11115 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
11116
11117 * keyboard.c (eval_dyn): New fun.
11118 (menu_item_eval_property): Use it.
11119
11120 * image.c (parse_image_spec): Use Ffunctionp.
11121
11122 * fns.c (concat, mapcar1): Accept byte-code-functions.
11123
11124 * eval.c (Fsetq): Handle lexical vars.
11125 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
11126 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
11127 (FletX, Flet): Obey lexical binding.
11128 (Fcommandp): Handle closures.
11129 (Feval): New `lexical' arg.
11130 (eval_sub): New function extracted from Feval. Use it almost
11131 everywhere where Feval was used. Look up vars in lexical env.
11132 Handle closures.
11133 (Ffunctionp): Move from subr.el.
11134 (Ffuncall): Handle closures.
11135 (apply_lambda): Remove `eval_flags'.
11136 (funcall_lambda): Handle closures and new byte-code-functions.
11137 (Fspecial_variable_p): New function.
11138 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
11139 but without exporting it to Lisp.
11140
11141 * doc.c (Fdocumentation, store_function_docstring):
11142 * data.c (Finteractive_form): Handle closures.
11143
11144 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
11145 interactive spec.
11146
11147 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
11148 New byte-codes.
11149 (exec_byte_code): New function extracted from Fbyte_code to handle new
11150 calling convention for byte-code-functions. Add new byte-codes.
11151
11152 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
11153
11154 * alloc.c (Fmake_symbol): Init new `declared_special' field.
11155
11156 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
11157
11158 * xdisp.c (redisplay_internal): Fix prototype.
11159
11160 2011-03-31 Eli Zaretskii <eliz@gnu.org>
11161
11162 * xdisp.c (SCROLL_LIMIT): New macro.
11163 (try_scrolling): Use it when setting scroll_limit.
11164 Limit scrolling to 100 screen lines.
11165 (redisplay_window): Even when falling back on "recentering",
11166 position point in the window according to scroll-conservatively,
11167 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
11168
11169 (try_scrolling): When point is above the window, allow searching
11170 as far as scroll_max, or one screenful, to compute vertical
11171 distance from PT to the scroll margin position. This prevents
11172 try_scrolling from unnecessarily failing when
11173 scroll-conservatively is set to a value slightly larger than the
11174 window height. Clean up the case of PT below the margin at bottom
11175 of window: scroll_max can no longer be INT_MAX. When aggressive
11176 scrolling is in use, don't let point enter the opposite scroll
11177 margin as result of the scroll.
11178 (syms_of_xdisp) <scroll-conservatively>: Document the
11179 threshold of 100 lines for never-recentering scrolling.
11180
11181 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
11182
11183 * dispextern.h (move_it_by_lines):
11184 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
11185 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
11186 (message_log_check_duplicate): Remove parameters `prev_bol' and
11187 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11188 (redisplay_internal): Remove parameter `preserve_echo_area',
11189 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
11190
11191 * indent.c (Fvertical_motion):
11192 * window.c (window_scroll_pixel_based, Frecenter):
11193 Don't pass `need_y_p' to `move_it_by_lines'.
11194
11195 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
11196
11197 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
11198 steal a few bits to be more compact.
11199 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
11200 Remove unneeded casts.
11201
11202 * bytecode.c (Fbyte_code): CAR and CDR can GC.
11203
11204 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
11205
11206 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
11207 binding" message (bug#7967).
11208
11209 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
11210
11211 Fix more problems found by GCC 4.6.0's static checks.
11212
11213 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
11214 Remove unused local var.
11215
11216 * editfns.c (Fmessage_box): Remove unused local var.
11217
11218 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11219 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11220 Omit unused local vars.
11221 * window.c (shrink_windows): Omit unused local var.
11222 * menu.c (digest_single_submenu): Omit unused local var.
11223 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
11224 Omit unused local var.
11225
11226 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
11227 Don't assume string length fits in int.
11228 (keyremap_step, read_key_sequence): Use size_t for sizes.
11229 (read_key_sequence): Don't check last_real_key_start redundantly.
11230
11231 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
11232 instead of alloca (Bug#8344).
11233
11234 * eval.c (Fbacktrace): Don't assume nargs fits in int.
11235 (Fbacktrace_frame): Don't assume nframes fits in int.
11236
11237 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
11238
11239 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
11240 concerns.
11241
11242 * term.c (produce_glyphless_glyph): Remove unnecessary test.
11243
11244 * cm.c (calccost): Turn while-do into do-while, for clarity.
11245
11246 * keyboard.c (syms_of_keyboard): Use the same style as later
11247 in this function when indexing through an array. This also
11248 works around GCC bug 48267.
11249
11250 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
11251
11252 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
11253
11254 * chartab.c (sub_char_table_ref_and_range): Redo for slight
11255 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
11256
11257 * keyboard.c, keyboard.h (num_input_events): Now size_t.
11258 This avoids undefined behavior on integer overflow, and is a bit
11259 more convenient anyway since it is compared to a size_t variable.
11260
11261 Variadic C functions now count arguments with size_t, not int.
11262 This avoids an unnecessary limitation on 64-bit machines, which
11263 caused (substring ...) to crash on large vectors (Bug#8344).
11264 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
11265 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
11266 All variadic functions and their callers changed accordingly.
11267 (struct gcpro.nvars): Now size_t, not int. All uses changed.
11268 * data.c (arith_driver, float_arith_driver): Likewise.
11269 * editfns.c (general_insert_function): Likewise.
11270 * eval.c (struct backtrace.nargs, interactive_p)
11271 (internal_condition_case_n, run_hook_with_args, apply_lambda)
11272 (funcall_lambda, mark_backtrace): Likewise.
11273 * fns.c (concat): Likewise.
11274 * frame.c (x_set_frame_parameters): Likewise.
11275 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
11276 0 if not found, not -1. All callers changed.
11277
11278 * alloc.c (garbage_collect): Don't assume stack size fits in int.
11279 (stack_copy_size): Now size_t, not int.
11280 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
11281
11282 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11283
11284 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
11285 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11286 All callers changed.
11287
11288 * lisp.h (multibyte_char_to_unibyte):
11289 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
11290 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11291 * character.h (CHAR_TO_BYTE8):
11292 * cmds.c (internal_self_insert):
11293 * editfns.c (general_insert_function):
11294 * keymap.c (push_key_description):
11295 * search.c (Freplace_match):
11296 * xdisp.c (message_dolog, set_message_1): All callers changed.
11297
11298 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11299
11300 * keyboard.c (safe_run_hook_funcall): New function.
11301 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
11302 don't set the hook to nil, but remove the offending function instead.
11303 (Qcommand_hook_internal): Remove, unused.
11304 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
11305 Vcommand_hook_internal.
11306
11307 * eval.c (enum run_hooks_condition): Remove.
11308 (funcall_nil, funcall_not): New functions.
11309 (run_hook_with_args): Call each function through a `funcall' argument.
11310 Remove `cond' argument, now redundant.
11311 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
11312 (Frun_hook_with_args_until_failure): Adjust accordingly.
11313 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
11314
11315 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11316
11317 * dispextern.h (string_buffer_position): Remove declaration.
11318
11319 * print.c (strout): Remove parameter `multibyte', unused since
11320 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
11321
11322 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
11323 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
11324 All callers changed.
11325
11326 * w32.c (_wsa_errlist): Use braces for struct initializers.
11327
11328 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
11329 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
11330 All callers changed.
11331 (string_buffer_position): Likewise. Also, make static (it's never
11332 used outside xdisp.c).
11333 (cursor_row_p): Remove parameter `w', unused since
11334 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
11335 (decode_mode_spec): Remove parameter `precision', introduced during
11336 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
11337 All callers changed.
11338
11339 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11340
11341 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
11342
11343 2011-03-27 Anders Lindgren <andlind@gmail.com>
11344
11345 * nsterm.m (ns_menu_bar_is_hidden): New variable.
11346 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
11347 (ns_update_auto_hide_menu_bar): New functions.
11348 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
11349 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
11350 ns_constrain_all_frames.
11351 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
11352 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
11353
11354 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11355
11356 * nsmenu.m (runDialogAt): Remove argument to timer_check.
11357
11358 2011-03-27 Glenn Morris <rgm@gnu.org>
11359
11360 * syssignal.h: Replace RETSIGTYPE with void.
11361 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
11362 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
11363 Replace SIGTYPE with void everywhere.
11364 * s/usg5-4-common.h (SIGTYPE): Remove definition.
11365 * s/template.h (SIGTYPE): Remove commented out definition.
11366
11367 2011-03-26 Eli Zaretskii <eliz@gnu.org>
11368
11369 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
11370 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
11371
11372 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
11373
11374 * w32.c (read_unc_volume): Use parameter `henum', instead of
11375 global variable `wget_enum_handle'.
11376
11377 * keymap.c (describe_vector): Remove parameters `indices' and
11378 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
11379 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
11380
11381 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
11382
11383 * keyboard.c (timer_check): Remove parameter `do_it_now',
11384 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
11385 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
11386 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
11387
11388 * keyboard.c (read_char):
11389 * w32menu.c (w32_menu_display_help):
11390 * xmenu.c (show_help_event, menu_help_callback):
11391 Adjust calls to `show_help_echo'.
11392
11393 * gtkutil.c (xg_maybe_add_timer):
11394 * keyboard.c (readable_events):
11395 * process.c (wait_reading_process_output):
11396 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
11397
11398 * insdel.c (adjust_markers_gap_motion):
11399 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
11400 (gap_left, gap_right): Don't call it.
11401
11402 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
11403
11404 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
11405 incurred during fontification.
11406
11407 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
11408
11409 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
11410 (DEFVAR_PER_BUFFER): Don't pass it.
11411
11412 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
11413 (scrolling_window): Don't pass it.
11414
11415 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
11416
11417 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
11418
11419 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
11420 and `suffix'.
11421 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
11422 of variables specific to SELinux and computation of `encoded_absname'.
11423
11424 * image.c (XPutPixel): Remove unused variable `height'.
11425
11426 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
11427
11428 * unexw32.c (get_section_info): Remove unused variable `section'.
11429
11430 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
11431 (system_process_attributes): Remove unused variable `sess'.
11432 (sys_read): Remove unused variable `err'.
11433
11434 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
11435 (w32_wnd_proc): Remove unused variable `isdead'.
11436 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
11437 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
11438 (x_create_tip_frame): Remove unused variable `tem'.
11439
11440 * w32inevt.c (w32_console_read_socket):
11441 Remove unused variable `no_events'.
11442
11443 * w32term.c (x_draw_composite_glyph_string_foreground):
11444 Remove unused variable `width'.
11445
11446 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
11447
11448 * w32term.c (x_set_glyph_string_clipping):
11449 Don't pass uninitialized region to CombineRgn.
11450
11451 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
11452
11453 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
11454 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
11455 (Fx_close_connection): Remove unused variable `i'.
11456
11457 * w32font.c (w32font_draw): Return number of glyphs.
11458 (w32font_open_internal): Remove unused variable `i'.
11459 (w32font_driver): Add missing initializer.
11460
11461 * w32menu.c (utf8to16): Remove unused variable `utf16'.
11462 (fill_in_menu): Remove unused variable `items_added'.
11463
11464 * w32term.c (last_mouse_press_frame): Remove static global variable.
11465 (w32_clip_to_row): Remove unused variable `f'.
11466 (x_delete_terminal): Remove unused variable `i'.
11467
11468 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
11469 (NOTHING): Remove unused static global variable.
11470 (uniscribe_check_otf): Remove unused variable `table'.
11471 (uniscribe_font_driver): Add missing initializers.
11472
11473 2011-03-23 Julien Danjou <julien@danjou.info>
11474
11475 * term.c (Fsuspend_tty, Fresume_tty):
11476 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
11477 * window.c (temp_output_buffer_show):
11478 * insdel.c (signal_before_change):
11479 * frame.c (Fhandle_switch_frame):
11480 * fileio.c (Fdo_auto_save):
11481 * emacs.c (Fkill_emacs):
11482 * editfns.c (save_excursion_restore):
11483 * cmds.c (internal_self_insert):
11484 * callint.c (Fcall_interactively):
11485 * buffer.c (Fkill_all_local_variables):
11486 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
11487 Use Frun_hooks.
11488 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
11489 unconditionally since it does the check itself.
11490
11491 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
11492
11493 Fix more problems found by GCC 4.5.2's static checks.
11494
11495 * coding.c (encode_coding_raw_text): Avoid unnecessary test
11496 the first time through the loop, since we know p0 < p1 then.
11497 This also avoids a gcc -Wstrict-overflow warning.
11498
11499 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
11500 leading to a memory leak, possible in functions like
11501 load_charset_map_from_file that can allocate an unbounded number
11502 of objects (Bug#8318).
11503
11504 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
11505 that could (at least in theory) be that large.
11506
11507 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
11508 This is less likely to overflow, and avoids undefined behavior if
11509 overflow does occur. All callers changed. Use strtoul to scan
11510 for the unsigned long integer.
11511 (pint2hrstr): Simplify and tune code slightly.
11512 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
11513
11514 * scroll.c (do_scrolling): Work around GCC bug 48228.
11515 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
11516
11517 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
11518 This also avoids a warning with gcc -Wstrict-overflow.
11519 (validate_x_resource_name): Simplify count usage.
11520 This also avoids a warning with gcc -Wstrict-overflow.
11521
11522 * fileio.c (Fcopy_file): Report error if fchown or fchmod
11523 fail (Bug#8306).
11524
11525 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
11526
11527 * process.c (Fmake_network_process): Use socklen_t, not int,
11528 where POSIX says socklen_t is required in portable programs.
11529 This fixes a porting bug on hosts like 64-bit HP-UX, where
11530 socklen_t is wider than int (Bug#8277).
11531 (Fmake_network_process, server_accept_connection):
11532 (wait_reading_process_output, read_process_output):
11533 Likewise.
11534
11535 * process.c: Rename or move locals to avoid shadowing.
11536 (list_processes_1, Fmake_network_process):
11537 (read_process_output_error_handler, exec_sentinel_error_handler):
11538 Rename or move locals.
11539 (Fmake_network_process): Define label "retry_connect" only if needed.
11540 (Fnetwork_interface_info): Fix pointer signedness.
11541 (process_send_signal): Add cast to avoid pointer signedness problem.
11542 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
11543 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
11544
11545 Make tparam.h and terminfo.c consistent.
11546 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
11547 Include tparam.h instead, since it declares them.
11548 * cm.h (PC): Remove extern decl; tparam.h now does this.
11549 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
11550 * terminfo.c: Include tparam.h, to check interfaces.
11551 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
11552 (tparam): Adjust signature to match interface in tparam.h;
11553 this removes some undefined behavior. Check that outstring and len
11554 are zero, which they always are with Emacs.
11555 * tparam.h (PC, BC, UP): New extern decls.
11556
11557 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
11558 (xftfont_open): Rename locals to avoid shadowing.
11559
11560 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
11561 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
11562 (OTF_TAG_SYM): Omit macro if not needed.
11563 (ftfont_list): Remove unused local.
11564 (get_adstyle_property, ftfont_pattern_entity):
11565 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
11566 Rename locals to avoid shadowing.
11567
11568 * xfont.c (xfont_list_family): Mark var as initialized.
11569
11570 * xml.c (make_dom): Now static.
11571
11572 * composite.c (composition_compute_stop_pos): Rename local to
11573 avoid shadowing.
11574 (composition_reseat_it): Remove unused locals.
11575 (find_automatic_composition, composition_adjust_point): Likewise.
11576 (composition_update_it): Mark var as initialized.
11577 (find_automatic_composition): Mark vars as initialized,
11578 with a FIXME (Bug#8290).
11579
11580 character.h: Rename locals to avoid shadowing.
11581 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
11582 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
11583 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
11584 (BUF_DEC_POS): Be more systematic about renaming local temporaries
11585 to avoid shadowing.
11586
11587 * textprop.c (property_change_between_p): Remove; unused.
11588
11589 * intervals.c (interval_start_pos): Now static.
11590
11591 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
11592
11593 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
11594 Rename locals to avoid shadowing.
11595
11596 * sound.c (wav_play, au_play, Fplay_sound_internal):
11597 Fix pointer signedness.
11598 (alsa_choose_format): Remove unused local var.
11599 (wav_play): Initialize a variable to 0, to prevent undefined
11600 behavior (Bug#8278).
11601
11602 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
11603
11604 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
11605
11606 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
11607 clobbering (Bug#8298).
11608 * sysdep.c (sys_subshell): Likewise.
11609 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
11610
11611 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
11612 This should get cleaned up, so that child_setup has the
11613 same signature on all platforms.
11614
11615 * callproc.c (call_process_cleanup): Now static.
11616 (relocate_fd): Rename locals to avoid shadowing.
11617
11618 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
11619
11620 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
11621 not to be necessary, and produces flickering.
11622
11623 2011-03-20 Glenn Morris <rgm@gnu.org>
11624
11625 * config.in: Remove file.
11626
11627 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
11628
11629 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
11630 are now in src/globals.h.
11631 (syms_of_minibuf): Remove spurious & from previous change.
11632
11633 2011-03-20 Leo Liu <sdl.web@gmail.com>
11634
11635 * minibuf.c (completing-read-function): New variable.
11636 (completing-read-default): Rename from completing-read.
11637 (completing-read): Call completing-read-function.
11638
11639 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
11640
11641 * xfaces.c (Fx_load_color_file):
11642 Read color file from absolute filename (bug#8250).
11643
11644 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
11645
11646 * makefile.w32-in: Update dependencies.
11647
11648 2011-03-17 Eli Zaretskii <eliz@gnu.org>
11649
11650 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
11651
11652 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
11653
11654 Fix more problems found by GCC 4.5.2's static checks.
11655
11656 * process.c (make_serial_process_unwind, send_process_trap):
11657 (sigchld_handler): Now static.
11658
11659 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
11660 That way, the code declares only the vars that it needs.
11661 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
11662 * s/cygwin.h (PTY_ITERATION): Likewise.
11663 * s/darwin.h (PTY_ITERATION): Likewise.
11664 * s/gnu-linux.h (PTY_ITERATION): Likewise.
11665
11666 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
11667 * process.c (allocate_pty): Don't declare stb unless it's needed.
11668
11669 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
11670 (CONSTANTLIM): Remove; unused.
11671 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
11672 Define only if needed.
11673
11674 * unexelf.c (unexec): Name an expression,
11675 to avoid gcc -Wbad-function-cast warning.
11676 Use a different way to cause a compilation error if anyone uses
11677 n rather than nn, a way that does not involve shadowing.
11678 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
11679
11680 * deps.mk (unexalpha.o): Remove; unused.
11681
11682 New file unexec.h, the (simple) interface for unexec (Bug#8267).
11683 * unexec.h: New file.
11684 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
11685 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
11686 Depend on unexec.h.
11687 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
11688 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
11689 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
11690 Change as necessary to match prototype in unexec.h.
11691
11692 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
11693 shadowing.
11694 (back_comment, skip_chars): Mark vars as initialized.
11695
11696 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
11697 Rename locals to avoid shadowing.
11698
11699 * lread.c (read1): Rewrite so as not to use empty "else".
11700 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
11701
11702 * print.c (Fredirect_debugging_output): Fix pointer signedess.
11703
11704 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
11705 warning when compiling print.c.
11706
11707 * font.c (font_unparse_fcname): Abort in an "impossible" situation
11708 instead of using an uninitialized var.
11709 (font_sort_entities): Mark var as initialized.
11710
11711 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
11712
11713 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
11714 pointers to constants.
11715 (font_parse_fcname): Remove unused vars.
11716 (font_delete_unmatched): Now static.
11717 (font_get_spec): Remove; unused.
11718 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
11719 (font_update_drivers, Ffont_get_glyphs, font_add_log):
11720 Rename or move locals to avoid shadowing.
11721
11722 * fns.c (require_nesting_list, require_unwind): Now static.
11723 (Ffillarray): Rename locals to avoid shadowing.
11724
11725 * floatfns.c (domain_error2): Define only if needed.
11726 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
11727
11728 * alloc.c (mark_backtrace): Move decl from here ...
11729 * lisp.h: ... to here, so that it can be checked.
11730
11731 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
11732 (Fdefvar): Rewrite so as not to use empty "else".
11733 (lisp_indirect_variable): Name an expression,
11734 to avoid gcc -Wbad-function-cast warning.
11735 (Fdefvar): Rename locals to avoid shadowing.
11736
11737 * callint.c (quotify_arg, quotify_args): Now static.
11738 (Fcall_interactively): Rename locals to avoid shadowing.
11739 Use const pointer when appropriate.
11740
11741 * lisp.h (get_system_name, get_operating_system_release):
11742 Move decls here, to check interfaces.
11743 * process.c (get_operating_system_release): Move decl to lisp.h.
11744 * xrdb.c (get_system_name): Likewise.
11745 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
11746 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
11747 some of which prompt warnings from gcc -Wbad-function-cast.
11748 (Fformat_time_string, Fencode_time, Finsert_char):
11749 (Ftranslate_region_internal, Fformat):
11750 Rename or remove local vars to avoid shadowing.
11751 (Ftranslate_region_internal): Mark var as initialized.
11752
11753 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
11754 avoid shadowing.
11755
11756 * lisp.h (eassert): Check that the argument compiles, even if
11757 ENABLE_CHECKING is not defined.
11758
11759 * data.c (Findirect_variable): Name an expression, to avoid
11760 gcc -Wbad-function-cast warning.
11761 (default_value, arithcompare, arith_driver, arith_error): Now static.
11762 (store_symval_forwarding): Rename local to avoid shadowing.
11763 (Fmake_variable_buffer_local, Fmake_local_variable):
11764 Mark variables as initialized.
11765 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
11766
11767 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
11768 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
11769 Rename locals to avoid shadowing.
11770 (mark_stack): Move local variables into the #ifdef region where
11771 they're used.
11772 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
11773 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
11774 needed otherwise.
11775 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
11776 (GC_STRING_CHARS): Remove; not used.
11777 (Fmemory_limit): Cast sbrk's returned value to char *.
11778
11779 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
11780 avoids undefined behavior in theory.
11781
11782 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
11783
11784 Use functions, not macros, for up- and down-casing (Bug#8254).
11785 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11786 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
11787 to use the following functions instead of these macros.
11788 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
11789 EMACS_INT, since callers assume the returned value fits in int.
11790 (upcase1): Likewise, for UPCASE_TABLE.
11791 (uppercasep, lowercasep, upcase): New static inline functions.
11792 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
11793 the race-condition problem in the old DOWNCASE.
11794
11795 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
11796 Rename locals to avoid shadowing.
11797 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
11798 (regex_compile, re_search_2, re_match_2_internal):
11799 Remove unused local vars.
11800 (FREE_VAR): Rewrite so as not to use empty "else",
11801 which gcc can warn about.
11802 (regex_compile, re_match_2_internal): Mark locals as initialized.
11803 (RETALLOC_IF): Define only if needed.
11804 (WORDCHAR_P): Likewise. This one is never needed, but is used
11805 only in a comment talking about a compiler bug, so put inside
11806 the #if 0 of that comment.
11807 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
11808 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
11809 Remove; unused.
11810
11811 * search.c (boyer_moore): Rename locals to avoid shadowing.
11812 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
11813 (PREV_CHAR_BOUNDARY): Likewise.
11814
11815 * search.c (simple_search): Remove unused var.
11816
11817 * dired.c (compile_pattern): Move decl from here ...
11818 * lisp.h: ... to here, so that it can be checked.
11819 (struct re_registers): New forward decl.
11820
11821 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
11822
11823 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
11824 All uses changed.
11825 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
11826 Rename locals to avoid shadowing.
11827 (Fvertical_motion): Mark locals as initialized.
11828
11829 * casefiddle.c (casify_object, casify_region): Now static.
11830 (casify_region): Mark local as initialized.
11831
11832 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
11833
11834 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
11835 New macros, so that the caller can use some names other than
11836 gcpro1, gcpro2, etc.
11837 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
11838 of the new macros.
11839 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
11840 argument, for consistency with GCPRO2_VAR, etc: it is now the
11841 prefix of the variable, not the variable itself. All uses
11842 changed.
11843 * dired.c (directory_files_internal, file_name_completion):
11844 Rename locals to avoid shadowing.
11845
11846 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
11847 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
11848 dired.c's scmp function, had undefined behavior.
11849 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11850 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
11851 * buffer.h: ... to here, because these macros use current_buffer,
11852 and the new implementation with inline functions needs to have
11853 current_buffer in scope now, rather than later when the macros
11854 are used.
11855 (downcase, upcase1): New static inline functions.
11856 (DOWNCASE, UPCASE1): Reimplement using these functions.
11857 This avoids undefined behavior in expressions like
11858 DOWNCASE (x) == DOWNCASE (y), which previously suffered
11859 from race conditions in accessing the global variables
11860 case_temp1 and case_temp2.
11861 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
11862 * lisp.h (case_temp1, case_temp2): Remove their decls.
11863 * character.h (ASCII_CHAR_P): Move from here ...
11864 * lisp.h: ... to here, so that the inline functions mentioned
11865 above can use them.
11866
11867 * dired.c (directory_files_internal_unwind): Now static.
11868
11869 * fileio.c (file_name_as_directory, directory_file_name):
11870 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
11871 Now static.
11872 (file_name_as_directory): Use const pointers when appropriate.
11873 (Fexpand_file_name): Likewise. In particular, newdir might
11874 point at constant storage, so make it a const pointer.
11875 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
11876 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
11877 signedness issues.
11878 (Fset_file_times, Finsert_file_contents, auto_save_error):
11879 Rename locals to avoid shadowing.
11880
11881 * minibuf.c (choose_minibuf_frame_1): Now static.
11882 (Ftry_completion, Fall_completions): Rename or remove locals
11883 to avoid shadowing.
11884
11885 * marker.c (bytepos_to_charpos): Remove; unused.
11886
11887 * lisp.h (verify_bytepos, count_markers): New decls,
11888 so that gcc does not warn that these functions aren't declared.
11889
11890 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
11891 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
11892 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
11893 (copy_text): Remove unused local var.
11894
11895 * filelock.c (within_one_second): Now static.
11896 (lock_file_1): Rename local to avoid shadowing.
11897
11898 * buffer.c (fix_overlays_before): Mark locals as initialized.
11899 (fix_start_end_in_overlays): Likewise. This function should be
11900 simplified by using pointers-to-pointers, but that's a different
11901 matter.
11902 (switch_to_buffer_1): Now static.
11903 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
11904 (report_overlay_modification): Rename locals to avoid shadowing.
11905
11906 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
11907 Fix pointer signedness issue.
11908 (sys_subshell): Mark local as volatile if checking for lint,
11909 to suppress a gcc -Wclobbered warning that does not seem to be right.
11910 (MAXPATHLEN): Define only if needed.
11911
11912 * process.c (serial_open, serial_configure): Move decls from here ...
11913 * systty.h: ... to here, so that they can be checked.
11914
11915 * fns.c (get_random, seed_random): Move extern decls from here ...
11916 * lisp.h: ... to here, so that they can be checked.
11917
11918 * sysdep.c (reset_io): Now static.
11919 (wait_for_termination_signal): Remove; unused.
11920
11921 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
11922 (copy_keymap_item, append_key, push_text_char_description):
11923 Now static.
11924 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
11925 (DENSE_TABLE_SIZE): Remove; unused.
11926 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
11927 (describe_map_tree):
11928 Rename locals to avoid shadowing.
11929
11930 * keyboard.c: Declare functions static if they are not used elsewhere.
11931 (echo_char, echo_dash, cmd_error, top_level_2):
11932 (poll_for_input, handle_async_input): Now static.
11933 (read_char, kbd_buffer_get_event, make_lispy_position):
11934 (make_lispy_event, make_lispy_movement, apply_modifiers):
11935 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
11936 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
11937 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
11938 (read_key_sequence, read_char): Mark locals as initialized.
11939 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
11940
11941 * keyboard.h (make_ctrl_char): New decl.
11942 (mark_kboards): Move decl here ...
11943 * alloc.c (mark_kboards): ... from here.
11944
11945 * lisp.h (force_auto_save_soon): New decl.
11946
11947 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
11948 (DEFINE_DUMMY_FUNCTION): New macro.
11949 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
11950 Use it.
11951 (main): Add casts to avoid warnings
11952 if GCC considers string literals to be constants.
11953
11954 * lisp.h (fatal_error_signal): Add decl, since it's exported.
11955
11956 * dbusbind.c: Pointer signedness fixes.
11957 (xd_signature, xd_append_arg, xd_initialize):
11958 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11959 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11960 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
11961 (Fdbus_register_signal): Use SSDATA when the context wants char *.
11962
11963 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
11964 if GCC considers string literals to be constants.
11965 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
11966
11967 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
11968
11969 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
11970 (print_preprocess, print_object): New macro to fix last change.
11971
11972 * print.c (print_preprocess): Don't forget font objects.
11973
11974 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
11975
11976 * emacs.c (USAGE3): Doc fixes.
11977
11978 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
11979
11980 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
11981 structure.
11982
11983 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
11984
11985 * lisp.h (VWindow_system, Qfile_name_history):
11986 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
11987 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
11988 (w32_system_caret_x, w32_system_caret_y): Declare extern.
11989
11990 * w32select.c: Don't #include "keyboard.h".
11991 (run_protected): Add extern declaration for waiting_for_input.
11992
11993 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
11994 * w32console.c (detect_input_pending, read_input_pending)
11995 (encode_terminal_code):
11996 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
11997 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
11998 (w32_system_caret_y, Qfile_name_history):
11999 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
12000 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
12001 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
12002 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
12003 * w32proc.c (Qlocal, report_file_error):
12004 * w32term.c (Vwindow_system, updating_frame):
12005 * w32uniscribe.c (initialized, uniscribe_font_driver):
12006 Remove unneeded extern declarations.
12007
12008 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
12009
12010 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
12011
12012 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
12013
12014 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
12015 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
12016 These macros can no longer be used for assignment.
12017
12018 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12019 Assign struct members directly, instead of using BUF_BEGV etc.
12020 (record_buffer_markers, fetch_buffer_markers): New functions for
12021 recording and fetching special buffer markers.
12022 (set_buffer_internal_1, set_buffer_temp): Use them.
12023
12024 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
12025
12026 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
12027
12028 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
12029 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
12030
12031 * xdisp.c (hscroll_window_tree):
12032 (reconsider_clip_changes): Use PT instead of BUF_PT.
12033
12034 2011-03-13 Eli Zaretskii <eliz@gnu.org>
12035
12036 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
12037 $(EMACS_ROOT)/lib/intprops.h.
12038
12039 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
12040
12041 Fix more problems found by GCC 4.5.2's static checks.
12042
12043 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
12044 to unsigned char * to avoid compiler diagnostic.
12045 (xg_free_frame_widgets): Make it clear that a local variable is
12046 needed only if USE_GTK_TOOLTIP.
12047 (gdk_window_get_screen): Make it clear that this macro is needed
12048 only if USE_GTK_TOOLTIP.
12049 (int_gtk_range_get_value): New function, which avoids a diagnostic
12050 from gcc -Wbad-function-cast.
12051 (xg_set_toolkit_scroll_bar_thumb): Use it.
12052 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
12053 diagnostic from gcc -Wbad-function-cast.
12054 (get_utf8_string, xg_get_file_with_chooser):
12055 Rename locals to avoid shadowing.
12056 (create_dialog): Move locals to avoid shadowing.
12057
12058 * xgselect.c (xg_select): Remove unused var.
12059
12060 * image.c (four_corners_best): Mark locals as initialized.
12061 (gif_load): Initialize transparent_p to zero (Bug#8238).
12062 Mark another local as initialized.
12063 (my_png_error, my_error_exit): Mark with NO_RETURN.
12064
12065 * image.c (clear_image_cache): Now static.
12066 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
12067 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
12068 (x_edge_detection): Remove unnecessary cast that
12069 gcc -Wbad-function-cast diagnoses.
12070 (gif_load): Fix pointer signedness.
12071 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
12072 (jpeg_load, gif_load): Rename locals to avoid shadowing.
12073
12074 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
12075
12076 Improve quality of tests for time stamp overflow.
12077 For example, without this patch (encode-time 0 0 0 1 1
12078 1152921504606846976) returns the obviously-bogus value (-948597
12079 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
12080 reports time overflow. See
12081 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
12082 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
12083 * editfns.c: Include limits.h and intprops.h.
12084 (TIME_T_MIN, TIME_T_MAX): New macros.
12085 (time_overflow): Move earlier, to before first use.
12086 (hi_time, lo_time): New functions, for an accurate test for
12087 out-of-range times.
12088 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
12089 (Fget_internal_run_time): Don't assume time_t fits in int.
12090 (make_time): Use list2 instead of Fcons twice.
12091 (Fdecode_time): More accurate test for out-of-range times.
12092 (check_tm_member): New function.
12093 (Fencode_time): Use it, to test for out-of-range times.
12094 (lisp_time_argument): Don't rely on undefined left-shift and
12095 right-shift behavior when checking for time stamp overflow.
12096
12097 * editfns.c (time_overflow): New function, refactoring common code.
12098 (Fformat_time_string, Fdecode_time, Fencode_time):
12099 (Fcurrent_time_string): Use it.
12100
12101 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
12102 * dired.c (make_time): Move to ...
12103 * editfns.c (make_time): ... here.
12104 * systime.h: Note the move.
12105
12106 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12107
12108 * fringe.c (update_window_fringes): Remove unused variables.
12109
12110 * unexmacosx.c (copy_data_segment): Also copy __got section.
12111 (Bug#8223)
12112
12113 2011-03-12 Eli Zaretskii <eliz@gnu.org>
12114
12115 * termcap.c [MSDOS]: Include "msdos.h".
12116 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
12117 Constify `char *' arguments and their references according to
12118 prototypes in tparam.h.
12119
12120 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
12121
12122 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
12123 Adapt all references accordingly.
12124
12125 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
12126
12127 2011-03-11 Tom Tromey <tromey@redhat.com>
12128
12129 * buffer.c (syms_of_buffer): Remove obsolete comment.
12130
12131 2011-03-11 Eli Zaretskii <eliz@gnu.org>
12132
12133 * termhooks.h (encode_terminal_code): Declare prototype.
12134
12135 * msdos.c (encode_terminal_code): Don't declare prototype.
12136
12137 * term.c (encode_terminal_code): Now external again, used by
12138 w32console.c and msdos.c.
12139
12140 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
12141 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
12142
12143 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
12144
12145 Fix some minor problems found by GCC 4.5.2's static checks.
12146
12147 * fringe.c (update_window_fringes): Mark locals as initialized
12148 (Bug#8227).
12149 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
12150
12151 * alloc.c (mark_fringe_data): Move decl from here ...
12152 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
12153 to check its interface.
12154 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
12155
12156 * fontset.c (free_realized_fontset): Now static.
12157 (Fset_fontset_font): Rename local to avoid shadowing.
12158 (fontset_font): Mark local as initialized.
12159 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
12160
12161 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
12162
12163 * xselect.c (x_disown_buffer_selections): Remove; not used.
12164 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
12165 (x_own_selection, Fx_disown_selection_internal): Rename locals
12166 to avoid shadowing.
12167 (x_handle_dnd_message): Remove local to avoid shadowing.
12168
12169 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
12170 so that the caller can use some name other than gcpro1.
12171 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
12172 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12173 (Fx_backspace_delete_keys_p):
12174 Use them to avoid shadowing, and rename vars to avoid shadowing.
12175 (x_decode_color, x_set_name, x_window): Now static.
12176 (Fx_create_frame): Add braces to silence GCC warning.
12177 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
12178 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
12179 Remove unused locals.
12180 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12181 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
12182 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
12183 macros.
12184
12185 * xterm.h (x_mouse_leave): New decl.
12186
12187 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
12188 Remove unused functions.
12189 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
12190 (x_calc_absolute_position): Now static.
12191 (XTread_socket): Don't define label "out" unless it's used.
12192 Don't declare local "event" unless it's used.
12193 (x_iconify_frame, x_free_frame_resources): Don't declare locals
12194 unless they are used.
12195 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
12196 (x_fatal_error_signal): Remove; not used.
12197 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
12198 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
12199 (x_error_catcher, x_connection_closed, x_error_handler):
12200 (x_error_quitter, xembed_send_message, x_iconify_frame):
12201 (my_log_handler): Rename locals to avoid shadowing.
12202 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
12203 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
12204
12205 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
12206 Rename or move locals to avoid shadowing.
12207 (tty_defined_color, merge_face_heights): Now static.
12208 (free_realized_faces_for_fontset): Remove; not used.
12209 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
12210 does not deduce is never used uninitialized.
12211 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
12212 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
12213
12214 * terminal.c (store_terminal_param): Now static.
12215
12216 * xmenu.c (menu_highlight_callback): Now static.
12217 (set_frame_menubar): Remove unused local.
12218 (xmenu_show): Rename parameter to avoid shadowing.
12219 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
12220 since they might point to immutable storage.
12221 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
12222 since it's unused otherwise.
12223
12224 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
12225 Add a FIXME, since the code still doesn't look right. (Bug#8215)
12226 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
12227 avoids a gcc -Wuninitialized diagnostic.
12228 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
12229 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
12230 does not deduce are never used uninitialized.
12231
12232 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
12233
12234 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
12235 * window.c (window_loop, size_window):
12236 (run_window_configuration_change_hook, enlarge_window): Likewise.
12237
12238 * window.c (display_buffer): Now static.
12239 (size_window): Mark variables that gcc -Wuninitialized
12240 does not deduce are never used uninitialized.
12241 * window.h (check_all_windows): New decl, to forestall
12242 gcc -Wmissing-prototypes diagnostic.
12243 * dispextern.h (bidi_dump_cached_states): Likewise.
12244
12245 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
12246 shadowing.
12247 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
12248 Include <limits.h>.
12249 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
12250 and to avoid gcc -Wuninitialized warning.
12251 (load_charset_map): Mark variables that gcc -Wuninitialized
12252 does not deduce are never used uninitialized.
12253 (load_charset): Abort instead of using uninitialized var (Bug#8229).
12254
12255 * coding.c (coding_set_source, coding_set_destination):
12256 Use "else { /* comment */ }" rather than "else /* comment */;"
12257 for clarity, and to avoid gcc -Wempty-body warning.
12258 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
12259 a block, when the outer 'i' will do.
12260 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
12261 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
12262 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
12263 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
12264 (Fdecode_sjis_char, Fdefine_coding_system_internal):
12265 Rename locals to avoid shadowing.
12266 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
12267 * coding.c (emacs_mule_char, encode_invocation_designation):
12268 Now static, since they're not used elsewhere.
12269 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
12270 (decode_coding_object, encode_coding_object, detect_coding_system):
12271 (decode_coding_emacs_mule): Mark variables that gcc
12272 -Wuninitialized does not deduce are never used uninitialized.
12273 (detect_coding_iso_2022): Initialize a local variable that might
12274 be used uninitialized. Leave a FIXME because it's not clear that
12275 this initialization is needed. (Bug#8211)
12276 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
12277 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
12278 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
12279 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
12280 Remove unused macros.
12281
12282 * category.c (hash_get_category_set): Remove unused local var.
12283 (copy_category_table): Now static, since it's not used elsewhere.
12284 * character.c (string_count_byte8): Likewise.
12285
12286 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
12287 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
12288
12289 * chartab.c (copy_sub_char_table): Now static, since it's not used
12290 elsewhere.
12291 (sub_char_table_ref_and_range, char_table_ref_and_range):
12292 Rename locals to avoid shadowing.
12293 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
12294
12295 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
12296 (BIDI_BOB): Remove unused macro.
12297
12298 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
12299 deduce are never used uninitialized.
12300 * term.c (encode_terminal_code): Likewise.
12301
12302 * term.c (encode_terminal_code): Now static. Remove unused local.
12303
12304 * tparam.h: New file.
12305 * term.c, tparam.h: Include it.
12306 * deps.mk (term.o, tparam.o): Depend on tparam.h.
12307 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
12308 Move these decls to tparam.h, and make them agree with what
12309 is actually in tparam.c. The previous trick of using incompatible
12310 decls in different modules does not conform to the C standard.
12311 All callers of tparam changed to use tparam's actual API.
12312 * tparam.c (tparam1, tparam, tgoto):
12313 Use const pointers where appropriate.
12314
12315 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
12316 * cm.h (struct cm): Likewise.
12317 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
12318 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
12319 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
12320 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
12321 (turn_on_face, init_tty): Likewise.
12322 * termchar.h (struct tty_display_info): Likewise.
12323
12324 * term.c (term_mouse_position): Rename local to avoid shadowing.
12325
12326 * alloc.c (mark_ttys): Move decl from here ...
12327 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
12328
12329 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
12330
12331 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
12332
12333 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
12334
12335 * search.c (compile_pattern_1): Remove argument regp, unused since
12336 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
12337 (compile_pattern): Don't pass it.
12338
12339 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
12340
12341 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
12342 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
12343 for ! HAVE_GTK3.
12344 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
12345
12346 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
12347
12348 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
12349 gdk_window_get_screen, gdk_window_get_geometry,
12350 gdk_x11_window_lookup_for_display and GDK_KEY_g.
12351 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
12352 (xg_get_pixbuf_from_pixmap): New function.
12353 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
12354 to Pixmap, take frame as parameter, remove GdkColormap parameter.
12355 Call xg_get_pixbuf_from_pixmap instead of
12356 gdk_pixbuf_get_from_drawable.
12357 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
12358 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
12359 (xg_check_special_colors): Use GtkStyleContext and its functions
12360 for HAVE_GTK3.
12361 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
12362 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
12363 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
12364 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
12365 Call gtk_widget_get_preferred_size.
12366 (xg_frame_resized): gdk_window_get_geometry only takes 5
12367 parameters.
12368 (xg_win_to_widget, xg_event_is_for_menubar):
12369 Call gdk_x11_window_lookup_for_display.
12370 (xg_set_widget_bg): New function.
12371 (delete_cb): New function.
12372 (xg_create_frame_widgets): Connect delete-event to delete_cb.
12373 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
12374 (xg_set_background_color): Call xg_set_widget_bg.
12375 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
12376 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
12377 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
12378 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
12379 if ! HAVE_GTK3.
12380 (update_frame_tool_bar): Call gtk_widget_hide.
12381 (xg_initialize): Use GDK_KEY_g.
12382
12383 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
12384 if ! HAVE_GTK3
12385 (x_session_initialize): Call gdk_x11_set_sm_client_id.
12386
12387 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
12388 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
12389 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
12390
12391 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
12392
12393 * w32xfns.c (select_palette): Check success of RealizePalette against
12394 GDI_ERROR, not zero.
12395
12396 See ChangeLog.11 for earlier changes.
12397
12398 ;; Local Variables:
12399 ;; coding: utf-8
12400 ;; End:
12401
12402 Copyright (C) 2011-2012 Free Software Foundation, Inc.
12403
12404 This file is part of GNU Emacs.
12405
12406 GNU Emacs is free software: you can redistribute it and/or modify
12407 it under the terms of the GNU General Public License as published by
12408 the Free Software Foundation, either version 3 of the License, or
12409 (at your option) any later version.
12410
12411 GNU Emacs is distributed in the hope that it will be useful,
12412 but WITHOUT ANY WARRANTY; without even the implied warranty of
12413 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12414 GNU General Public License for more details.
12415
12416 You should have received a copy of the GNU General Public License
12417 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.