]> code.delx.au - gnu-emacs/blob - src/ChangeLog
* dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
[gnu-emacs] / src / ChangeLog
1 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
2
3 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4
5 2012-10-31 Martin Rudalics <rudalics@gmx.at>
6
7 * minibuf.c (read_minibuf): Restore current buffer since
8 choose_minibuf_frame calling Fset_frame_selected_window may
9 change it (Bug#12766).
10
11 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
12
13 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
14
15 2012-10-30 Kenichi Handa <handa@gnu.org>
16
17 * font.c (Ffont_at): If WINDOW is specified and it is not
18 displaying the current buffer, signal an error.
19
20 2012-10-29 Daniel Colascione <dancol@dancol.org>
21
22 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode): In
23 preparation for fixing bug#12739, move these functions from
24 here...
25
26 * coding.h, coding.c: ... to here, and compile them only when
27 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
28 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
29
30 2012-10-28 Eli Zaretskii <eliz@gnu.org>
31
32 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
33 (timer_loop, getitimer, setitimer): Use it instead of
34 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
35 'clock'.
36 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
37 literal 10000.
38
39 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
40
41 * nsterm.m (NO_APPDEFINED_DATA): New define.
42 (last_appdefined_event_data): New variable
43 (last_appdefined_event): Remove.
44 (ns_select): Initialize t from last_appdefined_event_data instead
45 of [last_appdefined_event data1].
46 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
47 remove last_appdefined_event (Bug#12698).
48
49 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
50
51 * frame.c (x_set_font): Catch internal error.
52
53 2012-10-27 Eli Zaretskii <eliz@gnu.org>
54
55 Avoid overflow in w32 implementation of interval timers.
56 When possible, for ITIMER_PROF count only times the main thread
57 actually executes.
58 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
59 'volatile ULONGLONG' types. All the other data which was
60 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
61 (GetThreadTimes_Proc): New typedef.
62 (w32_get_timer_time): New function, returns a suitable time value
63 for the timer.
64 (timer_loop): Enter critical section when accessing ULONGLONG
65 values of the itimer_data struct, as these accesses are no longer
66 atomic. Call 'w32_get_timer_time' instead of 'clock'.
67 Remove unused variable.
68 (init_timers): Initialize s_pfn_Get_Thread_Times.
69 (start_timer_thread): Don't assign itimer->caller_thread here.
70 (getitimer): Assign itimer->caller_thread here.
71 (setitimer): Always call getitimer to get the value of ticks_now.
72 (sys_spawnve): Avoid compiler warning about format mismatch.
73
74 2012-10-26 Eli Zaretskii <eliz@gnu.org>
75
76 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
77 mouse movement events if the menu bar is active. This avoids
78 producing a busy "hour-glass" cursor by Windows if the mouse
79 pointer is positioned over a tooltip shown for some menu item.
80
81 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
82
83 Don't assume process IDs fit in int.
84 * emacs.c (shut_down_emacs) [!DOS_NT]:
85 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
86 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
87 Use pid_t, not int, to store process IDs, as 'int'
88 is not wide enough on a few platforms (e.g., AIX and IRIX).
89
90 2012-10-23 Kenichi Handa <handa@gnu.org>
91
92 The following change is to make face-font-rescale-alist work
93 correctly for non-ASCII fonts.
94
95 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
96 (font_open_for_lface): Handle Vface_font_rescale_alist.
97
98 2012-10-23 Chong Yidong <cyd@gnu.org>
99
100 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
101
102 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
103
104 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
105 for screen font.
106 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
107
108 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
109 event (Bug#12681).
110
111 2012-10-21 Glenn Morris <rgm@gnu.org>
112
113 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
114
115 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
116
117 Port to OpenBSD 5.1.
118 * frame.c (Fmouse_position, Fmouse_pixel_position):
119 * xdisp.c (produce_stretch_glyph):
120 Declare local vars only when they're needed.
121 This is clearer and avoids a warning on OpenBSD about unused vars.
122 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
123 This is safer, and avoids OpenBSD warnings about unused vars.
124 * keyboard.c (record_menu_key): Remove unnecessary decl.
125 (poll_timer): Define only if POLL_FOR_INPUT is defined.
126 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
127 as our definition clashes with OpenBSD's.
128 * xfaces.c (load_face_colors, check_lface_attrs)
129 (get_lface_attributes_no_remap, get_lface_attributes)
130 (lface_fully_specified_p, x_supports_face_attributes_p)
131 (tty_supports_face_attributes_p, face_fontset, realize_face)
132 (realize_x_face, realize_tty_face):
133 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
134 merely Lisp_Object *. This is more informative and avoids
135 a warning on OpenBSD about accessing beyond an object's size.
136
137 2012-10-20 Chong Yidong <cyd@gnu.org>
138
139 * lread.c (Fload): Doc fix (Bug#12592).
140
141 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
142
143 * font.c (Ffont_at): Fix previous change.
144
145 2012-10-19 Eli Zaretskii <eliz@gnu.org>
146
147 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
148 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
149 for the reasons.
150
151 * alloc.c (NSTATICS): Decrease to 0x800.
152
153 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
154
155 * fns.c (Fnreverse): Include the problem element when signalling an
156 error (bug#12677).
157
158 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
159
160 * nsterm.m (ns_select): Check writefds before call to
161 FD_ISSET (Bug#12668).
162
163 2012-10-18 Daniel Colascione <dancol@dancol.org>
164
165 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
166 (staticpro): If we run out of staticpro slots, die with an
167 informative error instead of just calling emacs_abort.
168
169 2012-10-18 Martin Rudalics <rudalics@gmx.at>
170
171 Fix two flaws reported by Dmitry Antipov.
172 * window.c (Ftemp_output_buffer_show): Remove.
173 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
174 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
175
176 2012-10-17 Eli Zaretskii <eliz@gnu.org>
177
178 * makefile.w32-in ($(BLD)/w32.$(O)):
179 ($(BLD)/vm-limit.$(O)):
180 ($(BLD)/term.$(O)):
181 ($(BLD)/unexw32.$(O)):
182 ($(BLD)/fileio.$(O)):
183 ($(BLD)/dispnew.$(O)): Update dependencies.
184
185 * w32term.h (w32_initialize_display_info, initialize_w32_display):
186 Add prototypes.
187
188 * w32proc.c: Include ctype.h.
189
190 * w32.h (init_environment, check_windows_init_file)
191 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
192 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
193 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
194 (sys_link): Add prototypes.
195
196 * w32.c: Include w32select.h.
197 (sys_access, e_malloc, sys_select): Add prototypes.
198 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
199
200 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
201
202 * unexw32.c: Include lisp.h and w32.h.
203
204 * term.c [WINDOWSNT]: Include w32term.h.
205
206 * process.c [WINDOWSNT]: Add prototype of sys_select.
207
208 * fileio.c [WINDOWSNT]: Include w32.h.
209
210 * dispnew.c [WINDOWSNT]: Include w32.h.
211
212 * cygw32.c (Fcygwin_convert_path_to_windows)
213 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
214 Lisp_Object values. (Bug#12661)
215
216 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
217 to Lisp_Object. (Bug#12661)
218
219 2012-10-17 Kenichi Handa <handa@gnu.org>
220
221 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
222 invalidate.
223
224 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
225
226 * buffer.c (Fkill_buffer): When unchaining the marker,
227 reset its buffer pointer to NULL (Bug#12652).
228
229 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
230
231 Do not verify indirection counters of killed buffers (Bug#12579).
232 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
233 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
234
235 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
236
237 * alloc.c (Fmake_byte_code): Fix typo in comment.
238 * print.c (print_interval): Define as static to match prototype.
239 * indent.c (disptab_matches_widthtab, recompute_width_table):
240 Convert to eassert.
241
242 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
243
244 * editfns.c (get_system_name): Remove.
245 * lisp.h (get_system_name): Remove prototype.
246 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
247 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
248
249 2012-10-15 Daniel Colascione <dancol@dancol.org>
250
251 * dbusbind.c: Add comment explaining reason for previous change.
252
253 2012-10-15 Martin Rudalics <rudalics@gmx.at>
254
255 * window.c (Fwindow_end): Rewrite check whether cached position
256 can be used (Bug#12600).
257 (resize_frame_windows, grow_mini_window, shrink_mini_window):
258 Set windows_or_buffers_changed.
259
260 2012-10-15 Daniel Colascione <dancol@dancol.org>
261
262 * dbusbind.c: Fix cygw32 build break when compiling with dbus
263 enabled by undefining the symbol "interface", which the platform
264 headers define to something incompatible.
265
266 2012-10-14 Daniel Colascione <dancol@dancol.org>
267
268 * image.c (init_tiff_functions, init_imagemagick_functions)
269 (init_svg_functions): Fix cygw32 build break by using these
270 functions only when WINDOWSNT _and_ HAVE_NTGUI.
271
272 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
273
274 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
275
276 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
277
278 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
279
280 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
281
282 * coding.c (detect_coding): Set coding->id before calling
283 this->detector.
284
285 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
286
287 * fileio.c: Formatting fixes.
288
289 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
290
291 Fix some stat-related races.
292 * fileio.c (Fwrite_region): Avoid race condition if a file is
293 removed or renamed by some other process immediately after Emacs
294 writes it but before Emacs stats it. Do not assume that stat (or
295 fstat) succeeds.
296 * image.c (slurp_file): Resolve the file name with fopen + fstat
297 rather than stat + fopen.
298 (pbm_read_file) [0]: Remove unused code with stat race.
299 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
300 Remove ineffective code with stat race.
301
302 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
303
304 * doc.c (get_doc_string): Don't signal an error if the file is missing.
305
306 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
307
308 * nsterm.m (hold_event_q): New static variable.
309 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
310 ! q_event_ptr.
311 (hold_event): New function.
312 (ns_read_socket): If hold_event_q have events, store them and
313 return (Bug#12384).
314 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
315 is zero (Bug#12384).
316
317 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
318
319 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
320
321 2012-10-12 Eli Zaretskii <eliz@gnu.org>
322
323 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
324
325 * fileio.c (check_existing): New function.
326 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
327 instead of calling 'stat', when what's needed is to check whether
328 a file exists. This avoids expensive system calls on MS-Windows.
329 (Bug#12587)
330
331 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
332
333 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
334 determine whether a file exists and is not a directory.
335
336 * lisp.h (check_existing): Add prototype.
337
338 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
339
340 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
341
342 2012-10-12 Glenn Morris <rgm@gnu.org>
343
344 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
345
346 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
347
348 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
349
350 * eval.c (Fautoload): Remember previous autoload status in load-history.
351
352 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
353
354 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
355 * lread.c (load_each_byte, new_backquote_flag, readchar)
356 (read_filtered_event, lisp_file_lexically_bound_p)
357 (safe_to_load_version, Fload, complete_filename_p, openp)
358 (build_load_history, readevalloop, read_escape, read1)
359 (string_to_number, read_vector, read_list):
360 * macros.c (Fstart_kbd_macro):
361 * marker.c (CONSIDER):
362 * menu.c (parse_single_submenu, digest_single_submenu)
363 (find_and_return_menu_selection, Fx_popup_menu):
364 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
365 (Ftry_completion):
366 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
367 (ns_menu_show):
368 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
369 (xmenu_show, xdialog_show):
370 Use bool for booleans.
371 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
372 as it's not a predicate. All uses changed. Omit unnecessary
373 buffer termination.
374
375 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
376
377 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
378 (save_excursion_restore): Do not restore mark if it was not saved.
379
380 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
381
382 * marker.c (cached_modiff): EMACS_INT, not int.
383
384 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
385 instead of having a wrong decl.
386 * nsmenu.m (waiting_for_input): Remove wrong decl.
387
388 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
389
390 keyboard.c, keymap.c: Use bool for booleans.
391 * dispnew.c (sit_for): Distinguish between 3-way display_option
392 and boolean do_display.
393 * keyboard.c (single_kboard, this_command_key_count_reset)
394 (waiting_for_input, echoing, immediate_quit, input_pending)
395 (interrupt_input, interrupts_deferred, pop_kboard)
396 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
397 (command_loop_1, adjust_point_for_property)
398 (safe_run_hooks_error, input_polling_used, read_char):
399 (help_char_p, readable_events, kbd_buffer_events_waiting)
400 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
401 (lucid_event_type_list_p, get_input_pending):
402 (gobble_input, menu_separator_name_p, menu_bar_item)
403 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
404 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
405 (keyremap_step, test_undefined, read_key_sequence)
406 (detect_input_pending, detect_input_pending_ignore_squeezables)
407 (detect_input_pending_run_timers, requeued_events_pending_p)
408 (quit_throw_to_read_char, Fset_input_interrupt_mode):
409 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
410 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
411 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
412 (accessible_keymaps_1, Fkey_description, push_key_description):
413 (shadow_lookup, struct where_is_internal_data)
414 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
415 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
416 (describe_map, describe_vector):
417 * menu.c (single_menu_item):
418 * nsmenu.m (ns_update_menubar):
419 * process.c (wait_reading_process_output):
420 * search.c (scan_buffer, scan_newline):
421 Use bool for boolean.
422 * keyboard.c (timers_run, swallow_events)
423 (detect_input_pending_run_timers):
424 * process.c (wait_reading_process_output):
425 Use unsigned for counter where wraparound-on-overflow is desired,
426 since unsigned is guaranteed to have that behavior and signed is not.
427 (read_char): Use ptrdiff_t for string length.
428 (get_input_pending): Remove first argument, since it was always
429 the same pointer-to-int (now pointer-to-boolean) &input_pending,
430 and behave as if it had that value. Return new value of
431 input_pending. All callers changed.
432 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
433 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
434 a string length.
435 * keymap.c (push_key_description): Omit last arg, which was always 1.
436 All callers changed.
437
438 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
439
440 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
441
442 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
443 ($(BLD)/term.$(O)): Update dependencies.
444
445 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
446
447 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
448 * lisp.h (enum pvec_type): Adjust comments and omit explicit
449 initializer for PVEC_NORMAL_VECTOR.
450
451 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
452
453 Clean out old termopts cruft.
454 * termopts.h (flow_control, meta_key): Remove unused decls.
455 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
456 Don't include termopts.h.
457
458 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
459
460 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
461
462 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
463
464 * commands.h (immediate_quit): Remove duplicate decl.
465
466 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
467
468 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
469 caching.
470 (nsfont_open): Remove setting of Vfonts_in_cache.
471 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
472
473 2012-10-09 Eli Zaretskii <eliz@gnu.org>
474
475 * w32fns.c (w32_last_error): Change the return value to DWORD, to
476 match what GetLastError returns. Explain why the function is
477 needed.
478
479 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
480 'is_tooltip_frame', to avoid confusion with its global namesake.
481
482 2012-10-08 Daniel Colascione <dancol@dancol.org>
483
484 * xdisp.c (start_hourglass): Call w32_note_current_window when
485 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
486 build that caused Emacs to display the hourglass cursor forever.
487
488 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
489 which is broken under remote desktop, calculate the number of
490 colors available for a display based on the display's number of
491 planes and number of bits per pixel per plane. (bug#10397).
492
493 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
494
495 * nsfont.m (Vfonts_in_cache): New variable.
496 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
497 are used. Add cached fonts to Vfonts_in_cache.
498 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
499
500 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
501
502 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
503 in nt/config.nt.
504 (FONT_H): Define after FRAME_H.
505 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
506 Update dependencies.
507
508 * w32term.c: Remove leftover declaration of keyboard_codepage.
509
510 2012-10-08 Eli Zaretskii <eliz@gnu.org>
511
512 * makefile.w32-in (FONT_H): Add $(FRAME_H).
513 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
514 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
515 (GLOBAL_SOURCES): Add cygw32.c.
516 ($(BLD)/unexw32.$(O)):
517 ($(BLD)/w32.$(O)):
518 ($(BLD)/w32console.$(O)):
519 ($(BLD)/w32fns.$(O)):
520 ($(BLD)/w32heap.$(O)):
521 ($(BLD)/w32menu.$(O)):
522 ($(BLD)/w32proc.$(O)): Add w32common.h.
523
524 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
525 'const char *'.
526 (x_to_w32_color): Don't modify the argument, modify a copy instead.
527
528 2012-10-08 Daniel Colascione <dancol@dancol.org>
529
530 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
531 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
532 accidental message numbering hole. Change other messages to
533 match.
534
535 * w32select.h (HAVE_W32SELECT): Remove.
536
537 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
538 w32common.h instead of w32heap.h.
539
540 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
541 (get_allocation_unit, get_processor_type, get_w32_major_version)
542 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
543 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
544 (OS_NT, os_subtype, cache_system_info): Move declarations to
545 w32common.
546
547 * w32heap.c: Include w32common.h.
548 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
549 (w32_minor_version, w32_build_number, w32_subtype):
550 Remove duplicate definitions.
551
552 * w32fns.c: Include w32common.h; include w32heap.h only in
553 WINDOWSNT.
554
555 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
556 Use `report_file_error' instead of `error' in order to better
557 inform users of what went wrong. Increase NTGUI_UNICODE file
558 dialog box file name length to 32k, the maximum allowed by the NT
559 kernel.
560
561 * w32common.h: New file.
562 (ROUND_UP, ROUND_DOWN, get_page_size)
563 (get_allocation_unit, get_processor_type, get_w32_major_version)
564 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
565 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
566 (OS_NT, os_subtype, cache_system_info): Move here.
567
568 * unexw32.c, unexcw.c: Include w32common.h.
569
570 * emacs.c (main): Use (defined (WINDOWSNT) || defined
571 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
572 to call syms_of_w32select.
573
574 * cygw32.h: Remove obsolete EXFUN declarations.
575
576 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
577
578 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
579 of w32inevt.o from SOME_MACHINE_OBJECTS.
580
581 2012-10-08 Daniel Colascione <dancol@dancol.org>
582
583 * image.c: Permanent fix for JPEG compilation issue --- limit
584 jpeglib `boolean' redefinition to Cygwin builds.
585
586 2012-10-08 Eli Zaretskii <eliz@gnu.org>
587
588 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
589
590 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
591 Cygwin.
592
593 2012-10-08 Daniel Colascione <dancol@dancol.org>
594
595 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
596 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
597 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
598 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
599 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
600 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
601 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
602 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
603 now a supported configuration.
604
605 * Makefile.in: consolidate image variables into LIBIMAGE; add
606 W32_OBJ and W32_LIBS. Compile new files.
607
608 * conf_post.h:
609 (_DebPrint) declare tracing facility for W32 debugging. We need
610 to unify tracing later.
611
612 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
613 unconditional use of W32 Unicode functions. Cygwin runs only on
614 100% Unicode operating systems.
615
616 * cygw32.c: New file. Define Cygwin-specific facilities.
617 (Fcygwin_convert_path_to_windows)
618 (Fcygwin_convert_path_from_windows): New user functions for
619 accessing Cygwin path-munging routines.
620
621 * cygw32.h: New file.
622 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
623 UTF-16LE strings temporarily inside non-Lisp-visible string
624 objects.
625
626 (w32_strerror): Just what it says on the tin.
627
628 * emacs.c: Make the NS fork-then-exec code for daemon-launching
629 also run for Cygwin; both systems have the same problem with using
630 GUI facilities in a forked child. Also call syms_of_cygw32,
631 syms_of_w32select in correct places.
632
633 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
634 needs fork-then-exec for daemon launching.
635
636 * font.h: Include frame.h.
637
638 * image.c: Use the image library cache machinery only when we're
639 compiling for native WINDOWSNT; Cygwin can use shared libraries
640 like any other Unixlike system.
641
642 * keyboard.c: Clarify a comment regarding the input loop.
643
644 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
645 functions directly instead of trying to detect at runtime that our
646 host operating system supports them. We make this change for two
647 reasons: Cygwin lacks support for the multibyte character
648 conversion functions used by the legacy menu code, and Cygwin
649 never needs to rely on non-Unicode APIs.
650
651 * unexw32.c (hinst): Declare extern.
652
653 * w32.c: Change header order;
654 (w32_strerror): Move to w32fns.c because we need it for
655 non-WINDOWSNT builds.
656
657 * w32.h: Add #error macro to make sure we don't include w32.h for
658 Cygwin builds. Remove w32select declarations.
659
660 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
661 w32fns.c. w32console.c is WINDOWSNT-only.
662
663 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
664 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
665 POSIXy alternative.
666 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
667 (w32_major_version, w32_minor_version, w32_build_number)
668 (os_subtype, sound_type): Define here
669 (w32_defined_color): Make color parameter const for consistency
670 with other _defined_color functions.
671 (w32_createwindow): Unconditionally call w32_init_class instead of
672 doing so only when hprevinst is non-NULL. Plumbing hprevinst
673 through the code is complex and unnecessary because class
674 registration is practically free.
675 (w32_name_of_message): New EMACSDEBUG-only function.
676 (Fset_message_beep): Move here
677 (Fx_open_connection): Require that the display name for Windows be
678 "w32" for consistency, emacsclient disambiguation, and maybe, one
679 day, multi-window-system support.
680 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
681 Cygwin files for W32 GUI facilities, since these clearly don't
682 expect Cygwin names.
683 (_DebPrint): Define.
684 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
685 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
686 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
687 (w32_last_error): Remove.
688
689 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
690
691 * w32heap.c (syspage_mask): Declare here.
692 (cache_system_info): Remove.
693
694 * w32inevt.c (faked_key): Define globally, not statically.
695 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
696 (w32_console_toggle_lock_key): Move to w32fns.c.
697
698 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
699
700 * w32proc.c (_DebPrint): Move to w32fns.c.
701 * w32select.c: Include string.h, stdio.h for Cygwin.
702 * w32select.h: New File.
703
704 * w32term.c: Include io.h for non-CYGWIN builds; needed for
705 get_osfhandle.
706 (w32_message_fd): New variable. Under Cygwin, holds the file
707 descriptor the system used to tell us about pending thread
708 messages.
709
710 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
711 that prevented compilation under non-WINDOWSNT systems.
712
713 (w32_initialize): Open /dev/windows and assign it to
714 w32_message_fd. Provide w32 feature.
715
716 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
717 (WM_EMACS_INPUT_READY): add.
718 (prepend_msg, w32_message_fd): Declare globally.
719
720 * w32xfns.c:
721 (keyboard_handle): Use only when WINDOWSNT.
722 (notify_msg_ready): New function. Posts a message to the main
723 thread's message queue under CYGWIN, which wakes up the main
724 thread from select(2) by making the /dev/windows file descriptor
725 ready. Under WINDOWSNT, it sets an event the same way the old
726 code did.
727
728 (post, prepend_msg): Actually call notify_msg_ready instead of
729 setting the input event directly.
730
731 2012-10-07 Eli Zaretskii <eliz@gnu.org>
732
733 * ralloc.c (relinquish): If a heap is ready to be relinquished,
734 but it still has blocs in it, don't return it to the system,
735 instead of aborting. (Bug#12402)
736
737 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
738
739 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
740
741 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
742 MAC_OS_X_VERSION_10_6.
743 (syms_of_nsterm): Remove comment about Panther and above for
744 ns-antialias-text.
745 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
746 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
747 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
748
749 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
750 MAC_OS_X_VERSION_10_4.
751
752 * nsmenu.m (fillWithWidgetValue:): Remove code for <
753 MAC_OS_X_VERSION_10_2.
754
755 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
756
757 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
758 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
759
760 * nsterm.m (ns_in_resize): Remove (Bug#12479).
761 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
762 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
763 Remove ns_in_resize check.
764 (ns_clear_frame_area): Remove resize handle code.
765
766 * nsfns.m (ns_in_resize): Remove.
767 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
768 Remove ns_in_resize check.
769
770 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
771
772 Improve sys_siglist detection.
773 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
774 defined as a macro, as is done in Solaris.
775 (sys_siglist_entries): New macro.
776 (save_strsignal): Use it.
777 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
778 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
779
780 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
781
782 * nsfns.m (Fx_create_frame): Call x_default_parameter with
783 fullscreen/Fullscreen.
784
785 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
786 tobar_height is new.
787
788 * nsterm.m (x_make_frame_visible): Check for fullscreen.
789 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
790 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
791 (windowDidResize:): Check for correct window if old style fullscreen.
792 Capitalize word in comment. Remove incorrect comment.
793 (initFrameFromEmacs:): tbar_height renamed tibar_height.
794 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
795 error in drawing background.
796 (toggleFullScreen:): Remove comment. Rearrange calls.
797 Set toolbar values to zero, save old height in tobar_height.
798 Restore tool bar height when leaving fullscreen.
799 (canBecomeMainWindow): New function.
800
801 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
802
803 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
804
805 2012-10-05 Eli Zaretskii <eliz@gnu.org>
806
807 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
808
809 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
810 that time stamps of directories could also be changed.
811 Don't request the too broad GENERIC_WRITE, only the more restrictive
812 FILE_WRITE_ATTRIBUTES access rights.
813
814 * fileio.c (Fset_file_times): Special-case ignoring errors for
815 directories only on MSDOS, not on MS-Windows.
816
817 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
818
819 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
820
821 2012-10-04 Eli Zaretskii <eliz@gnu.org>
822
823 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
824 see whether CreateFile failed.
825
826 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
827
828 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
829 to avoid similar races.
830 * keyboard.c (pending_signals): Now bool, not int.
831
832 Port timers to OpenBSD, plus check for timer failures.
833 OpenBSD problem reported by Han Boetes.
834 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
835 and/or setitimer.
836 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
837 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
838 like OpenBSD, which has timer_settime but does not declare it.
839 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
840 whether to use itimerspec-related primitives. All uses of
841 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
842
843 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
844
845 * profiler.c (handle_profiler_signal): Fix a malloc race
846 that caused Emacs to hang on Fedora 17 when profiling Lisp.
847
848 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
849
850 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
851
852 2012-10-02 Eli Zaretskii <eliz@gnu.org>
853
854 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
855 consistent with the change in return value of 'safe_strsignal'.
856
857 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
858
859 Prefer plain 'static' to 'static inline' (Bug#12541).
860 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
861 (bidi_set_sor_type, bidi_push_embedding_level)
862 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
863 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
864 (bidi_cache_search, bidi_cache_ensure_space)
865 (bidi_cache_iterator_state, bidi_cache_find)
866 (bidi_peek_at_next_level, bidi_set_paragraph_end)
867 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
868 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
869 Now 'static', not 'static inline'.
870
871 Count overruns when profiling; change units to ns.
872 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
873 Give extra weight to samples after overruns, to attempt to count
874 the time more accurately.
875 (setup_cpu_timer): Change sampling interval units from ms to ns, since
876 the underlying primitives nominally do ns.
877 (Fprofiler_cpu_start): Document the change. Mention that
878 the sampling intervals are only approximate.
879
880 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
881
882 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
883
884 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
885 case for the special 0 coding-system.
886
887 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
888 (Fmake_overlay): Remove redundant tests.
889 (fix_start_end_in_overlays): Remove redundant recentering.
890
891 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
892
893 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
894 Update dependencies.
895
896 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
897
898 Fix a malloc race condition involving strsignal.
899 A signal can arrive in the middle of a malloc, and Emacs's signal
900 handler can invoke strsignal, which can invoke malloc, which is
901 not portable. This race condition bug makes Emacs hang on GNU/Linux.
902 Fix it by altering the signal handler so that it does not invoke
903 strsignal.
904 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
905 * process.c (status_message): Use const pointer, in case strsignal
906 is #defined to safe_strsignal.
907 * sysdep.c (sys_siglist, init_signals): Always define and
908 initialize a substitute sys_siglist if the system does not define
909 one, even if HAVE_STRSIGNAL.
910 (safe_strsignal): Rename from strsignal. Always define,
911 using sys_siglist. Return a const pointer.
912 * syssignal.h (safe_strsignal): New decl.
913 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
914
915 2012-10-01 Eli Zaretskii <eliz@gnu.org>
916
917 * w32proc.c (timer_loop): Fix code that waits for timer
918 expiration, to avoid high CPU usage.
919
920 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
921
922 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
923 (sweep_weak_table): Remove redundant prototypes.
924
925 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
926
927 * emacs.c: Move the inclusion of TERM_HEADER after including
928 windows.h on WINDOWSNT. This avoids compilation problems with
929 MSVC.
930
931 2012-10-01 Eli Zaretskii <eliz@gnu.org>
932
933 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
934 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
935 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
936 as the previous version used 'void *'.
937
938 * ralloc.c (ROUNDUP): Fix last change.
939 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
940 'size_t'.
941
942 * w32proc.c <disable_itimers>: New static flag.
943 (init_timers): Initialize it to zero, after creating the critical
944 sections used by the timer threads.
945 (term_timers): Set to 1 before deleting the critical sections.
946 (getitimer, setitimer): If disable_itimers is non-zero, return an
947 error indication without doing anything. Reported by Fabrice
948 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
949 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
950 return results.
951 [!HAVE_SETITIMER]: Behave as the previous version that didn't
952 support timers.
953
954 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
955 term_ntproc after all the other bookkeeping, to get timers working
956 as long as possible.
957
958 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
959
960 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
961 Suggested by Juri Linkov in
962 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
963
964 Prefer plain 'static' to 'static inline' (Bug#12541).
965 With static functions, modern compilers inline pretty well by
966 themselves; advice from programmers often hurts as much as it helps.
967 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
968 this change shrinks the text size of the Emacs executable by 1.1%
969 without affecting CPU significantly in my benchmark.
970 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
971 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
972 (mark_maybe_object, mark_maybe_pointer, bounded_number):
973 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
974 (bset_auto_fill_function, bset_auto_save_file_format)
975 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
976 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
977 (bset_cache_long_line_scans, bset_case_fold_search)
978 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
979 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
980 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
981 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
982 (bset_header_line_format, bset_indicate_buffer_boundaries)
983 (bset_indicate_empty_lines, bset_invisibility_spec)
984 (bset_left_fringe_width, bset_major_mode, bset_mark)
985 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
986 (bset_name, bset_overwrite_mode, bset_pt_marker)
987 (bset_right_fringe_width, bset_save_length)
988 (bset_scroll_bar_width, bset_scroll_down_aggressively)
989 (bset_scroll_up_aggressively, bset_selective_display)
990 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
991 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
992 (set_buffer_overlays_after):
993 * category.c (bset_category_table):
994 * charset.c (read_hex):
995 * coding.c (produce_composition, produce_charset)
996 (handle_composition_annotation, handle_charset_annotation)
997 (char_encodable_p):
998 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
999 (assign_row, set_frame_matrix_frame, make_current)
1000 (add_row_entry):
1001 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1002 * fns.c (maybe_resize_hash_table):
1003 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1004 * gmalloc.c (register_heapinfo):
1005 * image.c (lookup_image_type):
1006 * intervals.c (set_interval_object, set_interval_left)
1007 (set_interval_right, copy_interval_parent, rotate_right)
1008 (rotate_left, balance_possible_root_interval):
1009 * keyboard.c (kset_echo_string, kset_kbd_queue)
1010 (kset_keyboard_translate_table, kset_last_prefix_arg)
1011 (kset_last_repeatable_command, kset_local_function_key_map)
1012 (kset_overriding_terminal_local_map, kset_real_last_command)
1013 (kset_system_key_syms, clear_event, set_prop):
1014 * lread.c (digit_to_number):
1015 * marker.c (attach_marker, live_buffer, set_marker_internal):
1016 * nsterm.m (ns_compute_glyph_string_overhangs):
1017 * process.c (pset_buffer, pset_command)
1018 (pset_decode_coding_system, pset_decoding_buf)
1019 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1020 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1021 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1022 * syntax.c (bset_syntax_table, dec_bytepos):
1023 * terminal.c (tset_param_alist):
1024 * textprop.c (interval_has_some_properties)
1025 (interval_has_some_properties_list):
1026 * window.c (wset_combination_limit, wset_dedicated)
1027 (wset_display_table, wset_hchild, wset_left_fringe_width)
1028 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1029 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1030 (wset_right_fringe_width, wset_right_margin_cols)
1031 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1032 (wset_vertical_scroll_bar_type, wset_window_parameters):
1033 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1034 (wset_column_number_displayed, wset_region_showing)
1035 (window_box_edges, run_window_scroll_functions)
1036 (append_glyph_string_lists, prepend_glyph_string_lists)
1037 (append_glyph_string, set_glyph_string_background_width)
1038 (append_glyph, append_composite_glyph)
1039 (take_vertical_position_into_account):
1040 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1041 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1042 (lface_hash, lface_same_font_attributes_p, lookup_face):
1043 * xml.c (libxml2_loaded_p):
1044 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1045 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1046 Now 'static', not 'static inline'.
1047
1048 * bidi.c: Tune.
1049 (bidi_copy_it): Do the whole copy with a single memcpy.
1050 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1051
1052 Revert the FOLLOW-SYMLINKS change for file-attributes.
1053 Doing it right would require several changes to Tramp, and there's
1054 not enough time to get that tested before the freeze today.
1055 * dired.c (directory_files_internal, Ffile_attributes):
1056 Undo last change.
1057
1058 * frame.c (x_report_frame_params): Port better to wider ints.
1059 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1060 or that pointers can be printed in 15 decimal digits.
1061 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1062
1063 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1064
1065 Support x64 build on MS-Windows.
1066 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1067 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1068 compatibility with x64.
1069 (x_get_focus_frame): Add prototype.
1070
1071 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1072 defining an XRectangle structure.
1073
1074 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1075 arithmetics for compatibility with x64.
1076
1077 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1078 compatibility with x64.
1079
1080 * w32heap.h: Adjust prototypes and declarations.
1081
1082 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1083 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1084 DWORD, long, and unsigned long, for compatibility with x64.
1085 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1086 (sbrk): Argument is now of type ptrdiff_t.
1087
1088 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1089 less than 0x0500.
1090 (w32_msg_pump): Use WPARAM type for 'result'.
1091
1092 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1093 architecture.
1094 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1095 compatibility with x64.
1096
1097 * vm-limit.c (lim_data): Now size_t.
1098 (check_memory_limits): Adjust prototypes of real_morecore and
1099 __morecore to receive argument of type ptrdiff_t. Use size_t for
1100 five_percent and data_size.
1101
1102 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1103 variables, for compatibility with x64.
1104 (rva_to_section, offset_to_section, relocate_offset)
1105 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1106 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1107 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1108 for compatibility with x64.
1109
1110 * sysdep.c (STDERR_FILENO): Define if not already defined.
1111
1112 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1113 (__morecore): Argument type is now ptrdiff_t.
1114 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1115 (relinquish): Use ptrdiff_t type for 'excess'.
1116 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1117
1118 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1119 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1120 instead of a literal number.
1121
1122 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1123 (min): Define only if not already defined.
1124
1125 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1126 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1127 hosts.
1128
1129 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1130 'bitmaps' is a pointer.
1131
1132 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1133
1134 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1135
1136 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1137
1138 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1139 * dired.c (directory_files_internal, Ffile_attributes):
1140 New arg follow_symlinks. All uses changed.
1141
1142 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1143
1144 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1145
1146 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1147
1148 Support atimers and CPU profiler via profile.c on MS-Windows.
1149 * w32proc.c (sig_mask, crit_sig): New static variables.
1150 (sys_signal): Support SIGALRM and SIGPROF.
1151 (sigemptyset, sigaddset, sigfillset, sigprocmask)
1152 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
1153 sigfillset, and sigprocmask are no longer no-ops.
1154 (sigismember): New function.
1155 (struct itimer_data): New definition.
1156 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1157 (crit_prof): New static variables.
1158 (MAX_SINGLE_SLEEP): New definition.
1159 (timer_loop, stop_timer_thread, term_timers, init_timers)
1160 (start_timer_thread, getitimer, setitimer): New functions.
1161 (alarm): No longer a no-op, calls setitimer.
1162
1163 * w32.c (term_ntproc): Call term_timers.
1164 (init_ntproc): Make sure all signals are unblocked at startup, to
1165 erase any traces of dumping. Call init_timers.
1166
1167 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1168 Windows-specific code to display the hourglass mouse pointer is no
1169 longer used.
1170 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1171 to hourglass timer expiration.
1172 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1173 Remove, no longer used.
1174 (w32_note_current_window, show_hourglass, hide_hourglass):
1175 New functions, in support of hourglass cursor display similar to other
1176 window systems.
1177 (syms_of_w32fns): Don't initialize hourglass_timer.
1178
1179 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1180 WINDOWSNT as well.
1181 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1182
1183 * w32.h (init_timers, term_timers): Add prototypes.
1184
1185 2012-09-30 Kenichi Handa <handa@gnu.org>
1186
1187 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1188 to the buffer relocation which may be caused by ccl_driver.
1189
1190 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1191
1192 * xfns.c (Fx_file_dialog): Update comment.
1193
1194 * w32fns.c (Fx_file_dialog): Update comment.
1195
1196 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1197 Initialize panel name field if OSX >= 10.6.
1198
1199 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1200
1201 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1202
1203 * nsterm.m (NEW_STYLE_FS): New define.
1204 (ns_fullscreen_hook, windowWillEnterFullScreen)
1205 (windowDidEnterFullScreen, windowWillExitFullScreen)
1206 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1207 (setFSValue): New functions.
1208 (EmacsFSWindow): New implementation.
1209 (canBecomeKeyWindow): New function for EmacsFSWindow.
1210 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1211 (dealloc): Release nonfs_window if in fullscreen.
1212 (updateFrameSize:): Call windowDidMove to update top/left.
1213 (windowWillResize:toSize:): Check if frame is still maximized.
1214 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1215 next_maximized, maximized_width, maximized_height and nonfs_window.
1216 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1217 tbar_height.
1218 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1219 fullscreen. Set maximized_width/height. Act on next_maximized.
1220
1221 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1222 (EmacsView): Add variables for fullscreen.
1223 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1224 (EmacsFSWindow): New interface for fullscreen.
1225
1226 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
1227
1228 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1229
1230 2012-09-30 Chong Yidong <cyd@gnu.org>
1231
1232 * fns.c (Frandom): Doc fix.
1233
1234 2012-09-30 Martin Rudalics <rudalics@gmx.at>
1235
1236 * window.c (Vwindow_combination_limit): New default value.
1237 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1238
1239 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1242 Suggested by Eli Zaretskii in
1243 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1244
1245 2012-09-30 Eli Zaretskii <eliz@gnu.org>
1246
1247 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1248 HAVE_TIMER_SETTIME is defined.
1249
1250 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1251
1252 Profiler improvements: more-accurate timers, overflow checks.
1253 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1254 signal.h, setjmp.h. Include systime.h instead.
1255 (saturated_add): New function.
1256 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1257 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1258 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1259 New static vars.
1260 (enum profiler_cpu_running): New enum.
1261 (profiler_cpu_running): Now of that enum type, not bool.
1262 All uses changed to store the new value.
1263 (handle_profiler_signal): Rename from sigprof_handler_1,
1264 for consistency with other handlers. Do not check whether
1265 cpu_log is a hash-table if garbage collecting, since it
1266 doesn't matter in that case.
1267 (deliver_profiler_signal): Rename from sigprof_handler,
1268 for consistency with other handlers.
1269 (setup_cpu_timer): New function, with much of what used to be in
1270 Fprofiler_cpu_start. Check for out-of-range argument.
1271 Prefer timer_settime if available, and prefer
1272 thread cputime clocks, then process cputime clocks, then
1273 monotonic clocks, to the old realtime clock. Use make_timeval
1274 to round more-correctly when falling back to setitimer.
1275 (Fprofiler_cpu_start): Use it.
1276 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1277 Don't assume that passing NULL as the 2nd argument of setitimer
1278 is the same as passing a pointer to all-zero storage.
1279 Ignore SIGPROF afterwards.
1280 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1281 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1282 non-fatal signal handlers. Ignore SIGPROF on startup.
1283 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1284 in profiler.c, since sysdep.c now uses it.
1285
1286 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1287 Suggested by Eli Zaretskii in
1288 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1289
1290 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
1291
1292 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1293
1294 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1295
1296 * lisp.h (struct backtrace): Remove indirection for `function' field.
1297 * xdisp.c (redisplay_internal):
1298 * profiler.c (record_backtrace, sigprof_handler_1):
1299 * alloc.c (Fgarbage_collect):
1300 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1301 (Fbacktrace_frame): Adjust accordingly.
1302
1303 2012-09-28 Glenn Morris <rgm@gnu.org>
1304
1305 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1306 (Frun_hook_with_args_until_failure): Doc fixes.
1307
1308 2012-09-28 Eli Zaretskii <eliz@gnu.org>
1309
1310 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1311 Qautomatic_redisplay and change the symbol name. All users changed.
1312
1313 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1314
1315 * profiler.c (sigprof_handler): Fix race condition.
1316
1317 2012-09-28 Glenn Morris <rgm@gnu.org>
1318
1319 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1320
1321 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1322
1323 Check more robustly for timer_settime.
1324 * Makefile.in (LIB_TIMER_TIME): New macro.
1325 (LIBES): Add it.
1326 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1327 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1328 call timer_settime.
1329
1330 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1331
1332 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1333
1334 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
1335
1336 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1337
1338 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1339
1340 * character.h (MAYBE_UNIFY_CHAR): Remove.
1341 * charset.c, charset.h (maybe_unify_char): Now static.
1342 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1343 Since this stuff is now private to charset.c, there's no need for
1344 a public macro and no need to inline by hand.
1345
1346 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1347 Stefan Monnier <monnier@iro.umontreal.ca>
1348 Juanma Barranquero <lekktu@gmail.com>
1349
1350 * profiler.c: New file.
1351 * Makefile.in (base_obj): Add profiler.o.
1352 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1353 ($(BLD)/profiler.$(O)): New target.
1354 * emacs.c (main): Call syms_of_profiler.
1355 * alloc.c (Qautomatic_gc): New constant.
1356 (MALLOC_PROBE): New macro.
1357 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1358 (total_bytes_of_live_objects): New function.
1359 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1360 Call malloc_probe for the memory profiler.
1361 (syms_of_alloc): Define Qautomatic_gc.
1362 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1363 race condition.
1364 (struct backtrace): Move definition...
1365 * lisp.h (struct backtrace): ..here.
1366 (Qautomatic_gc, profiler_memory_running): Declare vars.
1367 (malloc_probe, syms_of_profiler): Declare functions.
1368 * xdisp.c (Qautomatic_redisplay): New constant.
1369 (redisplay_internal): Record itself in backtrace_list.
1370 (syms_of_xdisp): Define Qautomatic_redisplay.
1371
1372 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1373 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1374
1375 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1376
1377 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1378
1379 Prefer POSIX timers if available.
1380 They avoid a race if the timer is too close to the current time.
1381 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1382 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
1383 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
1384
1385 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1386
1387 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1388 CHAR_STRING_ADVANCE.
1389 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1390 STRING_CHAR_ADVANCE.
1391
1392 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
1393
1394 Move Vlibrary_cache to emacs.c and reset before dumping.
1395
1396 * lisp.h (reset_image_types): Declare.
1397 [WINDOWSNT] (Vlibrary_cache): Declare.
1398
1399 * image.c (reset_image_types): New function.
1400
1401 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1402 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1403 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1404
1405 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1406 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1407
1408 * w32.h (Vlibrary_cache): Do not declare.
1409
1410 2012-09-25 Eli Zaretskii <eliz@gnu.org>
1411
1412 * w32proc.c (sys_signal): Handle all signals defined by the
1413 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1414 handlers for signals supported by Windows. Don't override
1415 term_ntproc as the handler for SIGABRT.
1416 (sigaction): Rewrite to call sys_signal instead of duplicating its
1417 code.
1418 (sys_kill): Improve commentary.
1419
1420 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1421 consistency with a signature of a signal handler. All callers
1422 changed.
1423 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1424 install term_ntproc as a signal handler for SIGABRT, as that
1425 should be done by the dumped Emacs.
1426
1427 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1428
1429 * w32select.c (term_w32select): Protect against repeated
1430 invocation by setting clipboard_owner to NULL after calling
1431 DestroyWindow.
1432
1433 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1434 and term_ntproc to their modified signatures.
1435
1436 * character.c (char_string, string_char): Remove calls to
1437 MAYBE_UNIFY_CHAR. See the discussion starting at
1438 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1439 for the details.
1440
1441 2012-09-25 Chong Yidong <cyd@gnu.org>
1442
1443 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1444
1445 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1446
1447 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1448 when encountering an unknown bytecode.
1449
1450 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1451
1452 image.c, indent.c: Use bool for booleans.
1453 * dispextern.h (struct image_type): Members valid_p, load, init
1454 now return bool, not int. All uses changed.
1455 * image.c: Omit unnecessary static decls.
1456 (x_create_bitmap_mask, x_build_heuristic_mask):
1457 Return void, not int, since callers don't care about the return value.
1458 (x_create_bitmap_mask, define_image_type, valid_image_p)
1459 (struct image_keyword, parse_image_spec, image_spec_value)
1460 (check_image_size, image_background)
1461 (image_background_transparent, x_clear_image_1)
1462 (postprocess_image, lookup_image, x_check_image_size)
1463 (x_create_x_image_and_pixmap, xbm_image_p)
1464 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1465 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1466 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1467 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1468 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1469 (png_image_p, init_png_functions, png_load_body, png_load)
1470 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1471 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1472 (init_gif_functions, gif_load, imagemagick_image_p)
1473 (imagemagick_load_image, imagemagick_load, svg_image_p)
1474 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1475 (gs_load):
1476 * nsimage.m (ns_load_image):
1477 * nsterm.m (ns_defined_color):
1478 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1479 * xfns.c (x_defined_color):
1480 * xterm.c (x_alloc_lighter_color_for_widget)
1481 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1482 (x_alloc_lighter_color):
1483 * indent.c (disptab_matches_widthtab, current_column)
1484 (scan_for_column, string_display_width, indented_beyond_p)
1485 (compute_motion, vmotion, Fvertical_motion):
1486 Use bool for booleans.
1487
1488 2012-09-24 Chong Yidong <cyd@gnu.org>
1489
1490 * chartab.c (Fset_char_table_default): Obsolete function removed.
1491
1492 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1493
1494 Move pid_t related decls out of lisp.h.
1495 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1496 (interruptible_wait_for_termination):
1497 Move these decls from lisp.h to syswait.h, since they use pid_t.
1498 Needed on FreeBSD; see Herbert J. Skuhra in
1499 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1500 * callproc.c: Include syswait.h.
1501
1502 gnutls.c, gtkutil.c: Use bool for boolean.
1503 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1504 (emacs_gnutls_handle_error):
1505 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1506 (xg_hide_tooltip, xg_create_frame_widgets)
1507 (create_dialog, xg_uses_old_file_dialog)
1508 (xg_get_file_with_chooser, xg_get_file_with_selection)
1509 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1510 (xg_item_label_same_p, xg_update_menubar)
1511 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1512 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1513 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1514 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1515 (update_frame_tool_bar, free_frame_tool_bar):
1516 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1517 * nsmenu.m (ns_update_menubar):
1518 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1519 * xfns.c (Fx_show_tip) [USE_GTK]:
1520 Use bool for boolean.
1521 * gtkutil.c (xg_update_frame_menubar):
1522 * xmenu.c (update_frame_menubar):
1523 Return void, not int, since caller ignores return value.
1524 * gtkutil.c (xg_change_toolbar_position):
1525 Return void, not 1.
1526
1527 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1528
1529 * makefile.w32-in (BLOCKINPUT_H): Remove.
1530 (SYSSIGNAL_H): New macro.
1531 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1532 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1533 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1534 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1535 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1536 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1537 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1538 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1539 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1540 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1541 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1542 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1543 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1544 ($(BLD)/w32xfns.$(O)): Update dependencies.
1545
1546 2012-09-23 Eli Zaretskii <eliz@gnu.org>
1547
1548 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1549 fatal_error_backtrace.
1550
1551 * w32proc.c (sys_kill): Undo last change: don't do anything when
1552 invoked to deliver SIGABRT to our own process. This is now
1553 handled by emacs_raise.
1554
1555 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
1556
1557 * w32term.c (w32_read_socket): Remove leftover reference to
1558 interrupt_input_pending.
1559
1560 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1561
1562 Do not use SA_NODEFER.
1563 Problem reported by Dani Moncayo in
1564 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
1565 * alloc.c (die):
1566 * sysdep.c (emacs_abort): Do not reset signal handler.
1567 * emacs.c (terminate_due_to_signal): Reset signal handler here.
1568 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
1569 wanted even on POSIXish hosts, and it doesn't work on Windows.
1570
1571 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1572
1573 * xterm.c (x_term_init): Call fixup_locale before and after calling
1574 gtk_init (Bug#12392).
1575
1576 2012-09-23 Chong Yidong <cyd@gnu.org>
1577
1578 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
1579 Vdynamic_library_alist.
1580
1581 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
1582 (Fgnutls_available_p): Caller changed.
1583
1584 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
1585 (Flibxml_parse_xml_region): Likewise.
1586
1587 * dispextern.h (struct image_type): Remove arg from init function.
1588
1589 * image.c (Finit_image_library, lookup_image_type)
1590 (define_image_type): Remove now-unneeded second arg.
1591 (init_xpm_functions, init_png_functions, init_jpeg_functions)
1592 (init_tiff_functions, init_gif_functions, init_svg_functions):
1593 Arglist and w32_delayed_load calling convention changed.
1594 (gs_type): Remove init_gs_functions; there is no such function.
1595 (valid_image_p, make_image): Fix caller to lookup_image_type.
1596
1597 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1598
1599 Simplify and avoid signal-handling races (Bug#12471).
1600 * alloc.c (die):
1601 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
1602 Avoid recursive loop if there's a fatal error in the function itself.
1603 * atimer.c (pending_atimers):
1604 * blockinput.h: Don't include "atimer.h"; no longer needed.
1605 (interrupt_input_pending): Remove. All uses removed.
1606 pending_signals now counts both atimers and ordinary interrupts.
1607 This is less racy than having three separate pending-signal flags.
1608 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
1609 (input_blocked_p):
1610 Rename from their upper-case counterparts BLOCK_INPUT,
1611 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
1612 INPUT_BLOCKED_P, and turn into functions. All uses changed.
1613 This makes it easier to access volatile variables more accurately.
1614 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
1615 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
1616 that's more reliable if the code is buggy and sets
1617 interrupt_input_blocked to a negative value. All uses changed.
1618 * atimer.c (deliver_alarm_signal):
1619 Remove. No need to deliver this to the parent; any thread can
1620 handle this signal now. All uses replaced by underlying handler.
1621 * atimer.c (turn_on_atimers):
1622 * dispnew.c (handle_window_change_signal):
1623 * emacs.c (handle_danger_signal):
1624 * keyboard.c (kbd_buffer_get_event):
1625 Don't reestablish signal handler; not needed with sigaction.
1626 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
1627 (UNBLOCK_INPUT_TO):
1628 Rework to avoid unnecessary accesses to volatile variables.
1629 (UNBLOCK_INPUT_TO): Now a function.
1630 (totally_unblock_input, unblock_input): New decls.
1631 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
1632 (init_data): Remove. Necessary stuff now done in init_signal.
1633 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
1634 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
1635 (fatal_error_code): Remove; no longer needed.
1636 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
1637 it doesn't always backtrace. All uses changed. No need to reset
1638 signal to default, since sigaction and/or die does that for us now.
1639 Use emacs_raise (FOO), not kill (getpid (), FOO).
1640 (main): Check more-accurately whether we're dumping.
1641 Move fatal-error setup to sysdep.c
1642 * floatfns.c: Do not include "syssignal.h"; no longer needed.
1643 * gtkutil.c (xg_get_file_name, xg_get_font):
1644 Remove no-longer-needed signal-mask manipulation.
1645 * keyboard.c, process.c (POLL_FOR_INPUT):
1646 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
1647 * keyboard.c (read_avail_input): Remove.
1648 All uses replaced by gobble_input.
1649 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
1650 (kbd_buffer_store_event_hold, gobble_input):
1651 (record_asynch_buffer_change) [USABLE_SIGIO]:
1652 (store_user_signal_events):
1653 No need to mess with signal mask.
1654 (gobble_input): If blocking input and there are terminals, simply
1655 set pending_signals to 1 and return. All hooks changed to not
1656 worry about whether input is blocked.
1657 (process_pending_signals): Clear pending_signals before processing
1658 them, in case a signal comes in while we're processing.
1659 By convention callers now test pending_signals before calling us.
1660 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
1661 New functions, to support changes to blockinput.h.
1662 (handle_input_available_signal): Now extern.
1663 (reinvoke_input_signal): Remove. All uses replaced by
1664 handle_async_input.
1665 (quit_count): Now volatile, since a signal handler uses it.
1666 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
1667 All callers changed. Block SIGINT only if not already blocked.
1668 Clear sigmask reliably, even if Fsignal returns, which it can.
1669 Omit unnecessary accesses to volatile var.
1670 (quit_throw_to_read_char): No need to restore sigmask.
1671 * keyboard.c (gobble_input, handle_user_signal):
1672 * process.c (wait_reading_process_output):
1673 Call signal-handling code rather than killing ourselves.
1674 * lisp.h: Include <float.h>, for...
1675 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
1676 (pending_signals): Now volatile.
1677 (syms_of_data): Now const if IEEE floating point.
1678 (handle_input_available_signal) [USABLE_SIGIO]:
1679 (terminate_due_to_signal, record_child_status_change): New decls.
1680 * process.c (create_process): Avoid disaster if memory is exhausted
1681 while we're processing a vfork, by tightening the critical section
1682 around the vfork.
1683 (send_process_frame, process_sent_to, handle_pipe_signal)
1684 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
1685 ignores SIGPIPE.
1686 (send_process): No need for setjmp/longjmp any more, since the
1687 SIGPIPE stuff is now gone. Instead, report an error if errno
1688 is EPIPE.
1689 (record_child_status_change): Now extern. PID and W are now args.
1690 Return void, not bool. All callers changed.
1691 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
1692 Remove. All uses removed. This bug should be fixed now in a
1693 different way.
1694 (wait_for_termination_1): Use waitpid rather than sigsuspend,
1695 and record the child status change directly. This avoids the
1696 need to futz with the signal mask.
1697 (process_fatal_action): Move here from emacs.c.
1698 (emacs_sigaction_flags): New function, containing
1699 much of what used to be in emacs_sigaction_init.
1700 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
1701 caught by emacs, to make races less likely.
1702 (deliver_process_signal): Rename from handle_on_main_thread.
1703 All uses changed.
1704 (BACKTRACE_LIMIT_MAX): Now at top level.
1705 (thread_backtrace_buffer, threadback_backtrace_pointers):
1706 New static vars.
1707 (deliver_thread_signal, deliver_fatal_thread_signal):
1708 New functions, for more-accurate delivery of thread-specific signals.
1709 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
1710 (deliver_arith_signal): Handle in this thread, not
1711 in the main thread, since it's triggered by this thread.
1712 (maybe_fatal_sig): New function.
1713 (init_signals): New arg DUMPING so that we can be more accurate
1714 about whether we're dumping. Caller changed.
1715 Treat thread-specific signals differently from process-general signals.
1716 Block all signals while handling fatal error; that's safer.
1717 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
1718 on IEEE hosts.
1719 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
1720 Ignore SIGPIPE unless batch.
1721 (emacs_backtrace): Output backtrace for the appropriate thread,
1722 which is not necessarily the main thread.
1723 * syssignal.h: Include <stdbool.h>.
1724 (emacs_raise): New macro.
1725 * xterm.c (x_connection_signal): Remove; no longer needed
1726 now that we use sigaction.
1727 (x_connection_closed): No need to mess with sigmask now.
1728 (x_initialize): No need to reset SIGPIPE handler here, since
1729 init_signals does this for us now.
1730
1731 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
1732
1733 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
1734 background rect may be larger (Bug#12245).
1735
1736 2012-09-23 Chong Yidong <cyd@gnu.org>
1737
1738 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
1739
1740 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 * .gdbinit: Just stop at fatal_error_backtrace.
1743 See Stefan Monnier's request in
1744 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
1745 Remove no-longer-used query of system type.
1746
1747 2012-09-22 Chong Yidong <cyd@gnu.org>
1748
1749 * search.c (Freplace_match): Doc fix (Bug#12325).
1750
1751 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
1752
1753 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
1754 (Fline_end_position): Doc fix.
1755
1756 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
1757
1758 2012-09-22 Chong Yidong <cyd@gnu.org>
1759
1760 * dispextern.h (struct image_type): Add new slot, storing a type
1761 initialization function.
1762
1763 * image.c (define_image_type): Call the image initializer function
1764 if it is defined. Arguments and return value changed.
1765 (valid_image_p, make_image): Callers changed.
1766 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
1767 (gif_type, imagemagick_type, svg_type, gs_type):
1768 Add initialization functions.
1769 (Finit_image_library): Call lookup_image_type.
1770 (CHECK_LIB_AVAILABLE): Macro deleted.
1771 (lookup_image_type): Call define_image_type here, rather than via
1772 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
1773 (syms_of_image): Move define_image_type calls for xbm_type and
1774 pbm_type to lookup_image_type.
1775
1776 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1777
1778 * keyboard.c (timer_check_2): Move calculation of 'timers' and
1779 'idle_timers' from here ...
1780 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
1781 lists, to avoid infloops when the timer does something stupid,
1782 like reinvoke itself with the same or smaller time-out.
1783 (Bug#12447)
1784
1785 2012-09-22 Martin Rudalics <rudalics@gmx.at>
1786
1787 * window.c (Fsplit_window_internal): Handle only Qt value of
1788 Vwindow_combination_limit separately.
1789 (Qtemp_buffer_resize): New symbol.
1790 (Vwindow_combination_limit): New default value.
1791 Rewrite doc-string.
1792
1793 2012-09-22 Eli Zaretskii <eliz@gnu.org>
1794
1795 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
1796 the new overlay string. (Bug#10159)
1797
1798 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
1799
1800 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
1801 or that fprintf is async-signal-safe. POSIX doesn't require
1802 either assumption.
1803
1804 2012-09-22 Chong Yidong <cyd@gnu.org>
1805
1806 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
1807 (Bug#8207).
1808
1809 2012-09-22 Kenichi Handa <handa@gnu.org>
1810
1811 * composite.c (composition_reseat_it): Handle the case that a
1812 grapheme cluster is not covered by a single font (Bug#12352).
1813
1814 2012-09-21 Chong Yidong <cyd@gnu.org>
1815
1816 * image.c (define_image_type): Avoid adding duplicate types to
1817 image_types (Bug#12463). Suggested by Jörg Walter.
1818
1819 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1820
1821 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
1822 (print_load_command_name): Add case LC_DATA_IN_CODE.
1823 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
1824
1825 2012-09-21 Glenn Morris <rgm@gnu.org>
1826
1827 * eval.c (Frun_hook_with_args_until_success)
1828 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
1829
1830 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
1831
1832 * fileio.c (Ffile_selinux_context): Only call freecon when
1833 lgetfilecon succeeded.
1834 (Fset_file_selinux_context): Likewise. (Bug#12444)
1835
1836 2012-09-21 Eli Zaretskii <eliz@gnu.org>
1837
1838 * xdisp.c (try_window_reusing_current_matrix): Under bidi
1839 reordering, locate the cursor by calling set_cursor_from_row; if
1840 that fails, clear the desired glyph matrix before returning a
1841 failure indication to the caller. Fixes leaving garbled display
1842 when fast scrolling with a down-key. (Bug#12403)
1843 (compute_stop_pos_backwards): Fix a typo that caused crashes while
1844 scrolling through multibyte text.
1845
1846 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
1847
1848 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
1849 calling mark_vectorlike since that's the one that marks the window.
1850 (mark_discard_killed_buffers): Mark the final cdr.
1851 * window.h (struct window): Move prev/next_buffers to the
1852 non-standard fields.
1853 * window.c (make_window): Initialize prev/next_buffers manually.
1854
1855 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 Omit unused arg EXPECTED from socket hooks.
1858 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
1859 * nsterm.m (ns_term_init):
1860 * termhooks.h (struct terminal.read_socket_hook):
1861 * w32inevt.c (w32_console_read_socket):
1862 * w32term.c (w32_read_socket):
1863 * xterm.c (XTread_socket):
1864 Omit unused arg EXPECTED. All callers changed.
1865 (store_user_signal_events): Return void, not int, since callers no
1866 longer care about the return value. All uses changed.
1867
1868 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
1869
1870 * w32gui.h (XParseGeometry): Do not declare.
1871
1872 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
1873
1874 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1875 Ignore 'expected'. See Eli Zaretskii in
1876 <http://bugs.gnu.org/12471#8> (last line).
1877
1878 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
1879 (XParseGeometry): Now static. Substitute extremal values for
1880 values that are out of range.
1881
1882 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
1883
1884 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
1885
1886 * nsfns.m (XParseGeometry): Remove.
1887 (Fx_create_frame): Call x_set_offset to correctly interpret
1888 top_pos in geometry.
1889
1890 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
1891 (Fx_parse_geometry): If there is a space in string, call
1892 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
1893
1894 2012-09-17 Eli Zaretskii <eliz@gnu.org>
1895
1896 * search.c (scan_buffer): Use character positions in calls to
1897 region_cache_forward and region_cache_backward, not byte
1898 positions. (Bug#12196)
1899
1900 * w32term.c (w32_read_socket): Set pending_signals to 1, like
1901 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
1902
1903 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
1904 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
1905 emacs_blocked_malloc, now deleted.
1906
1907 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
1908
1909 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
1910 The workaround was for improving performance on Solaris 2.4, but
1911 is getting in the way now. Emacs will still work if someone is
1912 still running Solaris 2.4 in a museum somewhere; Sun dropped
1913 support for Solaris 2.4 in 2003.
1914 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
1915 * process.c (create_process) [HAVE_WORKING_VFORK]:
1916 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
1917 since Emacs no longer uses vfork on that platform.
1918
1919 2012-09-17 Glenn Morris <rgm@gnu.org>
1920
1921 * emacs.c: Use COPYRIGHT.
1922
1923 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
1924
1925 Remove configure's --without-sync-input option (Bug#12450).
1926 When auditing signal-handling in preparation for cleaning it up,
1927 I found that SYNC_INPUT has race conditions and would be a real
1928 pain to fix. Since it's an undocumented and deprecated
1929 configure-time option, now seems like a good time to remove it.
1930 Also see <http://bugs.gnu.org/11080#16>.
1931 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
1932 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
1933 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
1934 (malloc_hysteresis):
1935 (check_depth) [XMALLOC_OVERRUN_CHECK]:
1936 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
1937 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
1938 (dont_register_blocks, bytes_used_when_reconsidered)
1939 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
1940 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
1941 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1942 Remove. All uses removed.
1943 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
1944 implementation, one that depends on whether the new macro
1945 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
1946 is defined.
1947 * atimer.c (run_timers, handle_alarm_signal):
1948 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
1949 (handle_async_input, process_pending_signals)
1950 (handle_input_available_signal, init_keyboard):
1951 * nsterm.m (ns_read_socket):
1952 * process.c (wait_reading_process_output):
1953 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
1954 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
1955 (emacs_write):
1956 * xterm.c (XTread_socket):
1957 Assume SYNC_INPUT.
1958 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
1959 * eval.c (handling_signal): Remove. All uses removed.
1960 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
1961 All uses replaced with the SYNC_INPUT version.
1962 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
1963 Remove decls.
1964 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
1965 Now static.
1966
1967 * font.c (Ffont_shape_gstring): Remove unused local.
1968
1969 2012-09-16 Glenn Morris <rgm@gnu.org>
1970
1971 * Makefile.in (clean): No longer run nextstep's clean.
1972
1973 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
1974 (ns_frag): Remove.
1975 (ns-app): Move here from ns.mk, and simplify.
1976 (clean): Simplify nextstep entry.
1977 * ns.mk: Remove file.
1978
1979 2012-09-17 Kenichi Handa <handa@gnu.org>
1980
1981 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
1982 not covert the last few charactes.
1983
1984 2012-09-16 Kenichi Handa <handa@gnu.org>
1985
1986 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
1987 here, but just check the validity of glyphs in the glyph-string.
1988
1989 2012-09-16 Martin Rudalics <rudalics@gmx.at>
1990
1991 * window.c (Fwindow_parameter, Fset_window_parameter):
1992 Accept any window as argument (Bug#12452).
1993
1994 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
1995
1996 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
1997 to ns_term_init to avoid memory leak.
1998
1999 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2000 explicit retain/release.
2001 (ns_term_init): Only allow one display. Initialize outerpool and
2002 ns_*_types.
2003
2004 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2005
2006 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2007 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2008 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2009 the Microsoft problem in a different way, by altering ../nt/config.nt.
2010
2011 2012-09-15 Eli Zaretskii <eliz@gnu.org>
2012
2013 * w32xfns.c:
2014 * w32uniscribe.c:
2015 * w32term.c:
2016 * w32select.c:
2017 * w32reg.c:
2018 * w32proc.c:
2019 * w32menu.c:
2020 * w32inevt.c:
2021 * w32heap.c:
2022 * w32font.c:
2023 * w32fns.c:
2024 * w32console.c:
2025 * w32.c:
2026 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2027 by lisp.h. This completes removal of setjmp.h inclusion
2028 erroneously announced in the previous commit. (Bug#12446)
2029
2030 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2031 more accurate.
2032
2033 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2034 not defined as a macro. The latter happens on MS-Windows.
2035 (Bug#12446)
2036
2037 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2038
2039 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2040 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
2041 Some instances of '#include <setjmp.h>' removed, if the
2042 only reason for the instance was because "lisp.h" was included.
2043 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2044 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2045 and _longjmp with the new symbols. Emacs already uses _setjmp if
2046 available, so this change affects only POSIXish hosts that have
2047 sigsetjmp but not _setjmp, such as some versions of Solaris and
2048 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2049 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2050 (png_load_body) [HAVE_PNG]:
2051 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2052 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2053 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2054 since PNG requires jmp_buf. This is the only exception to the
2055 general rule that we now use sys_setjmp and sys_longjmp.
2056 This exception is OK since this code does not change the signal
2057 mask or longjmp out of a signal handler.
2058
2059 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2060
2061 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2062 Include "syssignal.h", for 'main_thread'.
2063
2064 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2065
2066 Avoid out-of-range marker position (Bug#12426).
2067 * insdel.c (replace_range, replace_range_2):
2068 Adjust markers before overlays, as suggested by comments.
2069 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2070 Remove redundant check before calling offset_intervals.
2071
2072 2012-09-14 Martin Rudalics <rudalics@gmx.at>
2073
2074 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2075 current buffer (Bug#12387).
2076
2077 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
2078
2079 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2080
2081 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2082
2083 Use a more backwards-compatible timer format (Bug#12430).
2084 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2085 vector element, not from the 4th, since PSECS is now at the end.
2086 (Fcurrent_idle_time): Doc fix.
2087
2088 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2089
2090 Function to mark objects and remove killed buffers at once.
2091 * alloc.c (discard_killed_buffers): Rename to ...
2092 (mark_discard_killed buffers) ... new name. Add marking
2093 of remaining objects. Fix comment. Adjust users.
2094 (mark_object): Do not touch frame buffer lists here.
2095 * frame.c (delete_frame): Reset frame buffer lists here.
2096
2097 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2098
2099 Better workaround for GNOME bug when --enable-gcc-warnings.
2100 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2101 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2102 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2103
2104 Simplify SIGIO usage (Bug#12408).
2105 The code that dealt with SIGIO was crufty and confusing, e.g., it
2106 played tricks like "#undef SIGIO" but these tricks were not used
2107 consistently. Simplify mostly by not #undeffing standard symbols,
2108 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2109 or not as we please) rather than "defined SIGIO" (standard symbol
2110 that we probably shouldn't #undef).
2111 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2112 Modules that need it can include it.
2113 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2114 * dispextern.h (ignore_sigio): New decl.
2115 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2116 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2117 * emacs.c (shut_down_emacs):
2118 * keyboard.c (kbd_buffer_store_event_hold):
2119 Use ignore_sigio rather than invoking 'signal' directly.
2120 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2121 for FIONREAD.
2122 (FIONREAD, SIGIO): Do not #undef.
2123 (tty_read_avail_input): Use #error rather than a syntax error.
2124 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2125 for I_PIPE, used by SETUP_SLAVE_PTY.
2126 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2127 * sysdep.c (croak): Remove; no longer needed. This bit of
2128 temporary code, with Fred N. Fish's comment that it's temporary,
2129 has been in Emacs since at least 1992!
2130 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2131 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2132 * syssignal.h (croak): Remove decl.
2133 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2134 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2135 now that we're termios-only.
2136 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2137 * term.c (dissociate_if_controlling_tty): Use #error rather than
2138 a run-time error.
2139
2140 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2141 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2142 to work around GNOME bug 683906.
2143 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2144 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2145 This works around GCC bug 54561.
2146
2147 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2148
2149 More fixes for 'volatile' and setjmp/longjmp.
2150 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2151 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2152 (png_load_body) [HAVE_PNG]:
2153 (jpeg_load_body) [HAVE_JPEG]:
2154 New function, with most of the old parent function's body.
2155 (png_load) [HAVE_PNG]:
2156 (jpeg_load) [HAVE_JPEG]:
2157 Invoke the new function, to avoid longjmp munging our locals.
2158 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2159 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2160 longjmp is passed 2, as the C standard doesn't guarantee this.
2161 Instead, store the failure code into mgr->failure_code.
2162
2163 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2164
2165 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2166 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2167 (syms_of_keyboard): Remove support for unread-command-char.
2168
2169 2012-09-12 Eli Zaretskii <eliz@gnu.org>
2170
2171 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2172 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2173 violation. (Bug#12426)
2174
2175 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2178
2179 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2180
2181 * eval.c: Add `inhibit-debugger'.
2182 (Qinhibit_debugger): New symbol.
2183 (call_debugger): Bind it instead of Qdebug_on_error.
2184 (maybe_call_debugger): Test Vinhibit_debugger.
2185 (syms_of_eval): Define inhibit-debugger.
2186 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2187 (syms_of_xdisp): Remove inhibit-debug-on-message.
2188
2189 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2190
2191 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2192 If a nonvolatile local variable is written before a _longjmp to
2193 the frame containing the variable, and is read after the _longjmp,
2194 the value read is indeterminate. Some local variables of type
2195 'struct handler' and 'struct catchtag' are used in this way, so
2196 mark each of their slots as volatile if the slot can be set before
2197 _longjmp and read afterwards.
2198 * lisp.h (struct handler): var and chosen_clause are now volatile.
2199 (struct catchtag): val, next, and pdlcount are now volatile.
2200
2201 * bidi.c (bidi_push_it, bidi_pop_it):
2202 * fns.c (copy_hash_table):
2203 * image.c (define_image_type):
2204 * keyboard.c (kbd_buffer_store_event_hold):
2205 * process.c (Fprocess_send_eof):
2206 * xfaces.c (x_create_gc) [HAVE_NS]:
2207 * xgselect.c (xg_select):
2208 Prefer assignment to memcpy when either will do.
2209
2210 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2211 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2212 time an item is removed. No need to mark this function 'inline';
2213 the compiler knows better than we do.
2214
2215 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2216
2217 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2218 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2219 to change_frame_size (Bug#12388).
2220 (windowDidResize:): Pass YES to updateFrameSize.
2221
2222 * nsterm.h: Add delay parameter to updateFrameSize.
2223
2224 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2225
2226 Discard killed buffers from deleted window and frame objects.
2227 This reduces an amount of references to killed buffers and
2228 helps GC to reclaim them faster.
2229 * alloc.c (discard_killed_buffers): New function.
2230 (mark_object): Use it for deleted windows and frames.
2231 (mark_object): If symbol's value is set up for a killed buffer
2232 or deleted frame, restore its global binding.
2233 * data.c (swap_in_global_binding): Add GC notice.
2234 (swap_in_symval_forwarding): Use convenient set_blv_where.
2235 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2236 * window.h: ... to here.
2237
2238 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2239
2240 Convenient macro to check whether the buffer is live.
2241 * buffer.h (BUFFER_LIVE_P): New macro.
2242 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2243 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2244
2245 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2246
2247 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2248 composition cases (Bug#12364).
2249
2250 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2251 overhang of succeeding glyphs overlapping box cursor.
2252
2253 * w32term.c (x_draw_glyph_string): Likewise.
2254
2255 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2256
2257 Simplify, document, and port floating-point (Bug#12381).
2258 The porting part of this patch fixes bugs on non-IEEE platforms
2259 with frexp, ldexp, logb.
2260 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2261 Now static.
2262 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2263 support, by removing commented-out code and briefly listing the
2264 C89 functions excluded. The commented-out stuff was confusing
2265 maintenance, e.g., we thought we needed cbrt but it was commented out.
2266 (logb): Remove decl; no longer needed.
2267 (isfinite): New macro, if not already supplied.
2268 (isnan): Don't replace any existing macro.
2269 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2270 are present on all C89 platforms.
2271 (Ffrexp): Do not special-case zero, as frexp does the right thing
2272 for that case.
2273 (Flogb): Do not use logb, as it doesn't have the desired meaning
2274 on hosts that use non-base-2 floating point. Instead, stick with
2275 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2276 frexp, to avoid getting an unspecified result.
2277
2278 * xdisp.c (Qinhibit_debug_on_message): Now static.
2279
2280 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2281
2282 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2283 NSBezierPath (Bug#12131).
2284
2285 2012-09-10 Chong Yidong <cyd@gnu.org>
2286
2287 * fns.c (Fdelq, Fdelete): Doc fix.
2288
2289 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2290
2291 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2292 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2293
2294 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2295
2296 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2297 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2298 Use it.
2299
2300 2012-09-09 Eli Zaretskii <eliz@gnu.org>
2301
2302 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2303 left fringe if the window has a left margin. This avoids leaving
2304 traces of the cursor because its leftmost pixel is not drawn over.
2305
2306 * dispnew.c (update_window_line): When the left margin area of a
2307 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2308 that screen line. (Bug#12277)
2309
2310 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2311
2312 Assume C89 or later for math functions (Bug#12381).
2313 This simplifies the code, and makes it a bit smaller and faster,
2314 and (most important) makes it easier to clean up signal handling
2315 since we can stop worring about floating-point exceptions in
2316 library code. That was a problem before C89, but the problem
2317 went away many years ago on all practical Emacs targets.
2318 * data.c, image.c, lread.c, print.c:
2319 Don't include <math.h>; no longer needed.
2320 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2321 might be autoconfigured, as that never happens.
2322 * data.c (fmod):
2323 * doprnt.c (DBL_MAX_10_EXP):
2324 * print.c (DBL_DIG):
2325 Remove. C89 or later always defines these.
2326 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2327 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2328 (arith_error, domain_error, domain_error2):
2329 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2330 no longer needed -- we simply return what C returns. All uses removed.
2331 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2332 the wrapped code.
2333 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2334 Remove. All uses expanded, as these macros are no longer used
2335 more than once and are now more trouble than they're worth.
2336 (Ftan): Use tan, not sin / cos.
2337 (Flogb): Assume C89 frexp.
2338 (fmod_float): Assume C89 fmod.
2339 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2340 (init_floatfns): Remove. All uses removed.
2341
2342 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2343
2344 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2345 compositeToPoint for OSX < 10.6 (Bug#12390).
2346
2347 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2348
2349 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2350 This produces more-accurate results.
2351
2352 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2353
2354 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2355 changes (Bug#12088).
2356
2357 2012-09-08 Chong Yidong <cyd@gnu.org>
2358
2359 * syntax.c (Fstring_to_syntax): Doc fix.
2360
2361 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2362
2363 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2364 in the internal border.
2365 (x_set_window_size): Remove static variables and their usage.
2366 (ns_redraw_scroll_bars): Fix NSTRACE arg.
2367 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2368 Remove fringe/internal border adjustment (Bug#11052).
2369 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2370 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2371 (ns_fix_rect_ibw): Remove.
2372 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2373 (ns_dumpglyphs_box_or_relief): Ditto.
2374 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2375 adjustment.
2376 (ns_dumpglyphs_image): Ditto.
2377 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
2378 border adjustment.
2379 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2380 their usage. Add fringe_extended_p and its use as in other terms.
2381 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2382 scroll bar was removed.
2383 (updateFrameSize): New function.
2384 (windowDidResize): Move code to updateFrameSize and call it.
2385
2386 * nsterm.h (EmacsView): Add updateFrameSize.
2387
2388 2012-09-07 Chong Yidong <cyd@gnu.org>
2389
2390 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2391
2392 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2393
2394 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 More signal-handler cleanup (Bug#12327).
2397 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2398 Problem introduced when merging patches. Noted by Eli Zaretskii in
2399 <http://bugs.gnu.org/12327#67>.
2400 * floatfns.c: Comment fix.
2401 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2402 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2403 and anyway the declaration is harmless even if SIGDANGER is not defined.
2404 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2405 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2406 source files not surprisingly expected syssignal.h to define, or
2407 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2408 Include <sys/ioctl.h>, for FIONREAD.
2409 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2410 This eliminates a problem whereby other files mysteriously had
2411 to include "syssignal.h" before including "systty.h" if they
2412 wanted to use "#ifdef SIGIO".
2413
2414 2012-09-07 Eli Zaretskii <eliz@gnu.org>
2415
2416 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2417
2418 * w32.c (sigemptyset): Empty the set.
2419 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2420
2421 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2422
2423 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2424
2425 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2426 (mark_object): Likewise for frame objects.
2427
2428 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2429
2430 * syssignal.h (handle_on_main_thread): Always declare,
2431 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2432 This ports to platforms without HAVE_PTHREAD.
2433
2434 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2435
2436 Signal-handler cleanup (Bug#12327).
2437 Emacs's signal handlers were written in the old 4.2BSD style with
2438 sigblock and sigmask and so forth, and this led to some
2439 inefficiencies and confusion. Rewrite these to use
2440 pthread_sigmask etc. without copying signal sets around. Also,
2441 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2442 'signal', and instead use functions that do not attempt to take
2443 over the system name space. This patch causes Emacs's text
2444 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2445 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2446 Do not include <signal.h> or "syssignal.h", as these
2447 modules do not use signals.
2448 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2449 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2450 Do not include <signal.h>, as "syssignal.h" does that for us now.
2451 * atimer.c (sigmask_atimers): New function.
2452 (block_atimers, unblock_atimers): New functions,
2453 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2454 All uses replaced.
2455 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2456 no longer needed here.
2457 * emacs.c (main): Inspect existing signal handler with sigaction,
2458 so that there's no need to block and unblock SIGHUP.
2459 * sysdep.c (struct save_signal): New member 'action', replacing
2460 old member 'handler'.
2461 (save_signal_handlers, restore_signal_handlers):
2462 Use sigaction instead of 'signal' to save and restore.
2463 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2464 New function. All users of 'signal' modified to use set_sighandler
2465 if they're writeonly, and to use sys_signal if they're read+write.
2466 (emacs_sigaction_init, forwarded_signal): New functions.
2467 (sys_signal): Remove. All uses replaced by calls to sigaction
2468 and emacs_sigaction_init, or by direct calls to 'signal'.
2469 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2470 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2471 all uses replaced by pthread_sigmask etc. calls.
2472 * syssignal.h: Include <signal.h>.
2473 (emacs_sigaction_init, forwarded_signal): New decls.
2474 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2475 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2476 (sigmask, sys_sigmask): Remove; no longer needed.
2477 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2478 (sigblock, sigunblock, sigfree):
2479 (sigsetmask) [!defined sigsetmask]:
2480 Remove. All uses replaced by pthread_sigmask.
2481 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2482 no longer need to be replaced, and its typical old uses
2483 are now done via emacs_sigaction_init and sigaction.
2484 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2485 (sys_sigdel): Remove; unused.
2486 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2487
2488 2012-09-06 Eli Zaretskii <eliz@gnu.org>
2489
2490 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2491 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2492
2493 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2494
2495 Explicitly mark buffer_defaults and buffer_local_symbols.
2496 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2497 mark_local_symbols here.
2498 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2499 since special buffers aren't marked here any more.
2500 (allocate_buffer): Chain new buffer with all_buffers here...
2501 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2502 not here.
2503 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2504 (syms_of_buffer): Remove staticpro of the above.
2505 (init_buffer_once): Set names for buffer_defaults and
2506 buffer_local_symbols.
2507
2508 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2509
2510 Use bool for booleans in font-related modules.
2511 * font.c (font_intern_prop, font_style_to_value)
2512 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2513 (generate_otf_features, font_check_otf_features, font_check_otf)
2514 (font_match_p, font_list_entities, font_at):
2515 * fontset.c (fontset_id_valid_p, reorder_font_vector
2516 (fontset_find_font, Fset_fontset_font)
2517 (face_suitable_for_char_p) [0]:
2518 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2519 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2520 (m17n_flt_initialized, ftfont_shape_by_flt):
2521 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2522 * nsfont.m (nsfont_draw):
2523 * w32font.c (w32font_draw):
2524 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2525 Use bool for booleans.
2526 * font.h: Adjust to above API changes.
2527 (struct font, struct font_driver, struct font_driver_list):
2528 Use bool for booleans.
2529 (struct font): Remove useless member encoding_type.
2530 All users removed.
2531 * fontset.c, xftfont.c: Omit unnecessary static decls.
2532
2533 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2534
2535 * alloc.c (mark_object): Revert window marking code
2536 since it's unsafe for the Fset_window_configuration.
2537
2538 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2539
2540 Fix race conditions with signal handlers and errno (Bug#12327).
2541 Be more systematic about preserving errno whenever a signal
2542 handler returns, even if it's not in the main thread. Do this by
2543 renaming signal handlers to distinguish between signal delivery
2544 and signal handling. All uses changed.
2545 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2546 * data.c (deliver_arith_signal): Rename from arith_error.
2547 * dispnew.c (deliver_window_change_signal): Rename from
2548 window_change_signal.
2549 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2550 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2551 * keyboard.c (deliver_input_available_signal): Rename from
2552 input_available_signal.
2553 (deliver_user_signal): Rename from handle_user_signal.
2554 (deliver_interrupt_signal): Rename from interrupt_signal.
2555 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2556 (deliver_child_signal): Rename from sigchld_handler.
2557 * atimer.c (handle_alarm_signal):
2558 * data.c (handle_arith_signal):
2559 * dispnew.c (handle_window_change_signal):
2560 * emacs.c (handle_fatal_signal, handle_danger_signal):
2561 * keyboard.c (handle_input_available_signal):
2562 * keyboard.c (handle_user_signal, handle_interrupt_signal):
2563 * process.c (handle_pipe_signal, handle_child_signal):
2564 New functions, with the actual signal-handling code taken from the
2565 original respective signal handlers, sans the sporadic attempts to
2566 preserve errno, since that's now done by handle_on_main_thread.
2567 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
2568 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
2569 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2570 Move to sysdep.c.
2571 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2572 Move initialization of main_thread to sysdep.c's init_signals.
2573 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
2574 our usage, and simplifies the mainline code.
2575 (record_child_status_change): New static function, as a helper
2576 for handle_child_signal, and with most of the old child handler's
2577 contents.
2578 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
2579 (handle_child_signal): Use the above.
2580 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2581 Moved here from emacs.c.
2582 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
2583 code moved here from emacs.c's main function.
2584 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
2585 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
2586 This lets callers save and restore errno properly.
2587
2588 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2589
2590 Remove redundant or unused things here and there.
2591 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
2592 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
2593 * editfns.c (Fcompare_buffer_substrings): Likewise.
2594 * frame.h (struct terminal, struct font_driver_list):
2595 Remove redundant declarations.
2596 * window.h (Qleft, Qright): Likewise.
2597
2598 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2599
2600 Do not mark objects from deleted buffers, windows and frames.
2601 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
2602 (mark_object): Likewise for windows and frames.
2603
2604 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
2605
2606 * alloc.c (valid_lisp_object_p): Treat killed buffers,
2607 buffer_defaults and buffer_local_symbols as valid objects.
2608 Return special value to denote them.
2609
2610 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2611
2612 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
2613 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
2614 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
2615 (file_name_absolute_p, Fsubstitute_in_file_name):
2616 (check_executable, check_writable, Ffile_accessible_directory_p)
2617 (Fset_file_selinux_context, Fdefault_file_modes)
2618 (Finsert_file_contents, choose_write_coding_system)
2619 (Fwrite_region, build_annotations, a_write, e_write)
2620 (Fdo_auto_save):
2621 * filelock.c (boot_time_initialized, get_boot_time)
2622 (get_boot_time_1, lock_file_1, within_one_second):
2623 * floatfns.c (in_float):
2624 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
2625 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
2626 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
2627 * lisp.h (struct Lisp_Hash_Table.cmpfn):
2628 * window.c (compare_window_configurations):
2629 Use bool for booleans.
2630 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
2631 (Fdefault_file_modes): Now mode_t, not int, for modes.
2632 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
2633 (internal_delete_file): Now returns void, not a (boolean) int,
2634 since nobody was looking at the return value.
2635 * lisp.h, window.h: Adjust to above API changes.
2636
2637 * xdisp.c (set_message): Simplify and reindent last change.
2638
2639 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
2640
2641 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
2642
2643 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
2644
2645 * eval.c (call_debugger): Make the function non-static so that we
2646 can call it from set_message.
2647
2648 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
2649 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
2650
2651 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 Give more-useful info on a fatal error (Bug#12328).
2654 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
2655 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
2656 of doing the work ourselves.
2657 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
2658 do most of the work.
2659 (fatal_error_backtrace): New function, taken from the guts
2660 of the old fatal_error_signal, but with a new option to output
2661 a backtrace.
2662 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
2663 info about the signal than just its number.
2664 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
2665 * sysdep.c: Include <execinfo.h>
2666 (emacs_backtrace): New function, taken partly from the previous
2667 code of the 'die' function.
2668 (emacs_abort): Call fatal_error_backtrace rather than abort.
2669
2670 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
2671
2672 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
2673 eager (load-time) macro-expansion.
2674 * lisp.mk (lisp): Add macroexp.
2675
2676 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 Simplify redefinition of 'abort' (Bug#12316).
2679 Do not try to redefine the 'abort' function. Instead, redo
2680 the code so that it calls 'emacs_abort' rather than 'abort'.
2681 This removes the need for the NO_ABORT configure-time macro
2682 and makes it easier to change the abort code to do a backtrace.
2683 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
2684 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
2685 Remove; sysdep.c's emacs_abort now takes its place.
2686 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
2687 'abort' changed to use 'emacs_abort'.
2688 * msdos.c (dos_abort) [defined abort]: Remove; not used.
2689 (abort) [!defined abort]: Rename to ...
2690 (emacs_abort): ... new name.
2691 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
2692 the place of the old 'abort' in emacs.c.
2693 * w32.c, w32fns.c (abort): Do not #undef.
2694 * w32.c (emacs_abort): Rename from w32_abort.
2695
2696 2012-09-04 Eli Zaretskii <eliz@gnu.org>
2697
2698 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
2699 offsets[j].dv, since the y axis of the screen coordinates points
2700 down, while the y axis of the font definition coordinates points
2701 up. This fixes display of Arabic diacritics such as KASRA and
2702 KASRATAN. (Bug#11860)
2703
2704 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
2705
2706 Be more systematic about _setjmp vs setjmp.
2707 * alloc.c (test_setjmp, mark_stack):
2708 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
2709 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
2710 (png_load, my_error_exit, jpeg_load):
2711 * process.c (send_process_trap, send_process):
2712 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
2713 The underscored versions are up to 30x faster on some hosts.
2714 Formerly, the code used setjmp+longjmp sometimes and
2715 _setjmp+_longjmp at other times, with no particular reason to
2716 prefer setjmp+longjmp.
2717
2718 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
2719
2720 Fix minor problem found by static checking.
2721 * buffer.c (Fdelete_all_overlays): Return nil.
2722
2723 2012-09-03 Martin Rudalics <rudalics@gmx.at>
2724
2725 * buffer.c (Fdelete_all_overlays): New function.
2726
2727 2012-09-03 Chong Yidong <cyd@gnu.org>
2728
2729 * gtkutil.c: Add extern decl for Qxft.
2730
2731 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2732
2733 * emacs.c, eval.c: Use bool for boolean.
2734 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
2735 (malloc_using_checking) [DOUG_LEA_MALLOC]:
2736 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
2737 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
2738 (main, decode_env_path, Fdaemon_initialized):
2739 * eval.c (call_debugger, Finteractive_p, interactive_p):
2740 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
2741 (maybe_call_debugger, Fbacktrace):
2742 * process.c (read_process_output, exec_sentinel):
2743 Use bool for booleans.
2744 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
2745 All callers changed.
2746 * eval.c (interactive_p): Omit always-true boolean argument
2747 EXCLUDE_SUBRS_P. All callers changed.
2748 * dispextern.h, lisp.h: Reflect above API changes.
2749 * firstfile.c (dummy): Use the address of 'main', whose signature
2750 won't change, instead of the address of 'initialize', whose
2751 signature just changed from int to bool.
2752 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
2753 * msdos.c (fatal_error_in_progress): ... from here.
2754 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
2755 of incrementing it.
2756 (redisplay_internal, unwind_redisplay): Simply clear
2757 REDISPLAYING_P when unwinding, instead of saving its previous,
2758 always-false value and then restoring it.
2759
2760 Clean up some extern decls.
2761 Mostly, this hoists extern decls out of .c files and into .h files.
2762 That way, we're more likely to catch errors if the interfaces change.
2763 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
2764 declare xg_mark_data.
2765 * dispextern.h (x_frame_parm_handlers):
2766 * font.h (Qxft):
2767 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
2768 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
2769 (Qultra_bold, Qoblique, Qitalic):
2770 Move extern decl here from .c file.
2771 * alloc.c (xg_mark_data) [USE_GTK]:
2772 * doc.c (Qclosure):
2773 * eval.c (Qlexical_binding):
2774 * fns.c (time) [!HAVE_UNISTD_H]:
2775 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
2776 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
2777 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
2778 * lread.c (Qinternal_interpreter_environment):
2779 * minibuf.c (Qbuffer):
2780 * process.c (QCfamily, QCfilter):
2781 * widget.c (free_frame_faces):
2782 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
2783 * xfont.c (x_clear_errors):
2784 * xterm.c (x_frame_parm_handlers):
2785 Remove now-redundant extern decls.
2786 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
2787 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
2788 Now static.
2789 * xfaces.c: Remove unnecessary static decls.
2790 * xterm.c (updating_frame): Remove decl of nonexistent object.
2791
2792 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
2793 when building globals.h, as the objects that are not built on
2794 this host are not needed to compile C files on this host.
2795
2796 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
2797
2798 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
2799
2800 * frame.h: Add missing prototype for x_wm_set_size_hint.
2801
2802 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
2803
2804 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
2805 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
2806 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
2807 (Fsubstitute_command_keys):
2808 * editfns.c (region_limit, find_field, Fconstrain_to_field)
2809 (save_excursion_save, save_excursion_restore)
2810 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
2811 (format_time_string, general_insert_function)
2812 (make_buffer_string, make_buffer_string_both)
2813 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
2814 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
2815 (copy_text, insert_1, insert_1_both, insert_from_string)
2816 (insert_from_string_before_markers, insert_from_string_1)
2817 (insert_from_buffer, insert_from_buffer_1, replace_range)
2818 (replace_range_2, del_range_1, del_range_byte, del_range_both)
2819 (del_range_2, modify_region):
2820 * intervals.c (intervals_equal, balance_possible_root_interval)
2821 (adjust_intervals_for_insertion, merge_properties_sticky)
2822 (graft_intervals_into_buffer, lookup_char_property)
2823 (adjust_for_invis_intang, set_point_both)
2824 (get_property_and_range, compare_string_intervals)
2825 (set_intervals_multibyte_1, set_intervals_multibyte):
2826 * keyboard.c (decode_timer):
2827 Use bool for boolean.
2828 * intervals.h, lisp.h, systime.h: Reflect above API changes.
2829 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
2830
2831 2012-09-02 Chong Yidong <cyd@gnu.org>
2832
2833 * keymap.c (push_key_description): Print M-TAB as C-M-i
2834 (Bug#11758).
2835
2836 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
2837
2838 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
2839 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
2840 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
2841 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
2842 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
2843 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
2844 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
2845
2846 2012-09-01 Eli Zaretskii <eliz@gnu.org>
2847
2848 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
2849 more than one grapheme cluster passed to the shaper: compute the
2850 offset adjustment values separately for each cluster. (Bug#11860)
2851
2852 * image.c: Restore mistakenly removed inclusion of w32.h. Without
2853 it, GCC doesn't see prototypes of w32_delayed_load, and complains
2854 about implicit conversions from integer to pointer.
2855
2856 2012-09-01 Daniel Colascione <dancol@dancol.org>
2857
2858 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
2859 system used too early.
2860
2861 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 Better seed support for (random).
2864 * emacs.c (main): Call init_random.
2865 * fns.c (Frandom): Set the seed from a string argument, if given.
2866 Remove long-obsolete Gentzel cruft.
2867 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
2868 (init_random): New function.
2869
2870 2012-09-01 Daniel Colascione <dancol@dancol.org>
2871
2872 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
2873 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
2874 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
2875 x_wm_set_size_hint, x_query_colors, x_real_positions,
2876 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
2877 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
2878 all of which have been moved to common code.
2879
2880 * xfaces.c: Include TERM_HEADER instead of listing all possible
2881 window-system headers.
2882
2883 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
2884 to match header.
2885
2886 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
2887 directly accessing frame internals.
2888
2889 * w32font.h: Include font.h. Define syms_of_w32font and
2890 globals_of_w32font.
2891
2892 * process.c: Include TERM_HEADER instead of listing all possible
2893 window-system headers.
2894
2895 * nsterm.h: Remove declarations now in frame.h.
2896 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
2897
2898 * menu.c: Include TERM_HEADER instead of listing all possible
2899 window-system headers.
2900
2901 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
2902 window system.
2903
2904 * keyboard.c: Include TERM_HEADER instead of listing all possible
2905 window-system headers.
2906
2907 * image.c: Include TERM_HEADER instead of listing all possible
2908 window-system headers. Declare Vlibrary_cache when compiling for
2909 Windows.
2910
2911 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
2912 window system declarations.
2913
2914 * frame.h: Move common functions here: set_frame_menubar,
2915 x_set_window_size, x_sync, x_get_focus_frame,
2916 x_set_mouse_position, x_set_mouse_pixel_position,
2917 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
2918 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
2919 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
2920 x_activate_menubar, x_real_positions, x_bitmap_icon,
2921 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
2922 and x_query_colors.
2923
2924 * frame.c: Include TERM_HEADER instead of listing all possible
2925 window-system headers.
2926
2927 * font.c: Include TERM_HEADER instead of listing all possible
2928 window-system headers.
2929
2930 * emacs.c: Include TERM_HEADER.
2931
2932 * dispnew.c: Include TERM_HEADER instead of listing all possible
2933 window-system headers.
2934
2935 * ccl.h: Include character.h.
2936
2937 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
2938 the current window system; include in list of objects to link into
2939 Emacs.
2940
2941 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2942
2943 Remove mark_ttys function and fix tty_display_info initialization.
2944 * lisp.h (mark_ttys): Remove prototype.
2945 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
2946 to mark_ttys because all possible values of 'top_frame' slot are
2947 the frames which are reachable from Vframe_list.
2948 * term.c (mark_ttys): Remove.
2949 (init_tty): Safely initialize 'top_frame' slot with Qnil.
2950
2951 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2952
2953 Change struct frame bitfields from unsigned char to unsigned.
2954 * frame.h (struct frame): Change type of 'display_preempted',
2955 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
2956 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
2957 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
2958 bitfields from unsigned char to unsigned.
2959
2960 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2961
2962 Remove unused member of struct x_output and struct w32_output.
2963 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
2964 * w32term.h (struct w32_output): Likewise.
2965
2966 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
2967
2968 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
2969 does not become zero (Bug#12234).
2970
2971 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
2972
2973 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
2974 for GCC 4.7.1 x86-64.
2975
2976 2012-08-30 Glenn Morris <rgm@gnu.org>
2977
2978 * lread.c (init_lread): For out-of-tree builds, only add the
2979 source directory's site-lisp dir to the load-path if it exists,
2980 consistent with in-tree builds. (Bug#12302)
2981
2982 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
2983
2984 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
2985 button_values to NULL. Call setStykeMask so dialogs get a close button.
2986 (windowShouldClose:): Set window_closed.
2987 (dealloc): New member, free button_values.
2988 (process_dialog:): Make member function. Remove window argument,
2989 replace window with self. Count buttons and allocate and store values
2990 in button_values.
2991 (addButton:value:row:): value is int with the name tag. Call setTag
2992 with tag. Remove return self, declare return value as void.
2993 (addString:row:): Remove return self, declare return value as void.
2994 (addSplit): Remove return self, declare return value as void.
2995 (clicked:): Remove return self, declare return value as void.
2996 Set dialog_return to button_values[seltag]. Code formatting change.
2997 (initFromContents:isQuestion:): Adjust call to process_dialog.
2998 Code formatting change.
2999 (timeout_handler:): Set timer_fired to YES.
3000 (runDialogAt:): Set timer_fired to NO.
3001 Handle click on close button as quit.
3002
3003 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3004 Add window_closed and button_values. Add void as return value for
3005 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3006 Add process_dialog as new member.
3007
3008 2012-08-28 Eli Zaretskii <eliz@gnu.org>
3009
3010 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3011 is not one of the heaps we manage. (Bug#12242)
3012
3013 2012-08-28 Glenn Morris <rgm@gnu.org>
3014
3015 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3016
3017 2012-08-28 Martin Rudalics <rudalics@gmx.at>
3018
3019 * window.c (Fset_window_configuration): Remove handling of
3020 auto-buffer-name window parameter. Install revision of reverted
3021 fix.
3022
3023 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3024
3025 Do not allow to set major mode for a dead buffer.
3026 * buffer.c (Fset_buffer_major_mode): Signal an error
3027 if the buffer is dead.
3028 (Fother_buffer, other_buffer_safely): Remove redundant
3029 nested declaration.
3030
3031 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3032
3033 Always use set_buffer_if_live to restore original buffer at unwind.
3034 * buffer.h (record_unwind_current_buffer): New function.
3035 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3036 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3037 * undo.c, window.c: Adjust users.
3038 * buffer.c (set_buffer_if_live): Fix comment.
3039
3040 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3041
3042 Fix usage of set_buffer_internal.
3043 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3044 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3045 * coding.c (decode_coding): Omit redundant test.
3046 * fileio.c (decide_coding_unwind): Likewise.
3047 * fns.c (secure_hash): Likewise.
3048 * insdel.c (modify_region): Likewise.
3049 * keyboard.c (command_loop_1): Likewise.
3050 * print.c (PRINTFINISH): Likewise.
3051 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3052
3053 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3054
3055 * dispnew.c: Use bool for boolean.
3056 (frame_garbaged, display_completed, delayed_size_change)
3057 (fonts_changed_p, add_window_display_history)
3058 (add_frame_display_history, verify_row_hash)
3059 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3060 (row_equal_p, realloc_glyph_pool)
3061 (allocate_matrices_for_frame_redisplay)
3062 (showing_window_margins_p)
3063 (adjust_frame_glyphs_for_frame_redisplay)
3064 (build_frame_matrix_from_leaf_window, make_current)
3065 (mirrored_line_dance, mirror_line_dance, update_frame)
3066 (update_window_tree, update_single_window)
3067 (check_current_matrix_flags, update_window, update_text_area)
3068 (update_window_line, set_window_update_flags, scrolling_window)
3069 (update_frame_1, scrolling, buffer_posn_from_coords)
3070 (do_pending_window_change, change_frame_size)
3071 (change_frame_size_1, sit_for):
3072 Use bool for boolean.
3073 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3074 and remove last int (actually boolean) argument, which was always 0.
3075 All callers changed.
3076 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3077 * dispextern.h (struct composition_it): Use bool for boolean.
3078 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3079 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3080 * dired.c (file_name_completion):
3081 Use bool for boolean. (This was missed in an earlier change.)
3082
3083 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3084
3085 * window.c (Fset_window_configuration): Revert first part of
3086 last change.
3087
3088 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3089
3090 * nsterm.h (NSPanel): New class variable dialog_return.
3091
3092 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3093 Initialize dialog_return.
3094 (windowShouldClose:): Use stop instead of stopModalWithCode.
3095 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3096 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3097 event.
3098 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3099 modal loop returns.
3100
3101 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3102
3103 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3104 * composite.c (find_composition, composition_gstring_p)
3105 (composition_reseat_it, find_automatic_composition):
3106 * data.c (let_shadows_buffer_binding_p)
3107 (let_shadows_global_binding_p, set_internal, make_blv)
3108 (Fmake_variable_buffer_local, Fmake_local_variable)
3109 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3110 (cons_to_signed, arith_driver):
3111 * dbusbind.c (xd_in_read_queued_messages):
3112 * dired.c (directory_files_internal, file_name_completion):
3113 Use bool for booleans.
3114 * dired.c (file_name_completion):
3115 * process.h (fd_callback):
3116 Omit int (actually boolean) argument. It wasn't being used.
3117 All uses changed.
3118 * composite.h, lisp.h: Reflect above API changes.
3119
3120 * cmds.c, coding.c: Use bool for booleans.
3121 * cmds.c (move_point, Fself_insert_command):
3122 * coding.h (struct composition status, struct coding_system):
3123 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3124 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3125 (emacs_mule_char, decode_coding_emacs_mule)
3126 (encode_coding_emacs_mule, detect_coding_iso_2022)
3127 (decode_coding_iso_2022, encode_invocation_designation)
3128 (encode_designation_at_bol, encode_coding_iso_2022)
3129 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3130 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3131 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3132 (encode_coding_raw_text, detect_coding_charset)
3133 (decode_coding_charset, encode_coding_charset, detect_eol)
3134 (detect_coding, get_translation_table, produce_chars)
3135 (consume_chars, reused_workbuf_in_use)
3136 (make_conversion_work_buffer, code_conversion_save)
3137 (decode_coding_object, encode_coding_object)
3138 (detect_coding_system, char_encodable_p)
3139 (Funencodable_char_position, code_convert_region)
3140 (code_convert_string, code_convert_string_norecord)
3141 (Fset_coding_system_priority):
3142 * fileio.c (Finsert_file_contents):
3143 Use bool for booleans.
3144 * coding.h, lisp.h: Reflect above API changes.
3145 * coding.c: Remove unnecessary static function decls.
3146 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3147 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3148 not a boolean 'int', since callers never look at the return value.
3149 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3150 * coding.h (decoding_buffer_size, encoding_buffer_size)
3151 (emacs_mule_string_char): Remove unused extern decls.
3152 (struct iso_2022_spec, struct coding_system):
3153 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3154 (struct emacs_mule_spec): Remove unused field 'full_support'.
3155 All initializations removed.
3156 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3157
3158 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3159
3160 Fix spare memory change (Bug#12286).
3161 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3162 (valid_lisp_object_p): Likewise.
3163
3164 2012-08-27 Martin Rudalics <rudalics@gmx.at>
3165
3166 * window.c (Fset_window_configuration): Record any window's old
3167 buffer if it's replaced (see Bug#8789). If the new current
3168 buffer doesn't appear in the selected window, go to its old
3169 point (Bug#12208).
3170
3171 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3172
3173 Special MEM_TYPE_SPARE to denote reserved memory.
3174 * alloc.c (enum mem_type): New memory type.
3175 (refill_memory_reserve): Use new type for spare memory.
3176 This prevents live_cons_p and live_string_p from incorrect
3177 detection of uninitialized objects from spare memory as live.
3178
3179 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3180
3181 Spelling fixes.
3182 * Makefile.in (.PHONY): versioclean -> versionclean.
3183
3184 Remove unused external symbols.
3185 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3186 * window.c (Qwindow_valid_p, decode_valid_window):
3187 Now static, not extern.
3188 * data.c (Qinterval): Remove; unused.
3189 (syms_of_data): Do not define 'interval'.
3190 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3191 * window.h (decode_valid_window):
3192 Remove decls.
3193
3194 * character.c, charset.c, chartab.c: Use bool for booleans.
3195 * character.c (lisp_string_width, string_count_byte8)
3196 (string_escape_byte8):
3197 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3198 (load_charset_map_from_file, map_charset_chars)
3199 (Fdefine_charset_internal, define_charset_internal)
3200 (Fdeclare_equiv_charset, find_charsets_in_text)
3201 (Ffind_charset_region, char_charset, Fiso_charset):
3202 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3203 (sub_char_table_set, sub_char_table_set_range)
3204 (char_table_set_range, optimize_sub_char_table)
3205 (map_sub_char_table):
3206 Use bool for boolean.
3207 * character.c (str_to_unibyte): Omit last boolean argument; it was
3208 always 0. All callers changed.
3209 * character.h, charset.h: Adjust to match previous changes.
3210 * character.h (char_printable_p): Remove decl of nonexistent function.
3211 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3212 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3213 are all boolean, so make them single-bit bitfields.
3214
3215 * lisp.h (ASET): Remove attempt to detect side effects.
3216 It was meant to be temporary and it often doesn't work,
3217 because when IDX has side effects the behavior of IDX==IDX
3218 is undefined. See Stefan Monnier in
3219 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3220
3221 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3222
3223 * lisp.h (functionp): New function (extracted from Ffunctionp).
3224 (FUNCTIONP): Use it.
3225 * eval.c (Ffunctionp): Use it.
3226
3227 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3228
3229 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3230 as that's faster and simpler than static storage. Don't bother
3231 with the g_main_context_query overhead if g_main_context_pending
3232 says no events are pending.
3233 (gfds, gfds_size): Remove these static vars.
3234 (xgselect_initialize): Remove; no longer needed.
3235 All uses and decls removed.
3236
3237 * emacs.c (fatal_error_signal_hook): Remove.
3238 All uses removed. This leftover from old code was always 0.
3239
3240 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3241 * casefiddle.c (casify_object, casify_region):
3242 * casetab.c (set_case_table):
3243 * category.c, category.h (word_boundary_p):
3244 * category.h (CHAR_HAS_CATEGORY):
3245 Use bool for booleans, instead of int.
3246
3247 2012-08-25 Eli Zaretskii <eliz@gnu.org>
3248
3249 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3250
3251 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3252
3253 On assertion failure, print backtrace if available.
3254 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3255 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3256 * Makefile.in (LIB_EXECINFO): New macro.
3257 (LIBES): Use it.
3258
3259 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3260 * bytecode.c (exec_byte_code):
3261 * callint.c (check_mark, Fcall_interactively):
3262 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3263 (getenv_internal, sync_process_alive, call_process_exited):
3264 * lisp.h (USE_SAFE_ALLOCA):
3265 Use bool for booleans, instead of int.
3266 * lisp.h, process.h: Adjust prototypes to match above changes.
3267 * callint.c (Fcall_interactively): Don't assume the mark's
3268 offset fits in 'int'.
3269
3270 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3271
3272 * buffer.c, buffer.h: Use bool for boolean.
3273 * buffer.c (reset_buffer_local_variables)
3274 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3275 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3276 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3277 (overlay_touches_p, overlay_strings, Foverlay_put)
3278 (report_overlay_modification, call_overlay_mod_hooks):
3279 (mmap_enlarge, mmap_set_vars):
3280 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3281 Use bool for booleans, instead of int.
3282 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3283 since the 1-or-0 return value is always ignored anyway.
3284 (mmap_initialized_p):
3285 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3286 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3287
3288 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3289
3290 * bidi.c: Use bool for boolean.
3291 This is a bit more readable, and makes the text segment of bidi.o
3292 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3293 Presumably it's faster too.
3294 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3295 Now bool.
3296 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3297 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3298 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3299 (bidi_explicit_dir_char, bidi_level_of_next_char)
3300 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3301 Use bool for booleans, instead of int.
3302 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3303 (bidi_unshelve_cache): Adjust decls to match code.
3304
3305 2012-08-23 Martin Rudalics <rudalics@gmx.at>
3306
3307 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3308 argument.
3309
3310 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3311
3312 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3313 * atimer.h: Include <stdbool.h>.
3314
3315 2012-08-22 Dan Nicolaescu <dann@gnu.org>
3316
3317 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3318 compile time tests instead of run time tests on systems that do
3319 not use them.
3320 (FRAME_MAC_P): Remove leftover from deleted code.
3321 * frame.c (syms_of_frame): Remove leftover from deleted code.
3322
3323 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3324
3325 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3326
3327 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3328
3329 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3330 Otherwise, the compiler complains about (A?B:C) where B is void
3331 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
3332 (fontset_add): Return void, for FONTSET_ADD.
3333
3334 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3335
3336 * alloc.c: Use bool for booleans.
3337 (gc_in_progress, abort_on_gc)
3338 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3339 (dont_register_blocks) [GC_MALLOC_CHECK]:
3340 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3341 (check_string_bytes, make_specified_string, memory_full)
3342 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3343 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3344 (mark_stack, valid_pointer_p, make_pure_string)
3345 (Fgarbage_collect, survives_gc_p, gc_sweep):
3346 Use bool for booleans, instead of int.
3347 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3348 Remove unused local.
3349 * alloc.c (PURE_POINTER_P):
3350 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3351 * editfns.c (Fformat):
3352 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3353 (Fdo_auto_save):
3354 * fns.c (sweep_weak_table):
3355 * lisp.h (suppress_checking, push_message, survives_gc_p)
3356 (make_pure_string, gc_in_progress, abort_on_gc):
3357 * lread.c (readchar, read1):
3358 * print.c (Fprin1_to_string):
3359 * xdisp.c (push_message):
3360 Use bool for booleans affected directly or indirectly by
3361 alloc.c's changes.
3362
3363 Make recently-introduced setters macros.
3364 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3365 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3366 (set_fontset_default, set_fontset_fallback): Rename from their
3367 upper-case counterparts, and make them functions rather than macros.
3368 This is more consistent with the other recently-introduced setters.
3369 These don't need to be inline, since they're local.
3370
3371 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3372
3373 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3374 the loop (Bug#12247).
3375
3376 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3377
3378 * lisp.h (vcopy): Use memcpy rather than our own loop.
3379 This fixes a performance regression introduced by the recent
3380 addition of vcopy. This means 'vcopy' will need to be modified
3381 for a copying collector, but that's OK. Also, tighten the
3382 checking in the assertion.
3383
3384 2012-08-21 Eli Zaretskii <eliz@gnu.org>
3385
3386 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3387 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3388 non-base glyph for the width of the base character, according to
3389 what x_draw_composite_glyph_string_foreground expects.
3390 Generate WADJUST value according to composition_gstring_width's
3391 expectations, to produce correct width of the composed character.
3392 Reverse the sign of the DU offset produced by ScriptPlace.
3393
3394 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3395
3396 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3397
3398 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3399
3400 Avoid direct writes to contents member of struct Lisp_Vector.
3401 * lisp.h (vcopy): New function to copy data into vector.
3402 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3403 * fns.c (Ffillarray): Use ASET.
3404 * keyboard.c (timer_check_2): Use AREF and ASET.
3405 (append_tool_bar_item, Frecent_keys): Use vcopy.
3406 * lread.c (read_vector): Use ASET.
3407 * msdos.c (Frecent_doskeys): Use vcopy.
3408 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3409 (Finternal_merge_in_global_face): Use ASET and vcopy.
3410 * xfont.c (xfont_list_pattern): Likewise.
3411
3412 2012-08-21 Martin Rudalics <rudalics@gmx.at>
3413
3414 * window.c (Fwindow_point): For the selected window always return
3415 the position of its buffer's point.
3416 (Fset_window_point): For the selected window always go in its
3417 buffer to the specified position.
3418
3419 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3420
3421 Setter macros for fontsets.
3422 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3423 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3424 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3425 Adjust users.
3426
3427 2012-08-20 Glenn Morris <rgm@gnu.org>
3428
3429 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3430 Don't assume that `ln -f' works.
3431
3432 2012-08-20 Eli Zaretskii <eliz@gnu.org>
3433
3434 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3435 and later about non-assignments with no effect. See discussion at
3436 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3437 details.
3438
3439 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3440
3441 Inline setter functions for Lisp_Objects slots of struct specbinding.
3442 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3443 Adjust users.
3444
3445 2012-08-20 Martin Rudalics <rudalics@gmx.at>
3446
3447 * window.c (select_window): Always make selected window's buffer
3448 current.
3449
3450 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3451
3452 Use AREF and ASET for docstrings of category tables.
3453 * category.h (CATEGORY_DOCSTRING): Use AREF.
3454 (SET_CATEGORY_DOCSTRING): Use ASET.
3455 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3456
3457 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3458
3459 Inline setter functions for hash table members.
3460 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3461 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3462 (set_hash_key_and_value, set_hash_index, set_hash_next)
3463 (set_hash_hash): New functions.
3464 * charset.c, fns.c: Adjust users.
3465
3466 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3467
3468 Inline getter and setter functions for per-buffer values.
3469 * buffer.h (per_buffer_default, set_per_buffer_default)
3470 (per_buffer_value, set_per_buffer_value): New functions.
3471 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3472 * buffer.c, data.c: Adjust users.
3473
3474 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
3475
3476 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3477
3478 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3479
3480 Rely on <config.h> + <unistd.h> to declare 'environ',
3481 as gnulib does this if the system doesn't.
3482 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
3483 Remove declaration. MS-Windows declares it on stdlib.h which is
3484 included by conf_post.h.
3485 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3486 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3487 * vm-limit.c: Include <unistd.h>, for 'environ'.
3488
3489 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3490 (start_of_data): Remove decl; mem-limits.h provides it.
3491
3492 * xdisp.c (handle_invisible_prop): Make it a bit faster
3493 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3494
3495 2012-08-19 Chong Yidong <cyd@gnu.org>
3496
3497 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3498 ends (Bug#3874).
3499
3500 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3501
3502 * .gdbinit: Use call instead of set when calling a function in the
3503 inferior.
3504
3505 * data.c (set_internal): Don't use set_blv_found.
3506 (Fkill_local_variable): Likewise.
3507
3508 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3509
3510 * nsfont.m (ns_ascii_average_width): Ensure the string
3511 ascii_printable is initialized with a null-terminated character
3512 array. Otherwise, it can contain undesired extra characters.
3513
3514 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3515
3516 port new setting code to Sun C 5.8 2005/10/13
3517 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3518 Return void, not Lisp_Object. Otherwise, the compiler
3519 complains about (A?B:C) where B is void and C is Lisp_Object
3520 when compiling CHAR_TABLE_SET, due to the recent change to
3521 the API of sub_char_table_set_contents.
3522
3523 2012-08-18 Chong Yidong <cyd@gnu.org>
3524
3525 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3526 for the string case (Bug#3874).
3527
3528 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3529
3530 * buffer.h (BSET): Remove (Bug#12215).
3531 Replace all uses with calls to new setter functions.
3532 (bset_bidi_paragraph_direction, bset_case_canon_table)
3533 (bset_case_eqv_table, bset_directory, bset_display_count)
3534 (bset_display_time, bset_downcase_table)
3535 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3536 (bset_last_selected_window, bset_local_var_alist)
3537 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3538 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3539 (bset_width_table):
3540 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3541 (bset_auto_fill_function, bset_auto_save_file_format)
3542 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3543 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3544 (bset_cache_long_line_scans, bset_case_fold_search)
3545 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3546 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3547 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3548 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3549 (bset_header_line_format, bset_indicate_buffer_boundaries)
3550 (bset_indicate_empty_lines, bset_invisibility_spec)
3551 (bset_left_fringe_width, bset_major_mode, bset_mark)
3552 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3553 (bset_name, bset_overwrite_mode, bset_pt_marker)
3554 (bset_right_fringe_width, bset_save_length)
3555 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3556 (bset_scroll_up_aggressively, bset_selective_display)
3557 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3558 (bset_word_wrap, bset_zv_marker):
3559 * category.c (bset_category_table):
3560 * syntax.c (bset_syntax_table):
3561 New setter functions.
3562
3563 * process.h (PSET): Remove (Bug#12215).
3564 Replace all uses with calls to new setter functions.
3565 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3566 (PROCESS_INLINE): New macro.
3567 (pset_childp): New setter function.
3568 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
3569 * process.c (PROCESS_INLINE):
3570 Define to EXTERN_INLINE, so that the corresponding functions
3571 are compiled into code.
3572 (pset_buffer, pset_command, pset_decode_coding_system)
3573 (pset_decoding_buf, pset_encode_coding_system)
3574 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
3575 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
3576 (pset_type, pset_write_queue): New setter functions.
3577
3578 * window.h (WSET): Remove (Bug#12215).
3579 Replace all uses with calls to new setter functions.
3580 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3581 (WINDOW_INLINE): New macro.
3582 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
3583 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
3584 (wset_total_lines, wset_vertical_scroll_bar)
3585 (wset_window_end_pos, wset_window_end_valid)
3586 (wset_window_end_vpos): New setter functions.
3587 * window.c (WINDOW_INLINE):
3588 Define to EXTERN_INLINE, so that the corresponding functions
3589 are compiled into code.
3590 (wset_combination_limit, wset_dedicated, wset_display_table)
3591 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
3592 (wset_new_normal, wset_new_total, wset_next_buffers)
3593 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
3594 (wset_prev_buffers, wset_right_fringe_width)
3595 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
3596 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
3597 (wset_window_parameters):
3598 * xdisp.c (wset_base_line_number, wset_base_line_pos)
3599 (wset_column_number_displayed, wset_region_showing):
3600 New setter functions.
3601
3602 * termhooks.h (TSET): Remove (Bug#12215).
3603 Replace all uses with calls to new setter functions.
3604 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3605 (TERMHOOKS_INLINE): New macro.
3606 (tset_charset_list, tset_selection_alist): New setter functions.
3607 * terminal.c (TERMHOOKS_INLINE):
3608 Define to EXTERN_INLINE, so that the corresponding functions
3609 are compiled into code.
3610 (tset_param_alist): New setter function.
3611
3612 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3613
3614 * keyboard.h (KSET): Remove (Bug#12215).
3615 Replace all uses with calls to new setter functions.
3616 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3617 (KEYBOARD_INLINE): New macro.
3618 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
3619 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
3620 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
3621 New setter functions.
3622 * keyboard.c (KEYBOARD_INLINE):
3623 Define to EXTERN_INLINE, so that the corresponding functions
3624 are compiled into code.
3625 (kset_echo_string, kset_kbd_queue)
3626 (kset_keyboard_translate_table, kset_last_prefix_arg)
3627 (kset_last_repeatable_command, kset_local_function_key_map)
3628 (kset_overriding_terminal_local_map, kset_real_last_command)
3629 (kset_system_key_syms): New setter functions.
3630
3631 * frame.h (FSET): Remove (Bug#12215).
3632 Replace all uses with calls to new setter functions.
3633 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
3634 (FRAME_INLINE): New macro.
3635 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
3636 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
3637 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
3638 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
3639 (fset_param_alist, fset_root_window, fset_scroll_bars)
3640 (fset_selected_window, fset_title, fset_tool_bar_items)
3641 (fset_tool_bar_position, fset_tool_bar_window): New functions.
3642 * frame.c (FRAME_INLINE):
3643 Define to EXTERN_INLINE, so that the corresponding functions
3644 are compiled into code.
3645 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
3646
3647 A few more naming-convention fixes for getters and setters.
3648 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
3649 and rename from buffer_overlays_set_before.
3650 (set_buffer_overlays_after): Move here from buffer.h, and rename
3651 from buffer_overlays_set_after.
3652 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
3653 All uses changed.
3654 (set_buffer_intervals): Rename from buffer_set_intervals.
3655 * intervals.c (set_interval_object): Move here from intervals.h,
3656 and rename from interval_set_object.
3657 (set_interval_left): Move here from intervals.h, and rename from
3658 interval_set_left.
3659 (set_interval_right): Move here from intervals.h, and rename from
3660 interval_set_right.
3661 (copy_interval_parent): Move here from intervals.h, and rename from
3662 interval_copy_parent.
3663 * intervals.h (set_interval_parent): Rename from interval_set_parent.
3664 (set_interval_plist): Rename from interval_set_plist.
3665 Return void, not Lisp_Object, since no caller uses the result.
3666 * lisp.h (string_intervals): Rename from string_get_intervals.
3667 (set_string_intervals): Rename from string_set_intervals.
3668
3669 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
3670 (set_char_table_contents): Rename from char_table_set_contents.
3671 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
3672 All uses changed. See the end of
3673 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
3674
3675 * lisp.h (CSET): Remove (Bug#12215).
3676 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
3677 (set_char_table_purpose): New functions,
3678 replacing CSET. All uses changed. For example, replace
3679 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
3680 "set_char_table_parent (char_table, parent);".
3681 The old version was confusing because it used the same name
3682 'parent' for two different things.
3683
3684 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3685
3686 Functions to get and set Lisp_Object fields of buffer-local variables.
3687 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
3688 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
3689 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
3690 * data.c, eval.c, frame.c: Adjust users.
3691
3692 2012-08-17 Chong Yidong <cyd@gnu.org>
3693
3694 * xfaces.c (merge_face_vectors): If the target font specfies a
3695 font spec, make the font's attributes take precedence over
3696 directly-specified attributes.
3697 (merge_face_ref): Recognize :font.
3698
3699 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
3700
3701 Do not use memcpy for copying intervals.
3702 * intervals.c (reproduce_interval): New function.
3703 (reproduce_tree, reproduce_tree_obj): Use it.
3704 (reproduce_tree_obj): Remove prototype.
3705
3706 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
3707
3708 * lisp.h (duration_to_sec_usec): Remove unused decl.
3709
3710 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
3711
3712 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
3713 to an allocated instance of NSString, not to the class itself.
3714
3715 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
3716
3717 * makefile.w32-in (C_CTYPE_H): New macro.
3718 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
3719 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
3720 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3721
3722 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
3723
3724 Use ASCII tests for character types.
3725 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
3726 * xfns.c, xterm.c:
3727 Don't include <ctype.h>; was not needed.
3728 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
3729 * sysdep.c, xfaces.c:
3730 Include <c-ctype.h> instead of <ctype.h>.
3731 * nsterm.m: Include <c-ctype.h>.
3732 * charset.c (read_hex):
3733 * doc.c (Fsnarf_documentation):
3734 * fileio.c (IS_DRIVE) [WINDOWSNT]:
3735 (DRIVE_LETTER) [DOS_NT]:
3736 (Ffile_name_directory, Fexpand_file_name)
3737 (Fsubstitute_in_file_name):
3738 * font.c (font_parse_xlfd, font_parse_fcname):
3739 * frame.c (x_set_font_backend):
3740 * gtkutil.c (xg_get_font):
3741 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
3742 * nsimage.m (hexchar):
3743 * nsterm.m (ns_xlfd_to_fontname):
3744 * sysdep.c (system_process_attributes):
3745 * xfaces.c (hash_string_case_insensitive):
3746 Use C-locale tests instead of locale-specific tests for character
3747 types, since we want the ASCII interpretation here, not the
3748 interpretation suitable for whatever happens to be the current locale.
3749
3750 2012-08-16 Martin Rudalics <rudalics@gmx.at>
3751
3752 Consistently check windows for validity/liveness
3753 (Bug#11984, Bug#12025, Bug#12026).
3754 * lisp.h (CHECK_VALID_WINDOW): New macro.
3755 * window.c (decode_window): Rename to decode_live_window.
3756 (decode_valid_window, Fwindow_valid_p): New functions.
3757 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
3758 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
3759 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
3760 (Fwindow_prev_sibling, Fwindow_combination_limit)
3761 (Fset_window_combination_limit, Fwindow_use_time)
3762 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
3763 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
3764 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
3765 (Fwindow_hscroll, Fset_window_hscroll)
3766 (Fwindow_redisplay_end_trigger)
3767 (Fset_window_redisplay_end_trigger, Fwindow_edges)
3768 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
3769 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3770 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
3771 (Fwindow_end, Fset_window_point, Fset_window_start)
3772 (Fpos_visible_in_window_p, Fwindow_line_height)
3773 (Fwindow_dedicated_p, Fset_window_dedicated_p)
3774 (Fwindow_prev_buffers, Fset_window_prev_buffers)
3775 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
3776 (Fset_window_parameter, Fwindow_display_table)
3777 (Fset_window_display_table, Fdelete_other_windows_internal)
3778 (Fset_window_buffer, Fset_window_new_total)
3779 (Fset_window_new_normal, Fdelete_window_internal)
3780 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
3781 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
3782 (Fwindow_scroll_bars): Check whether argument window is a valid or
3783 live window. Update doc-strings.
3784 (syms_of_window): New symbol Qwindow_valid_p.
3785 * keyboard.c (Fposn_at_x_y): Check whether argument
3786 frame_or_window denotes a valid window.
3787
3788 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 Fix previous char table change.
3791 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
3792 * chartab.c (optimize_sub_char_table): Likewise.
3793
3794 2012-08-16 Chong Yidong <cyd@gnu.org>
3795
3796 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
3797
3798 * xfont.c (xfont_open):
3799 * xftfont.c (xftfont_open): Set the font's max_width field.
3800
3801 * nsfont.m (nsfont_open): Similar to the Xft backend, set
3802 min_width to space_width and average_width to the average over
3803 printable ASCII characters.
3804 (ns_char_width): Code cleanup.
3805 (ns_ascii_average_width): New utility function.
3806
3807 * font.h (struct font): Update comments.
3808
3809 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
3810
3811 Simple interface to set Lisp_Object fields of character tables.
3812 * lisp.h (CSET): New macro.
3813 (char_table_set_extras, char_table_set_contents)
3814 (sub_char_table_set_contents): New function.
3815 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
3816 * syntax.c: Adjust users.
3817
3818 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
3819
3820 * eval.c (eval_sub): Bind lexical-binding.
3821 * lread.c (Qlexical_binding): Make non-static.
3822
3823 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
3824
3825 * nsmenu.m (popupSession): Remove.
3826 (pop_down_menu): Remove endModalSession.
3827 (timeout_handler:): New method.
3828 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
3829 Call runModalForWindow. Check timer_fired when it returns.
3830 If not set, cancel timer and break out of loop.
3831 Otherwise loop again, with a new timeout.
3832
3833 * nsterm.m: Include fcntl.h if present.
3834 (fd_entry, t_readfds, inNsSelect): Remove.
3835 (select_writefds, select_valid, select_timeout, selfds)
3836 (select_mutex, apploopnr): Add.
3837 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
3838 Otherwise call kbd_buffer_store_event.
3839 (ns_send_appdefined): Remove release of fd_entry.
3840 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
3841 Increment and decrement apploopnr.
3842 (ns_select): If no file descriptors, just do a NSTimer.
3843 Otherwise copy read/write masks and start select thread (fd_handler).
3844 Start main loop and wait for application defined event.
3845 Inform select thread to stop selecting after main loop is exited.
3846 (ns_term_init): Create selfds pipe and set non-blocking.
3847 Initialize select_mutex. Start the select thread (fd_handler).
3848 (fd_handler:): Loop forever, wait for info from the main thread
3849 to either start or stop selecting. When select returns, send
3850 and appdefined event.
3851 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
3852 If not call kbd_buffer_store_event.
3853
3854 * nsterm.h (EmacsApp): fd_handler takes id argument.
3855 (EmacsDialogPanel): Add timer_fired and timeout_handler.
3856
3857 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
3858
3859 2012-08-15 Eli Zaretskii <eliz@gnu.org>
3860
3861 * region-cache.c (move_cache_gap): Update gap_len using the actual
3862 growth of the boundaries array. Do not change cache_len.
3863 (Bug#12196)
3864
3865 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3866
3867 Generalize and cleanup font subsystem checks.
3868 * font.h (FONT_DEBUG, font_assert): Remove.
3869 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
3870 Change font_assert to eassert. Use eassert where appropriate.
3871
3872 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
3873
3874 * gtkutil.c (xg_get_font): Use pango_units_to_double.
3875
3876 2012-08-15 Chong Yidong <cyd@gnu.org>
3877
3878 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
3879 When using the new font chooser, use gtk_font_chooser_get_font_desc to
3880 extract the font descriptor instead of just the font name.
3881 In that case, return a font spec instead of a string.
3882 (x_last_font_name): Move to this file from xfns.c.
3883
3884 * xfns.c (Fx_select_font): The return value can also be a font
3885 spec. Move x_last_font_name management to gtkutil.c.
3886
3887 * xfaces.c: Make font weight and style symbols non-static.
3888
3889 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
3890
3891 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
3892 (bug#12117).
3893
3894 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
3895
3896 * alloc.c (Fgarbage_collect): Use plural form consistently.
3897
3898 2012-08-14 Eli Zaretskii <eliz@gnu.org>
3899
3900 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
3901 iteration through the command loop. Fixes a problem whereby mouse
3902 movements are ignored until the first mouse click.
3903
3904 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3905
3906 Use bool, not int, for Lisp booleans.
3907 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
3908 makes Emacs a bit smaller and presumably a bit faster.
3909 * lisp.h: Include <stdbool.h>.
3910 (struct Lisp_Boolfwd, defvar_bool):
3911 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
3912 * regex.c [!emacs]: Include <stdbool.h>.
3913 (false, true): Remove; <stdbool.h> does this for us now.
3914
3915 2012-08-14 Chong Yidong <cyd@gnu.org>
3916
3917 * character.c (Fcharacterp): Doc fix (Bug#12076).
3918
3919 * data.c (Findirect_variable): Doc fix (Bug#11040).
3920
3921 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
3922
3923 * editfns.c (Fformat): Doc fix (Bug#12059).
3924 (Fsave_current_buffer): Doc fix (Bug#11542).
3925
3926 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3927
3928 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
3929 (bug#12022).
3930
3931 2012-08-14 Martin Rudalics <rudalics@gmx.at>
3932
3933 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
3934 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
3935 * minibuf.c (choose_minibuf_frame, read_minibuf):
3936 * w32fns.c (x_create_tip_frame):
3937 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
3938 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
3939
3940 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 * intervals.c (offset_intervals): Remove obsolete comment.
3943
3944 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
3945
3946 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
3947
3948 2012-08-14 Gergely Risko <gergely@risko.hu>
3949
3950 * coding.c (decode_coding): Record buffer modification before
3951 disabling undo_list (Bug#11773).
3952
3953 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3954
3955 Revert and cleanup some recent overlay changes.
3956 * buffer.h (enum overlay_type): Remove.
3957 (buffer_get_overlays, buffer_set_overlays): Likewise.
3958 (buffer_set_overlays_before, buffer_set_overlays_after):
3959 New function. Adjust users.
3960 (unchain_both): Add eassert.
3961
3962 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
3963
3964 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
3965
3966 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
3967
3968 * gtkutil.c (xg_mark_data): Don't assume C99.
3969
3970 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
3971
3972 * gtkutil.c (xg_frame_tb_info): New struct.
3973 (TB_INFO_KEY): New define.
3974 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
3975 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
3976 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
3977 if not present.
3978 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
3979 is up to date. Otherwise store new data.
3980 (free_frame_tool_bar): Free xg_frame_tb_info if present.
3981
3982 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3983
3984 Use KSET for write access to Lisp_Object members of struct kboard.
3985 * keyboard.h (KSET): New macro.
3986 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
3987 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
3988 * xterm.c: Adjust users.
3989
3990 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
3991
3992 Use BSET for write access to Lisp_Object members of struct buffer.
3993 * buffer.h (BSET): New macro.
3994 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
3995 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
3996 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
3997 * window.c, xdisp.c, xfns.c: Adjust users.
3998
3999 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4000
4001 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4002
4003 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4004
4005 * nsterm.m (not_in_argv): New function.
4006 (application:openFile, application:openTempFile:):
4007 (application:openFileWithoutUI:, application:openFiles:): Open file
4008 if not_in_argv returns non-zero (bug#12171).
4009
4010 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
4011 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4012 Define for Gtk+ versions less than 3.2.
4013 (xg_get_font_name): Use those functions/macros here.
4014 Reported by Frans Oilinki <moilinki@gmail.com>.
4015
4016 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4017
4018 * unexmacosx.c (copy_data_segment): Copy initialized data in
4019 statically linked libraries from input file rather than memory.
4020
4021 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4022 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4023 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4024
4025 2012-08-10 Glenn Morris <rgm@gnu.org>
4026
4027 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4028 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4029
4030 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4031
4032 Fix last change to allow compilation with low optimization levels.
4033 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4034 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4035
4036 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4037
4038 Use common inline syntax in intervals.h.
4039 * intervals.h (INTERVALS_INLINE): New macro.
4040 Change all users from LISP_INLINE.
4041
4042 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4043
4044 Define Qnone once for all platforms.
4045 * frame.c (Qnone): Define here.
4046 (syms_of_frame): DEFSYM it.
4047 * lisp.h (Qnone): New declaration.
4048 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4049 * xfns.c: Remove duplication. Adjust users.
4050
4051 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4052
4053 Remove unused macros from intervals.h.
4054 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4055 * intervals.c: Adjust comment.
4056
4057 2012-08-10 Eli Zaretskii <eliz@gnu.org>
4058
4059 * w32fns.c <w32_unicode_gui>: New static variable.
4060 (globals_of_w32fns): Initialize it according to os_subtype.
4061 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4062 testing os_subtype.
4063
4064 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
4065 Eli Zaretskii <eliz@gnu.org>
4066
4067 Fix bug #10299 with Unicode characters sent by customized
4068 keyboards created by MSKLC.
4069 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4070 (w32_init_class): Use it to initialize the Emacs class with either
4071 ANSI or Unicode API calls.
4072 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4073 later.
4074 (w32_wnd_proc): If the character code sent by WM_CHAR or
4075 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4076 original message. Call DefWindowProcW on NT and later.
4077
4078 2012-08-10 Glenn Morris <rgm@gnu.org>
4079
4080 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4081
4082 * lisp.h (DIRECTORY_SEP): Let configure set it.
4083
4084 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4085
4086 Use TSET for write access to Lisp_Object slots of struct terminal.
4087 * termhooks.h (TSET): New macro.
4088 * coding.c, terminal.c, xselect.c: Adjust users.
4089
4090 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4091
4092 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4093 the failing expression, include them in the error message.
4094 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4095 * lisp.h (internal_condition_case_n): Update declaration.
4096
4097 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4098
4099 Inline functions to examine and change buffer overlays.
4100 * buffer.c (unchain_both): New function.
4101 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4102 (buffer_has_overlays): New function.
4103 (enum overlay_type): New enum.
4104 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4105 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4106
4107 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4108
4109 Inline functions to examine and change buffer intervals.
4110 * alloc.c (mark_interval_tree): Remove.
4111 (MARK_INTERVAL_TREE): Simplify.
4112 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4113 * intervals.c (buffer_balance_intervals): New function.
4114 (graft_intervals_into_buffer): Adjust indentation.
4115 (set_intervals_multibyte): Simplify.
4116 * buffer.h (BUF_INTERVALS): Remove.
4117 (buffer_get_intervals, buffer_set_intervals): New function.
4118 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4119 * intervals.c, textprop.c: Adjust users.
4120
4121 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4122
4123 Inline functions to examine and change string intervals.
4124 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4125 (string_get_intervals, string_set_intervals): New function.
4126 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4127 * lread.c, print.c, textprop.c: Adjust users.
4128
4129 2012-08-08 Glenn Morris <rgm@gnu.org>
4130
4131 * lisp.mk (lisp): Remove language/persian.elc.
4132
4133 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4134
4135 Cleanup intervals.
4136 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4137 (NULL_INTERVAL_P): Likewise. Adjust users.
4138 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4139 Adjust comment. Move under #if 0.
4140 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4141 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4142
4143 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4144
4145 Check total length of intervals with eassert.
4146 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4147 * intervals.c: Change all users to eassert.
4148
4149 2012-08-07 Eli Zaretskii <eliz@gnu.org>
4150
4151 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4152 Rename fields to match removal of FGET and WGET and disuse of
4153 INTERNAL_FIELD in Lisp_Cons.
4154
4155 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4156
4157 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4158 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4159 name since all xname users are fixed long time ago. Do not
4160 use INTERNAL_FIELD.
4161 (set_symbol_name, set_symbol_function, set_symbol_plist):
4162 (set_symbol_next, set_overlay_plist): New function.
4163 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4164 (struct Lisp_Overlay): Likewise.
4165 (CVAR, MVAR, SVAR): Remove.
4166 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4167 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4168 * xterm.c: Adjust users.
4169 * .gdbinit: Change to use name field of struct Lisp_Symbol
4170 where appropriate.
4171
4172 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4173
4174 Basic functions to set Lisp_Object and pointer slots of intervals.
4175 * intervals.h (interval_set_parent, interval_set_object):
4176 (interval_set_left, interval_set_right, interval_set_plist):
4177 (interval_copy_parent): New function.
4178 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
4179 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4180 Adjust indentation.
4181 (INTERVAL_SIZE): Remove. Adjust users.
4182 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4183
4184 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4185
4186 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4187 * process.h (PGET): Remove.
4188 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4189 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4190
4191 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4192
4193 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4194 * window.h (WGET): Remove.
4195 (struct window): Do not use INTERNAL_FIELD.
4196 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4197 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4198 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4199 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4200 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4201 Adjust users.
4202
4203 2012-08-07 Chong Yidong <cyd@gnu.org>
4204
4205 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4206 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4207 (Fdelete_window_internal): Signal an error if the window is not on
4208 a live frame (Bug#12025).
4209
4210 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4211
4212 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4213 * frame.h (FGET): Remove.
4214 (struct frame): Do not use INTERNAL_FIELD.
4215 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4216 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4217 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4218 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4219
4220 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
4221
4222 * w32.c: Silence compiler warnings.
4223 (map_w32_filename): Remove unused variable `is_fat'.
4224 (chase_symlinks): Add parentheses around expression.
4225
4226 2012-08-06 Glenn Morris <rgm@gnu.org>
4227
4228 * sysdep.c: Respect BROKEN_GETWD.
4229
4230 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4231 Let configure handle it.
4232 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4233
4234 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4235
4236 Use GCALIGNMENT where appropriate.
4237 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4238 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4239 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4240
4241 2012-08-06 Eli Zaretskii <eliz@gnu.org>
4242
4243 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4244 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
4245
4246 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4247
4248 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4249 that should be sufficient for everyone.
4250
4251 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4252
4253 * keyboard.c (timer_check_2): Add break so timer_check returns next
4254 timeout.
4255
4256 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4257
4258 Fix Windows build errors introduced after converting to WGET and WSET.
4259 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4260 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4261
4262 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4263
4264 * nsterm.m (ns_frame_rehighlight): Use FSET.
4265
4266 * nsmenu.m (ns_update_menubar): Use FSET.
4267
4268 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4269
4270 Separate read and write access to Lisp_Object slots of Lisp_Process.
4271 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4272 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4273
4274 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4275
4276 Separate read and write access to Lisp_Object slots of struct window.
4277 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4278 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4279 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4280 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4281 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4282 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4283 Adjust users.
4284
4285 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4286
4287 Fix Windows build errors introduced after converting to FGET and FSET.
4288 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4289 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4290 (w32_judge_scroll_bars): Change to use FSET.
4291 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4292
4293 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4294
4295 Fix replacement typo.
4296 * window.c (replace_window): Set root_window instead of
4297 selected_window. This fixes a total window subsystem
4298 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4299
4300 2012-08-06 Glenn Morris <rgm@gnu.org>
4301
4302 * lisp.mk (lisp): Add language/persian.elc.
4303
4304 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4305
4306 Separate read and write access to Lisp_Object slots of struct frame.
4307 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4308 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4309 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4310 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4311 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4312
4313 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4314
4315 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4316
4317 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4318
4319 Generalize common compile-time constants.
4320 * lisp.h (header_size, bool_header_size, word_size): Now here.
4321 (struct Lisp_Vector): Add comment.
4322 (struct Lisp_Bool_Vector): Move up to define handy constants.
4323 (VECSIZE, PSEUDOVECSIZE): Simplify.
4324 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4325 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4326 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4327 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4328 * xfont.c, xmenu.c: Use word_size where appropriate.
4329
4330 2012-08-05 Lawrence Mitchell <wence@gmx.li>
4331
4332 * search.c (Freplace_match): Treat \? in the replacement text
4333 literally (Bug#8161).
4334
4335 2012-08-05 Chong Yidong <cyd@gnu.org>
4336
4337 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4338 * frame.c (Vdelete_frame_functions):
4339 * emacs.c (Vkill_emacs_hook): Doc fix.
4340
4341 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4342
4343 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4344 --with-x-toolkit=no builds.
4345 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4346
4347 2012-08-04 Chong Yidong <cyd@gnu.org>
4348
4349 * syntax.c (Fmodify_syntax_entry): Doc fix.
4350
4351 2012-08-04 Eli Zaretskii <eliz@gnu.org>
4352
4353 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4354 * w32.c (init_environment): Change the default values of many
4355 environment variables in dflt_envvars[] to NULL, to avoid pushing
4356 them into environment when they were not already defined.
4357 Remove the code that deletes site-lisp subdirectories from the default
4358 value of EMACSLOADPATH, as it is no longer needed.
4359 (check_windows_init_file): Now external, not static.
4360 Use Vload_path as is, without adding anything, as this function is now
4361 called when Vload_path is already set up.
4362
4363 * w32.h (check_windows_init_file): Add prototype.
4364
4365 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4366 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4367 compatibility with Posix platforms.
4368 (main): Move the call to check_windows_init_file to here from
4369 w32.c.
4370 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4371 any, in the DEFALT argument into the root of the Emacs build or
4372 installation tree, as appropriate.
4373
4374 * callproc.c (init_callproc_1): Call decode_env_path instead of
4375 doing its equivalent by hand.
4376 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4377 the code that sets Vexec_path run on MS-Windows.
4378
4379 * lread.c (init_lread): Add comments to #ifdef's.
4380
4381 * msdos.c (dos_set_window_size, IT_update_begin)
4382 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4383 instead of direct references.
4384
4385 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4386
4387 Export DEFAULT_REHASH_* to GDB.
4388 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4389 Now constants, not macros.
4390
4391 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4392
4393 Remove unnecessary casts involving pointers.
4394 These casts are no longer needed now that we assume C89 or later,
4395 since they involve casting to or from void *.
4396 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4397 (make_pure_float, make_pure_vector):
4398 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4399 * macros.c (Fstart_kbd_macro):
4400 * menu.c (find_and_return_menu_selection):
4401 * minibuf.c (read_minibuf_noninteractive):
4402 * sysdep.c (closedir):
4403 * xdisp.c (x_produce_glyphs):
4404 * xfaces.c (compare_fonts_by_sort_order):
4405 * xfns.c (x_real_positions, select_visual):
4406 * xselect.c (x_stop_queuing_selection_requests)
4407 (x_get_window_property, x_get_window_property_as_lisp_data):
4408 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4409 Remove unnecessary pointer casts.
4410 * alloc.c (record_xmalloc): New function.
4411 * lisp.h (record_xmalloc): New decl.
4412 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4413 more like a function. This is because the pointer cast is not
4414 needed. All uses changed.
4415 * print.c (print_string, print_error_message): Avoid length recalc.
4416
4417 Improve fix for macroexp crash with debugging (Bug#12118).
4418 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4419 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4420 not supposed to be invoked from the garbage collector.
4421 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4422 (gc_aset): New function, which is like ASET but can be
4423 used in the garbage collector.
4424 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4425 (set_hash_index): Use it instead of ASET.
4426
4427 2012-08-03 Eli Zaretskii <eliz@gnu.org>
4428
4429 Support symlinks on latest versions of MS-Windows.
4430 * w32.c: Include winioctl.h and aclapi.h.
4431 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4432 (revert_to_self): Forward declarations of static functions.
4433 <static BOOL g_b_init_get_security_info>:
4434 <g_b_init_create_symbolic_link>: New static flags.
4435 (globals_of_w32): Initialize them to zero.
4436 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4437 (map_w32_filename): Improve commentary. Simplify switch.
4438 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4439 headers (most versions of MinGW w32api don't).
4440 (get_security_info, create_symbolic_link)
4441 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4442 New functions.
4443 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4444 in the argument file name.
4445 (sys_access): Call unc_volume_file_attributes only if
4446 GetFileAttributes fails with network-related error codes.
4447 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4448 have the required privileges.
4449 (get_file_security_desc_by_name): Rename from
4450 get_file_security_desc.
4451 (stat_worker): New function, with most of the guts of 'stat', and
4452 with addition of handling of symlinks and support for 'lstat'.
4453 If possible, get file's attributes and security information by
4454 handle, not by name. Produce S_IFLNK bit for symlinks, when
4455 called from 'lstat'.
4456 (stat, lstat): New functions, call 'stat_worker'.
4457 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4458 symlinks when the underlying filesystem supports them.
4459
4460 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4461
4462 Fix macroexp crash on Windows with debugging (Bug#12118).
4463 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4464 checking subscripts; problem introduced with the recent
4465 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4466 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4467 since it's used in non-static inline functions now.
4468
4469 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4470 Don't assume buffer size fits in 'int'. Remove unused local.
4471
4472 Use C99-style 'extern inline' if available.
4473 * buffer.h (BUFFER_INLINE):
4474 * category.h (CATEGORY_INLINE):
4475 * character.h (CHARACTER_INLINE):
4476 * charset.h (CHARSET_INLINE):
4477 * composite.h (COMPOSITE_INLINE):
4478 * dispextern.h (DISPEXTERN_INLINE):
4479 * lisp.h (LISP_INLINE):
4480 * systime.h (SYSTIME_INLINE):
4481 New macro, replacing 'static inline' in this header.
4482 * buffer.h, category.h, character.h, charset.h, composite.h:
4483 * dispextern.h, lisp.h, systime.h:
4484 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4485 * alloc.c (LISP_INLINE):
4486 * buffer.c (BUFFER_INLINE):
4487 * category.c (CATEGORY_INLINE):
4488 * character.c (CHARACTER_INLINE):
4489 * charset.c (CHARSET_INLINE):
4490 * composite.c (COMPOSITE_INLINE):
4491 * dispnew.c (DISPEXTERN_INLINE):
4492 * sysdep.c (SYSTIME_INLINE):
4493 Define to EXTERN_INLINE, so that the corresponding functions
4494 are compiled into code.
4495 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4496 (INLINE_HEADER_END): New macros.
4497 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4498 since it's used in non-static inline functions now.
4499 (VALMASK) [!USE_LSB_TAG]: Likewise.
4500
4501 2012-08-02 Glenn Morris <rgm@gnu.org>
4502
4503 * s/: Remove empty directory.
4504
4505 * s/ms-w32.h: Move to ../nt/inc.
4506 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4507 Update for new ms-w32.h location.
4508
4509 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4510
4511 Port to Solaris 8.
4512 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4513
4514 2012-08-02 Glenn Morris <rgm@gnu.org>
4515
4516 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4517 hard-coding the path separator.
4518
4519 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4520
4521 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4522 This how ASET and AREF are supposed to work, and makes
4523 it easier to think about future improvements. See
4524 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4525 * charset.h (set_charset_attr): New function.
4526 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4527 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4528 (aref_addr): New function. All uses of &AREF(...) changed.
4529 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4530 (set_hash_index): New functions. All lvalue-style uses of
4531 HASH_KEY etc. changed.
4532 * keyboard.c (set_prop): New function. All lvalue-style uses
4533 of PROP changed.
4534
4535 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4536
4537 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4538 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
4539 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
4540 * nsfns.m (ns_set_name_as_filename): Likewise.
4541 * nsmenu.m (ns_update_menubar): Likewise.
4542 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4543
4544 2012-08-01 Eli Zaretskii <eliz@gnu.org>
4545
4546 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4547 Adapt to latest changes in field names of the corresponding Lisp
4548 objects.
4549
4550 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4551
4552 2012-08-01 Glenn Morris <rgm@gnu.org>
4553
4554 * s/msdos.h: Remove file.
4555 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4556 * Makefile.in (S_FILE): Remove.
4557 (config_h): Remove S_FILE.
4558
4559 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4560
4561 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
4562 Remove; moved to nt/config.nt.
4563
4564 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4565
4566 Use INTERNAL_FIELD for conses and overlays.
4567 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
4568 Remove obsolete comment.
4569 (MVAR): New macro.
4570 (struct Lisp_Overlay): Use INTERNAL_FIELD.
4571 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
4572
4573 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4574
4575 Use INTERNAL_FIELD for symbols.
4576 * lisp.h (SVAR): New macro. Adjust users.
4577 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
4578 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
4579
4580 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4581
4582 Use INTERNAL_FIELD for processes.
4583 * process.h (PVAR): New macro. Adjust style.
4584 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
4585 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
4586
4587 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
4588
4589 Use INTERNAL_FIELD for windows.
4590 * window.h (WVAR): New macro.
4591 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
4592 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4593 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4594 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
4595 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
4596 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4597
4598 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4599
4600 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
4601
4602 2012-08-01 Glenn Morris <rgm@gnu.org>
4603
4604 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
4605 Move to configure.ac.
4606
4607 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
4608
4609 * makefile.w32-in (CONFIG_H): Update dependencies.
4610 (CONF_POST_H): New macro.
4611
4612 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
4613
4614 2012-07-31 Glenn Morris <rgm@gnu.org>
4615
4616 * Makefile.in (S_FILE): No longer set by configure.
4617
4618 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
4619 is available.
4620 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
4621
4622 * process.h (NULL_DEVICE):
4623 * emacs.c (SEPCHAR):
4624 * editfns.c (USER_FULL_NAME): Let configure set them.
4625
4626 * s/README, s/template.h: Remove files.
4627
4628 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
4629
4630 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
4631 Move to configure.ac.
4632
4633 2012-07-31 Eli Zaretskii <eliz@gnu.org>
4634
4635 * .gdbinit (xframe): Adapt to introduction of FVAR and the
4636 resulting renaming of 'struct frame' members.
4637
4638 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
4639
4640 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
4641 after introduction of FVAR.
4642
4643 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4644
4645 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
4646
4647 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
4648 instead of compositeToPoint.
4649 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
4650
4651 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
4652
4653 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4654
4655 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
4656 * lisp.h (INTERNAL_FIELD): New macro.
4657 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
4658 (BVAR): Change to use INTERNAL_FIELD.
4659 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
4660 (KVAR): Change to use INTERNAL_FIELD.
4661 * frame.h (FVAR): New macro.
4662 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
4663 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
4664 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
4665 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4666 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
4667
4668 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
4669
4670 Miscellaneous fixes for non-default X toolkits.
4671 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
4672 * xterm.c (x_frame_of_widget): Remove redundant prototype.
4673 Move under #ifdef USE_LUCID.
4674 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
4675 definition and usage to avoid warnings.
4676
4677 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
4678
4679 * nsterm.m (openFiles): Fix previous checkin.
4680
4681 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
4682
4683 * indent.c (compute_motion): Remove unused local.
4684
4685 2012-07-31 Glenn Morris <rgm@gnu.org>
4686
4687 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
4688
4689 * conf_post.h [USG5_4]:
4690 Move remaining contents of s/usg5-4-common.h here.
4691 * s/usg5-4-common.h: Remove file.
4692
4693 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
4694 * s/irix6-5.h: Remove file.
4695
4696 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
4697 * s/darwin.h: Remove file.
4698
4699 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
4700 * s/hpux10-20.h: Remove file, which is now empty.
4701
4702 2012-07-30 Glenn Morris <rgm@gnu.org>
4703
4704 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
4705 * Makefile.in (config_h): Add conf_post.h.
4706 * makefile.w32-in (CONFIG_H): Add conf_post.h.
4707
4708 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
4709
4710 * nsterm.m (ns_do_open_file): New variable.
4711 (ns_term_init): Set ns_do_open_file to YES after run returns.
4712 (openFile, openTempFile, openFileWithoutUI, openFiles):
4713 Open files only if ns_do_open_file.
4714
4715 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4716
4717 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
4718 This no-op macro hasn't been needed for many years.
4719 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
4720
4721 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
4722 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
4723 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
4724 gdb_make_enums_visible.
4725 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
4726 (DIRECTORY_SEP): Now a constant, not a macro.
4727
4728 2012-07-30 Eli Zaretskii <eliz@gnu.org>
4729
4730 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
4731 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
4732
4733 * w32term.c <w32_keyboard_codepage>: Renamed from
4734 keyboard_codepage and now external. All users changed.
4735
4736 * w32term.h: Add declaration of w32_keyboard_codepage.
4737
4738 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
4739 the codepage to translate keys to Unicode. If this argument is
4740 -1, use the value returned by GetConsoleCP. All callers changed.
4741
4742 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4743
4744 Update .PHONY listings in makefiles.
4745 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
4746 bootstrap-clean, distclean, maintainer-clean, versioclean,
4747 extraclean, frc.
4748
4749 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
4750 This is a bit clearer. Fix some commentary typos.
4751
4752 2012-07-30 Glenn Morris <rgm@gnu.org>
4753
4754 * s/netbsd.h: Let configure include signal.h if needed.
4755 Remove file, which is now empty.
4756
4757 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
4758 Let configure set them.
4759 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
4760 No more need to undefine.
4761
4762 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
4763
4764 * keymap.c (Fkey_description): Don't remove 0x80 bit from
4765 non-single-byte char when adding meta modifier. (Bug#12090)
4766
4767 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4768
4769 Convert safe_call to use variable number of arguments.
4770 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
4771 (safe_call2): Fix comment.
4772 * lisp.h (safe_call): Adjust prototype.
4773 * coding.c (encode_coding_object): Change to use safe_call2.
4774 * xfaces.c (merge_face_heights): Change to use safe_call1.
4775
4776 2012-07-30 Glenn Morris <rgm@gnu.org>
4777
4778 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
4779 does that unconditionally. Remove file, which is now empty.
4780
4781 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
4782 Remove empty files.
4783
4784 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 Export to GDB most of lisp.h's remaining object-like macros.
4787 * lisp.h (min, max): Move earlier, because they're used earlier now.
4788 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
4789 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
4790 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
4791 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
4792 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
4793 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
4794 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
4795 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
4796 Now constants, for GDB. They need not be macros.
4797 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
4798 Now constants, for GDB, as well as macros, for static initializers.
4799 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
4800 Move to after the definition of struct Lisp_Char_Table,
4801 since the former now needs that type defined.
4802 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
4803 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
4804 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
4805 New enums, for gdb_make_enums_visible.
4806 (GLYPH_MODE_LINE_FACE): Remove; unused.
4807 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
4808 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
4809 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
4810 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
4811 enum maxargs, enum MAX_ALLOCA.
4812 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
4813 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
4814 no longer needed, now that they are done in lisp.h.
4815
4816 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
4817
4818 Cleanup string bytes checking.
4819 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
4820 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
4821 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
4822 (check_sblock, compact_small_strings): Simplify.
4823
4824 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4825
4826 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
4827 These macros are confusing and no longer need to be defined, as
4828 the enum values now suffice. All uses replaced with definiens.
4829 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
4830
4831 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
4832
4833 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
4834 ($(BLD)/w32console.$(O)): Update dependencies.
4835
4836 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4837
4838 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
4839 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
4840 time. Adjust users.
4841 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
4842
4843 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
4844
4845 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
4846 setting sitelisp (Bug#12010).
4847
4848 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4849
4850 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
4851
4852 * w32heap.c (cache_system_info):
4853 * w32.c (sys_rename):
4854 * w32proc.c (find_child_console, sys_kill): All users changed.
4855
4856 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4857
4858 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
4859
4860 2012-07-29 Eli Zaretskii <eliz@gnu.org>
4861
4862 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
4863
4864 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4865
4866 Cleanup statistics calculation in Fgarbage_collect.
4867 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
4868 Fix zombies percentage calculation. Simplify elapsed time calculation.
4869
4870 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
4871
4872 Generalize marker debugging code under MARKER_DEBUG and use eassert.
4873 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
4874 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
4875 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
4876 (replace_range, replace_range_2, del_range_2): Change to eassert.
4877 * marker.c (byte_char_debug_check): Adjust style.
4878
4879 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
4880
4881 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
4882 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
4883 long-ago-commented-out code that talks about "WIN32".
4884 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
4885 All uses changed.
4886
4887 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
4888
4889 Use Gnulib stdalign module (Bug#9772, Bug#9960).
4890 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
4891 Simplify by using alignof.
4892 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
4893 * lisp.h: Include <stdalign.h>.
4894 (GCALIGNMENT): New macro and constant.
4895 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
4896 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
4897 (stdalign): New macro, if not already defined.
4898
4899 2012-07-28 Eli Zaretskii <eliz@gnu.org>
4900
4901 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
4902 * w32inevt.c: Include w32inevt.h.
4903 (w32_read_console_input): New inline function, calls either
4904 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
4905 w32_console_unicode_input.
4906 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
4907 (w32_kbd_patch_key, key_event): Use the codepage returned by
4908 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
4909 (key_event): use uChar.UnicodeChar only if
4910 w32_console_unicode_input is non-zero.
4911
4912 * w32console.c: Include w32heap.h.
4913 <w32_console_unicode_input>: New global variable.
4914 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
4915 family of Windows, zero otherwise.
4916
4917 * w32inevt.h: Declare w32_console_unicode_input.
4918
4919 * xdisp.c (init_iterator): Don't reference tip_frame in a build
4920 --without-x. (Bug#11742)
4921
4922 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4923
4924 Adjust GDB to reflect pvec_type changes (Bug#12036).
4925 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
4926 2012-07-04 changes to pseudovector representation.
4927 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
4928
4929 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
4930
4931 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
4932 bus address.
4933 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
4934
4935 2012-07-27 Eli Zaretskii <eliz@gnu.org>
4936
4937 * alloc.c (listn): Fix the order the arguments are consed onto the
4938 list.
4939
4940 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
4941 enumeration constants, as PURE and HEAP are too general, and clash
4942 with other headers and sources, such as gmalloc.c and the
4943 MS-Windows system headers. All users changed.
4944
4945 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4946
4947 Revert last save_excursion_save and save_excursion_restore changes.
4948 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
4949 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
4950
4951 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4952
4953 Fix recently-introduced typos in Windows port.
4954 Reported by Martin Rudalics <rudalics@gmx.at>.
4955 * w32.c (init_environment): Replace comma with semicolon.
4956 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
4957
4958 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
4959
4960 Improve GDB symbol export (Bug#12036).
4961 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
4962 arms of an 'if', not using conditional expressions; otherwise GDB
4963 complains about the types in the unevaluated arm when the argument
4964 is an integer literal.
4965 (xgetint): Simplify expression.
4966 * alloc.c (gdb_make_enums_visible): New constant. This ports to
4967 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
4968 Zaretskii in <http://bugs.gnu.org/12036#13>.
4969 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
4970 needed now that we have gdb_make_enums_visible.
4971 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
4972 (enum enum_USE_LSB_TAG):
4973 New enum types, packaging up enums that need to be exported to GDB.
4974
4975 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4976
4977 Utility function to make a list from specified amount of objects.
4978 * lisp.h (enum constype): New datatype.
4979 (listn): New prototype.
4980 * alloc.c (listn): New function.
4981 (Fmemory_use_count, syms_of_alloc): Use it.
4982 * buffer.c (syms_of_buffer): Likewise.
4983 * callint.c (syms_of_callint): Likewise.
4984 * charset.c (define_charset_internal): Likewise.
4985 * coding.c (syms_of_coding): Likewise.
4986 * keymap.c (syms_of_keymap): Likewise.
4987 * search.c (syms_of_search): Likewise.
4988 * syntax.c (syms_of_syntax): Likewise.
4989 * w32.c (init_environment): Likewise.
4990 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
4991 * xdisp.c (syms_of_xdisp): Likewise.
4992 * xfns.c (syms_of_xfns): Likewise.
4993
4994 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
4995
4996 Fast save_excursion_save and save_excursion_restore.
4997 * lisp.h (struct Lisp_Excursion): New data type.
4998 (PVEC_EXCURSION): New pseudovector type.
4999 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5000 to deal with it. Adjust comments.
5001 (init_marker, attach_marker): New prototype.
5002 (unchain_marker): Adjust prototype.
5003 * marker.c (attach_marker): Change to global.
5004 (init_marker): New function.
5005 * alloc.c (Fmake_marker, build_marker): Use it.
5006 (build_marker): More easserts.
5007 (mark_object): Handle struct Lisp_Excursion.
5008 * editfns.c (save_excursion_save, save_excursion_restore):
5009 Reimplement to use struct Lisp_Excursion. Add comments.
5010
5011 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5012
5013 Fix export of symbols to GDB (Bug#12036).
5014 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5015 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5016 emacs.c, as this is a more-suitable home. Had this been done earlier
5017 the fix for 12036 would have avoided some of the problems noted in
5018 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5019 would have been more obvious.
5020 * emacs.c: Do not include <verify.h>; no longer needed.
5021 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5022 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5023 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5024 Remove; now done in lisp.h.
5025 * lisp.h (PUBLISH_TO_GDB): New macro.
5026 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5027 (DATA_SEG_BITS): Use it.
5028 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5029 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5030 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5031 not be usable in #if. This simplifies things.
5032
5033 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
5034
5035 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5036
5037 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5038
5039 Simplify export of symbols to GDB (Bug#12036).
5040 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5041 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5042 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5043 Adjust to changes in lisp.h and emacs.c, by using
5044 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5045 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5046 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5047 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5048 instead of gdb_valbits.
5049 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5050 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5051 instead of gdb_array_mark_flag.
5052 (xboolvector): Get size from $->size, not $->header.size.
5053 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5054 (xreload, hook-run, hookpost-run): Remove.
5055 * emacs.c: Include <verify.h>.
5056 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5057 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5058 Remove.
5059 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5060 (gdb_USE_LSB_TAG): New enum constants.
5061 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5062 Also define these as enum constants, so they're visible to GDB.
5063 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5064 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5065 as constants, so they're visible to GDB.
5066 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5067 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5068 Now enum constants, not macros, so they're visible to GDB.
5069 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5070 more convenient now. All uses changed.
5071 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5072 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5073
5074 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5075
5076 Explicitly free restriction data that are not needed anymore.
5077 * editfns.c (save_restriction_restore): Free restriction data.
5078
5079 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5080
5081 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5082 add argument, tune behavior, and adjust all callers.
5083
5084 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5085
5086 Use typedef for EMACS_INT, EMACS_UINT.
5087 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5088 than macros. This simplifies debugging in the usual case, since
5089 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5090 and it allows expressions involving EMACS_INT casts.
5091 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5092
5093 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5094
5095 * nsterm.m (ns_read_socket): Return early if there is a modal
5096 window (Bug#12043).
5097
5098 2012-07-25 Martin Rudalics <rudalics@gmx.at>
5099
5100 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5101 that FOCUS-FRAME can be omitted.
5102
5103 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5104
5105 Adjust buffer text indirection counters at the end of Fkill_buffer.
5106 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5107 buffer is definitely dead. This should really fix an issue reported
5108 by Christoph Scholtes again. (Bug#12007).
5109 (init_buffer_once): Initialize indirection counters of
5110 buffer_defaults and buffer_local_symbols (for sanity and safety).
5111
5112 2012-07-24 Eli Zaretskii <eliz@gnu.org>
5113
5114 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5115 and continuation glyphs on tooltip frames, leave them at zero.
5116 Avoids continued lines in tooltips. (Bug#11832)
5117
5118 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5119
5120 Simplify copy_overlay.
5121 * buffer.c (copy_overlay): Simplify. Use build_marker.
5122 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5123
5124 2012-07-23 Eli Zaretskii <eliz@gnu.org>
5125
5126 * print.c (print_object): Don't crash when a frame's name is nil
5127 or invalid. (Bug#12025)
5128
5129 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5130 it signals an error when a tooltip frame is being created.
5131
5132 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 Cleanup miscellaneous objects allocation and initialization.
5135 * alloc.c (allocate_misc): Change to static. Add argument to
5136 specify the subtype. Adjust comment and users.
5137 (build_overlay): New function.
5138 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5139 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5140 (allocate_misc): Remove prototype.
5141 (build_overlay): Add prototype.
5142
5143 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5144
5145 Swap buffer text indirection counters in Fbuffer_swap_text.
5146 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5147 This avoids crash reported by Christoph Scholtes at
5148 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5149
5150 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5151
5152 * nsmenu.m (Popdown_data): New struct.
5153 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5154 free Popdown_data.
5155 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5156 (initWithContentRect): Make imgView and contentView non-static
5157 and autorelease them. Also autorelease img and matrix (Bug#12005).
5158 (dealloc): Remove (Bug#12005).
5159
5160 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5161
5162 Adjust consing_since_gc when objects are explicitly freed.
5163 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5164 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5165 (free_cons, free_misc): Subtract object size from consing_since_gc.
5166
5167 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5168
5169 Simplify and cleanup markers positioning code.
5170 * marker.c (attach_marker): More useful eassert.
5171 (live_buffer, set_marker_internal): New function.
5172 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5173 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5174
5175 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5176
5177 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5178 as it's limited by the amount of memory, not by INT_MAX.
5179
5180 2012-07-21 Eli Zaretskii <eliz@gnu.org>
5181
5182 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5183 in special-event-map. See the discussion at
5184 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5185 for the reasons.
5186
5187 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
5188 info.dwItemData. Fixes crashes on 64-bit Windows.
5189 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
5190
5191 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5192
5193 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
5194 (conversationIdentifier): Return value is NSInteger.
5195 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
5196
5197 2012-07-21 Chong Yidong <cyd@gnu.org>
5198
5199 * window.c (decode_any_window): Signal an error if the window is
5200 on a dead frame (Bug#11984).
5201
5202 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5203
5204 Add indirection counting to speed up Fkill_buffer.
5205 * buffer.h (struct buffer): New member.
5206 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5207 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5208 base buffer indirection counter.
5209 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5210 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5211 through buffer list if indirection counter is 0.
5212
5213 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5214
5215 Extend the value returned by Fgarbage_collect with heap statistics.
5216 * alloc.c (Qheap): New symbol.
5217 (syms_of_alloc): DEFSYM it.
5218 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5219 (Fmemory_free): Remove.
5220 (syms_of_alloc): Don't defsubr it.
5221 * buffer.c (Fcompact_buffer): Remove.
5222 (syms_of_buffer): Don't defsubr it.
5223
5224 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5225
5226 Make maybe_gc inline.
5227 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5228 * lisp.h (consing_since_gc, gc_relative_threshold)
5229 (memory_full_cons_threshold): Revert declaration.
5230 (maybe_gc): Remove prototype, define as inline.
5231 * alloc.c: Remove old commented-out code.
5232 (consing_since_gc, gc_relative_threshold)
5233 (memory_full_cons_threshold): Revert to global.
5234 (maybe_gc): Remove.
5235
5236 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5237
5238 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5239 * lisp.h (build_unibyte_string): New function.
5240 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5241 * sysdep.c, w32fns.c, xfns.c: Use it.
5242 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5243 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5244 Adjust users accordingly.
5245 * font.h (font_open_by_name): Adjust prototype.
5246
5247 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5248
5249 Cleanup calls to Fgarbage_collect.
5250 * lisp.h (maybe_gc): New prototype.
5251 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5252 Remove declarations.
5253 * alloc.c (maybe_gc): New function.
5254 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5255 Make them static.
5256 * bytecode.c (MAYBE_GC): Use maybe_gc.
5257 * eval.c (eval_sub, Ffuncall): Likewise.
5258 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5259 to avoid dependency from auto-save feature.
5260
5261 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5262
5263 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5264 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5265 'for_each_per_buffer_object_at'.
5266 All uses changed. It's better to use upper-case for macros that
5267 cannot be implemented as functions, to give the reader a clue
5268 that they're special.
5269
5270 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5271
5272 * alloc.c (Fgarbage_collect): Tweak docstring.
5273
5274 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5275
5276 Tweak the value returned from Fgarbage_collect again.
5277 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5278 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5279 Adjust documentation.
5280 (total_vector_bytes): Rename to total_vector_slots, adjust
5281 accounting.
5282 (total_free_vector_bytes): Rename to total_free_vector_slots,
5283 adjust accounting.
5284 (Qstring_bytes, Qvector_slots): New symbols.
5285 (syms_of_alloc): DEFSYM them.
5286
5287 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5288
5289 Buffer compaction primitive which may be used from Lisp.
5290 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5291 (syms_of_buffer): Register Fcompact_buffer.
5292 * alloc.c (Fgarbage_collect): Use compact_buffer.
5293 * buffer.h (compact_buffer): New prototype.
5294 (struct buffer_text): New member.
5295
5296 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5297
5298 New macro to iterate over all buffers, miscellaneous cleanups.
5299 * lisp.h (all_buffers): Remove declaration.
5300 * buffer.h (all_buffers): Add declaration, with comment.
5301 (for_each_buffer): New macro.
5302 * alloc.c (Fgarbage_collect, mark_object): Use it.
5303 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5304 (init_buffer): Likewise.
5305 * data.c (Fset_default): Likewise.
5306 * coding.c (code_conversion_restore): Remove redundant check
5307 for dead buffer.
5308 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5309
5310 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5311
5312 Fix bug that created negative-length intervals.
5313 * intervals.c (merge_interval_right, merge_interval_left):
5314 Do not zero out this interval if it is absorbed by its children,
5315 as this interval's total length doesn't change in that case. See
5316 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5317
5318 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5319
5320 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5321 when invoking (make-bool-vector N t) and N is a positive
5322 multiple of 8 -- the last 8 bits were mistakenly cleared.
5323
5324 Remove some struct layout assumptions in bool vectors.
5325 * alloc.c (bool_header_size): New constant.
5326 (header_size, word_size): Move earlier, as they're now used earlier.
5327 Use 'word_size' in a few more places, where it's appropriate.
5328 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5329 padding before the data member of a bool vector.
5330 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5331 than doing the check by hand with an abort ().
5332
5333 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5334
5335 * eval.c (Fdefvar): Don't check constants since we only set the var if
5336 it's not yet defined anyway (bug#11904).
5337
5338 * lisp.h (last_undo_boundary): Declare new var.
5339 * keyboard.c (command_loop_1): Set it.
5340 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5341 were auto-added by the command loop (bug#11774).
5342
5343 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5344
5345 * w32font.c (Qsymbol): Remove local definition.
5346 (syms_of_w32font): Don't DEFSYM it.
5347
5348 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5349
5350 Fix sweep_vectors to handle large bool vectors correctly.
5351 * alloc.c (sweep_vectors): Account total_vector_bytes for
5352 bool vectors larger than VBLOCK_BYTES_MAX.
5353
5354 2012-07-18 Chong Yidong <cyd@gnu.org>
5355
5356 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5357 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5358
5359 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5360
5361 Return more descriptive data from Fgarbage_collect.
5362 Suggested by Stefan Monnier in
5363 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5364 * alloc.c (bounded_number): New function.
5365 (total_buffers, total_vectors): New variable.
5366 (total_string_size): Rename to total_string_bytes, adjust users.
5367 (total_vector_size): Rename to total_vector_bytes, adjust users.
5368 (sweep_vectors): Account total_vectors and total_vector_bytes.
5369 (Fgarbage_collect): New return value. Adjust documentation.
5370 (gc_sweep): Account total_buffers.
5371 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5372 (VECTOR_SIZE): Remove.
5373 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5374 (Qinterval, Qmisc): New symbols.
5375 (syms_of_data): Initialize them.
5376 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5377 (Qcons, Qbuffer): New declarations.
5378
5379 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5380
5381 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5382 Round up, not down. Improve doc.
5383
5384 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5385
5386 Restore old code in allocate_string_data to avoid Faset breakage.
5387 Reported by Julien Danjou <julien@danjou.info> in
5388 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5389 * alloc.c (allocate_string_data): Restore old code with minor
5390 adjustments, fix comment to explain this subtle issue.
5391
5392 2012-07-17 Eli Zaretskii <eliz@gnu.org>
5393
5394 Remove FILE_SYSTEM_CASE.
5395 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5396
5397 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5398 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5399 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5400 call-process-region passes it through expand-file-name.
5401
5402 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5403
5404 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5405
5406 Fix crash when creating indirect buffer (Bug#11917)
5407 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5408 Don't handle unbound variables specially if non-zero.
5409 (Fbuffer_local_variables): Pass zero.
5410 (clone_per_buffer_values): Pass non-zero.
5411
5412 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5413
5414 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5415 to make the loop interruptible.
5416
5417 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5418
5419 * gnutls.c (emacs_gnutls_handshake): Only retry if
5420 GNUTLS_E_INTERRUPTED.
5421
5422 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5423
5424 Cleanup and convert miscellaneous checks to eassert.
5425 * alloc.c (mark_interval): Fix comment, partially rephrase
5426 old comment from intervals.h (see below).
5427 * intervals.c (find_interval, adjust_intervals_for_insertion)
5428 (delete_interval, adjust_intervals_for_deletion)
5429 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5430 Convert to eassert.
5431 (adjust_intervals_for_insertion, make_new_interval):
5432 Remove obsolete and unused code.
5433 * intervals.h (struct interval): Remove obsolete comment.
5434 * textprotp.c (erase_properties): Remove unused code.
5435 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5436 (Fremove_list_of_text_properties): Convert to eassert.
5437
5438 2012-07-17 Chong Yidong <cyd@gnu.org>
5439
5440 * editfns.c (Finsert_char): Doc fix.
5441
5442 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5443
5444 Fix previous change to make Fmemory_free always accurate.
5445 * alloc.c (make_interval): Update total_free_intervals.
5446 (make_float): Likewise for total_free_floats.
5447 (free_cons, Fcons): Likewise for total_free_conses.
5448 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5449 Likewise for total_free_vector_bytes.
5450 (Fmake_symbol): Likewise for total_free_symbols.
5451 (bytes_free): Remove.
5452
5453 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5454
5455 Simple free memory accounting feature.
5456 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5457 (sweep_vectors): Accumulate size of free vectors.
5458 (Fgarbage_collect): Setup bytes_free.
5459 (Fmemory_free): New function.
5460 (syms_of_alloc): Register it.
5461
5462 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5463
5464 Cleanup overlays checking.
5465 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5466 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5467 eassert and OVERLAYP.
5468 (sort_overlays): Change to use OVERLAYP.
5469
5470 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5471
5472 * editfns.c (Finsert_char): Make it interactive, and make the
5473 second arg optional. Copy interactive spec and docstring from
5474 ucs-insert.
5475
5476 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5477
5478 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5479 Unlike the other wrapped functions, fabs has an unspecified
5480 effect on errno.
5481
5482 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5483
5484 * nsterm.m (keyDown): Interpret flags without left/right bits
5485 as the left key (Bug#11670).
5486
5487 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5488
5489 Remove empty and useless init functions.
5490 * lisp.h (init_character_once, init_fns, init_image)
5491 (init_filelock, init_sound): Remove prototype.
5492 * character.c (init_character_once): Remove.
5493 * filelock.c (init_filelock): Likewise.
5494 * fns.c (init_fns): Likewise.
5495 * image.c (init_image): Likewise.
5496 * sound.c (init_sound): Likewise.
5497 * emacs.c (main): Adjust accordingly.
5498
5499 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5500
5501 * gtkutil.h: Tiny cleanups.
5502 (use_old_gtk_file_dialog): Remove useless declaration.
5503 (xg_uses_old_file_dialog): Add suggested const attribute.
5504
5505 2012-07-15 Eli Zaretskii <eliz@gnu.org>
5506
5507 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5508 (bidi_paragraph_init): Use it to limit search forward for a strong
5509 directional character in abnormally large paragraphs full of
5510 neutral or weak characters. (Bug#11943)
5511
5512 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5513
5514 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5515 the toolbar (Bug#9451).
5516 (xg_make_tool_item): Give the widget event box a transparent
5517 background.
5518
5519 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5520
5521 Cleanup basic allocation variables and functions.
5522 * alloc.c (ignore_warnings, init_intervals, init_float)
5523 (init_cons, init_symbol, init_marker): Remove.
5524 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5525 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5526 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5527 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5528 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5529 (staticidx, init_alloc_once, init_strings, free_ablock):
5530 Remove redundant initialization.
5531 * fns.c (init_weak_hash_tables): Remove.
5532 * lisp.h (init_weak_hash_tables): Remove prototype.
5533
5534 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5535
5536 Use zero_vector where appropriate.
5537 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5538 accordingly.
5539 * lisp.h (zero_vector): New declaration.
5540 * font.c (null_vector): Remove.
5541 (syms_of_font): Remove initialization and staticpro.
5542 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5543 * keymap.c (Faccessible_keymaps): Likewise.
5544
5545 2012-07-15 Leo Liu <sdl.web@gmail.com>
5546
5547 * fringe.c: Fix typo in comments.
5548
5549 2012-07-14 Leo Liu <sdl.web@gmail.com>
5550
5551 * fringe.c: Add a new bitmap exclamation-mark.
5552
5553 2012-07-14 Eli Zaretskii <eliz@gnu.org>
5554
5555 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5556
5557 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5558 (HAVE_MENUS): Don't define, defined by editing config.in with
5559 msdos/sed2v2.inp.
5560 (GMALLOC_INHIBIT_VALLOC): Don't define.
5561 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
5562
5563 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
5564
5565 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
5566
5567 2012-07-14 Glenn Morris <rgm@gnu.org>
5568
5569 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
5570 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
5571 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
5572
5573 2012-07-13 Glenn Morris <rgm@gnu.org>
5574
5575 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
5576
5577 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
5578 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
5579
5580 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
5581
5582 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
5583 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
5584 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
5585 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
5586 where appropriate.
5587 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
5588 as boolean expression.
5589 (x_set_window_size): Remove unused variable toolbar.
5590 (ns_get_color_default, ns_mod_to_lisp): Remove.
5591 (ns_mouse_position): Remove unused variables xchar and ychar.
5592 (ns_compute_glyph_string_overhangs): Remove unused variable face.
5593 (ns_set_vertical_scroll_bar): Remove unused variable count.
5594 (ns_delete_terminal): Remove unused variable i.
5595 (ns_term_init): Remove unused variables r, g and b.
5596 (mouseDown): Remove unused variable window.
5597 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
5598 (initFrameFromEmacs): Remove unused variable vbextra.
5599 (mouseEntered): Remove unused variables p and dpyinfo.
5600 (mouseExited): Remove unused variables p and r.
5601 (ns_define_frame_cursor, ns_clear_frame_area)
5602 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
5603 (menuDown): Assign [sender tag] to variable and cast the variable.
5604
5605 * nsterm.h (menuDown): Add id as type to argument sender.
5606 (ns_display_info_for_name): Add Lisp_Object argument.
5607 (ns_term_init): Add Lisp_Object argument.
5608 (ns_map_event_to_object): Add void argument.
5609 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
5610 prototype with arguments and only declare if __OBJC__.
5611 (nxatoms_of_nsselect): Add void argument.
5612 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
5613 (ns_alloc_autorelease_pool): Add void argument.
5614 (ns_release_autorelease_pool): Add void* argument.
5615 (ns_get_defaults_value): Add const char* argument.
5616
5617 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
5618 (initFromContents): Use SSDATA where appropriate.
5619 (ns_update_menubar): Add braces to ambigous if-else.
5620 (initWithTitle): Put () around assignment in if statement.
5621 (ns_menu_show): Remove unused variables window and keymap.
5622 (update_frame_tool_bar): Remove unused variable selected_p.
5623 (initWithContentRect): Remove unused variable this_cmd_name.
5624
5625 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
5626 appropriate.
5627 (setXBMColor): Remove unused variable len.
5628 (setPixmapData): Put () around assignment in loop statement.
5629
5630 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
5631 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
5632 where appropriate.
5633 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
5634 around assignment in loop statement.
5635 (nsfont_open): Remove unused variable i.
5636 (nsfont_open): Remove unused variable len.
5637 (nsfont_draw): Remove unused variable cs.
5638
5639 * nsfns.m (x_set_icon_name, ns_set_name_internal)
5640 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
5641 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
5642 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
5643 (Fns_font_name, Fns_perform_service)
5644 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
5645 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
5646 (ns_set_name): Remove unused variable view.
5647 (x_set_menu_bar_lines): Remove unused variable olines.
5648 (x_set_tool_bar_lines): Remove unused variable root_window.
5649 (Fns_list_colors): Put () around assignment in while statement.
5650 (Fns_perform_service): Remove unused variable len.
5651 (Fns_display_usable_bounds): Remove unused variable top.
5652 (syms_of_nsfns): Remove unused variable i.
5653
5654 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
5655 memcpy (Bug#11907).
5656
5657 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
5658
5659 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
5660 and free it with DestroyExceptionInfo (Bug#11558).
5661
5662 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
5663
5664 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
5665 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
5666 Set here, not in nt/config.nt.
5667
5668 2012-07-13 Eli Zaretskii <eliz@gnu.org>
5669
5670 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
5671 cursor overflow into the last glyph on display line when the right
5672 fringe is off. (Bug#11832)
5673
5674 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
5675
5676 * xdisp.c (produce_special_glyphs): Now static.
5677 * dispextern.h (produce_special_glyphs): Remove decl.
5678
5679 2012-07-13 Glenn Morris <rgm@gnu.org>
5680
5681 * s/bsd-common.h, s/cygwin.h: Remove empty files.
5682 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
5683
5684 * s/usg5-4-common.h (USG, USG5):
5685 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
5686 * s/sol2-6.h (SOLARIS2):
5687 * s/irix6-5.h (IRIX6_5):
5688 * s/hpux10-20.h (USG, USG5, HPUX):
5689 * s/gnu-linux.h (USG, GNU_LINUX):
5690 * s/freebsd.h (BSD_SYSTEM):
5691 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
5692 * s/cygwin.h (CYGWIN):
5693 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
5694 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
5695
5696 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
5697
5698 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
5699
5700 2012-07-13 Glenn Morris <rgm@gnu.org>
5701
5702 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
5703
5704 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
5705
5706 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
5707 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
5708
5709 2012-07-12 Glenn Morris <rgm@gnu.org>
5710
5711 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
5712
5713 * process.c (init_process_emacs): Rename from init_process.
5714 The old name is also the name of a Mach system call.
5715 * lisp.h, emacs.c: Update for this name change.
5716 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
5717 longer needed.
5718
5719 2012-07-12 Eli Zaretskii <eliz@gnu.org>
5720
5721 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
5722 memmove call that removes glyphs covered by the left truncation
5723 glyph. Improve commentary.
5724 (display_line): Fix display of continuation glyphs on GUI frames
5725 when the right fringe is turned off and variable-size fonts are
5726 used in the window. Move the code that appends a stretch glyph to
5727 produce_special_glyphs, so that it could be used for truncation
5728 and continuation glyphs alike.
5729 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
5730 glyph of a suitably computed width, to align the special glyphs at
5731 the window margin. Code moved from display_line. (Bug#11832)
5732
5733 2012-07-12 Glenn Morris <rgm@gnu.org>
5734
5735 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
5736
5737 * s/gnu-linux.h, s/hpux10-20.h:
5738 Do not unconditionally define HAVE_XRMSETDATABASE.
5739
5740 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
5741
5742 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
5743
5744 Fix typos that broke OS X build.
5745 Reported by Randal L. Schwartz in
5746 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
5747 * nsterm.m (ns_timeout): Add missing local decl.
5748 (ns_get_color): snprintf -> sprintf, to fix typo.
5749
5750 2012-07-12 Glenn Morris <rgm@gnu.org>
5751
5752 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
5753 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
5754 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
5755 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
5756
5757 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
5758 Move PTY_OPEN to configure.
5759
5760 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5761 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
5762 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
5763
5764 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
5765
5766 Use empty_unibyte_string where applicable.
5767 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
5768 * lread.c (read1): Likewise.
5769 * xsettings.c (syms_of_xsettings): Likewise.
5770
5771 2012-07-12 Glenn Morris <rgm@gnu.org>
5772
5773 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
5774 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
5775 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
5776 * s/hpux10-20.h (RUN_TIME_REMAP):
5777 * s/bsd-common.h (TABDLY): Move to configure.
5778
5779 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
5780
5781 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
5782
5783 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5784 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
5785
5786 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
5787
5788 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
5789 * s/template.h: Move NARROWPROTO to configure.
5790
5791 2012-07-11 Glenn Morris <rgm@gnu.org>
5792
5793 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
5794 unused since 2011-01-17 change to systty.h.
5795
5796 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
5797 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5798 Move HAVE_PTYS and HAVE_SOCKETS to configure.
5799
5800 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5801
5802 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
5803
5804 2012-07-11 Glenn Morris <rgm@gnu.org>
5805
5806 * s/darwin.h, s/gnu-linux.h, s/template.h:
5807 Move INTERRUPT_INPUT to configure.
5808
5809 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5810
5811 Minor adjustments to interning code.
5812 * lisp.h (intern, intern_c_string): Redefine as static inline
5813 wrappers for intern_1 and intern_c_string_1, respectively.
5814 (intern_1, intern_c_string_1): Rename prototypes.
5815 * lread.c (intern_1, intern_c_string_1, oblookup):
5816 Simplify Vobarray checking.
5817 * font.c (font_intern_prop): Likewise. Adjust comment.
5818 * w32font.c (intern_font_name): Likewise.
5819
5820 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
5821
5822 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
5823
5824 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
5825 of Fcar/Fcdr if possible.
5826 * font.c (check_otf_features): Likewise.
5827 * fontset.c (Fnew_fontset): Likewise.
5828 * gnutls.c (Fgnutls_boot): Likewise.
5829 * minibuf.c (read_minibuf): Likewise.
5830 * msdos.c (IT_set_frame_parameters): Likewise.
5831 * xmenu.c (Fx_popup_dialog): Likewise.
5832 * w32menu.c (Fx_popup_dialog): Likewise.
5833
5834 2012-07-11 Glenn Morris <rgm@gnu.org>
5835
5836 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
5837 since nothing has defined it on these platforms.
5838
5839 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
5840 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
5841
5842 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
5843 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
5844 Move CLASH_DETECTION to configure.
5845
5846 * s/gnu.h: Remove file, which is now empty.
5847
5848 * s/gnu.h, s/gnu-linux.h:
5849 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
5850
5851 2012-07-11 John Wiegley <johnw@newartisans.com>
5852
5853 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
5854 function attribute, so we only use it if it exists in the
5855 compiler.
5856
5857 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5858
5859 Avoid call to strlen in fast_c_string_match_ignore_case.
5860 * search.c (fast_c_string_match_ignore_case): Change to use
5861 length argument. Adjust users accordingly.
5862 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
5863
5864 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
5865
5866 Assume mkdir, rmdir.
5867 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
5868 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
5869
5870 Assume rename.
5871 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
5872
5873 Assume perror.
5874 * s/hpux10-20.h (HAVE_PERROR): Remove.
5875 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
5876 Remove dummy definition, as this problem was obsolete long ago.
5877
5878 Assume strerror.
5879 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
5880
5881 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
5882
5883 Avoid calls to strlen in font processing functions.
5884 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
5885 (font_open_by_name): Change to use length argument.
5886 Adjust users accordingly.
5887 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
5888 Adjust prototypes.
5889 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
5890 Change to return ptrdiff_t.
5891 (xfont_list_pattern, xfont_match): Use length returned by
5892 xfont_decode_coding_xlfd.
5893 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
5894
5895 2012-07-11 Glenn Morris <rgm@gnu.org>
5896
5897 * s/darwin.h, s/freebsd.h, s/netbsd.h:
5898 Move DONT_REOPEN_PTY to configure.
5899
5900 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
5901 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
5902
5903 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
5904
5905 Remove "#define unix" that is no longer needed (Bug#11905).
5906 * s/aix4-2.h (unix): Remove; no longer needed.
5907
5908 EMACS_TIME simplification (Bug#11875).
5909 This replaces macros (which typically do not work in GDB)
5910 with functions, typedefs and enums, making the code easier to debug.
5911 The functional style also makes code easier to read and maintain.
5912 * systime.h: Include <sys/time.h> on all hosts, not just if
5913 WINDOWSNT, since 'struct timeval' is needed in general.
5914 (EMACS_TIME): Now a typedef, not a macro.
5915 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
5916 not macros.
5917 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
5918 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
5919 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
5920 (EMACS_TIME_LE): Now functions, not macros.
5921 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
5922 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
5923 which are not functions. All uses rewritten to use:
5924 (make_emacs_time): New function.
5925 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
5926 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
5927 not functions. All uses rewritten to use the following, respectively:
5928 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
5929 (add_emacs_time, sub_emacs_time): New functions.
5930 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
5931 * fileio.c (Fcopy_file):
5932 * xterm.c (XTflash): Get the current time closer to when it's used.
5933 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
5934
5935 * bytecode.c (targets): Suppress -Woverride-init warnings.
5936
5937 Simplify by avoiding confusing use of strncpy etc.
5938 * doc.c (Fsnarf_documentation):
5939 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
5940 * frame.c (Fmake_terminal_frame):
5941 * gtkutil.c (get_utf8_string):
5942 * lread.c (openp):
5943 * nsmenu.m (ns_update_menubar):
5944 * regex.c (regerror):
5945 Prefer memcpy to strncpy and strncat when either will do.
5946 * fileio.c (Fsubstitute_in_file_name):
5947 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
5948 (menu_separator_name_p):
5949 * nsmenu.m (ns_update_menubar):
5950 Prefer memcmp to strncmp when either will do.
5951 * nsterm.m: Include <ftoastr.h>.
5952 (ns_get_color):
5953 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
5954 Prefer snprintf to strncpy.
5955 * nsterm.m (ns_term_init):
5956 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
5957 * nsterm.m (ns_term_init):
5958 Avoid the need for strncpy, by using build_string or
5959 make_unibyte_string directly. Use dtoastr, not snprintf.
5960 * process.c (Fmake_network_process): Diagnose service names that
5961 are too long, rather than silently truncating them or creating
5962 non-null-terminated names.
5963 (Fnetwork_interface_info): Likewise, for interface names.
5964 * sysdep.c (system_process_attributes) [GNU_LINUX]:
5965 Prefer sprintf to strncat.
5966 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
5967 Prefer vsnprintf to vsprintf + strncpy.
5968
5969 2012-07-10 Glenn Morris <rgm@gnu.org>
5970
5971 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
5972 Clarify fallback case.
5973
5974 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5975
5976 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
5977 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
5978 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
5979 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
5980 where argument type is known to be a Lisp_Cons.
5981
5982 2012-07-10 Tom Tromey <tromey@redhat.com>
5983
5984 * bytecode.c (BYTE_CODE_THREADED): New macro.
5985 (BYTE_CODES): New macro. Replaces all old byte-code defines.
5986 (enum byte_code_op): New type.
5987 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
5988 (exec_byte_code): Use them. Use token threading when applicable.
5989
5990 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
5991
5992 Optimize pure C strings initialization.
5993 * lisp.h (make_pure_string): Fix prototype.
5994 (build_pure_c_string): New function, defined as static inline. This
5995 provides a better opportunity to optimize away calls to strlen when
5996 the function is called with compile-time constant argument.
5997 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
5998 argument, adjust users accordingly. Use build_pure_c_string where
5999 appropriate.
6000 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6001 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6002 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6003
6004 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6005
6006 Avoid calls to strlen in miscellaneous functions.
6007 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6008 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6009 * lread.c (openp): Likewise.
6010
6011 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6012
6013 Avoid calls to strlen in path processing functions.
6014 * fileio.c (file_name_as_directory): Add comment. Change to add
6015 srclen argument and return the length of result. Adjust users
6016 accordingly.
6017 (directory_file_name): Fix comment. Change to add srclen argument,
6018 swap 1st and 2nd arguments to obey the common convention.
6019 Adjust users accordingly.
6020 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6021
6022 2012-07-10 Glenn Morris <rgm@gnu.org>
6023
6024 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6025 Move PENDING_OUTPUT_COUNT definition to configure.
6026
6027 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6028 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6029 * s/gnu.h (DATA_START): Move definitions to configure.
6030
6031 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6032 We include usg5-4-common.h, which defines them both.
6033
6034 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6035 O_RDONLY already includes it).
6036
6037 Stop ns builds setting the EMACSLOADPATH environment variable.
6038 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6039 Now it does not set EMACSLOADPATH, just returns the load-path string.
6040 * nsterm.h: Update accordingly.
6041 * lread.c [HAVE_NS]: Include nsterm.h.
6042 (init_lread) [HAVE_NS]: Use ns_load_path.
6043 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6044
6045 2012-07-09 Glenn Morris <rgm@gnu.org>
6046
6047 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6048 since the included bsd-common.h does so.
6049
6050 Stop ns builds setting the EMACSPATH environment variable.
6051 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6052 (ns_init_paths): Do not set EMACSPATH.
6053 * nsterm.h (ns_exec_path): Add it.
6054 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6055 Use ns_exec_path.
6056
6057 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6058
6059 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6060
6061 * process.c (wait_reading_process_output): 'waitchannels' was unset
6062 when read_kbd || !NILP (wait_for_cell); fix this.
6063
6064 Add GCC-style 'const' attribute to functions that can use it.
6065 * character.h (char_resolve_modifier_mask):
6066 * keyboard.h (make_ctrl_char):
6067 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6068 (init_character_once, next_almost_prime, init_fns, init_image)
6069 (flush_pending_output, init_sound):
6070 * mem-limits.h (start_of_data):
6071 * menu.h (finish_menu_items):
6072 Add ATTRIBUTE_CONST.
6073 * emacs.c (DEFINE_DUMMY_FUNCTION):
6074 Declare the dummy function with ATTRIBUTE_CONST.
6075 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6076 Add decls with ATTRIBUTE_CONST.
6077
6078 Minor improvements to make_formatted_string.
6079 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6080 where int is good enough, as vsprintf returns an int.
6081 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6082
6083 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6084
6085 Use make_formatted_string to avoid double length calculation.
6086 * lisp.h (make_formatted_string): New prototype.
6087 * alloc.c (make_formatted_string): New function.
6088 * buffer.c (Fgenerate_new_buffer_name): Use it.
6089 * dbusbind.c (syms_of_dbusbind): Likewise.
6090 * editfns.c (Fcurrent_time_zone): Likewise.
6091 * filelock.c (get_boot_time): Likewise.
6092 * frame.c (make_terminal_frame, set_term_frame_name)
6093 (x_report_frame_params): Likewise.
6094 * image.c (gs_load): Likewise.
6095 * minibuf.c (get_minibuffer): Likewise.
6096 * msdos.c (dos_set_window_size): Likewise.
6097 * process.c (make_process): Likewise.
6098 * xdisp.c (ensure_echo_area_buffers): Likewise.
6099 * xsettings.c (apply_xft_settings): Likewise.
6100
6101 2012-07-09 Glenn Morris <rgm@gnu.org>
6102
6103 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6104 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6105 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6106 * nsterm.h (ns_etc_directory): Add it.
6107 * callproc.c [HAVE_NS]: Include nsterm.h.
6108 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6109
6110 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6111
6112 Move marker debugging code under MARKER_DEBUG.
6113 * marker.c (MARKER_DEBUG): Move marker debugging code under
6114 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6115 for bootstrap with --enable-checking (~3x slowdown reported
6116 by Juanma Barranquero <lekktu@gmail.com>).
6117 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6118
6119 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6122 See <http://bugs.gnu.org/11825#29>.
6123
6124 2012-07-08 Eli Zaretskii <eliz@gnu.org>
6125
6126 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6127 has no font, use the frame's font. (Bug#11813)
6128 (display_line): Add commentary about displaying truncation glyphs
6129 on GUI frames.
6130 (produce_special_glyphs): Move here from term.c.
6131
6132 * term.c (produce_special_glyphs): Move to xdisp.c.
6133
6134 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6135 section.
6136
6137 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6138
6139 * xdisp.c (display_line): Avoid warning about implicit declaration
6140 of FRAME_FONT.
6141
6142 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6143
6144 * lisp.h: Remove empty conditional.
6145
6146 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6147
6148 * lread.c (load_path_check): Now static.
6149
6150 Fix some minor --with-ns problems found by static checking.
6151 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6152 (x_set_font) [!HAVE_X_WINDOWS]:
6153 * image.c (xpm_load_image) [HAVE_NS]:
6154 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6155 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6156 Remove unused local.
6157 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6158 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6159 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6160 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6161 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6162 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6163 Fix pointer signedness problem.
6164 * xfaces.c (FRAME_X_FONT_TABLE):
6165 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6166
6167 2012-07-07 Glenn Morris <rgm@gnu.org>
6168
6169 * lread.c (load_path_check): New function, split from init_lread.
6170 (init_lread): Reorganize. Motivation:
6171 If EMACSLOADPATH is set, check/warn about that rather than the
6172 defaults, which we are not going to use. Hence we can remove
6173 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6174 Don't warn if site-lisp directories are missing.
6175 If not installed, start from a blank load-path, since
6176 PATH_LOADSEARCH refers to the eventual installation directories.
6177
6178 2012-07-07 Eli Zaretskii <eliz@gnu.org>
6179
6180 Support truncation and continuation glyphs on GUI frames, when
6181 fringes are disabled. (Bug#11832)
6182 * xdisp.c (init_iterator): Get dimensions of truncation and
6183 continuation glyphs even if on GUI frames.
6184 Adjust it->last_visible_x on GUI frames when the left or right fringes,
6185 or both, are absent.
6186 (start_display, move_it_in_display_line_to): Handle the case of a
6187 GUI frame without a fringe to display continuation or truncation
6188 glyphs.
6189 (insert_left_trunc_glyphs): Support GUI frames: make sure
6190 truncation glyphs overwrite enough glyphs from the current line to
6191 have sufficient space in pixels.
6192 (display_line): Support truncation and continuation glyphs on GUI
6193 frames. If some spare pixels are left on the line after inserting
6194 the truncation glyphs, fill that space with a stretch glyph of a
6195 suitably computed width.
6196
6197 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6198 produce_glyphs, to support GUI sessions.
6199
6200 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6201
6202 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6203
6204 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6205
6206 Do not require float-time's arg to fit in time_t (Bug#11825).
6207 This works better on hosts where time_t is unsigned, and where
6208 float-time is applied to the (negative) difference between two times.
6209 * editfns.c (decode_time_components): Last arg is now double *,
6210 not int *, and means to store all the result as a double, without
6211 worrying about whether the seconds part fits in time_t.
6212 All callers changed.
6213 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6214 All callers changed.
6215 (Ffloat_time): Do not fail merely because the specified time falls
6216 outside of time_t range.
6217
6218 2012-07-07 Glenn Morris <rgm@gnu.org>
6219
6220 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6221 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6222 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6223
6224 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
6225
6226 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6227 Update dependencies.
6228
6229 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6230
6231 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6232
6233 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6234 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6235 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6236 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6237 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6238 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6239
6240 * xfont.c (compare_font_names): Redo to omit the need for casts.
6241
6242 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6243
6244 * xfns.c (Fx_change_window_property): Doc fix.
6245 * w32fns.c (Fx_change_window_property): Doc fix.
6246
6247 * w32fns.c (Fx_window_property): Accept the same arguments as the
6248 X Windows version. Doc fix.
6249 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6250
6251 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
6252 Eli Zaretskii <eliz@gnu.org>
6253
6254 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6255 Windows-specific code from nt/config.nt moved here.
6256 Obsolete settings removed.
6257
6258 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6259
6260 * process.c: Avoid unnecessary calls to gettime.
6261 (wait_reading_process_output): Don't get the time of day
6262 when gobbling data immediately and not waiting, as there's no need
6263 for it in that case. This removes a FIXME.
6264
6265 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6266
6267 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6268 is defined (Bug#11768).
6269
6270 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6271
6272 Fix marker debugging code.
6273 * marker.c (byte_char_debug_check): Do not perform the check
6274 if buffer is not multibyte.
6275 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6276 Call byte_char_debug_check with correct arguments.
6277
6278 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6279
6280 Compile marker debugging code only if ENABLE_CHECKING is defined.
6281 * marker.c (byte_char_debug_check, count_markers):
6282 Use only if ENABLE_CHECKING is defined.
6283 (byte_debug_flag): Remove.
6284 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6285 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6286
6287 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6288
6289 Avoid code repetition in marker-related functions.
6290 * marker.c (attach_marker): New function.
6291 (Fset_marker, set_marker_restricted, set_marker_both)
6292 (set_marker_restricted_both): Use it.
6293 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6294 Consistently rename charno to charpos.
6295 (marker_position): Add eassert.
6296 (marker_byte_position): Convert to eassert.
6297
6298 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6299
6300 Simplify list operations in unchain_overlay and unchain_marker.
6301 * buffer.c (unchain_overlay): Simplify. Add comment.
6302 * marker.c (unchain_marker): Simplify. Fix comments.
6303
6304 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6305
6306 Introduce fast path for the widely used marker operation.
6307 * alloc.c (build_marker): New function.
6308 * lisp.h (build_marker): New prototype.
6309 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6310 * composite.c (autocmp_chars): Likewise.
6311 * editfns.c (buildmark): Remove.
6312 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6313 (save_restriction_save): Use build_marker.
6314 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6315 * window.c (save_window_save): Likewise.
6316
6317 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6318
6319 Do not use Fdelete_overlay in delete_all_overlays
6320 to avoid redundant calls to unchain_overlay.
6321 * buffer.c (drop_overlay): New function.
6322 (delete_all_overlays, Fdelete_overlay): Use it.
6323 * minibuf.c (get_minibuffer): Fix comment.
6324
6325 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6326
6327 Port to OpenBSD 5.1 amd64.
6328 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6329 This is needed for OpenBSD, and should be harmless on all BSD systems.
6330 Also, include <sys/sysctl.h>, as it should be available on all
6331 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6332 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6333 use p_pid member, not kp_proc.pid.
6334
6335 2012-07-06 Glenn Morris <rgm@gnu.org>
6336
6337 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6338
6339 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6340
6341 More xmalloc and related cleanup.
6342 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6343 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6344 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6345 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6346 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6347 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6348 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6349 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6350 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6351 * xterm.c:
6352 Omit needless casts involving void * pointers and allocation.
6353 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6354 as the former is more robust if P's type is changed.
6355 Prefer xzalloc to xmalloc + memset 0.
6356 Simplify malloc-or-realloc to realloc.
6357 Don't worry about xmalloc returning a null pointer.
6358 Prefer xstrdup to xmalloc + strcpy.
6359 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6360 growing it.
6361 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6362 alloca of a constant.
6363
6364 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6365
6366 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6367 hscroll is larger than the line width. Fixes long and futile
6368 looping inside extend_face_to_end_of_line (on a TTY) producing
6369 glyphs that are not needed and thrown away.
6370
6371 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6372
6373 * marker.c (set_marker_restricted_both): Simplify by using
6374 clip_to_bounds.
6375
6376 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6377
6378 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6379
6380 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6381
6382 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6383 not defined (Bug#11768).
6384 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6385 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6386 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6387 followed by gtk_box_set_homogeneous (Bug#11768).
6388 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
6389 (update_theme_scrollbar_width, xg_create_scroll_bar):
6390 Use gtk_scrollbar_new (Bug#11768).
6391 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6392 (is_box_type): New function (Bug#11768).
6393 (xg_tool_item_stale_p): Call is_box_type.
6394 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
6395 with default display (Bug#11768).
6396
6397 2012-07-05 Eli Zaretskii <eliz@gnu.org>
6398
6399 * xdisp.c (window_hscroll_limited): New function.
6400 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6401 coordinates when window's hscroll is set to insanely large
6402 values. (Bug#11857)
6403
6404 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
6405
6406 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6407 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6408
6409 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6410
6411 Cleanup xmalloc.
6412 * lisp.h (xzalloc): New prototype. Omit needless casts.
6413 * alloc.c (xzalloc): New function. Omit needless casts.
6414 * charset.c: Omit needless casts. Convert all calls to
6415 xmalloc with following memset to xzalloc.
6416 * dispnew.c: Likewise.
6417 * fringe.c: Likewise.
6418 * image.c: Likewise.
6419 * sound.c: Likewise.
6420 * term.c: Likewise.
6421 * w32fns.c: Likewise.
6422 * w32font.c: Likewise.
6423 * w32term.c: Likewise.
6424 * xfaces.c: Likewise.
6425 * xfns.c: Likewise.
6426 * xterm.c: Likewise.
6427 * atimer.c: Omit needless casts.
6428 * buffer.c: Likewise.
6429 * callproc.c: Likewise.
6430 * ccl.c: Likewise.
6431 * coding.c: Likewise.
6432 * composite.c: Likewise.
6433 * doc.c: Likewise.
6434 * doprnt.c: Likewise.
6435 * editfns.c: Likewise.
6436 * emacs.c: Likewise.
6437 * eval.c: Likewise.
6438 * filelock.c: Likewise.
6439 * fns.c: Likewise.
6440 * gtkutil.c: Likewise.
6441 * keyboard.c: Likewise.
6442 * lisp.h: Likewise.
6443 * lread.c: Likewise.
6444 * minibuf.c: Likewise.
6445 * msdos.c: Likewise.
6446 * print.c: Likewise.
6447 * process.c: Likewise.
6448 * region-cache.c: Likewise.
6449 * search.c: Likewise.
6450 * sysdep.c: Likewise.
6451 * termcap.c: Likewise.
6452 * terminal.c: Likewise.
6453 * tparam.c: Likewise.
6454 * w16select.c: Likewise.
6455 * w32.c: Likewise.
6456 * w32reg.c: Likewise.
6457 * w32select.c: Likewise.
6458 * w32uniscribe.c: Likewise.
6459 * widget.c: Likewise.
6460 * xdisp.c: Likewise.
6461 * xmenu.c: Likewise.
6462 * xrdb.c: Likewise.
6463 * xselect.c: Likewise.
6464
6465 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6466
6467 * fileio.c (time_error_value): Check the right error number.
6468 Problem reported by Troels Nielsen in
6469 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6470
6471 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6474 This should be fixed in a better way; see Eli Zaretskii in
6475 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6476 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6477
6478 * fileio.c (time_error_value): Rename from special_mtime.
6479 The old name's problems were noted by Eli Zaretskii in
6480 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6481
6482 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6483 This variable's comment says Emacs needs at least one GDB-visible
6484 symbol of type enum pvec_type, to work around GDB problems.
6485 The symbol's value doesn't matter.
6486
6487 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6488 that causes compilation to fail on pre-C99 compilers.
6489
6490 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
6491
6492 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6493 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6494
6495 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6496
6497 * buffer.c (init_buffer_once): Fix initialization of
6498 headers for buffer_defaults and buffer_local_symbols.
6499 Reported by Juanma Barranquero <lekktu@gmail.com>.
6500
6501 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6502
6503 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6504 * lisp.h (enum pvec_type): Use fewer bits.
6505 (PSEUDOVECTOR_SIZE_BITS): New constant.
6506 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6507 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6508 change in pvec_type.
6509 (PSEUDOVECTOR_TYPEP): New macro.
6510 (TYPED_PSEUDOVECTORP): Use it.
6511 * fns.c (internal_equal): Adapt code to extract pvectype.
6512 * emacs.c (gdb_pvec_type): Update type.
6513 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6514 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6515 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6516 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6517 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6518 abusing vector->header.next.nbytes.
6519 (live_vector_p): Use PVEC_TYPE.
6520 (mark_object): Adapt code to extract pvectype. Use switch.
6521
6522 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6523
6524 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6525 Tighten new eassert a bit.
6526
6527 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6528
6529 Fix compilation with --enable-gcc-warnings and -O1
6530 optimization level.
6531 * doprnt.c (doprnt): Change type of tem to int, initialize
6532 to avoid compiler warning. Add eassert.
6533 * search.c (simple_search): Initialize match_byte to avoid
6534 compiler warning. Add eassert.
6535
6536 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6537
6538 Avoid weird behavior with large horizontal scrolls.
6539 Without this change, for example, large hscroll values would
6540 mess up Emacs's display on Fedora 15 x86, presumably due to
6541 overflows in int calculations in the display code.
6542 Also, if buffers had long lines, Emacs would freeze.
6543 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6544 (set_window_hscroll): New function, containing the old guts of
6545 Fset_window_hscroll. Return the clipped value.
6546 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6547 This avoids the need to check against PTRDIFF_MAX.
6548
6549 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6550
6551 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6552
6553 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6554
6555 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6558 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6559 since GCC 4.4.6 issues a bogus warning for them.
6560
6561 Fix bugs in file timestamp newness comparisons.
6562 * fileio.c (Ffile_newer_than_file_p):
6563 * lread.c (Fload): Use full timestamp resolution of files,
6564 not just the 1-second resolution, so that files that are only
6565 slightly newer still count as newer.
6566 * fileio.c (Ffile_newer_than_file_p): Don't assume file
6567 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
6568
6569 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * fileio.c: Improve handling of file time marker. (Bug#11852)
6572 (special_mtime): New function.
6573 (Finsert_file_contents, Fverify_visited_file_modtime):
6574 Use it to set special mtime values consistently.
6575
6576 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
6577
6578 * fileio.c (Finsert_file_contents): Properly handle st_mtime
6579 marker for non-existing file. (Bug#11852)
6580
6581 2012-07-03 Glenn Morris <rgm@gnu.org>
6582
6583 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
6584 and did not make it into globals.h).
6585
6586 2012-07-03 Tom Tromey <tromey@redhat.com>
6587
6588 * window.c (Fset_window_margins, Fset_window_fringes)
6589 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
6590 * textprop.c (Fprevious_property_change): No longer static.
6591 * syntax.c (Fsyntax_table_p): No longer static.
6592 * process.c (Fget_process, Fprocess_datagram_address): No longer
6593 static.
6594 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
6595 * keyboard.c (Fcommand_execute): No longer static.
6596 Remove EXFUN.
6597 * insdel.c (Fcombine_after_change_execute): No longer static.
6598 * image.c (Finit_image_library): No longer static.
6599 * fileio.c (Fmake_symbolic_link): No longer static.
6600 * eval.c (Ffetch_bytecode): No longer static.
6601 * editfns.c (Fuser_full_name): No longer static.
6602 * doc.c (Fdocumentation_property, Fsnarf_documentation):
6603 No longer static.
6604 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
6605 static.
6606 * dired.c (Ffile_attributes): No longer static.
6607 * composite.c (Fcomposition_get_gstring): No longer static.
6608 * callproc.c (Fgetenv_internal): No longer static.
6609
6610 * ccl.h: Remove EXFUNs.
6611 * buffer.h: Remove EXFUNs.
6612 * dispextern.h: Remove EXFUNs.
6613 * intervals.h: Remove EXFUNs.
6614 * fontset.h: Remove EXFUN.
6615 * font.h: Remove EXFUNs.
6616 * dosfns.c (system_process_attributes): Remove EXFUN.
6617 * keymap.h: Remove EXFUNs.
6618 * lisp.h: Remove EXFUNs.
6619 * w32term.h: Remove EXFUNs.
6620 * window.h: Remove EXFUNs.
6621 * xsettings.h: Remove EXFUN.
6622 * xterm.h: Remove EXFUN.
6623
6624 2012-07-03 Glenn Morris <rgm@gnu.org>
6625
6626 * lisp.h (Frandom): Make it visible to C.
6627 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
6628 buffer for invisible buffers. (Bug#1229)
6629
6630 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6631
6632 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
6633 values which aren't power of 2.
6634 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
6635 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
6636 accordingly.
6637
6638 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
6639
6640 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
6641
6642 * alloc.c (mark_object): Revert part of last patch to use `switch'.
6643
6644 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6645
6646 * alloc.c (allocate_vector_block): Remove redundant
6647 calls to mallopt if DOUG_LEA_MALLOC is defined.
6648 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
6649 avoid calls to mallopt if zero_vector is returned.
6650
6651 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6652
6653 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
6654 is enabled, avoid dereferencing NULL current_sblock if
6655 running undumped.
6656
6657 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
6658
6659 Cleanup basic buffer management.
6660 * buffer.h (struct buffer): Change layout to use generic vector
6661 marking code. Fix some comments. Change type of 'clip_changed'
6662 to bitfield. Remove unused #ifndef old.
6663 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
6664 (GET_OVERLAYS_AT): Fix indentation.
6665 (for_each_per_buffer_object_at): New macro.
6666 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
6667 (Fbuffer_local_variables): Use it.
6668 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
6669 * alloc.c (allocate_buffer): Adjust to match new layout of
6670 struct buffer. Fix comment.
6671 (mark_overlay): New function.
6672 (mark_buffer): Use it. Use mark_vectorlike to mark normal
6673 Lisp area of struct buffer.
6674 (mark_object): Use it. Adjust marking of misc objects
6675 and related comments.
6676
6677 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
6678
6679 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
6680 wrapper that is not needed because the wrapped code is a no-op (zero
6681 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
6682 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
6683
6684 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
6685
6686 * alloc.c (mark_buffer): Simplify. Remove prototype.
6687 (mark_object): Add comment. Reorganize marking of vector-like
6688 objects. Use CHECK_LIVE for all vector-like objects except buffers
6689 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
6690 Avoid redundant calls to mark_vectorlike for bool vectors.
6691
6692 2012-06-30 Glenn Morris <rgm@gnu.org>
6693
6694 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
6695
6696 * epaths.in (PATH_SITELOADSEARCH): New.
6697 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
6698 This is rather than relying on --enable-locallisppath elements
6699 having "site-lisp" in their names. (Bug#10208#25, 11658)
6700
6701 2012-06-30 Eli Zaretskii <eliz@gnu.org>
6702
6703 * w32proc.c (sys_select): Accept and ignore one more argument.
6704
6705 * w32.c (emacs_gnutls_pull): Call select with one more argument.
6706
6707 * sysselect.h [DOS_NT]: Don't include sys/select.h.
6708 (pselect) [!MS_DOS]: Redirect to sys_select.
6709
6710 * sysdep.c: Don't include dos.h and dosfns.h.
6711
6712 * process.c (sys_select):
6713 * msdos.c (sys_select): Accept one more argument and ignore it.
6714
6715 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
6716 adapt data types and code to that.
6717
6718 * dosfns.c:
6719 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
6720 which clashes with the gnulib function of the same name.
6721
6722 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
6723
6724 * font.c (font_style_to_value, font_style_symbolic)
6725 (font_prop_validate_style): Add type checks for values in
6726 font_style_table.
6727
6728 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
6729 argument.
6730 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
6731 uses.
6732
6733 2012-06-29 Eli Zaretskii <eliz@gnu.org>
6734
6735 * xdisp.c (try_window_id): Undo last change.
6736
6737 * w32.c (getwd): Adjust commentary about startup_dir.
6738 (init_environment): Always call sys_access, even in non-MSVC
6739 builds. Don't chdir to the directory of the Emacs executable.
6740 This undoes code from 1997 which was justified by the need to
6741 "avoid conflicts when removing and renaming directories". But its
6742 downside was that every relative file name was being interpreted
6743 relative to the directory of the Emacs executable, which can never
6744 be TRT. In particular, it broke sys_access when called with
6745 relative file names.
6746 (sys_access): Map GetLastError to errno.
6747
6748 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6749
6750 * window.h (struct window): Change type of 'fringes_outside_margins'
6751 to bitfield. Fix comment. Adjust users accordingly.
6752 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
6753 Adjust comment.
6754 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
6755 to ptrdiff_t.
6756
6757 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
6758
6759 * gnutls.c (emacs_gnutls_handshake):
6760 Add QUIT to make the loop interruptible.
6761
6762 2012-06-29 Glenn Morris <rgm@gnu.org>
6763
6764 * charset.c (init_charset): Make lack of etc/charsets fatal.
6765
6766 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6767
6768 * editfns.c (region_limit): Fix type mismatch.
6769
6770 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
6771
6772 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
6773 undefined. Convert from xassert to eassert.
6774 * nsmenu.m: Convert from xassert to eassert.
6775 * nsterm.m: Likewise.
6776
6777 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
6778
6779 * editfns.c (region_limit): Clip to narrowing (bug#11770).
6780
6781 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 Avoid integer overflow on scroll-left and scroll-right.
6784 * window.c (HSCROLL_MAX): New macro.
6785 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
6786 overflow when requested scroll falls outside ptrdiff_t range.
6787
6788 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6789
6790 * window.h (struct window): Change type of 'hscroll',
6791 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
6792 'last_modified' and 'last_overlay_modified' to EMACS_INT.
6793 Adjust users accordingly.
6794 * xdisp.c (try_cursor_movement): Replace type check with eassert.
6795 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
6796 from EMACS_INT to ptrdiff_t.
6797 (make_window): Omit redundant initialization.
6798
6799 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
6800
6801 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
6802
6803 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6804
6805 * window.h (struct window): Change type of 'use_time' and
6806 'sequence_number' from Lisp_Object to int.
6807 * frame.c (make_frame): Adjust users accordingly.
6808 * print.c (print_object): Likewise.
6809 * window.c (select_window, Fwindow_use_time, make_parent_window)
6810 (make_window): Likewise.
6811
6812 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6813
6814 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
6815 enabled with --enable-checking=[all,glyphs] configure option.
6816 Fix GLYPH_DEBUG usage assuming that it may be undefined,
6817 adjust comments accordingly.
6818 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
6819 undefined, adjust comments accordingly.
6820 * image.c: Likewise.
6821 * scroll.c: Likewise.
6822 * w32fns.c: Likewise.
6823 * w32term.c: Likewise.
6824 * xdisp.c: Likewise.
6825 * xfaces.c: Likewise.
6826 * xfns.c: Likewise.
6827 * xterm.c: Likewise.
6828
6829 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
6830
6831 Generalize run-time debugging checks.
6832 * dispextern.h (XASSERTS): Remove.
6833 * fontset.c (xassert): Remove.
6834 Convert from xassert to eassert.
6835 * alloc.c: Convert from xassert to eassert.
6836 * bidi.c: Likewise.
6837 * dispnew.c: Likewise.
6838 * fns.c: Likewise.
6839 * fringe.c: Likewise.
6840 * ftfont.c: Likewise.
6841 * gtkutil.c: Likewise.
6842 * image.c: Likewise.
6843 * keyboard.c: Likewise.
6844 * menu.c: Likewise.
6845 * process.c: Likewise.
6846 * scroll.c: Likewise.
6847 * sound.c: Likewise.
6848 * term.c: Likewise.
6849 * w32console.c: Likewise.
6850 * w32fns.c: Likewise.
6851 * w32term.c: Likewise.
6852 * window.c: Likewise.
6853 * xdisp.c: Likewise.
6854 * xfaces.c: Likewise.
6855 * xfns.c: Likewise.
6856 * xselect.c: Likewise.
6857 * xterm.c: Likewise.
6858
6859 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
6860
6861 * fns.c (maybe_resize_hash_table): Output message when growing the
6862 purify-hashtable.
6863
6864 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6865
6866 * alloc.c (allocate_string_data): Remove dead code.
6867 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
6868 avoid GCC warning about unused macro.
6869
6870 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6871
6872 * alloc.c (allocate_string): Omit intervals initialization.
6873 * alloc.c (make_uninit_multibyte_string): Initialize intervals
6874 as in make_pure_string and make_pure_c_string.
6875
6876 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6877
6878 * alloc.c (allocate_string): Fix last change.
6879
6880 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
6881
6882 * alloc.c (allocate_string): Remove two redundant calls
6883 to memset, add explicit initialization where appropriate.
6884
6885 2012-06-27 Glenn Morris <rgm@gnu.org>
6886
6887 * lisp.mk (lisp): Remove paths.elc.
6888
6889 2012-06-27 Chong Yidong <cyd@gnu.org>
6890
6891 * doc.c (Fsubstitute_command_keys): Fix punctuation.
6892
6893 2012-06-26 John Wiegley <johnw@newartisans.com>
6894
6895 * unexmacosx.c (copy_data_segment): Add two section names used
6896 on Mac OS X Lion: __mod_init_func and __mod_term_func.
6897
6898 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
6899 when building with Clang.
6900
6901 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
6902
6903 * eval.c (Fapply): Allow calling it with a single argument.
6904
6905 2012-06-26 Eli Zaretskii <eliz@gnu.org>
6906
6907 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
6908 _stricmp and _strnicmp.
6909 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
6910
6911 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6912
6913 * alloc.c (allocate_window): Zero out non-Lisp part of newly
6914 allocated window.
6915 (allocate_process): Likewise for new process.
6916 (allocate_terminal): Change to use offsetof.
6917 (allocate_frame): Likewise.
6918 * frame.c (make_frame): Omit redundant initialization.
6919 * window.c (make_parent_window): Use memset.
6920 (make_window): Omit redundant initialization.
6921 * process.c (make_process): Omit redundant initialization.
6922 * terminal.c (create_terminal): Likewise.
6923
6924 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6925
6926 * term.c (delete_tty): Remove redundant call to memset.
6927
6928 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
6929
6930 * alloc.c: Remove build_string.
6931 * lisp.h: Define build_string as static inline. This provides
6932 a better opportunity to optimize away calls to strlen when the
6933 function is called with compile-time constant argument.
6934 * image.c (imagemagick_error): Convert to build_string.
6935 * w32proc.c (sys_spawnve): Likewise.
6936 * xterm.c (x_term_init): Likewise.
6937
6938 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
6939
6940 Use sprintf return value instead of invoking strlen on result.
6941 In the old days this wasn't portable, since some sprintf
6942 implementations returned char *. But they died out years ago and
6943 Emacs already assumes sprintf returns int.
6944 Similarly for float_to_string.
6945 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
6946 * ccl.c (ccl_driver):
6947 * character.c (string_escape_byte8):
6948 * data.c (Fnumber_to_string):
6949 * doprnt.c (doprnt):
6950 * print.c (print_object):
6951 * xdisp.c (message_dolog):
6952 * xfns.c (syms_of_xfns):
6953 Use sprintf or float_to_string result to avoid need to call strlen.
6954 * data.c (Fnumber_to_string):
6955 Use make_unibyte_string, since the string must be ASCII.
6956 * lisp.h, print.c (float_to_string): Now returns int length.
6957 * term.c (produce_glyphless_glyph):
6958 Use sprintf result rather than recomputing it.
6959
6960 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
6961 * Makefile.in (ALL_CFLAGS):
6962 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
6963 * gmalloc.c, regex.c: Include <config.h> unconditionally.
6964
6965 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6966
6967 * dispextern.h (xstrcasecmp): Define to library function
6968 strcasecmp if available.
6969 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
6970
6971 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
6972
6973 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
6974 Avoid comma operator.
6975 * menu.c (push_submenu_start, push_submenu_end)
6976 (push_left_right_boundary, push_menu_pane): Likewise.
6977 * msdos.c (dos_rawgetc): Likewise.
6978
6979 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6980
6981 * xfns.c (xic_create_fontsetname): Remove redundant calls
6982 to memset.
6983
6984 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
6985
6986 * gtkutil.c (get_utf8_string): Remove redundant assignment.
6987 sprintf already null-terminates its output.
6988
6989 * xfns.c (x_window): Remove redundant cast.
6990
6991 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
6992
6993 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
6994 `const char *' to `char *' to avoid compiler warning.
6995
6996 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
6997
6998 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
6999 instead of truncating it to 63 (admittedly a generous limit).
7000
7001 * process.c: Fix spelling and caps in comments.
7002
7003 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7004
7005 * emacs.c (setpgrp): Remove definition, unused.
7006 * sysdep.c (setpgrp): Remove definition, not used in this file.
7007
7008 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
7009
7010 * makefile.w32-in: Update dependencies.
7011
7012 2012-06-24 Eli Zaretskii <eliz@gnu.org>
7013
7014 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7015 (SYSTIME_H): Add nt/inc/sys/time.h.
7016
7017 * systime.h [WINDOWSNT]: Include sys/time.h.
7018
7019 * s/ms-w32.h (struct timespec): Definition moved from
7020 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7021
7022 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7023
7024 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7025 * buffer.h (buffer_slot_type_mismatch):
7026 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7027 * eval.c (unwind_to_catch):
7028 * image.c (my_png_error, my_error_exit):
7029 * keyboard.c (quit_throw_to_read_char, user_error)
7030 (Fexit_recursive_edit, Fabort_recursive_edit):
7031 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7032 (wrong_type_argument, buffer_overflow, __executable_start)
7033 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7034 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7035 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7036 (fatal):
7037 (child_setup) [!DOS_NT]:
7038 * lread.c (end_of_file_error, invalid_syntax):
7039 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7040 * puresize.h (pure_write_error):
7041 * search.c (matcher_overflow):
7042 * sound.c (sound_perror, alsa_sound_perror):
7043 * sysdep.c, syssignal.h (croak):
7044 * term.c (maybe_fatal, vfatal):
7045 * textprop.c (text_read_only):
7046 * undo.c (user_error):
7047 * unexmacosx.c (unexec_error):
7048 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7049 Use _Noreturn rather than NO_RETURN.
7050 No need for separate decl merely because of _Noreturn.
7051 * sound.c (sound_warning, parse_sound):
7052 Remove unnecessary forward decls.
7053
7054 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7055
7056 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7057 * lisp.h (WAIT_READING_MAX): New macro.
7058 * dispnew.c (Fsleep_for, sit_for):
7059 * keyboard.c (kbd_buffer_get_event):
7060 * process.c (Faccept_process_output):
7061 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7062 This improves on the previous patch, which introduced a bug
7063 when time_t is unsigned and as wide as intmax_t.
7064 See <http://bugs.gnu.org/9000#51>.
7065
7066 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7067
7068 * dispnew.c (sit_for, Fsleep_for):
7069 * keyboard.c (kbd_buffer_get_event):
7070 * process.c (Faccept_process_output): Avoid compiler warnings when
7071 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7072
7073 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
7074
7075 * makefile.w32-in: Update dependencies.
7076
7077 * w32.c (ltime): Add return type and declare static.
7078 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7079
7080 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7081
7082 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7083 Privately reported by Herbert J. Skuhra.
7084 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7085 All uses changed.
7086 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7087 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7088
7089 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7090
7091 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7092 last argument of make_unibyte_string.
7093
7094 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7095 language ID in the event parameters.
7096
7097 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7098 event.code, not the obscure "character set ID".
7099
7100 2012-06-23 Chong Yidong <cyd@gnu.org>
7101
7102 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7103
7104 2012-06-23 Eli Zaretskii <eliz@gnu.org>
7105
7106 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7107 * w32.c (fdutimens): New function.
7108
7109 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7110
7111 * s/ms-w32.h (pselect): Redirect to sys_select.
7112
7113 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7114
7115 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7116 in the logic of incrementing and decrementing the value of
7117 use_relocatable_buffers.
7118
7119 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7120
7121 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7122 Privately reported by Herbert J. Skuhra.
7123 [__FreeBSD__]: Remove "*/" typo after "#include".
7124 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7125 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7126 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7127 Don't assume EMACS_TIME and struct timeval are the same type.
7128
7129 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7130
7131 Support higher-resolution time stamps (Bug#9000).
7132 The time stamps are only nanosecond-resolution at the C level,
7133 since that's the best that any real-world system supports now.
7134 But they are picosecond-resolution at the Lisp level, as that's
7135 easy, and leaves room for future OS improvements.
7136
7137 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7138 (LIBES): Use it.
7139
7140 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7141 Don't get current time unless it's needed.
7142
7143 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7144 now provides it if it's absent.
7145 (start_atimer): Port to higher-res time stamps.
7146 Check for time stamp overflow. Don't get current time more
7147 often than is needed.
7148
7149 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7150 Include systime.h, not time.h.
7151 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7152
7153 * dired.c: Include stat-time.h.
7154 (Ffile-attributes): File times now have higher resolution.
7155
7156 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7157 (struct image): Timestamp now has higher resolution.
7158
7159 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7160 has at least microseconds now. All uses removed.
7161 (update_frame, update_single_window, update_window, update_frame_1)
7162 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
7163 (duration_to_sec_usec): Remove; no longer needed.
7164
7165 * editfns.c (time_overflow): Now extern.
7166 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7167 (float-time, Fformat_time_string, Fcurrent_time_string)
7168 (Fcurrent_time_zone): Accept and generate higher-resolution
7169 time stamps.
7170 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7171 (decode_time_components, lisp_seconds_argument): New functions.
7172 (make_time): Now static.
7173 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7174 Report an error if the time is invalid, rather than having the caller
7175 do that.
7176
7177 * fileio.c: Include <stat-time.h>
7178 (Fcopy_file): Copy higher-resolution time stamps.
7179 Prefer to set the time stamp via a file descriptor if that works.
7180 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7181 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7182 (Fvisited_file_modtime, Fset_visited_file_modtime):
7183 Support higher-resolution time stamps.
7184
7185 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7186
7187 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7188
7189 * image.c (prepare_image_for_display, clear_image_cache)
7190 (lookup_image): Port to higer-resolution time stamps.
7191
7192 * keyboard.c (start_polling, bind_polling_period):
7193 Check for time stamp overflow.
7194 (read_char, kbd_buffer_get_event, timer_start_idle)
7195 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7196 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7197 Port to higher-resolution time stamps. Do not assume time_t is signed.
7198 (decode_timer): New function. Timers are now vectors of length 9,
7199 not 8, to accommodate the picosecond component.
7200 (timer_check_2): Use it.
7201
7202 * nsterm.m (select_timeout, timeval_subtract): Remove.
7203 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7204 as they're a bit more accurate and handle overflow better.
7205 (ns_select): Change prototype to be compatible with pselect.
7206 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7207 * nsterm.h (ns_select): Adjust prototype.
7208
7209 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7210 us-resolution time stamps.
7211 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7212
7213 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7214
7215 * lisp.h (time_overflow): New decl.
7216 (wait_reading_process_output): First arg is now intmax_t, not int,
7217 to accommodate larger waits.
7218
7219 * process.h (struct Lisp_Process.read_output_delay):
7220 Now counts nanoseconds, not microseconds.
7221 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7222 EMACS_HAS_USECS.
7223 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7224 (wait_reading_process_output):
7225 Port to ns-resolution time stamps.
7226 (Faccept_process_output, wait_reading_process_output):
7227 Check for time stamp overflow. Do not assume time_t is signed.
7228 (select_wrapper): Remove; we now use pselect.
7229 (Fprocess_attributes): Now generates ns-resolution time stamps.
7230
7231 * sysdep.c: Include utimens.h. Don't include utime.h
7232 or worry about struct utimbuf; gnulib does that for us now.
7233 (gettimeofday): Remove; gnulib provides a substitute.
7234 (make_timeval): New function.
7235 (set_file_times): Now sets ns-resolution time stamps.
7236 New arg FD; all uses changed.
7237 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7238 (system_process_attributes):
7239 Now returns ns-resolution time stamp. All uses changed.
7240 Check for time stamp overflow.
7241
7242 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7243 provides a substitute now.
7244
7245 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7246 since it guarantees struct timespec.
7247 (EMACS_TIME): Now struct timespec, so that we can support
7248 ns-resolution time stamps.
7249 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7250 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7251 (EMACS_USECS): Remove.
7252 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7253 so multiply the arg by 1000 before storing it.
7254 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7255 New macros.
7256 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7257 Port to ns-resolution time stamps.
7258 (EMACS_TIME_NEG_P): Remove; replaced by....
7259 (EMACS_TIME_SIGN): New macro.
7260 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7261 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7262 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7263 (make_timeval, make_lisp_time, decode_time_components): New decls.
7264 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7265 that it mishandled time_t overflow. You can't compare by subtracting!
7266 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7267 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7268
7269 * term.c: Include <sys/time.h>.
7270 (timeval_to_Time): New function, for proper overflow wraparound.
7271 (term_mouse_position, term_mouse_click): Use it.
7272
7273 * undo.c (record_first_change): Support higher-resolution time stamps
7274 in the undo buffer.
7275 (Fprimitive_undo): Use them when restoring time stamps.
7276
7277 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7278 (w32_get_internal_run_time):
7279 Port to higher-resolution Emacs time stamps.
7280 (ltime): Now accepts single 64-bit integer, as that's more convenient
7281 for callers.
7282
7283 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7284
7285 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7286 for compatibility with pselect. Support ns-resolution time stamps.
7287
7288 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7289
7290 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7291 Check for time stamp overflow, and support ns-resolution time stamps.
7292
7293 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7294 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7295 (timeval_subtract): Remove; no longer needed.
7296 (XTflash, XTring_bell, x_wait_for_event):
7297 Port to ns-resolution time stamps. Don't assume time_t is signed.
7298
7299 2012-06-22 Chong Yidong <cyd@gnu.org>
7300
7301 * xdisp.c (x_consider_frame_title): Revert last change.
7302
7303 2012-06-22 Eli Zaretskii <eliz@gnu.org>
7304
7305 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7306 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7307 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7308 staticidx goes up to 1597 out of 1600 = 0x640.)
7309
7310 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7311
7312 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7313 Otherwise, the umask might be mistakenly 0 while handling input signals.
7314
7315 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7316
7317 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7318
7319 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7320
7321 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7322 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7323 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7324 access to `contents' member of Lisp_Vector objects with AREF and ASET
7325 where appropriate.
7326
7327 2012-06-19 Chong Yidong <cyd@gnu.org>
7328
7329 * frame.c (delete_frame): When selecting a frame on a different
7330 text terminal, do not alter the terminal's top-frame.
7331
7332 * xdisp.c (format_mode_line_unwind_data): Record the target
7333 frame's selected window and its terminal's top-frame.
7334 (unwind_format_mode_line): Restore them.
7335 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7336 Callers changed.
7337 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7338 since tty frames can be explicitly named.
7339 (prepare_menu_bars): Likewise.
7340
7341 * term.c (Ftty_top_frame): New function.
7342
7343 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7344
7345 Port byte-code-meter to modern targets.
7346 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7347 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
7348 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
7349 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7350 (METER_1, METER_2): Simplify.
7351
7352 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7353
7354 * data.c (Fdefalias): Return `symbol' (bug#11686).
7355
7356 2012-06-18 Martin Rudalics <rudalics@gmx.at>
7357
7358 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
7359 gets killed during executing of this function (Bug#11665).
7360 Try to always return Qt when the buffer has been actually killed.
7361 (Vkill_buffer_query_functions): In doc-string say that functions
7362 run by this hook should not change the current buffer.
7363
7364 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7365
7366 Fix recently-introduced process.c problems found by static checking.
7367 * process.c (write_queue_push, write_queue_pop, send_process):
7368 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7369 (write_queue_pop): Fix pointer signedness problem.
7370 (send_process): Remove unused local.
7371
7372 2012-06-17 Chong Yidong <cyd@gnu.org>
7373
7374 * xdisp.c (redisplay_internal): No need to redisplay terminal
7375 frames that are not on top.
7376
7377 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
7378
7379 * process.c (make_process): Initialize write_queue.
7380 (write_queue_push, write_queue_pop): New functions.
7381 (send_process): Use them to maintain correct ordering of process
7382 writes (Bug#10815).
7383
7384 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7385
7386 * lisp.h (eassert): Assume C89 or later.
7387 This removes the need for CHECK.
7388 (CHECK): Remove. Its comments about always evaluating its
7389 argument were confusing, as 'eassert' typically does not evaluate
7390 its argument.
7391
7392 * coding.c (produce_chars): Use ptrdiff_t, not int.
7393
7394 * xterm.c (x_draw_underwave): Check for integer overflow.
7395 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7396
7397 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
7398
7399 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7400 referenced (Bug#11583).
7401
7402 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7403
7404 Implement wave-style variant of underlining.
7405 * dispextern.h (face_underline_type): New enum.
7406 (face): Add field for underline type.
7407 * nsterm.m (ns_draw_underwave): New function.
7408 (ns_draw_text_decoration): Use it.
7409 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7410 New functions.
7411 (x_draw_glyph_string): Use them.
7412 * xfaces.c (Qline, Qwave): New Lisp objects.
7413 (check_lface_attrs, merge_face_ref)
7414 (Finternal_set_lisp_face_attribute, realize_x_face):
7415 Handle wave-style underline face attributes.
7416 * xterm.c (x_draw_underwave): New function.
7417 (x_draw_glyph_string): Use it.
7418
7419 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
7420
7421 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7422 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7423 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7424 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7425 ($(BLD)/w32select.$(O)): Update dependencies.
7426
7427 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7428
7429 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7430 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7431 * character.c (_fetch_multibyte_char_p): Remove.
7432 * alloc.c: Include "character.h" before "buffer.h".
7433 * bidi.c: Likewise.
7434 * buffer.c: Likewise.
7435 * bytecode.c: Likewise.
7436 * callint.c: Likewise.
7437 * callproc.c: Likewise.
7438 * casefiddle.c: Likewise.
7439 * casetab.c: Likewise.
7440 * category.c: Likewise.
7441 * cmds.c: Likewise.
7442 * coding.c: Likewise.
7443 * composite.c: Likewise.
7444 * dired.c: Likewise.
7445 * dispnew.c: Likewise.
7446 * doc.c: Likewise.
7447 * dosfns.c: Likewise.
7448 * editfns.c: Likewise.
7449 * emacs.c: Likewise.
7450 * fileio.c: Likewise.
7451 * filelock.c: Likewise.
7452 * font.c: Likewise.
7453 * fontset.c: Likewise.
7454 * fringe.c: Likewise.
7455 * indent.c: Likewise.
7456 * insdel.c: Likewise.
7457 * intervals.c: Likewise.
7458 * keyboard.c: Likewise.
7459 * keymap.c: Likewise.
7460 * lread.c: Likewise.
7461 * macros.c: Likewise.
7462 * marker.c: Likewise.
7463 * minibuf.c: Likewise.
7464 * nsfns.m: Likewise.
7465 * nsmenu.m: Likewise.
7466 * print.c: Likewise.
7467 * process.c: Likewise.
7468 * regex.c: Likewise.
7469 * region-cache.c: Likewise.
7470 * search.c: Likewise.
7471 * syntax.c: Likewise.
7472 * term.c: Likewise.
7473 * textprop.c: Likewise.
7474 * undo.c: Likewise.
7475 * unexsol.c: Likewise.
7476 * w16select.c: Likewise.
7477 * w32fns.c: Likewise.
7478 * w32menu.c: Likewise.
7479 * window.c: Likewise.
7480 * xdisp.c: Likewise.
7481 * xfns.c: Likewise.
7482 * xmenu.c: Likewise.
7483 * xml.c: Likewise.
7484 * xselect.c: Likewise.
7485
7486 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7487
7488 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7489 If all the glyphs of the glyph row came from strings, and we have no
7490 cursor positioning clues, put the cursor on the first glyph of the
7491 row.
7492 (handle_face_prop): Use chunk-relative overlay string index when
7493 indexing into it->string_overlays array. (Bug#11653)
7494 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7495 the rightmost. (Bug#11720)
7496
7497 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7498
7499 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7500 (CATEGORY_MEMBER): Enforce 1/0 value.
7501 * category.c (_temp_category_set): Remove.
7502
7503 2012-06-16 Eli Zaretskii <eliz@gnu.org>
7504
7505 * window.c (Fdelete_other_windows_internal)
7506 (Fdelete_window_internal): Don't access frame's mouse highlight
7507 info of the initial frame. (Bug#11677)
7508
7509 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7510
7511 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7512 Assume USE_2_TAGS_FOR_INTS.
7513 (xreload): Adjust $tagmask width to match recent lisp.h change.
7514
7515 Simplify lisp.h in minor ways that should not affect code.
7516 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7517 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7518 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7519 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7520 (INTTYPEBITS): New macro, for clarity.
7521 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
7522 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7523 Simplify now that USE_LSB_TAG is always defined.
7524 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7525 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7526
7527 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
7528
7529 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7530
7531 2012-06-13 Glenn Morris <rgm@gnu.org>
7532
7533 * s/bsd-common.h (BSD4_3):
7534 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7535
7536 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7537
7538 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7539 instead of union.
7540 (XLI, XIL): Define.
7541 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7542 Use them.
7543 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
7544 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
7545 * alloc.c (widen_to_Lisp_Object): Remove.
7546 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7547 * frame.c (delete_frame): Remove outdated comment.
7548 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7549 USE_LISP_UNION_TYPE.
7550 (Fw32_unregister_hot_key): Likewise.
7551 (Fw32_toggle_lock_key): Likewise.
7552 * w32menu.c (add_menu_item): Likewise.
7553 (w32_menu_display_help): Use XIL instead of checking
7554 USE_LISP_UNION_TYPE.
7555 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7556 (init_heap): Likewise.
7557 * w32term.c (w32_read_socket): Update comment.
7558
7559 2012-06-13 Glenn Morris <rgm@gnu.org>
7560
7561 * s/usg5-4-common.h, src/s/unixware.h:
7562 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
7563
7564 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
7565
7566 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
7567
7568 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
7569 * alloc.c (make_number) [!defined make_number]:
7570 Remove, as lisp.h always defines this now.
7571 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
7572 (roundup_size): Verify that it is a power of 2.
7573 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
7574 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
7575 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
7576 -DUSE_LSB_TAG=0, to override the automatically-selected default.
7577 USE_LSB_TAG now is always defined to be either 0 or 1.
7578 All uses changed.
7579 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
7580 code works fine either way, and efficiency is not a concern here,
7581 as the union type is for debugging, not for production.
7582 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
7583 Use an inline function on all platforms when using the union type,
7584 since this is simpler and 'static inline' can be used portably
7585 within Emacs now.
7586 (LISP_INITIALLY_ZERO): New macro.
7587 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
7588 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
7589
7590 2012-06-12 Glenn Morris <rgm@gnu.org>
7591
7592 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
7593
7594 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
7595
7596 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
7597 Move BROKEN_SIGIO to configure.
7598
7599 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
7600 Move NO_TERMIO to configure.
7601
7602 2012-06-12 Chong Yidong <cyd@gnu.org>
7603
7604 * image.c (imagemagick_load_image): Use MagickFlattenImage if
7605 MagickMergeImageLayers is undefined. Use pixel pusher loop if
7606 MagickExportImagePixels is undefined.
7607
7608 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
7609
7610 * image.c (imagemagick_load_image): Remove unused label.
7611
7612 2012-06-11 Glenn Morris <rgm@gnu.org>
7613
7614 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
7615 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
7616 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
7617 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
7618
7619 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
7620
7621 * alloc.c (make_byte_code): New function.
7622 (Fmake_byte_code): Use it. Don't purify here.
7623 * lread.c (read1): Use it as well to avoid extra allocation.
7624
7625 2012-06-11 Chong Yidong <cyd@gnu.org>
7626
7627 * image.c (imagemagick_load_image): Implement transparency.
7628
7629 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
7630
7631 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
7632 account for preceding backslashes. (Bug#11663)
7633
7634 2012-06-09 Chong Yidong <cyd@gnu.org>
7635
7636 * term.c: Support italics in capable terminals (Bug#9652).
7637 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
7638 (turn_on_face): Output using TS_enter_italic_mode if available.
7639 Don't handle unused blinking and alt-charset cases.
7640 (turn_off_face): Handle italic case; discard unused tty_blinking_p
7641 and tty_alt_charset_p cases.
7642 (tty_capable_p, init_tty): Support italics.
7643
7644 * termchar.h (struct tty_display_info): Add field for italics.
7645 Remove unused blink field.
7646
7647 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
7648 Handle slant.
7649
7650 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
7651 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
7652 tty_alt_charset_p. Add tty_italic_p.
7653
7654 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
7655
7656 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
7657 dbus_type_is_basic if available.
7658 (xd_extract_signed, xd_extract_unsigned): Rename from
7659 extract_signed and extract_unsigned, respectively. Adapt callers.
7660
7661 2012-06-09 Chong Yidong <cyd@gnu.org>
7662
7663 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
7664
7665 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
7666 case (Bug#9752).
7667
7668 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
7669
7670 * xdisp.c (vmessage): Treat frame message as multibyte.
7671 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
7672 would generate the diagnostic "Making \302\247 buffer-local while
7673 let-bound!".
7674
7675 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7676
7677 * dispnew.c (showing_window_margins_p): Undo last change, which
7678 was done due to an inadvertent commit.
7679 (adjust_frame_glyphs_for_frame_redisplay): Do call
7680 showing_window_margins_p.
7681
7682 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7683
7684 * eval.c (Fmake_var_non_special): New primitive.
7685 (syms_of_eval): Defsubr it.
7686 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
7687
7688 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
7689
7690 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
7691 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
7692
7693 2012-06-08 Eli Zaretskii <eliz@gnu.org>
7694
7695 * alloc.c (allocate_vectorlike): Fix last change.
7696
7697 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
7698
7699 Block-based vector allocation of small vectors.
7700 * lisp.h (struct vectorlike_header): New field `nbytes',
7701 adjust comment accordingly.
7702 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
7703 to denote vector blocks. Adjust users (live_vector_p,
7704 mark_maybe_pointer, valid_lisp_object_p) accordingly.
7705 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
7706 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
7707 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
7708 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
7709 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
7710 (roundup_size): New constant.
7711 (struct vector_block): New data type.
7712 (vector_blocks, vector_free_lists, zero_vector): New variables.
7713 (all_vectors): Rename to `large_vectors'.
7714 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
7715 (sweep_vectors): New functions.
7716 (allocate_vectorlike): Return `zero_vector' as the only vector of
7717 0 items. Allocate new vector from block if vector size is less than
7718 or equal to VBLOCK_BYTES_MAX.
7719 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
7720 (init_alloc_once): Add call to init_vectors.
7721
7722 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
7723
7724 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
7725
7726 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
7727
7728 * doprnt.c (doprnt): Truncate multibyte char correctly.
7729 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
7730 would mishandle a string argument "Xc" if X was a multibyte
7731 character of length 2: it would truncate after X's first byte
7732 rather than including all of X.
7733
7734 2012-06-06 Chong Yidong <cyd@gnu.org>
7735
7736 * buffer.c (word_wrap): Doc fix.
7737
7738 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
7739
7740 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
7741
7742 2012-06-03 Glenn Morris <rgm@gnu.org>
7743
7744 * xdisp.c (tool-bar-style): Doc fix.
7745
7746 2012-06-03 Ulrich Müller <ulm@gentoo.org>
7747
7748 * Makefile.in (PAXCTL): Define.
7749 (temacs$(EXEEXT)): Disable memory randomization for the temacs
7750 binary via PaX flags if the paxctl utility is available.
7751 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7752 Restore PaX flags to their default. (Bug#11398)
7753
7754 2012-06-03 Chong Yidong <cyd@gnu.org>
7755
7756 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
7757 buffer (Bug#11226).
7758
7759 2012-06-03 Chong Yidong <cyd@gnu.org>
7760
7761 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
7762 (note_mode_line_or_margin_highlight): If there is no help echo,
7763 use mode-line-default-help-echo. Handle the case where the mouse
7764 position is past the end of the mode line string.
7765
7766 * buffer.c (buffer_local_value_1): New function, split from
7767 Fbuffer_local_value; can return Qunbound.
7768 (Fbuffer_local_value): Use it.
7769 (Vmode_line_format): Docstring tweaks.
7770
7771 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7772
7773 * sysdep.c (system_process_attributes): Improve comment.
7774
7775 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
7776
7777 * keyboard.c: Export real-this-command to Elisp.
7778 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
7779 and DEFVAR it. Update all users.
7780
7781 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
7782
7783 * minibuf.c (Fassoc_string): Remove duplicate declaration.
7784
7785 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
7786 Convert pctcpu and pctmem to Lisp float properly.
7787 Let the compiler fold better, as 100.0/0x8000 is exact.
7788
7789 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
7790
7791 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
7792 cons_block.
7793
7794 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
7795
7796 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
7797
7798 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
7799
7800 For a 'struct window', replace some Lisp_Object fields to
7801 bitfields where appropriate, remove unused fields.
7802 * window.h (struct window): Remove unused 'last_mark_x' and
7803 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
7804 change its type from Lisp_Object to bitfield.
7805 Change type of 'force_start', 'optional_new_start',
7806 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
7807 fields from Lisp_Object to bitfield. Adjust users accordingly.
7808
7809 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7810
7811 Pacify gcc -Wdouble-precision when using Xaw.
7812 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
7813 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
7814 Use 'float' consistently, rather than 'float' in most places
7815 and 'double' in a couple of places.
7816
7817 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7818
7819 * xdisp.c (handle_stop): Detect whether we have overlay strings
7820 loaded by testing it->current.overlay_string_index to be
7821 non-negative, instead of checking whether n_overlay_strings is
7822 positive. (Bug#11587)
7823
7824 2012-05-31 Chong Yidong <cyd@gnu.org>
7825
7826 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
7827
7828 * doc.c (Fsubstitute_command_keys): Doc fix.
7829
7830 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7831
7832 * search.c (search_buffer): Remove calls to
7833 r_alloc_inhibit_buffer_relocation, as it is now called by
7834 maybe_unify_char, which was the cause of relocation of buffer text
7835 in bug#11519.
7836
7837 2012-05-31 Eli Zaretskii <eliz@gnu.org>
7838
7839 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
7840 for the duration of call to load_charset, to avoid problems with
7841 callers of maybe_unify_char that access buffer text through C
7842 pointers.
7843
7844 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
7845 decrement the inhibition flag, instead of just setting or
7846 resetting it.
7847
7848 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
7849
7850 Remove obsolete '#define static' cruft.
7851 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
7852 This #undef was "temporary" in 2000; it is no longer needed
7853 now that '#define static' has gone away.
7854 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
7855 (gray_bitmap_bits): Remove; no longer needed.
7856 All uses replaced with definiens.
7857 * xterm.c: Include "bitmaps/gray.xbm".
7858
7859 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 Clean up __executable_start, monstartup when --enable-profiling.
7862 The following changes affect the code only when profiling.
7863 * dispnew.c (__executable_start): Rename from safe_bcopy.
7864 Define only on platforms that need it.
7865 * emacs.c: Include <sys/gmon.h> when profiling.
7866 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
7867 (__executable_start): Remove decl, since lisp.h does it now.
7868 (safe_bcopy): Remove decl; no longer has that name.
7869 (main): Coalesce #if into single bit of code, for simplicity.
7870 Cast pointers to uintptr_t, since standard libraries want integers
7871 and not pointers.
7872 * lisp.h (__executable_start): New decl.
7873
7874 2012-05-31 Glenn Morris <rgm@gnu.org>
7875
7876 * image.c (Fimagemagick_types): Doc fix.
7877
7878 2012-05-30 Jim Meyering <meyering@redhat.com>
7879
7880 * callproc.c (Fcall_process_region): Include directory component
7881 in mkstemp error message (Bug#11586).
7882
7883 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
7884
7885 * alloc.c, lisp.h (make_pure_vector): Now static.
7886
7887 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
7888
7889 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
7890 Move to byte-run.el.
7891 (Fautoload): Do the hash-doc more carefully.
7892 * data.c (Fdefalias): Purify definition, except for keymaps.
7893 (Qdefun): Move from eval.c.
7894 * lisp.h (Qdefun): Remove.
7895 * lread.c (read1): Tiny simplification.
7896
7897 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
7898
7899 Do not create empty overlays with the evaporate property (Bug#9642).
7900 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
7901 Bug#9642, but explicitly check that the buffer the overlay would
7902 be moved to is live and rearrange lines to make sure that errors
7903 will not put the overlay in an inconsistent state.
7904 (Fdelete_overlay): Cosmetics.
7905
7906 2012-05-28 Eli Zaretskii <eliz@gnu.org>
7907
7908 * w32term.c (my_bring_window_to_top): New function.
7909 (x_raise_frame): Use handle returned by DeferWindowPos, which
7910 could be different from the original one.
7911 Call my_bring_window_to_top instead of my_set_foreground_window.
7912 (Bug#11513)
7913
7914 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
7915 by calling BringWindowToTop.
7916
7917 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
7918 (WM_EMACS_END): Increase by one.
7919
7920 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
7921
7922 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
7923 This avoids undefined behavior that might cause the eassert
7924 to not catch an out-of-range value.
7925
7926 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
7927
7928 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
7929 Update dependencies.
7930
7931 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7932
7933 * bidi.c (bidi_mirror_char): Fix last change.
7934
7935 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
7936
7937 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
7938 when referring to sectname field in printf format.
7939
7940 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
7941
7942 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
7943 Only r_alloc_inhibit_buffer_relocation needed to be added;
7944 the others were already declared.
7945
7946 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
7947 before checking whether it's out of range. Put the check inside
7948 eassert. See
7949 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
7950
7951 2012-05-27 Ken Brown <kbrown@cornell.edu>
7952
7953 * callproc.c (Fcall_process): Restore a line that was accidentally
7954 commented out in the 2011-02-13 change (bug#11547).
7955
7956 2012-05-27 Eli Zaretskii <eliz@gnu.org>
7957
7958 * lisp.h [REL_ALLOC]: Add prototypes for external functions
7959 defined on ralloc.c.
7960
7961 * buffer.c [REL_ALLOC]: Remove prototypes of
7962 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
7963 they are now on lisp.h.
7964
7965 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
7966
7967 * search.c (search_buffer): Use it to inhibit relocation of buffer
7968 text while re_search_2 is doing its job, because re_search_2 is
7969 passed C pointers to buffer text. (Bug#11519)
7970
7971 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
7972 Update value to 24.
7973
7974 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
7975 state after an additional call to move_it_in_display_line_to, keep
7976 the values of it->max_ascent and it->max_descent found for the
7977 entire line.
7978 (pos_visible_p): Revert the comparison against bottom_y to what it
7979 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
7980 (Bug#11464)
7981
7982 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
7983
7984 Fix coding-related core dumps with gcc -ftrapv.
7985 The code was computing A - B, where A and B are pointers, and B is
7986 random garbage. This can lead to core dumps on platforms that
7987 have special pointer registers, and it also leads to core dumps on
7988 x86-64 when compiled with gcc -ftrapv. The fix is to compute
7989 A - B only when B is initialized properly.
7990 * coding.c (coding_set_source, coding_set_destination): Return void.
7991 (coding_change_source, coding_change_destinations): New functions,
7992 with the old behaviors of coding_set_source and coding_set_destination.
7993 All callers that need an offset changed to use these new functions.
7994
7995 2012-05-26 Glenn Morris <rgm@gnu.org>
7996
7997 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
7998
7999 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8000
8001 Extend mouse support on W32 text-mode console.
8002 * xdisp.c (draw_row_with_mouse_face):
8003 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
8004
8005 * w32console.c: Include window.h.
8006 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8007 New functions.
8008 (initialize_w32_display): Initialize mouse-highlight data.
8009
8010 * w32inevt.c: Include termchar.h and window.h.
8011 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8012 moves, call note_mouse_highlight. If help_echo changed, call
8013 gen_help_event to produce help-echo message in the echo area.
8014 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8015 highlight info.
8016
8017 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8018
8019 * lread.c (read1): Simplify slightly to avoid an overflow warning
8020 with GCC 4.7.0 on x86-64.
8021
8022 2012-05-26 Eli Zaretskii <eliz@gnu.org>
8023
8024 * bidi.c (bidi_mirror_char): Revert last change: an int is
8025 definitely wide enough here.
8026
8027 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
8028
8029 Fix integer width and related bugs (Bug#9874).
8030 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
8031 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8032 (string_bytes, check_sblock, allocate_string_data):
8033 (compact_small_strings, Fmake_bool_vector, make_string)
8034 (make_unibyte_string, make_multibyte_string)
8035 (make_string_from_bytes, make_specified_string)
8036 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8037 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8038 (mark_vectorlike):
8039 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8040 (allocate_pseudovector):
8041 Use int, not EMACS_INT, where int is wide enough.
8042 (inhibit_garbage_collection, Fgarbage_collect):
8043 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8044 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8045 int might not be wide enough.
8046 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8047 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8048 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8049 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8050 (bidi_level_of_next_char, bidi_move_to_visually_next):
8051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8052 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8053 (Fkill_buffer, Fset_buffer_major_mode)
8054 (advance_to_char_boundary, Fbuffer_swap_text)
8055 (Fset_buffer_multibyte, overlays_at, overlays_in)
8056 (overlay_touches_p, struct sortvec, record_overlay_string)
8057 (overlay_strings, recenter_overlay_lists)
8058 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8059 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8060 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8061 (Foverlay_recenter, last_overlay_modification_hooks_used)
8062 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8063 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8064 (validate_region): Omit unnecessary test for b <= e,
8065 since that's guaranteed by the previous test.
8066 (adjust_overlays_for_delete): Avoid pos + length overflow.
8067 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8068 (report_overlay_modification):
8069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8070 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8071 Omit pointer cast, which isn't needed anyway, and doesn't work
8072 after the EMACS_INT -> ptrdiff_t change.
8073 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
8074 * buffer.h: Adjust decls to match defn changes elsewhere.
8075 (struct buffer_text, struct buffer):
8076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8077 Use EMACS_INT, not int, where int might not be wide enough.
8078 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8079 not int, to avoid needless 32-bit limit on 64-bit hosts.
8080 (exec_byte_code): Use tighter memory-full test, one that checks
8081 for alloca overflow. Don't compute the address of the object just
8082 before an array, as that's not portable. Use EMACS_INT, not
8083 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
8084 * callint.c (Fcall_interactively):
8085 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8086 * callproc.c (call_process_kill, Fcall_process):
8087 Don't assume pid_t fits into an Emacs fixnum.
8088 (call_process_cleanup, Fcall_process, child_setup):
8089 Don't assume pid_t fits into int.
8090 (call_process_cleanup, Fcall_process, delete_temp_file)
8091 (Fcall_process_region):
8092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8093 (Fcall_process): Simplify handling of volatile integers.
8094 Use int, not EMACS_INT, where int will do.
8095 * casefiddle.c (casify_object, casify_region, operate_on_word)
8096 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8097 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8098 (casify_object): Avoid integer overflow when overallocating buffer.
8099 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
8100 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
8101 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8102 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8103 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8104 integers are now checked earlier. All uses replaced with XINT.
8105 (ccl_driver):
8106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8107 For CCL_MapSingle, check that content and value are in int range.
8108 (ccl_driver, Fregister_code_conversion_map):
8109 Check that Vcode_version_map_vector is a vector.
8110 (resolve_symbol_ccl_program): Check that vector header is in range.
8111 Always copy the vector, so that we can check its contents reliably
8112 now rather than having to recheck each instruction as it's being
8113 executed. Check that vector words fit in 'int'.
8114 (ccl_get_compiled_code, Fregister_ccl_program)
8115 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8116 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8117 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8118 contents are in range.
8119 (Fccl_execute_on_string): Check that status is in range.
8120 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8121 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8122 Accept and return EMACS_INT, not int, because callers can pass values
8123 out of 'int' range.
8124 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8125 (multibyte_chars_in_text, parse_str_as_multibyte)
8126 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8127 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8128 (string_escape_byte8, Fget_byte):
8129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8130 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
8131 avoid mishandling large integers.
8132 * character.h: Adjust decls to match defn changes elsewhere.
8133 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8134 (Ffind_charset_region):
8135 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8136 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8137 (load_charset_map_from_vector, Fdefine_charset_internal):
8138 Don't assume fixnum fits in int.
8139 (load_charset_map_from_vector, Fmap_charset_chars):
8140 Remove now-unnecessary CHECK_NATNUMs.
8141 (Fdefine_charset_internal): Check ranges here, more carefully.
8142 Don't rely on undefined behavior with signed left shift overflow.
8143 Don't assume unsigned int fits into fixnum, or that fixnum fits
8144 into unsigned int. Don't require max_code to be a valid fixnum;
8145 that's not true for gb10830 4-byte on a 32-bit host. Allow
8146 invalid_code to be a cons, for the same reason. Require code_offset
8147 to be a character. Avoid int overflow if max_char is close
8148 to INT_MAX.
8149 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8150 this is intended anyway and avoids some undefined behavior.
8151 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8152 INDEX_TO_CODE_POINT, as that's what it expects.
8153 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
8154 * charset.h (DECODE_CHAR): Return int, not unsigned;
8155 this is what was intended anyway, and it avoids undefined behavior.
8156 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8157 integer-overflow issues.
8158 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8159 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8160 where the argument is EMACS_INT, and this behavior is not intended.
8161 * chartab.c (Fmake_char_table, Fset_char_table_range)
8162 (uniprop_get_decoder, uniprop_get_encoder):
8163 Don't assume fixnum fits in int.
8164 * cmds.c (move_point): New function, that does the gist of
8165 Fforward_char and Fbackward_char, but does so while checking
8166 for integer overflow more accurately.
8167 (Fforward_char, Fbackward_char): Use it.
8168 (Fforward_line, Fend_of_line, internal_self_insert)
8169 (internal_self_insert):
8170 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8171 Fix a FIXME, by checking for integer overflow when calculating
8172 target_clm and actual_clm.
8173 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8174 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
8175 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8176 (coding_alloc_by_making_gap, alloc_destination)
8177 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8178 (encode_coding_utf_16, detect_coding_emacs_mule)
8179 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8180 (detect_coding_iso_2022, decode_coding_iso_2022)
8181 (encode_invocation_designation, encode_designation_at_bol)
8182 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8183 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8184 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8185 (encode_coding_ccl, encode_coding_raw_text)
8186 (detect_coding_charset, decode_coding_charset)
8187 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8188 (produce_composition, produce_charset, produce_annotation)
8189 (decode_coding, handle_composition_annotation)
8190 (handle_charset_annotation, consume_chars, decode_coding_gap)
8191 (decode_coding_object, encode_coding_object, detect_coding_system)
8192 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8193 (code_convert_region, code_convert_string)
8194 (Fdefine_coding_system_internal)
8195 (coding_set_source, coding_set_destination):
8196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8197 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8198 (Fdefine_coding_system_internal):
8199 Don't assume fixnums fit in int.
8200 (decode_coding_gap, decode_coding_object, encode_coding_object)
8201 (Fread_coding_system, Fdetect_coding_region)
8202 (Funencodable_char_position, Fcheck_coding_systems_region)
8203 (get_translation, handle_composition_annotation, consume_chars):
8204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8205 (consume_chars): Rewrite to not calculate an address outside buffer.
8206 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
8207 Don't access memory outside of the args array.
8208 (Fdefine_coding_system_internal): Check for charset-id overflow.
8209 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8210 result of ENCODE_CHAR.
8211 * coding.h: Adjust decls to match defn changes elsewhere.
8212 (struct coding_system):
8213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8214 * composite.c (get_composition_id, find_composition)
8215 (run_composition_function, update_compositions)
8216 (compose_text, composition_gstring_put_cache)
8217 (composition_gstring_p, composition_gstring_width)
8218 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8219 (composition_compute_stop_pos, composition_reseat_it)
8220 (composition_update_it, struct position_record)
8221 (find_automatic_composition, composition_adjust_point)
8222 (Fcomposition_get_gstring, Ffind_composition_internal):
8223 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8224 (update_compositions):
8225 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8226 * composite.h: Adjust decls to match defn changes elsewhere.
8227 (struct composition):
8228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8229 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8230 Do not attempt to compute the address of the object just before a
8231 buffer; this is not portable.
8232 (Faref, Faset):
8233 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8234 (Faset): Use int, not EMACS_INT, where int is wide enough.
8235 (Fstring_to_number): Don't assume fixnums fit in int.
8236 (Frem): Don't assume arg is nonnegative.
8237 * dbusbind.c (xd_append_arg): Check for integers out of range.
8238 (Fdbus_call_method): Don't overflow the timeout int.
8239 (extract_signed, extract_unsigned): New functions.
8240 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8241 (xd_get_connection_references): Return ptrdiff_t, not int.
8242 All uses changed.
8243 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8244 (xd_read_message_1):
8245 Use int, not unsigned, where the dbus API uses int.
8246 (Fdbus_message_internal): Don't overflow mtype.
8247 (syms_of_dbusbind): Allocate right-sized buffer for integers.
8248 * dired.c (directory_files_internal, file_name_completion, scmp)
8249 (file_name_completion_stat):
8250 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8251 (file_name_completion): Don't overflow matchcount.
8252 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8253 * dispextern.h: Adjust decls to match defn changes elsewhere.
8254 (struct text_pos, struct glyph, struct bidi_saved_info)
8255 (struct bidi_string_data, struct bidi_it, struct composition_it)
8256 (struct it):
8257 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8258 (struct display_pos, struct composition_it, struct it):
8259 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8260 * dispnew.c (increment_matrix_positions)
8261 (increment_row_positions, mode_line_string)
8262 (marginal_area_string):
8263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8264 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
8265 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8266 (duration_to_sec_usec): New function, to check for overflow better.
8267 (Fsleep_for, sit_for): Use it.
8268 * doc.c (get_doc_string, store_function_docstring):
8269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8270 (get_doc_string, Fsnarf_documentation):
8271 Use int, not EMACS_INT, where int is wide enough.
8272 (get_doc_string):
8273 Use SAFE_ALLOCA, not alloca.
8274 Check for overflow when converting EMACS_INT to off_t.
8275 * doprnt.c (doprnt):
8276 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8277 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8278 Don't assume uid_t fits into fixnum.
8279 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8280 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8281 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8282 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8283 (general_insert_function)
8284 (Finsert_char, make_buffer_string, make_buffer_string_both)
8285 (update_buffer_properties, Fbuffer_substring)
8286 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8287 (Fsubst_char_in_region, check_translation)
8288 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8289 (transpose_markers, Ftranspose_regions):
8290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8291 (clip_to_bounds): Move to lisp.h as an inline function).
8292 (Fconstrain_to_field): Don't assume integers are nonnegative.
8293 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8294 (Fsubst_char_in_region, Fsave_restriction):
8295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8296 (Femacs_pid): Don't assume pid_t fits into fixnum.
8297 (lo_time): Use int, not EMACS_INT, when int suffices.
8298 (lisp_time_argument): Check for usec out of range.
8299 (Fencode_time): Don't assume fixnum fits in int.
8300 (Fuser_login_name, Fuser_full_name): Signal an error
8301 if a uid argument is out of range, rather than relying on
8302 undefined behavior.
8303 (Fformat_time_string): Remove now-unnecessary check.
8304 lisp_time_argument checks for out-of-range usec now.
8305 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
8306 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8307 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8308 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8309 (init_cmdargs, Fdump_emacs):
8310 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8311 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8312 the bottom (typically) 32 bits of the fixnum.
8313 * eval.c (specpdl_size, call_debugger):
8314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8315 (when_entered_debugger, Fbacktrace_debug):
8316 Don't assume fixnum can fit in int.
8317 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8318 the object just before a buffer; this is not portable.
8319 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8320 (grow_specpdl, unbind_to):
8321 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8322 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8323 (grow_specpdl): Simplify allocation by using xpalloc.
8324 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
8325 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8326 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8327 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8328 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8329 (a_write, e_write):
8330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8331 (Fcopy_file, non_regular_nbytes, read_non_regular)
8332 (Finsert_file_contents):
8333 Use int, not EMACS_INT, where int is wide enough.
8334 (READ_BUF_SIZE): Verify that it fits in int.
8335 (Finsert_file_contents): Check that counts are in proper range,
8336 rather than assuming fixnums fit into ptrdiff_t etc.
8337 Don't assume fixnums fit into int.
8338 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
8339 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8340 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
8341 (string_char_to_byte, string_byte_to_char)
8342 (string_make_multibyte, string_to_multibyte)
8343 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8344 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8345 (substring_both, Fdelete, internal_equal, Ffillarray)
8346 (Fclear_string, mapcar1)
8347 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8348 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8349 (larger_vector, make_hash_table, maybe_resize_hash_table)
8350 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8351 (Fmaphash, secure_hash):
8352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8353 (concat): Check for string index and length overflow.
8354 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8355 (Frequire):
8356 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8357 (larger_vector): New API (vec, incr_min, size_max) replaces old
8358 one (vec, new_size, init). This catches size overflow.
8359 INIT was removed because it was always Qnil.
8360 All callers changed.
8361 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8362 the upper bound on a hash table index size.
8363 (make_hash_table, maybe_resize_hash_table): Use it.
8364 (secure_hash): Computer start_byte and end_byte only after
8365 they're known to be in ptrdiff_t range.
8366 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8367 (Ffont_get_glyphs, Ffont_at):
8368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8369 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8370 (Flist_fonts, Fopen_font):
8371 Don't assume fixnum can fit in int.
8372 (check_gstring): Don't assume index can fit in int.
8373 (font_match_p): Check that fixnum is a character, not a nonnegative
8374 fixnum, since the later code needs to stuff it into an int.
8375 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8376 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8377 conversion overflow issues.
8378 (Fopen_font): Check for integer out of range.
8379 (Ffont_get_glyphs): Don't assume index can fit in int.
8380 * font.h: Adjust decls to match defn changes elsewhere.
8381 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8382 integer overflow.
8383 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8384 printmax_t, where ptrdiff_t is wide enough.
8385 (Finternal_char_font):
8386 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8387 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8388 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8389 (Fset_frame_position, x_set_frame_parameters)
8390 (x_set_line_spacing, x_set_border_width)
8391 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8392 Check that fixnums are in proper range for system types.
8393 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8395 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8396 Use SAFE_ALLOCA_LISP, not alloca.
8397 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8398 intptr_t is wide enough.
8399 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8400 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8401 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8402 Check for fixnum out of range.
8403 * ftfont.c (ftfont_list): Don't assume index fits in int.
8404 Check that fixnums are in proper range for system types.
8405 (ftfont_shape_by_flt):
8406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8407 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8409 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8410 Check that fixnums are in proper range for system types.
8411 * gnutls.h: Adjust decls to match defn changes elsewhere.
8412 * gtkutil.c (xg_dialog_run):
8413 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8414 (update_frame_tool_bar):
8415 Check that fixnums are in proper range for system types.
8416 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
8417 (lookup_image): Check that fixnums are in range for system types.
8418 * indent.c (last_known_column, last_known_column_point):
8419 (current_column_bol_cache):
8420 (skip_invisible, current_column, check_display_width):
8421 (check_display_width, scan_for_column, current_column_1)
8422 (Findent_to, Fcurrent_indentation, position_indentation)
8423 (indented_beyond_p, Fmove_to_column, compute_motion):
8424 (Fcompute_motion, Fvertical_motion):
8425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8426 (last_known_column_modified): Use EMACS_INT, not int.
8427 (check_display_width):
8428 (Fcompute_motion):
8429 Check that fixnums and floats are in proper range for system types.
8430 (compute_motion): Don't assume index or fixnum fits in int.
8431 (compute_motion, Fcompute_motion):
8432 Use int, not EMACS_INT, when it is wide enough.
8433 (vmotion): Omit local var start_hpos that is always 0; that way
8434 we don't need to worry about overflow in expressions involving it.
8435 * indent.h: Adjust decls to match defn changes elsewhere.
8436 (struct position):
8437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8438 Use int, not EMACS_INT, where int is wide enough.
8439 Remove unused members ovstring_chars_done and tab_offset;
8440 all uses removed.
8441 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8442 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8443 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8444 (make_gap, copy_text, insert, insert_and_inherit)
8445 (insert_before_markers, insert_before_markers_and_inherit)
8446 (insert_1, count_combining_before, count_combining_after)
8447 (insert_1_both, insert_from_string)
8448 (insert_from_string_before_markers, insert_from_string_1)
8449 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8450 (adjust_after_replace, adjust_after_insert, replace_range)
8451 (replace_range_2, del_range, del_range_1, del_range_byte)
8452 (del_range_both, del_range_2, modify_region)
8453 (prepare_to_modify_buffer, signal_before_change)
8454 (signal_after_change, Fcombine_after_change_execute):
8455 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8456 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8457 (balance_an_interval, split_interval_right, split_interval_left)
8458 (find_interval, next_interval, update_interval)
8459 (adjust_intervals_for_insertion, delete_node, delete_interval)
8460 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8461 (static_offset_intervals, offset_intervals)
8462 (merge_interval_right, merge_interval_left, make_new_interval)
8463 (graft_intervals_into_buffer, temp_set_point_both)
8464 (temp_set_point, set_point, adjust_for_invis_intang)
8465 (set_point_both, move_if_not_intangible, get_property_and_range)
8466 (get_local_map, copy_intervals, copy_intervals_to_string)
8467 (compare_string_intervals, set_intervals_multibyte_1):
8468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8469 * intervals.h: Adjust decls to match defn changes elsewhere.
8470 (struct interval):
8471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8472 * keyboard.c (this_command_key_count, this_single_command_key_start)
8473 (before_command_key_count, before_command_echo_length, echo_now)
8474 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8475 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8476 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8477 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8479 (last_non_minibuf_size, last_point_position, echo_truncate)
8480 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8481 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8482 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8483 (stuff_buffered_input):
8484 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8485 (last_auto_save, command_loop_1, read_char):
8486 Use EMACS_INT, not int, to avoid integer overflow.
8487 (record_char): Avoid overflow in total_keys computation.
8488 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8489 * keyboard.h: Adjust decls to match defn changes elsewhere.
8490 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8491 (Fkey_description, Fdescribe_vector, Flookup_key):
8492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8493 (click_position): New function, to check that positions are in range.
8494 (Fcurrent_active_maps):
8495 (describe_command):
8496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8497 (Faccessible_keymaps, Fkey_description):
8498 (preferred_sequence_p):
8499 Don't assume fixnum can fit into int.
8500 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8501 Check for integer overflow in size calculations.
8502 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8503 avoid mishandling large integers.
8504 * lisp.h: Adjust decls to match defn changes elsewhere.
8505 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8506 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8507 (struct Lisp_Marker):
8508 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8509 (clip_to_bounds): Now an inline function, moved here from editfns.c.
8510 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8511 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8512 All callers changed.
8513 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8514 Assume the arg has valid form, since it always does.
8515 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8516 unsigned integer system type.
8517 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8518 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8519 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8520 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8521 (duration_to_sec_usec): New decl.
8522 * lread.c (read_from_string_index, read_from_string_index_byte)
8523 (read_from_string_limit, readchar, unreadchar, openp)
8524 (read_internal_start, read1, oblookup):
8525 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8526 (Fload, readevalloop, Feval_buffer, Feval_region):
8527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8528 (openp): Check for out-of-range argument to 'access'.
8529 (read1): Use int, not EMACS_INT, where int is wide enough.
8530 Don't assume fixnum fits into int.
8531 Fix off-by-one error that can read outside a buffer.
8532 (read_filtered_event): Use duration_to_sec_usec
8533 to do proper overflow checking on durations.
8534 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8535 in size calculation.
8536 (Fexecute_kbd_macro):
8537 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8538 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8539 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8540 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8541 (set_marker_both, set_marker_restricted_both, marker_position)
8542 (marker_byte_position, Fbuffer_has_markers_at):
8543 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8544 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
8545 * menu.c (ensure_menu_items): Rename from grow_menu_items.
8546 It now merely ensures that the menu is large enough, without
8547 necessarily growing it, as this avoids some integer overflow issues.
8548 All callers changed.
8549 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8550 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8551 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8552 Use SAFE_ALLOCA_LISP, not alloca.
8553 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8554 to EMACS_INT. Check that fixnums are in proper range for system types.
8555 * minibuf.c (minibuf_prompt_width, string_to_object)
8556 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8557 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8558 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8559 (get_minibuffer, read_minibuf_unwind):
8560 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8561 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
8562 this simplifies overflow checking. All callers changed.
8563 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
8564 (Ftest_completion):
8565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8566 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
8567 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
8568 Check that fixnums are in proper range for system types.
8569 (Fx_create_frame, Fx_show_tip):
8570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8571 * nsfont.m (ns_findfonts, nsfont_list_family):
8572 Don't assume fixnum fits in long.
8573 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
8574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8575 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
8576 wide enough.
8577 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
8578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8579 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
8580 (PRINTDECLARE, PRINTPREPARE):
8581 (strout, print_string):
8582 (print, print_preprocess, print_check_string_charset_prop)
8583 (print_object):
8584 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8585 (PRINTDECLARE):
8586 (temp_output_buffer_setup, Fprin1_to_string, print_object):
8587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8588 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
8589 (printchar, strout): Use xpalloc to catch size calculation overflow.
8590 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
8591 (print_error_message): Use SAFE_ALLOCA, not alloca.
8592 (print_object): Use int, not EMACS_INT, where int is wide enough.
8593 (print_depth, new_backquote_output, print_number_index):
8594 Use ptrdiff_t, not int, where int might not be wide enough.
8595 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
8596 (Fset_process_window_size, Fformat_network_address)
8597 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
8598 (sigchld_handler):
8599 Check that fixnums are in proper range for system types.
8600 (Fsignal_process): Simplify by avoiding a goto.
8601 Check for process-ids out of pid_t range rather than relying on
8602 undefined behavior.
8603 (process_tick, update_tick): Use EMACS_INT, not int.
8604 (Fformat_network_address, read_process_output, send_process)
8605 (Fprocess_send_region, status_notify):
8606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8607 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
8608 (wait_reading_process_output, read_process_output, exec_sentinel):
8609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8610 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
8611 (Faccept_process_output): Use duration_to_sec_usec to do proper
8612 overflow checking on durations.
8613 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
8614 Don't assume pid_t fits in int.
8615 * process.h (struct Lisp_Process): Members tick and update_tick
8616 are now of type EMACS_INT, not int.
8617 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
8618 configured --with-wide-int.
8619 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
8620 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
8621 * search.c (looking_at_1, string_match_1):
8622 (fast_string_match, fast_c_string_match_ignore_case)
8623 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
8624 (scan_newline, find_before_next_newline, search_command)
8625 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
8626 (set_search_regs, wordify):
8627 (Freplace_match):
8628 (Fmatch_data):
8629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8630 (string_match_1, search_buffer, set_search_regs):
8631 (Fmatch_data):
8632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8633 (wordify): Check for overflow in size calculation.
8634 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
8635 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
8636 Check that fixnums are in proper range for system types.
8637 * sound.c (struct sound_device)
8638 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
8639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8640 (Fplay_sound_internal):
8641 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8642 * syntax.c (struct lisp_parse_state, find_start_modiff)
8643 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
8644 (Fparse_partial_sexp):
8645 Don't assume fixnums can fit in int.
8646 (struct lisp_parse_state, find_start_pos, find_start_value)
8647 (find_start_value_byte, find_start_begv)
8648 (update_syntax_table, char_quoted, dec_bytepos)
8649 (find_defun_start, prev_char_comend_first, back_comment):
8650 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
8651 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
8652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8653 (Finternal_describe_syntax_value): Check that match_lisp is a
8654 character, not an integer, since the code stuffs it into int.
8655 (scan_words, scan_sexps_forward):
8656 Check that fixnums are in proper range for system types.
8657 (Fforward_word):
8658 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8659 (scan_sexps_forward):
8660 Use CHARACTERP, not INTEGERP, since the value must fit into int.
8661 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
8662 * syntax.h: Adjust decls to match defn changes elsewhere.
8663 (struct gl_state_s):
8664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8665 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
8666 MOST_POSITIVE_FIXNUM.
8667 * sysdep.c (wait_for_termination_1, wait_for_termination)
8668 (interruptible_wait_for_termination, mkdir):
8669 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
8670 (emacs_read, emacs_write):
8671 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8672 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
8673 and double all fit in int.
8674 * term.c (set_tty_color_mode):
8675 Check that fixnums are in proper range for system types.
8676 * termhooks.h (struct input_event):
8677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8678 * textprop.c (validate_interval_range, interval_of)
8679 (Fadd_text_properties, set_text_properties_1)
8680 (Fremove_text_properties, Fremove_list_of_text_properties)
8681 (Ftext_property_any, Ftext_property_not_all)
8682 (copy_text_properties, text_property_list, extend_property_ranges)
8683 (verify_interval_modification):
8684 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8685 (Fnext_single_char_property_change)
8686 (Fprevious_single_char_property_change):
8687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8688 (copy_text_properties):
8689 Check for integer overflow in index calculation.
8690 * undo.c (last_boundary_position, record_point, record_insert)
8691 (record_delete, record_marker_adjustment, record_change)
8692 (record_property_change):
8693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8694 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
8695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8696 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8697 (Fx_hide_tip, Fx_file_dialog):
8698 * w32menu.c (set_frame_menubar):
8699 Use ptrdiff_t, not int, for consistency with rest of code.
8700 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
8701 (select_window, Fdelete_other_windows_internal)
8702 (window_scroll_pixel_based, window_scroll_line_based)
8703 (Frecenter, Fset_window_configuration):
8704 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8705 (Fset_window_hscroll, run_window_configuration_change_hook)
8706 (set_window_buffer, temp_output_buffer_show, scroll_command)
8707 (Fscroll_other_window, Frecenter):
8708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8709 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
8710 Don't assume fixnum fits in int.
8711 (Fset_window_scroll_bars):
8712 Check that fixnums are in proper range for system types.
8713 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
8714 (string_pos, c_string_pos, number_of_chars, init_iterator)
8715 (in_ellipses_for_invisible_text_p, init_from_display_pos)
8716 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
8717 (compute_display_string_end, handle_face_prop)
8718 (face_before_or_after_it_pos, handle_invisible_prop)
8719 (handle_display_prop, handle_display_spec, handle_single_display_spec)
8720 (display_prop_intangible_p, string_buffer_position_lim)
8721 (string_buffer_position, handle_composition_prop, load_overlay_strings)
8722 (get_overlay_strings_1, get_overlay_strings)
8723 (iterate_out_of_display_property, forward_to_next_line_start)
8724 (back_to_previous_visible_line_start, reseat, reseat_to_string)
8725 (get_next_display_element, set_iterator_to_next)
8726 (get_visually_first_element, compute_stop_pos_backwards)
8727 (handle_stop_backwards, next_element_from_buffer)
8728 (move_it_in_display_line_to, move_it_in_display_line)
8729 (move_it_to, move_it_vertically_backward, move_it_by_lines)
8730 (add_to_log, message_dolog, message_log_check_duplicate)
8731 (message2, message2_nolog, message3, message3_nolog
8732 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
8733 (current_message_1, truncate_echo_area, truncate_message_1)
8734 (set_message, set_message_1, store_mode_line_noprop)
8735 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
8736 (text_outside_line_unchanged_p, check_point_in_composition)
8737 (reconsider_clip_changes)
8738 (redisplay_internal, set_cursor_from_row, try_scrolling)
8739 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
8740 (redisplay_window, find_last_unchanged_at_beg_row)
8741 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
8742 (trailing_whitespace_p, find_row_edges, display_line)
8743 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
8744 (display_mode_element, store_mode_line_string)
8745 (pint2str, pint2hrstr, decode_mode_spec)
8746 (display_count_lines, display_string, draw_glyphs)
8747 (x_produce_glyphs, x_insert_glyphs)
8748 (rows_from_pos_range, mouse_face_from_buffer_pos)
8749 (fast_find_string_pos, mouse_face_from_string_pos)
8750 (note_mode_line_or_margin_highlight, note_mouse_highlight):
8751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8752 (safe_call, init_from_display_pos, handle_fontified_prop)
8753 (handle_single_display_spec, load_overlay_strings)
8754 (with_echo_area_buffer, setup_echo_area_for_printing)
8755 (display_echo_area, echo_area_display)
8756 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
8757 (update_tool_bar, hscroll_window_tree, redisplay_internal)
8758 (redisplay_window, dump_glyph_row, display_mode_line)
8759 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
8760 (handle_display_spec, display_prop_string_p):
8761 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8762 (handle_single_display_spec, build_desired_tool_bar_string)
8763 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
8764 (get_specified_cursor_type):
8765 Check that fixnums are in proper range for system types.
8766 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
8767 (Flookup_image_map):
8768 Don't assume fixnums fit in int.
8769 (compare_overlay_entries):
8770 Avoid mishandling comparisons due to subtraction overflow.
8771 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
8772 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
8773 (handle_tool_bar_click):
8774 Use int, not unsigned, since we prefer signed and the signedness
8775 doesn't matter here.
8776 (get_next_display_element, next_element_from_display_vector):
8777 Use int, not EMACS_INT, when int is wide enough.
8778 (start_hourglass): Use duration_to_sec_usec to do proper
8779 overflow checking on durations.
8780 * xfaces.c (Fbitmap_spec_p):
8781 Check that fixnums are in proper range for system types.
8782 (compare_fonts_by_sort_order):
8783 Avoid mishandling comparisons due to subtraction overflow.
8784 (Fx_family_fonts, realize_basic_faces):
8785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8786 (Fx_family_fonts):
8787 Don't assume fixnum fits in int.
8788 Use SAFE_ALLOCA_LISP, not alloca.
8789 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
8790 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
8791 (face_at_buffer_position, face_for_overlay_string)
8792 (face_at_string_position):
8793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8794 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
8795 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
8796 (Fx_show_tip):
8797 Check that fixnums are in proper range for system types.
8798 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
8799 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
8800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8801 (Fx_change_window_property): Don't assume fixnums fit in int.
8802 * xfont.c (xfont_chars_supported):
8803 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8804 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
8805 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
8806 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8807 * xml.c (parse_region):
8808 * xrdb.c (magic_file_p):
8809 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8810 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
8811 (x_get_local_selection, x_reply_selection_request)
8812 (x_handle_selection_request, wait_for_property_change):
8813 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8814 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
8815 short is wide enough.
8816 (x_send_client_event): Don't assume fixnum fits in int.
8817 * xterm.c (x_x_to_emacs_modifiers):
8818 Don't assume EMACS_INT overflows nicely into int.
8819 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
8820 may come from Lisp.
8821 (handle_one_xevent): NATNUMP can eval its arg twice.
8822 (x_connection_closed):
8823 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8824 * xterm.h: Adjust decls to match defn changes elsewhere.
8825 (struct scroll_bar): Use struct vectorlike_header
8826 rather than rolling our own approximation.
8827 (SCROLL_BAR_VEC_SIZE): Remove; not used.
8828
8829 2012-05-25 Glenn Morris <rgm@gnu.org>
8830
8831 * lisp.mk (lisp): Update for more files being compiled now.
8832
8833 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
8834
8835 * lread.c: Remove `read_pure' which makes no difference.
8836 (read_pure): Remove var.
8837 (unreadpure): Remove function.
8838 (readevalloop): Don't call read_list with -1 flag.
8839 (read1, read_vector): Don't test read_pure any more.
8840 (read_list): Simplify.
8841
8842 * fileio.c, character.h: Minor style tweaks.
8843
8844 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
8845
8846 * window.h (clip_changed): Remove useless declaration.
8847
8848 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
8849
8850 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
8851 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
8852
8853 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
8854
8855 Remove src/m/*.
8856 This directory predates autoconf and is no longer needed nowadays.
8857 Move its few remaining bits of functionality to where they're needed.
8858 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
8859 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
8860 * m/template.h: Remove.
8861 * Makefile.in (M_FILE): Remove. All uses removed.
8862 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
8863 * lisp.h (USE_LSB_TAG):
8864 * mem-limits.h (EXCEEDS_LISP_PTR):
8865 Use VAL_MAX, not VALBITS, in #if.
8866 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
8867 (EMACS_UINT): Define unconditionally now.
8868 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
8869 (BITS_PER_EMACS_INT): New constants, replacing
8870 what used to be in config.h, but not useful in #if.
8871 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
8872 define them any more.
8873 (VAL_MAX): New macro.
8874 (VALMASK): Use it.
8875 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
8876 BITS_PER_EMACS_INT, in #if.
8877 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
8878 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
8879 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
8880 * s/ms-w32.h (DATA_START):
8881 Move here from removed file m/intel386.h.
8882 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
8883 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
8884
8885 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
8886
8887 Assume C89 or later.
8888 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
8889 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
8890 (xrealloc):
8891 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
8892 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
8893 * textprop.c, tparam.c (NULL): Remove.
8894 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
8895 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
8896 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
8897 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
8898 * xterm.c (input_signal_count): Assume volatile works.
8899
8900 2012-05-21 Ken Brown <kbrown@cornell.edu>
8901
8902 * xgselect.c (xg_select): Fix first argument in call to 'select'
8903 (bug#11508).
8904
8905 2012-05-20 Ken Brown <kbrown@cornell.edu>
8906
8907 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
8908 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
8909
8910 2012-05-19 Ken Brown <kbrown@cornell.edu>
8911
8912 * xfns.c (x_in_use): Remove `static' qualifier.
8913 * xterm.h (x_in_use): Declare.
8914 * xgselect.c: Include xterm.h.
8915 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
8916 and `display_arg' (bug#9754).
8917
8918 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
8919
8920 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
8921
8922 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
8923 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
8924
8925 2012-05-18 Eli Zaretskii <eliz@gnu.org>
8926
8927 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
8928
8929 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
8930 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
8931
8932 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
8933 reference to image_cache->refcount.
8934 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
8935
8936 2012-05-17 Juri Linkov <juri@jurta.org>
8937
8938 * search.c (Fword_search_regexp, Fword_search_backward)
8939 (Fword_search_forward, Fword_search_backward_lax)
8940 (Fword_search_forward_lax): Move functions to isearch.el
8941 (bug#10145, bug#11381).
8942
8943 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
8944
8945 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
8946
8947 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
8948
8949 * lread.c (init_obarray): Declare Qt and Qnil as special.
8950
8951 2012-05-14 Glenn Morris <rgm@gnu.org>
8952
8953 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
8954 Put "libexec" before "bin", for the sake of init_callproc_1.
8955
8956 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8957
8958 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
8959
8960 * unexaix.c: Port to more-recent AIX compilers.
8961 (report_error, report_error_1, make_hdr, copy_sym)
8962 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
8963 Make arguments const char *, not char *, to avoid violations of C
8964 standard and to fix some AIX warnings reported by Gilles Pion.
8965
8966 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8967
8968 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
8969 already have overlays loaded.
8970 (handle_single_display_spec): Before returning without displaying
8971 fringe bitmap, synchronize the bidi iterator with the main display
8972 iterator, by calling iterate_out_of_display_property.
8973 (iterate_out_of_display_property): Detect buffer iteration by
8974 testing that it->string is a Lisp string.
8975 (get_next_display_element): When the current object is exhausted,
8976 and there's something on it->stack, call set_iterator_to_next to
8977 proceed with what's on the stack, instead of returning zero.
8978 (set_iterator_to_next): If called at the end of a Lisp string,
8979 proceed to consider_string_end without incrementing string
8980 position. Don't increment display vector index past the end of
8981 the display vector. (Bug#11417)
8982 (pos_visible_p): Don't report a position visible when move_it_to
8983 stopped at the last line of window, which happens to be scanned
8984 backwards by the bidi iteration. (Bug#11464)
8985
8986 2012-05-14 Eli Zaretskii <eliz@gnu.org>
8987
8988 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
8989 and right-margin display specs even if the spec is invalid or we
8990 are on a TTY, and thus unable to display on the fringes.
8991 That's because the text with the property will not be displayed anyway,
8992 so we need to signal to the caller that this is a "replacing"
8993 display spec. This fixes display when the spec is invalid or we
8994 are on a TTY.
8995
8996 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
8997
8998 * unexaix.c (make_hdr): Fix typo in prototype.
8999 This bug broke the build on AIX. Problem reported by Gilles Pion.
9000
9001 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
9002
9003 * keyboard.c (kbd_buffer_get_event): Read special events also in
9004 batch mode. (Bug#11415)
9005
9006 2012-05-12 Glenn Morris <rgm@gnu.org>
9007
9008 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9009
9010 2012-05-12 Eli Zaretskii <eliz@gnu.org>
9011
9012 * lisp.mk (lisp): Add newcomment.elc.
9013
9014 2012-05-12 Glenn Morris <rgm@gnu.org>
9015
9016 * Makefile.in (MKDIR_P): New, set by configure.
9017 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9018
9019 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9020
9021 Remove unused function hourglass_started.
9022 * dispextern.h (hourglass_started):
9023 * w32fns.c (hourglass_started):
9024 * xdisp.c (hourglass_started): Remove.
9025
9026 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
9027
9028 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9029 Update dependencies.
9030
9031 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9032
9033 * xgselect.c (xg_select): Put maxfds+1 into a var.
9034 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9035
9036 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9037
9038 2012-05-10 Dave Abrahams <dave@boostpro.com>
9039
9040 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9041 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9042
9043 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
9044
9045 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9046 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9047 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9048 Initialize xd_registered_buses.
9049
9050 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9051
9052 Untag more efficiently if USE_LSB_TAG.
9053 This is based on a proposal by YAMAMOTO Mitsuharu in
9054 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9055 For an admittedly artificial (nth 8000 longlist) benchmark on
9056 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9057 Emacs's overall text size by 1%.
9058 * lisp.h (XUNTAG): New macro.
9059 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9060 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9061 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9062 * eval.c (Fautoload):
9063 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9064 * frame.h (XFRAME): Use XUNTAG.
9065
9066 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9067 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9068 Remove unportable assumptions about print widths of types like
9069 dbus_uint32_t.
9070 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9071 intptr_t when converting between pointer and integer, to avoid GCC
9072 warnings about wrong width.
9073
9074 2012-05-09 Eli Zaretskii <eliz@gnu.org>
9075
9076 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9077 stack for each reader_thread, instead of defaulting to 8MB
9078 determined by the linker. This avoids failures in creating
9079 subprocesses on Windows 7, see the discussion in this thread:
9080 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9081
9082 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9083
9084 Fix up display of the *Minibuf-0* buffer in the mini window.
9085 * keyboard.c (read_char): Don't clear the echo area if there's no
9086 message to clear.
9087 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
9088 contents of *Minibuf-0*) if there's no message displayed in its stead.
9089
9090 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
9091
9092 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9093 batch mode.
9094
9095 2012-05-06 Chong Yidong <cyd@gnu.org>
9096
9097 * lisp.mk (lisp): Update.
9098
9099 2012-05-05 Jim Meyering <meyering@redhat.com>
9100
9101 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9102
9103 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9104
9105 * data.c (PUT_ERROR): New macro.
9106 (syms_of_data): Use it. Add new error type `user-error'.
9107 * undo.c (user_error): New function.
9108 (Fprimitive_undo): Use it.
9109 * print.c (print_error_message): Adjust print style for `user-error'.
9110 * keyboard.c (user_error): New function.
9111 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9112
9113 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9114
9115 Do not limit current-time-string to years 1000..9999.
9116 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9117 (Fcurrent_time_string): Support any year that is supported by the
9118 underlying localtime representation. Don't use asctime, as it
9119 has undefined behavior for years outside the range -999..9999.
9120
9121 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9122
9123 Fix race conditions involving setenv, gmtime, localtime, asctime.
9124 Without this fix, interrupts could mess up code that uses these
9125 nonreentrant functions, since setting TZ invalidates existing
9126 tm_zone or tzname values, and since most of these functions return
9127 pointers to static storage.
9128 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9129 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9130 Grow the critical sections to include not just invoking
9131 localtime/gmtime, but also accessing these functions' results
9132 including their tm_zone values if any, and any related TZ setting.
9133 (format_time_string): Last arg is now struct tm *, not struct tm **,
9134 so that the struct tm is saved in the critical section.
9135 All callers changed. Simplify allocation of initial buffer, partly
9136 motivated by the fact that memory allocation needs to be outside
9137 the critical section.
9138
9139 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9140
9141 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9142 with RESET_INTERVAL.
9143
9144 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9145 Remove duplicated buffer name initialization.
9146
9147 2012-05-02 Jim Meyering <jim@meyering.net>
9148
9149 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9150
9151 * xfns.c (x_window): Use xstrdup (Bug#11375).
9152
9153 2012-05-02 Eli Zaretskii <eliz@gnu.org>
9154
9155 * xdisp.c (pos_visible_p): If already at a newline from the
9156 display string before the 'while' loop, don't walk back the glyphs
9157 from it3.glyph_row. Solves assertion violation when the display
9158 string begins with a newline (egg.el). (Bug#11367)
9159
9160 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9161
9162 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9163 Move to simple.el.
9164
9165 2012-05-01 Glenn Morris <rgm@gnu.org>
9166
9167 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9168 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9169 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9170 All were removed before 23.1.
9171
9172 * dispnew.c: Remove HAVE_LIBNCURSES test;
9173 it is always true on relevant platforms.
9174
9175 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9176 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9177
9178 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9179
9180 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9181
9182 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9183 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9184 Remove.
9185
9186 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9187
9188 Do not avoid creating empty evaporating overlays (Bug#9642).
9189 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9190 That is, do not delete an evaporating overlay if it becomes
9191 empty after its bounds are adjusted to fit within its buffer.
9192 This fix caused other problems, and I'm reverting it until we get
9193 to the bottom of them.
9194
9195 2012-04-27 Chong Yidong <cyd@gnu.org>
9196
9197 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9198
9199 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9200
9201 * xdisp.c (pos_visible_p): If the window start position is beyond
9202 ZV, start the display from buffer beginning. Prevents assertion
9203 violation in init_iterator when the minibuffer window is scrolled
9204 via the scroll bar.
9205
9206 * window.c (window_scroll_pixel_based): Likewise.
9207
9208 2012-04-27 Chong Yidong <cyd@gnu.org>
9209
9210 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9211
9212 2012-04-27 Glenn Morris <rgm@gnu.org>
9213
9214 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9215 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9216
9217 2012-04-27 Eli Zaretskii <eliz@gnu.org>
9218
9219 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9220 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
9221
9222 2012-04-26 Eli Zaretskii <eliz@gnu.org>
9223
9224 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9225 display element, check also the underlying string or buffer
9226 character. (Bug#11341)
9227
9228 * w32menu.c: Include w32heap.h.
9229 (add_menu_item): If the call to AppendMenuW (via
9230 unicode_append_menu) fails, disable Unicode menus only if we are
9231 running on Windows 9X/Me.
9232
9233 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9234
9235 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9236 (xgetint): Add missing shift for LSB tags.
9237
9238 2012-04-24 Martin Rudalics <rudalics@gmx.at>
9239
9240 * keyboard.c (read_char): Don't wipe echo area for select window
9241 events: These might get delayed via `mouse-autoselect-window'
9242 (Bug#11304).
9243
9244 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
9245
9246 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9247 manipulation of :loaded-from data.
9248
9249 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
9250
9251 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9252 now a cons (bug#11311).
9253
9254 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9255
9256 Do not create empty overlays with the evaporate property (Bug#9642).
9257 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9258 if it becomes empty after its bounds are adjusted to fit within
9259 its buffer. Without this fix, in a nonempty buffer (let ((o
9260 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9261 yields an empty overlay that has the evaporate property, which is
9262 not supposed to happen.
9263
9264 Fix minor GTK3 problems found by static checking.
9265 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9266 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9267 (struct _EmacsFixedClass, emacs_fixed_get_type):
9268 Move decls here from emacsgtkfixed.h, since they needn't be public.
9269 (emacs_fixed_get_type): Now static.
9270 (emacs_fixed_class_init): Omit unused local.
9271 (emacs_fixed_child_type): Remove; unused.
9272 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9273 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9274 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9275 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9276 (EMACS_FIXED_GET_CLASS): Remove; unused.
9277 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9278
9279 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9280 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9281
9282 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9283
9284 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
9285 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
9286 (__malloc_size_t, __malloc_ptrdiff_t):
9287 Remove. All uses removed, replaced by the definiens if needed,
9288 since we can assume C89 or better now.
9289 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9290 (protect_malloc_state, align, get_contiguous_space)
9291 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9292 (malloc_atfork_handler_child, malloc_enable_thread)
9293 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9294 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9295 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9296 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9297 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9298 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9299 Define using prototypes, not old style.
9300 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9301 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9302 (align): Don't assume that signed integer overflow wraps around.
9303 Omit unused local var.
9304 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9305 (_free_internal_nolock, memalign, mallochook, reallochook):
9306 Omit no-longer-needed casts.
9307 (valloc): Use getpagesize, not __getpagesize.
9308 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9309 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9310
9311 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9312
9313 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
9314
9315 Move functions from C to Lisp. Make non-blocking method calls
9316 the default. Implement further D-Bus standard interfaces.
9317
9318 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9319 (QCdbus_request_name_allow_replacement)
9320 (QCdbus_request_name_replace_existing)
9321 (QCdbus_request_name_do_not_queue)
9322 (QCdbus_request_name_reply_primary_owner)
9323 (QCdbus_request_name_reply_in_queue)
9324 (QCdbus_request_name_reply_exists)
9325 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9326 (QCdbus_registered_serial, QCdbus_registered_method)
9327 (QCdbus_registered_signal): New Lisp objects.
9328 (XD_DEBUG_MESSAGE): Use sizeof.
9329 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9330 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9331 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9332 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9333 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9334 (xd_signature, xd_append_arg): Allow float for integer types.
9335 (xd_get_connection_references): New function.
9336 (xd_get_connection_address): Rename from xd_initialize.
9337 Return cached address.
9338 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9339 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9340 level.
9341 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9342 Return number of refcounts.
9343 (Fdbus_get_unique_name): Make stronger parameter check.
9344 (Fdbus_message_internal): New defun.
9345 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9346 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9347 (Fdbus_send_signal, Fdbus_register_service)
9348 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9349 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9350 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9351 (Vdbus_compiled_version, Vdbus_runtime_version)
9352 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9353 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9354 (Vdbus_message_type_signal): New defvars.
9355 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9356 Adapt docstring.
9357
9358 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9359
9360 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9361 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9362 Do not assume ptrdiff_t is the same width as 'int'.
9363
9364 * alloc.c: Handle unusual debugging option combinations.
9365 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9366 since the two debugging options are incompatible.
9367 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9368 is defined.
9369 (mem_init, mem_insert, mem_insert_fixup):
9370 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9371 (NEED_MEM_INSERT): Remove; no longer needed.
9372
9373 2012-04-22 Leo Liu <sdl.web@gmail.com>
9374
9375 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9376
9377 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9378
9379 * sysdep.c [__FreeBSD__]: Minor cleanups.
9380 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9381 Use Emacs indenting style more consistently. Avoid some casts.
9382 Use 'double' consistently rather than mixing 'float' and 'double'.
9383
9384 2012-04-21 Eduard Wiebe <usenet@pusto.de>
9385
9386 * sysdep.c (list_system_processes, system_process_attributes):
9387 Add implementation for FreeBSD (Bug#5243).
9388
9389 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9390
9391 * lisp.mk (lisp): Update.
9392
9393 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9394
9395 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9396 It is never used otherwise.
9397
9398 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9399
9400 * print.c (print_preprocess): Only check print_depth if print-circle
9401 is nil.
9402 (print_object): Check for cycles even when print-circle is nil and
9403 print-gensym is t, but only check print_depth if print-circle is nil.
9404
9405 2012-04-20 Chong Yidong <cyd@gnu.org>
9406
9407 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9408 set the status to "failed" and ensure that sentinel is run.
9409
9410 2012-04-20 Glenn Morris <rgm@gnu.org>
9411
9412 * process.c (Fset_process_inherit_coding_system_flag)
9413 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
9414 (Fmake_network_process, Fmake_serial_process): Doc fix.
9415
9416 2012-04-20 Eli Zaretskii <eliz@gnu.org>
9417
9418 * xdisp.c (string_buffer_position_lim): Limit starting position to
9419 BEGV.
9420 (set_cursor_from_row): If called for a mode-line or header-line
9421 row, return zero immediately.
9422 (try_cursor_movement): If inside continuation line, don't back up
9423 farther than the first row after the header line, if any.
9424 Don't consider the header-line row as "partially visible", even if
9425 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9426
9427 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9428
9429 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9430 (bug#11238).
9431
9432 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
9433 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
9434
9435 configure: new option --enable-gcc-warnings (Bug#11207)
9436 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9437 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9438 (ALL_CFLAGS): Use new macros rather than old.
9439 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9440 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9441 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9442 -Wunused-result, -Wunused-variable. This should go away once
9443 the Emacs and Gnulib regex code is merged.
9444 (xmalloc, xrealloc): Now static.
9445
9446 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9447
9448 * dired.c (Fsystem_groups): Remove unused local.
9449
9450 2012-04-17 Glenn Morris <rgm@gnu.org>
9451
9452 * dired.c (Fsystem_users): Doc fix.
9453
9454 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9455
9456 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9457 (syms_of_dired): Add them.
9458
9459 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9460
9461 Fix minor alloc.c problems found by static checking.
9462 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9463 New extern decls, to avoid calling undeclared functions.
9464 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9465 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9466 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9467 (NEED_MEM_INSERT): New macro.
9468 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
9469 Remove one incorrect comment and fix another.
9470
9471 Fix minor ralloc.c problems found by static checking.
9472 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9473 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9474 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9475 (r_alloc_sbrk): Now static.
9476
9477 Improve ralloc.c interface checking.
9478 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9479 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9480 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9481 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9482 [REL_ALLOC]: ... to here, to check interface.
9483 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9484 Remove decls. This fixes an "It stinks!".
9485
9486 * alloc.c (which_symbols): Fix alignment issue / type clash.
9487
9488 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9489
9490 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9491 (struct Lisp_Misc_Any): Likewise.
9492 (struct Lisp_Free): Likewise.
9493 * alloc.c (union aligned_Lisp_Symbol): Define.
9494 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9495 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9496 (union aligned_Lisp_Misc): Define.
9497 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9498 aligned_Lisp_Misc instead of union Lisp_Misc.
9499 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
9500
9501 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9502
9503 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9504 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9505 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9506 * s/netbsd.h, s/sol2-6.h:
9507 Remove definition of GC_MARK_STACK, since the default now works.
9508 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9509 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9510 no longer the default.
9511 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9512
9513 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
9514
9515 * lread.c (lisp_file_lexically_bound_p):
9516 Fix hang at ";-*-\n" (bug#11238).
9517
9518 2012-04-14 Eli Zaretskii <eliz@gnu.org>
9519
9520 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9521 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9522
9523 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9524
9525 * nsterm.m (constrainFrameRect): Always constrain when there is only
9526 one screen (Bug#10962).
9527
9528 2012-04-13 Ken Brown <kbrown@cornell.edu>
9529
9530 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9531
9532 2012-04-13 Reuben Thomas <rrt@sc3d.org>
9533
9534 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9535
9536 2012-04-11 Daniel Colascione <dancol@dancol.org>
9537
9538 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9539 against is gone. It's better to use vfork now so that when Cygwin
9540 gains a new, working vfork, we use it automatically (bug#10398).
9541
9542 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9543
9544 * window.c (save_window_save): Obey window-point-insertion-type.
9545
9546 2012-04-11 Glenn Morris <rgm@gnu.org>
9547
9548 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9549
9550 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9551
9552 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9553
9554 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
9555
9556 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9557 (force_quit_count): New var.
9558 (handle_interrupt): Use it.
9559
9560 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
9561
9562 * w32.c (w32_delayed_load): Record the full path of the library
9563 being loaded (bug#10424).
9564
9565 2012-04-09 Glenn Morris <rgm@gnu.org>
9566
9567 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
9568 not just in the obarray, before snarfing them. (Bug#11036)
9569
9570 * Makefile.in ($(leimdir)/leim-list.el):
9571 Pass EMACS rather than BUILT_EMACS.
9572
9573 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
9574
9575 * process.c (make_process):
9576 * process.h: Add integer `gnutls_handshakes_tried' member to
9577 process struct.
9578
9579 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
9580 Add convenience `GNUTLS_LOG2i' macro.
9581
9582 * gnutls.c (gnutls_log_function2i): Convenience log function.
9583 (emacs_gnutls_read): Use new log functions,
9584 `gnutls_handshakes_tried' process member, and
9585 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
9586 attempts per process (connection).
9587
9588 2012-04-09 Chong Yidong <cyd@gnu.org>
9589
9590 * eval.c (Fuser_variable_p, user_variable_p_eh)
9591 (lisp_indirect_variable): Functions deleted.
9592 (Fdefvar): Caller changed.
9593
9594 * callint.c (Finteractive, Fcall_interactively):
9595 * minibuf.c (Fread_variable): Callers changed.
9596
9597 2012-04-09 Eli Zaretskii <eliz@gnu.org>
9598
9599 * xdisp.c (set_cursor_from_row): If the display string appears in
9600 the buffer at position that is closer to point than the position
9601 after the display string, display the cursor on the first glyph of
9602 the display string. Fixes cursor display when a 'display' text
9603 property immediately follows invisible text. (Bug#11094)
9604
9605 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
9606
9607 composite.c: use 'double' consistently
9608 * composite.c (get_composition_id): Use 'double' consistently
9609 instead of converting 'float' to 'double' and vice versa; this is
9610 easier to understand and avoids a GCC warning.
9611
9612 2012-04-09 Glenn Morris <rgm@gnu.org>
9613
9614 * Makefile.in: Generate leim-list with bootstrap-emacs, in
9615 preparation for dumping it with emacs. (Bug#4789)
9616 (leimdir): New variable.
9617 ($(leimdir)/leim-list.el): New rule.
9618 (emacs$(EXEEXT)): Depend on leim-list.el.
9619
9620 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
9621 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
9622 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
9623
9624 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
9625
9626 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
9627 proper alignment.
9628
9629 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
9630
9631 * xml.c (init_libxml2_functions) [WINDOWSNT]:
9632 Remove unused local variable.
9633
9634 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9635
9636 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
9637 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
9638 (mark_memory): Mark Lisp_Objects only if pointers might hide in
9639 objects, as mark_maybe_pointer will catch them otherwise.
9640 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
9641 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
9642
9643 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
9644
9645 Fix typo that broke non-Windows builds.
9646 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
9647
9648 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9649
9650 Support building on MS-Windows with libxml2.
9651
9652 * makefile.w32-in (OBJ2): Add xml.$(O).
9653 (GLOBAL_SOURCES): Add xml.c.
9654 ($(BLD)/xml.$(O)): New dependency list.
9655
9656 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
9657 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
9658 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
9659 [!WINDOWSNT]: New macros.
9660 (init_libxml2_functions, libxml2_loaded_p): New functions.
9661 (parse_region): Call fn_xmlCheckVersion instead of using the macro
9662 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
9663 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
9664 Calls xmlCleanupParser only if libxml2 was loaded (or statically
9665 linked in).
9666 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
9667 Call init_libxml2_functions before calling libxml2 functions.
9668 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
9669
9670 * emacs.c: Don't include libxml/parser.h.
9671 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
9672 xmlCleanupParser directly.
9673
9674 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
9675
9676 2012-04-07 Eli Zaretskii <eliz@gnu.org>
9677
9678 * indent.c (Fvertical_motion): If there is a display string at
9679 point, use it.vpos to compute how many lines to backtrack after
9680 move_it_to point. (Bug#11133)
9681
9682 2012-04-06 Eli Zaretskii <eliz@gnu.org>
9683
9684 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
9685 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
9686 about subtle differences between FETCH_CHAR* and STRING_CHAR*
9687 macros related to unification of CJK characters. For the details,
9688 see the discussion following the message here:
9689 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
9690
9691 2012-04-04 Chong Yidong <cyd@gnu.org>
9692
9693 * keyboard.c (Vdelayed_warnings_list): Doc fix.
9694
9695 2012-04-01 Eli Zaretskii <eliz@gnu.org>
9696
9697 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
9698 instead of alloca. (Bug#11138)
9699
9700 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
9701
9702 * w32menu.c (is_simple_dialog): Properly check lisp types.
9703 (Bug#11141)
9704
9705 2012-03-31 Eli Zaretskii <eliz@gnu.org>
9706
9707 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
9708 position we get to after a call to move_it_to fails the
9709 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
9710 only if we wind up in a string from display property. (Bug#11063)
9711
9712 * window.c (Fdelete_other_windows_internal): Invalidate the row
9713 and column information about mouse highlight, so that redisplay
9714 restores it after reallocating the glyph matrices. (Bug#7464)
9715
9716 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
9717 string comes from a `display' text property, use the buffer
9718 position of that property as if we actually saw that position in
9719 the row's glyphs.
9720 (move_it_by_lines): Remove the assertion that
9721 "it->current_x == 0 && it->hpos == 0" which can be legitimately
9722 violated when there's a before-string at the beginning of a line.
9723 (Bug#11063)
9724
9725 2012-03-30 Eli Zaretskii <eliz@gnu.org>
9726
9727 * xdisp.c (append_space_for_newline): If the default face was
9728 remapped, use the remapped face for the appended newline.
9729 (extend_face_to_end_of_line): Use the remapped default face for
9730 extending the face to the end of the line.
9731 (display_line): Call extend_face_to_end_of_line when the default
9732 face was remapped. (Bug#11068)
9733
9734 2012-03-29 Eli Zaretskii <eliz@gnu.org>
9735
9736 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
9737
9738 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
9739
9740 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
9741
9742 2012-03-27 Glenn Morris <rgm@gnu.org>
9743
9744 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
9745 Doc fixes.
9746
9747 2012-03-26 Kenichi Handa <handa@m17n.org>
9748
9749 * dispextern.h (struct glyph): Fix previous change. Change the
9750 bit length of glyphless.ch to 25 (Bug#11082).
9751
9752 2012-03-26 Chong Yidong <cyd@gnu.org>
9753
9754 * keyboard.c (Vselection_inhibit_update_commands): New variable.
9755 (command_loop_1): Use it; inhibit selection update for
9756 handle-select-window too (Bug#8996).
9757
9758 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
9759
9760 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
9761
9762 2012-03-25 Kenichi Handa <handa@m17n.org>
9763
9764 * dispextern.h (struct glyph): Change the bit length of
9765 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
9766
9767 2012-03-24 Eli Zaretskii <eliz@gnu.org>
9768
9769 * s/ms-w32.h (tzname): Include time.h before redirecting to
9770 _tzname. Fixes the MSVC build. (Bug#9960)
9771
9772 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
9773
9774 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
9775 characters.
9776
9777 * xterm.c (XTread_socket): Only modify handling_signal if
9778 !SYNC_INPUT. (Bug#11080)
9779
9780 2012-03-23 Eli Zaretskii <eliz@gnu.org>
9781
9782 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
9783 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
9784 when fetching a multibyte character consumes more bytes than
9785 CHAR_BYTES returns, due to unification of CJK characters in
9786 string_char. (Bug#11073)
9787
9788 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
9789
9790 * process.c (wait_reading_process_output): Handle pty disconnect
9791 by refraining from sending oneself a SIGCHLD (bug#10933).
9792
9793 2012-03-22 Chong Yidong <cyd@gnu.org>
9794
9795 * dispextern.h (struct it): New member string_from_prefix_prop_p.
9796
9797 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9798 Mark string as coming from a prefix property.
9799 (handle_face_prop): Use default face for prefix strings (Bug#4281).
9800 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
9801
9802 2012-03-21 Chong Yidong <cyd@gnu.org>
9803
9804 * xfaces.c (Vface_remapping_alist): Doc fix.
9805
9806 2012-03-20 Eli Zaretskii <eliz@gnu.org>
9807
9808 * w32proc.c (Fw32_set_console_codepage)
9809 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
9810 Doc fixes.
9811
9812 2012-03-20 Chong Yidong <cyd@gnu.org>
9813
9814 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
9815 to reflect default non-nil value of redisplay-dont-pause.
9816
9817 2012-03-19 Kenichi Handa <handa@m17n.org>
9818
9819 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
9820 it fit in a valid range (Bug#11003).
9821
9822 2012-03-18 Eli Zaretskii <eliz@gnu.org>
9823
9824 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
9825 that is not from display property, accept the row as a "cursor
9826 row" if one of the string's character has a non-nil `cursor'
9827 property. Fixes cursor positioning when there are newlines in
9828 overlay strings, e.g. in icomplete.el. (Bug#11035)
9829
9830 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
9831
9832 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
9833
9834 2012-03-12 Chong Yidong <cyd@gnu.org>
9835
9836 * eval.c (inhibit_lisp_code): Rename from
9837 inhibit_window_configuration_change_hook; move from window.c.
9838
9839 * xfns.c (unwind_create_frame_1, Fx_create_frame):
9840 * window.c (run_window_configuration_change_hook)
9841 (syms_of_window): Callers changed.
9842
9843 2012-03-11 Chong Yidong <cyd@gnu.org>
9844
9845 * keymap.c (Fkey_description): Doc fix (Bug#9700).
9846
9847 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
9848
9849 2012-03-10 Chong Yidong <cyd@gnu.org>
9850
9851 * frame.c (other_visible_frames): Don't assume the selected frame
9852 is visible (Bug#10955).
9853
9854 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
9855
9856 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
9857
9858 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
9859
9860 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
9861 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
9862 zero (Bug#10954).
9863
9864 2012-03-03 Glenn Morris <rgm@gnu.org>
9865
9866 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
9867
9868 2012-03-02 Eli Zaretskii <eliz@gnu.org>
9869
9870 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
9871 position past the first glyph_row that ends at ZV. (Bug#10902)
9872 (redisplay_window, next_element_from_string): Fix typos in
9873 comments.
9874 (redisplay_window): Pass to move_it_vertically the margin in
9875 pixels, not in screen lines.
9876
9877 2012-03-02 Glenn Morris <rgm@gnu.org>
9878
9879 * buffer.c (buffer-list-update-hook): Doc fix.
9880
9881 2012-02-29 Eli Zaretskii <eliz@gnu.org>
9882
9883 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
9884 push_it before setting up the iterator for the first overlay
9885 string, even if we have an empty string loaded.
9886 (next_overlay_string): If there's an empty string on the iterator
9887 stack, pop the stack. (Bug#10903)
9888
9889 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
9890
9891 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
9892 Suggested by Stefan Monnier in
9893 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
9894 * alloc.c (widen_to_Lisp_Object): New static function.
9895 (mark_memory): Also mark Lisp_Objects by fetching pointer words
9896 and widening them to Lisp_Objects. This would work even if
9897 USE_LSB_TAG is defined and wide integers are used, which might
9898 happen in a future version of Emacs.
9899
9900 2012-02-25 Chong Yidong <cyd@gnu.org>
9901
9902 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
9903 Doc fix.
9904
9905 * xselect.c (Fx_selection_exists_p): Doc fix.
9906 (x_clipboard_manager_save_all): Print an informative message
9907 before saving to clipboard manager.
9908
9909 2012-02-24 Chong Yidong <cyd@gnu.org>
9910
9911 * keyboard.c (process_special_events): Handle all X selection
9912 requests in kbd_buffer, not just the next one (Bug#8869).
9913
9914 2012-02-23 Chong Yidong <cyd@gnu.org>
9915
9916 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
9917 call when setting menu-bar-lines and tool-bar-lines parameters.
9918 (unwind_create_frame_1): New helper function.
9919
9920 * window.c (inhibit_window_configuration_change_hook): New var.
9921 (run_window_configuration_change_hook): Obey it.
9922 (syms_of_window): Initialize it.
9923
9924 2012-02-22 Chong Yidong <cyd@gnu.org>
9925
9926 * xterm.c (x_draw_image_relief): Add missing type check for
9927 Vtool_bar_button_margin (Bug#10743).
9928
9929 2012-02-21 Chong Yidong <cyd@gnu.org>
9930
9931 * fileio.c (Vfile_name_handler_alist): Doc fix.
9932
9933 * buffer.c (Fget_file_buffer): Protect against invalid file
9934 handler return value.
9935
9936 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
9937
9938 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
9939 when computing $valmask.
9940
9941 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
9942 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
9943 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
9944 It's useless in that case, and it can cause problems on hosts
9945 that allocate halves of EMACS_INT values separately.
9946 Reported by Dan Horák. Diagnosed by Andreas Schwab in
9947 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
9948 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
9949 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
9950 it avoids undefined behavior on hosts where shifting right by more
9951 than the word width has undefined behavior.
9952
9953 2012-02-19 Chong Yidong <cyd@gnu.org>
9954
9955 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
9956 (Funhandled_file_name_directory, Ffile_name_as_directory)
9957 (Fdirectory_file_name, Fexpand_file_name)
9958 (Fsubstitute_in_file_name): Protect against invalid file handler
9959 return values (Bug#10845).
9960
9961 2012-02-18 Eli Zaretskii <eliz@gnu.org>
9962
9963 * .gdbinit (pitx): Fix incorrect references to fields of the
9964 iterator stack.
9965
9966 2012-02-17 Chong Yidong <cyd@gnu.org>
9967
9968 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
9969
9970 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
9971
9972 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
9973 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
9974
9975 2012-02-15 Chong Yidong <cyd@gnu.org>
9976
9977 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
9978 marked as special. Also, starting docstrings with * is obsolete.
9979
9980 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
9981
9982 * gnutls.c (emacs_gnutls_write): Fix last change.
9983
9984 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
9985
9986 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
9987 send_process.
9988
9989 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
9990
9991 * keymap.c (Fsingle_key_description): Handle char ranges.
9992
9993 2012-02-12 Chong Yidong <cyd@gnu.org>
9994
9995 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
9996 as that creates a dangerous corner case.
9997
9998 * window.c (Fdelete_window_internal): Invalidate the mouse
9999 highlight (Bug#9904).
10000
10001 2012-02-12 Glenn Morris <rgm@gnu.org>
10002
10003 * xselect.c (Fx_own_selection_internal)
10004 (Fx_get_selection_internal, Fx_disown_selection_internal)
10005 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10006 * nsselect.m (Fx_own_selection_internal)
10007 (Fx_disown_selection_internal, Fx_selection_exists_p)
10008 (Fx_selection_owner_p, Fx_get_selection_internal):
10009 Sync docs and argument specs with the xselect.c versions.
10010
10011 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10012
10013 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10014
10015 2012-02-11 Eli Zaretskii <eliz@gnu.org>
10016
10017 * w32select.c (Fx_selection_exists_p): Sync doc string and
10018 argument list with xselect.c. (Bug#10783)
10019
10020 * w16select.c (Fx_selection_exists_p): Sync doc string and
10021 argument list with xselect.c. (Bug#10783)
10022
10023 2012-02-10 Glenn Morris <rgm@gnu.org>
10024
10025 * fns.c (Fsecure_hash): Doc fix.
10026
10027 2012-02-09 Kenichi Handa <handa@m17n.org>
10028
10029 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10030
10031 2012-02-07 Chong Yidong <cyd@gnu.org>
10032
10033 * buffer.c (Fbuffer_local_variables)
10034 (buffer_lisp_local_variables): Handle unbound vars correctly;
10035 don't let Qunbound leak into Lisp.
10036
10037 2012-02-07 Glenn Morris <rgm@gnu.org>
10038
10039 * image.c (Fimagemagick_types): Doc fix.
10040
10041 * image.c (imagemagick-render-type): Change it from a lisp object
10042 to an integer. Move the doc here from the lisp manual.
10043 Treat all values not equal to 0 the same.
10044
10045 2012-02-06 Chong Yidong <cyd@gnu.org>
10046
10047 * doc.c (store_function_docstring): Avoid applying docstring of
10048 alias to base function (Bug#2603).
10049
10050 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10051
10052 * .gdbinit (pp1, pv1): Remove redundant defines.
10053 (pr): Use pp.
10054
10055 2012-02-04 Chong Yidong <cyd@gnu.org>
10056
10057 * nsterm.m: Declare a global (Bug#10694).
10058
10059 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10060
10061 * w32.c (get_emacs_configuration_options):
10062 Include --enable-checking, if specified, in the return value.
10063
10064 2012-02-04 Martin Rudalics <rudalics@gmx.at>
10065
10066 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10067 after rounding frame sizes. (Bug#9723)
10068
10069 2012-02-04 Eli Zaretskii <eliz@gnu.org>
10070
10071 * keyboard.c (adjust_point_for_property): Don't position point
10072 before BEGV. (Bug#10696)
10073
10074 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10075
10076 Handle overflow when computing char display width (Bug#9496).
10077 * character.c (char_width): Return EMACS_INT, not int.
10078 (char_width, c_string_width): Check for overflow when
10079 computing the width; this is possible now that individual
10080 characters can have unbounded width. Problem introduced
10081 by merge from Emacs 23 on 2012-01-19.
10082
10083 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
10084
10085 * dbusbind.c (Fdbus_register_method): Mention the return value
10086 :ignore in the docstring.
10087
10088 2012-02-02 Glenn Morris <rgm@gnu.org>
10089
10090 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10091
10092 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10093 Unconditionally set to t. (Bug#10673)
10094 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10095 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10096 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10097
10098 2012-02-02 Kenichi Handa <handa@m17n.org>
10099
10100 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10101 0, do not call append_composite_glyph.
10102
10103 2012-02-02 Kenichi Handa <handa@m17n.org>
10104
10105 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10106 NULL (Bug#6988).
10107 (x_produce_glyphs): If the component of a composition is a null
10108 string, set it->pixel_width to 1 to avoid zero-width glyph.
10109
10110 2012-02-01 Eli Zaretskii <eliz@gnu.org>
10111
10112 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10113 first 2 arguments are identical. This makes inserting large
10114 output from a subprocess an order of magnitude faster on
10115 MS-Windows, where all sbrk'ed memory is always contiguous.
10116
10117 2012-01-31 Glenn Morris <rgm@gnu.org>
10118
10119 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10120 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10121 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10122
10123 2012-01-29 Glenn Morris <rgm@gnu.org>
10124
10125 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10126
10127 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10128
10129 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10130
10131 2012-01-28 Chong Yidong <cyd@gnu.org>
10132
10133 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10134
10135 2012-01-26 Chong Yidong <cyd@gnu.org>
10136
10137 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10138
10139 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10140 repeat counts (Bug#10507).
10141
10142 2012-01-26 Glenn Morris <rgm@gnu.org>
10143
10144 * lread.c (syms_of_lread): Doc fix.
10145
10146 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10147
10148 * coding.c (encode_designation_at_bol): Change return value to
10149 EMACS_INT.
10150
10151 2012-01-25 Chong Yidong <cyd@gnu.org>
10152
10153 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10154
10155 2012-01-21 Chong Yidong <cyd@gnu.org>
10156
10157 * floatfns.c (Fcopysign): Make the second argument non-optional,
10158 since nil is not allowed anyway.
10159
10160 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10161
10162 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10163 (send_process): Likewise.
10164
10165 2012-01-19 Martin Rudalics <rudalics@gmx.at>
10166
10167 * window.c (save_window_save, Fcurrent_window_configuration)
10168 (Vwindow_persistent_parameters): Do not use Qstate.
10169 Rewrite doc-strings.
10170
10171 2012-01-19 Kenichi Handa <handa@m17n.org>
10172
10173 * character.c (char_width): New function.
10174 (Fchar_width, c_string_width, lisp_string_width):
10175 Use char_width (Bug#9496).
10176
10177 2012-01-16 Martin Rudalics <rudalics@gmx.at>
10178
10179 * window.c (Vwindow_persistent_parameters): New variable.
10180 (Fset_window_configuration, save_window_save): Handle persistent
10181 window parameters.
10182
10183 2012-01-14 Eli Zaretskii <eliz@gnu.org>
10184
10185 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10186 thrashing the stack of the thread. (Bug#9087)
10187
10188 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10189
10190 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10191
10192 2012-01-11 Eli Zaretskii <eliz@gnu.org>
10193
10194 * xdisp.c (rows_from_pos_range): Handle the case where the
10195 highlight ends on a newline. (Bug#10464)
10196 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10197 he end column for display of highlight that ends on a newline
10198 before a R2L line.
10199
10200 2012-01-11 Glenn Morris <rgm@gnu.org>
10201
10202 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10203 from load-path also when installation-directory is nil. (Bug#10208)
10204
10205 2012-01-10 Glenn Morris <rgm@gnu.org>
10206
10207 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10208
10209 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10210 Update template values to be closer to their typical values these days.
10211
10212 2012-01-09 Eli Zaretskii <eliz@gnu.org>
10213
10214 * xdisp.c (rows_from_pos_range): Accept additional argument
10215 DISP_STRING, and accept any glyph in a row whose object is that
10216 string as eligible for mouse highlight. Fixes mouse highlight of
10217 display strings from overlays. (Bug#10464)
10218
10219 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
10220
10221 emacs: fix an auto-save permissions race condition (Bug#10400)
10222 * fileio.c (auto_saving_dir_umask): New static var.
10223 (Fmake_directory_internal): Use it.
10224 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10225 creating the directory. The old code temporarily assigns
10226 too-generous permissions to the directory.
10227 (do_auto_save_eh): Clear it.
10228 (Fdo_auto_save): Catch all errors, not just file errors, so
10229 that the var is always cleared.
10230
10231 2012-01-07 Eli Zaretskii <eliz@gnu.org>
10232
10233 * search.c (scan_buffer): Pass character positions to
10234 know_region_cache, not byte positions. (Bug#6540)
10235
10236 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
10237
10238 * w32.c (sys_rename): Report EXDEV when rename of a directory
10239 fails because the target is on another logical disk. (Bug#10284)
10240
10241 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10242
10243 * xterm.c (x_embed_request_focus): New function.
10244
10245 * xterm.h: Add prototype.
10246
10247 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10248
10249 2012-01-05 Glenn Morris <rgm@gnu.org>
10250
10251 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10252
10253 2012-01-01 Eli Zaretskii <eliz@gnu.org>
10254
10255 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10256 Load gnutls_transport_set_lowat only if GnuTLS version is below
10257 2.11.1.
10258 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10259 GnuTLS versions below 2.11.1.
10260
10261 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10262
10263 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10264 to the doc string advising against its use for altering the way
10265 windows are scrolled.
10266
10267 2011-12-28 Kenichi Handa <handa@m17n.org>
10268
10269 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10270 coding-system ASCII compatible only when it does not produce BOM
10271 on encoding (Bug#10383).
10272
10273 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10274
10275 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10276 can scroll.
10277 (create_and_show_popup_menu): Always use menu_position_func for
10278 Gtk3 (Bug#10361).
10279
10280 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10281
10282 * callint.c (Fcall_interactively): Don't truncate prompt string.
10283
10284 2011-12-23 Eli Zaretskii <eliz@gnu.org>
10285
10286 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10287 property that ends at ZV, so that the bidi iteration could be
10288 resumed from there (after widening). (Bug#10360)
10289
10290 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10291
10292 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10293
10294 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10295
10296 * nsterm.m (x_free_frame_resources):
10297 Release f->output_data.ns->miniimage.
10298 (ns_index_color): Fix indentation. Do not retain
10299 color_table->colors[i].
10300
10301 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10302 before returning.
10303
10304 * nsfns.m (x_set_background_color): Assign return value from
10305 ns_index_color to face-background instead of NSColor*.
10306 (ns_implicitly_set_icon_type): Fix indentation.
10307 Change assignment in for loop to comparison.
10308
10309 * emacs.c (ns_pool): New variable.
10310 (main): Assign ns_pool.
10311 (Fkill_emacs): Call ns_release_autorelease_pool.
10312
10313 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10314 autorelease fdesc, release fdAttrs and tdict.
10315 (ns_get_covering_families): Release charset.
10316 (ns_findfonts): Release NSFontDescriptor created with new.
10317 (ns_uni_to_glyphs): Fix indentation.
10318 (setString): Release attrStr before assigning new value.
10319
10320 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10321
10322 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10323 and NS_IMPL_COCOA.
10324 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10325 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10326
10327 2011-12-18 David Reitter <reitter@cmu.edu>
10328
10329 * nsterm.m (ns_term_init): Subscribe for notifications
10330 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10331 to method trackingNotification in EmacsMenu.
10332
10333 * nsmenu.m (trackingMenu): New variable.
10334 (trackingNotification): New method (from Aquamacs).
10335 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
10336 from Aquamacs (Bug#7030).
10337
10338 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10339
10340 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10341 (symbol_to_nsstring): Fix indentation.
10342 (ns_symbol_to_pb): New function.
10343 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10344 (Fns_rotate_cut_buffers_internal): Remove.
10345 (Fns_store_selection_internal): Rename from
10346 Fns_store_cut_buffer_internal.
10347 (ns_get_foreign_selection, Fx_own_selection_internal)
10348 (Fx_disown_selection_internal, Fx_selection_exists_p)
10349 (Fns_get_selection_internal, Fns_store_selection_internal):
10350 Use ns_symbol_to_pb and check if return value is nil.
10351 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10352 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
10353 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10354 renamed to Sns_store_selection_internal.
10355 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10356 and remove this function.
10357 (ns_handle_selection_clear): Remove, never used.
10358 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10359 here.
10360
10361 2011-12-17 Ken Brown <kbrown@cornell.edu>
10362
10363 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10364 GID is unknown (Bug#10257).
10365
10366 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10367
10368 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10369 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10370 which caused a build failure on GNU/Linux IA-64. This problem was
10371 introduced by my 2011-10-07 patch.
10372
10373 2011-12-15 Juri Linkov <juri@jurta.org>
10374
10375 * image.c (imagemagick_error): New function. (Bug#10112)
10376 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10377 Use `imagemagick_error' where ImageMagick functions return
10378 `MagickFalse'.
10379 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10380 proper order.
10381
10382 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10383
10384 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10385 fill background (Bug#8992).
10386
10387 2011-12-13 Martin Rudalics <rudalics@gmx.at>
10388
10389 * window.c (Vwindow_combination_resize)
10390 (Vwindow_combination_limit): Use t instead of non-nil in
10391 doc-strings.
10392 (Vrecenter_redisplay): Add first sentence of doc-string on
10393 separate line.
10394 (Frecenter): Fix doc-string typo.
10395
10396 2011-12-11 Kenichi Handa <handa@m17n.org>
10397
10398 * coding.c (Funencodable_char_position): Pay attention to the
10399 buffer text relocation (Bug#9389).
10400
10401 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10402
10403 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10404 gtk_init (Bug#10100).
10405
10406 2011-12-10 Eli Zaretskii <eliz@gnu.org>
10407
10408 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10409 IT->string is nil. (Bug#10263)
10410
10411 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10412
10413 * nsterm.h (x_free_frame_resources): Declare.
10414
10415 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10416 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10417
10418 * nsterm.h (ns_get_defaults_value): Declare.
10419
10420 * nsterm.m (ns_default): Call ns_get_defaults_value.
10421
10422 2011-12-09 Eli Zaretskii <eliz@gnu.org>
10423
10424 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10425 (Bug#10170)
10426
10427 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10428
10429 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10430 that where the value of an _OBJC_* symbol points to is in the .bss
10431 section (Bug#10240).
10432
10433 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10434
10435 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
10436 after the loop to call ccl_driver at least once (Bug#8619).
10437
10438 2011-12-08 Kenichi Handa <handa@m17n.org>
10439
10440 * ftfont.c (get_adstyle_property): Fix previous change
10441 (Bug#10233).
10442
10443 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
10444
10445 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10446 dirs from the default value of EMACSLOADPATH (bug#10208).
10447
10448 2011-12-07 Glenn Morris <rgm@gnu.org>
10449
10450 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10451 installation and source directories as well. (Bug#10208)
10452
10453 2011-12-06 Chong Yidong <cyd@gnu.org>
10454
10455 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10456
10457 2011-12-06 Glenn Morris <rgm@gnu.org>
10458
10459 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10460 as an error, not just -1. (Bug#10217)
10461
10462 2011-12-05 Chong Yidong <cyd@gnu.org>
10463
10464 * keyboard.c (process_special_events): New function.
10465 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10466
10467 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10468
10469 * coding.c (encode_designation_at_bol): Don't use uninitialized
10470 local variable (Bug#9318).
10471
10472 2011-12-05 Kenichi Handa <handa@m17n.org>
10473
10474 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10475 return Qnil (Bug#8046, Bug#10193).
10476
10477 2011-12-05 Kenichi Handa <handa@m17n.org>
10478
10479 * coding.c (encode_designation_at_bol): New args charbuf_end and
10480 dst. Return the number of produced bytes. Callers changed.
10481 (coding_set_source): Return how many bytes coding->source was
10482 relocated.
10483 (coding_set_destination): Return how many bytes
10484 coding->destination was relocated.
10485 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
10486 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
10487
10488 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10489
10490 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10491 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10492 macro (Bug#9318).
10493
10494 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10495
10496 The following changes are to fix Bug#9318.
10497
10498 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
10499 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10500 (encode_coding_iso_2022, encode_coding_sjis)
10501 (encode_coding_big5, encode_coding_charset): Use the above macros.
10502
10503 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
10504
10505 * lisp.h (process_quit_flag): Fix external declaration.
10506
10507 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10508
10509 Don't macro-inline non-performance-critical code.
10510 * eval.c (process_quit_flag): New function.
10511 * lisp.h (QUIT): Use it.
10512
10513 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10514
10515 * nsfns.m (get_geometry_from_preferences): New function.
10516 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10517
10518 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10519
10520 * emacs.c (Qkill_emacs): Define.
10521 (syms_of_emacs): Initialize it.
10522 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10523 Qquit_flag to `kill-emacs' instead.
10524 (quit_throw_to_read_char): Add parameter `from_signal'.
10525 All callers changed. Call Fkill_emacs if requested and safe.
10526 * lisp.h (QUIT): Call Fkill_emacs if requested.
10527
10528 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10529
10530 * widget.c (update_wm_hints): Return if wmshell is null.
10531 (widget_update_wm_size_hints): New function.
10532
10533 * widget.h (widget_update_wm_size_hints): Declare.
10534
10535 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10536 widget_update_wm_size_hints (Bug#10104).
10537
10538 2011-12-03 Eli Zaretskii <eliz@gnu.org>
10539
10540 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10541 before a newline, prepare the bidi iterator for consuming the
10542 newline, and keep the current paragraph direction. (Bug#10183)
10543 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
10544
10545 2011-12-02 Juri Linkov <juri@jurta.org>
10546
10547 * search.c (Fword_search_regexp): New Lisp function created from
10548 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10549 (Fword_search_backward, Fword_search_forward)
10550 (Fword_search_backward_lax, Fword_search_forward_lax):
10551 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10552 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10553
10554 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10555
10556 * fileio.c (Finsert_file_contents): Move after-change-function call
10557 to before the "handled:" label, since all "goto handled" appear in
10558 cases where the *-change-functions have already been properly called
10559 (bug#10117).
10560
10561 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
10562
10563 * keyboard.c (interrupt_signal): Don't call kill-emacs when
10564 waiting for input. (Bug#10169)
10565
10566 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10567
10568 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
10569 verifies glyph row's hash code--we have just reallocated the
10570 glyphs, so their contents can be complete garbage. (Bug#10164)
10571
10572 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
10573
10574 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
10575
10576 2011-11-30 Eli Zaretskii <eliz@gnu.org>
10577
10578 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
10579 attributes are tested _before_ calling verify_row_hash, to protect
10580 against GCC re-ordering of the tests. (Bug#10164)
10581
10582 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
10583
10584 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
10585
10586 * xterm.c (handle_one_xevent): Only set async_visible and friends
10587 if net_wm_state_hidden_seen is non-zero (Bug#10002)
10588 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
10589 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
10590
10591 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
10592
10593 Remove GCPRO-related macros that exist only to avoid shadowing locals.
10594 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
10595 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
10596 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10597 All uses changed to use GCPRO1 etc.
10598 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
10599 Revert to old implementation (i.e., before 2011-03-11).
10600
10601 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10602
10603 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
10604 of scroll runs so as to avoid assigning disabled bogus rows and
10605 unnecessary graphics copy operations.
10606
10607 2011-11-27 Eli Zaretskii <eliz@gnu.org>
10608
10609 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
10610 (snprintf) [_MSC_VER]: Redirect to _snprintf.
10611 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
10612 (malloc, free, realloc, calloc): Redirect to e_* only when
10613 compiling Emacs.
10614
10615 * lisp.h (GCTYPEBITS): Move before first use.
10616 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
10617 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
10618 this macro definition.
10619
10620 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
10621 _MSC_VER.
10622
10623 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
10624
10625 * gtkutil.c (xg_create_frame_widgets):
10626 Call gtk_window_set_has_resize_grip (FALSE) if that function is
10627 present with Gtk+ 2.0.
10628
10629 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10630
10631 * fileio.c (Finsert_file_contents): Undo previous change; see
10632 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
10633
10634 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
10635
10636 Rename locals to avoid shadowing.
10637 * fileio.c (Finsert_file_contents):
10638 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
10639 * process.c (wait_reading_process_output):
10640 Rename inner 'proc' to 'p' to avoid shadowing.
10641 Indent for consistency with usual Emacs style.
10642
10643 2011-11-25 Eli Zaretskii <eliz@gnu.org>
10644
10645 * xdisp.c (redisplay_window): If cursor row is not fully visible
10646 after recentering, and scroll-conservatively is set to a large
10647 number, scroll window by a few more lines to make the cursor fully
10648 visible and out of scroll-margin. (Bug#10105)
10649 (start_display): Don't move to the next line if the display should
10650 start at a newline that is part of a display vector or an overlay
10651 string. (Bug#10119)
10652
10653 2011-11-24 Juri Linkov <juri@jurta.org>
10654
10655 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
10656 after the `MagickPingImage' call. (Bug#10112)
10657
10658 2011-11-23 Chong Yidong <cyd@gnu.org>
10659
10660 * window.c (Fcoordinates_in_window_p): Accept only live windows.
10661
10662 2011-11-23 Martin Rudalics <rudalics@gmx.at>
10663
10664 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
10665 making another buffer current. (Bug#10114)
10666
10667 2011-11-23 Glenn Morris <rgm@gnu.org>
10668
10669 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
10670
10671 2011-11-23 Chong Yidong <cyd@gnu.org>
10672
10673 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
10674 using it (Bug#5984).
10675
10676 2011-11-22 Eli Zaretskii <eliz@gnu.org>
10677
10678 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
10679 and header-lines, as they don't have one computed for them.
10680 (Bug#10098)
10681
10682 * .gdbinit (prow): Make displayed values more self-explaining.
10683 Add row's hash code.
10684
10685 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
10686
10687 * process.c (wait_reading_process_output): Fix asynchrounous
10688 GnuTLS socket handling on some versions of the GnuTLS library.
10689 (wait_reading_process_output): Add comment and URL.
10690
10691 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
10692
10693 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
10694
10695 2011-11-21 Chong Yidong <cyd@gnu.org>
10696
10697 * window.c (Fnext_window, Fprevious_window): Doc fix.
10698
10699 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10700
10701 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
10702
10703 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10704
10705 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
10706
10707 2011-11-20 Martin Rudalics <rudalics@gmx.at>
10708
10709 * window.c (Fset_window_combination_limit): Rename argument
10710 STATUS to LIMIT.
10711 (Vwindow_combination_limit): Remove "status" from doc-string.
10712
10713 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
10714
10715 * m/ibms390.h: Remove.
10716 * m/ibms390x.h: Don't include "ibms390.h".
10717
10718 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
10719
10720 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
10721 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
10722
10723 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
10724
10725 * casetab.c (Fset_case_table):
10726 * charset.c (Fcharset_after): Fix typos.
10727
10728 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
10729
10730 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
10731 Otherwise, valgrind does not work on some platforms.
10732 Problem reported by Andreas Schwab in
10733 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
10734 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
10735 is set, removing the need for VIRT_ADDRESS_VARIES.
10736 (PURE_P): Use a more-efficient implementation that needs just one
10737 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
10738 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
10739 to 4 (xorl, subq, cmpq, setbe).
10740 * alloc.c (pure): Always extern now, since that's the
10741 VIRT_ADDR_VARIES behavior.
10742 (PURE_POINTER_P): Use a single comparison, not two, for
10743 consistency with the new puresize.h.
10744 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
10745 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
10746 Remove VIRT_ADDR_VARIES no longer needed.
10747
10748 2011-11-19 Eli Zaretskii <eliz@gnu.org>
10749
10750 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
10751 (erase_phys_cursor, update_window_cursor, show_mouse_face)
10752 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
10753 behave as if the cursor position were at the window margin.
10754
10755 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
10756 and the cursor position is out of bounds, behave as if the cursor
10757 position were at the window margin. (Bug#10075)
10758
10759 2011-11-18 Chong Yidong <cyd@gnu.org>
10760
10761 * window.c (Fwindow_combination_limit): Make first argument
10762 non-optional, since it is meaningless for live windows like the
10763 selected window.
10764
10765 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
10766
10767 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
10768
10769 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
10770
10771 * intervals.c: Fix grafting over the whole buffer (bug#10071).
10772 (graft_intervals_into_buffer): Simplify.
10773
10774 2011-11-18 Eli Zaretskii <eliz@gnu.org>
10775
10776 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
10777 hash values of the two rows.
10778 (copy_row_except_pointers): Preserve the used[] arrays and the
10779 hash values of the two rows. (Bug#10035)
10780 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
10781
10782 * xdisp.c (row_hash): New function, body extracted from
10783 compute_line_metrics.
10784 (compute_line_metrics): Call row_hash, instead of computing the
10785 hash code inline.
10786
10787 * dispnew.c (verify_row_hash): Call row_hash for computing the
10788 hash code of a row, instead of duplicating code from xdisp.c.
10789
10790 * dispextern.h (row_hash): Add prototype.
10791
10792 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
10793
10794 * frame.c (delete_frame): Don't delete the terminal when the last
10795 X frame is closed if emacs is built with GTK toolkit.
10796
10797 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
10798
10799 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
10800
10801 2011-11-17 Martin Rudalics <rudalics@gmx.at>
10802
10803 * window.c (Vwindow_splits): Rename to
10804 Vwindow_combination_resize. Suggested by Juri Linkov.
10805 (Fsplit_window_internal): Use Vwindow_combination_resize instead
10806 of Vwindow_splits.
10807
10808 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
10809
10810 * nsfns.m (Fns_font_name):
10811 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
10812
10813 2011-11-16 Martin Rudalics <rudalics@gmx.at>
10814
10815 * window.h (window): Rename slot "nest" to "combination_limit".
10816 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
10817 (Fset_window_nest): Rename to Fset_window_combination_limit.
10818 (Vwindow_nest): Rename to Vwindow_combination_limit.
10819 (recombine_windows, make_parent_window, make_window)
10820 (Fsplit_window_internal, saved_window)
10821 (Fset_window_configuration, save_window_save): Rename all
10822 occurrences of window_nest to window_combination_limit.
10823
10824 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
10825
10826 * image.c (imagemagick_load_image): Fix typo.
10827
10828 2011-11-14 Eli Zaretskii <eliz@gnu.org>
10829
10830 * xdisp.c (display_line): Move the call to
10831 highlight_trailing_whitespace before the call to
10832 compute_line_metrics, since the latter needs to see the final
10833 faces of all the glyphs to compute ROW's hash value.
10834 Fixes assertion violations in row_equal_p. (Bug#10035)
10835
10836 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
10837
10838 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
10839 just return (bug#10044).
10840
10841 2011-11-12 Eli Zaretskii <eliz@gnu.org>
10842
10843 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
10844 with user-defined heap size. Bump the default size of the temacs
10845 heap to 27MB, to avoid memory warning when running temacs.
10846 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
10847
10848 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
10849 current_matrix and desired_matrix. (Bug#9990)
10850 (verify_row_hash) [XASSERTS]: New function.
10851 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
10852 that the hash value of glyph rows is correct.
10853
10854 2011-11-12 Martin Rudalics <rudalics@gmx.at>
10855
10856 * window.h (window): Remove splits slot.
10857 * window.c (Fwindow_splits, Fset_window_splits): Remove.
10858 (Fdelete_other_windows_internal, make_parent_window)
10859 (make_window, Fsplit_window_internal, Fdelete_window_internal)
10860 (Fset_window_configuration, save_window_save): Don't deal with
10861 split status of windows.
10862 (saved_window): Remove splits slot.
10863 (Vwindow_splits): Rewrite doc-string.
10864
10865 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
10866
10867 * xfns.c (unwind_create_frame):
10868 * nsfns.m (unwind_create_frame):
10869 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
10870 Vframe_list (Bug#9999).
10871
10872 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
10873
10874 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
10875
10876 2011-11-11 Kenichi Handa <handa@m17n.org>
10877
10878 * callproc.c (Fcall_process): Set the member dst_multibyte of
10879 process_coding.
10880
10881 2011-11-11 Johan Bockgård <bojohan@gnu.org>
10882
10883 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
10884 avoid a crash (bug#9496).
10885
10886 2011-11-09 Chong Yidong <cyd@gnu.org>
10887
10888 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
10889 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
10890
10891 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10892
10893 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
10894
10895 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
10896
10897 Avoid some portability problems by eschewing 'extern inline' functions.
10898 The trivial performance wins aren't worth the portability hassles; see
10899 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
10900 et seq.
10901 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10902 (window_box_width, window_box_left, window_box_left_offset)
10903 (window_box_right, window_box_right_offset): Undo previous change,
10904 by removing the "extern"s.
10905 * intervals.c (adjust_intervals_for_insertion)
10906 (adjust_intervals_for_deletion): Undo previous change,
10907 making these static again.
10908 (offset_intervals, temp_set_point_both, temp_set_point)
10909 (copy_intervals_to_string): No longer inline.
10910 * xdisp.c (window_text_bottom_y, window_box_width)
10911 (window_box_height, window_box_left_offset)
10912 (window_box_right_offset, window_box_left, window_box_right)
10913 (window_box): No longer inline.
10914
10915 2011-11-08 Chong Yidong <cyd@gnu.org>
10916
10917 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
10918 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
10919 Signal an error if not a live window.
10920 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
10921 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
10922
10923 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
10924
10925 * lisp.h (syms_of_abbrev): Remove declaration.
10926 Reported by CHENG Gao <chenggao@royau.me>.
10927
10928 2011-11-07 Eli Zaretskii <eliz@gnu.org>
10929
10930 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
10931 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
10932 of temacs in GUI mode.
10933
10934 2011-11-07 Martin Rudalics <rudalics@gmx.at>
10935
10936 * window.h: Declare delete_all_child_windows instead of
10937 delete_all_subwindows.
10938 * window.c (Fwindow_nest, Fset_window_nest)
10939 (Fset_window_new_total, Fset_window_new_normal)
10940 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
10941 (delete_all_subwindows): Rename to delete_all_child_windows.
10942 (Fdelete_other_windows_internal, Fset_window_configuration):
10943 Call delete_all_child_windows instead of delete_all_subwindows.
10944 * frame.c (delete_frame): Call delete_all_child_windows instead
10945 of delete_all_subwindows.
10946
10947 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
10948
10949 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
10950 This is also needed for porting to any host where GC_MARK_STACK is
10951 not GC_MAKE_GCPROS_NOOPS.
10952 (which_symbols): Use it.
10953
10954 2011-11-07 Kenichi Handa <handa@m17n.org>
10955
10956 * coding.c (coding_set_destination): Check coding->src_pos only
10957 when coding->src_object is a buffer (bug#9910).
10958
10959 * process.c (send_process): Set the member src_multibyte of coding
10960 to 0 (bug#9911) when sending a unibyte text.
10961
10962 * callproc.c (Fcall_process): Set the member src_multibyte of
10963 process_coding to 0 (bug#9912).
10964
10965 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10966
10967 * xmenu.c (cleanup_widget_value_tree): New function.
10968 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
10969 calling free_menubar_widget_value_tree directly (Bug#9830).
10970
10971 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
10972
10973 Fix some portability problems with 'inline'.
10974 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
10975 (window_box_width, window_box_left, window_box_left_offset)
10976 (window_box_right, window_box_right_offset): Declare extern.
10977 Otherwise, these inline functions do not conform to C99 and
10978 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
10979 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
10980 * intervals.c (adjust_intervals_for_insertion)
10981 (adjust_intervals_for_deletion): Now extern, because otherwise the
10982 extern inline functions 'offset_intervals' couldn't refer to it.
10983 (static_offset_intervals): Remove.
10984 (offset_intervals): Rewrite using the old contents of
10985 static_offset_intervals. The old version didn't conform to C99
10986 because an extern inline function contained a reference to an
10987 identifier with static linkage.
10988
10989 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
10990
10991 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
10992 GC.
10993
10994 2011-11-06 Eli Zaretskii <eliz@gnu.org>
10995
10996 * xdisp.c (init_iterator, reseat_to_string): Don't set the
10997 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
10998 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
10999 return Qleft_to_right.
11000
11001 2011-11-06 Chong Yidong <cyd@gnu.org>
11002
11003 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11004 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11005 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11006 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11007 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11008 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11009 (Fwindow_vscroll): Doc fix.
11010 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11011 argument, since it makes no sense to pass a live window and for
11012 consistency with window-child.
11013
11014 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11015
11016 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11017 support MSVC.
11018
11019 2011-11-05 Jason Rumney <jasonr@gnu.org>
11020
11021 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11022 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11023 fonts (Bug#6029).
11024 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11025 bitwise arithmetic preventing use of unicode-sip and non-truetype
11026 opentype fonts.
11027
11028 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11029
11030 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11031 "emacs"-only part.
11032
11033 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11034 initialization code to keep similarity to xfns.c after changes
11035 from 2011-11-05.
11036
11037 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11038
11039 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11040 (unwind_create_frame): New function (Bug#9943).
11041 (Fx_create_frame): Restructure code to be more similar to the one in
11042 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11043 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11044 Move terminal->reference_count++ just before making the frame official
11045 (Bug#9943).
11046
11047 * nsterm.m (x_free_frame_resources): New function.
11048 (x_destroy_window): Move code to x_free_frame_resources.
11049
11050 * xfns.c (unwind_create_frame): Fix comment.
11051 (Fx_create_frame, x_create_tip_frame):
11052 Move terminal->reference_count++ just before making the frame
11053 official. Move initialization of image_cache_refcount and
11054 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11055
11056 2011-11-05 Eli Zaretskii <eliz@gnu.org>
11057
11058 Support MSVC build with newer versions of Visual Studio.
11059 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11060 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11061 nt/gmake.defs.
11062
11063 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11064 which are not supported by MSVC.
11065 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11066 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11067 bitfields.
11068 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11069 types in bitfields.
11070 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11071
11072 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11073
11074 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
11075
11076 Support MSVC build with newer versions of Visual Studio.
11077 * w32.c: Don't include w32api.h for MSVC.
11078 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11079
11080 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11081 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11082 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11083 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11084 e_* cousins.
11085 (alloca) [_MSC_VER]: Define to _alloca.
11086
11087 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11088
11089 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11090
11091 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11092
11093 * xdisp.c (note_mouse_highlight): If either of
11094 previous/next-single-property-change returns nil, treat that as
11095 the beginning or the end of the buffer. (Bug#9955)
11096
11097 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11098
11099 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
11100 label is not null (Bug#9951).
11101 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11102 may be NULL.
11103
11104 2011-11-04 Eli Zaretskii <eliz@gnu.org>
11105
11106 * window.c (Fwindow_body_size): Mention in the doc string that the
11107 return value is in frame's canonical units. (Bug#9949)
11108
11109 2011-11-03 Eli Zaretskii <eliz@gnu.org>
11110
11111 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11112
11113 * w32fns.c (unwind_create_frame): If needed, free the glyph
11114 matrices of the partially constructed frame. (Bug#9943)
11115 * xfns.c (unwind_create_frame): Likewise.
11116
11117 2011-11-01 Eli Zaretskii <eliz@gnu.org>
11118
11119 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11120 Don't stop backward scan on the continuation glyph, even though
11121 its CHARPOS is positive.
11122 (mouse_face_from_buffer_pos, note_mouse_highlight):
11123 Rename cover_string to disp_string.
11124
11125 2011-11-01 Martin Rudalics <rudalics@gmx.at>
11126
11127 * window.c (temp_output_buffer_show): Don't use
11128 Vtemp_buffer_show_specifiers.
11129 (Vtemp_buffer_show_specifiers): Remove unused variable.
11130
11131 2011-10-30 Eli Zaretskii <eliz@gnu.org>
11132
11133 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11134 past the beginning of the current glyph matrix.
11135
11136 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
11137
11138 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11139 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11140 HAVE_GTK3 (Bug#9869).
11141
11142 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11143 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11144
11145 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11146
11147 * xterm.c: Declare x_handle_net_wm_state to return int.
11148 (handle_one_xevent): Check if we are iconified but don't have
11149 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11150 (get_current_wm_state): Return non-zero if not hidden,
11151 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11152 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11153 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11154 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11155
11156 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11157
11158 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11159 so that this new function doesn't get optimized away by a
11160 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11161
11162 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11163
11164 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11165
11166 2011-10-29 Eli Zaretskii <eliz@gnu.org>
11167
11168 Fix the `xbytecode' command.
11169 * .gdbinit (xprintbytestr): New command.
11170 (xwhichsymbols): Rename from `which'; all callers changed.
11171 (xbytecode): Print the byte-code string as well.
11172
11173 2011-10-29 Kim Storm <storm@cua.dk>
11174
11175 * alloc.c (which_symbols): New function.
11176
11177 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11178
11179 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11180 line. (Bug#9903)
11181
11182 2011-10-29 Glenn Morris <rgm@gnu.org>
11183
11184 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11185 Not clear what it was for, and it causes various bugs. (Bug#9839)
11186
11187 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11188
11189 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11190 possible random value that matches one of those tested as
11191 condition to clear the mouse face.
11192
11193 2011-10-28 Chong Yidong <cyd@gnu.org>
11194
11195 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11196
11197 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11198
11199 * window.c (make_window): Initialize phys_cursor_on_p.
11200
11201 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11202
11203 * lisp.h (struct Lisp_Symbol): Update comments.
11204
11205 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
11206
11207 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11208
11209 2011-10-28 Eli Zaretskii <eliz@gnu.org>
11210
11211 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11212 <oslsachem@gmail.com> for helping to debug this.
11213
11214 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11215 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11216 (g_b_init_get_glyph_outline_w): New static variables.
11217 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11218 (GetGlyphOutlineW_Proc): New typedefs.
11219 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
11220 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11221 New functions.
11222 (w32font_open_internal, compute_metrics):
11223 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
11224 instead of calling the "wide" APIs directly.
11225
11226 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11227
11228 * w32.h (syms_of_w32font): Add prototype.
11229
11230 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11231
11232 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11233 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11234 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11235 (Fmove_to_window_line): Doc fix.
11236
11237 2011-10-27 Chong Yidong <cyd@gnu.org>
11238
11239 * process.c (make_process): Set gnutls_state to NULL.
11240
11241 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11242 non-NULL, regardless of GNUTLS_INITSTAGE.
11243 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11244 an error. Set process slots as soon as we allocate them.
11245
11246 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11247
11248 2011-10-27 Chong Yidong <cyd@gnu.org>
11249
11250 * gnutls.c (emacs_gnutls_deinit): New function.
11251 Deallocate credentials structures as well as calling gnutls_deinit.
11252 (Fgnutls_deinit, Fgnutls_boot): Use it.
11253
11254 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11255 (deactivate_process): Call emacs_gnutls_deinit.
11256
11257 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
11258
11259 * image.c (x_create_x_image_and_pixmap):
11260 * w32.c (sys_rename, w32_delayed_load):
11261 * w32font.c (fill_in_logfont):
11262 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11263
11264 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
11265
11266 * w32fns.c (w32_default_color_map): New function,
11267 extracted from Fw32_default_color_map.
11268 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
11269
11270 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11271
11272 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11273
11274 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11275
11276 * keyboard.c (test_undefined): New function (bug#9751).
11277 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11278
11279 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11280
11281 * sysdep.c (init_sys_modes): Fix the check for the controlling
11282 terminal (Bug#6649).
11283
11284 2011-10-20 Eli Zaretskii <eliz@gnu.org>
11285
11286 * dispextern.h (struct bidi_it): New member next_en_type.
11287
11288 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11289 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11290 current character, check also for next_en_type being WEAK_EN.
11291 (bidi_resolve_weak): Don't enter the expensive loop if the current
11292 position is before next_en_pos. Record the bidi type of the first
11293 non-ET, non-BN character we find, in addition to its position.
11294 (bidi_level_of_next_char): Invalidate next_en_type when
11295 next_en_pos is over-stepped.
11296
11297 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11298
11299 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11300 * editfns.c: Rewrite current-time-zone so that it invokes
11301 the equivalent of (format-time-string "%Z") to get the time zone name.
11302 This fixes a bug when the time zone name contains characters that
11303 need converting from the system time locale to Emacs internal format.
11304 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11305 that patch fixed format-time-string to do the conversion, but
11306 I forgot to fix current-time-zone.
11307 (format_time_string): New function, containing most of
11308 what Fformat_time_string used to contain.
11309 (Fformat_time_string): Rewrite in terms of format_time_string.
11310 This doesn't change this function's behavior.
11311 (current-time-zone): Rewrite to use format_time_string.
11312 This fixes the bug reported by Michael Schierl in
11313 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11314 Jason Rumney's 2007-06-07 change worked around this bug, but
11315 didn't fix it.
11316 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11317
11318 2011-10-19 Eli Zaretskii <eliz@gnu.org>
11319
11320 * xdisp.c (start_display): If the character at POS is displayed
11321 via a display vector, reset IT->current.dpvec_index to zero.
11322 (try_window_reusing_current_matrix): If a line ends in a display
11323 vector or the next line starts in a display vector, continue
11324 redrawing the window even though the character position of
11325 start_row was reached.
11326 (Bug#9771, part 2)
11327
11328 2011-10-18 Chong Yidong <cyd@gnu.org>
11329
11330 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11331 with nobreak-char-display too.
11332
11333 2011-10-18 Eli Zaretskii <eliz@gnu.org>
11334
11335 Fix part 3 of bug#9771.
11336 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11337 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11338 non-neutral characters if the current character is a paragraph
11339 separator (a.k.a. Newline). This avoids running the same
11340 expensive loop twice, once when we consume the preceding newline
11341 and the other time when the line actually needs to be displayed.
11342 Avoid the loop when we see neutrals on the base embedding level
11343 following a character whose directionality is the same as the
11344 paragraph's. This avoids running the expensive loop when a line
11345 ends in a long sequence of neutrals, like control characters.
11346 Add assertion against STRONG_AL type. Slightly rearrange code
11347 that determines the type of a neutral given the first non-neutral
11348 that follows it.
11349 (bidi_level_of_next_char): Set next_en_pos to zero when
11350 invalidating its info.
11351
11352 2011-10-17 Eli Zaretskii <eliz@gnu.org>
11353
11354 * xdisp.c (push_display_prop): Determine whether to record string
11355 or buffer position by IT->string, not by IT->method. Allow
11356 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
11357 (move_it_vertically_backward): Don't look for character position
11358 immediately after the newline when in a continuation line.
11359 (Bug#9771, part 1)
11360
11361 2011-10-15 Martin Rudalics <rudalics@gmx.at>
11362
11363 * window.c (coordinates_in_window): Rewrite and delabelize
11364 vertical border check. (Bug#5357) (Bug#9618)
11365
11366 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11367
11368 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11369 errors in XSetWindowBorder (bug#9310).
11370
11371 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11372
11373 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11374 avoid crash when xmalloc overrun checking is enabled.
11375
11376 2011-10-13 Eli Zaretskii <eliz@gnu.org>
11377
11378 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11379 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11380 cursor motion with <left> and <right> arrow keys.
11381
11382 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11383 some callers set that themselves.
11384
11385 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11386
11387 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11388 display string and the previous row comes from the same string and
11389 is empty. (Bug#9739) (Bug#9738)
11390
11391 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11392
11393 * doc.c (get_doc_string): Encode file name (bug#9735).
11394
11395 2011-10-12 Eli Zaretskii <eliz@gnu.org>
11396
11397 * bidi.c (bidi_level_of_next_char):
11398 * xdisp.c (get_visually_first_element): Remove old incorrect
11399 comments regarding the Unicode Line Separator character.
11400
11401 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11402
11403 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11404
11405 * alloc.c (Fgc_status): Do not access beyond zombies array
11406 boundary if nzombies > MAX_ZOMBIES.
11407 * alloc.c (dump_zombies): Add missing format specifier.
11408
11409 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11410
11411 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11412 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11413
11414 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11415 Some packages use them to denote characters with modifiers.
11416
11417 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11418
11419 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11420 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11421 matching a pp-number. Rename parameter var to var1.
11422
11423 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11424
11425 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11426
11427 2011-10-08 Glenn Morris <rgm@gnu.org>
11428
11429 * callint.c (Fcall_interactively): Give a more explicit error for the
11430 'c' case with a non-character input. (Bug#8479)
11431
11432 2011-10-08 Eli Zaretskii <eliz@gnu.org>
11433
11434 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11435 lines.
11436 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11437 lines that are hscrolled on the left.
11438
11439 * dispnew.c (buffer_posn_from_coords): Account for a possible
11440 presence of header-line. (Bug#4426)
11441
11442 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11443
11444 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11445 Don't advertise functionality which we discourage or doesn't work.
11446
11447 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11448
11449 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11450 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11451 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11452 this makes Emacs dump core during garbage collection on rare
11453 occasions. sizeof is obviously inferior to offsetof here, so
11454 stick with offsetof.
11455 (GC_POINTER_ALIGNMENT): New macro.
11456 (mark_memory): Omit 3rd (offset) arg; caller changed.
11457 Don't assume EMACS_INT alignment is the same as pointer alignment.
11458
11459 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11460
11461 * keyboard.c (read_key_sequence_remapped): New var.
11462 (read_key_sequence): Compute remapping in the right buffer.
11463 (command_loop_1): Use read_key_sequence's remapping directly.
11464
11465 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11466
11467 * dired.c (file_name_completion): Don't expand file name.
11468 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11469 before checking file name handler.
11470
11471 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11472 they've been requested explicitly (bug#9591).
11473
11474 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
11475
11476 * keymap.c (Fsingle_key_description): Use make_specified_string
11477 instead of build_string to build string from push_key_description.
11478 (Bug#5193)
11479
11480 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11481
11482 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11483 This fixes a Y2038 bug on 64-bit hosts.
11484 * buffer.c (reset_buffer):
11485 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11486 (Fclear_buffer_auto_save_failure):
11487 Use 0, not -1, to represent an unset failure time, since time_t
11488 might not be signed.
11489
11490 Remove dependency on glibc malloc internals.
11491 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11492 Move back here from lisp.h, but with their new implementations.
11493 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11494 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11495 * charset.c (charset_table_init): New static var.
11496 (syms_of_charset): Use it instead of xmalloc. This removes a
11497 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11498 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11499 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11500 Move back to alloc.c.
11501 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11502 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11503
11504 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11505
11506 * nsterm.m (windowDidResize): Call x_set_window_size only when
11507 ns_in_resize is true. Otherwise set pixelwidth/height and
11508 call change_frame_size (Bug#9628).
11509
11510 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11511
11512 Port --enable-checking=all to Fedora 14 x86-64.
11513 * charset.c (syms_of_charset): Also account for glibc malloc's
11514 internal overhead when calculating the initial malloc maximum.
11515
11516 Port --enable-checking=all to Fedora 14 x86.
11517 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11518 Move to lisp.h.
11519 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11520 (overrun_check_realloc, overrun_check_free):
11521 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11522 That way, xmalloc returns a properly-aligned pointer even if
11523 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11524 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11525 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11526 into account when calculating the initial malloc maximum.
11527 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11528 Move here from alloc.c, so that charset.c can use it too.
11529 Properly align; the old code wasn't right for common 32-bit hosts
11530 when configured with --enable-checking=all.
11531 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11532 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11533
11534 2011-09-29 Eli Zaretskii <eliz@gnu.org>
11535
11536 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
11537 use EDOM.
11538
11539 2011-09-28 Eli Zaretskii <eliz@gnu.org>
11540
11541 * xdisp.c (compute_display_string_end): If there's no display
11542 string at CHARPOS, return -1.
11543
11544 * bidi.c (bidi_fetch_char): When compute_display_string_end
11545 returns a negative value, treat the character as a normal
11546 character not covered by a display string. (Bug#9624)
11547
11548 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
11549
11550 * lread.c (Fread_from_string): Fix typo in docstring.
11551
11552 2011-09-27 Eli Zaretskii <eliz@gnu.org>
11553
11554 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11555 newline, reseat the iterator instead of bidi-iterating there one
11556 character at a time. (Bug#9610)
11557 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11558 TO_CHARPOS if the bidi iterator is at base embedding level.
11559
11560 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
11561
11562 * lread.c (readevalloop): Use correct code for NBSP.
11563 (read1): Likewise. (Bug#9608)
11564
11565 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
11566
11567 * dbusbind.c (Fdbus_register_signal): When service is not
11568 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
11569
11570 2011-09-25 Glenn Morris <rgm@gnu.org>
11571
11572 * buffer.c (truncate-lines): Doc fix.
11573
11574 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
11575
11576 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
11577 (Fset_window_next_buffers): Doc fix.
11578
11579 2011-09-24 Glenn Morris <rgm@gnu.org>
11580
11581 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
11582
11583 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
11584
11585 Fix minor problems found by static checking.
11586 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
11587 * indent.c (Fvertical_motion): Fix == vs = typo.
11588
11589 2011-09-24 Eli Zaretskii <eliz@gnu.org>
11590
11591 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
11592 Default value is now t. Doc fix.
11593
11594 * indent.c (Fvertical_motion): Compute and apply the overshoot
11595 logic when moving up, not only when moving down. Fix the
11596 confusing name and values of the it_overshoot_expected variable;
11597 logic changes accordingly. (Bug#9254) (Bug#9549)
11598
11599 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
11600 CHARPOS is covered by a display string which includes newlines.
11601 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
11602 is covered by a display string with embedded newlines.
11603
11604 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
11605
11606 * dbusbind.c (Fdbus_register_signal): Add match rule to
11607 Vdbus_registered_objects_table. (Bug#9581)
11608 (Fdbus_register_method, Vdbus_registered_objects_table):
11609 Fix docstring.
11610
11611 2011-09-24 Jim Meyering <meyering@redhat.com>
11612
11613 do not ignore write error for any output size
11614 The previous change was incomplete.
11615 While it makes emacs --batch detect the vast majority of stdout
11616 write failures, errors were still ignored whenever the output size is
11617 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
11618 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
11619 && echo FAIL: ignored write error
11620 FAIL: ignored write error
11621 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
11622 && echo FAIL: ignored write error
11623 FAIL: ignored write error
11624 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
11625
11626 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
11627
11628 * emacs.c (Fkill_emacs): In noninteractive mode exit
11629 non-successfully if a write error occurred on stdout. (Bug#9574)
11630
11631 2011-09-21 Eli Zaretskii <eliz@gnu.org>
11632
11633 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
11634 the xassert test.
11635
11636 * dispextern.h (struct it): Update the comment documenting what
11637 can it->OBJECT be.
11638
11639 2011-09-20 Eli Zaretskii <eliz@gnu.org>
11640
11641 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
11642 a display string, extend search for cursor position to end of row.
11643 (find_row_edges): If the row ends in a newline from a display
11644 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
11645 Handle the case of a display string with multiple newlines.
11646 (Fcurrent_bidi_paragraph_direction): Fix search for previous
11647 non-empty line. Fixes confusing cursor motion with arrow keys at
11648 the beginning of a line that starts with whitespace.
11649
11650 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
11651
11652 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
11653 (bug#9493).
11654
11655 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
11656
11657 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
11658 boolean (Bug#9154).
11659
11660 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11661
11662 * xdisp.c (display_line): Record maximum and minimum buffer
11663 positions even if no glyphs were produced (e.g., by a zero-width
11664 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
11665 buffer positions that will be removed from the glyph row because
11666 they don't fit.
11667 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
11668 column is beyond frame width: don't subtract 1 "pixel" when
11669 computing width of the stretch.
11670 (reseat_at_next_visible_line_start): Undo the change made on
11671 2011-09-17 that saved paragraph information and restored it after
11672 the call to `reseat'. (Bug#9545)
11673
11674 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11675
11676 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
11677 and turn window cursor on if cleared (Bug#9415).
11678
11679 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
11680
11681 * search.c (boyer_moore): Take unibyte characters from pattern
11682 literally. (Bug#9458)
11683
11684 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11685
11686 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
11687
11688 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
11689
11690 Fix minor problem found by static checking.
11691 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
11692 initialized, to pacify gcc -Wuninitialized.
11693
11694 * fileio.c: Report proper errno when syscall falls.
11695 (Finsert_file_contents): Save and restore errno,
11696 so that report_file_error outputs the correct diagnostic.
11697 (Fwrite_region) [CLASH_DETECTION]: Likewise.
11698
11699 2011-09-18 Eli Zaretskii <eliz@gnu.org>
11700
11701 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
11702
11703 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11704
11705 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
11706 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
11707
11708 2011-09-17 Eli Zaretskii <eliz@gnu.org>
11709
11710 * xdisp.c (reseat_at_next_visible_line_start): Keep information
11711 about the current paragraph and restore it after the call to reseat.
11712
11713 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
11714 (bidi_find_paragraph_start): Search back for paragraph beginning
11715 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
11716 (bidi_move_to_visually_next): Only trigger paragraph-related
11717 computations when the last character is a newline or at EOB, not
11718 just any NEUTRAL_B. (Bug#9470)
11719
11720 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
11721 truncated lines if point is covered by a display string. (Bug#9524)
11722
11723 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
11724
11725 * xselect.c: Relax test for outgoing X longs (Bug#9498).
11726 (cons_to_x_long): New function.
11727 (lisp_data_to_selection_data): Use it. Correct the test for
11728 short-versus-long data; it was negated. Break out of vector
11729 loop, for efficiency, when a long datum is discovered.
11730
11731 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
11732
11733 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
11734
11735 2011-09-16 Eli Zaretskii <eliz@gnu.org>
11736
11737 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
11738 GCC PR/17406) by declaring this function with external scope.
11739
11740 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11741
11742 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
11743 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
11744
11745 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
11746
11747 * editfns.c (Fformat): Correctly handle text properties on "%%".
11748
11749 2011-09-15 Eli Zaretskii <eliz@gnu.org>
11750
11751 * xterm.c (x_draw_composite_glyph_string_foreground):
11752 * w32term.c (x_draw_composite_glyph_string_foreground):
11753 * term.c (encode_terminal_code):
11754 * composite.c (composition_update_it, get_composition_id):
11755 * xdisp.c (get_next_display_element)
11756 (fill_composite_glyph_string): Add comments about special meaning
11757 of TAB characters in a composition.
11758
11759 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
11760
11761 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
11762 This occurs when processing a multibyte format.
11763 Problem reported by Wolfgang Jenker.
11764
11765 2011-09-15 Johan Bockgård <bojohan@gnu.org>
11766
11767 * xdisp.c (try_cursor_movement): Only check for exact match if
11768 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
11769
11770 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11771
11772 Remove unused external symbols.
11773 * dispextern.h (calc_pixel_width_or_height): Remove decl.
11774 * xdisp.c (calc_pixel_width_or_height): Now static.
11775 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
11776 * indent.c (check_display_width):
11777 * w32term.c: Fix comment to match code.
11778 * xterm.c, xterm.h (x_catching_errors): Remove.
11779
11780 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
11781
11782 * xselect.c: Use signed conversions more consistently (Bug#9498).
11783 (selection_data_to_lisp_data): Assume incoming selection data are
11784 signed integers, not unsigned. This is to be consistent with
11785 outgoing selection data, which was modified to use signed integers
11786 in as part of the fix to Bug#9196 in response to Jan D.'s comment
11787 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
11788 expects long, not unsigned long.
11789
11790 2011-09-14 Eli Zaretskii <eliz@gnu.org>
11791
11792 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
11793 computation of loop end. Reported by Johan Bockgård
11794 <bojohan@gnu.org>.
11795
11796 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
11797
11798 * frame.c (Fother_visible_frames_p): Function deleted.
11799
11800 2011-09-12 Eli Zaretskii <eliz@gnu.org>
11801
11802 * indent.c (compute_motion): Process display vector front to back
11803 rather than the other way around. (Bug#2496)
11804
11805 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
11806
11807 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
11808
11809 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
11810
11811 * minibuf.c (Fread_from_minibuffer): Doc fix.
11812
11813 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11814
11815 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
11816 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
11817
11818 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
11819
11820 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
11821 value for non-existent files.
11822
11823 2011-09-11 Eli Zaretskii <eliz@gnu.org>
11824
11825 * fileio.c (Finsert_file_contents): If the file cannot be opened,
11826 set its "size" to -1. This will set the modtime_size field of
11827 the corresponding buffer to -1, which is what
11828 verify-visited-file-modtime expects for files that do not exist.
11829 (Bug#9139)
11830
11831 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
11832
11833 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
11834 here ...
11835 * lisp.h: ... from here. push_key_description is no longer
11836 defined in keyboard.c, so its declaration should not be in
11837 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
11838 logically belongs with push_key_description.
11839
11840 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
11841
11842 * buffer.h: Include <sys/types.h> instead of <time.h>.
11843 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
11844 Problem reported by Herbert J. Skuhra.
11845
11846 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
11847
11848 * xml.c (parse_region): Make the parsing work for
11849 non-comment-starting XML files again (bug#9144).
11850
11851 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
11852
11853 * image.c (gif_load): Fix calculation of bottom and right corner.
11854 (Bug#9468)
11855
11856 2011-09-10 Eli Zaretskii <eliz@gnu.org>
11857
11858 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
11859 redisplay in small windows.
11860
11861 2011-09-09 Eli Zaretskii <eliz@gnu.org>
11862
11863 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
11864
11865 2011-09-08 Martin Rudalics <rudalics@gmx.at>
11866
11867 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
11868 Operate on live windows only.
11869
11870 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
11871
11872 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
11873
11874 2011-09-07 Eli Zaretskii <eliz@gnu.org>
11875
11876 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
11877 only under bidi iteration.
11878
11879 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
11880
11881 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
11882
11883 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11884
11885 isnan: Fix porting problem to Solaris 10 with bundled gcc.
11886 Without this fix, the command to link temacs failed due to an
11887 undefined symbol __builtin_isnan. This is because
11888 /usr/include/iso/math_c99.h #defines isnan(x) to
11889 __builtin_isnan(x), but the bundled gcc, which identifies itself
11890 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
11891 a __builtin_isnan.
11892 * floatfns.c (isnan): #undef, and then #define to a clone of
11893 what's in data.c.
11894 (Fisnan): Always define, since it's always available now.
11895 (syms_of_floatfns): Always define isnan at the Lisp level.
11896
11897 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11898
11899 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
11900
11901 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
11902
11903 * fileio.c: Fix bugs with large file offsets (Bug#9428).
11904 The previous code assumed that file offsets (off_t values) fit in
11905 EMACS_INT variables, which is not true on typical 32-bit hosts.
11906 The code messed up by falsely reporting buffer overflow in cases
11907 such as (insert-file-contents "big" nil 1 2) into an empty buffer
11908 when "big" contains more than 2**29 bytes, even though this
11909 inserts just one byte and does not overflow the buffer.
11910 (Finsert_file_contents): Store file offsets as off_t
11911 values, not as EMACS_INT values. Check for overflow when
11912 converting between EMACS_INT and off_t. When checking for
11913 buffer overflow or for overlap, take the offsets into account.
11914 Don't use EMACS_INT for small values where int suffices.
11915 When checking for overlap, fix a typo: ZV was used where
11916 ZV_BYTE was intended.
11917 (Fwrite_region): Don't assume off_t fits into 'long'.
11918 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
11919
11920 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
11921
11922 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
11923
11924 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
11925
11926 sprintf-related integer and memory overflow issues (Bug#9412).
11927
11928 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
11929 (esprintf, exprintf, evxprintf): New functions.
11930 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
11931 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
11932 (modify_event_symbol): Do not assume that the length of
11933 name_alist_or_stem is safe to alloca and fits in int.
11934 (Fexecute_extended_command): Likewise for function name and binding.
11935 (Frecursion_depth): Wrap around reliably on integer overflow.
11936 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
11937 since some callers pass EMACS_INT values.
11938 (Fsingle_key_description): Don't crash if symbol name contains more
11939 than MAX_ALLOCA bytes.
11940 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
11941 (get_minibuffer): Arg is now EMACS_INT, not int.
11942 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
11943 (esprintf, exprintf, evxprintf): New decls.
11944 * window.h (command_loop_level, minibuf_level): Reflect API changes.
11945
11946 * dbusbind.c (signature_cat): New function.
11947 (xd_signature, Fdbus_register_signal):
11948 Do not overrun buffer; instead, report string overflow.
11949
11950 * dispnew.c (add_window_display_history): Don't overrun buffer.
11951 Truncate instead; this is OK since it's just a log.
11952
11953 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
11954 even if the time zone offset is outlandishly large.
11955 Don't mishandle offset == INT_MIN.
11956
11957 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
11958 when creating daemon; the previous buffer-overflow check was incorrect.
11959
11960 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
11961 which has the guts of the old verror function.
11962
11963 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
11964 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
11965
11966 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
11967 (font_unparse_xlfd): Don't blindly alloca long strings.
11968 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
11969 fits in int, when using sprintf. Use single snprintf to count
11970 length of string rather than counting it via multiple sprintfs;
11971 that's simpler and more reliable.
11972 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
11973 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
11974 sprintf, in case result does not fit in int.
11975
11976 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
11977 (fontset_from_font): Print it.
11978
11979 * frame.c (tty_frame_count): Now printmax_t, not int.
11980 (make_terminal_frame, set_term_frame_name): Print it.
11981 (x_report_frame_params): In X, window IDs are unsigned long,
11982 not signed long, so print them as unsigned.
11983 (validate_x_resource_name): Check for implausibly long names,
11984 and don't assume name length fits in 'int'.
11985 (x_get_resource_string): Don't blindly alloca invocation name;
11986 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
11987 not fit in int.
11988
11989 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
11990 (xg_check_special_colors, xg_set_geometry):
11991 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
11992
11993 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
11994 Use esprintf, not sprintf, in case result does not fit in int.
11995
11996 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
11997 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
11998 it as a large positive number.
11999 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12000 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12001
12002 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12003 in case result does not fit in int.
12004
12005 * print.c (float_to_string): Detect width overflow more reliably.
12006 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12007 buffer overrun. Don't assume list length fits in 'int'. Treat
12008 print length of 0 as 0, not as infinity; to be consistent with other
12009 uses of print length in this function. Don't overflow print length
12010 index. Don't assume hash table size fits in 'long', or that
12011 vectorlike size fits in 'unsigned long'.
12012
12013 * process.c (make_process): Use printmax_t, not int, to format
12014 process-name gensyms.
12015
12016 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12017
12018 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12019 to avoid potential buffer overrun.
12020
12021 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12022 if X resource line is longer than 512 bytes.
12023
12024 * xfns.c (x_window): Make sprintf buffer a bit bigger
12025 to avoid potential buffer overrun.
12026
12027 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12028
12029 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12030
12031 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12032
12033 Integer overflow fixes for scrolling, etc.
12034 Without these, Emacs silently mishandles large integers sometimes.
12035 For example, "C-u 4294967297 M-x recenter" was treated as if
12036 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12037
12038 * xdisp.c (try_window_id): Check Emacs fixnum range before
12039 converting to 'int'.
12040
12041 * window.c (window_scroll_line_based, Frecenter):
12042 Check that an Emacs fixnum is in range before assigning it to 'int'.
12043 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12044 values converted from Emacs fixnums.
12045 (Frecenter): Don't wrap around a line count if it is out of 'int'
12046 range; instead, treat it as an extreme value.
12047 (Fset_window_configuration, compare_window_configurations):
12048 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12049
12050 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12051 that can exceed INT_MAX. Check that EMACS_INT value is in range
12052 before assigning it to the (possibly-narrower) index.
12053 (match_limit): Don't assume that a fixnum can fit in 'int'.
12054
12055 * print.c (print_object): Use ptrdiff_t, not int, for index that can
12056 exceed INT_MAX.
12057
12058 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
12059 (Fvertical_motion): Don't wrap around LINES values that don't fit
12060 in 'int'. Instead, treat them as extreme values. This is good
12061 enough for windows, which can't have more than INT_MAX lines anyway.
12062
12063 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12064
12065 * Require libxml/parser.h to avoid compilation warning.
12066
12067 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12068
12069 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12070 since this reportedly can destroy thread storage.
12071
12072 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
12073
12074 * syntax.c (find_defun_start): Update all cache variables if
12075 exiting early (Bug#9401).
12076
12077 2011-08-30 Eli Zaretskii <eliz@gnu.org>
12078
12079 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12080
12081 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12082 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12083 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12084
12085 * term.c (tty_append_glyph): New function.
12086 (produce_stretch_glyph): Static function and its prototype deleted.
12087
12088 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12089 Add prototypes.
12090
12091 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12092
12093 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12094 when checking :margin (Bug#9390).
12095 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
12096 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
12097 so that the name doesn't mislead. All uses changed.
12098
12099 2011-08-28 Johan Bockgård <bojohan@gnu.org>
12100
12101 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12102 set_tty_hooks.
12103
12104 2011-08-27 Eli Zaretskii <eliz@gnu.org>
12105
12106 * xdisp.c (move_it_to): Don't bail out early when reaching
12107 position beyond to_charpos, if we are scanning backwards.
12108 (move_it_vertically_backward): When DY == 0, make sure we get to
12109 the first character in the line after the newline.
12110
12111 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12112
12113 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12114 (ccl_driver): Do not generate an out-of-range pointer.
12115 (Fccl_execute_on_string): Remove unnecessary check for
12116 integer overflow, noted by Stefan Monnier in
12117 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12118 Remove a FIXME that didn't need fixing.
12119 Simplify the newly-introduced buffer reallocation code.
12120
12121 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
12122
12123 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12124
12125 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
12126
12127 Integer and memory overflow issues (Bug#9196).
12128
12129 * doc.c (get_doc_string): Rework so that
12130 get_doc_string_buffer_size is the actual buffer size, rather than
12131 being 1 less than the actual buffer size; this makes xpalloc more
12132 convenient.
12133
12134 * image.c (x_allocate_bitmap_record, cache_image):
12135 * xselect.c (Fx_register_dnd_atom):
12136 Simplify previous changes by using xpalloc.
12137
12138 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12139 since either will do and ptrdiff_t is convenient with xpalloc.
12140
12141 * charset.c (charset_table_size)
12142 (struct charset_sort_data.priority): Now ptrdiff_t.
12143 (charset_compare): Don't overflow if priorities differ greatly.
12144 (Fsort_charsets): Don't assume list length fits in int.
12145 Check for size-calculation overflow when allocating sort data.
12146 (syms_of_charset): Allocate an initial charset table that is
12147 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12148
12149 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12150
12151 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12152 The actual value is always <= INT_MAX, and leaving it unsigned made
12153 overflow checking harder.
12154
12155 * dispextern.h (struct glyph_matrix.rows_allocated)
12156 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12157 with xpalloc. The values are still always <= INT_MAX.
12158
12159 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12160
12161 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12162 (SAFE_NALLOCA): New macro.
12163
12164 * region-cache.c (struct boundary.pos, find_cache_boundary)
12165 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12166 (set_cache_region, invalidate_region_cache)
12167 (revalidate_region_cache, know_region_cache, region_cache_forward)
12168 (region_cache_backward, pp_cache):
12169 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12170 so that ptrdiff_t * can be passed to xpalloc.
12171 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12172 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12173 (pp_cache): Don't assume cache_len fits in int.
12174 * region-cache.h: Adjust extern decls to match.
12175
12176 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12177 EMACS_INT, since either will do, for xpalloc.
12178
12179 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12180 (xnmalloc, xnrealloc, xpalloc): New functions.
12181
12182 * bidi.c (bidi_shelve_header_size): New constant.
12183 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12184 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12185
12186 * bidi.c (bidi_cache_shrink):
12187 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12188 (overlay_strings):
12189 Don't update size of array until after memory allocation succeeds,
12190 because xmalloc/xrealloc may not return.
12191 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12192 now that we have proper integer overflow checking.
12193 (record_overlay_string, overlay_strings): Catch overflows when
12194 calculating size of overlay_str_buf.
12195
12196 * callproc.c (Fcall_process): Check for size overflow when
12197 calculating size of args2.
12198 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12199 Normally we prefer signed values, but sticking with ptrdiff_t would
12200 require adding more-complicated checks.
12201
12202 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12203 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12204 Redo buffer-overflow calculations to avoid integer overflow.
12205 Add a FIXME comment where memory seems to be over-allocated.
12206
12207 * character.c (Fstring): Check for size-calculation overflow.
12208
12209 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12210 unnecessary integer overflow. Check for size overflow.
12211 (encode_coding_object): Don't update size until xmalloc succeeds.
12212
12213 * composite.c (get_composition_id): Check for overflow in glyph
12214 length calculations.
12215
12216 Integer and memory overflow fixes for display code.
12217 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12218 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12219 (scrolling_window): Check for overflow in size calculations.
12220 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12221 Don't assume glyph table len fits in int.
12222 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12223 (row_table_size): Now ptrdiff_t, not int.
12224 (scrolling_window): Avoid overflow in size calculations.
12225 Don't update size until allocation succeeds.
12226 * fns.c (concat): Check for overflow in size calculations.
12227 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12228 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12229 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12230
12231 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12232 (get_doc_string): Check for size calculation overflow.
12233 Don't update size until allocation succeeds.
12234 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12235 EMACS_INT, where ptrdiff_t will do.
12236 (Fsubstitute_command_keys): Check for string overflow.
12237
12238 * editfns.c (set_time_zone_rule): Don't assume environment length
12239 fits in int.
12240 (message_length): Now ptrdiff_t, not int.
12241 (Fmessage_box): Don't update size until allocation succeeds.
12242 Don't assume message length fits in int.
12243 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12244
12245 * emacs.c (main): Do not reallocate argv, since there is a null at
12246 the end that can be overwritten, and this way there's no need to
12247 worry about size-calculation overflow.
12248 (sort_args): Check for size-calculation overflow.
12249
12250 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12251 alloc succeeds.
12252 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12253
12254 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12255 (x_set_scroll_bar_width, x_figure_window_size):
12256 Check for integer overflow.
12257 (x_set_alpha): Do not assume XINT fits in int.
12258
12259 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12260 This is for the members text_lines, text_cols, total_lines, total_cols,
12261 where the system imposes an 'int' limit.
12262
12263 * fringe.c (Fdefine_fringe_bitmap):
12264 Don't update size until alloc works.
12265
12266 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12267 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12268
12269 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12270 Check for size-calculation overflow.
12271 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12272 do, as we prefer signed integers.
12273 (id_to_widget.max_size, id_to_widget.used)
12274 (xg_store_widget_in_map, xg_remove_widget_from_map)
12275 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12276 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12277 Use and return ptrdiff_t, not int.
12278 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12279 * gtkutil.h: Change prototypes to match the above.
12280
12281 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12282 are duplicate now that they've been promoted to lisp.h.
12283 (x_allocate_bitmap_record, x_alloc_image_color)
12284 (make_image_cache, cache_image, xpm_load):
12285 Don't update size until alloc is done.
12286 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12287 (x_detect_edges):
12288 Check for size calculation overflow.
12289 (ct_colors_allocated_max): New constant.
12290 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12291 overflow.
12292
12293 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12294 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12295 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12296 Use ptrdiff_t, not int, to count maps.
12297 (read_char_minibuf_menu_prompt): Check for overflow in size
12298 calculations. Don't update size until allocation succeeds.
12299 Redo calculations to avoid overflow.
12300 * keyboard.h: Change prototypes to match the above.
12301
12302 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12303 to count maps.
12304 (current_minor_maps): Check for size calculation overflow.
12305 * keymap.h: Change prototypes to match the above.
12306
12307 * lread.c (read1, init_obarray): Don't update size until alloc done.
12308
12309 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12310 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12311
12312 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12313 Now ptrdiff_t, not int.
12314 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12315 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12316
12317 * process.c (Fnetwork_interface_list): Check for overflow
12318 in size calculation.
12319
12320 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12321
12322 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12323 overflow. Don't bother calling xmalloc when xrealloc will do.
12324
12325 * search.c (Freplace_match): Check for size calculation overflow.
12326 (Fset_match_data): Don't assume list lengths fit in 'int'.
12327
12328 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12329 for command line length. Do not attempt to address one before the
12330 beginning of an array, as that's not portable.
12331
12332 * term.c (max_frame_lines): Remove; unused.
12333 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12334 not int.
12335 (encode_terminal_code, calculate_costs): Check for size
12336 calculation overflow.
12337 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12338 table lengths and related sizes. Don't update size until alloc
12339 done. Redo calculations to avoid overflow.
12340 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12341
12342 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12343 subtracting pointers.
12344 (gobble_line): Check for overflow more carefully. Don't update size
12345 until alloc done.
12346
12347 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12348 Don't update size until alloc done.
12349 Redo size calculations to avoid overflow.
12350 Check for size calculation overflow.
12351 (main) [DEBUG]: Fix typo in invoking tparam1.
12352
12353 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12354 Use ptrdiff_t, not int, for sizes.
12355 (store_mode_line_noprop_char): Don't update size until alloc done.
12356
12357 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12358 Use ptrdiff_t, not int, for sizes.
12359 (Finternal_make_lisp_face, cache_face):
12360 Check for size calculation overflow.
12361 (cache_face): Treat size calculation overflows as if they were
12362 memory exhaustion (the usual treatment), rather than aborting.
12363
12364 * xfns.c (x_encode_text, x_set_name_internal)
12365 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12366 sizes, since they can exceed INT_MAX in size. Check for size
12367 calculation overflow.
12368
12369 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12370 (xg_select): Check for size calculation overflow.
12371 Don't update size until alloc done.
12372
12373 * xrdb.c (get_environ_db): Don't assume path length fits in int,
12374 as sprintf is limited to int lengths.
12375
12376 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12377 (X_LONG_MIN): New macros.
12378 Use them to make the following changes clearer.
12379 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12380 This change doesn't affect the value now, but it may help remind
12381 future maintainers not to raise the value too much later.
12382 (SELECTION_QUANTUM): Remove, replacing with ...
12383 (selection_quantum): ... new function, which avoids overflow.
12384 All uses changed.
12385 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12386 assumption that selection length fits in 'int'.
12387 (x_reply_selection_request, x_handle_selection_request)
12388 (x_get_window_property, receive_incremental_selection)
12389 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12390 (lisp_data_to_selection_data, clean_local_selection_data):
12391 Use ptrdiff_t, not int, to record length of selection.
12392 (x_reply_selection_request, x_get_window_property)
12393 (receive_incremental_selection, x_property_data_to_lisp):
12394 Redo calculations to avoid overflow.
12395 (x_reply_selection_request): When sending hint, ceiling it at
12396 X_LONG_MAX rather than relying on wraparound overflow to send
12397 something.
12398 (x_get_window_property, receive_incremental_selection)
12399 (lisp_data_to_selection_data, x_property_data_to_lisp):
12400 Check for size-calculation overflow.
12401 (x_get_window_property, receive_incremental_selection)
12402 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12403 Don't store size until memory allocation succeeds.
12404 (x_get_window_property): Plug memory leak on memory exhaustion.
12405 Don't double-block input; malloc is safe here. Don't assume 2**34
12406 - 4 fits in unsigned long. Add an xassert to check
12407 XGetWindowProperty overflow. Be more careful about overflow
12408 calculations, and distinguish size from memory overflow better.
12409 (receive_incremental_selection): When tracing, don't assume
12410 unsigned int is less than INT_MAX.
12411 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12412 harmful) conversions of unsigned short to int.
12413 (lisp_data_to_selection_data): Don't assume that integers
12414 in the range -65535 through -1 fit in an X unsigned short.
12415 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12416 result parameters unless successful. Rely on cons_to_unsigned
12417 to report problems with elements; the old code wasn't right anyway.
12418 (x_check_property_data): Check for int overflow; we cannot use
12419 a wider type due to X limits.
12420 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12421
12422 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
12423
12424 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12425 (x_term_init): Check for size calculation overflow.
12426 (x_color_cells): Don't store size until memory allocation succeeds.
12427 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
12428 Don't assume alloca size is less than MAX_ALLOCA.
12429 (x_term_init): Don't assume length fits in int (sprintf is limited
12430 to int size).
12431
12432 Use ptrdiff_t for composition IDs.
12433 * character.c (lisp_string_width):
12434 * composite.c (composition_table_size, n_compositions)
12435 (get_composition_id, composition_gstring_from_id):
12436 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12437 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12438 * window.c (Frecenter):
12439 Use ptrdiff_t, not int, for composition IDs.
12440 * composite.c (get_composition_id): Check for integer overflow.
12441 * composite.h: Adjust prototypes to match the above changes.
12442
12443 Use ptrdiff_t for hash table indexes.
12444 * category.c (hash_get_category_set):
12445 * ccl.c (ccl_driver):
12446 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12447 * coding.c (coding_system_charset_list, detect_coding_system):
12448 * coding.h (struct coding_system.id):
12449 * composite.c (get_composition_id, gstring_lookup_cache):
12450 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12451 * image.c (xpm_get_color_table_h):
12452 * lisp.h (hash_lookup, hash_put):
12453 * minibuf.c (Ftest_completion):
12454 Use ptrdiff_t for hash table indexes, not int (which is too
12455 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12456 32-bit --with-wide-int hosts).
12457
12458 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12459 Add a FIXME comment about memory leaks.
12460 (syms_of_charset): Don't assume xmalloc returns.
12461
12462 Don't assume that stated character widths fit in int.
12463 * character.c (Fchar_width, c_string_width, lisp_string_width):
12464 * character.h (CHAR_WIDTH):
12465 * indent.c (MULTIBYTE_BYTES_WIDTH):
12466 Use sanitize_char_width to avoid undefined and/or bad behavior
12467 with outlandish widths.
12468 * character.h (sanitize_tab_width): Rename from sanitize_width,
12469 now that we have two such functions. All uses changed.
12470 (sanitize_char_width): New inline function.
12471
12472 Don't assume that tab-width fits in int.
12473 * character.h (sanitize_width): New inline function.
12474 (SANE_TAB_WIDTH): New macro.
12475 (ASCII_CHAR_WIDTH): Use it.
12476 * indent.c (sane_tab_width): Remove. All uses replaced by
12477 SANE_TAB_WIDTH (current_buffer).
12478 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12479
12480 * fileio.c: Integer overflow issues with file modes.
12481 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12482
12483 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12484 Remove unreachable code.
12485 (read_hex, load_charset_map_from_file): Check for integer overflow.
12486
12487 * xterm.c: Don't go over XClientMessageEvent limit.
12488 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12489 (x_send_scroll_bar_event): Likewise. Check that the size does not
12490 exceed limits imposed by XClientMessageEvent, as well as the usual
12491 ptrdiff_t and size_t limits.
12492
12493 * keyboard.c: Overflow, signedness and related fixes.
12494 (make_lispy_movement): Use same integer type in forward decl
12495 that is used in the definition.
12496 (read_key_sequence, keyremap_step):
12497 Change bufsize argument back to int, undoing my 2011-03-30 change.
12498 We prefer signed types, and int is wide enough here.
12499 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12500 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12501 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12502 length, not size_t. Use ptrdiff_t for index, not int.
12503 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12504 possibility of integer overflow.
12505
12506 Overflow, signedness and related fixes for images.
12507
12508 * dispextern.h (struct it.stack[0].u.image.image_id)
12509 (struct_it.image_id, struct image.id, struct image_cache.size)
12510 (struct image_cache.used, struct image_cache.ref_count):
12511 * gtkutil.c (update_frame_tool_bar):
12512 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12513 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12514 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12515 * nsmenu.m (update_frame_tool_bar):
12516 * xdisp.c (calc_pixel_width_or_height):
12517 * xfns.c (image_cache_refcount):
12518 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12519 on typical 64-bit hosts.
12520
12521 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12522 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12523 Omit unnecessary casts to int.
12524 (parse_image_spec): Check that integers fall into 'int' range
12525 when the callers expect that.
12526 (image_ascent): Redo ascent calculation to avoid int overflow.
12527 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12528 (lookup_image): Remove unnecessary tests.
12529 (xbm_image_p): Locals are now of int, not EMACS_INT,
12530 since parse_image_check makes sure they fit into int.
12531 (png_load, gif_load, svg_load_image):
12532 Prefer int to unsigned where either will do.
12533 (tiff_handler): New function, combining the cores of the
12534 old tiff_error_handler and tiff_warning_handler.
12535 This function is rewritten to use vsnprintf and thereby avoid
12536 stack buffer overflows. It uses only the features of vsnprintf
12537 that are common to both POSIX and native Microsoft.
12538 (tiff_error_handler, tiff_warning_handler): Use it.
12539 (tiff_load, gif_load, imagemagick_load_image):
12540 Don't assume :index value fits in 'int'.
12541 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12542 (imagemagick_load_image): Check that crop parameters fit into
12543 the integer types that MagickCropImage accepts. Don't assume
12544 Vimagemagick_render_type has a nonnegative value. Don't assume
12545 size_t fits in 'long'.
12546 (gs_load): Use printmax_t to print the widest integers possible.
12547 Check for integer overflow when computing image height and width.
12548
12549 2011-08-26 Eli Zaretskii <eliz@gnu.org>
12550
12551 * xdisp.c (redisplay_window): Don't force window start if point
12552 will be invisible in the resulting window. (Bug#9324)
12553
12554 2011-08-25 Eli Zaretskii <eliz@gnu.org>
12555
12556 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12557 the display spec is of the form `(space ...)'.
12558 (handle_display_spec): Return the value returned by
12559 handle_single_display_spec, not just 1 or zero.
12560 (handle_single_display_spec): If the display spec is of the form
12561 `(space ...)', and specifies display in the text area, return 2
12562 rather than 1.
12563 (try_cursor_movement): Check for the need to scroll more
12564 accurately, and prefer exact match for point under bidi.
12565 Don't advance `row' beyond the last row of the window.
12566
12567 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
12568 into disp_prop; all users changed.
12569
12570 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
12571 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
12572 for the text covered by the display property.
12573
12574 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
12575
12576 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
12577 Change return value to nil.
12578 (Frecord_buffer): Delete unused function.
12579
12580 2011-08-24 Eli Zaretskii <eliz@gnu.org>
12581
12582 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
12583 buffers, return left-to-right.
12584 (set_cursor_from_row): Consider candidate row a win if its glyph
12585 represents a newline and point is on that newline. Fixes cursor
12586 positioning on the newline at EOL of R2L text within L2R
12587 paragraph, and vice versa.
12588 (try_cursor_movement): Check continued rows, in addition to
12589 continuation rows. Fixes unwarranted scroll when point enters a
12590 continued line of R2L text within an L2R paragraph, or vice versa.
12591 (cursor_row_p): Consider the case of point being equal to
12592 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
12593 from the end of a short line to the beginning of a continued line
12594 of R2L text within L2R paragraph.
12595 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
12596 composed characters.
12597
12598 * bidi.c (bidi_check_type): Use xassert.
12599 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
12600 members.
12601
12602 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12603
12604 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
12605 a character.
12606
12607 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
12608
12609 * nsfont.m (ns_otf_to_script): Fix typo.
12610
12611 2011-08-22 Kenichi Handa <handa@m17n.org>
12612
12613 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
12614 extra slot even if the purpose is char-code-property-table.
12615
12616 2011-08-23 Eli Zaretskii <eliz@gnu.org>
12617
12618 * xdisp.c (redisplay_window): When computing centering_position,
12619 account for the height of the header line. (Bug#8874)
12620
12621 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
12622 instead of CHAR_TO_BYTE. Fixes a crash when a completion
12623 candidate is selected by the mouse, and that candidate has a
12624 composed character under the mouse.
12625
12626 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
12627 coordinates reported by pos-visible-in-window-p for a composed
12628 character in column zero.
12629
12630 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
12631
12632 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
12633
12634 2011-08-22 Eli Zaretskii <eliz@gnu.org>
12635
12636 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
12637 consider it a hit if to_charpos is anywhere in the range of the
12638 composed buffer positions.
12639
12640 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
12641
12642 * image.c (gif_load): Don't assume that each subimage has the same
12643 dimensions as the base image. Handle disposal method that is
12644 "undefined" by the gif spec (Bug#9335).
12645
12646 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
12647
12648 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
12649 (Fcondition_case): Document `debug' symbol in error handler.
12650
12651 2011-08-19 Eli Zaretskii <eliz@gnu.org>
12652
12653 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
12654 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
12655 from an Org mode buffer to a Speedbar frame.
12656
12657 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
12658 a composition, take its buffer position from IT->cmp_it.charpos.
12659 Fixes cursor positioning at the beginning of a line that begins
12660 with a composed character.
12661
12662 2011-08-18 Eli Zaretskii <eliz@gnu.org>
12663
12664 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
12665 character bidirectional type, use STRONG_L instead. Fixes crashes
12666 in a buffer produced by `describe-categories'.
12667
12668 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
12669 members before the level stack, so they would be saved and
12670 restored when copying iterator state. Fixes incorrect reordering
12671 around TABs covered by display properties.
12672
12673 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
12674
12675 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
12676
12677 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
12678
12679 * eval.c (internal_condition_case, internal_condition_case_1)
12680 (internal_condition_case_2, internal_condition_case_n):
12681 Remove unnecessary aborts (Bug#9081).
12682
12683 2011-08-17 Eli Zaretskii <eliz@gnu.org>
12684
12685 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
12686 has no `load' handler, try opening the file locally. (Bug#9311)
12687
12688 2011-08-16 Ken Brown <kbrown@cornell.edu>
12689
12690 * gmalloc.c: Expand comment.
12691
12692 2011-08-16 Eli Zaretskii <eliz@gnu.org>
12693
12694 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
12695 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
12696
12697 2011-08-16 Ken Brown <kbrown@cornell.edu>
12698
12699 Fix memory allocation problems in Cygwin build (Bug#9273).
12700
12701 * unexcw.c ( __malloc_initialized): Declare external variable.
12702 (fixup_executable): Force the dumped emacs to reinitialize malloc.
12703
12704 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
12705 New variables.
12706 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
12707 dumped emacs.
12708 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
12709 in the static heap.
12710 [CYGWIN] (special_realloc): New function.
12711 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
12712 requests to realloc storage in the static heap.
12713
12714 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
12715
12716 * bidi.c (bidi_initialize): Remove unused local.
12717
12718 2011-08-15 Eli Zaretskii <eliz@gnu.org>
12719
12720 * bidimirror.h:
12721 * biditype.h: Remove file.
12722 * makefile.w32-in ($(BLD)/bidi.$(O)):
12723 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
12724
12725 * dispextern.h: Fix a typo in the comment to bidi_type_t.
12726
12727 * chartab.c: Improve commentary for the uniprop_table API.
12728
12729 * bidi.c (bidi_paragraph_init): Support zero value of
12730 bidi_ignore_explicit_marks_for_paragraph_level.
12731 (bidi_initialize): Use uniprop_table instead of including
12732 biditype.h and bidimirror.h.
12733
12734 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
12735 coordinates of the iterator when restoring from ppos_it.
12736 (Bug#9296)
12737
12738 2011-08-14 Kenichi Handa <handa@m17n.org>
12739
12740 * process.c (create_process): Call setup_process_coding_systems
12741 after the pid of the process is set to -1 (Bug#8162).
12742
12743 2011-08-14 Eli Zaretskii <eliz@gnu.org>
12744
12745 * xdisp.c (move_it_in_display_line_to): Don't invoke
12746 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
12747 ppos_it. Fixes vertical cursor motion when line beginning is
12748 covered by an image. (Bug#9296)
12749
12750 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
12751
12752 * nsterm.h (ns_run_ascript): Declare.
12753 (NSAPP_DATA2_RUNASSCRIPT): Define.
12754
12755 * nsfns.m (as_script, as_result, as_status): New static variables.
12756 (ns_run_ascript): New function.
12757 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
12758 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
12759 the event loop. Get status from as_status (Bug#7276).
12760
12761 * nsterm.m (sendEvent): If event is NSApplicationDefined and
12762 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
12763 the event loop (Bug#7276).
12764
12765 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
12766
12767 * gnutls.c (QCgnutls_bootprop_priority)
12768 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
12769 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
12770 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
12771 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
12772 (QCgnutls_bootprop_verify_hostname_error)
12773 (QCgnutls_bootprop_callbacks_verify): Rename from
12774 Qgnutls_bootprop_..., all uses changed.
12775
12776 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
12777 uses changed.
12778
12779 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
12780
12781 * xfaces.c (Qframe_set_background_mode): Now static.
12782 * dispextern.h (Qframe_set_background_mode): Remove decl.
12783
12784 * process.c (Fnetwork_interface_info): Declare local only if needed.
12785
12786 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
12787
12788 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
12789 (Fnetwork_interface_list): Allocate in increments of bytes instead
12790 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
12791 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
12792 sockaddr.
12793 (struct ifflag_def): notrailers is smart on OSX.
12794 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
12795 Get hardware address with getifaddrs if available.
12796
12797 2011-08-12 Eli Zaretskii <eliz@gnu.org>
12798
12799 * xdisp.c (iterate_out_of_display_property): xassert that
12800 IT->position is set to within IT->object's boundaries. Break from
12801 the loop as soon as EOB is reached; avoids infloops in redisplay
12802 when IT->position is set up wrongly due to some bug.
12803 Set IT->current to match the bidi iterator unconditionally.
12804 (push_display_prop): Allow GET_FROM_STRING as IT->method on
12805 entry. Force push_it to save on the stack the current
12806 buffer/string position, to be restored by pop_it. Fix flags in
12807 the iterator structure wrt the object coming from a display
12808 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
12809 properties. (Bug#9284)
12810
12811 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
12812
12813 * fontset.c (fontset_get_font_group): Add proper type checks.
12814 (Bug#9172)
12815
12816 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12817
12818 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
12819 and LC_VERSION_MIN_MACOSX.
12820 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
12821 (dump_it) [LC_FUNCTION_STARTS]: Use it.
12822
12823 2011-08-08 Eli Zaretskii <eliz@gnu.org>
12824
12825 * xdisp.c (forward_to_next_line_start): Allow to use the
12826 no-display-properties-and-no-overlays under bidi display.
12827 Set disp_pos in the bidi iterator to avoid searches for display
12828 properties and overlays.
12829
12830 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
12831
12832 * editfns.c (Fset_time_zone_rule): Document relationship with the
12833 setenv function.
12834
12835 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
12836 the font entity extracted from the cache (Bug#8109).
12837
12838 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
12839
12840 * composite.c (autocmp_chars): Don't reset point. That is done by
12841 restore_point_unwind (Bug#5984).
12842
12843 2011-08-07 Juri Linkov <juri@jurta.org>
12844
12845 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
12846 to show the arg `TIME' instead of `TIMEVAL'.
12847
12848 2011-08-06 Eli Zaretskii <eliz@gnu.org>
12849
12850 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
12851 display property strides EOL and includes a newline, as in
12852 longlines-mode. (Bug#9254)
12853 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
12854 word-wrap under bidirectional display. (Bug#9224)
12855
12856 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
12857 is non-zero, even if the data buffer is NULL. Fixes a crash in
12858 vertical-motion with longlines-mode. (Bug#9254)
12859
12860 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12861
12862 * bidi.c <bidi_cache_total_alloc>: Now static.
12863 (bidi_initialize): Initialize bidi_cache_total_alloc.
12864
12865 * xdisp.c (display_line): Release buffer allocated for shelved bidi
12866 cache. (Bug#9221)
12867
12868 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
12869 amount allocated this far in `bidi_cache_total_alloc'.
12870 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
12871 non-zero, only free the data buffer without restoring the cache
12872 contents. All callers changed.
12873
12874 * dispextern.h (bidi_unshelve_cache): Update prototype.
12875
12876 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
12877 (move_it_in_display_line, move_it_to)
12878 (move_it_vertically_backward, move_it_by_lines): Replace the call
12879 to xfree to an equivalent call to bidi_unshelve_cache.
12880 (move_it_in_display_line_to): Fix logic of returning
12881 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
12882
12883 2011-08-05 Eli Zaretskii <eliz@gnu.org>
12884
12885 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
12886 came from a string character with a `cursor' property. (Bug#9229)
12887
12888 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12889
12890 * Makefile.in (LIB_PTHREAD): New variable.
12891 (LIBES): Add LIB_PTHREAD (Bug#9216).
12892
12893 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
12894 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
12895
12896 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
12897
12898 * regex.c (re_iswctype): Remove some redundant boolean conversions.
12899
12900 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
12901
12902 * xterm.c (x_find_topmost_parent): New function.
12903 (x_set_frame_alpha): Find topmost parent window with
12904 x_find_topmost_parent and set the property there also (bug#9181).
12905 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
12906
12907 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
12908
12909 * callproc.c (Fcall_process): Avoid vfork clobbering
12910 the local vars buffer, coding_systems, current_dir.
12911
12912 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
12913
12914 * keymap.c (Fmake_composed_keymap): Move to subr.el.
12915
12916 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
12917
12918 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
12919 so that it is not optimized away.
12920
12921 * xdisp.c (compute_display_string_pos): Remove unused local.
12922
12923 2011-08-02 Eli Zaretskii <eliz@gnu.org>
12924
12925 Fix slow cursor motion and scrolling in large buffers with
12926 selective display, like Org Mode buffers. (Bug#9218)
12927
12928 * dispextern.h (struct bidi_it): New member disp_prop_p.
12929
12930 * xdisp.c: Remove one-slot cache of display string positions.
12931 (compute_display_string_pos): Accept an additional argument
12932 DISP_PROP_P; callers changed. Scan at most 5K characters forward
12933 for a display string or property. If found, set DISP_PROP_P
12934 non-zero.
12935
12936 * bidi.c (bidi_fetch_char): Accept an additional argument
12937 DISP_PROP_P, and pass it to compute_display_string_pos.
12938 Only handle text covered by a display string if DISP_PROP_P is returned
12939 non-zero. All callers of bidi_fetch_char changed.
12940
12941 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
12942
12943 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
12944
12945 2010-12-03 Don March <don@ohspite.net>
12946
12947 * keymap.c (Fdefine_key): Fix non-prefix key error message when
12948 last character M-[char] is translated to ESC [char] (bug#7541).
12949
12950 2011-08-02 Kenichi Handa <handa@m17n.org>
12951
12952 * lisp.h (uniprop_table): Extern it.
12953
12954 * chartab.c (uniprop_table): Make it non-static.
12955
12956 2011-08-01 Eli Zaretskii <eliz@gnu.org>
12957
12958 * xdisp.c (forward_to_next_line_start): Accept additional argument
12959 BIDI_IT_PREV, and store into it the state of the bidi iterator had
12960 on the newline.
12961 (reseat_at_next_visible_line_start): Use the bidi iterator state
12962 returned by forward_to_next_line_start to restore the state of
12963 it->bidi_it after backing up to previous newline. (Bug#9212)
12964
12965 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
12966
12967 * regex.c (re_comp): Protoize.
12968 (re_exec): Fix return type.
12969 (regexec): Fix type of `ret'. (Bug#9203)
12970
12971 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
12972
12973 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
12974 This is needed if max-image-size is a floating-point number.
12975
12976 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
12977
12978 * print.c (print_object): Print empty symbol as ##.
12979
12980 * lread.c (read1): Read ## as empty symbol.
12981
12982 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
12983
12984 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
12985 setting frame foreground color (Bug#9175).
12986 (x_set_background_color): Likewise.
12987
12988 * nsmenu.m (-setText): Size tooltip dimensions precisely to
12989 contents (Bug#9176).
12990 (EmacsTooltip -init): Remove bezels and add shadows to
12991 tooltip windows.
12992
12993 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
12994 or scroll bar (Bug#8470).
12995
12996 * nsfont.m (nsfont_open): Remove assignment to voffset and
12997 unnecessary vars hshink, expand, hd, full_height, min_height.
12998 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
12999
13000 * nsterm.h (nsfont_info): Remove voffset field.
13001
13002 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13003
13004 Implement strike-through and overline on NextStep (Bug#8863).
13005
13006 * nsfont.m (nsfont_open): Use underline position provided by font,
13007 instead of hard-coded value of 2.
13008 (nsfont_draw): Call ns_draw_text_decoration instead.
13009
13010 * nsterm.h: Add declaration for ns_draw_text_decoration.
13011
13012 * nsterm.m (ns_draw_text_decoration): New function for drawing
13013 underline, overline, and strike-through.
13014 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13015 ns_draw_text_decoration. Change treatment of cursor drawing to
13016 accommodate underlining, etc.
13017
13018 2011-07-28 Eli Zaretskii <eliz@gnu.org>
13019
13020 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13021 default.
13022
13023 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13024
13025 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13026 Without this fix, if a signal arrives just after memory fills up,
13027 'malloc' might be invoked reentrantly.
13028
13029 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13030 In other words, assume that every image size is allowed, on non-X
13031 hosts. This assumption is probably wrong, but it lets Emacs compile.
13032
13033 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13034
13035 * regex.c (re_iswctype): Convert return values to boolean.
13036
13037 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13038
13039 * xdisp.c (compute_display_string_pos): Don't use cached display
13040 string position if the buffer had its restriction changed.
13041 (Bug#9184)
13042
13043 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13044
13045 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13046
13047 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13048
13049 Integer signedness and overflow and related fixes. (Bug#9079)
13050
13051 * bidi.c: Integer size and overflow fixes.
13052 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13053 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13054 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13055 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13056 (bidi_find_other_level_edge):
13057 Use ptrdiff_t instead of EMACS_INT where either will do.
13058 This works better on 32-bit hosts configured --with-wide-int.
13059 (bidi_cache_ensure_space): Check for size-calculation overflow.
13060 Use % rather than repeated addition, for better worst-case speed.
13061 Don't set bidi_cache_size until after xrealloc returns, because it
13062 might not return.
13063 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
13064 (bidi_cache_ensure_space): Also check that the bidi cache size
13065 does not exceed that of the largest Lisp string or buffer. See Eli
13066 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
13067
13068 * alloc.c (__malloc_size_t): Remove.
13069 All uses replaced by size_t. See Andreas Schwab's note
13070 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13071
13072 * image.c: Improve checking for integer overflow.
13073 (check_image_size): Assume that f is nonnull, since
13074 it is always nonnull in practice. This is one less thing to
13075 worry about when checking for integer overflow later.
13076 (x_check_image_size): New function, which checks for integer
13077 overflow issues inside X.
13078 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13079 This removes the need for a memory_full check.
13080 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13081 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13082 (xbm_read_bitmap_data): Change locals back to 'int', since
13083 their values must fit in 'int'.
13084 (xpm_load_image, png_load, tiff_load):
13085 Invoke x_create_x_image_and_pixmap earlier,
13086 to avoid much needless work if the image is too large.
13087 (tiff_load): Treat overly large images as if
13088 x_create_x_image_and_pixmap failed, not as malloc failures.
13089 (gs_load): Use x_check_image_size.
13090
13091 * gtkutil.c: Omit integer casts.
13092 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13093 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13094
13095 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13096
13097 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13098 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13099 would wrongly return t on a 64-bit host.
13100
13101 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13102 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13103 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13104 and therefore cause GCC to emit a bogus diagnostic in some cases.
13105
13106 * image.c: Integer signedness and overflow and related fixes.
13107 This is not an exhaustive set of fixes, but it's time to
13108 record what I've got.
13109 (lookup_pixel_color, check_image_size): Remove redundant decls.
13110 (check_image_size): Don't assume that arbitrary EMACS_INT values
13111 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13112 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13113 (tiff_load, imagemagick_load_image):
13114 Check for overflow in size calculations.
13115 (x_create_x_image_and_pixmap): Remove unnecessary test for
13116 xmalloc returning NULL; that can't happen.
13117 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13118 (xpm_color_bucket): Use better integer hashing function.
13119 (xpm_cache_color): Don't possibly over-allocate memory.
13120 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13121 (gif_memory_source):
13122 Use ptrdiff_t, not int or size_t, to record sizes.
13123 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13124 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13125 either works, as we prefer signed integers.
13126 (tiff_read_from_memory, tiff_write_from_memory):
13127 Return tsize_t, not size_t, since that's what the TIFF API wants.
13128 (tiff_read_from_memory): Don't fail simply because the read would
13129 go past EOF; instead, return a short read.
13130 (tiff_load): Omit no-longer-needed casts.
13131 (Fimagemagick_types): Don't assume size fits into 'int'.
13132
13133 Improve hashing quality when configured --with-wide-int.
13134 * fns.c (hash_string): New function, taken from sxhash_string.
13135 Do not discard information about ASCII character case; this
13136 discarding is no longer needed.
13137 (sxhash-string): Use it. Change sig to match it. Caller changed.
13138 * lisp.h: Declare it.
13139 * lread.c (hash_string): Remove, since we now use fns.c's version.
13140 The fns.c version returns a wider integer if --with-wide-int is
13141 specified, so this should help the quality of the hashing a bit.
13142
13143 * emacs.c: Integer overflow minor fix.
13144 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13145 Define only if GNU_LINUX.
13146 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13147
13148 * dispnew.c: Integer signedness and overflow fixes.
13149 Remove unnecessary forward decls, that were a maintenance hassle.
13150 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13151 All uses changed.
13152 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13153 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13154 (prepare_desired_row, line_draw_cost):
13155 Use int, not unsigned, where either works.
13156 (save_current_matrix, restore_current_matrix):
13157 Use ptrdiff_t, not size_t, where either works.
13158 (init_display): Check for overflow more accurately, and without
13159 relying on undefined behavior.
13160
13161 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13162 Remove, replacing with the new symbols in lisp.h. All uses changed.
13163 * fileio.c (make_temp_name):
13164 * filelock.c (lock_file_1, lock_file):
13165 * xdisp.c (message_dolog):
13166 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13167 Use pMd etc. instead.
13168 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13169 replacing the pWIDE etc. symbols removed from editfns.c.
13170
13171 * keyboard.h (num_input_events): Now uintmax_t.
13172 This is (very slightly) less likely to mess up due to wraparound.
13173 All uses changed.
13174
13175 * buffer.c: Integer signedness fixes.
13176 (alloc_buffer_text, enlarge_buffer_text):
13177 Use ptrdiff_t rather than size_t when either will do, as we prefer
13178 signed integers.
13179
13180 * alloc.c: Integer signedness and overflow fixes.
13181 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13182 (__malloc_size_t): Default to size_t, not to int.
13183 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13184 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13185 Prefer ptrdiff_t to size_t when either would do, as we prefer
13186 signed integers.
13187 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13188 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13189 Now const. Initialize with values that are in range even if char
13190 is signed.
13191 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13192 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13193 These functions do the right thing with sizes > 2**32.
13194 (check_depth): Now ptrdiff_t, not int.
13195 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13196 Adjust to new way of storing sizes. Check for size overflow bugs
13197 in rest of code.
13198 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13199 slightly wrong anyway, as it missed one instance of
13200 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13201 (refill_memory_reserve): Omit needless cast to size_t.
13202 (mark_object_loop_halt): Mark as externally visible.
13203
13204 * xselect.c: Integer signedness and overflow fixes.
13205 (Fx_register_dnd_atom, x_handle_dnd_message):
13206 Use ptrdiff_t, not size_t, since we prefer signed.
13207 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13208 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13209 x_dnd_atoms_size and x_dnd_atoms_length.
13210
13211 * doprnt.c: Prefer signed to unsigned when either works.
13212 * eval.c (verror):
13213 * doprnt.c (doprnt):
13214 * lisp.h (doprnt):
13215 * xdisp.c (vmessage):
13216 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13217 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13218 prefer signed arithmetic to avoid comparison confusion.
13219 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13220 but is a bit tricky.
13221
13222 Assume freestanding C89 headers, string.h, stdlib.h.
13223 * data.c, doprnt.c, floatfns.c, print.c:
13224 Include float.h unconditionally.
13225 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13226 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13227 * regex.c: Likewise for stddef.h, string.h.
13228 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13229 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13230 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13231 (STDC_HEADERS): Remove obsolete defines.
13232 * sysdep.c: Include limits.h unconditionally.
13233
13234 Assume support for memcmp, memcpy, memmove, memset.
13235 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13236 * regex.c (memcmp, memcpy):
13237 Remove; we assume C89 now.
13238
13239 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13240 (__malloc_safe_bcopy): Remove; no longer needed.
13241
13242 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
13243 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13244 well either way, and we prefer signed to unsigned.
13245
13246 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13247
13248 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13249 closes the connection while we're reading (bug#9182).
13250
13251 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
13252
13253 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13254 are specified (Bug#9168).
13255
13256 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13257
13258 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13259 Found by GCC static checking and --with-wide-int on a 32-bit host.
13260
13261 2011-07-25 Eli Zaretskii <eliz@gnu.org>
13262
13263 * xdisp.c (compute_display_string_pos): Fix logic of caching
13264 previous display string position. Initialize cached_prev_pos to
13265 -1. Fixes slow-down at the beginning of a buffer.
13266
13267 2011-07-24 Eli Zaretskii <eliz@gnu.org>
13268
13269 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13270 for attrs[LFACE_FONTSET_INDEX].
13271
13272 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13273
13274 * xml.c (parse_region): Remove unused local
13275 that was recently introduced.
13276
13277 2011-07-23 Eli Zaretskii <eliz@gnu.org>
13278
13279 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13280 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13281
13282 * xdisp.c (move_it_in_display_line_to): Record the best matching
13283 position for TO_CHARPOS while scanning the line, and restore it on
13284 exit if none of the characters scanned was an exact match.
13285 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
13286 when exact match is impossible due to invisible text, and the
13287 lines are truncated.
13288
13289 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13290
13291 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13292 for OSX >= 10.7.
13293
13294 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13295
13296 Fix a significant slow-down of cursor motion with C-n, C-p,
13297 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13298 auto-repeat under bidi redisplay in fontified buffers.
13299 * xdisp.c (compute_stop_pos_backwards): New function.
13300 (next_element_from_buffer): Call compute_stop_pos_backwards to
13301 find a suitable prev_stop when we find ourselves before
13302 base_level_stop.
13303 (reseat): Don't look for prev_stop, as that could mean a very long
13304 run.
13305 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13306 <cached_disp_overlay_modiff>: Cache for last found display string
13307 position.
13308 (compute_display_string_pos): Return the cached position if asked
13309 about the same buffer in the same area of character positions, and
13310 the buffer wasn't changed since the time the display string
13311 position was cached.
13312
13313 2011-07-22 Eli Zaretskii <eliz@gnu.org>
13314
13315 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13316 is an integer, which is important for empty lines. (Bug#9149)
13317
13318 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
13319
13320 * frame.c (Fmodify_frame_parameters): In tty case, update the
13321 default face if necessary (Bug#4238).
13322
13323 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
13324
13325 * editfns.c (Fstring_to_char): No need to explain what a character
13326 is in the docstring (Bug#6576).
13327
13328 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13329
13330 * xml.c (parse_region): Make sure we always return a tree.
13331
13332 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13333
13334 * xml.c (parse_region): If a document contains only comments,
13335 return that, too.
13336
13337 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13338
13339 * xml.c (make_dom): Return comments, too.
13340
13341 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13342
13343 Port to OpenBSD.
13344 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13345 and the surrounding thread.
13346 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13347 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13348 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13349 timer goes off.
13350 * s/openbsd.h (BROKEN_SIGIO): Define.
13351 * unexelf.c (unexec) [__OpenBSD__]:
13352 Don't update the .mdebug section of the Alpha COFF symbol table.
13353
13354 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13355
13356 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13357 (bug#8460).
13358
13359 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13360
13361 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13362 This fixes some race conditions on the permissions of any newly
13363 created file.
13364
13365 * alloc.c (valid_pointer_p): Use pipe, not open.
13366 This fixes some permissions issues when debugging.
13367
13368 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13369 If fchown fails to set both uid and gid, try to set just gid,
13370 as that is sometimes allowed. Adjust the file's mode to eliminate
13371 setuid or setgid bits that are inappropriate if fchown fails.
13372
13373 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13374
13375 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13376 to compare Lisp_Objects.
13377 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13378 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13379 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13380
13381 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13382
13383 * lread.c (read_integer): Unread even EOF character.
13384 (read1): Likewise. Properly record start position of symbol.
13385
13386 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13387 symbol character follows.
13388
13389 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13390
13391 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13392 This works around a problem with the previous change to Fcopy_file.
13393 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13394 and without this change, GCC might complain about discarding
13395 fchown's return value.
13396
13397 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
13398
13399 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13400
13401 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13402
13403 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13404
13405 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13406
13407 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13408 it's used from the C level.
13409
13410 * process.c: Use the same condition for POLL_FOR_INPUT in both
13411 keyboard.c and process.c (bug#1858).
13412
13413 2011-07-09 Lawrence Mitchell <wence@gmx.li>
13414
13415 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13416 (Fgnutls_boot): Use it.
13417
13418 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13419
13420 * doc.c (Fsubstitute_command_keys): Revert last change.
13421
13422 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13423
13424 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13425 quotes the next character, and doesn't affect other longer
13426 sequences (bug#8935).
13427
13428 * lread.c (syms_of_lread): Clarify that is isn't only
13429 `eval-buffer' and `eval-defun' that's affected by
13430 `lexical-binding' (bug#8460).
13431
13432 2011-07-15 Eli Zaretskii <eliz@gnu.org>
13433
13434 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
13435 bidi redisplay when a line includes both an image and is truncated.
13436
13437 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13438
13439 Fix minor problems found by static checking.
13440 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13441 (elsz): Now a signed constant, not a size_t var. We prefer signed
13442 types to unsigned, to avoid integer comparison confusion. Without
13443 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13444 "cannot optimize loop, the loop counter may overflow", a symptom
13445 of the confusion.
13446 * indent.c (Fvertical_motion): Mark locals as initialized.
13447 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13448
13449 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13450
13451 * search.c (Fre_search_backward): Mention `case-fold-search' in
13452 all the re_search_* functions (bug#8138).
13453
13454 * keyboard.c (Fopen_dribble_file): Document when the file is
13455 closed (bug#8056).
13456
13457 2011-07-14 Eli Zaretskii <eliz@gnu.org>
13458
13459 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13460 bidi_cache_idx.
13461
13462 Support bidi reordering of display and overlay strings.
13463 * xdisp.c (compute_display_string_pos)
13464 (compute_display_string_end): Accept additional argument STRING.
13465 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13466 (reseat_to_string): Initialize bidi_it->string.s and
13467 bidi_it->string.schars.
13468 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
13469 NULL (avoids a crash in bidi_paragraph_init).
13470 Initialize itb.string.lstring.
13471 (init_iterator): Call bidi_init_it only of a valid
13472 buffer position was specified. Initialize paragraph_embedding to
13473 L2R.
13474 (reseat_to_string): Initialize the bidi iterator.
13475 (display_string): If we need to ignore text properties of
13476 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13477 original value of -1 will not work with bidi.)
13478 (compute_display_string_pos): First arg is now struct
13479 `text_pos *'; all callers changed. Support display properties on
13480 Lisp strings.
13481 (compute_display_string_end): Support display properties on Lisp
13482 strings.
13483 (init_iterator, reseat_1, reseat_to_string): Initialize the
13484 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13485 when iterating on a string not from display properties).
13486 (compute_display_string_pos, compute_display_string_end):
13487 Fix calculation of the object to scan. Fixes an error when using
13488 arrow keys.
13489 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
13490 base_level_stop; instead, set base_level_stop to BEGV.
13491 Fixes crashes in vertical-motion.
13492 (next_element_from_buffer): Improve commentary for when
13493 the iterator is before prev_stop.
13494 (init_iterator): Initialize bidi_p from the default value of
13495 bidi-display-reordering, not from buffer-local value. Use the
13496 buffer-local value only if initializing for buffer iteration.
13497 (handle_invisible_prop): Support invisible properties on strings
13498 that are being bidi-reordered.
13499 (set_iterator_to_next): Support bidi reordering of C strings and
13500 Lisp strings.
13501 (next_element_from_string): Support bidi reordering of Lisp
13502 strings.
13503 (handle_stop_backwards): Support Lisp strings as well.
13504 (display_string): Support display of R2L glyph rows.
13505 Use IT_STRING_CHARPOS when displaying from a Lisp string.
13506 (init_iterator): Don't initialize it->bidi_p for strings
13507 here.
13508 (reseat_to_string): Initialize it->bidi_p for strings here.
13509 (next_element_from_string, next_element_from_c_string)
13510 (next_element_from_buffer): Add xassert's for correspondence
13511 between IT's object being iterated and it->bidi_it.string
13512 structure.
13513 (face_before_or_after_it_pos): Support bidi iteration.
13514 (next_element_from_c_string): Handle the case of the first string
13515 character that is not the first one in the visual order.
13516 (get_visually_first_element): New function, refactored from common
13517 parts of next_element_from_buffer, next_element_from_string, and
13518 next_element_from_c_string.
13519 (tool_bar_lines_needed, redisplay_tool_bar)
13520 (display_menu_bar): Force left-to-right direction. Add a FIXME
13521 comment for making that be controlled by a user option.
13522 (push_it, pop_it): Save and restore the state of the
13523 bidi iterator. Save and restore the bidi_p flag.
13524 (pop_it): Iterate out of display property for string iteration as
13525 well.
13526 (iterate_out_of_display_property): Support iteration over strings.
13527 (handle_single_display_spec): Set up it->bidi_it for iteration
13528 over a display string, and call bidi_init_it.
13529 (handle_single_display_spec, next_overlay_string)
13530 (get_overlay_strings_1, push_display_prop): Set up the bidi
13531 iterator for displaying display or overlay strings.
13532 (forward_to_next_line_start): Don't use the shortcut if
13533 bidi-iterating.
13534 (back_to_previous_visible_line_start): If handle_display_prop
13535 pushed the iterator stack, restore the internal state of the bidi
13536 iterator by calling bidi_pop_it same number of times.
13537 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13538 and we are bidi-iterating, don't decrement the iterator position;
13539 instead, set the first_elt flag in the bidi iterator, to produce
13540 the same effect.
13541 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13542 (push_display_prop): xassert that we are iterating a buffer.
13543 (push_it, pop_it): Save and restore paragraph_embedding member.
13544 (handle_single_display_spec, next_overlay_string)
13545 (get_overlay_strings_1, reseat_1, reseat_to_string)
13546 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13547 correctly. Don't assume unibyte strings are not bidi-reordered.
13548 (compute_display_string_pos)
13549 (compute_display_string_end): Fix handling the case of C string.
13550 (push_it, pop_it): Save and restore from_disp_prop_p.
13551 (handle_single_display_spec, push_display_prop): Set the
13552 from_disp_prop_p flag.
13553 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13554 (pop_it): Call iterate_out_of_display_property only if we are
13555 popping after iteration over a string that came from a display
13556 property. Fix a typo in popping stretch info. Add an assertion
13557 for verifying that the iterator position is in sync with the bidi
13558 iterator.
13559 (handle_single_display_spec, get_overlay_strings_1)
13560 (push_display_prop): Fix initialization of paragraph direction for
13561 string when that of the parent object is not yet determined.
13562 (reseat_1): Call bidi_init_it to resync the bidi
13563 iterator with IT's position. (Bug#7616)
13564 (find_row_edges): If ROW->start.pos gives position
13565 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
13566 (handle_stop, back_to_previous_visible_line_start, reseat_1):
13567 Reset the from_disp_prop_p flag.
13568 (SAVE_IT, RESTORE_IT): New macros.
13569 (pos_visible_p, face_before_or_after_it_pos)
13570 (back_to_previous_visible_line_start)
13571 (move_it_in_display_line_to, move_it_in_display_line)
13572 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13573 (try_scrolling, redisplay_window, display_line): Use them when
13574 saving a temporary copy of the iterator and restoring it back.
13575 (back_to_previous_visible_line_start, reseat_1)
13576 (init_iterator): Empty the bidi cache "stack".
13577 (move_it_in_display_line_to): If iterator ended up at
13578 EOL, but we never saw any buffer positions smaller than
13579 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
13580 motion in bidi-reordered lines.
13581 (move_it_in_display_line_to): Record prev_method and prev_pos
13582 immediately before the call to set_iterator_to_next. Fixes cursor
13583 motion in bidi-reordered lines with stretch glyphs and strings
13584 displayed in margins. (Bug#8133) (Bug#8867)
13585 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
13586 TO_CHARPOS.
13587 (pos_visible_p): Support positions in bidi-reordered lines.
13588 Save and restore bidi cache.
13589
13590 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
13591 (bidi_paragraph_info): Delete unused struct.
13592 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
13593 (bidi_cache_start): New variable.
13594 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
13595 to zero.
13596 (bidi_cache_fetch_state, bidi_cache_search)
13597 (bidi_cache_find_level_change, bidi_cache_iterator_state)
13598 (bidi_cache_find, bidi_peek_at_next_level)
13599 (bidi_level_of_next_char, bidi_find_other_level_edge)
13600 (bidi_move_to_visually_next): Compare cache index with
13601 bidi_cache_start rather than with zero.
13602 (bidi_fetch_char): Accept new argument STRING; all callers
13603 changed. Support iteration over a string. Support strings with
13604 display properties. Support unibyte strings. Fix the type of
13605 `len' according to what STRING_CHAR_AND_LENGTH expects.
13606 (bidi_paragraph_init, bidi_resolve_explicit_1)
13607 (bidi_resolve_explicit, bidi_resolve_weak)
13608 (bidi_level_of_next_char, bidi_move_to_visually_next):
13609 Support iteration over a string.
13610 (bidi_set_sor_type, bidi_resolve_explicit_1)
13611 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
13612 can now be zero (for strings); special values 0 and -1 were
13613 changed to -1 and -2, respectively.
13614 (bidi_char_at_pos): New function.
13615 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
13616 Call it instead of FETCH_MULTIBYTE_CHAR.
13617 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
13618 initialized to valid values.
13619 (bidi_init_it): Don't initialize charpos and bytepos with invalid
13620 values.
13621 (bidi_level_of_next_char): Allow the sentinel "position" to pass
13622 the test for valid cached positions. Fix the logic for looking up
13623 the sentinel state in the cache. GCPRO the Lisp string we are
13624 iterating.
13625 (bidi_push_it, bidi_pop_it): New functions.
13626 (bidi_initialize): Initialize the bidi cache start stack pointer.
13627 (bidi_cache_ensure_space): New function, refactored from part of
13628 bidi_cache_iterator_state. Don't assume the required size is just
13629 one BIDI_CACHE_CHUNK away.
13630 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
13631 (bidi_count_bytes, bidi_char_at_pos): New functions.
13632 (bidi_cache_search): Don't assume bidi_cache_last_idx is
13633 always valid if bidi_cache_idx is valid.
13634 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
13635 is valid if it's going to be used.
13636 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
13637 (bidi_cache_fetch_state, bidi_cache_search)
13638 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13639 (bidi_cache_iterator_state, bidi_cache_find)
13640 (bidi_find_other_level_edge, bidi_cache_start_stack):
13641 All variables related to cache indices are now EMACS_INT.
13642
13643 * dispextern.h (struct bidi_string_data): New structure.
13644 (struct bidi_it): New member `string'. Make flag members be 1-bit
13645 fields, and put them last in the struct.
13646 (compute_display_string_pos, compute_display_string_end):
13647 Update prototypes.
13648 (bidi_push_it, bidi_pop_it): Add prototypes.
13649 (struct iterator_stack_entry): New members bidi_p,
13650 paragraph_embedding, and from_disp_prop_p.
13651 (struct it): Member bidi_p is now a bit field 1 bit wide.
13652 (bidi_shelve_cache, bidi_unshelve_cache):
13653 Declare prototypes.
13654
13655 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
13656 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
13657 and vector-like objects.
13658
13659 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
13660 cache around display iteration.
13661
13662 * window.c (Fwindow_end, window_scroll_pixel_based)
13663 (displayed_window_lines, Frecenter): Save and restore the bidi
13664 cache around display iteration.
13665
13666 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13667
13668 * editfns.c (Fdelete_region): Clarify the use of the named
13669 parameters (bug#6788).
13670
13671 2011-07-14 Martin Rudalics <rudalics@gmx.at>
13672
13673 * indent.c (Fvertical_motion): Set and restore w->pointm when
13674 saving and restoring the window's buffer (Bug#9006).
13675
13676 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13677
13678 * editfns.c (Fstring_to_char): Clarify just what is returned
13679 (bug#6576). Text by Eli Zaretskii.
13680
13681 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
13682
13683 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
13684
13685 2011-07-13 Eli Zaretskii <eliz@gnu.org>
13686
13687 * buffer.c (mmap_find): Fix a typo.
13688
13689 2011-07-13 Johan Bockgård <bojohan@gnu.org>
13690
13691 Fix execution of x selection hooks.
13692 * xselect.c (Qx_lost_selection_functions)
13693 (Qx_sent_selection_functions): New vars.
13694 (syms_of_xselect): DEFSYM them.
13695 (x_handle_selection_request): Pass Qx_sent_selection_functions
13696 rather than Vx_sent_selection_functions to Frun_hook_with_args.
13697 (x_handle_selection_clear,x_clear_frame_selections):
13698 Pass Qx_lost_selection_functions rather than
13699 Vx_lost_selection_functions to Frun_hook_with_args.
13700
13701 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
13702
13703 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
13704 The old code sometimes used this field without initializing it.
13705
13706 * alloc.c (gc_sweep): Don't read past end of array.
13707 In theory, the old code could also have corrupted Emacs internals,
13708 though it'd be very unlikely.
13709
13710 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
13711
13712 * character.c (Fcharacterp): Don't advertise optional ignored
13713 argument. (Bug#4026)
13714
13715 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13716
13717 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
13718 key" (bug#4257).
13719
13720 * window.c (Fset_window_start): Doc fix (bug#4199).
13721 (Fset_window_hscroll): Ditto.
13722
13723 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
13724
13725 Fix minor new problems caught by GCC 4.6.1.
13726 * term.c (init_tty): Remove unused local.
13727 * xsettings.c (store_monospaced_changed): Define this function only
13728 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
13729 not used otherwise.
13730
13731 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
13732
13733 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
13734
13735 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
13736
13737 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
13738 are the mini-buffer and the echo area (bug#3320).
13739
13740 * term.c (init_tty): Remove support for supdup, c10 and perq
13741 terminals, which are no longer supported (bug#1482).
13742
13743 2011-07-10 Johan Bockgård <bojohan@gnu.org>
13744
13745 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
13746
13747 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
13748
13749 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
13750 for non-popups (Bug#3642).
13751
13752 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
13753
13754 * alloc.c (reset_malloc_hooks): Protoize.
13755 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
13756 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
13757 * cm.c (losecursor): Likewise.
13758 * data.c (fmod): Likewise.
13759 * dispnew.c (swap_glyphs_in_rows): Likewise.
13760 * emacs.c (memory_warning_signal): Likewise.
13761 * floatfns.c (float_error): Likewise.
13762 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
13763 (otf_open, font_otf_capability, generate_otf_features)
13764 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
13765 Likewise.
13766 * image.c (pbm_read_file): Likewise.
13767 * indent.c (string_display_width): Likewise.
13768 * intervals.c (check_for_interval, search_for_interval)
13769 (inc_interval_count, count_intervals, root_interval)
13770 (adjust_intervals_for_insertion, make_new_interval): Likewise.
13771 * lread.c (defalias): Likewise.
13772 * ralloc.c (r_alloc_check): Likewise.
13773 * regex.c (set_image_of_range_1, set_image_of_range)
13774 (regex_grow_registers): Likewise.
13775 * sysdep.c (strerror): Likewise.
13776 * termcap.c (valid_filename_p, tprint, main): Likewise.
13777 * tparam.c (main): Likewise.
13778 * unexhp9k800.c (run_time_remap, save_data_space)
13779 (update_file_ptrs, read_header, write_header, calculate_checksum)
13780 (copy_file, copy_rest, display_header): Likewise.
13781 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
13782 Likewise.
13783 * xdisp.c (check_it): Likewise.
13784 * xfaces.c (register_color, unregister_color, unregister_colors):
13785 Likewise.
13786 * xfns.c (print_fontset_result): Likewise.
13787 * xrdb.c (member, fatal, main): Likewise.
13788
13789 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
13790
13791 Fix minor problems found by static checking (Bug#9031).
13792 * chartab.c (char_table_set_range, map_sub_char_table):
13793 Remove unused locals.
13794 (uniprop_table): Now static.
13795 * composite.c (_work_char): Remove unused static var.
13796
13797 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
13798
13799 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
13800
13801 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
13802
13803 * gtkutil.c (qttip_cb): Remove code without function.
13804
13805 2011-07-09 Eli Zaretskii <eliz@gnu.org>
13806
13807 * w32.c (pthread_sigmask): New stub.
13808
13809 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
13810
13811 Use pthread_sigmask, not sigprocmask (Bug#9010).
13812 sigprocmask is portable only for single-threaded applications, and
13813 Emacs can be multi-threaded when it uses GTK.
13814 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
13815 (LIBES): Use it.
13816 * callproc.c (Fcall_process):
13817 * process.c (create_process):
13818 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
13819 Use pthread_sigmask, not sigprocmask.
13820
13821 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13822
13823 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
13824 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
13825 wrong (Bug#8591).
13826
13827 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13828
13829 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
13830 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
13831 (xg_hide_tooltip): Fix comment.
13832
13833 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
13834 in registerServicesMenuSendTypes.
13835 (validRequestorForSendType): Don't check ns_return_types.
13836
13837 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
13838 ns_return_type.
13839
13840 2011-07-08 Jason Rumney <jasonr@gnu.org>
13841
13842 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
13843 SH_SHOW for hidden windows (Bug#5482).
13844
13845 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
13846 frame struct members of non-existent frames (Bug#6284).
13847
13848 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
13849
13850 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
13851 variable firstTime not needed on OSX >= 10.6.
13852 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
13853 >= 10.5. Use setKnobProportion, setDoubleValue.
13854
13855 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
13856 (MAC_OS_X_VERSION_10_5): Define if not defined.
13857 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
13858 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
13859 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
13860
13861 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
13862 cString and lossyCString on OSX >= 10.4.
13863
13864 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
13865 sizeToFit on OSX >= 10.2.
13866
13867 * nsimage.m (allocInitFromFile): Don't use deprecated method
13868 bestRepresentationForDevice on OSX >= 10.6.
13869
13870 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
13871 to avoid warning.
13872
13873 * emacs.c: Declare unexec_init_emacs_zone.
13874
13875 * nsgui.h: Fix compiler warning about gnulib redefining verify.
13876
13877 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
13878
13879 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
13880 on svcsMenu (Bug#8842).
13881
13882 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
13883 ns_return_types.
13884 (Fns_list_services): Just return Qnil on 10.6, code not working there.
13885
13886 * nsterm.m (QUTF8_STRING): Declare.
13887 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
13888 (validRequestorForSendType): Return type is (id).
13889 Change indexOfObjectIdenticalTo to indexOfObject.
13890 Check if we have local selection before returning self (Bug#8842).
13891 (writeSelectionToPasteboard): Put local selection into paste board
13892 if we have a local selection (Bug#8842).
13893 (syms_of_nsterm): DEFSYM QUTF8_STRING.
13894
13895 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
13896 (ns_get_local_selection): Declare.
13897
13898 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
13899
13900 * keymap.c (describe_map_tree): Don't insert a double newline at
13901 the end of the buffer (bug#1169) and return whether we inserted
13902 something.
13903
13904 * callint.c (Fcall_interactively): Change "reading args" to
13905 "providing args" to try to clarify what it does (bug#1010).
13906
13907 2011-07-07 Kenichi Handa <handa@m17n.org>
13908
13909 * composite.c (composition_compute_stop_pos): Ignore a static
13910 composition starting before CHARPOS (Bug#8915).
13911
13912 * xdisp.c (handle_composition_prop): Likewise.
13913
13914 2011-07-07 Eli Zaretskii <eliz@gnu.org>
13915
13916 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
13917 (Bug#9015)
13918
13919 2011-07-07 Kenichi Handa <handa@m17n.org>
13920
13921 * character.h (unicode_category_t): New enum type.
13922
13923 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
13924 (Qchar_code_property_table): New variable.
13925 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
13926 (UNIPROP_COMPRESSED_FORM_P): New macros.
13927 (char_table_ascii): Uncompress the compressed values.
13928 (sub_char_table_ref): New arg is_uniprop. Callers changed.
13929 Uncompress the compressed values.
13930 (sub_char_table_ref_and_range): Likewise.
13931 (char_table_ref_and_range): Uncompress the compressed values.
13932 (sub_char_table_set): New arg is_uniprop. Callers changed.
13933 Uncompress the compressed values.
13934 (sub_char_table_set_range): Args changed. Callers changed.
13935 (char_table_set_range): Adjuted for the above change.
13936 (map_sub_char_table): Delete args default_val and parent. Add arg
13937 top. Give decoded values to a Lisp function.
13938 (map_char_table): Adjust for the above change. Give decoded
13939 values to a Lisp function. Gcpro more variables.
13940 (uniprop_table_uncompress)
13941 (uniprop_decode_value_run_length): New functions.
13942 (uniprop_decoder, uniprop_decoder_count): New variables.
13943 (uniprop_get_decoder, uniprop_encode_value_character)
13944 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
13945 New functions.
13946 (uniprop_encoder, uniprop_encoder_count): New variables.
13947 (uniprop_get_encoder, uniprop_table)
13948 (Funicode_property_table_internal, Fget_unicode_property_internal)
13949 (Fput_unicode_property_internal): New functions.
13950 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
13951 Sunicode_property_table_internal, Sget_unicode_property_internal,
13952 and Sput_unicode_property_internal. Defvar_lisp
13953 char-code-property-alist.
13954
13955 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
13956 Vunicode_category_table.
13957
13958 * font.c (font_range): Adjust for the change of
13959 Vunicode_category_table.
13960
13961 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
13962
13963 * m/iris4d.h: Remove file, move contents ...
13964 * s/irix6-5.h: ... here.
13965
13966 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
13967
13968 Remove unportable assumption about struct layout (Bug#8884).
13969 * alloc.c (mark_buffer):
13970 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
13971 (clone_per_buffer_values): Don't assume that
13972 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
13973 This isn't true in general, and it's particularly not true
13974 if Emacs is configured with --with-wide-int.
13975 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
13976 New macros, used in the buffer.c change.
13977
13978 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
13979
13980 * xsettings.c: Use both GConf and GSettings if both are available.
13981 (store_config_changed_event): Add comment.
13982 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
13983 (store_tool_bar_style_changed): New functions.
13984 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
13985 (struct xsettings): Move font inside HAVE_XFT.
13986 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
13987 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
13988 Move inside HAVE_XFT.
13989 (something_changed_gsettingsCB): Rename from something_changedCB.
13990 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
13991 also.
13992 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
13993 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
13994 (something_changed_gconfCB): Rename from something_changedCB.
13995 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
13996 (parse_settings): Move check for font inside HAVE_XFT.
13997 (read_settings, apply_xft_settings): Add comment.
13998 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
13999 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14000 call store_font_name_changed.
14001 (xft_settings_event): Add comment.
14002 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14003 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14004 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14005 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14006 (xsettings_initialize): Call init_gsettings last.
14007 (xsettings_get_system_font, xsettings_get_system_normal_font):
14008 Add comment.
14009
14010 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14011
14012 Random fixes. E.g., (random) never returned negative values.
14013 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14014 subseconds part to the entropy, as that's a bit more random.
14015 Prefer signed to unsigned, since the signedness doesn't matter and
14016 in general we prefer signed. When given a limit, use a
14017 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14018 latter isn't right if USE_2_TAGS_FOR_INTS.
14019 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14020 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14021
14022 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14023
14024 * textprop.c (text_property_stickiness):
14025 Obey Vtext_property_default_nonsticky.
14026 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14027 * w32fns.c (syms_of_w32fns):
14028 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14029
14030 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14031
14032 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14033 This is more efficient than Ffile_directory_p and avoids a minor race.
14034
14035 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14036
14037 * buffer.c (Foverlay_put): Say what the return value is
14038 (bug#7835).
14039
14040 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14041 is a directory before asking whether to use the file name
14042 (bug#7564).
14043 (barf_or_query_if_file_exists): Make the "File is a directory"
14044 error be more correct.
14045
14046 * fns.c (Frequire): Remove the mention of the .gz files, since
14047 that's installation-specific, but keep the mention of
14048 `get-load-suffixes'.
14049
14050 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14051
14052 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14053 Report string overflow if the output is too long.
14054
14055 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
14056
14057 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14058 (syms_of_gnutls): Remove duplicate DEFSYM for
14059 Qgnutls_bootprop_verify_hostname_error, an error for
14060 Qgnutls_bootprop_verify_error (which is no longer used).
14061
14062 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14063 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14064 Also (re)move comments that are misplaced or no longer relevant.
14065
14066 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14067
14068 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14069
14070 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
14071
14072 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14073 and background color parameters if they have been changed.
14074
14075 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14076
14077 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14078
14079 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14080
14081 * xsettings.c (SYSTEM_FONT): Define only when used.
14082 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14083
14084 * keymap.c (access_keymap_1): Now static.
14085
14086 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
14087
14088 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14089 leave any prefix arg for the up event (Bug#1586).
14090
14091 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14092
14093 * lread.c (syms_of_lread): Mention single symbols defined by
14094 `defvar' or `defconst' (bug#7154).
14095
14096 * fns.c (Frequire): Mention .el.gz files (bug#7314).
14097 (Frequire): Mention get-load-suffixes.
14098
14099 2011-07-02 Martin Rudalics <rudalics@gmx.at>
14100
14101 * window.h (window): Remove clone_number slot.
14102 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14103 Remove.
14104 (make_parent_window, make_window, saved_window)
14105 (Fset_window_configuration, save_window_save): Don't deal with
14106 clone numbers.
14107 * buffer.c (Qclone_number): Remove declaration.
14108 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14109
14110 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14111
14112 Add multiple inheritance to keymaps.
14113 * keymap.c (Fmake_composed_keymap): New function.
14114 (Fset_keymap_parent): Simplify.
14115 (fix_submap_inheritance): Remove.
14116 (access_keymap_1): New function extracted from access_keymap to handle
14117 embedded parents and handle lists of maps.
14118 (access_keymap): Use it.
14119 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14120 (Fcopy_keymap): Handle embedded parents.
14121 (Fcommand_remapping, define_as_prefix): Simplify.
14122 (Fkey_binding): Simplify.
14123 (syms_of_keymap): Move minibuffer-local-completion-map,
14124 minibuffer-local-filename-completion-map,
14125 minibuffer-local-must-match-map, and
14126 minibuffer-local-filename-must-match-map to Elisp.
14127 (syms_of_keymap): Defsubr make-composed-keymap.
14128 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14129 (parse_menu_item): Trivial simplification.
14130
14131 2011-07-01 Glenn Morris <rgm@gnu.org>
14132
14133 * Makefile.in (SETTINGS_LIBS): Fix typo.
14134
14135 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14136
14137 * coding.c (Fencode_coding_string): Record the last coding system
14138 used, as the function doc string says (bug#8738).
14139
14140 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14141
14142 * xsettings.c (store_monospaced_changed): Take new font as arg and
14143 check for change against current_mono_font.
14144 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14145 (emacs_settings_constructor, emacs_settings_get_property)
14146 (emacs_settings_set_property, emacs_settings_class_init)
14147 (emacs_settings_init, gsettings_obj): Remove.
14148 (something_changedCB): New function for HAVE_GSETTINGS.
14149 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14150 with value as argument.
14151 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14152 g_settings_new (Bug#8967). Do not create gsettings_obj.
14153 Remove calls to g_settings_bind. Connect something_changedCB to
14154 "changed".
14155
14156 * xgselect.c: Add defined (HAVE_GSETTINGS).
14157 (xgselect_initialize): Ditto.
14158
14159 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14160 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14161 xg_select.
14162
14163 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14164
14165 * eval.c (struct backtrace): Simplify and port the data structure.
14166 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14167 signed bit field, as this assumption is not portable and it makes
14168 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14169 "char debug_on_exit : 1" as this is not portable either; instead,
14170 use the portable "unsigned int debug_on_exit : 1". Remove unused
14171 member evalargs. Remove obsolete comments about cc bombing out.
14172
14173 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14174
14175 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
14176 Let HAVE_GSETTINGS override HAVE_GCONF.
14177 (store_monospaced_changed): New function.
14178 (EMACS_SETTINGS): A new type derived from GObject to handle
14179 GSettings notifications.
14180 (emacs_settings_constructor, emacs_settings_get_property)
14181 (emacs_settings_set_property, emacs_settings_class_init):
14182 New functions.
14183 (gsettings_client, gsettings_obj): New variables.
14184 (GSETTINGS_SCHEMA): New define.
14185 (something_changedCB): Call store_monospaced_changed.
14186 (init_gsettings): New function.
14187 (xsettings_initialize): Call init_gsettings.
14188 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14189 to NULL.
14190
14191 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
14192 GCONF_CFLAGS/LIBS.
14193
14194 2011-06-29 Martin Rudalics <rudalics@gmx.at>
14195
14196 * window.c (resize_root_window, grow_mini_window)
14197 (shrink_mini_window): Rename Qresize_root_window to
14198 Qwindow_resize_root_window and Qresize_root_window_vertically to
14199 Qwindow_resize_root_window_vertically.
14200
14201 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14202
14203 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14204
14205 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
14206
14207 * makefile.w32-in: Redesign dependencies so they reflect more
14208 clearly which files are directly included by each source file,
14209 and not through other includes.
14210
14211 2011-06-27 Martin Rudalics <rudalics@gmx.at>
14212
14213 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14214 (sort_overlays, overlay_strings): When an overlay's clone number
14215 matches the window's clone number process the overlay even if
14216 the overlay's window property doesn't match the current window.
14217
14218 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14219 (Fwindow_hchild): Rename to Fwindow_left_child.
14220 (Fwindow_next): Rename to Fwindow_next_sibling.
14221 (Fwindow_prev): Rename to Fwindow_prev_sibling.
14222 (resize_window_check): Rename to window_resize_check.
14223 (resize_window_apply): Rename to window_resize_apply.
14224 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14225 (Fdelete_other_windows_internal, resize_frame_windows)
14226 (Fsplit_window_internal, Fdelete_window_internal)
14227 (grow_mini_window, shrink_mini_window)
14228 (Fresize_mini_window_internal): Fix callers accordingly.
14229
14230 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14231
14232 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14233 (emacs_fixed_set_min_size): Remove.
14234 (emacs_fixed_new): Take frame as argument.
14235
14236 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14237 (_EmacsFixedPrivate): Remove minwidth/height.
14238 Add struct frame *f.
14239 (emacs_fixed_init): Initialize priv->f.
14240 (get_parent_class, emacs_fixed_set_min_size): Remove.
14241 (emacs_fixed_new): Set priv->f to argument.
14242 (emacs_fixed_get_preferred_width)
14243 (emacs_fixed_get_preferred_height): Use min_width/height from
14244 frames size_hint to set minimum and natural (Bug#8919).
14245 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14246 and use min_width/height from frames size_hint to set
14247 min_width/height (Bug#8919).
14248
14249 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
14250 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14251 Fix indentation.
14252
14253 2011-06-26 Eli Zaretskii <eliz@gnu.org>
14254
14255 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14256 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14257 called at ZV.
14258
14259 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
14260
14261 * process.c (wait_reading_process_output): Bypass select if
14262 waiting for a cell while ignoring keyboard input, and input is
14263 pending. Suggested by Jan Djärv (Bug#8869).
14264
14265 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14266
14267 Use gnulib's dup2 module instead of rolling our own.
14268 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14269
14270 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14271
14272 * dispnew.c (scrolling_window): Before scrolling, turn off a
14273 mouse-highlight in the window being scrolled.
14274
14275 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
14276
14277 Move DEFSYM to lisp.h and use everywhere.
14278
14279 * character.h (DEFSYM): Move declaration...
14280 * lisp.h (DEFSYM): ...here.
14281
14282 * gnutls.c:
14283 * minibuf.c:
14284 * w32menu.c:
14285 * w32proc.c:
14286 * w32select.c: Don't include character.h.
14287
14288 * alloc.c (syms_of_alloc):
14289 * buffer.c (syms_of_buffer):
14290 * bytecode.c (syms_of_bytecode):
14291 * callint.c (syms_of_callint):
14292 * casefiddle.c (syms_of_casefiddle):
14293 * casetab.c (init_casetab_once):
14294 * category.c (init_category_once, syms_of_category):
14295 * ccl.c (syms_of_ccl):
14296 * cmds.c (syms_of_cmds):
14297 * composite.c (syms_of_composite):
14298 * dbusbind.c (syms_of_dbusbind):
14299 * dired.c (syms_of_dired):
14300 * dispnew.c (syms_of_display):
14301 * doc.c (syms_of_doc):
14302 * editfns.c (syms_of_editfns):
14303 * emacs.c (syms_of_emacs):
14304 * eval.c (syms_of_eval):
14305 * fileio.c (syms_of_fileio):
14306 * fns.c (syms_of_fns):
14307 * frame.c (syms_of_frame):
14308 * fringe.c (syms_of_fringe):
14309 * insdel.c (syms_of_insdel):
14310 * keymap.c (syms_of_keymap):
14311 * lread.c (init_obarray, syms_of_lread):
14312 * macros.c (syms_of_macros):
14313 * msdos.c (syms_of_msdos):
14314 * print.c (syms_of_print):
14315 * process.c (syms_of_process):
14316 * search.c (syms_of_search):
14317 * sound.c (syms_of_sound):
14318 * syntax.c (init_syntax_once, syms_of_syntax):
14319 * terminal.c (syms_of_terminal):
14320 * textprop.c (syms_of_textprop):
14321 * undo.c (syms_of_undo):
14322 * w32.c (globals_of_w32):
14323 * window.c (syms_of_window):
14324 * xdisp.c (syms_of_xdisp):
14325 * xfaces.c (syms_of_xfaces):
14326 * xfns.c (syms_of_xfns):
14327 * xmenu.c (syms_of_xmenu):
14328 * xsettings.c (syms_of_xsettings):
14329 * xterm.c (syms_of_xterm): Use DEFSYM.
14330
14331 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14332
14333 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
14334
14335 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14336
14337 Integer and buffer overflow fixes (Bug#8873).
14338
14339 * print.c (printchar, strout): Check for string overflow.
14340 (PRINTPREPARE, printchar, strout):
14341 Don't set size unless allocation succeeds.
14342
14343 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14344 for sizes. Check for string overflow more accurately.
14345 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14346
14347 * macros.c: Integer and buffer overflow fixes.
14348 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14349 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14350 Use ptrdiff_t, not int, for sizes.
14351 Don't increment bufsize until after realloc succeeds.
14352 Check for size-calculation overflow.
14353 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14354
14355 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14356
14357 * lread.c: Integer overflow fixes.
14358 (read_integer): Radix is now EMACS_INT, not int,
14359 to improve quality of diagnostics for out-of-range radices.
14360 Calculate buffer size correctly for out-of-range radices.
14361 (read1): Check for integer overflow in radices, and in
14362 read-circle numbers.
14363 (read_escape): Avoid int overflow.
14364 (Fload, openp, read_buffer_size, read1)
14365 (substitute_object_recurse, read_vector, read_list, map_obarray):
14366 Use ptrdiff_t, not int, for sizes.
14367 (read1): Use EMACS_INT, not int, for sizes.
14368 Check for size overflow.
14369
14370 * image.c (cache_image): Check for size arithmetic overflow.
14371
14372 * lread.c: Integer overflow issues.
14373 (saved_doc_string_size, saved_doc_string_length)
14374 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14375 Now ptrdiff_t, not int.
14376 (read1): Don't assume doc string length fits in int. Check for
14377 out-of-range doc string lengths.
14378 (read_list): Don't assume file position fits in int.
14379 (read_escape): Check for hex character overflow.
14380
14381 2011-06-22 Leo Liu <sdl.web@gmail.com>
14382
14383 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14384 Move to minibuffer.el.
14385
14386 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14387
14388 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
14389 The following patches are for when GLYPH_DEBUG && !XASSERT.
14390 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14391 * dispnew.c (flush_stdout):
14392 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14393 Mark as externally visible.
14394 * dispnew.c (check_window_matrix_pointers): Now static.
14395 * dispnew.c (window_to_frame_vpos):
14396 * xfns.c (unwind_create_frame):
14397 * xterm.c (x_check_font): Remove unused local.
14398 * scroll.c (CHECK_BOUNDS):
14399 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14400 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14401 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14402 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14403 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14404 Now static.
14405 (debug_method_add): Use va_list and vsprintf rather than relying
14406 on undefined behavior with wrong number of arguments.
14407 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14408 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14409 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14410 since we're not interested in debugging glyphs with old libraries.
14411 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14412 GCC 4.6.0's static checking.
14413
14414 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14415
14416 Integer overflow and signedness fixes (Bug#8873).
14417 A few related buffer overrun fixes, too.
14418
14419 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14420
14421 * dispextern.h (struct face.stipple):
14422 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14423 (x_bitmap_mask, x_allocate_bitmap_record)
14424 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14425 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14426 (x_create_bitmap_from_xpm_data):
14427 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14428 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14429 (.bitmaps_last):
14430 * xfaces.c (load_pixmap):
14431 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14432 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14433 (.bitmaps_last, struct x_output.icon_bitmap):
14434 Use ptrdiff_t, not int, for bitmap indexes.
14435 (x_allocate_bitmap_record): Check for size overflow.
14436 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14437
14438 Use ptrdiff_t, not int, for overlay counts.
14439 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14440 * editfns.c (overlays_around, get_pos_property):
14441 * textprop.c (get_char_property_and_overlay):
14442 * xdisp.c (next_overlay_change, note_mouse_highlight):
14443 * xfaces.c (face_at_buffer_position):
14444 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14445 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14446 (Fnext_overlay_change, Fprevious_overlay_change)
14447 (mouse_face_overlay_overlaps, Foverlays_in):
14448 Use ptrdiff_t, not int, for sizes.
14449 (overlays_at, overlays_in): Check for size-calculation overflow.
14450
14451 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14452
14453 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14454 (x_session_initialize): Do not assume string length fits in int.
14455
14456 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14457 This is unlikely, but can occur if DPI is outlandish.
14458
14459 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
14460 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14461
14462 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14463 * xrdb.c (magic_file_p, search_magic_path):
14464 Omit last arg SUFFIX; it was always 0. All callers changed.
14465 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14466
14467 * xfont.c (xfont_match): Avoid need for strlen.
14468
14469 * xfns.c: Don't assume strlen fits in int.
14470 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14471
14472 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14473 not unsigned long, as we prefer signed integers. All callers changed.
14474 Detect integer overflow in repeat count.
14475 (message_dolog): Don't assume print length fits in 39 bytes.
14476 (display_mode_element): Don't assume strlen fits in int.
14477
14478 * termcap.c: Don't assume sizes fit in int and never overflow.
14479 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14480 (gobble_line): Check for size-calculation overflow.
14481
14482 * minibuf.c (Fread_buffer):
14483 * lread.c (intern, intern_c_string):
14484 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14485 Don't assume string length fits in int.
14486
14487 * keyboard.c (parse_tool_bar_item):
14488 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14489
14490 * font.c: Don't assume string length fits in int.
14491 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14492 Use ptrdiff_t, not int.
14493 (font_intern_prop): Don't assume string length fits in int.
14494 Don't assume integer property fits in fixnum.
14495 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
14496
14497 * filelock.c: Fix some buffer overrun and integer overflow issues.
14498 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
14499 Reformulate so as not to need the command string.
14500 Invoke gzip -cd rather than gunzip, as it's more portable.
14501 (lock_info_type, lock_file_1, lock_file):
14502 Don't assume pid_t and time_t fit in unsigned long.
14503 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14504 (current_lock_owner): Prefer signed type for sizes.
14505 Use memcpy, not strncpy, where memcpy is what is really wanted.
14506 Don't assume (via atoi) that time_t and pid_t fit in int.
14507 Check for time_t and/or pid_t out of range, e.g., via a network share.
14508 Don't alloca where an auto var works fine.
14509
14510 * fileio.c: Fix some integer overflow issues.
14511 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14512 Don't assume string length fits in int.
14513 (directory_file_name): Don't assume string length fits in long.
14514 (make_temp_name): Don't assume pid fits in int, or that its print
14515 length is less than 20.
14516
14517 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14518
14519 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14520
14521 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14522
14523 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14524 We prefer signed integers, even for size calculations.
14525
14526 * emacs.c: Don't assume string length fits in 'int'.
14527 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14528 (main): Don't invoke strlen when not needed.
14529
14530 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14531 (XD_DEBUG_MESSAGE): Don't waste a byte.
14532
14533 * callproc.c (getenv_internal_1, getenv_internal)
14534 (Fgetenv_internal):
14535 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14536
14537 * lread.c (invalid_syntax): Omit length argument.
14538 All uses changed. This doesn't fix a bug, but it simplifies the
14539 code away from its former Hollerith-constant appearance, and it's
14540 one less 'int' to worry about when looking at integer-overflow issues.
14541 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
14542
14543 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14544 This didn't break anything, but it didn't help either.
14545 It's confusing to put a bogus integer in a place where the actual
14546 value does not matter.
14547 (LIST_END_P): Remove unused macro and its bogus comment.
14548 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
14549
14550 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14551 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14552 implementation.
14553 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14554 We prefer signed types, and the value cannot exceed the EMACS_INT
14555 range anyway (because otherwise the length would not be representable).
14556 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14557 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14558 This avoids a GCC warning when WIDE_EMACS_INT.
14559
14560 * indent.c (sane_tab_width): New function.
14561 (current_column, scan_for_column, Findent_to, position_indentation)
14562 (compute_motion): Use it. This is just for clarity.
14563 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
14564
14565 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
14566
14567 * lisp.h (lint_assume): New macro.
14568 * composite.c (composition_gstring_put_cache):
14569 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
14570
14571 * editfns.c, insdel.c:
14572 Omit unnecessary forward decls, to simplify future changes.
14573
14574 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
14575
14576 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
14577
14578 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
14579 Use much-faster test for byte-length change.
14580 Don't assume string byte-length fits in 'int'.
14581 Check that character arg fits in 'int'.
14582 (mapcar1): Declare byte as byte, for clarity.
14583
14584 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
14585
14586 * fns.c (concat): Catch string overflow earlier.
14587 Do not rely on integer wraparound.
14588
14589 * dispextern.h (struct it.overlay_strings_charpos)
14590 (struct it.selective): Now EMACS_INT, not int.
14591 * xdisp.c (forward_to_next_line_start)
14592 (back_to_previous_visible_line_start)
14593 (reseat_at_next_visible_line_start, next_element_from_buffer):
14594 Don't arbitrarily truncate the value of 'selective' to int.
14595
14596 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
14597
14598 * composite.c: Don't truncate sizes to 'int'.
14599 (composition_gstring_p, composition_reseat_it)
14600 (composition_adjust_point): Use EMACS_INT, not int.
14601 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
14602 not EMACS_UINT, for indexes.
14603
14604 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
14605
14606 * buffer.c: Include <verify.h>.
14607 (struct sortvec.priority, struct sortstr.priority):
14608 Now EMACS_INT, not int.
14609 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
14610 (struct sortstr.size, record_overlay_string)
14611 (struct sortstrlist.size, struct sortlist.used):
14612 Don't truncate size to int.
14613 (record_overlay_string): Check for size-calculation overflow.
14614 (init_buffer_once): Check at compile-time, not run-time.
14615
14616 2011-06-22 Jim Meyering <meyering@redhat.com>
14617
14618 Don't leak an XBM-image-sized buffer
14619 * image.c (xbm_load): Free the image buffer after using it.
14620
14621 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
14622
14623 Port to Sun C.
14624 * composite.c (find_automatic_composition): Omit needless 'return 0;'
14625 that Sun C diagnosed.
14626 * fns.c (secure_hash): Fix pointer signedness issue.
14627 * intervals.c (static_offset_intervals): New function.
14628 (offset_intervals): Use it.
14629
14630 2011-06-21 Leo Liu <sdl.web@gmail.com>
14631
14632 * deps.mk (fns.o):
14633 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
14634 sha512.h.
14635
14636 * fns.c (secure_hash): Rename from crypto_hash_function and change
14637 the first arg to accept symbols.
14638 (Fsecure_hash): New primitive.
14639 (syms_of_fns): New symbols.
14640
14641 2011-06-20 Deniz Dogan <deniz@dogan.se>
14642
14643 * process.c (Fset_process_buffer): Clarify return value in
14644 docstring.
14645
14646 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
14647
14648 * dispnew.c (add_window_display_history): Use BVAR.
14649
14650 * xdisp.c (debug_method_add): Use BVAR.
14651 (check_window_end, dump_glyph_matrix, dump_glyph)
14652 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
14653
14654 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
14655 Likewise.
14656
14657 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
14658 check till after the cache is created in init_frame_faces.
14659
14660 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
14661
14662 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
14663
14664 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
14665
14666 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
14667 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
14668 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
14669
14670 Improve buffer-overflow checking (Bug#8873).
14671 * fileio.c (Finsert_file_contents):
14672 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
14673 Remove the old (too-loose) buffer overflow checks.
14674 They weren't needed, since make_gap checks for buffer overflow.
14675 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
14676 The old code merely checked for Emacs fixnum overflow, and relied
14677 on undefined (wraparound) behavior. The new code avoids undefined
14678 behavior, and also checks for ptrdiff_t and/or size_t overflow.
14679
14680 * editfns.c (Finsert_char): Don't dump core with very negative counts.
14681 Tune. Don't use wider integers than needed. Don't use alloca.
14682 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
14683
14684 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
14685
14686 * insdel.c, lisp.h (buffer_overflow): New function.
14687 (insert_from_buffer_1, replace_range, replace_range_2):
14688 * insdel.c (make_gap_larger):
14689 * editfns.c (Finsert_char):
14690 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
14691
14692 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
14693
14694 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
14695
14696 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
14697
14698 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
14699 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
14700
14701 * fileio.c: Don't assume EMACS_INT fits in off_t.
14702 (emacs_lseek): New static function.
14703 (Finsert_file_contents, Fwrite_region): Use it.
14704 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
14705
14706 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
14707
14708 * fns.c: Don't overflow int when computing a list length.
14709 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
14710 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
14711 truncation on 64-bit hosts. Check for QUIT every
14712 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
14713 faster and is responsive enough.
14714 (Flength): Report an error instead of overflowing an integer.
14715 (Fsafe_length): Return a float if the value is not representable
14716 as a fixnum. This shouldn't happen except in contrived situations.
14717 (Fnthcdr, Fsort): Don't assume list length fits in int.
14718 (Fcopy_sequence): Don't assume vector length fits in int.
14719
14720 * alloc.c: Check that resized vectors' lengths fit in fixnums.
14721 (header_size, word_size): New constants.
14722 (allocate_vectorlike): Don't check size overflow here.
14723 (allocate_vector): Check it here instead, since this is the only
14724 caller of allocate_vectorlike that could cause overflow.
14725 Check that the new vector's length is representable as a fixnum.
14726
14727 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
14728 The previous code was bogus. For example, next_almost_prime (32)
14729 returned 39, which is undesirable as it is a multiple of 3; and
14730 next_almost_prime (24) returned 25, which is a multiple of 5 so
14731 why was the code bothering to check for multiples of 7?
14732
14733 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
14734
14735 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
14736
14737 Variadic C functions now count arguments with ptrdiff_t.
14738 This partly undoes my 2011-03-30 change, which replaced int with size_t.
14739 Back then I didn't know that the Emacs coding style prefers signed int.
14740 Also, in the meantime I found a few more instances where arguments
14741 were being counted with int, which may truncate counts on 64-bit
14742 machines, or EMACS_INT, which may be unnecessarily wide.
14743 * lisp.h (struct Lisp_Subr.function.aMANY)
14744 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
14745 Arg counts are now ptrdiff_t, not size_t.
14746 All variadic functions and their callers changed accordingly.
14747 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
14748 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
14749 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
14750 * callint.c (Fcall_interactively): Check arg count for overflow,
14751 to avoid potential buffer overrun. Use signed char, not 'int',
14752 for 'varies' array, so that we needn't bother to check its size
14753 calculation for overflow.
14754 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
14755 * eval.c (apply_lambda):
14756 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
14757 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
14758 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
14759
14760 * callint.c (Fcall_interactively): Don't use index var as event count.
14761
14762 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
14763 * mem-limits.h (SIZE): Remove; no longer used.
14764
14765 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
14766
14767 Remove unnecessary casts.
14768 * xterm.c (x_term_init):
14769 * xfns.c (x_set_border_pixel):
14770 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
14771 These aren't needed now that we assume ANSI C.
14772
14773 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
14774 It's more likely to cause problems (due to unsigned overflow)
14775 than to cure them.
14776
14777 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
14778
14779 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
14780
14781 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
14782
14783 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
14784
14785 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
14786
14787 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
14788
14789 GLYPH_CODE_FACE returns EMACS_INT, not int.
14790 * dispextern.h (merge_faces):
14791 * xfaces.c (merge_faces):
14792 * xdisp.c (get_next_display_element, next_element_from_display_vector):
14793 Don't assume EMACS_INT fits in int.
14794
14795 * character.h (CHAR_VALID_P): Remove unused parameter.
14796 * fontset.c, lisp.h, xdisp.c: All uses changed.
14797
14798 * editfns.c (Ftranslate_region_internal): Omit redundant test.
14799
14800 * fns.c (concat): Minor tuning based on overflow analysis.
14801 This doesn't fix any bugs. Use int to hold character, instead
14802 of constantly refetching from Emacs object. Use XFASTINT, not
14803 XINT, for value known to be a character. Don't bother comparing
14804 a single byte to 0400, as it's always less.
14805
14806 * floatfns.c (Fexpt):
14807 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
14808
14809 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
14810 for characters.
14811
14812 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
14813
14814 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
14815 Without this fix, on a 64-bit host (aset S 0 4294967386) would
14816 incorrectly succeed when S was a string, because 4294967386 was
14817 truncated before it was used.
14818
14819 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
14820 Otherwise, an out-of-range integer could cause undefined behavior
14821 on a 64-bit host.
14822
14823 * composite.c: Use int, not EMACS_INT, for characters.
14824 (fill_gstring_body, composition_compute_stop_pos): Use int, not
14825 EMACS_INT, for values that are known to be in character range.
14826 This doesn't fix any bugs but is the usual style inside Emacs and
14827 may generate better code on 32-bit machines.
14828
14829 Make sure a 64-bit char is never passed to ENCODE_CHAR.
14830 This is for reasons similar to the recent CHAR_STRING fix.
14831 * charset.c (Fencode_char): Check that character arg is actually
14832 a character. Pass an int to ENCODE_CHAR.
14833 * charset.h (ENCODE_CHAR): Verify that the character argument is no
14834 wider than 'int', as a compile-time check to prevent future regressions
14835 in this area.
14836
14837 * character.c (char_string): Remove unnecessary casts.
14838
14839 Make sure a 64-bit char is never passed to CHAR_STRING.
14840 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
14841 by silently ignoring the top 32 bits, allowing some values
14842 that were far too large to be valid characters.
14843 * character.h: Include <verify.h>.
14844 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
14845 arguments are no wider than unsigned, as a compile-time check
14846 to prevent future regressions in this area.
14847 * data.c (Faset):
14848 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
14849 (Fsubst_char_in_region):
14850 * fns.c (concat):
14851 * xdisp.c (decode_mode_spec_coding):
14852 Adjust to CHAR_STRING's new requirement.
14853 * editfns.c (Finsert_char, Fsubst_char_in_region):
14854 * fns.c (concat): Check that character args are actually
14855 characters. Without this test, these functions did the wrong
14856 thing with wildly out-of-range values on 64-bit hosts.
14857
14858 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
14859 These casts should not be needed on 32-bit hosts, either.
14860 * keyboard.c (read_char):
14861 * lread.c (Fload): Remove casts to unsigned.
14862
14863 * lisp.h (UNSIGNED_CMP): New macro.
14864 This fixes comparison bugs on 64-bit hosts.
14865 (ASCII_CHAR_P): Use it.
14866 * casefiddle.c (casify_object):
14867 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
14868 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
14869 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
14870 * dispextern.h (FACE_FROM_ID):
14871 * keyboard.c (read_char): Use UNSIGNED_CMP.
14872
14873 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
14874 not to EMACS_INT, to avoid GCC warning.
14875
14876 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
14877
14878 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
14879 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
14880 isn't needed on 32-bit machines.
14881
14882 * buffer.c (Fgenerate_new_buffer_name):
14883 Use EMACS_INT for count, not int.
14884 (advance_to_char_boundary): Return EMACS_INT, not int.
14885
14886 * data.c (Qcompiled_function): Now static.
14887
14888 * window.c (window_body_lines): Now static.
14889
14890 * image.c (gif_load): Rename local to avoid shadowing.
14891
14892 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
14893 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
14894 * alloc.c (make_save_value): Integer argument is now of type
14895 ptrdiff_t, not int.
14896 (mark_object): Use ptrdiff_t, not int.
14897 * lisp.h (pD): New macro.
14898 * print.c (print_object): Use it.
14899
14900 * alloc.c: Use EMACS_INT, not int, to count objects.
14901 (total_conses, total_markers, total_symbols, total_vector_size)
14902 (total_free_conses, total_free_markers, total_free_symbols)
14903 (total_free_floats, total_floats, total_free_intervals)
14904 (total_intervals, total_strings, total_free_strings):
14905 Now EMACS_INT, not int. All uses changed.
14906 (Fgarbage_collect): Compute overall total using a double, so that
14907 integer overflow is less likely to be a problem. Check for overflow
14908 when converting back to an integer.
14909 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
14910 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
14911 These were 'int' variables that could overflow on 64-bit hosts;
14912 they were never used, so remove them instead of repairing them.
14913 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
14914 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
14915 Previously, this ceilinged at INT_MAX, but that doesn't work on
14916 64-bit machines.
14917 (allocate_pseudovector): Don't use EMACS_INT when int would do.
14918
14919 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
14920 (allocate_vectorlike): Check for ptrdiff_t overflow.
14921 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
14922 when a (possibly-narrower) signed value would do just as well.
14923 We prefer using signed arithmetic, to avoid comparison confusion.
14924
14925 * alloc.c: Catch some string size overflows that we were missing.
14926 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
14927 for convenience in STRING_BYTES_MAX.
14928 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
14929 The definition here is exact; the one in lisp.h was approximate.
14930 (allocate_string_data): Check for string overflow. This catches
14931 some instances we weren't catching before. Also, it catches
14932 size_t overflow on (unusual) hosts where SIZE_MAX <= min
14933 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
14934 and ptrdiff_t and EMACS_INT are both 64 bits.
14935
14936 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
14937 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
14938 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
14939
14940 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
14941
14942 * alloc.c (Fmake_string): Check for out-of-range init.
14943
14944 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
14945
14946 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
14947
14948 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
14949
14950 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
14951 xg_get_default_scrollbar_width.
14952
14953 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
14954 (int_gtk_range_get_value): Move to the scroll bar part of the file.
14955 (style_changed_cb): Call update_theme_scrollbar_width and call
14956 x_set_scroll_bar_default_width and xg_frame_set_char_size for
14957 all frames (Bug#8505).
14958 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
14959 Call gtk_window_set_resizable if HAVE_GTK3.
14960 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
14961 and height if HAVE_GTK3 (Bug#8505).
14962 (scroll_bar_width_for_theme): New variable.
14963 (update_theme_scrollbar_width): New function.
14964 (xg_get_default_scrollbar_width): Move code to
14965 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
14966 (xg_initialize): Call update_theme_scrollbar_width.
14967
14968 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
14969
14970 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
14971
14972 2011-06-12 Martin Rudalics <rudalics@gmx.at>
14973
14974 * frame.c (make_frame): Call other_buffer_safely instead of
14975 other_buffer.
14976
14977 * window.c (temp_output_buffer_show): Call display_buffer with
14978 second argument Vtemp_buffer_show_specifiers and reset latter
14979 immediately after the call.
14980 (Vtemp_buffer_show_specifiers): New variable.
14981 (auto_window_vscroll_p, next_screen_context_lines)
14982 (Vscroll_preserve_screen_position): Remove leading asterisks from
14983 doc-strings.
14984
14985 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
14986
14987 Fix minor problems found by GCC 4.6.0 static checking.
14988 * buffer.c (Qclone_number): Remove for now, as it's unused.
14989 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
14990 (record_buffer): Remove unused local.
14991 * frame.c (other_visible_frames, frame_buffer_list): Now static.
14992 (set_frame_buffer_list): Remove; unused.
14993 * frame.h (other_visible_frames): Remove decl.
14994 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
14995 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
14996 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
14997 if HAVE_GPM.
14998 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
14999 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15000 Define only if HAVE_GPM.
15001 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15002 (update_hints_inhibit): Remove; never set. All uses removed.
15003 * widgetprv.h (emacsFrameClassRec): Remove decl.
15004 * window.c (delete_deletable_window): Now returns void, since it
15005 wasn't returning anything.
15006 (compare_window_configurations): Remove unused locals.
15007 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15008 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
15009 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15010 the same widths as pointers. This follows up on the 2011-05-06 patch.
15011 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15012 * xterm.h: Likewise.
15013 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15014
15015 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
15016
15017 * makefile.w32-in: Update dependencies.
15018 (LISP_H): Add lib/intprops.h.
15019
15020 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15021
15022 * image.c (gif_load): Add animation frame delay to the metadata.
15023 (syms_of_image): Use DEFSYM. New symbol `delay'.
15024
15025 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15026
15027 * window.c (delete_deletable_window): Re-add.
15028 (Fset_window_configuration): Rewrite to handle dead buffers and
15029 consequently deletable windows.
15030 (window_tree, Fwindow_tree): Remove. Supply functionality in
15031 window.el.
15032 (compare_window_configurations): Simplify code.
15033
15034 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15035
15036 * image.c (imagemagick_load_image): Fix type mismatch.
15037 (Fimagemagick_types): Likewise.
15038
15039 * window.h (replace_buffer_in_windows): Declare.
15040
15041 2011-06-11 Martin Rudalics <rudalics@gmx.at>
15042
15043 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15044 Qclone_number. Remove external declaration of Qdelete_window.
15045 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15046 code.
15047 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15048 Run Qbuffer_list_update_hook if allowed.
15049 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15050 buffer list implementation.
15051 (other_buffer_safely): New function.
15052 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15053 calls to replace_buffer_in_windows and
15054 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15055 if allowed.
15056 (record_buffer): Inhibit quitting and rewrite using quittable
15057 functions. Run Qbuffer_list_update_hook if allowed.
15058 (Frecord_buffer, Funrecord_buffer): New functions.
15059 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15060 Move switch-to-buffer to window.el.
15061 (bury-buffer): Move to window.el.
15062 (Vbuffer_list_update_hook): New variable.
15063
15064 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15065 section.
15066
15067 * window.h (resize_frame_windows): Move up in code.
15068 (Fwindow_frame): Remove EXFUN.
15069 (replace_buffer_in_all_windows): Remove prototype.
15070 (replace_buffer_in_windows_safely): Add prototype.
15071
15072 * window.c: Declare Qdelete_window static again. Move down
15073 declaration of select_count.
15074 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15075 (Fother_window): Move to window.el.
15076 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15077 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15078 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15079 window.el.
15080 (replace_buffer_in_windows): Implement by calling
15081 Qreplace_buffer_in_windows.
15082 (replace_buffer_in_all_windows): Remove with some functionality
15083 moved into replace_buffer_in_windows_safely.
15084 (replace_buffer_in_windows_safely): New function.
15085 (select_window_norecord, select_frame_norecord): Move in front
15086 of run_window_configuration_change_hook. Remove now obsolete
15087 declarations.
15088 (Fset_window_buffer): Rewrite doc-string.
15089 Call Qrecord_window_buffer.
15090 (keys_of_window): Move binding for other-window to window.el.
15091
15092 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
15093
15094 * dispextern.h (struct image): Replace data member, whose int_val
15095 and ptr_val fields were not used by anything, with a single
15096 lisp_val object.
15097
15098 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15099 (gif_clear_image, gif_load, imagemagick_load_image)
15100 (gs_clear_image, gs_load): Callers changed.
15101
15102 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15103
15104 * buffer.h: Include <time.h>, for time_t.
15105 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15106
15107 Fix minor problems found by static checking.
15108
15109 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15110
15111 Make identifiers static if they are not used in other modules.
15112 * data.c (Qcompiled_function, Qframe, Qvector):
15113 * image.c (QimageMagick, Qsvg):
15114 * minibuf.c (Qmetadata):
15115 * window.c (resize_window_check, resize_root_window): Now static.
15116 * window.h (resize_window_check, resize_root_window): Remove decls.
15117
15118 * window.c (window_deletion_count, delete_deletable_window):
15119 Remove; unused.
15120 (window_body_lines): Now static.
15121 (Fdelete_other_windows_internal): Mark vars as initialized.
15122 Make sure 'resize_failed' is initialized.
15123 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15124 (resize_window_apply): Remove unused local.
15125 * window.h (delete_deletable_window): Remove decl.
15126
15127 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
15128 (imagemagick_load_image): Fix pointer signedness problem by changing
15129 last arg from unsigned char * to char *. All uses changed.
15130 Also, fix a local for similar reasons.
15131 Remove unused locals. Remove locals to avoid shadowing.
15132 (fn_rsvg_handle_free): Remove; unused.
15133 (svg_load, svg_load_image): Fix pointer signedness problem.
15134 (imagemagick_load_image): Don't use garbage pointer image_wand.
15135
15136 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15137
15138 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
15139
15140 * image.c (gif_load): Fix omitted cast error introduced by
15141 2011-06-06 change.
15142
15143 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15144
15145 * window.h (resize_proportionally, orig_total_lines)
15146 (orig_top_line): Remove from window structure.
15147 (set_window_height, set_window_width, change_window_heights)
15148 (Fdelete_window): Remove prototypes.
15149 (resize_frame_windows): Remove duplicate declaration.
15150
15151 2011-06-10 Eli Zaretskii <eliz@gnu.org>
15152
15153 * window.h (resize_frame_windows, resize_window_check)
15154 (delete_deletable_window, resize_root_window)
15155 (resize_frame_windows): Declare prototypes.
15156
15157 * window.c (resize_window_apply): Make definition be "static" to
15158 match the prototype.
15159
15160 2011-06-10 Martin Rudalics <rudalics@gmx.at>
15161
15162 * window.c: Remove declarations of Qwindow_size_fixed,
15163 window_min_size_1, window_min_size_2, window_min_size,
15164 size_window, window_fixed_size_p, enlarge_window, delete_window.
15165 Remove static from declaration of Qdelete_window, it's
15166 temporarily needed by Fbury_buffer.
15167 (replace_window): Don't assign orig_top_line and
15168 orig_total_lines.
15169 (Fdelete_window, delete_window): Remove. Window deletion is
15170 handled by window.el.
15171 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15172 Replace Fdelete_window calls with calls to Qdelete_window.
15173 (Fdelete_other_windows): Remove. Deleting other windows is
15174 handled by window.el.
15175 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15176 handled in window.el.
15177 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15178 Window minimum sizes are handled in window.el.
15179 (shrink_windows, size_window, set_window_height)
15180 (set_window_width, change_window_heights, window_height)
15181 (window_width, CURBEG, CURSIZE, enlarge_window)
15182 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15183 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15184 handled in window.el.
15185 (make_dummy_parent): Rename to make_parent_window and give it a
15186 second argument horflag.
15187 (make_window): Don't set resize_proportionally any more.
15188 (Fsplit_window): Remove. Windows are split in window.el.
15189 (save_restore_action, save_restore_orig_size)
15190 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15191 Resize mini windows in window.el.
15192 (grow_mini_window, shrink_mini_window): Implement by calling
15193 Qresize_root_window_vertically, resize_window_check and
15194 resize_window_apply.
15195 (saved_window, Fset_window_configuration, save_window_save):
15196 Do not handle orig_top_line, orig_total_lines, and
15197 resize_proportionally.
15198 (window_min_height, window_min_width): Move to window.el.
15199 (keys_of_window): Move bindings for delete-other-windows,
15200 split-window, delete-window and enlarge-window to window.el.
15201
15202 * buffer.c: Temporarily extern Qdelete_window.
15203 (Fbury_buffer): Temporarily call Qdelete_window instead of
15204 Fdelete_window (Fbury_buffer will move to window.el soon).
15205
15206 * frame.c (set_menu_bar_lines_1): Remove code handling
15207 orig_top_line and orig_total_lines.
15208
15209 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15210 set_window_height but set heights directly.
15211 (change_frame_size_1): Use resize_frame_windows.
15212
15213 * xdisp.c (init_xdisp): Don't use set_window_height but set
15214 heights directly.
15215
15216 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15217 Use resize_frame_windows instead of change_window_heights and run
15218 run_window_configuration_change_hook.
15219
15220 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15221 instead of change_window_heights and run
15222 run_window_configuration_change_hook.
15223
15224 2011-06-09 Martin Rudalics <rudalics@gmx.at>
15225
15226 * window.c (replace_window): Rename second argument REPLACEMENT to
15227 NEW. New third argument SETFLAG. Rewrite.
15228 (delete_window, make_dummy_parent): Call replace_window with
15229 third argument 1.
15230 (window_list_1): Move down in code.
15231 (run_window_configuration_change_hook): Move set_buffer part
15232 before select_frame_norecord part in order to unwind correctly.
15233 Rename count1 to count.
15234 (recombine_windows, delete_deletable_window, resize_root_window)
15235 (Fdelete_other_windows_internal)
15236 (Frun_window_configuration_change_hook, make_parent_window)
15237 (resize_window_check, resize_window_apply, Fresize_window_apply)
15238 (resize_frame_windows, Fsplit_window_internal)
15239 (Fdelete_window_internal, Fresize_mini_window_internal):
15240 New functions.
15241 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15242
15243 2011-06-08 Martin Rudalics <rudalics@gmx.at>
15244
15245 * window.h (window): Add some new members to window structure -
15246 normal_lines, normal_cols, new_total, new_normal, clone_number,
15247 splits, nest, prev_buffers, next_buffers.
15248 (WINDOW_TOTAL_SIZE): Move here from window.c.
15249 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
15250
15251 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15252 Remove.
15253 (make_dummy_parent): Set new members of windows structure.
15254 (make_window): Move down in code. Handle new members of window
15255 structure.
15256 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15257 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15258 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15259 (Fset_window_prev_buffers, Fwindow_next_buffers)
15260 (Fset_window_next_buffers, Fset_window_clone_number):
15261 New functions.
15262 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15263 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15264 Doc-string fixes.
15265 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15266 Argument WINDOW can be now internal window too.
15267 (Fwindow_use_time): Move up in code.
15268 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15269 Rewrite doc-string.
15270 (Fset_window_configuration, saved_window)
15271 (Fcurrent_window_configuration, save_window_save): Handle new
15272 members of window structure.
15273 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15274 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15275 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15276 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15277 Qget_mru_window, Qresize_root_window,
15278 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15279 Qauto_buffer_name; staticpro them.
15280
15281 2011-06-07 Martin Rudalics <rudalics@gmx.at>
15282
15283 * window.c (Fwindow_total_size, Fwindow_left_column)
15284 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15285 (Fwindow_list_1): New functions.
15286 (window_box_text_cols): Replace with window_body_cols.
15287 (Fwindow_width, Fscroll_left, Fscroll_right):
15288 Use window_body_cols instead of window_box_text_cols.
15289 (delete_window, Fset_window_configuration):
15290 Call delete_all_subwindows with window as argument.
15291 (delete_all_subwindows): Take a window as argument and not a
15292 structure. Rewrite.
15293 (window_loop): Remove handling of GET_LRU_WINDOW and
15294 GET_LARGEST_WINDOW.
15295 (Fget_lru_window, Fget_largest_window): Move to window.el.
15296
15297 * window.h: Extern window_body_cols instead of
15298 window_box_text_cols. delete_all_subwindows now takes a
15299 Lisp_Object as argument.
15300
15301 * indent.c (compute_motion, Fcompute_motion):
15302 Use window_body_cols instead of window_box_text_cols.
15303
15304 * frame.c (delete_frame): Call delete_all_subwindows with root
15305 window as argument.
15306
15307 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15308
15309 * fns.c (Fputhash): Document return value.
15310
15311 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
15312
15313 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15314
15315 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15316
15317 Cons<->int and similar integer overflow fixes (Bug#8794).
15318
15319 Check for overflow when converting integer to cons and back.
15320 * charset.c (Fdefine_charset_internal, Fdecode_char):
15321 Use cons_to_unsigned to catch overflow.
15322 (Fencode_char): Use INTEGER_TO_CONS.
15323 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15324 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15325 * data.c (long_to_cons, cons_to_long): Remove.
15326 (cons_to_unsigned, cons_to_signed): New functions.
15327 These signal an error for invalid or out-of-range values.
15328 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15329 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15330 * font.c (Ffont_variation_glyphs):
15331 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15332 * lisp.h: Include <intprops.h>.
15333 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15334 (cons_to_signed, cons_to_unsigned): New decls.
15335 (long_to_cons, cons_to_long): Remove decls.
15336 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15337 (Fprimitive_undo): Use CONS_TO_INTEGER.
15338 * xfns.c (Fx_window_property): Likewise.
15339 * xselect.c: Include <limits.h>.
15340 (x_own_selection, selection_data_to_lisp_data):
15341 Use INTEGER_TO_CONS.
15342 (x_handle_selection_request, x_handle_selection_clear)
15343 (x_get_foreign_selection, Fx_disown_selection_internal)
15344 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15345 (lisp_data_to_selection_data): Use cons_to_unsigned.
15346 (x_fill_property_data): Use cons_to_signed.
15347 Report values out of range.
15348
15349 Check for buffer and string overflow more precisely.
15350 * buffer.h (BUF_BYTES_MAX): New macro.
15351 * lisp.h (STRING_BYTES_MAX): New macro.
15352 * alloc.c (Fmake_string):
15353 * character.c (string_escape_byte8):
15354 * coding.c (coding_alloc_by_realloc):
15355 * doprnt.c (doprnt):
15356 * editfns.c (Fformat):
15357 * eval.c (verror):
15358 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15359 since they may not be the same number.
15360 * editfns.c (Finsert_char):
15361 * fileio.c (Finsert_file_contents):
15362 Likewise for BUF_BYTES_MAX.
15363
15364 * image.c: Use ptrdiff_t, not int, for sizes.
15365 (slurp_file): Switch from int to ptrdiff_t.
15366 All uses changed.
15367 (slurp_file): Check that file size fits in both size_t (for
15368 malloc) and ptrdiff_t (for sanity and safety).
15369
15370 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15371 if b->modtime has its maximal value.
15372
15373 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15374
15375 Don't assume time_t can fit into int.
15376 * buffer.h (struct buffer.modtime): Now time_t, not int.
15377 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15378 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15379
15380 Minor fixes for signed vs unsigned integers.
15381 * character.h (MAYBE_UNIFY_CHAR):
15382 * charset.c (maybe_unify_char):
15383 * keyboard.c (read_char, reorder_modifiers):
15384 XINT -> XFASTINT, since the integer must be nonnegative.
15385 * ftfont.c (ftfont_spec_pattern):
15386 * keymap.c (access_keymap, silly_event_symbol_error):
15387 XUINT -> XFASTINT, since the integer must be nonnegative.
15388 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15389 since it makes no difference and we prefer signed.
15390 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15391 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15392 nonnegative.
15393
15394 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15395
15396 * window.h (Fwindow_frame): Declare.
15397
15398 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15399
15400 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15401 (SPARE_MEMORY): Always define.
15402 (LARGE_REQUEST): Remove.
15403 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15404
15405 2011-06-06 Martin Rudalics <rudalics@gmx.at>
15406
15407 * lisp.h: Move EXFUNS for Fframe_root_window,
15408 Fframe_first_window and Fset_frame_selected_window to window.h.
15409
15410 * window.h: Move EXFUNS for Fframe_root_window,
15411 Fframe_first_window and Fset_frame_selected_window here from
15412 lisp.h.
15413
15414 * frame.c (Fwindow_frame, Fframe_first_window)
15415 (Fframe_root_window, Fframe_selected_window)
15416 (Fset_frame_selected_window): Move to window.c.
15417 (Factive_minibuffer_window): Move to minibuf.c.
15418 (Fother_visible_frames_p): New function.
15419
15420 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15421
15422 * window.c (decode_window, decode_any_window): Move up in code.
15423 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15424 (inhibit_frame_unsplittable): Remove unused variable.
15425 (Fwindow_buffer): Move up and rewrite doc-string.
15426 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15427 (Fwindow_prev): New functions.
15428 (Fwindow_frame): Move here from frame.c. Accept any window as
15429 argument.
15430 (Fframe_root_window, Fframe_first_window)
15431 (Fframe_selected_window): Move here from frame.c. Accept frame
15432 or arbitrary window as argument. Update doc-strings.
15433 (Fminibuffer_window): Move up in code.
15434 (Fwindow_minibuffer_p): Move up in code and simplify.
15435 (Fset_frame_selected_window): Move here from frame.c.
15436 Marginal rewrite.
15437 (Fselected_window, select_window, Fselect_window): Move up in
15438 code. Minor doc-string fixes.
15439
15440 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15441
15442 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15443 Do not assume that spare memory exists; that assumption is valid
15444 only if SYSTEM_MALLOC.
15445 (LARGE_REQUEST): New macro, so that the issue of large requests
15446 is separated from the issue of spare memory.
15447
15448 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15449
15450 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15451 format. (Bug#8806)
15452
15453 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15454
15455 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15456 before statements.
15457
15458 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15459
15460 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15461
15462 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15463
15464 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15465 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15466
15467 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
15468
15469 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15470
15471 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
15472
15473 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15474 (x_clipboard_manager_save): Add return value.
15475 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15476 New error handlers.
15477 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15478 Obey Vx_select_enable_clipboard_manager. Catch errors in
15479 x_clipboard_manager_save (Bug#8779).
15480 (Vx_select_enable_clipboard_manager): New variable.
15481 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
15482
15483 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
15484
15485 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15486
15487 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15488
15489 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15490 in the current matrix if keep_current_p is non-zero.
15491
15492 2011-06-04 Eli Zaretskii <eliz@gnu.org>
15493
15494 * bidi.c (bidi_level_of_next_char): Fix last change.
15495
15496 2011-06-03 Eli Zaretskii <eliz@gnu.org>
15497
15498 Support bidi reordering of text covered by display properties.
15499
15500 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15501 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15502 (bidi_cache_search, bidi_cache_iterator_state)
15503 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
15504 (bidi_level_of_next_char, bidi_move_to_visually_next):
15505 Support character positions inside a run of characters covered by a
15506 display string.
15507 (bidi_paragraph_init, bidi_resolve_explicit_1)
15508 (bidi_level_of_next_char): Call bidi_fetch_char and
15509 bidi_fetch_char_advance instead of FETCH_CHAR and
15510 FETCH_CHAR_ADVANCE.
15511 (bidi_init_it): Initialize new members.
15512 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15513 definitions.
15514 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15515 instead of using explicit *_CHAR codes.
15516 (bidi_resolve_explicit, bidi_resolve_weak):
15517 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
15518 bidirectional text is supported only in multibyte buffers.
15519 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15520 it to initialize the frame_window_p member of struct bidi_it.
15521 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15522 (bidi_resolve_explicit, bidi_resolve_weak)
15523 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15524 bidi_it->nchars is non-positive.
15525 (bidi_level_of_next_char): Don't try to lookup the cache for the
15526 next/previous character if nothing is cached there yet, or if we
15527 were just reseat()'ed to a new position.
15528
15529 * xdisp.c (set_cursor_from_row): Set start and stop points
15530 according to the row's direction when priming the loop that looks
15531 for the glyph on which to display cursor.
15532 (single_display_spec_intangible_p): Function deleted.
15533 (display_prop_intangible_p): Reimplement to call
15534 handle_display_spec instead of single_display_spec_intangible_p.
15535 Accept 3 additional arguments needed by handle_display_spec.
15536 This fixes incorrect cursor motion across display property with complex
15537 values: lists, `(when COND...)' forms, etc.
15538 (single_display_spec_string_p): Support property values that are
15539 lists with the argument STRING its top-level element.
15540 (display_prop_string_p): Fix the condition for processing a
15541 property that is a list to be consistent with handle_display_spec.
15542 (handle_display_spec): New function, refactored from the
15543 last portion of handle_display_prop.
15544 (compute_display_string_pos): Accept additional argument
15545 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15546 value of a `display' property is a "replacing spec".
15547 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15548 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15549 the display property, but just return a value indicating whether
15550 the display property will replace the characters it covers.
15551 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15552 frame_window_p members of struct bidi_it.
15553 (compute_display_string_pos, compute_display_string_end):
15554 New functions.
15555 (push_it): Accept second argument POSITION, where pop_it should
15556 jump to continue iteration.
15557 (reseat_1): Initialize bidi_it.disp_pos.
15558
15559 * keyboard.c (adjust_point_for_property): Adjust the call to
15560 display_prop_intangible_p to its new signature.
15561
15562 * dispextern.h (struct bidi_it): New member frame_window_p.
15563 (bidi_init_it): Update prototypes.
15564 (display_prop_intangible_p): Update prototype.
15565 (compute_display_string_pos, compute_display_string_end):
15566 Declare prototypes.
15567 (struct bidi_it): New members nchars and disp_pos. ch_len is now
15568 EMACS_INT.
15569
15570 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
15571
15572 Malloc failure behavior now depends on size of allocation.
15573 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
15574 * lisp.h: Change signatures accordingly.
15575 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
15576 All callers changed. (Bug#8762)
15577
15578 * gnutls.c: Use Emacs's memory allocators.
15579 Without this change, the gnutls library would invoke malloc etc.
15580 directly, which causes problems on non-SYNC_INPUT hosts, and which
15581 runs afoul of improving memory_full behavior. (Bug#8761)
15582 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
15583 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
15584 xfree instead of the default malloc, realloc, free.
15585 (Fgnutls_boot): No need to check for memory allocation failure,
15586 since xmalloc does that for us.
15587
15588 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
15589 * category.c (hash_get_category_set):
15590 * ccl.c (ccl_driver):
15591 * charset.c (Fdefine_charset_internal):
15592 * charset.h (struct charset.hash_index):
15593 * composite.c (get_composition_id, gstring_lookup_cache)
15594 (composition_gstring_put_cache):
15595 * composite.h (struct composition.hash_index):
15596 * dispextern.h (struct image.hash):
15597 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
15598 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
15599 (hashfn_equal, hashfn_user_defined, make_hash_table)
15600 (maybe_resize_hash_table, hash_lookup, hash_put)
15601 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
15602 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
15603 (Fsxhash, Fgethash, Fputhash, Fmaphash):
15604 * image.c (make_image, search_image_cache, lookup_image)
15605 (xpm_put_color_table_h):
15606 * lisp.h (struct Lisp_Hash_Table):
15607 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
15608 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
15609 for hashes and hash indexes, instead of 'unsigned' and 'int'.
15610 * alloc.c (allocate_vectorlike):
15611 Check for overflow in vector size calculations.
15612 * ccl.c (ccl_driver):
15613 Check for overflow when converting EMACS_INT to int.
15614 * fns.c, image.c: Remove unnecessary static decls that would otherwise
15615 need to be updated by these changes.
15616 * fns.c (make_hash_table, maybe_resize_hash_table):
15617 Check for integer overflow with large hash tables.
15618 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
15619 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
15620 (SXHASH_REDUCE): New macro.
15621 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
15622 Use it instead of discarding useful hash info with large hash values.
15623 (sxhash_float): New function.
15624 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
15625 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
15626 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
15627 Rewrite to use FIXNUM_BITS, as this simplifies things.
15628 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
15629 Adjust signatures to match updated version of code.
15630 (consing_since_gc): Now EMACS_INT, since a single hash table can
15631 use more than INT_MAX bytes.
15632
15633 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
15634
15635 Make it possible to build with GCC-4.6+ -O2 -flto.
15636
15637 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
15638
15639 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
15640
15641 * minibuf.c (get_minibuffer, read_minibuf_unwind):
15642 Call minibuffer-inactive-mode.
15643
15644 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
15645
15646 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
15647 Update dependencies.
15648
15649 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15650
15651 * data.c (init_data): Remove code for UTS, this system is not
15652 supported anymore.
15653
15654 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15655
15656 Don't force ./temacs to start in terminal mode.
15657
15658 * frame.c (make_initial_frame): Initialize faces in all cases, not
15659 only when CANNOT_DUMP is defined.
15660 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
15661
15662 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15663
15664 * dispnew.c (add_window_display_history): Use const for the string
15665 pointer. Remove declaration, not needed.
15666
15667 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15668
15669 Use 'inline', not 'INLINE'.
15670 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
15671 * alloc.c, fontset.c (INLINE): Remove.
15672 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
15673 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
15674 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
15675 * gmalloc.c (register_heapinfo): Use inline unconditionally.
15676 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
15677
15678 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
15679
15680 Make it possible to run ./temacs.
15681
15682 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
15683 syms_of_callproc does the same thing. Remove test for
15684 "initialized", do it in the caller.
15685 * emacs.c (main): Avoid calling set_initial_environment when dumping.
15686
15687 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
15688
15689 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
15690 (read_minibuf): Use get_minibuffer.
15691 (syms_of_minibuf): Use DEFSYM.
15692 (Qmetadata): New var.
15693 * data.c (Qbuffer): Don't make it static.
15694 (syms_of_data): Use DEFSYM.
15695
15696 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
15697
15698 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
15699 (CCL_CODE_MIN): New macro.
15700
15701 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
15702
15703 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
15704
15705 * eval.c (Qdebug): Now static.
15706 * lisp.h (Qdebug): Remove decl. This reverts a part of the
15707 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
15708 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
15709
15710 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15711
15712 * image.c: Various fixes to ImageMagick code comments.
15713 (Fimagemagick_types): Doc fix.
15714
15715 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
15716
15717 Minor fixes prompted by GCC 4.6.0 warnings.
15718
15719 * xselect.c (converted_selections, conversion_fail_tag): Now static.
15720
15721 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
15722 (x_clipboard_manager_save_all): Move extern decl to ...
15723 * xterm.h: ... here, so that it can be checked for consistency.
15724
15725 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
15726
15727 * xselect.c (x_clipboard_manager_save_frame)
15728 (x_clipboard_manager_save_all): New functions.
15729 (Fx_clipboard_manager_save): Lisp function deleted.
15730
15731 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
15732 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
15733
15734 * xterm.h: Update prototype.
15735
15736 2011-05-28 William Xu <william.xwl@gmail.com>
15737
15738 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
15739 exiting (Bug#8239).
15740
15741 2011-05-28 Jim Meyering <meyering@redhat.com>
15742
15743 Avoid a sign-extension bug in crypto_hash_function.
15744 * fns.c (to_uchar): Define.
15745 (crypto_hash_function): Use it to convert some newly-signed
15746 variables to unsigned, to avoid sign-extension bugs. For example,
15747 without this change, (md5 "truc") would evaluate to
15748 45723a2aff78ff4fff7fff1114760e62 rather than the expected
15749 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
15750 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
15751
15752 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15753
15754 Integer overflow fixes.
15755
15756 * dbusbind.c: Serial number integer overflow fixes.
15757 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
15758 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
15759 to hold a serial number that is too large for a fixnum.
15760 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15761 Check for serial numbers out of range. Decode any serial number
15762 that was so large that it became a float. (Bug#8722)
15763
15764 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
15765 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15766 Use XFASTINT rather than XUINT when numbers are nonnegative.
15767 (xd_append_arg, Fdbus_method_return_internal):
15768 (Fdbus_method_error_internal): Likewise. Also, for unsigned
15769 arguments, check that Lisp number is nonnegative, rather than
15770 silently wrapping negative numbers around. (Bug#8722)
15771 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
15772 (Bug#8722)
15773
15774 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
15775
15776 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
15777
15778 ccl: Add integer overflow checks.
15779 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
15780 (IN_INT_RANGE): New macros.
15781 (ccl_driver): Use them to check for integer overflow when
15782 decoding a CCL program. Many of the new checks are whether XINT (x)
15783 fits in int; it doesn't always, on 64-bit hosts. The new version
15784 doesn't catch all possible integer overflows, but it's an
15785 improvement. (Bug#8719)
15786
15787 * alloc.c (make_event_array): Use XINT, not XUINT.
15788 There's no need for unsigned here.
15789
15790 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
15791 This follows up to the 2011-05-06 change that substituted uintptr_t
15792 for EMACS_INT. This case wasn't caught back then.
15793
15794 Rework Fformat to avoid integer overflow issues.
15795 * editfns.c: Include <float.h> unconditionally, as it's everywhere
15796 now (part of C89). Include <verify.h>.
15797 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
15798 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
15799 (Fformat): Avoid the prepass trying to compute sizes; it was only
15800 approximate and thus did not catch overflow reliably. Instead, walk
15801 through the format just once, formatting and computing sizes as we go,
15802 checking for integer overflow at every step, and allocating a larger
15803 buffer as needed. Keep track separately whether the format is
15804 multibyte. Keep only the most-recently calculated precision, rather
15805 than them all. Record whether each argument has been converted to
15806 string. Use EMACS_INT, not int, for byte and char and arg counts.
15807 Support field widths and precisions larger than INT_MAX. Avoid
15808 sprintf's undefined behavior with conversion specifications such as %#d
15809 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
15810 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
15811 formatting out-of-range floating point numbers with int
15812 formats. (Bug#8668)
15813
15814 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
15815
15816 * data.c: Avoid integer truncation in expressions involving floats.
15817 * data.c: Include <intprops.h>.
15818 (arith_driver): When there's an integer overflow in an expression
15819 involving floating point, convert the integers to floating point
15820 so that the resulting value does not suffer from catastrophic
15821 integer truncation. For example, on a 64-bit host (* 4
15822 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
15823 Do not rely on undefined behavior after integer overflow.
15824
15825 merge count_size_as_multibyte, parse_str_to_multibyte
15826 * character.c, character.h (count_size_as_multibyte):
15827 Rename from parse_str_to_multibyte; all uses changed.
15828 Check for integer overflow.
15829 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
15830 since it's now a duplicate of the other. This is more of
15831 a character than a buffer op, so better that it's in character.c.
15832 * fns.c, print.c: Adjust to above changes.
15833
15834 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
15835
15836 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
15837
15838 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
15839
15840 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15841 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
15842 (x_clipboard_manager_save): Now static.
15843 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
15844
15845 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
15846 (crypto_hash_function): Now static.
15847 Fix pointer signedness problems. Avoid unnecessary initializations.
15848
15849 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
15850
15851 * termhooks.h (Vselection_alist): Make it terminal-local.
15852
15853 * terminal.c (create_terminal): Initialize it.
15854
15855 * xselect.c: Support for clipboard managers.
15856 (Vselection_alist): Move to termhooks.h as terminal-local var.
15857 (LOCAL_SELECTION): New macro.
15858 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
15859 (symbol_to_x_atom): Remove gratuitous arg.
15860 (x_handle_selection_request, lisp_data_to_selection_data)
15861 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
15862 (x_own_selection, x_get_local_selection, x_convert_selection):
15863 New arg, specifying work frame. Use terminal-local Vselection_alist.
15864 (some_frame_on_display): Delete unused function.
15865 (Fx_own_selection_internal, Fx_get_selection_internal)
15866 (Fx_disown_selection_internal, Fx_selection_owner_p)
15867 (Fx_selection_exists_p): New optional frame arg.
15868 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
15869 (x_handle_selection_clear): Don't treat other terminals with the
15870 same keyboard specially. Use the terminal-local Vselection_alist.
15871 (x_clear_frame_selections): Use Frun_hook_with_args.
15872
15873 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
15874
15875 * xterm.h: Add support for those atoms.
15876
15877 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
15878
15879 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
15880 (converted_selections, conversion_fail_tag): New global variables.
15881 (x_selection_request_lisp_error): Free the above.
15882 (x_get_local_selection): Remove unnecessary code.
15883 (x_reply_selection_request): Args changed; handle arbitrary array
15884 of converted selections stored in converted_selections.
15885 Separate the XChangeProperty and SelectionNotify steps.
15886 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
15887 (x_convert_selection): New function.
15888 (x_handle_selection_event): Simplify.
15889 (x_get_foreign_selection): Don't ignore incoming requests while
15890 waiting for an answer; this will fail when we implement
15891 SAVE_TARGETS, and seems unnecessary anyway.
15892 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
15893 (Vx_sent_selection_functions): Doc fix.
15894
15895 2011-05-26 Leo Liu <sdl.web@gmail.com>
15896
15897 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
15898
15899 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15900
15901 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
15902
15903 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
15904 for fringe update if it has periodic bitmap.
15905 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
15906 and fringe_bitmap_periodic_p.
15907
15908 * fringe.c (get_fringe_bitmap_data): New function.
15909 (draw_fringe_bitmap_1, update_window_fringes): Use it.
15910 (update_window_fringes): Record periodicity of fringe bitmap in glyph
15911 row. Mark glyph row for fringe update if periodicity changed.
15912
15913 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
15914 for fringe update unless it has periodic bitmap.
15915
15916 2011-05-25 Kenichi Handa <handa@m17n.org>
15917
15918 * xdisp.c (get_next_display_element): Set correct it->face_id for
15919 a static composition.
15920
15921 2011-05-24 Leo Liu <sdl.web@gmail.com>
15922
15923 * deps.mk (fns.o):
15924 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
15925
15926 * fns.c (crypto_hash_function, Fsha1): New function.
15927 (Fmd5): Use crypto_hash_function.
15928 (syms_of_fns): Add Ssha1.
15929
15930 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15931
15932 * gnutls.c: Remove unused macros.
15933 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
15934 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
15935 Remove macros that are defined and never used.
15936 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
15937
15938 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15939
15940 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
15941 (Fx_get_selection_internal): Minor cleanup.
15942 (Fx_own_selection_internal): Rename arguments for consistency with
15943 select.el.
15944
15945 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
15946
15947 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
15948
15949 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
15950
15951 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
15952
15953 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15954
15955 * dispnew.c (scrolling_window): Don't exclude the case that the
15956 last enabled row in the desired matrix touches the bottom boundary.
15957
15958 2011-05-21 Glenn Morris <rgm@gnu.org>
15959
15960 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
15961 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
15962 and add some more files.
15963
15964 2011-05-20 Eli Zaretskii <eliz@gnu.org>
15965
15966 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
15967 report_file_error introduced by the change from 2011-05-07.
15968
15969 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
15970
15971 * systime.h (Time): Define only if emacs is defined.
15972 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
15973 where the include path doesn't have X11/X.h by default. See
15974 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
15975
15976 2011-05-20 Kenichi Handa <handa@m17n.org>
15977
15978 * composite.c (find_automatic_composition): Fix previous change.
15979
15980 2011-05-20 Glenn Morris <rgm@gnu.org>
15981
15982 * lisp.mk: New file, split from Makefile.in.
15983 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
15984 (shortlisp): Remove.
15985 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
15986
15987 2011-05-19 Glenn Morris <rgm@gnu.org>
15988
15989 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
15990 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
15991 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
15992 (lisp): Set the order to that of loadup.el.
15993 (shortlisp): Make it a copy of $lisp.
15994 (SOME_MACHINE_LISP): Remove.
15995 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
15996 Use just $shortlisp, not $SOME_MACHINE_LISP too.
15997
15998 2011-05-18 Kenichi Handa <handa@m17n.org>
15999
16000 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16001 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16002 (find_automatic_composition): Mostly rewrite for efficiency.
16003
16004 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
16005
16006 * makefile.w32-in: Update dependencies.
16007
16008 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16009
16010 * menu.c: Include limits.h (fixes the MS-Windows build broken by
16011 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
16012
16013 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
16014
16015 Fix some integer overflow issues, such as string length overflow.
16016
16017 * insdel.c (count_size_as_multibyte): Check for string overflow.
16018
16019 * character.c (lisp_string_width): Check for string overflow.
16020 Use EMACS_INT, not int, for string indexes and lengths; in
16021 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16022 the resulting string length overflows an EMACS_INT; instead,
16023 report a string overflow if no precision given. When checking for
16024 precision exhaustion, use a check that cannot possibly have
16025 integer overflow. (Bug#8675)
16026 * character.h (lisp_string_width): Adjust to new signature.
16027
16028 * alloc.c (string_overflow): New function.
16029 (Fmake_string): Use it. This doesn't change behavior, but saves
16030 a few bytes and will simplify future changes.
16031 * character.c (string_escape_byte8): Likewise.
16032 * lisp.h (string_overflow): New decl.
16033
16034 Fixups, following up to the user-interface timestamp change.
16035 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16036 for UI timestamps, instead of unsigned long.
16037 * msdos.c (mouse_get_pos): Likewise.
16038 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
16039 * w32gui.h (Time): Define by including "systime.h" rather than by
16040 declaring it ourselves. (Bug#8664)
16041
16042 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16043 * image.c (clear_image_cache): Likewise.
16044
16045 * term.c (term_mouse_position): Don't assume time_t wraparound.
16046
16047 Be more systematic about user-interface timestamps.
16048 Before, the code sometimes used 'Time', sometimes 'unsigned long',
16049 and sometimes 'EMACS_UINT', to represent these timestamps.
16050 This change causes it to use 'Time' uniformly, as that's what X uses.
16051 This makes the code easier to follow, and makes it easier to catch
16052 integer overflow bugs such as Bug#8664.
16053 * frame.c (Fmouse_position, Fmouse_pixel_position):
16054 Use Time, not unsigned long, for user-interface timestamps.
16055 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16056 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16057 * keyboard.h (last_event_timestamp): Likewise.
16058 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16059 * menu.h (xmenu_show): Likewise.
16060 * term.c (term_mouse_position): Likewise.
16061 * termhooks.h (struct input_event.timestamp): Likewise.
16062 (struct terminal.mouse_position_hook): Likewise.
16063 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16064 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16065 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16066 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16067 what it was before.
16068 * menu.h, termhooks.h: Include "systime.h", for Time.
16069
16070 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16071 Don't assume that the difference between two unsigned long values
16072 can fit into an integer. At this point, we know button_down_time
16073 <= event->timestamp, so the difference must be nonnegative, so
16074 there's no need to cast the result if double-click-time is
16075 nonnegative, as it should be; check that it's nonnegative, just in
16076 case. This bug is triggered when events are more than 2**31 ms
16077 apart (about 25 days). (Bug#8664)
16078
16079 * xselect.c (last_event_timestamp): Remove duplicate decl.
16080 (x_own_selection): Remove needless cast to unsigned long.
16081
16082 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16083 that always fit in int. Use a sentinel instead of a counter, to
16084 avoid a temp and to allay GCC's concerns about possible int overflow.
16085 * frame.h (struct frame): Use int for menu_bar_items_used
16086 instead of EMACS_INT, since it always fits in int.
16087
16088 * menu.c (grow_menu_items): Check for int overflow.
16089
16090 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16091
16092 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16093 Before, the code was not consistent. These values cannot exceed
16094 2**31 - 1 so there's no need to make them unsigned.
16095 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16096 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16097 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16098 as modifiers.
16099 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16100
16101 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16102 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16103 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16104 presumably because the widths might not match.
16105
16106 * window.c (size_window): Avoid needless test at loop start.
16107
16108 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16109
16110 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16111
16112 2011-05-12 Drew Adams <drew.adams@oracle.com>
16113
16114 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16115
16116 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16117
16118 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16119 `width' to `bar_area_x' and `bar_area_width', respectively.
16120 (x_scroll_run): Take account of fringe background extension.
16121
16122 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16123 Rename local vars `left' and `width' to `bar_area_x' and
16124 `bar_area_width', respectively.
16125 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16126 background extension.
16127
16128 2011-05-10 Jim Meyering <meyering@redhat.com>
16129
16130 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16131
16132 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
16133
16134 * image.c (Finit_image_library): Return t for built-in image types,
16135 like pbm and xbm. (Bug#8640)
16136
16137 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16138
16139 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16140
16141 2011-05-07 Eli Zaretskii <eliz@gnu.org>
16142
16143 * w32console.c (Fset_screen_color): Doc fix.
16144 (Fget_screen_color): New function.
16145 (syms_of_ntterm): Defsubr it.
16146
16147 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16148 unlink the temporary file if Fcall_process didn't create it in the
16149 first place.
16150 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16151 child process will be redirected to a file specified with `:file'.
16152 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16153 cue to call_process_cleanup not to close that handle.
16154
16155 2011-05-07 Ben Key <bkey76@gmail.com>
16156
16157 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16158 one of two shell specific rules, either bootstrap-temacs-CMD or
16159 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16160 to the previous implementation of the bootstrap-temacs rule.
16161 The bootstrap-temacs-CMD rule is similar to the previous
16162 implementation of the bootstrap-temacs rule except that it
16163 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16164 variable.
16165
16166 These changes, along with some changes to nt/configure.bat,
16167 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16168 earlier fix to add support for --cflags and --ldflags options
16169 that include quotes so that it works whether make uses cmd or
16170 sh as the shell.
16171
16172 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
16173
16174 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16175 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16176 is a constant.
16177 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16178 a string. Handle both cases.
16179 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16180 (Fdbus_register_method): Use Qinvalid_function.
16181
16182 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16183
16184 * makefile.w32-in: Update dependencies.
16185 (LISP_H): Add inttypes.h and stdin.h.
16186 (PROCESS_H): Add unistd.h.
16187
16188 2011-05-06 Eli Zaretskii <eliz@gnu.org>
16189
16190 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16191 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16192
16193 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
16194
16195 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16196
16197 * term.c (vfatal): Remove stray call to va_end.
16198 It's not needed and the C Standard doesn't allow it here anyway.
16199
16200 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16201 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16202
16203 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16204 bytes.
16205
16206 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16207
16208 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16209
16210 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16211
16212 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16213
16214 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16215
16216 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16217 * charset.c (Fdefine_charset_internal): Don't initialize
16218 charset.code_space[15]. The value was garbage, on hosts with
16219 32-bit int (Bug#8600).
16220
16221 * lread.c (read_integer): Be more consistent with string-to-number.
16222 Use string_to_number to do the actual conversion; this avoids
16223 rounding errors and fixes some other screwups. Without this fix,
16224 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16225 (digit_to_number): Move earlier, for benefit of read_integer.
16226 Return -1 if the digit is out of range for the base, -2 if it is
16227 not a digit in any supported base. (Bug#8602)
16228
16229 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16230
16231 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16232 to match comment at start of function. This also removes a
16233 GCC warning about overflow in a 32+64-bit port.
16234
16235 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16236
16237 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16238 Reported by Stefan Monnier in
16239 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
16240 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16241 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
16242
16243 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16244 (EMACS_UINTPTR): Likewise, with uintptr_t.
16245
16246 * lisp.h: Prefer 64-bit EMACS_INT if available.
16247 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16248 on 32-bit hosts that have 64-bit int, so that they can access
16249 large files.
16250 However, temporarily disable this change unless the temporary
16251 symbol WIDE_EMACS_INT is defined.
16252
16253 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16254
16255 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16256 This removes an assumption that EMACS_INT and long are the same
16257 width as pointers. The assumption is true for Emacs porting targets
16258 now, but we want to make other targets possible.
16259 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16260 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16261 In the rest of the code, change types of integers that hold casted
16262 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16263 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16264 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16265 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16266 No need to cast type when ORing.
16267 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16268 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16269 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16270 assume EMACS_INT is the same width as char *.
16271 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16272 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16273 Remove no-longer-needed casts.
16274 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16275 (xg_tool_bar_help_callback, xg_make_tool_item):
16276 Use EMACS_INTPTR to hold an integer
16277 that will be cast to void *; this can avoid a GCC warning
16278 if EMACS_INT is not the same width as void *.
16279 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16280 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16281 (current_message_1, set_message_1):
16282 Use a local to convert to proper width without a cast.
16283 * xmenu.c (dialog_selection_callback): Likewise.
16284
16285 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16286 Also, don't assume VALBITS / RAND_BITS is less than 5,
16287 and don't rely on undefined behavior when shifting a 1 left into
16288 the sign bit.
16289 * lisp.h (get_random): Change signature to match.
16290
16291 * lread.c (hash_string): Use size_t, not int, for hash computation.
16292 Normally we prefer signed values; but hashing is special, because
16293 it's better to use unsigned division on hash table sizes so that
16294 the remainder is nonnegative. Also, size_t is the natural width
16295 for hashing into memory. The previous code used 'int', which doesn't
16296 retain enough info to hash well into very large tables.
16297 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16298
16299 * dbusbind.c: Don't possibly lose pointer info when converting.
16300 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16301 Use XPNTR rather than XHASH, so that the high-order bits of
16302 the pointer aren't lost when converting through void *.
16303
16304 * eval.c (Fautoload): Don't double-shift a pointer.
16305
16306 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16307
16308 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
16309
16310 * gnutls.c (DEF_GNUTLS_FN):
16311 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16312
16313 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16314
16315 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16316 marker. (Bug#8610)
16317
16318 2011-05-05 Eli Zaretskii <eliz@gnu.org>
16319
16320 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16321 New version that can reserve upto 2GB of heap space.
16322
16323 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
16324
16325 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16326
16327 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16328
16329 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16330 `gnutls_certificate_set_x509_key_file'.
16331
16332 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
16333
16334 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16335 Update dependencies.
16336
16337 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16338
16339 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16340 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16341 Remove unused parameter `fildes'.
16342 * process.c (read_process_output, send_process): Don't pass it.
16343
16344 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16345
16346 Fix previous change: the library cache is defined in w32.c.
16347 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16348 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16349
16350 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
16351
16352 Implement dynamic loading of GnuTLS on Windows.
16353
16354 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16355 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16356 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16357 Declare.
16358
16359 * gnutls.c (Qgnutls_dll): Define.
16360 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16361 (gnutls_*): Declare function pointers.
16362 (init_gnutls_functions): New function to initialize function pointers.
16363 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16364 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16365 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16366 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16367 (emacs_gnutls_write, emacs_gnutls_read)
16368 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16369 (Fgnutls_available_p): New function.
16370 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16371 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16372 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16373
16374 * image.c: Include w32.h.
16375 (Vimage_type_cache): Delete.
16376 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16377 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16378 (w32_delayed_load): Move to w32.c.
16379
16380 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16381
16382 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16383 (w32_delayed_load): Move from image.c. When loading a library, record
16384 its filename in the :loaded-from property of the library id.
16385 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16386 Initialize and staticpro them.
16387 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16388
16389 * process.c: Include lisp.h before w32.h, not after.
16390 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16391 instead of gnutls_record_check_pending.
16392
16393 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16394
16395 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16396
16397 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16398 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16399 as passed in.
16400
16401 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16402
16403 * xterm.c (x_set_frame_alpha): Do not set property on anything
16404 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16405
16406 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16407
16408 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16409
16410 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
16411
16412 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16413 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16414 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16415 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16416 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16417 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16418 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16419 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16420 (Qgnutls_bootprop_callbacks_verify): Make static.
16421
16422 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16423
16424 * callproc.c: Indentation fixup.
16425
16426 * sysdep.c (wait_for_termination_1): Make static.
16427 (wait_for_termination, interruptible_wait_for_termination):
16428 Move after wait_for_termination_1.
16429
16430 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16431
16432 * sysdep.c (interruptible_wait_for_termination): New function
16433 which is like wait_for_termination, but allows keyboard
16434 interruptions.
16435
16436 * callproc.c (Fcall_process): Add (:file "file") as an option for
16437 the STDOUT buffer.
16438 (Fcall_process_region): Ditto.
16439
16440 2011-04-30 Eli Zaretskii <eliz@gnu.org>
16441
16442 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16443 rather than `XVECTOR (FOO)->size'.
16444
16445 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16446 inttypes.h, as a gnulib replacement is used if it not available in
16447 system headers.
16448
16449 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16450
16451 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16452 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16453 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16454
16455 * coding.c (coding_alloc_by_realloc): Error out if destination
16456 will grow beyond MOST_POSITIVE_FIXNUM.
16457 (decode_coding_emacs_mule): Abort if there isn't enough place in
16458 charbuf for the composition carryover bytes. Reserve an extra
16459 space for up to 2 characters produced in a loop.
16460 (decode_coding_iso_2022): Abort if there isn't enough place in
16461 charbuf for the composition carryover bytes.
16462
16463 2011-04-21 Eli Zaretskii <eliz@gnu.org>
16464
16465 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16466 aborting when %lld or %lll format is passed.
16467 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16468 %llo or %llx format is passed. (Bug#8545)
16469
16470 * window.c (window_scroll_line_based): Use a marker instead of
16471 simple variables to record original value of point. (Bug#7952)
16472
16473 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16474 produced by %s or %c overflows available buffer space. (Bug#8545)
16475
16476 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16477
16478 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
16479 (SIZE_MAX): Move defn after all includes, as they might #define it.
16480
16481 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16482
16483 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16484
16485 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16486
16487 * keyboard.c (Qdelayed_warnings_hook): Define.
16488 (command_loop_1): Run `delayed-warnings-hook'
16489 if Vdelayed_warnings_list is non-nil.
16490 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16491 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16492
16493 2011-04-28 Eli Zaretskii <eliz@gnu.org>
16494
16495 * doprnt.c (doprnt): Don't return value smaller than the buffer
16496 size if the message was truncated. (Bug#8545).
16497
16498 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
16499
16500 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16501 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16502
16503 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16504
16505 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16506
16507 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
16508
16509 * makefile.w32-in: Update dependencies.
16510
16511 2011-04-27 Eli Zaretskii <eliz@gnu.org>
16512
16513 Improve `doprnt' and its usage. (Bug#8545)
16514 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16515 `format_end'. Remove support for %l as a conversion specifier.
16516 Don't use xrealloc. Improve diagnostics when the %l size modifier
16517 is used. Update the commentary.
16518
16519 * eval.c (verror): Simplify calculation of size_t.
16520
16521 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16522 messages.
16523
16524 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16525
16526 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16527 change.
16528
16529 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16530
16531 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16532 This makes this file independent of the recent pseudovector change.
16533
16534 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
16535
16536 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16537
16538 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
16539 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
16540 Remove unused local.
16541 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
16542
16543 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
16544 GCC 4.6.0 optimizes based on type-based alias analysis.
16545 For example, if b is of type struct buffer * and v of type struct
16546 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16547 != &v->size, and therefore "v->size = 1; b->size = 2; return
16548 v->size;" must therefore return 1. This assumption is incorrect
16549 for Emacs, since it type-puns struct Lisp_Vector * with many other
16550 types. To fix this problem, this patch adds a new type struct
16551 vectorlike_header that documents the constraints on layout of vectors
16552 and pseudovectors, and helps optimizing compilers not get fooled
16553 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16554 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
16555 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16556 the size member.
16557 (XSETPVECTYPE): Rewrite in terms of new macro.
16558 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16559 This is a bit clearer, and further avoids the possibility of
16560 undesirable aliasing.
16561 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
16562 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
16563 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
16564 since Lisp_Subr is a special case (no "next" field).
16565 (ASIZE): Now uses header.size rather than size.
16566 All previous uses of XVECTOR (foo)->size replaced to use this macro,
16567 to avoid the hassle of writing XVECTOR (foo)->header.size.
16568 (struct vectorlike_header): New type.
16569 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
16570 object, to help avoid aliasing.
16571 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
16572 (SUBRP): Likewise, since Lisp_Subr is a special case.
16573 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
16574 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
16575 (struct Lisp_Hash_Table): Combine first two members into a single
16576 struct vectorlike_header member. All uses of "size" and "next" members
16577 changed to be "header.size" and "header.next".
16578 * buffer.h (struct buffer): Likewise.
16579 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
16580 * frame.h (struct frame): Likewise.
16581 * process.h (struct Lisp_Process): Likewise.
16582 * termhooks.h (struct terminal): Likewise.
16583 * window.c (struct save_window_data, struct saved_window): Likewise.
16584 * window.h (struct window): Likewise.
16585 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
16586 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
16587 * buffer.c (init_buffer_once): Likewise.
16588 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
16589 special case.
16590 * process.c (Fformat_network_address): Use local var for size,
16591 for brevity.
16592
16593 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
16594
16595 Make the Lisp reader and string-to-float more consistent (Bug#8525)
16596 * data.c (atof): Remove decl; no longer used or needed.
16597 (digit_to_number): Move to lread.c.
16598 (Fstring_to_number): Use new string_to_number function, to be
16599 consistent with how the Lisp reader treats infinities and NaNs.
16600 Do not assume that floating-point numbers represent EMACS_INT
16601 without losing information; this is not true on most 64-bit hosts.
16602 Avoid double-rounding errors, by insisting on integers when
16603 parsing non-base-10 numbers, as the documentation specifies.
16604 * lisp.h (string_to_number): New decl, replacing ...
16605 (isfloat_string): Remove.
16606 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
16607 (read1): Do not accept +. and -. as integers; this
16608 appears to have been a coding error. Similarly, do not accept
16609 strings like +-1e0 as floating point numbers. Do not report
16610 overflow for integer overflows unless the base is not 10 which
16611 means we have no simple and reliable way to continue.
16612 Break out the floating-point parsing into a new
16613 function string_to_number, so that Fstring_to_number parses
16614 floating point numbers consistently with the Lisp reader.
16615 (digit_to_number): Move here from data.c. Make it static inline.
16616 (E_CHAR, EXP_INT): Remove, replacing with ...
16617 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
16618 (string_to_number): New function, replacing isfloat_string.
16619 This function checks for valid syntax and produces the resulting
16620 Lisp float number too. Rework it so that string-to-number
16621 no longer mishandles examples like "1.0e+". Use strtoumax,
16622 so that overflow for non-base-10 numbers is reported only when
16623 there's no portable and simple way to convert to floating point.
16624
16625 * textprop.c (set_text_properties_1): Rewrite for clarity,
16626 and to avoid GCC warning about integer overflow.
16627
16628 * intervals.h (struct interval): Use EMACS_INT for members
16629 where EMACS_UINT might cause problems. See
16630 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
16631 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
16632 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
16633 All uses changed.
16634 (offset_intervals): Tell GCC not to worry about length overflow
16635 when negating a negative length.
16636
16637 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
16638 (overrun_check_free): Likewise.
16639
16640 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
16641 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
16642 word size.
16643
16644 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16645 (gnutls_make_error): Rename local to avoid shadowing.
16646 (gnutls_emacs_global_deinit): ifdef out; not used.
16647 (Fgnutls_boot): Use const for pointer to readonly storage.
16648 Comment out unused local. Fix pointer signedness problems.
16649
16650 * lread.c (openp): Don't stuff size_t into an 'int'.
16651 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
16652 about possible signed overflow.
16653
16654 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
16655 (GDK_KEY_g): Don't define if already defined.
16656 (xg_prepare_tooltip): Avoid pointer signedness problem.
16657 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
16658
16659 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
16660 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
16661
16662 * xfns.c (Fx_window_property): Simplify a bit,
16663 to make a bit faster and to avoid GCC 4.6.0 warning.
16664 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
16665
16666 * fns.c (internal_equal): Don't assume size_t fits in int.
16667
16668 * alloc.c (compact_small_strings): Tighten assertion a little.
16669
16670 Replace pEd with more-general pI, and fix some printf arg casts.
16671 * lisp.h (pI): New macro, generalizing old pEd macro to other
16672 conversion specifiers. For example, use "...%"pI"d..." rather
16673 than "...%"pEd"...".
16674 (pEd): Remove. All uses replaced with similar uses of pI.
16675 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
16676 * alloc.c (check_pure_size): Don't overflow by converting size to int.
16677 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
16678 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
16679 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
16680 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
16681 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
16682 64-bit hosts.
16683 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
16684 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
16685 * print.c (safe_debug_print, print_object): Likewise.
16686 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
16687 to int.
16688 Use pI instead of if-then-else-abort. Use %p to avoid casts,
16689 avoiding the 0 flag, which is not portable.
16690 * process.c (Fmake_network_process): Use pI to avoid cast.
16691 * region-cache.c (pp_cache): Likewise.
16692 * xdisp.c (decode_mode_spec): Likewise.
16693 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
16694 behavior on 64-bit hosts with printf arg.
16695 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
16696 (x_stop_queuing_selection_requests): Likewise.
16697 (x_get_window_property): Don't truncate byte count to an 'int'
16698 when tracing.
16699
16700 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
16701 here, since it parses constructs like leading '-' and spaces,
16702 which are not wanted; and it overflows with large numbers.
16703 Instead, simply match F[0-9]+, which is what is wanted anyway.
16704
16705 * alloc.c: Remove unportable assumptions about struct layout.
16706 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
16707 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
16708 (allocate_vectorlike, make_pure_vector): Use the new macros,
16709 plus offsetof, to remove unportable assumptions about struct layout.
16710 These assumptions hold on all porting targets that I know of, but
16711 they are not guaranteed, they're easy to remove, and removing them
16712 makes further changes easier.
16713
16714 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
16715 This doesn't fix a bug but makes the code clearer.
16716 (string_overrun_cookie): Now const. Use initializers that
16717 don't formally overflow signed char, to avoid warnings.
16718 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
16719 can cause Emacs to crash when string overrun checking is enabled.
16720 (allocate_buffer): Don't assume sizeof (struct buffer) is a
16721 multiple of sizeof (EMACS_INT); it need not be, if
16722 alignof(EMACS_INT) < sizeof (EMACS_INT).
16723 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
16724
16725 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
16726
16727 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
16728
16729 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
16730
16731 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
16732 supposed to be handshaking. (Bug#8556)
16733 Reported by Paul Eggert <eggert@cs.ucla.edu>.
16734
16735 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
16736
16737 * lisp.h (Qdebug): List symbol.
16738 * eval.c (Qdebug): Restore global linkage.
16739 * keyboard.c (debug-on-event): New variable.
16740 (handle_user_signal): Break into debugger when debug-on-event
16741 matches the current signal symbol.
16742
16743 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
16744
16745 * alloc.c (check_sblock, check_string_bytes)
16746 (check_string_free_list): Convert to standard C.
16747
16748 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
16749
16750 * w32.c (emacs_gnutls_push): Fix typo.
16751
16752 2011-04-25 Eli Zaretskii <eliz@gnu.org>
16753
16754 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
16755 "cast to pointer from integer of different size".
16756
16757 Improve doprnt and its use in verror. (Bug#8545)
16758 * doprnt.c (doprnt): Document the set of format control sequences
16759 supported by the function. Use SAFE_ALLOCA instead of always
16760 using `alloca'.
16761
16762 * eval.c (verror): Don't limit the buffer size at size_max-1, that
16763 is one byte too soon. Don't use xrealloc; instead xfree and
16764 xmalloc anew.
16765
16766 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
16767
16768 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
16769 callbacks stage.
16770
16771 * gnutls.c: Renamed global_initialized to
16772 gnutls_global_initialized. Added internals for the
16773 :verify-hostname-error, :verify-error, and :verify-flags
16774 parameters of `gnutls-boot' and documented those parameters in the
16775 docstring. Start callback support.
16776 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
16777 unless a fatal error occurred. Call gnutls_alert_send_appropriate
16778 on error. Return error code.
16779 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
16780 (emacs_gnutls_read): Likewise.
16781 (Fgnutls_boot): Return handshake error code.
16782 (emacs_gnutls_handle_error): New function.
16783 (wsaerror_to_errno): Likewise.
16784
16785 * w32.h (emacs_gnutls_pull): Add prototype.
16786 (emacs_gnutls_push): Likewise.
16787
16788 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
16789 (emacs_gnutls_push): Likewise.
16790
16791 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
16792
16793 * process.c (wait_reading_process_output): Check if GnuTLS
16794 buffered some data internally if no FDs are set for TLS
16795 connections.
16796
16797 * makefile.w32-in (OBJ2): Add gnutls.$(O).
16798 (LIBS): Link to USER_LIBS.
16799 ($(BLD)/gnutls.$(0)): New target.
16800
16801 2011-04-24 Eli Zaretskii <eliz@gnu.org>
16802
16803 * xdisp.c (handle_single_display_spec): Rename the
16804 display_replaced_before_p argument into display_replaced_p, to
16805 make it consistent with the commentary. Fix typos in the
16806 commentary.
16807
16808 * textprop.c (syms_of_textprop): Remove dead code.
16809 (copy_text_properties): Delete obsolete commentary about an
16810 interface that was deleted long ago. Fix typos in the description
16811 of arguments.
16812
16813 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
16814 to changes in oldXMenu/XMenu.h from 2011-04-16.
16815 <menu_help_message, prev_menu_help_message>: Constify.
16816 (IT_menu_make_room): menu->help_text is now `const char **';
16817 adjust.
16818
16819 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
16820 to changes in oldXMenu/XMenu.h from 2011-04-16.
16821 (struct XMenu): Declare `help_text' `const char **'.
16822
16823 * xfaces.c <Qunspecified>: Make extern again.
16824
16825 * syntax.c: Include sys/types.h before including regex.h, as
16826 required by POSIX.
16827
16828 * doc.c (get_doc_string): Improve the format passed to `error'.
16829
16830 * doprnt.c (doprnt): Improve commentary.
16831
16832 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
16833
16834 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
16835 them with etags.
16836
16837 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
16838 changes in globals.h immediately force recompilation.
16839 (TAGS): Depend on $(CURDIR)/m/intel386.h and
16840 $(CURDIR)/s/ms-w32.h.
16841 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
16842
16843 * character.c (Fchar_direction): Function deleted.
16844 (syms_of_character): Don't defsubr it.
16845 <char-direction-table>: Deleted.
16846
16847 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16848
16849 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
16850 * doprnt.c: Include limits.h.
16851 (SIZE_MAX): New macro.
16852 (doprnt): Return a size_t value. 2nd arg is now size_t.
16853 Many local variables are now size_t instead of int or unsigned.
16854 Improve overflow protection. Support `l' modifier for integer
16855 conversions. Support %l conversion. Don't assume an EMACS_INT
16856 argument for integer conversions and for %c.
16857
16858 * lisp.h (doprnt): Restore prototype.
16859
16860 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
16861 $(SRC)/character.h.
16862
16863 * Makefile.in (base_obj): Add back doprnt.o.
16864
16865 * deps.mk (doprnt.o): Add back prerequisites.
16866 (callint.o): Depend on character.h.
16867
16868 * eval.c (internal_lisp_condition_case): Include the handler
16869 representation in the error message.
16870 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
16871 when breaking from the loop.
16872
16873 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
16874
16875 * callint.c (Fcall_interactively): When displaying error message
16876 about invalid control letter, pass the character's codepoint, not
16877 a pointer to its multibyte form. Improve display of the character
16878 in octal and display also its hex code.
16879
16880 * character.c (char_string): Use %x to display the (unsigned)
16881 codepoint of an invalid character, to avoid displaying a bogus
16882 negative value.
16883
16884 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
16885 `error', not SYMBOL_NAME itself.
16886
16887 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
16888 character arguments to `error'.
16889
16890 * charset.c (check_iso_charset_parameter): Fix incorrect argument
16891 to `error' in error message about FINAL_CHAR argument. Make sure
16892 FINAL_CHAR is a character, and use %c when it is passed as
16893 argument to `error'.
16894
16895 2011-04-23 Eli Zaretskii <eliz@gnu.org>
16896
16897 * s/ms-w32.h (localtime): Redirect to sys_localtime.
16898
16899 * w32.c: Include <time.h>.
16900 (sys_localtime): New function.
16901
16902 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
16903
16904 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
16905
16906 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
16907
16908 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
16909
16910 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
16911 zombies (Bug#8467).
16912
16913 2011-04-19 Eli Zaretskii <eliz@gnu.org>
16914
16915 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
16916 gl_state.e_property when gl_state.object is Qt.
16917
16918 * insdel.c (make_gap_larger): Remove limitation of buffer size
16919 to <= INT_MAX.
16920
16921 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
16922
16923 * xdisp.c (lookup_glyphless_char_display)
16924 (produce_glyphless_glyph): Handle cons cell entry in
16925 glyphless-char-display.
16926 (Vglyphless_char_display): Document it.
16927
16928 * term.c (produce_glyphless_glyph): Handle cons cell entry in
16929 glyphless-char-display.
16930
16931 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
16932
16933 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
16934
16935 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
16936
16937 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
16938 definition for no-X builds.
16939
16940 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
16941
16942 Static checks with GCC 4.6.0 and non-default toolkits.
16943
16944 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
16945
16946 * process.c (keyboard_bit_set): Define only if SIGIO.
16947 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
16948 (send_process): Repair possible setjmp clobbering.
16949
16950 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
16951
16952 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
16953
16954 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
16955
16956 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
16957 Define only if needed.
16958
16959 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
16960 by pacifying GCC about it. Maybe it's time to retire it?
16961 * xfaces.c (USG, __TIMEVAL__): Likewise.
16962
16963 * dispextern.h (struct redisplay_interface): Rename param
16964 to avoid shadowing.
16965 * termhooks.h (struct terminal): Likewise.
16966 * xterm.c (xembed_send_message): Likewise.
16967
16968 * insdel.c (make_gap_smaller): Define only if
16969 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
16970
16971 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
16972 it.
16973
16974 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
16975 so that we aren't warned about unused symbols.
16976
16977 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
16978
16979 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
16980
16981 * xfns.c (x_real_positions): Mark locals as initialized.
16982
16983 * xmenu.c (xmenu_show): Don't use uninitialized vars.
16984
16985 * xterm.c: Fix problems found by static analysis with other toolkits.
16986 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
16987 (x_dispatch_event): Declare static if USE_GTK, and
16988 define if USE_GTK || USE_X_TOOLKIT.
16989 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
16990 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
16991 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
16992 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
16993
16994 * xmenu.c (menu_help_callback): Pointer type fixes.
16995 Use const pointers when pointing at readonly data. Avoid pointer
16996 signedness clashes.
16997 (FALSE): Remove unused macro.
16998 (update_frame_menubar): Remove unused decl.
16999
17000 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17001
17002 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17003 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17004 (single_menu_item): Rename local to avoid shadowing.
17005
17006 * keyboard.c (make_lispy_event): Remove unused local var.
17007
17008 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17009 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17010
17011 * bitmaps: Change bitmaps from unsigned char back to the X11
17012 compatible char. Avoid the old compiler warnings about
17013 out-of-range initializers by using, for example, '\xab' rather
17014 than 0xab.
17015
17016 * xgselect.c (xgselect_initialize): Check vs interface
17017 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17018
17019 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17020
17021 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17022 to read-only memory.
17023
17024 * fns.c (vector): Remove; this old hack is no longer needed.
17025
17026 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
17027 Remove unused var.
17028 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
17029
17030 * xrdb.c (x_load_resources): Omit unused local.
17031
17032 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
17033 (x_window): Rename locals to avoid shadowing.
17034 (USG): Use the kludged USG macro, to pacify gcc.
17035
17036 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
17037 (x_term_init): Remove local to avoid shadowing.
17038
17039 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
17040
17041 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17042 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17043
17044 2011-04-16 Eli Zaretskii <eliz@gnu.org>
17045
17046 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17047
17048 Fix regex.c, syntax.c and friends for buffers > 2GB.
17049 * syntax.h (struct gl_state_s): Declare character position members
17050 EMACS_INT.
17051
17052 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17053
17054 * textprop.c (verify_interval_modification, interval_of):
17055 Declare arguments EMACS_INT.
17056
17057 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17058 EMACS_INT.
17059
17060 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17061
17062 * indent.c (Fvertical_motion): Local variable it_start is now
17063 EMACS_INT.
17064
17065 * regex.c (re_match, re_match_2, re_match_2_internal)
17066 (bcmp_translate, regcomp, regexec, print_double_string)
17067 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17068 (re_compile_pattern, re_exec): Declare arguments and local
17069 variables `size_t' and `ssize_t' and return values `regoff_t', as
17070 appropriate.
17071 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17072 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17073 <compile_stack_type>: `size' and `avail' are now `size_t'.
17074
17075 * regex.h <regoff_t>: Use ssize_t, not int.
17076 (re_search, re_search_2, re_match, re_match_2): Arguments that
17077 specify buffer/string position and length are now ssize_t and
17078 size_t. Return type is regoff_t.
17079
17080 2011-04-16 Ben Key <bkey76@gmail.com>
17081
17082 * nsfont.m: Fixed bugs in ns_get_family and
17083 ns_descriptor_to_entity that were caused by using free to
17084 deallocate memory blocks that were allocated by xmalloc (via
17085 xstrdup). This caused Emacs to crash when compiled with
17086 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17087 --enable-checking=xmallocoverrun). xfree is now used to
17088 deallocate these memory blocks.
17089
17090 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
17091
17092 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17093
17094 emacs_write: Accept and return EMACS_INT for sizes.
17095 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17096 et seq.
17097 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17098 Accept and return EMACS_INT.
17099 (emacs_gnutls_write): Return the number of bytes written on
17100 partial writes.
17101 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
17102 (emacs_read, emacs_write): Remove check for negative size, as the
17103 Emacs source code has been audited now.
17104 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17105 (emacs_read, emacs_write): Use it.
17106 * process.c (send_process): Adjust to the new signatures of
17107 emacs_write and emacs_gnutls_write. Do not attempt to store
17108 a byte offset into an 'int'; it might overflow.
17109 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
17110
17111 * sound.c: Don't assume sizes fit in 'int'.
17112 (struct sound_device.period_size, alsa_period_size):
17113 Return EMACS_INT, not int.
17114 (struct sound_device.write, vox_write, alsa_write):
17115 Accept EMACS_INT, not int.
17116 (wav_play, au_play): Use EMACS_INT to store sizes and to
17117 record read return values.
17118
17119 2011-04-15 Ben Key <bkey76@gmail.com>
17120
17121 * keyboard.c (Qundefined): Don't declare static since it is used
17122 in nsfns.m.
17123 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17124 static since they are used in nsfont.m.
17125
17126 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17127
17128 * process.c (Qprocessp): Don't declare static.
17129 * lisp.h (Qprocessp): Declare again.
17130
17131 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
17132
17133 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17134
17135 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17136
17137 Improve C-level modularity by making more things 'static'.
17138
17139 Don't publish debugger-only interfaces to other modules.
17140 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17141 (verify_bytepos, count_markers): Move decls to the only modules
17142 that need them.
17143 * region-cache.h (pp_cache): Likewise.
17144 * window.h (check_all_windows): Likewise.
17145 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17146
17147 * sysdep.c (croak): Now static, if
17148 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17149 * syssignal.h (croak): Declare only if not static.
17150
17151 * alloc.c (refill_memory_reserve): Now static if
17152 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17153 * lisp.h (refill_memory_reserve): Declare only if not static.
17154
17155 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17156 Define only if USE_LUCID.
17157
17158 * xrdb.c (x_customization_string, x_rm_string): Now static.
17159
17160 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17161 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17162
17163 * xdisp.c (draw_row_with_mouse_face): Now static.
17164 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17165
17166 * window.h (check_all_windows): Mark externally visible.
17167
17168 * window.c (window_deletion_count): Now static.
17169
17170 * undo.c: Make symbols static if they're not exported.
17171 (last_undo_buffer, last_boundary_position, pending_boundary):
17172 Now static.
17173
17174 * textprop.c (interval_insert_behind_hooks): Now static.
17175 (interval_insert_in_front_hooks): Likewise.
17176
17177 * term.c: Make symbols static if they're not exported.
17178 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17179 (max_frame_lines, tty_set_terminal_modes):
17180 (tty_reset_terminal_modes, tty_turn_off_highlight):
17181 (get_tty_terminal): Now static.
17182 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17183 * termhooks.h (term_mouse_moveto): Do not declare if
17184 HAVE_WINDOW_SYSTEM.
17185 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17186 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17187
17188 * sysdep.c: Make symbols static if they're not exported.
17189 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17190 Now static.
17191 (sigprocmask_set, full_mask): Remove; unused.
17192 (wait_debugging): Mark as visible.
17193 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17194 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17195
17196 * syntax.c (syntax_temp): Define only if !__GNUC__.
17197
17198 * sound.c (current_sound_device, current_sound): Now static.
17199
17200 * search.c (searchbufs, searchbuf_head): Now static.
17201
17202 * scroll.c (scroll_cost): Remove; unused.
17203 * dispextern.h (scroll_cost): Remove decl.
17204
17205 * region-cache.h (pp_cache): Mark as externally visible.
17206
17207 * process.c: Make symbols static if they're not exported.
17208 (process_tick, update_tick, create_process, chan_process):
17209 (Vprocess_alist, proc_buffered_char, datagram_access):
17210 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17211 (deactivate_process): Mark defn as static, as well as decl.
17212 * lisp.h (create_process): Remove decl.
17213 * process.h (chan_process, Vprocess_alist): Remove decls.
17214
17215 * print.c: Make symbols static if they're not exported.
17216 (print_depth, new_backquote_output, being_printed, print_buffer):
17217 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17218 (print_interval, print_number_index, initial_stderr_stream):
17219 Now static.
17220 * lisp.h (Fprinc): Remove decl.
17221 (debug_output_compilation_hack): Mark as externally visible.
17222
17223 * sysdep.c (croak): Move decl from here to syssignal.h.
17224 * syssignal.h (croak): Put it here, so the API can be checked when
17225 'croak' is called from dissociate_if_controlling_tty.
17226
17227 * minibuf.c: Make symbols static if they're not exported.
17228 (minibuf_save_list, choose_minibuf_frame): Now static.
17229 * lisp.h (choose_minibuf_frame): Remove decl.
17230
17231 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17232
17233 * lread.c: Make symbols static if they're not exported.
17234 (read_objects, initial_obarray, oblookup_last_bucket_number):
17235 Now static.
17236 (make_symbol): Remove; unused.
17237 * lisp.h (initial_obarray, make_symbol): Remove decls.
17238
17239 * keyboard.c: Make symbols static if they're not exported.
17240 (single_kboard, recent_keys_index, total_keys, recent_keys):
17241 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17242 (this_single_command_key_start, echoing, last_auto_save):
17243 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17244 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17245 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17246 (Vlispy_mouse_stem, double_click_count):
17247 Now static.
17248 (force_auto_save_soon): Define only if SIGDANGER.
17249 (ignore_mouse_drag_p): Now static if
17250 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17251 (print_help): Remove; unused.
17252 (stop_character, last_timer_event): Mark as externally visible.
17253 * keyboard.h (ignore_mouse_drag_p): Declare only if
17254 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17255 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17256 * lisp.h (echoing): Remove decl.
17257 (force_auto_save_soon): Declare only if SIGDANGER.
17258 * xdisp.c (redisplay_window): Simplify code, to make it more
17259 obvious that ignore_mouse_drag_p is not accessed if !defined
17260 USE_GTK && !defined HAVE_NS.
17261
17262 * intervals.c: Make symbols static if they're not exported.
17263 (merge_properties_sticky, merge_interval_right, delete_interval):
17264 Now static.
17265 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17266
17267 * insdel.c: Make symbols static if they're not exported.
17268 However, leave prepare_to_modify_buffer alone. It's never
17269 called from outside this function, but that appears to be a bug.
17270 (combine_after_change_list, combine_after_change_buffer):
17271 (adjust_after_replace, signal_before_change): Now static.
17272 (adjust_after_replace_noundo): Remove; unused.
17273 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
17274 (signal_before_change): Remove decls.
17275
17276 * indent.c (val_compute_motion, val_vmotion): Now static.
17277
17278 * image.c: Make symbols static if they're not exported.
17279 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17280 if USE_GTK.
17281 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17282 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17283
17284 * fringe.c (standard_bitmaps): Now static.
17285 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17286
17287 * frame.c: Make symbols static if they're not exported.
17288 (x_report_frame_params, make_terminal_frame): Now static.
17289 (get_frame_param): Now static, unless HAVE_NS.
17290 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17291 (x_get_resource_string): Remove; not used.
17292 * frame.h (make_terminal_frame, x_report_frame_params):
17293 (x_get_resource_string); Remove decls.
17294 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17295 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17296
17297 * font.c, fontset.c: Make symbols static if they're not exported.
17298 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17299 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17300 * font.c (font_close_object): Now static.
17301 * font.h (font_close_object): Remove.
17302 * fontset.c (FONTSET_OBJLIST): Remove.
17303 (free_realized_fontset) #if-0 the body, which does nothing.
17304 (face_suitable_for_char_p): #if-0, as it's never called.
17305 * fontset.h (face_suitable_for_char_p): Remove decl.
17306 * xfaces.c (face_at_string_position):
17307 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
17308 since 0 is always ASCII.
17309
17310 * fns.c (weak_hash_tables): Now static.
17311
17312 * fileio.c: Make symbols static if they're not exported.
17313 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17314 (Vwrite_region_annotation_buffers): Now static.
17315
17316 * eval.c: Make symbols static if they're not exported.
17317 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17318 * lisp.h (backtrace_list): Remove decl.
17319
17320 * emacs.c: Make symbols static if they're not exported.
17321 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17322 (fatal_error_code, fatal_error_signal_hook, standard_args):
17323 Now static.
17324 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17325 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17326 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17327 * lisp.h (fatal_error_signal_hook): Remove decl.
17328 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17329
17330 * editfns.c: Move a (normally-unused) function to its only use.
17331 * editfns.c, lisp.h (get_operating_system_release): Remove.
17332 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17333 worth the hassle of breaking this out.
17334
17335 * xterm.c: Make symbols static if they're not exported.
17336 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17337 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17338 (x_destroy_window, x_delete_display):
17339 Now static.
17340 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17341 (x_mouse_leave): Remove; unused.
17342 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17343 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17344 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17345 Remove decls.
17346 (x_mouse_leave): Declare only if WINDOWSNT.
17347 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17348 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17349 USE_X_TOOLKIT.
17350
17351 * ftxfont.c: Make symbols static if they're not exported.
17352 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17353 HAVE_FREETYPE.
17354 * font.h (ftxfont_driver): Likewise.
17355
17356 * xfns.c: Make symbols static if they're not exported.
17357 (x_last_font_name, x_display_info_for_name):
17358 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17359 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17360 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17361 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17362 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17363 (last_show_tip_args): Now static.
17364 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17365 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17366 (x_screen_planes): Remove; unused.
17367 * dispextern.h (x_screen_planes): Remove decl.
17368
17369 * dispnew.c: Make symbols static if they're not exported.
17370 * dispextern.h (redraw_garbaged_frames, scrolling):
17371 (increment_row_positions): Remove.
17372 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17373 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17374 Now static.
17375 (redraw_garbaged_frames): Remove; unused.
17376
17377 * xfaces.c: Make symbols static if they're not exported.
17378 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17379 Remove decls.
17380 * xterm.h (defined_color): Remove decls.
17381 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17382 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17383 (menu_face_changed_default, defined_color, free_realized_face):
17384 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17385 (ascii_face_of_lisp_face): Remove; unused.
17386
17387 * xdisp.c: Make symbols static if they're not exported.
17388 * dispextern.h (scratch_glyph_row, window_box_edges):
17389 (glyph_to_pixel_coords, set_cursor_from_row):
17390 (get_next_display_element, set_iterator_to_next):
17391 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17392 (show_mouse_face): Remove decls
17393 * frame.h (message_buf_print): Likewise.
17394 * lisp.h (pop_message, set_message, check_point_in_composition):
17395 Likewise.
17396 * xterm.h (set_vertical_scroll_bar): Likewise.
17397 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17398 (message_buf_print, scratch_glyph_row, displayed_buffer):
17399 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17400 (get_next_display_element, show_mouse_face, window_box_edges):
17401 (frame_to_window_pixel_xy, check_point_in_composition):
17402 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17403 (glyph_to_pixel_coords): Remove; unused.
17404
17405 * dired.c (file_name_completion): Now static.
17406
17407 * dbusbind.c (xd_in_read_queued_messages): Now static.
17408
17409 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17410 * data.c (circular_list_error): Remove.
17411
17412 * commands.h (last_point_position, last_point_position_buffer):
17413 (last_point_position_window): Remove decls.
17414 * keyboard.c: Make these variables static.
17415
17416 * coding.h (coding, code_convert_region, encode_coding_gap):
17417 Remove decls.
17418 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17419 (iso_code_class, detect_coding, code_convert_region): Now static.
17420 (encode_coding_gap): Remove; unused.
17421
17422 * chartab.c (chartab_chars, chartab_bits): Now static.
17423
17424 * charset.h (charset_iso_8859_1): Remove decl.
17425 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17426 Now static.
17427
17428 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17429 * ccl.c (Vccl_program_table): Now static.
17430 (check_ccl_update): Remove; unused.
17431
17432 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17433 * category.h: ... from here.
17434 * category.c (check_category_table, set_category_set): Now static.
17435
17436 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17437 * lisp.h: Remove these decls.
17438
17439 * buffer.c (buffer_count): Remove unused var.
17440
17441 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17442 so that it's not optimized away.
17443 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17444 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17445 exported only to the debugger.
17446
17447 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
17448 * atimer.h (run_all_atimers): Remove; not exported.
17449
17450 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17451 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17452 was inaccessible from Lisp.
17453 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17454 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17455
17456 alloc.c: Import and export fewer symbols, and remove unused items.
17457 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17458 is defined.
17459 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17460 it's not optimized away by whole-program optimization.
17461 (message_enable_multibyte, free_misc): Remove.
17462 (catchlist, handlerlist, mark_backtrace):
17463 Declare only if BYTE_MARK_STACK.
17464 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17465 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17466 (message_enable_multibyte): Remove decl.
17467 (free_misc, interval_free_list, float_block, float_block_index):
17468 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17469 (cons_free_list, last_marked_index):
17470 Now static.
17471 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17472 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17473 (mark_backtrace): Define only if BYTE_MARK_STACK.
17474 * xdisp.c (message_enable_multibyte): Now static.
17475
17476 Declare Lisp_Object Q* variables to be 'static' if not exported.
17477 This makes it easier for human readers (and static analyzers)
17478 to see whether these variables are used from other modules.
17479 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17480 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17481 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17482 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17483 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17484 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17485 * xmenu.c, xselect.c:
17486 Declare Q* vars static if they are not used in other modules.
17487 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17488 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17489 Remove decls of unexported vars.
17490 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17491
17492 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17493
17494 Make Emacs functions such as Fatom 'static' by default.
17495 This makes it easier for human readers (and static analyzers)
17496 to see whether these functions can be called from other modules.
17497 DEFUN now defines a static function. To make the function external
17498 so that it can be used in other C modules, use the new macro DEFUE.
17499 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17500 (Finit_image_library):
17501 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17502 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17503 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17504 Remove decls, since these functions are now static.
17505 (Funintern, Fget_internal_run_time): New decls, since these functions
17506 were already external.
17507
17508 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17509 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17510 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17511 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17512 * keyboard.c, keymap.c, lread.c:
17513 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17514 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17515 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17516 Mark functions with DEFUE instead of DEFUN,
17517 if they are used in other modules.
17518 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17519 decls for now-static functions.
17520 * buffer.h (Fdelete_overlay): Remove decl.
17521 * callproc.c (Fgetenv_internal): Mark as internal.
17522 * composite.c (Fremove_list_of_text_properties): Remove decl.
17523 (Fcomposition_get_gstring): New forward static decl.
17524 * composite.h (Fcomposite_get_gstring): Remove decl.
17525 * dired.c (Ffile_attributes): New forward static decl.
17526 * doc.c (Fdocumntation_property): New forward static decl.
17527 * eval.c (Ffetch_bytecode): New forward static decl.
17528 (Funintern): Remove extern decl; now in .h file where it belongs.
17529 * fileio.c (Fmake_symbolic_link): New forward static decl.
17530 * image.c (Finit_image_library): New forward static decl.
17531 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17532 * intervals.h (Fprevious_property_change):
17533 (Fremove_list_of_text_properties): Remove decls.
17534 * keyboard.c (Fthis_command_keys): Remove decl.
17535 (Fcommand_execute): New forward static decl.
17536 * keymap.c (Flookup_key): New forward static decl.
17537 (Fcopy_keymap): Now static.
17538 * keymap.h (Flookup_key): Remove decl.
17539 * process.c (Fget_process): New forward static decl.
17540 (Fprocess_datagram_address): Mark as internal.
17541 * syntax.c (Fsyntax_table_p): New forward static decl.
17542 (skip_chars): Remove duplicate decl.
17543 * textprop.c (Fprevious_property_change): New forward static decl.
17544 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17545 Now internal.
17546 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17547 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17548
17549 * editfns.c (Fformat): Remove unreachable code.
17550
17551 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17552
17553 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17554 change. (Bug#8496)
17555
17556 2011-04-13 Eli Zaretskii <eliz@gnu.org>
17557
17558 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17559 when at ZV. (Bug#8487)
17560
17561 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
17562
17563 * charset.c (Fclear_charset_maps): Use xfree instead of free.
17564 (Bug#8437)
17565 * keyboard.c (parse_tool_bar_item): Likewise.
17566 * sound.c (sound_cleanup, alsa_close): Likewise.
17567 * termcap.c (tgetent): Likewise.
17568 * xfns.c (x_default_font_parameter): Likewise.
17569 * xsettings.c (read_and_apply_settings): Likewise.
17570
17571 * alloc.c (overrun_check_malloc, overrun_check_realloc)
17572 (overrun_check_free): Protoize.
17573
17574 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
17575
17576 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
17577 since callers should never pass a negative size.
17578 Change the signature to match that of plain 'read' and 'write'; see
17579 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
17580 * lisp.h: Update prototypes of emacs_write and emacs_read.
17581
17582 2011-04-11 Eli Zaretskii <eliz@gnu.org>
17583
17584 * xdisp.c (redisplay_window): Don't try to determine the character
17585 position of the scroll margin if the window start point w->startp
17586 is outside the buffer's accessible region. (Bug#8468)
17587
17588 2011-04-10 Eli Zaretskii <eliz@gnu.org>
17589
17590 Fix write-region and its subroutines for buffers > 2GB.
17591 * fileio.c (a_write, e_write): Modify declaration of arguments and
17592 local variables to support buffers larger than 2GB.
17593 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
17594
17595 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
17596 argument, local variables, and return value.
17597
17598 * lisp.h: Update prototypes of emacs_write and emacs_read.
17599
17600 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
17601
17602 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
17603
17604 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
17605
17606 Fix more problems found by GCC 4.6.0's static checks.
17607
17608 * xdisp.c (vmessage): Use a better test for character truncation.
17609
17610 * charset.c (load_charset_map): <, not <=, for optimization,
17611 and to avoid potential problems with integer overflow.
17612 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
17613 * casetab.c (set_identity, shuffle): Likewise.
17614 * editfns.c (Fformat): Likewise.
17615 * syntax.c (skip_chars): Likewise.
17616
17617 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
17618 This also lets GCC 4.6.0 generate slightly better loop code.
17619
17620 * callint.c (Fcall_interactively): <, not <=, for optimization.
17621 (Fcall_interactively): Count the number of arguments produced,
17622 not the number of arguments given. This is simpler and lets GCC
17623 4.6.0 generate slightly better code.
17624
17625 * ftfont.c: Distingish more carefully between FcChar8 and char.
17626 The previous code passed unsigned char * to a functions like
17627 strlen and xstrcasecmp that expect char *, which does not
17628 conform to the C standard.
17629 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
17630 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
17631 char * when the C standard requires it.
17632
17633 * keyboard.c (read_char): Remove unused var.
17634
17635 * eval.c: Port to Windows vsnprintf (Bug#8435).
17636 Include <limits.h>.
17637 (SIZE_MAX): Define if the headers do not.
17638 (verror): Do not give up if vsnprintf returns a negative count.
17639 Instead, grow the buffer. This ports to Windows vsnprintf, which
17640 does not conform to C99. Problem reported by Eli Zaretskii.
17641 Also, simplify the allocation scheme, by avoiding the need for
17642 calling realloc, and removing the ALLOCATED variable.
17643
17644 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
17645
17646 Remove invocations of doprnt, as Emacs now uses vsnprintf.
17647 But keep the doprint source code for now, as we might revamp it
17648 and use it again (Bug#8435).
17649 * lisp.h (doprnt): Remove.
17650 * Makefile.in (base_obj): Remove doprnt.o.
17651 * deps.mk (doprnt.o): Remove.
17652
17653 error: Print 32- and 64-bit integers portably (Bug#8435).
17654 Without this change, on typical 64-bit hosts error ("...%d...", N)
17655 was used to print both 32- and 64-bit integers N, which relied on
17656 undefined behavior.
17657 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
17658 * lisp.h (error, verror): Mark as printf-like functions.
17659 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
17660 Report overflow in size calculations when allocating printf buffer.
17661 Do not truncate output string at its first null byte.
17662 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
17663 Truncate the output at a character boundary, since vsnprintf does not
17664 do that.
17665 * charset.c (check_iso_charset_parameter): Convert internal
17666 character to string before calling 'error', since %c now has the
17667 printf meaning.
17668 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
17669 overflow when computing char to be passed to 'error'. Do not
17670 pass Lisp_Object to 'error'; pass the integer instead.
17671 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
17672 formatted with plain %d.
17673
17674 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
17675
17676 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
17677
17678 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
17679
17680 * xterm.c (x_catch_errors): Remove duplicate declaration.
17681
17682 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
17683
17684 * xdisp.c, lisp.h (message_nolog): Remove; unused.
17685
17686 2011-04-10 Jim Meyering <meyering@redhat.com>
17687
17688 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
17689 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
17690 return ssize_t not "int", and use size_t as the buffer length.
17691 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
17692 * gnutls.h: Update declarations.
17693 * process.c (read_process_output): Use ssize_t, to match.
17694 (send_process): Likewise.
17695
17696 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17697
17698 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
17699
17700 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
17701
17702 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
17703 Use unsigned char, to match FcChar8 type definition.
17704
17705 * xterm.c (handle_one_xevent):
17706 * xmenu.c (create_and_show_popup_menu):
17707 * xselect.c (x_decline_selection_request)
17708 (x_reply_selection_request): Avoid type-punned deref of X events.
17709
17710 2011-04-09 Eli Zaretskii <eliz@gnu.org>
17711
17712 Fix some uses of `int' instead of EMACS_INT.
17713 * search.c (string_match_1, fast_string_match)
17714 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
17715 (scan_buffer, find_next_newline_no_quit)
17716 (find_before_next_newline, search_command, Freplace_match)
17717 (Fmatch_data): Make some `int' variables be EMACS_INT.
17718
17719 * xdisp.c (display_count_lines): 3rd argument and return value now
17720 EMACS_INT. All callers changed.
17721 (pint2hrstr): Last argument is now EMACS_INT.
17722
17723 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
17724 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
17725 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
17726 (decode_coding_utf_16, decode_coding_emacs_mule)
17727 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
17728 (decode_coding_ccl, decode_coding_charset)
17729 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
17730 (decode_coding_iso_2022, decode_coding_emacs_mule)
17731 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
17732 <char_offset, last_offset>: Declare EMACS_INT.
17733 (encode_coding_utf_8, encode_coding_utf_16)
17734 (encode_coding_emacs_mule, encode_invocation_designation)
17735 (encode_designation_at_bol, encode_coding_iso_2022)
17736 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
17737 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
17738 Declare EMACS_INT.
17739 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
17740 (encode_invocation_designation): Last argument P_NCHARS is now
17741 EMACS_INT.
17742 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
17743 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
17744
17745 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
17746 All users changed.
17747
17748 * ccl.c (Fccl_execute_on_string): Declare some variables
17749 EMACS_INT.
17750
17751 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
17752
17753 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
17754
17755 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
17756
17757 * process.c (Fformat_network_address): Doc fix.
17758
17759 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
17760
17761 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
17762
17763 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
17764
17765 * keyboard.c (read_char): Call Lisp function help-form-show,
17766 instead of using internal_with_output_to_temp_buffer.
17767 (Qhelp_form_show): New var.
17768 (syms_of_keyboard): Use DEFSYM macro.
17769
17770 * print.c (internal_with_output_to_temp_buffer): Function deleted.
17771
17772 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
17773
17774 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
17775
17776 * process.c (Flist_processes): Remove to Lisp.
17777 (list_processes_1): Delete.
17778
17779 2011-04-06 Eli Zaretskii <eliz@gnu.org>
17780
17781 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
17782
17783 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
17784
17785 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
17786
17787 Fix more problems found by GCC 4.6.0's static checks.
17788
17789 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
17790
17791 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
17792
17793 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
17794
17795 * xdisp.c (vmessage): Mark as a printf-like function.
17796
17797 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
17798
17799 * sound.c (sound_warning): Don't crash if arg contains a printf format.
17800
17801 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
17802 printf-like functions.
17803 (tiff_load): Add casts to remove these marks before passing them
17804 to system-supplied API.
17805
17806 * eval.c (Fsignal): Remove excess argument to 'fatal'.
17807
17808 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
17809 This avoids several warnings with gcc -Wstrict-overflow.
17810 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
17811 directly, rather than having caller test rule sign. This avoids
17812 some unnecessary tests.
17813 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
17814 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
17815 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
17816
17817 * xfont.c (xfont_text_extents): Remove var that was set but not used.
17818 (xfont_open): Avoid unnecessary tests.
17819
17820 * composite.c (composition_gstring_put_cache): Use unsigned integer.
17821
17822 * composite.h, composite.c (composition_gstring_put_cache):
17823 Use EMACS_INT, not int, for length.
17824
17825 * composite.h (COMPOSITION_DECODE_REFS): New macro,
17826 breaking out part of COMPOSITION_DECODE_RULE.
17827 (COMPOSITION_DECODE_RULE): Use it.
17828 * composite.c (get_composition_id): Remove unused local vars,
17829 by using the new macro.
17830
17831 * textprop.c (set_text_properties_1): Change while to do-while,
17832 since the condition is always true at first.
17833
17834 * intervals.c (graft_intervals_into_buffer): Mark var as used.
17835 (interval_deletion_adjustment): Return unsigned value.
17836 All uses changed.
17837
17838 * process.c (list_processes_1, create_pty, read_process_output):
17839 (exec_sentinel): Remove vars that were set but not used.
17840 (create_pty): Remove unnecessary "volatile"s.
17841 (Fnetwork_interface_info): Avoid possibility of int overflow.
17842 (read_process_output): Do adaptive read buffering even if carryover.
17843 (read_process_output): Simplify nbytes computation if buffered.
17844
17845 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
17846
17847 * syntax.c (scan_words): Remove var that was set but not used.
17848 (update_syntax_table): Use unsigned instead of int.
17849
17850 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
17851 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
17852 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
17853
17854 * print.c (print_error_message): Avoid int overflow.
17855
17856 * font.c (font_list_entities): Redo for clarity,
17857 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
17858
17859 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
17860 (font_score): Avoid potential overflow in diff calculation.
17861
17862 * fns.c (substring_both): Remove var that is set but not used.
17863 (sxhash): Redo loop for clarity and to avoid wraparound warning.
17864
17865 * eval.c (funcall_lambda): Rename local to avoid shadowing.
17866
17867 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
17868 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
17869 can always succeed if overflow has undefined behavior.
17870
17871 * search.c (boyer_moore, wordify): Remove vars set but not used.
17872 (wordify): Omit three unnecessary tests.
17873
17874 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
17875 All callers changed. This avoids the need for an unused var.
17876
17877 * casefiddle.c (casify_region): Remove var that is set but not used.
17878
17879 * dired.c (file_name_completion): Remove var that is set but not used.
17880
17881 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
17882
17883 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
17884 (Finsert_file_contents): Remove unnecessary code checking fd.
17885
17886 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
17887 Check for integer overflow on size calculations.
17888
17889 * buffer.c (Fprevious_overlay_change): Remove var that is set
17890 but not used.
17891
17892 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
17893 Remove vars that are set but not used.
17894 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
17895 (timer_check_2): Mark vars as initialized.
17896
17897 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
17898
17899 * image.c (lookup_image): Remove var that is set but not used.
17900 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
17901
17902 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
17903 that are set but not used.
17904
17905 * xfns.c (make_invisible_cursor): Don't return garbage
17906 if XCreateBitmapFromData fails (Bug#8410).
17907
17908 * xselect.c (x_get_local_selection, x_handle_property_notify):
17909 Remove vars that are set but not used.
17910
17911 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
17912 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
17913
17914 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
17915 Remove var that is set but not used.
17916 (scroll_bar_windows_size): Now size_t, not int.
17917 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
17918 Check for overflow.
17919
17920 * xfaces.c (realize_named_face): Remove vars that are set but not used.
17921 (map_tty_color) [!defined MSDOS]: Likewise.
17922
17923 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
17924
17925 * coding.c: Remove vars that are set but not used.
17926 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
17927 All callers changed.
17928 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
17929 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
17930 (decode_coding_charset): Remove vars that are set but not used.
17931
17932 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
17933 that is set but not used.
17934
17935 * print.c (print_object): Remove var that is set but not used.
17936
17937 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
17938 The gnulib version avoids calling malloc in the usual case,
17939 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
17940 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
17941 * filelock.c (current_lock_owner): Likewise.
17942 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
17943 * sysdep.c: Include allocator.h, careadlinkat.h.
17944 (emacs_no_realloc_allocator): New static constant.
17945 (emacs_readlink): New function.
17946 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
17947 ../lib/careadlinkat.h.
17948
17949 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
17950
17951 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
17952 first non-nil return value).
17953
17954 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
17955
17956 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
17957 if not defined (Bug#8403).
17958
17959 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17960
17961 * xdisp.c (display_count_lines): Remove parameter `start',
17962 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
17963 (get_char_face_and_encoding): Remove parameter `multibyte_p',
17964 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17965 (fill_stretch_glyph_string): Remove parameters `row' and `area',
17966 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
17967 and thereabouts. All callers changed.
17968 (get_per_char_metric): Remove parameter `f', unused since
17969 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
17970
17971 2011-04-02 Jim Meyering <meyering@redhat.com>
17972
17973 do not dereference NULL upon failed strdup
17974 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
17975 (ns_get_family): Likewise.
17976
17977 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
17978
17979 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
17980
17981 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
17982
17983 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
17984 later (Bug#8403).
17985
17986 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
17987
17988 Add lexical binding.
17989
17990 * window.c (Ftemp_output_buffer_show): New fun.
17991 (Fsave_window_excursion):
17992 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
17993
17994 * lread.c (lisp_file_lexically_bound_p): New function.
17995 (Fload): Bind Qlexical_binding.
17996 (readevalloop): Remove `evalfun' arg.
17997 Bind Qinternal_interpreter_environment.
17998 (Feval_buffer): Bind Qlexical_binding.
17999 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18000 Mark as dynamic.
18001 (syms_of_lread): Declare `lexical-binding'.
18002
18003 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18004
18005 * keyboard.c (eval_dyn): New fun.
18006 (menu_item_eval_property): Use it.
18007
18008 * image.c (parse_image_spec): Use Ffunctionp.
18009
18010 * fns.c (concat, mapcar1): Accept byte-code-functions.
18011
18012 * eval.c (Fsetq): Handle lexical vars.
18013 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18014 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18015 (FletX, Flet): Obey lexical binding.
18016 (Fcommandp): Handle closures.
18017 (Feval): New `lexical' arg.
18018 (eval_sub): New function extracted from Feval. Use it almost
18019 everywhere where Feval was used. Look up vars in lexical env.
18020 Handle closures.
18021 (Ffunctionp): Move from subr.el.
18022 (Ffuncall): Handle closures.
18023 (apply_lambda): Remove `eval_flags'.
18024 (funcall_lambda): Handle closures and new byte-code-functions.
18025 (Fspecial_variable_p): New function.
18026 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18027 but without exporting it to Lisp.
18028
18029 * doc.c (Fdocumentation, store_function_docstring):
18030 * data.c (Finteractive_form): Handle closures.
18031
18032 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18033 interactive spec.
18034
18035 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18036 New byte-codes.
18037 (exec_byte_code): New function extracted from Fbyte_code to handle new
18038 calling convention for byte-code-functions. Add new byte-codes.
18039
18040 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
18041
18042 * alloc.c (Fmake_symbol): Init new `declared_special' field.
18043
18044 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18045
18046 * xdisp.c (redisplay_internal): Fix prototype.
18047
18048 2011-03-31 Eli Zaretskii <eliz@gnu.org>
18049
18050 * xdisp.c (SCROLL_LIMIT): New macro.
18051 (try_scrolling): Use it when setting scroll_limit.
18052 Limit scrolling to 100 screen lines.
18053 (redisplay_window): Even when falling back on "recentering",
18054 position point in the window according to scroll-conservatively,
18055 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18056
18057 (try_scrolling): When point is above the window, allow searching
18058 as far as scroll_max, or one screenful, to compute vertical
18059 distance from PT to the scroll margin position. This prevents
18060 try_scrolling from unnecessarily failing when
18061 scroll-conservatively is set to a value slightly larger than the
18062 window height. Clean up the case of PT below the margin at bottom
18063 of window: scroll_max can no longer be INT_MAX. When aggressive
18064 scrolling is in use, don't let point enter the opposite scroll
18065 margin as result of the scroll.
18066 (syms_of_xdisp) <scroll-conservatively>: Document the
18067 threshold of 100 lines for never-recentering scrolling.
18068
18069 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
18070
18071 * dispextern.h (move_it_by_lines):
18072 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18073 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18074 (message_log_check_duplicate): Remove parameters `prev_bol' and
18075 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18076 (redisplay_internal): Remove parameter `preserve_echo_area',
18077 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18078
18079 * indent.c (Fvertical_motion):
18080 * window.c (window_scroll_pixel_based, Frecenter):
18081 Don't pass `need_y_p' to `move_it_by_lines'.
18082
18083 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18084
18085 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18086 steal a few bits to be more compact.
18087 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18088 Remove unneeded casts.
18089
18090 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18091
18092 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18093
18094 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18095 binding" message (bug#7967).
18096
18097 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18098
18099 Fix more problems found by GCC 4.6.0's static checks.
18100
18101 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18102 Remove unused local var.
18103
18104 * editfns.c (Fmessage_box): Remove unused local var.
18105
18106 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18107 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18108 Omit unused local vars.
18109 * window.c (shrink_windows): Omit unused local var.
18110 * menu.c (digest_single_submenu): Omit unused local var.
18111 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18112 Omit unused local var.
18113
18114 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18115 Don't assume string length fits in int.
18116 (keyremap_step, read_key_sequence): Use size_t for sizes.
18117 (read_key_sequence): Don't check last_real_key_start redundantly.
18118
18119 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18120 instead of alloca (Bug#8344).
18121
18122 * eval.c (Fbacktrace): Don't assume nargs fits in int.
18123 (Fbacktrace_frame): Don't assume nframes fits in int.
18124
18125 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18126
18127 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18128 concerns.
18129
18130 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18131
18132 * cm.c (calccost): Turn while-do into do-while, for clarity.
18133
18134 * keyboard.c (syms_of_keyboard): Use the same style as later
18135 in this function when indexing through an array. This also
18136 works around GCC bug 48267.
18137
18138 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18139
18140 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18141
18142 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18143 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18144
18145 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18146 This avoids undefined behavior on integer overflow, and is a bit
18147 more convenient anyway since it is compared to a size_t variable.
18148
18149 Variadic C functions now count arguments with size_t, not int.
18150 This avoids an unnecessary limitation on 64-bit machines, which
18151 caused (substring ...) to crash on large vectors (Bug#8344).
18152 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18153 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
18154 All variadic functions and their callers changed accordingly.
18155 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18156 * data.c (arith_driver, float_arith_driver): Likewise.
18157 * editfns.c (general_insert_function): Likewise.
18158 * eval.c (struct backtrace.nargs, interactive_p)
18159 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18160 (funcall_lambda, mark_backtrace): Likewise.
18161 * fns.c (concat): Likewise.
18162 * frame.c (x_set_frame_parameters): Likewise.
18163 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18164 0 if not found, not -1. All callers changed.
18165
18166 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18167 (stack_copy_size): Now size_t, not int.
18168 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18169
18170 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18171
18172 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18173 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18174 All callers changed.
18175
18176 * lisp.h (multibyte_char_to_unibyte):
18177 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18178 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18179 * character.h (CHAR_TO_BYTE8):
18180 * cmds.c (internal_self_insert):
18181 * editfns.c (general_insert_function):
18182 * keymap.c (push_key_description):
18183 * search.c (Freplace_match):
18184 * xdisp.c (message_dolog, set_message_1): All callers changed.
18185
18186 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18187
18188 * keyboard.c (safe_run_hook_funcall): New function.
18189 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18190 don't set the hook to nil, but remove the offending function instead.
18191 (Qcommand_hook_internal): Remove, unused.
18192 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18193 Vcommand_hook_internal.
18194
18195 * eval.c (enum run_hooks_condition): Remove.
18196 (funcall_nil, funcall_not): New functions.
18197 (run_hook_with_args): Call each function through a `funcall' argument.
18198 Remove `cond' argument, now redundant.
18199 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18200 (Frun_hook_with_args_until_failure): Adjust accordingly.
18201 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18202
18203 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
18204
18205 * dispextern.h (string_buffer_position): Remove declaration.
18206
18207 * print.c (strout): Remove parameter `multibyte', unused since
18208 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18209
18210 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18211 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18212 All callers changed.
18213
18214 * w32.c (_wsa_errlist): Use braces for struct initializers.
18215
18216 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18217 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18218 All callers changed.
18219 (string_buffer_position): Likewise. Also, make static (it's never
18220 used outside xdisp.c).
18221 (cursor_row_p): Remove parameter `w', unused since
18222 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18223 (decode_mode_spec): Remove parameter `precision', introduced during
18224 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18225 All callers changed.
18226
18227 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18228
18229 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18230
18231 2011-03-27 Anders Lindgren <andlind@gmail.com>
18232
18233 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18234 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18235 (ns_update_auto_hide_menu_bar): New functions.
18236 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18237 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18238 ns_constrain_all_frames.
18239 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18240 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18241
18242 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18243
18244 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18245
18246 2011-03-27 Glenn Morris <rgm@gnu.org>
18247
18248 * syssignal.h: Replace RETSIGTYPE with void.
18249 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18250 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18251 Replace SIGTYPE with void everywhere.
18252 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18253 * s/template.h (SIGTYPE): Remove commented out definition.
18254
18255 2011-03-26 Eli Zaretskii <eliz@gnu.org>
18256
18257 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18258 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18259
18260 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
18261
18262 * w32.c (read_unc_volume): Use parameter `henum', instead of
18263 global variable `wget_enum_handle'.
18264
18265 * keymap.c (describe_vector): Remove parameters `indices' and
18266 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18267 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18268
18269 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18270
18271 * keyboard.c (timer_check): Remove parameter `do_it_now',
18272 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18273 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18274 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18275
18276 * keyboard.c (read_char):
18277 * w32menu.c (w32_menu_display_help):
18278 * xmenu.c (show_help_event, menu_help_callback):
18279 Adjust calls to `show_help_echo'.
18280
18281 * gtkutil.c (xg_maybe_add_timer):
18282 * keyboard.c (readable_events):
18283 * process.c (wait_reading_process_output):
18284 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18285
18286 * insdel.c (adjust_markers_gap_motion):
18287 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18288 (gap_left, gap_right): Don't call it.
18289
18290 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
18291
18292 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18293 incurred during fontification.
18294
18295 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18296
18297 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18298 (DEFVAR_PER_BUFFER): Don't pass it.
18299
18300 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18301 (scrolling_window): Don't pass it.
18302
18303 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
18304
18305 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18306
18307 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18308 and `suffix'.
18309 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18310 of variables specific to SELinux and computation of `encoded_absname'.
18311
18312 * image.c (XPutPixel): Remove unused variable `height'.
18313
18314 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18315
18316 * unexw32.c (get_section_info): Remove unused variable `section'.
18317
18318 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18319 (system_process_attributes): Remove unused variable `sess'.
18320 (sys_read): Remove unused variable `err'.
18321
18322 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18323 (w32_wnd_proc): Remove unused variable `isdead'.
18324 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18325 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18326 (x_create_tip_frame): Remove unused variable `tem'.
18327
18328 * w32inevt.c (w32_console_read_socket):
18329 Remove unused variable `no_events'.
18330
18331 * w32term.c (x_draw_composite_glyph_string_foreground):
18332 Remove unused variable `width'.
18333
18334 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
18335
18336 * w32term.c (x_set_glyph_string_clipping):
18337 Don't pass uninitialized region to CombineRgn.
18338
18339 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
18340
18341 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18342 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18343 (Fx_close_connection): Remove unused variable `i'.
18344
18345 * w32font.c (w32font_draw): Return number of glyphs.
18346 (w32font_open_internal): Remove unused variable `i'.
18347 (w32font_driver): Add missing initializer.
18348
18349 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18350 (fill_in_menu): Remove unused variable `items_added'.
18351
18352 * w32term.c (last_mouse_press_frame): Remove static global variable.
18353 (w32_clip_to_row): Remove unused variable `f'.
18354 (x_delete_terminal): Remove unused variable `i'.
18355
18356 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18357 (NOTHING): Remove unused static global variable.
18358 (uniscribe_check_otf): Remove unused variable `table'.
18359 (uniscribe_font_driver): Add missing initializers.
18360
18361 2011-03-23 Julien Danjou <julien@danjou.info>
18362
18363 * term.c (Fsuspend_tty, Fresume_tty):
18364 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18365 * window.c (temp_output_buffer_show):
18366 * insdel.c (signal_before_change):
18367 * frame.c (Fhandle_switch_frame):
18368 * fileio.c (Fdo_auto_save):
18369 * emacs.c (Fkill_emacs):
18370 * editfns.c (save_excursion_restore):
18371 * cmds.c (internal_self_insert):
18372 * callint.c (Fcall_interactively):
18373 * buffer.c (Fkill_all_local_variables):
18374 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18375 Use Frun_hooks.
18376 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
18377 unconditionally since it does the check itself.
18378
18379 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
18380
18381 Fix more problems found by GCC 4.5.2's static checks.
18382
18383 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18384 the first time through the loop, since we know p0 < p1 then.
18385 This also avoids a gcc -Wstrict-overflow warning.
18386
18387 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18388 leading to a memory leak, possible in functions like
18389 load_charset_map_from_file that can allocate an unbounded number
18390 of objects (Bug#8318).
18391
18392 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18393 that could (at least in theory) be that large.
18394
18395 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18396 This is less likely to overflow, and avoids undefined behavior if
18397 overflow does occur. All callers changed. Use strtoul to scan
18398 for the unsigned long integer.
18399 (pint2hrstr): Simplify and tune code slightly.
18400 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
18401
18402 * scroll.c (do_scrolling): Work around GCC bug 48228.
18403 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18404
18405 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18406 This also avoids a warning with gcc -Wstrict-overflow.
18407 (validate_x_resource_name): Simplify count usage.
18408 This also avoids a warning with gcc -Wstrict-overflow.
18409
18410 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18411 fail (Bug#8306).
18412
18413 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
18414
18415 * process.c (Fmake_network_process): Use socklen_t, not int,
18416 where POSIX says socklen_t is required in portable programs.
18417 This fixes a porting bug on hosts like 64-bit HP-UX, where
18418 socklen_t is wider than int (Bug#8277).
18419 (Fmake_network_process, server_accept_connection):
18420 (wait_reading_process_output, read_process_output):
18421 Likewise.
18422
18423 * process.c: Rename or move locals to avoid shadowing.
18424 (list_processes_1, Fmake_network_process):
18425 (read_process_output_error_handler, exec_sentinel_error_handler):
18426 Rename or move locals.
18427 (Fmake_network_process): Define label "retry_connect" only if needed.
18428 (Fnetwork_interface_info): Fix pointer signedness.
18429 (process_send_signal): Add cast to avoid pointer signedness problem.
18430 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
18431 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
18432
18433 Make tparam.h and terminfo.c consistent.
18434 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18435 Include tparam.h instead, since it declares them.
18436 * cm.h (PC): Remove extern decl; tparam.h now does this.
18437 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18438 * terminfo.c: Include tparam.h, to check interfaces.
18439 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18440 (tparam): Adjust signature to match interface in tparam.h;
18441 this removes some undefined behavior. Check that outstring and len
18442 are zero, which they always are with Emacs.
18443 * tparam.h (PC, BC, UP): New extern decls.
18444
18445 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
18446 (xftfont_open): Rename locals to avoid shadowing.
18447
18448 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
18449 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18450 (OTF_TAG_SYM): Omit macro if not needed.
18451 (ftfont_list): Remove unused local.
18452 (get_adstyle_property, ftfont_pattern_entity):
18453 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18454 Rename locals to avoid shadowing.
18455
18456 * xfont.c (xfont_list_family): Mark var as initialized.
18457
18458 * xml.c (make_dom): Now static.
18459
18460 * composite.c (composition_compute_stop_pos): Rename local to
18461 avoid shadowing.
18462 (composition_reseat_it): Remove unused locals.
18463 (find_automatic_composition, composition_adjust_point): Likewise.
18464 (composition_update_it): Mark var as initialized.
18465 (find_automatic_composition): Mark vars as initialized,
18466 with a FIXME (Bug#8290).
18467
18468 character.h: Rename locals to avoid shadowing.
18469 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18470 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18471 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18472 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18473 to avoid shadowing.
18474
18475 * textprop.c (property_change_between_p): Remove; unused.
18476
18477 * intervals.c (interval_start_pos): Now static.
18478
18479 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18480
18481 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18482 Rename locals to avoid shadowing.
18483
18484 * sound.c (wav_play, au_play, Fplay_sound_internal):
18485 Fix pointer signedness.
18486 (alsa_choose_format): Remove unused local var.
18487 (wav_play): Initialize a variable to 0, to prevent undefined
18488 behavior (Bug#8278).
18489
18490 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18491
18492 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18493
18494 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18495 clobbering (Bug#8298).
18496 * sysdep.c (sys_subshell): Likewise.
18497 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
18498
18499 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18500 This should get cleaned up, so that child_setup has the
18501 same signature on all platforms.
18502
18503 * callproc.c (call_process_cleanup): Now static.
18504 (relocate_fd): Rename locals to avoid shadowing.
18505
18506 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
18507
18508 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18509 not to be necessary, and produces flickering.
18510
18511 2011-03-20 Glenn Morris <rgm@gnu.org>
18512
18513 * config.in: Remove file.
18514
18515 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
18516
18517 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18518 are now in src/globals.h.
18519 (syms_of_minibuf): Remove spurious & from previous change.
18520
18521 2011-03-20 Leo Liu <sdl.web@gmail.com>
18522
18523 * minibuf.c (completing-read-function): New variable.
18524 (completing-read-default): Rename from completing-read.
18525 (completing-read): Call completing-read-function.
18526
18527 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18528
18529 * xfaces.c (Fx_load_color_file):
18530 Read color file from absolute filename (bug#8250).
18531
18532 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
18533
18534 * makefile.w32-in: Update dependencies.
18535
18536 2011-03-17 Eli Zaretskii <eliz@gnu.org>
18537
18538 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18539
18540 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18541
18542 Fix more problems found by GCC 4.5.2's static checks.
18543
18544 * process.c (make_serial_process_unwind, send_process_trap):
18545 (sigchld_handler): Now static.
18546
18547 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18548 That way, the code declares only the vars that it needs.
18549 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18550 * s/cygwin.h (PTY_ITERATION): Likewise.
18551 * s/darwin.h (PTY_ITERATION): Likewise.
18552 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18553
18554 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18555 * process.c (allocate_pty): Don't declare stb unless it's needed.
18556
18557 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
18558 (CONSTANTLIM): Remove; unused.
18559 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18560 Define only if needed.
18561
18562 * unexelf.c (unexec): Name an expression,
18563 to avoid gcc -Wbad-function-cast warning.
18564 Use a different way to cause a compilation error if anyone uses
18565 n rather than nn, a way that does not involve shadowing.
18566 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
18567
18568 * deps.mk (unexalpha.o): Remove; unused.
18569
18570 New file unexec.h, the (simple) interface for unexec (Bug#8267).
18571 * unexec.h: New file.
18572 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
18573 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
18574 Depend on unexec.h.
18575 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
18576 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
18577 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
18578 Change as necessary to match prototype in unexec.h.
18579
18580 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
18581 shadowing.
18582 (back_comment, skip_chars): Mark vars as initialized.
18583
18584 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
18585 Rename locals to avoid shadowing.
18586
18587 * lread.c (read1): Rewrite so as not to use empty "else".
18588 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
18589
18590 * print.c (Fredirect_debugging_output): Fix pointer signedess.
18591
18592 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
18593 warning when compiling print.c.
18594
18595 * font.c (font_unparse_fcname): Abort in an "impossible" situation
18596 instead of using an uninitialized var.
18597 (font_sort_entities): Mark var as initialized.
18598
18599 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
18600
18601 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
18602 pointers to constants.
18603 (font_parse_fcname): Remove unused vars.
18604 (font_delete_unmatched): Now static.
18605 (font_get_spec): Remove; unused.
18606 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
18607 (font_update_drivers, Ffont_get_glyphs, font_add_log):
18608 Rename or move locals to avoid shadowing.
18609
18610 * fns.c (require_nesting_list, require_unwind): Now static.
18611 (Ffillarray): Rename locals to avoid shadowing.
18612
18613 * floatfns.c (domain_error2): Define only if needed.
18614 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
18615
18616 * alloc.c (mark_backtrace): Move decl from here ...
18617 * lisp.h: ... to here, so that it can be checked.
18618
18619 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
18620 (Fdefvar): Rewrite so as not to use empty "else".
18621 (lisp_indirect_variable): Name an expression,
18622 to avoid gcc -Wbad-function-cast warning.
18623 (Fdefvar): Rename locals to avoid shadowing.
18624
18625 * callint.c (quotify_arg, quotify_args): Now static.
18626 (Fcall_interactively): Rename locals to avoid shadowing.
18627 Use const pointer when appropriate.
18628
18629 * lisp.h (get_system_name, get_operating_system_release):
18630 Move decls here, to check interfaces.
18631 * process.c (get_operating_system_release): Move decl to lisp.h.
18632 * xrdb.c (get_system_name): Likewise.
18633 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
18634 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
18635 some of which prompt warnings from gcc -Wbad-function-cast.
18636 (Fformat_time_string, Fencode_time, Finsert_char):
18637 (Ftranslate_region_internal, Fformat):
18638 Rename or remove local vars to avoid shadowing.
18639 (Ftranslate_region_internal): Mark var as initialized.
18640
18641 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
18642 avoid shadowing.
18643
18644 * lisp.h (eassert): Check that the argument compiles, even if
18645 ENABLE_CHECKING is not defined.
18646
18647 * data.c (Findirect_variable): Name an expression, to avoid
18648 gcc -Wbad-function-cast warning.
18649 (default_value, arithcompare, arith_driver, arith_error): Now static.
18650 (store_symval_forwarding): Rename local to avoid shadowing.
18651 (Fmake_variable_buffer_local, Fmake_local_variable):
18652 Mark variables as initialized.
18653 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
18654
18655 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
18656 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
18657 Rename locals to avoid shadowing.
18658 (mark_stack): Move local variables into the #ifdef region where
18659 they're used.
18660 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
18661 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
18662 needed otherwise.
18663 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
18664 (GC_STRING_CHARS): Remove; not used.
18665 (Fmemory_limit): Cast sbrk's returned value to char *.
18666
18667 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
18668 avoids undefined behavior in theory.
18669
18670 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
18671
18672 Use functions, not macros, for up- and down-casing (Bug#8254).
18673 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18674 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
18675 to use the following functions instead of these macros.
18676 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
18677 EMACS_INT, since callers assume the returned value fits in int.
18678 (upcase1): Likewise, for UPCASE_TABLE.
18679 (uppercasep, lowercasep, upcase): New static inline functions.
18680 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
18681 the race-condition problem in the old DOWNCASE.
18682
18683 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
18684 Rename locals to avoid shadowing.
18685 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
18686 (regex_compile, re_search_2, re_match_2_internal):
18687 Remove unused local vars.
18688 (FREE_VAR): Rewrite so as not to use empty "else",
18689 which gcc can warn about.
18690 (regex_compile, re_match_2_internal): Mark locals as initialized.
18691 (RETALLOC_IF): Define only if needed.
18692 (WORDCHAR_P): Likewise. This one is never needed, but is used
18693 only in a comment talking about a compiler bug, so put inside
18694 the #if 0 of that comment.
18695 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
18696 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
18697 Remove; unused.
18698
18699 * search.c (boyer_moore): Rename locals to avoid shadowing.
18700 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
18701 (PREV_CHAR_BOUNDARY): Likewise.
18702
18703 * search.c (simple_search): Remove unused var.
18704
18705 * dired.c (compile_pattern): Move decl from here ...
18706 * lisp.h: ... to here, so that it can be checked.
18707 (struct re_registers): New forward decl.
18708
18709 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
18710
18711 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
18712 All uses changed.
18713 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
18714 Rename locals to avoid shadowing.
18715 (Fvertical_motion): Mark locals as initialized.
18716
18717 * casefiddle.c (casify_object, casify_region): Now static.
18718 (casify_region): Mark local as initialized.
18719
18720 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
18721
18722 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
18723 New macros, so that the caller can use some names other than
18724 gcpro1, gcpro2, etc.
18725 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
18726 of the new macros.
18727 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
18728 argument, for consistency with GCPRO2_VAR, etc: it is now the
18729 prefix of the variable, not the variable itself. All uses
18730 changed.
18731 * dired.c (directory_files_internal, file_name_completion):
18732 Rename locals to avoid shadowing.
18733
18734 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
18735 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
18736 dired.c's scmp function, had undefined behavior.
18737 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
18738 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
18739 * buffer.h: ... to here, because these macros use current_buffer,
18740 and the new implementation with inline functions needs to have
18741 current_buffer in scope now, rather than later when the macros
18742 are used.
18743 (downcase, upcase1): New static inline functions.
18744 (DOWNCASE, UPCASE1): Reimplement using these functions.
18745 This avoids undefined behavior in expressions like
18746 DOWNCASE (x) == DOWNCASE (y), which previously suffered
18747 from race conditions in accessing the global variables
18748 case_temp1 and case_temp2.
18749 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
18750 * lisp.h (case_temp1, case_temp2): Remove their decls.
18751 * character.h (ASCII_CHAR_P): Move from here ...
18752 * lisp.h: ... to here, so that the inline functions mentioned
18753 above can use them.
18754
18755 * dired.c (directory_files_internal_unwind): Now static.
18756
18757 * fileio.c (file_name_as_directory, directory_file_name):
18758 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
18759 Now static.
18760 (file_name_as_directory): Use const pointers when appropriate.
18761 (Fexpand_file_name): Likewise. In particular, newdir might
18762 point at constant storage, so make it a const pointer.
18763 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
18764 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
18765 signedness issues.
18766 (Fset_file_times, Finsert_file_contents, auto_save_error):
18767 Rename locals to avoid shadowing.
18768
18769 * minibuf.c (choose_minibuf_frame_1): Now static.
18770 (Ftry_completion, Fall_completions): Rename or remove locals
18771 to avoid shadowing.
18772
18773 * marker.c (bytepos_to_charpos): Remove; unused.
18774
18775 * lisp.h (verify_bytepos, count_markers): New decls,
18776 so that gcc does not warn that these functions aren't declared.
18777
18778 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
18779 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
18780 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
18781 (copy_text): Remove unused local var.
18782
18783 * filelock.c (within_one_second): Now static.
18784 (lock_file_1): Rename local to avoid shadowing.
18785
18786 * buffer.c (fix_overlays_before): Mark locals as initialized.
18787 (fix_start_end_in_overlays): Likewise. This function should be
18788 simplified by using pointers-to-pointers, but that's a different
18789 matter.
18790 (switch_to_buffer_1): Now static.
18791 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
18792 (report_overlay_modification): Rename locals to avoid shadowing.
18793
18794 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
18795 Fix pointer signedness issue.
18796 (sys_subshell): Mark local as volatile if checking for lint,
18797 to suppress a gcc -Wclobbered warning that does not seem to be right.
18798 (MAXPATHLEN): Define only if needed.
18799
18800 * process.c (serial_open, serial_configure): Move decls from here ...
18801 * systty.h: ... to here, so that they can be checked.
18802
18803 * fns.c (get_random, seed_random): Move extern decls from here ...
18804 * lisp.h: ... to here, so that they can be checked.
18805
18806 * sysdep.c (reset_io): Now static.
18807 (wait_for_termination_signal): Remove; unused.
18808
18809 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
18810 (copy_keymap_item, append_key, push_text_char_description):
18811 Now static.
18812 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
18813 (DENSE_TABLE_SIZE): Remove; unused.
18814 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
18815 (describe_map_tree):
18816 Rename locals to avoid shadowing.
18817
18818 * keyboard.c: Declare functions static if they are not used elsewhere.
18819 (echo_char, echo_dash, cmd_error, top_level_2):
18820 (poll_for_input, handle_async_input): Now static.
18821 (read_char, kbd_buffer_get_event, make_lispy_position):
18822 (make_lispy_event, make_lispy_movement, apply_modifiers):
18823 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
18824 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
18825 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
18826 (read_key_sequence, read_char): Mark locals as initialized.
18827 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
18828
18829 * keyboard.h (make_ctrl_char): New decl.
18830 (mark_kboards): Move decl here ...
18831 * alloc.c (mark_kboards): ... from here.
18832
18833 * lisp.h (force_auto_save_soon): New decl.
18834
18835 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
18836 (DEFINE_DUMMY_FUNCTION): New macro.
18837 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
18838 Use it.
18839 (main): Add casts to avoid warnings
18840 if GCC considers string literals to be constants.
18841
18842 * lisp.h (fatal_error_signal): Add decl, since it's exported.
18843
18844 * dbusbind.c: Pointer signedness fixes.
18845 (xd_signature, xd_append_arg, xd_initialize):
18846 (Fdbus_call_method, Fdbus_call_method_asynchronously):
18847 (Fdbus_method_return_internal, Fdbus_method_error_internal):
18848 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
18849 (Fdbus_register_signal): Use SSDATA when the context wants char *.
18850
18851 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
18852 if GCC considers string literals to be constants.
18853 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
18854
18855 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
18856
18857 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
18858 (print_preprocess, print_object): New macro to fix last change.
18859
18860 * print.c (print_preprocess): Don't forget font objects.
18861
18862 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
18863
18864 * emacs.c (USAGE3): Doc fixes.
18865
18866 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
18867
18868 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
18869 structure.
18870
18871 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
18872
18873 * lisp.h (VWindow_system, Qfile_name_history):
18874 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
18875 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
18876 (w32_system_caret_x, w32_system_caret_y): Declare extern.
18877
18878 * w32select.c: Don't #include "keyboard.h".
18879 (run_protected): Add extern declaration for waiting_for_input.
18880
18881 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
18882 * w32console.c (detect_input_pending, read_input_pending)
18883 (encode_terminal_code):
18884 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
18885 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
18886 (w32_system_caret_y, Qfile_name_history):
18887 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
18888 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
18889 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
18890 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
18891 * w32proc.c (Qlocal, report_file_error):
18892 * w32term.c (Vwindow_system, updating_frame):
18893 * w32uniscribe.c (initialized, uniscribe_font_driver):
18894 Remove unneeded extern declarations.
18895
18896 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
18897
18898 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
18899
18900 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
18901
18902 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
18903 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
18904 These macros can no longer be used for assignment.
18905
18906 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
18907 Assign struct members directly, instead of using BUF_BEGV etc.
18908 (record_buffer_markers, fetch_buffer_markers): New functions for
18909 recording and fetching special buffer markers.
18910 (set_buffer_internal_1, set_buffer_temp): Use them.
18911
18912 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
18913
18914 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
18915
18916 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
18917 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
18918
18919 * xdisp.c (hscroll_window_tree):
18920 (reconsider_clip_changes): Use PT instead of BUF_PT.
18921
18922 2011-03-13 Eli Zaretskii <eliz@gnu.org>
18923
18924 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
18925 $(EMACS_ROOT)/lib/intprops.h.
18926
18927 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
18928
18929 Fix more problems found by GCC 4.5.2's static checks.
18930
18931 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
18932 to unsigned char * to avoid compiler diagnostic.
18933 (xg_free_frame_widgets): Make it clear that a local variable is
18934 needed only if USE_GTK_TOOLTIP.
18935 (gdk_window_get_screen): Make it clear that this macro is needed
18936 only if USE_GTK_TOOLTIP.
18937 (int_gtk_range_get_value): New function, which avoids a diagnostic
18938 from gcc -Wbad-function-cast.
18939 (xg_set_toolkit_scroll_bar_thumb): Use it.
18940 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
18941 diagnostic from gcc -Wbad-function-cast.
18942 (get_utf8_string, xg_get_file_with_chooser):
18943 Rename locals to avoid shadowing.
18944 (create_dialog): Move locals to avoid shadowing.
18945
18946 * xgselect.c (xg_select): Remove unused var.
18947
18948 * image.c (four_corners_best): Mark locals as initialized.
18949 (gif_load): Initialize transparent_p to zero (Bug#8238).
18950 Mark another local as initialized.
18951 (my_png_error, my_error_exit): Mark with NO_RETURN.
18952
18953 * image.c (clear_image_cache): Now static.
18954 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
18955 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
18956 (x_edge_detection): Remove unnecessary cast that
18957 gcc -Wbad-function-cast diagnoses.
18958 (gif_load): Fix pointer signedness.
18959 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
18960 (jpeg_load, gif_load): Rename locals to avoid shadowing.
18961
18962 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
18963
18964 Improve quality of tests for time stamp overflow.
18965 For example, without this patch (encode-time 0 0 0 1 1
18966 1152921504606846976) returns the obviously-bogus value (-948597
18967 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
18968 reports time overflow. See
18969 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
18970 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
18971 * editfns.c: Include limits.h and intprops.h.
18972 (TIME_T_MIN, TIME_T_MAX): New macros.
18973 (time_overflow): Move earlier, to before first use.
18974 (hi_time, lo_time): New functions, for an accurate test for
18975 out-of-range times.
18976 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
18977 (Fget_internal_run_time): Don't assume time_t fits in int.
18978 (make_time): Use list2 instead of Fcons twice.
18979 (Fdecode_time): More accurate test for out-of-range times.
18980 (check_tm_member): New function.
18981 (Fencode_time): Use it, to test for out-of-range times.
18982 (lisp_time_argument): Don't rely on undefined left-shift and
18983 right-shift behavior when checking for time stamp overflow.
18984
18985 * editfns.c (time_overflow): New function, refactoring common code.
18986 (Fformat_time_string, Fdecode_time, Fencode_time):
18987 (Fcurrent_time_string): Use it.
18988
18989 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
18990 * dired.c (make_time): Move to ...
18991 * editfns.c (make_time): ... here.
18992 * systime.h: Note the move.
18993
18994 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
18995
18996 * fringe.c (update_window_fringes): Remove unused variables.
18997
18998 * unexmacosx.c (copy_data_segment): Also copy __got section.
18999 (Bug#8223)
19000
19001 2011-03-12 Eli Zaretskii <eliz@gnu.org>
19002
19003 * termcap.c [MSDOS]: Include "msdos.h".
19004 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19005 Constify `char *' arguments and their references according to
19006 prototypes in tparam.h.
19007
19008 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
19009
19010 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19011 Adapt all references accordingly.
19012
19013 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19014
19015 2011-03-11 Tom Tromey <tromey@redhat.com>
19016
19017 * buffer.c (syms_of_buffer): Remove obsolete comment.
19018
19019 2011-03-11 Eli Zaretskii <eliz@gnu.org>
19020
19021 * termhooks.h (encode_terminal_code): Declare prototype.
19022
19023 * msdos.c (encode_terminal_code): Don't declare prototype.
19024
19025 * term.c (encode_terminal_code): Now external again, used by
19026 w32console.c and msdos.c.
19027
19028 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19029 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
19030
19031 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
19032
19033 Fix some minor problems found by GCC 4.5.2's static checks.
19034
19035 * fringe.c (update_window_fringes): Mark locals as initialized
19036 (Bug#8227).
19037 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
19038
19039 * alloc.c (mark_fringe_data): Move decl from here ...
19040 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19041 to check its interface.
19042 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19043
19044 * fontset.c (free_realized_fontset): Now static.
19045 (Fset_fontset_font): Rename local to avoid shadowing.
19046 (fontset_font): Mark local as initialized.
19047 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
19048
19049 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19050
19051 * xselect.c (x_disown_buffer_selections): Remove; not used.
19052 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
19053 (x_own_selection, Fx_disown_selection_internal): Rename locals
19054 to avoid shadowing.
19055 (x_handle_dnd_message): Remove local to avoid shadowing.
19056
19057 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19058 so that the caller can use some name other than gcpro1.
19059 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
19060 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19061 (Fx_backspace_delete_keys_p):
19062 Use them to avoid shadowing, and rename vars to avoid shadowing.
19063 (x_decode_color, x_set_name, x_window): Now static.
19064 (Fx_create_frame): Add braces to silence GCC warning.
19065 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
19066 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19067 Remove unused locals.
19068 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19069 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19070 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19071 macros.
19072
19073 * xterm.h (x_mouse_leave): New decl.
19074
19075 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19076 Remove unused functions.
19077 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19078 (x_calc_absolute_position): Now static.
19079 (XTread_socket): Don't define label "out" unless it's used.
19080 Don't declare local "event" unless it's used.
19081 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19082 unless they are used.
19083 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19084 (x_fatal_error_signal): Remove; not used.
19085 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19086 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19087 (x_error_catcher, x_connection_closed, x_error_handler):
19088 (x_error_quitter, xembed_send_message, x_iconify_frame):
19089 (my_log_handler): Rename locals to avoid shadowing.
19090 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
19091 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
19092
19093 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19094 Rename or move locals to avoid shadowing.
19095 (tty_defined_color, merge_face_heights): Now static.
19096 (free_realized_faces_for_fontset): Remove; not used.
19097 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19098 does not deduce is never used uninitialized.
19099 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19100 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
19101
19102 * terminal.c (store_terminal_param): Now static.
19103
19104 * xmenu.c (menu_highlight_callback): Now static.
19105 (set_frame_menubar): Remove unused local.
19106 (xmenu_show): Rename parameter to avoid shadowing.
19107 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19108 since they might point to immutable storage.
19109 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19110 since it's unused otherwise.
19111
19112 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
19113 Add a FIXME, since the code still doesn't look right. (Bug#8215)
19114 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19115 avoids a gcc -Wuninitialized diagnostic.
19116 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
19117 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19118 does not deduce are never used uninitialized.
19119
19120 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19121
19122 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
19123 * window.c (window_loop, size_window):
19124 (run_window_configuration_change_hook, enlarge_window): Likewise.
19125
19126 * window.c (display_buffer): Now static.
19127 (size_window): Mark variables that gcc -Wuninitialized
19128 does not deduce are never used uninitialized.
19129 * window.h (check_all_windows): New decl, to forestall
19130 gcc -Wmissing-prototypes diagnostic.
19131 * dispextern.h (bidi_dump_cached_states): Likewise.
19132
19133 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19134 shadowing.
19135 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
19136 Include <limits.h>.
19137 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19138 and to avoid gcc -Wuninitialized warning.
19139 (load_charset_map): Mark variables that gcc -Wuninitialized
19140 does not deduce are never used uninitialized.
19141 (load_charset): Abort instead of using uninitialized var (Bug#8229).
19142
19143 * coding.c (coding_set_source, coding_set_destination):
19144 Use "else { /* comment */ }" rather than "else /* comment */;"
19145 for clarity, and to avoid gcc -Wempty-body warning.
19146 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19147 a block, when the outer 'i' will do.
19148 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19149 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19150 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19151 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19152 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19153 Rename locals to avoid shadowing.
19154 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
19155 * coding.c (emacs_mule_char, encode_invocation_designation):
19156 Now static, since they're not used elsewhere.
19157 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
19158 (decode_coding_object, encode_coding_object, detect_coding_system):
19159 (decode_coding_emacs_mule): Mark variables that gcc
19160 -Wuninitialized does not deduce are never used uninitialized.
19161 (detect_coding_iso_2022): Initialize a local variable that might
19162 be used uninitialized. Leave a FIXME because it's not clear that
19163 this initialization is needed. (Bug#8211)
19164 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19165 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19166 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19167 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19168 Remove unused macros.
19169
19170 * category.c (hash_get_category_set): Remove unused local var.
19171 (copy_category_table): Now static, since it's not used elsewhere.
19172 * character.c (string_count_byte8): Likewise.
19173
19174 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19175 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19176
19177 * chartab.c (copy_sub_char_table): Now static, since it's not used
19178 elsewhere.
19179 (sub_char_table_ref_and_range, char_table_ref_and_range):
19180 Rename locals to avoid shadowing.
19181 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
19182
19183 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
19184 (BIDI_BOB): Remove unused macro.
19185
19186 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19187 deduce are never used uninitialized.
19188 * term.c (encode_terminal_code): Likewise.
19189
19190 * term.c (encode_terminal_code): Now static. Remove unused local.
19191
19192 * tparam.h: New file.
19193 * term.c, tparam.h: Include it.
19194 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19195 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19196 Move these decls to tparam.h, and make them agree with what
19197 is actually in tparam.c. The previous trick of using incompatible
19198 decls in different modules does not conform to the C standard.
19199 All callers of tparam changed to use tparam's actual API.
19200 * tparam.c (tparam1, tparam, tgoto):
19201 Use const pointers where appropriate.
19202
19203 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19204 * cm.h (struct cm): Likewise.
19205 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19206 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19207 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19208 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19209 (turn_on_face, init_tty): Likewise.
19210 * termchar.h (struct tty_display_info): Likewise.
19211
19212 * term.c (term_mouse_position): Rename local to avoid shadowing.
19213
19214 * alloc.c (mark_ttys): Move decl from here ...
19215 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19216
19217 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19218
19219 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19220
19221 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
19222
19223 * search.c (compile_pattern_1): Remove argument regp, unused since
19224 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19225 (compile_pattern): Don't pass it.
19226
19227 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19228
19229 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19230 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19231 for ! HAVE_GTK3.
19232 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19233
19234 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19235
19236 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19237 gdk_window_get_screen, gdk_window_get_geometry,
19238 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19239 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19240 (xg_get_pixbuf_from_pixmap): New function.
19241 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19242 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19243 Call xg_get_pixbuf_from_pixmap instead of
19244 gdk_pixbuf_get_from_drawable.
19245 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19246 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19247 (xg_check_special_colors): Use GtkStyleContext and its functions
19248 for HAVE_GTK3.
19249 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19250 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19251 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
19252 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19253 Call gtk_widget_get_preferred_size.
19254 (xg_frame_resized): gdk_window_get_geometry only takes 5
19255 parameters.
19256 (xg_win_to_widget, xg_event_is_for_menubar):
19257 Call gdk_x11_window_lookup_for_display.
19258 (xg_set_widget_bg): New function.
19259 (delete_cb): New function.
19260 (xg_create_frame_widgets): Connect delete-event to delete_cb.
19261 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
19262 (xg_set_background_color): Call xg_set_widget_bg.
19263 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19264 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19265 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19266 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19267 if ! HAVE_GTK3.
19268 (update_frame_tool_bar): Call gtk_widget_hide.
19269 (xg_initialize): Use GDK_KEY_g.
19270
19271 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19272 if ! HAVE_GTK3
19273 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19274
19275 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19276 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19277 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19278
19279 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
19280
19281 * w32xfns.c (select_palette): Check success of RealizePalette against
19282 GDI_ERROR, not zero.
19283
19284 See ChangeLog.11 for earlier changes.
19285
19286 ;; Local Variables:
19287 ;; coding: utf-8
19288 ;; End:
19289
19290 Copyright (C) 2011-2012 Free Software Foundation, Inc.
19291
19292 This file is part of GNU Emacs.
19293
19294 GNU Emacs is free software: you can redistribute it and/or modify
19295 it under the terms of the GNU General Public License as published by
19296 the Free Software Foundation, either version 3 of the License, or
19297 (at your option) any later version.
19298
19299 GNU Emacs is distributed in the hope that it will be useful,
19300 but WITHOUT ANY WARRANTY; without even the implied warranty of
19301 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19302 GNU General Public License for more details.
19303
19304 You should have received a copy of the GNU General Public License
19305 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.