* lisp/autorevert.el (auto-revert-notify-handler): Use memq.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
55577e7c
SM
12013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * lisp.mk (lisp): Add prog-mode.el.
4
f019a684
PE
52013-06-05 Paul Eggert <eggert@cs.ucla.edu>
6
7 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
8 * process.c (dummy_handler): New function.
9 (lib_child_handler): New static var.
10 (handle_child_signal): Invoke it.
11 (catch_child_signal): If a library has set up a signal handler,
12 save it into lib_child_handler.
13 (init_process_emacs): If using glib and not on Windows, tickle glib's
14 child-handling code so that it initializes its private SIGCHLD handler.
15 * syssignal.h (SA_SIGINFO): Default to 0.
16 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
17 31; it should no longer be needed now.
18
90db8702
MA
192013-06-05 Michael Albinus <michael.albinus@gmx.de>
20
21 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
22
23 * gfilenotify.c (globals_of_gfilenotify): New function.
24 (syms_of_gfilenotify): Move global initialization there.
25
26 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
27
bfa3acd6
SM
282013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
29
30 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
31 * keyboard.c (menu_bar_items, tool_bar_items):
32 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
33 not override local keymaps any more.
34
ba59bd80
EZ
352013-06-04 Eli Zaretskii <eliz@gnu.org>
36
37 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
38
7f203aa1
EZ
392013-06-03 Eli Zaretskii <eliz@gnu.org>
40
9337e206
EZ
41 * w32console.c (initialize_w32_display): Return the dimensions of
42 the console window via 2 additional arguments, not via the current
43 frame. This avoids crashes due to overrunning the bounds of
44 frame's decode_mode_spec_buffer, which is not resized following
45 the change of the frame dimensions from the initial 10x10.
46
47 * w32term.h (w32_initialize_display_info): Adjust prototype.
48
49 * term.c (init_tty): Take dimensions of the frame from the values
50 returned by initialize_w32_display.
51
7f203aa1
EZ
52 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
53 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
54 (LIBES): Add $(GFILENOTIFY_LIBS).
55
56 * w32inevt.c (handle_file_notifications): Add dummy implementation
57 for !HAVE_W32NOTIFY.
58
59 * w32term.c: Wrap code with HAVE_W32NOTIFY.
60
55a87246
JD
612013-06-03 Jan Djärv <jan.h.d@swipnet.se>
62
63 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
64
65 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
66
67 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
68
3d5ee10a
PE
692013-06-03 Paul Eggert <eggert@cs.ucla.edu>
70
71 Fix minor problems found by static checking.
72 * data.c (pure_write_error):
73 Use xsignal2, not Fsignal, as Fsignal might return.
74 * eval.c (set_backtrace_debug_on_exit): Now static.
75 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
76 No longer inline. EXTERN_INLINE is needed only for functions
77 defined in .h files. Reindent function header as per GNU style.
78 (backtrace_p, backtrace_top, backtrace_next):
79 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
80 compiler or linker. Add extern decls to pacify gcc -Wall.
81 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
82 Now static.
83 * frame.c (free_monitors): Define only on platforms that need it.
84 * nsterm.m (ns_term_init):
85 * process.c (catch_child_signal):
86 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
87 defined on all porting targets these days.
88 * process.c, process.h (catch_child_signal):
89 Make it extern only if NS_IMPL_GNUSTEP is defined.
90
e2d8a6f0
EZ
912013-06-03 Eli Zaretskii <eliz@gnu.org>
92
93 * w32.c (gettimeofday): Make the signature identical to prototype
94 in nt/inc/sys/time.h.
95
a8a7c5f6
SM
962013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
97
98 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
99 .gdbinit.
100
101 * keyboard.c (safe_run_hooks_error): Improve error message.
102
103 * data.c (pure_write_error): Add `object' argument.
104 * puresize.h (CHECK_IMPURE): Use it.
105
c9628c79
MA
1062013-06-03 Michael Albinus <michael.albinus@gmx.de>
107
108 * Makefile.in (NOTIFY_OBJ): New variable.
109 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
110
111 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
112 Call syms_of_gfilenotify.
113
114 * gfilenotify.c: New file.
115
116 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
117 and Qfile_w32notify.
118 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
119 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
120
121 * lisp.h: Declare syms_of_gfilenotify.
122
123 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
124
2f592f95
SM
1252013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
126
127 Merge the specpdl and backtrace stacks. Make the structure of the
128 specpdl entries more obvious via a tagged union of structs.
129 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
130 (enum specbind_tag): New enum.
131 (struct specbinding): Make it a tagged union of structs.
132 Add a case for backtrace records.
133 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
134 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
135 (backtrace_debug_on_exit): New accessors.
136 (struct backtrace): Remove.
137 (struct catchtag): Remove backlist field.
138 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
139 Move to eval.c.
140 (Flocal_variable_p): Speed up the common case where the binding is
141 already loaded.
142 * eval.c (backtrace_list): Remove.
143 (set_specpdl_symbol, set_specpdl_old_value): Remove.
144 (set_backtrace_args, set_backtrace_nargs)
145 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
146 (backtrace_next): New functions.
147 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
148 (unwind_to_catch, internal_lisp_condition_case)
149 (internal_condition_case, internal_condition_case_1)
150 (internal_condition_case_2, internal_condition_case_n): Don't bother
151 with backtrace_list any more.
152 (Fsignal): Adjust to new backtrace format.
153 (grow_specpdl): Move up.
154 (record_in_backtrace): New function.
155 (eval_sub, Ffuncall): Use it.
156 (apply_lambda): Adjust to new backtrace format.
157 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
158 data.c.
159 (specbind): Adjust to new specpdl format. Simplify.
160 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
161 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
162 backtrace format.
163 (mark_backtrace): Remove.
164 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
165 * xdisp.c (redisplay_internal): Use record_in_backtrace.
166 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
167 Use mark_specpdl.
168 * profiler.c (record_backtrace): Use get_backtrace.
169 (handle_profiler_signal): Use backtrace_top_function.
170 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
171 accessor functions.
172
c0342369
JD
1732013-06-02 Jan Djärv <jan.h.d@swipnet.se>
174
175 * process.h (catch_child_signal): Declare.
176
177 * process.c (catch_child_signal): New function.
178 (init_process_emacs): Call it.
179
180 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
181 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
182 NS_IMPL_COCOA.
183 (x_set_cursor_type): Remove declaration.
184 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
185 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
186 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
187 (ns_get_color): Use F suffix on float.
188 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
189 (ns_get_rgb_color): Remove.
190 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
191 (note_mouse_movement): x and y are CGFloat.
192 (ns_draw_fringe_bitmap): Remove unused rowY.
193 Change #if to COCOA && >= 10_6.
194 (ns_draw_window_cursor): Remove unused overspill.
195 (ns_draw_underwave): width and x are EamcsCGFloat.
196 (ns_draw_box): thickness is CGFloat.
197 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
198 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
199 if not in main thread.
200 (ns_get_pending_menu_title, ns_check_menu_open)
201 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
202 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
203 (sendFromMainThread:): New method.
204 (changeFont:): size is CGFloat.
205 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
206 Disable warning about permanent text.
207 (characterIndexForPoint:): Adjust return type depending on GNUStep
208 version.
209 (mouseDown:): delta is CGFloat.
210 (updateFrameSize): Remove unised variable f.
211 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
212 Cast float to EmacsCGFloat.
213 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
214 also to -1 when restoring.
215 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
216 inside NS_IMPL_COCOA.
217 (toggleFullScreen:): Put call to toggleFullScreen inside
218 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
219 (setPosition:portion:whole:): por is CGFloat.
220 (getMouseMotionPart:window:x:y:): Add F suffix to float.
221 (mouseDown:): Use CGFloat.
222 (mouseDragged:): Remove unised variable edge.
223 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
224
225 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
226 of CGFloat differs.
227 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
228 when NS_IMPL_GNUSTEP.
229 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
230 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
231 (EmacsToolbar): Add clearAll. Add tag argument to
232 addDisplayItemWithImage.
233 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
234
235 * nsselect.m (ns_get_local_selection): Remove unused variable type.
236
237 * nsmenu.m (ns_update_menubar): Make static.
238 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
239 (fillWithWidgetValue:): Add cast to SEL for setAction.
240 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
241 (update_frame_tool_bar): Update code for GNUStep.
242 (clearAll): New method.
243 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
244 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP. Move
245 identifierToItem setObject and activeIdentifiers addObject before
246 call to insertItemWithItemIdentifier.
247 (validateVisibleItems): Fix indentation.
248 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
249 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
250 UtilityWindow to aStyle, remove call to setStyleMask.
251
252 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
253
254 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
255 (ns_charset_covers, ns_get_covering_families, nsfont_open):
256 Use F suffix on floats.
257 (ns_char_width): Returns CGFloat.
258 (ns_ascii_average_width): w is CGFloat instead of float.
259 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
260 DPSxshow.
261 (ns_glyph_metrics): CGFloat instead of float.
262
263 * nsfns.m (x_set_foreground_color, x_set_background_color): Use
264 EmacsCGFloat.
265 (ns_implicitly_set_icon_type, Fx_create_frame): Make static, remove
266 unused variables.
267 (Fns_read_file_name): Keep track if panel is for save. Use
268 ns_filename_from_panel/ns_directory_from_panel.
269 (Fns_list_services): delegate only used for COCOA.
270 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep. Just
271 return the input if GNUStep.
272 (x_screen_planes): Remove.
273 (Fxw_color_values): Use EmacsCGFloat
274 (Fns_display_monitor_attributes_list): Only get screen number for
275 Cocoa.
276 (getDirectory, getFilename): Removed from EmacsOpenPanel and
277 EmacsSavePanel.
278 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
279 ns_directory_from_panel.
280
da9aff11
PE
2812013-06-01 Paul Eggert <eggert@cs.ucla.edu>
282
283 * process.c (handle_child_signal): Also use WCONTINUED.
284 This is so that list-processes doesn't mistakenly list the process
285 as stopped, when the process has actually been continued and is
286 now running.
287
0e64479a
PE
2882013-05-31 Paul Eggert <eggert@cs.ucla.edu>
289
fc186a96
PE
290 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
291 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
292 not already configured.
293
0e64479a
PE
294 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
295
38b787fa
EZ
2962013-05-29 Eli Zaretskii <eliz@gnu.org>
297
298 * Makefile.in (mostlyclean): Remove *.res files.
299
22513e52
SM
3002013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
301
302 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
303 a buffer (bug#8447).
304
6ef3db10
EZ
3052013-05-27 Eli Zaretskii <eliz@gnu.org>
306
307 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
308 display vector, and we backtrack, handle the case that the
309 previous character position is also displayed from a display
310 vector or covered by a display string or image. (Bug#14476)
311
6799bb26
JD
3122013-05-25 Jan Djärv <jan.h.d@swipnet.se>
313
314 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
315 (struct MonitorInfo, free_monitors): Remove.
316 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
317 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
318 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
319 Qframes, Qsource.
320
321 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
322 (struct MonitorInfo, free_monitors): Remove.
323 (ns_screen_name): Make static.
324 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
325 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
326 Qframes, Qsource.
327
328 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
329 (struct MonitorInfo): New struct.
330 (free_monitors, make_monitor_attribute_list): Declare.
331
22513e52
SM
332 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
333 New Lisp_Object:s.
6799bb26
JD
334 (free_monitors, make_monitor_attribute_list): New functions.
335 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
336 Qsource.
337
38cd43eb
XF
3382013-05-25 Xue Fuqiao <xfq.free@gmail.com>
339
340 * callproc.c (call_process): Refine the doc string. (Bug#14045)
341
2af0948d
SM
3422013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
343
a7eb9b0f
SM
344 * keyboard.c: Apply keyboard decoding only to events that come directly
345 from the tty, not from unread-command-events (bug#14368).
346 (read_event_from_main_queue): New function, extracted from read_char).
347 (read_decoded_char): Remove.
348 (read_decoded_event_from_main_queue): New function to replace it.
349 (read_char): Use it.
350 (read_key_sequence): Use read_char rather than read_decoded_char.
351
2af0948d
SM
352 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
353
1413e9a5
BR
3542013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
355
356 * casetab.c (init_casetab_once): Fix last change (bug#14424).
357
e6d2f155
KH
3582013-05-22 Kenichi Handa <handa@gnu.org>
359
360 The following changes are to fix the setting of
361 buffer-file-coding-system on, for instance, C-x RET c unix RET
362 _FILE_OF_DOS_EOL_TYPE_ RET.
363
364 * coding.h (struct coding_system): New member detected_utf8_chars.
365
366 * coding.c (detect_coding_utf_8): Count characters and check EOL
367 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
368 BOM is there.
369 (setup_coding_system): Do not initialize coding->head_ascii.
370 (check_ascii): Do not set coding->eol_seen but update it. Do not
371 call adjust_coding_eol_type here.
1413e9a5
BR
372 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
373 If the eol-type of CODING is already specified, adjust the eol type
e6d2f155
KH
374 of the found coding-system.
375 (decode_coding_gap): Cancel previous change. Utilize the
376 character numbers counted by detect_coding_utf_8. Fix detection
377 of BOM for utf-8.
378
ab56a6f4 3792013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
fc30d803
SM
380
381 * search.c (looking_at_1): Only set last_thing_searched if the match
382 changed the match-data (bug#14281).
383
ecc3c6ed
DA
3842013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
385
386 * xdisp.c (reseat_at_previous_visible_line_start):
387 Already declared in dispextern.h, so remove it here.
388 (move_it_vertically_backward): Likewise.
389
5ba8bf35
YM
3902013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
391
392 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
d6635ba2 393 (Fx_display_pixel_width, Fx_display_pixel_height)
fc30d803
SM
394 (Fx_display_mm_width, Fx_display_mm_height):
395 Mention `display-monitor-attributes-list' in docstrings.
5ba8bf35 396
91e8418b
YM
397 * nsfns.m (ns_get_screen): Remove function. All uses removed.
398 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
399 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
400 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
401 (Fx_display_backing_store, Fx_display_visual_class)
402 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
403 (Fx_display_grayscale_p, Fx_display_pixel_width)
404 (Fx_display_pixel_height, Fx_display_planes)
405 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
406 (Fx_display_screens): Don't confuse X11 screens with NS screens.
407 (Fx_display_mm_width, Fx_display_mm_height)
408 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
409 height for all physical monitors as in X11.
410
fc30d803
SM
411 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
412 Return pixel width or height for all physical monitors as in X11.
91e8418b 413
31ff141c
PE
4142013-05-18 Paul Eggert <eggert@cs.ucla.edu>
415
416 Port --enable-gcc-warnings to clang.
417 * bytecode.c (exec_byte_code):
418 * regex.c:
419 Redo diagnostic pragmas to pacify clang, too.
420 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
421 * editfns.c (Fencode_time):
422 * fileio.c (file_accessible_directory_p):
423 * font.c (font_unparse_xlfd):
424 Use '&"string"[index]' instead of '"string" + (index)'.
425 * undo.c (user_error): Remove; unused.
426
df065a0b
EZ
4272013-05-16 Eli Zaretskii <eliz@gnu.org>
428
04d360e7
EZ
429 * insdel.c (insert_1_both): Document the arguments, instead of
430 referring to insert_1, which no longer exists.
431
5bb98290
EZ
432 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
433 some window, increment windows_or_buffers_changed, so that
434 *Messages* display in that window is updated. (Bug#14408)
435
df065a0b
EZ
436 * w32.c: Include epaths.h.
437 (init_environment): Use cmdproxy.exe without leading directories.
438 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
439 case.
440 (gettimeofday): Adjust signature and return value to Posix
441 expectations.
442
443 * unexw32.c (open_output_file): Delete the existing emacs.exe
444 before creating it, to break the hard link to the versioned
445 executable.
446
447 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
448 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
449 (FIRSTFILE_OBJ): New variables.
450 (W32_RES): Rename to EMACSRES. All users changed.
451 (base_obj): Use $(CM_OBJ).
452 (ALLOBJS): Use $(FIRSTFILE_OBJ).
453 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
454 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
455 $(W32_RES_LINK) before $(LIBES).
456 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
457
1aa8d505
SM
4582013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
459
6e911150
SM
460 * makefile.w32-in (DOC): Use just "DOC".
461
462 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
463
1aa8d505
SM
464 * process.c: Export default filters and sentinels to Elisp.
465 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
466 New constants.
467 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
468 (Fset_process_sentinel, Fformat_network_address):
469 Default to them instead of nil.
470 (server_accept_connection): Sentinels can't be nil any more.
471 (read_and_dispose_of_process_output): New function, extracted from
472 read_process_output.
473 (read_process_output): Use it; filters can't be nil.
474 (Finternal_default_process_filter): New function, extracted from
475 read_process_output.
476 (exec_sentinel_unwind): Remove function.
477 (exec_sentinel): Don't zilch sentinel while running.
478 (status_notify): Sentinels can't be nil.
479 (Finternal_default_process_sentinel): New function extracted from
480 status_notify.
481 (setup_process_coding_systems): Default filter is not nil any more.
482 (syms_of_process): Export new Elisp functions and initialize
483 new constants.
484 * lisp.h (make_lisp_proc): New function.
485
5ac2eb34
SM
4862013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
487
488 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
489
eda9c7d7
EZ
4902013-05-14 Eli Zaretskii <eliz@gnu.org>
491
492 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
5ac2eb34
SM
493 unless we know that the window w is a leaf window.
494 Another attempt at solving bug#14062.
eda9c7d7 495
8fdeaad5
JD
4962013-05-14 Jan Djärv <jan.h.d@swipnet.se>
497
498 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
499 fdesc (Bug#14375).
500
44aa9ee6
PE
5012013-05-12 Paul Eggert <eggert@cs.ucla.edu>
502
503 * image.c (gif_load): Check that subimages fit (Bug#14345).
504
759fd763
SM
5052013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
506
507 * lread.c (skip_dyn_eof): New function.
508 (read1): Use it to skip the end of a file in response to #@00.
509
510 * doc.c (get_doc_string): Slightly relax the sanity checking.
511
4465bfb4
JD
5122013-05-09 Jan Djärv <jan.h.d@swipnet.se>
513
514 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
515 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
516 (MonitorInfo): New struct.
517 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
518 (Fns_display_monitor_attributes_list): New functions.
519 (display-usable-bounds): Remove.
520 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
521 Qsource.
522
7583e2a0
PE
5232013-05-09 Paul Eggert <eggert@cs.ucla.edu>
524
525 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
526 (GTK_CHECK_VERSION): New macro, if not already defined.
527 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
528 replaced by GTK_CHECK_VERSION.
529
ad75d77e
PE
5302013-05-08 Paul Eggert <eggert@cs.ucla.edu>
531
532 * xterm.h (GTK_PREREQ): New macro.
533 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
534 to use this macro instead, for consistency and clarity.
535
07525f77
EZ
5362013-05-08 Eli Zaretskii <eliz@gnu.org>
537
538 * xdisp.c (row_for_charpos_p): New function, with code of
539 cursor_row_p, but accepts an additional argument CHARPOS instead
540 of using a hardcoded PT.
541 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
542 (row_containing_pos): Call row_for_charpos_p instead of partially
543 doing the same. Fixes cursor positioning under longlines-mode
544 when longlines-show-effect includes more than one newline, when
545 moving the cursor vertically up.
546
d901fc8d
JB
5472013-05-08 Juanma Barranquero <lekktu@gmail.com>
548
549 * makefile.w32-in (ACL_H): New macro.
550 ($(BLD)/fileio.$(O)): Update dependencies.
551
f269bc61
PE
5522013-05-07 Paul Eggert <eggert@cs.ucla.edu>
553
ffdc270a
PE
554 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
555 * Makefile.in (LIB_ACL): New macro.
556 (LIBACL_LIBS): Remove.
557 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
558 * fileio.c: Include <acl.h>.
559 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
560 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
561 !acl_errno_valid.
562 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
563 it ourselves.
564
f269bc61
PE
565 * unexelf.c: Don't assume ElfW (Half) fits in int.
566 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
567 when dealing with ElfW (Half) values, since they can exceed 2**31
568 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
569 (entry_address): Omit unused NUM arg. All uses changed.
570
a261c53e
JL
5712013-05-07 Juri Linkov <juri@jurta.org>
572
573 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
574 to the string converted from number with `Fnumber_to_string'.
575 (Bug#14254)
576
2b66427d
PE
5772013-05-07 Paul Eggert <eggert@cs.ucla.edu>
578
579 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
580 This fixes a problem introduced by my previous change.
581
15acfe41
GM
5822013-05-07 Glenn Morris <rgm@gnu.org>
583
584 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
585
5ea03bf5
JD
5862013-05-07 Jan Djärv <jan.h.d@swipnet.se>
587
588 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
589
e0c9d565
PE
5902013-05-07 Paul Eggert <eggert@cs.ucla.edu>
591
592 Static checking by GCC 4.8.0.
593 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
594 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
595 (x_get_monitor_attributes_fallback)
596 (x_get_monitor_attributes_xinerama)
597 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
598 Define only if USE_GTK.
599 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
600 (x_get_monitor_attributes_fallback): Omit unused locals.
601 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
602 Use double, not float, to avoid mixed-mode floating point arithmetic.
603
4e3f9230
YM
6042013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
605 Jan Djärv <jan.h.d@swipnet.se>
606
607 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
608 (XINERAMA_CFLAGS): New macros.
609 (ALL_CFLAGS, LIBES): Use them.
610
611 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
612 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
613 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
614 (syms_of_xfns): DEFSYM them.
615 (struct MonitorInfo): New struct.
616 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
617 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
618 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
619 (x_get_monitor_attributes_xinerama): New functions.
620 (Fx_display_monitor_attributes_list): New primitive.
621 (syms_of_xfns): Defsubr it.
622
623 * xterm.h (x_display_info): Add Xatom_net_workarea and
624 Xatom_net_current_desktop.
625
626 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
627 and dpyinfo->Xatom_net_current_desktop.
628
05839b6a
EZ
6292013-05-06 Eli Zaretskii <eliz@gnu.org>
630
631 * xdisp.c (pos_visible_p): Use the special code for finding the
632 beginning of a display property or overlay for any "replacing"
633 display property, not just for display strings. This solves
634 incorrect reporting of position by posn-at-point. (Bug#14241)
635
dc4a2ee0
PE
6362013-05-06 Paul Eggert <eggert@cs.ucla.edu>
637
5ee94506
PE
638 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
639 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
640 Verify that ElfW (Half) fits in int.
641 (fatal): Use same signature as lisp.h.
642 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
643 configure and build with -DUNEXELF_DEBUG without worrying about
644 other modules that use DEBUG.
645 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
646 possibly-wide integers now uses it instead of plain fprintf.
647 (entry_address): New function, which avoids problems with 32-bit
648 overflow on 64-bit hosts.
649 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
650 (round_up): Don't assume the remainder fits in int.
651 (find_section): Use bool for boolean. Simplify debug code.
652 (unexec): Don't assume file sizes fit in int or size_t.
653 Omit unnecessary trailing newline in 'fatal' format.
654 Use strerror rather than outputting decimal error number.
655 Remove unused code when emacs is not defined;
656 this file relies on Emacs now.
657 Don't assume e_phnum and e_shnum are positive.
658
dc4a2ee0
PE
659 * regex.c: Fix problems when DEBUG is defined.
660 (extract_number, extract_number_and_incr): Define regardless of
661 whether DEBUG is defined; that's simpler and makes the code less
662 likely to go stale in the normal case when DEBUG is not defined.
663 Return int rather than taking an int * arg. All callers changed.
664 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
665 Remove, replacing with ...
666 (DEBUG_PRINT): New macro. All callers changed.
667 (DEBUG_COMPILES_ARGUMENTS): New macro.
668 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
669 (print_compiled_pattern, print_double_string) [DEBUG]:
670 Use prototype rather than old-style definition.
671 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
672 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
673 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
674 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
675 Don't assume ptrdiff_t, size_t, and long are the same width as int.
676 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
677 This matters only when DEBUG is defined.
678
14c7ed05
EZ
6792013-05-05 Eli Zaretskii <eliz@gnu.org>
680
681 * xdisp.c (set_iterator_to_next): Set the
682 ignore_overlay_strings_at_pos_p flag only if we are _really_
683 iterating over an overlay string, as indicated by the
684 current.overlay_string_index member. (Bug#14306)
685
e6076b1b
JD
6862013-05-05 Jan Djärv <jan.h.d@swipnet.se>
687
688 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
689 to where it is used, to avoid autorelease issues (Bug#14050).
690
cbee2131
PE
6912013-05-05 Paul Eggert <eggert@cs.ucla.edu>
692
693 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
694 * fileio.c (syms_of_fileio): Implement this.
695 * filelock.c (create_lock_file): If symbolic links don't work, so
696 we use a regular file as a lock file, do not fsync the lock file;
697 it's not needed.
698
30c7e542
SM
6992013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
700
701 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
702 (syms_of_minibuf): Adjust accodingly.
703 * lread.c (Fread):
704 * callint.c (Fcall_interactively): Adjust calls accordingly.
705
5bebd186
EZ
7062013-05-04 Eli Zaretskii <eliz@gnu.org>
707
708 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
30c7e542
SM
709 w->contents is a buffer before computing everything else.
710 Use parentheses to disambiguate last part of the condition.
5bebd186
EZ
711
712 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
713 assertion violations. (Bug#14062)
714
0fb0a4f3
DR
7152013-05-01 David Reitter <david.reitter@gmail.com>
716
717 * nsfns.m (ns_tooltip): Initialize.
718
9e63b4a5
EZ
7192013-04-28 Eli Zaretskii <eliz@gnu.org>
720
721 * coding.c (decode_coding_gap): Don't remove the character before
722 a newline unless it's a CR character. (Bug#14287)
723
ad60824e
DN
7242013-04-28 Dan Nicolaescu <dann@gnu.org>
725
726 * dispextern.h (struct face): Move enum face_underline_type
727 earlier so that bitfields can be in the same word.
728
edbdcec0
JD
7292013-04-28 Jan Djärv <jan.h.d@swipnet.se>
730
731 * nsfns.m (handlePanelKeys): New function.
732 (EmacsOpenPanel:performKeyEquivalent:)
733 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
734 arrows/function/control and copy/paste keys (Bug#14296).
735
0208ede7
JL
7362013-04-27 Juri Linkov <juri@jurta.org>
737
738 * callint.c (Fcall_interactively): Call `Qread_number' for
739 interactive code letter `n' instead of using duplicate code.
740 (Bug#14254)
741
b8dd59f7
PE
7422013-04-27 Paul Eggert <eggert@cs.ucla.edu>
743
744 * systime.h (make_timeval): Declare as 'const'.
745
8bd722db
KH
7462013-04-27 Kenichi Handa <handa@gnu.org>
747
748 * font.c (font_open_entity): Always open a font of manageable
749 size.
750
13d0e56f 7512013-04-26 Paul Eggert <eggert@cs.ucla.edu>
cbee2131 752
f780d632
PE
753 Port better to AIX (Bug#14258).
754 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
755 to pacify AIX xlc.
756
ec509856
KH
7572013-04-24 Kenichi Handa <handa@gnu.org>
758
759 * coding.c (decode_coding_iso_2022): When an invalid escape
760 sequence is encountered, reset the invocation and designation
761 status to the safest one.
762
84fc48e5
PE
7632013-04-22 Paul Eggert <eggert@cs.ucla.edu>
764
765 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
766 Without this fix, "make distclean" leaves stamp-h1 behind.
767
806bda47
EC
7682013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
769
770 * w32fns.c (w32_fullscreen_rect): New function to compute the
771 window rectangle for the given fullscreen mode.
772 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
773 longer tunes the window size. This keeps the window's edges flush
774 with the screen and allows the taskbar to hide itself in fullboth.
775
776 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
777 window decorations and uses the entire screen.
778
779 * w32term.h (w32_fullscreen_rect) Add prototype.
780 (struct w32_output): Replace normal_width, normal_height,
781 normal_top, and normal_left members with a single normal_placement
782 struct.
783 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
784 Remove macros.
785 (FRAME_NORMAL_PLACEMENT): New macro.
786
9cc2810b
JB
7872013-04-16 Juanma Barranquero <lekktu@gmail.com>
788
789 * minibuf.c (Ftest_completion): Silence compiler warning.
790
fd16b54c
EZ
7912013-04-15 Eli Zaretskii <eliz@gnu.org>
792
793 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
5fbcd237 794 bug#14062.
fd16b54c
EZ
795
796 * frame.h (WINDOW_FRAME): Protect macro and its argument with
797 parentheses.
798
799 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
800 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
801 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
802 parentheses where appropriate.
803
9e3379a0
PE
8042013-04-14 Paul Eggert <eggert@cs.ucla.edu>
805
806 * keyboard.c (timer_start_idle): Remove no-longer-used local.
807
ddd6b685
EZ
8082013-04-14 Eli Zaretskii <eliz@gnu.org>
809
810 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
811 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
812 Mention in the doc string that setting these variables takes
813 effect only after a call to set-window-buffer. (Bug#14200)
814
29b79ba1
EZ
8152013-04-13 Eli Zaretskii <eliz@gnu.org>
816
817 * indent.c (Fvertical_motion): Don't consider display strings on
818 overlay strings as display strings on the buffer position we
819 started from. This prevents vertical cursor motion from jumping
820 more than one line when there's an overlay string with a display
821 property at end of line.
822 Reported by Karl Chen <Karl.Chen@quarl.org> in
823 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
824
562c6ee9
SM
8252013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
826
827 * window.c (select_window): `record_buffer' even if window is
828 already selected (bug#14191).
829
fcc1fe85
EZ
8302013-04-11 Eli Zaretskii <eliz@gnu.org>
831
832 * window.c (Fwindow_end): Test more flags, including the buffer's
833 last_overlay_modified flag, to determine whether the window's
834 display is really up-to-date. Prevents the function from
835 returning a stale value. (Bug#14170)
836 (Fwindow_line_height): Fix the test for up-to-date-ness of the
837 current matrix.
838
f009190a
EZ
8392013-04-10 Eli Zaretskii <eliz@gnu.org>
840
841 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562c6ee9
SM
842 garbaged only if it is not already the top frame on its TTY.
843 This prevents flickering due to constant redrawing of TTY frames when
f009190a
EZ
844 there are GUI frames open in the same session. (Bug#13864)
845
78ce603d
SM
8462013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
847
848 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
849 of marking the idle timers directly.
850
a8036e40
SM
8512013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
852
853 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
854 tables (bug#14054).
855
7ffe7ef6
SM
8562013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
857
858 * window.c (select_window): Don't record_buffer while the invariant is
859 temporarily broken (bug#14161).
860
861 * fns.c (Fdelq): Don't assume !NILP => CONSP.
862
7d9f6883
EZ
8632013-04-07 Eli Zaretskii <eliz@gnu.org>
864
865 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
866
5406cfd9
RF
8672013-04-07 Romain Francoise <romain@orebokech.com>
868
869 Ignore additional platform-specific ACL errors (Bug#13702).
870 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
871 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
872
95c0e83b
JD
8732013-03-31 Jan Djärv <jan.h.d@swipnet.se>
874
875 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
876 f->output_data.ns.
877
876da980
PE
8782013-04-07 Paul Eggert <eggert@cs.ucla.edu>
879
880 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
881 This bug was introduced by my 2013-02-25 change that simplified
882 data_start configuration. Without this change, on GNU/Linux
883 an Emacs configured with --enable-profiling fails immediately
884 due to a profiler signal.
885 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
886 with these flags. On platforms where special flags are needed
887 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
888 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
889 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
890
7452b7bd
DA
8912013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
892
893 Get rid of some platform-specific functions examining window
894 system and its capabilities. This is a partial rework of the
895 2013-04-05 change.
896 * lisp.h (have_menus_p): Remove prototype. This function is
897 replaced with platform-independent window_system_available.
898 (check_window_system): Move to...
899 * frame.h (decode_window_system_frame, window_system_available):
900 ...here, add new prototypes.
901 * frame.c (window_system_available, decode_window_system_frame):
902 New functions.
903 (check_window_system): Platform-independent now.
904 * xterm.h (x_in_use): Remove declaration.
905 (check_x_frame):
906 * w32term.h (check_x_frame):
907 * nsterm.h (check_x_frame): Remove prototypes. This function
908 is replaced with platform-independent decode_window_system_frame.
909 * msdos.c (have_menus_p): Remove.
910 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
911 Remove platform-specific functions. Use check_window_system,
912 decode_window_system_frame and check_ns_display_info where
913 appropriate. Minor style and comment tweaks.
914 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
915 (check_x_frame): Likewise.
916 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
917 Likewise.
918 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
919 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
920 * xmenu.c, xselect.c: All related users changed.
921
251e9147
KH
9222013-04-03 Kenichi Handa <handa@gnu.org>
923
924 The following changes is to optimize the code for reading UTF-8
925 files.
926
562c6ee9 927 * coding.c (check_ascii): Rename from detect_ascii. Return value
251e9147
KH
928 changed. Check EOL format. Do not call adjust_coding_eol_type
929 here.
930 (check_utf_8): New function.
931 (adjust_coding_eol_type): Do nothing if already adjusted.
932 (detect_coding): Compare the return value of check_ascii with
933 coding->src_bytes. Call adjust_coding_eol_type if necessary.
934 (decode_coding_gap): Optimize for valid UTF-8.
935
8bc369d4
KH
9362013-03-21 Kenichi Handa <handa@gnu.org>
937
938 * coding.c (syms_of_coding): Cancel previous change.
939
940 * insdel.c (insert_from_gap): Fix previous change.
941
73931ad1
DA
9422013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
943
944 Consistently use platform-specific function to detect window system.
945 * lisp.h (check_window_system): New prototype. This function is
946 going to replace check_x, check_w32 and check_ns.
947 (have_menus_p): Mention msdos.c in comment.
948 * fontset.c (check_window_system_func): Remove. Adjust all users.
949 * fontset.h (check_window_system_func): Remove prototype.
950 * nsterm.h (check_ns):
951 * xterm.h (check_x):
952 * w32term.h (check_w32): Likewise.
953 * menu.c (Fx_popup_menu): Use check_window_system.
954 * msdos.c (check_window_system): Define for MS-DOS.
955 * nsfns.m (check_window_system): Define for NS. Adjust all users.
956 * w32fns.c (check_window_system): Likewise for MS-Windows.
957 * xfns.c (check_window_system): Likewise for X.
958 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
959 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
960
7216e43b
PE
9612013-04-02 Paul Eggert <eggert@cs.ucla.edu>
962
963 Prefer < to > in range checks such as 0 <= i && i < N.
964 This makes it easier to visualize quantities on a number line.
965 This patch doesn't apply to all such range checks,
966 only to the range checks affected by the 2013-03-24 change.
967 This patch reverts most of the 2013-03-24 change.
968 * alloc.c (xpalloc, Fgarbage_collect):
969 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
970 * character.c (string_escape_byte8):
971 * charset.c (read_hex):
972 * data.c (cons_to_unsigned):
973 * dispnew.c (update_frame_1):
974 * doc.c (Fsubstitute_command_keys):
975 * doprnt.c (doprnt):
976 * editfns.c (hi_time, decode_time_components):
977 * fileio.c (file_offset):
978 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
979 * font.c (font_intern_prop):
980 * frame.c (x_set_alpha):
981 * gtkutil.c (get_utf8_string):
982 * indent.c (check_display_width):
983 * keymap.c (Fkey_description):
984 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
985 * lread.c (read1):
986 * minibuf.c (read_minibuf_noninteractive):
987 * process.c (wait_reading_process_output):
988 * search.c (Freplace_match):
989 * window.c (get_phys_cursor_glyph):
990 * xdisp.c (redisplay_internal):
991 * xsmfns.c (smc_save_yourself_CB):
992 Prefer < to > for range checks.
993 * dispnew.c (sit_for): Don't mishandle NaNs.
994 This fixes a bug introduced in the 2013-03-24 change.
995 * editfns.c (decode_time_components): Don't hoist comparison.
996 This fixes another bug introduced in the 2013-03-24 change.
997
92759988
DA
9982013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
999
1000 * frame.h (struct frame): Drop scroll_bottom_vpos
1001 member becaue all real users are dead long ago.
1002 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
1003 * xdisp.c (redisplay_internal): Adjust user.
1004
9a1971bb
GM
10052013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
1006
f38ab167
JD
1007 * nsmenu.m (showAtX:Y:for:): setLevel to
1008 NSPopUpMenuWindowLevel (Bug#13998).
1009
6d01f1fe
JD
10102013-03-30 Jan Djärv <jan.h.d@swipnet.se>
1011
1012 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
1013 (ns_check_pending_open_menu): Declare.
1014
1015 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
1016 (x_activate_menubar): Update the menu with title that matches
1017 ns_get_pending_menu_title, and call
1018 ns_check_pending_openmenu (Bug#12698).
1019 (menuWillOpen:): New method.
1020 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
1021
1022 * nsterm.m (menu_will_open_state, menu_mouse_point)
1023 (menu_pending_title): New varaibles.
1024 (ns_get_pending_menu_title, ns_check_menu_open)
1025 (ns_check_pending_open_menu): New functions.
1026
781f4782
DA
10272013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
1028
1029 * indent.c (current_column_bol_cache): Remove leftover which is not
1030 used in Fmove_to_column any more.
1031 (current_column, scan_for_column): Adjust users.
1032 * keyboard.c (last_point_position_buffer, last_point_position_window):
1033 Remove leftovers which are not used for recording undo any more.
1034 (command_loop_1, syms_of_keyboard): Adjust users.
1035 * xdisp.c (last_max_ascent): Remove leftover which is not used in
1036 redisplay_window any more.
1037 (move_it_to): Adjust user.
1038
1921c31b
JB
10392013-03-29 Juanma Barranquero <lekktu@gmail.com>
1040
1041 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
1042 Update dependencies.
1043
717b8bcd
SM
10442013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
1045
1046 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
1047 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
1048 forward references.
1049
e74aeda8
DA
10502013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1051
1052 * window.h (struct window): Replace hchild, vchild and buffer slots
1053 with the only contents slot. This is possible because each valid
1054 window may have either the child window (in vertical or horizontal
1055 combination) or buffer to display (for the leaf window). Using that,
1056 a lof of operations to traverse and/or change window hierarchies may
1057 be simplified. New member horizontal is used to distinguish between
1058 horizontal and vertical combinations of internal windows.
1059 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
1060 (WINDOW_VERTICAL_COMBINATION_P): New macros.
1061 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
1062 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
1063 Use contents slot, not buffer, where appropriate.
1064 (wset_combination): New function.
1065 (wset_buffer): Add eassert.
1066 (Fframe_first_window): Simplify the loop reaching first window.
1067 (Fwindow_buffer): Use WINDOW_LEAF_P.
1068 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
1069 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
1070 (unshow_buffer): Convert initial debugging check to eassert.
1071 (replace_window, recombine_windows, Fdelete_other_windows_internal)
1072 (make_parent_window, window_resize_check, window_resize_apply)
1073 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
1074 (Fset_window_configuration, delete_all_child_windows, save_window_save):
1075 Adjust to match struct window changes.
1076 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
1077 (mark_window_cursors_off, count_windows, get_leaf_windows)
1078 (foreach_window_1): Simplify the loop.
1079 * alloc.c (mark_object): Do not check for the leaf window because
1080 internal windows has no glyph matrices anyway.
1081 * dispnew.c (clear_window_matrices, showing_window_margins_p)
1082 (allocate_matrices_for_window_redisplay, fake_current_matrices)
1083 (allocate_matrices_for_frame_redisplay, free_window_matrices)
1084 (build_frame_matrix_from_window_tree, mirror_make_current)
1085 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
1086 (update_window_tree, set_window_update_flags): Simplify the loop.
1087 (sync_window_with_frame_matrix_rows): Enforce live window.
1088 Use contents slot, not buffer, where appropriate.
1089 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
1090 and WINDOW_HORIZONTAL_COMBINATION_P.
1091 (make_frame_visible_1): Simplify the loop.
1092 Use contents slot, not buffer, where appropriate.
1093 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
1094 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
1095 (expose_window_tree): Likewise.
1096 Use contents slot, not buffer, where appropriate.
1097 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
1098 to avoid deleted windows. Use contents slot instead of buffer.
1099 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
1100 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
1101 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
1102 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
1103
121ab1cd
EZ
11042013-03-28 Eli Zaretskii <eliz@gnu.org>
1105
ef454cf7
EZ
1106 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
1107 identify the reasons for assertion violations in bug#14062 and
1108 similar ones.
21e930f8
EZ
1109 (Fx_show_tip): Fix compilation error under
1110 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 1111
121ab1cd
EZ
1112 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
1113 Reported by <rzl24ozi@gmail.com>.
1114
5c89ca24
DA
11152013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
1116
1117 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
1118 start marker...
562c6ee9
SM
1119 (unwind_with_echo_area_buffer): ...to restore it here.
1120 This is needed to ensure that...
5c89ca24
DA
1121 (redisplay_window): ...both window markers are valid here,
1122 which is verified by eassert.
1123 * editfns.c (save_excursion_save): Do not assume that
1124 selected_window always displays the buffer.
c7f53895
DA
1125 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
1126 Fix comment.
5c89ca24 1127
f557c1b1
SM
11282013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
1129
1130 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
1131 the upcase table.
1132
40693bba 11332013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
1134
1135 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
1136
c86f791f
EZ
11372013-03-27 Eli Zaretskii <eliz@gnu.org>
1138
1139 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
1140 since MinGW's w32api headers do. This avoids compiler warnings.
1141
1142 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
1143 if already defined.
1144
c6e72e17
EZ
11452013-03-26 Eli Zaretskii <eliz@gnu.org>
1146
1147 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
1148
54e95010
JD
11492013-03-26 Jan Djärv <jan.h.d@swipnet.se>
1150
1151 * gtkutil.c (style_changed_cb): Check if frame is live and an
1152 X frame (Bug#14038).
1153
b88b62de
EZ
11542013-03-26 Eli Zaretskii <eliz@gnu.org>
1155
a18d7de6
EZ
1156 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
1157 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
1158 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
1159 MinGW64.
8f5e14c8
EZ
1160 Move inclusion of time.h before sys/time.h, so that MinGW64 could
1161 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 1162
b88b62de
EZ
1163 Fix incompatibilities between MinGW.org and MinGW64 headers.
1164 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
1165
1166 * w32.c (REPARSE_DATA_BUFFER): Guard with
1167 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
1168
c074e458
JD
11692013-03-25 Jan Djärv <jan.h.d@swipnet.se>
1170
1171 * xterm.c: Include X11/XKBlib.h
1172 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
1173
908589fd
AS
11742013-03-24 Andreas Schwab <schwab@linux-m68k.org>
1175
1176 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
1177 written backwards.
1178 * blockinput.h (input_blocked_p): Likewise.
1179 * bytecode.c (exec_byte_code): Likewise.
1180 * callproc.c (call_process_kill, call_process_cleanup)
1181 (Fcall_process): Likewise.
1182 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
1183 (Fccl_execute_on_string): Likewise.
1184 * character.c (string_escape_byte8): Likewise.
1185 * charset.c (read_hex): Likewise.
1186 * cm.c (calccost): Likewise.
1187 * data.c (cons_to_unsigned): Likewise.
1188 * dired.c (directory_files_internal, file_name_completion):
1189 Likewise.
1190 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
1191 (sit_for): Likewise.
1192 * doc.c (Fsubstitute_command_keys): Likewise.
1193 * doprnt.c (doprnt): Likewise.
1194 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
1195 * emacsgtkfixed.c: Likewise.
1196 * fileio.c (file_offset, Fwrite_region): Likewise.
1197 * floatfns.c (Fexpt, fmod_float): Likewise.
1198 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
1199 Likewise.
1200 * font.c (font_intern_prop): Likewise.
1201 * frame.c (x_set_alpha): Likewise.
1202 * gtkutil.c (get_utf8_string): Likewise.
1203 * indent.c (check_display_width): Likewise.
1204 * intervals.c (create_root_interval, rotate_right, rotate_left)
1205 (split_interval_right, split_interval_left)
1206 (adjust_intervals_for_insertion, delete_node)
1207 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1208 (merge_interval_right, merge_interval_left, copy_intervals)
1209 (set_intervals_multibyte_1): Likewise.
1210 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
1211 * keymap.c (Fkey_description): Likewise.
1212 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
1213 * lread.c (openp, read_integer, read1, string_to_number):
1214 Likewise.
1215 * menu.c (ensure_menu_items): Likewise.
1216 * minibuf.c (read_minibuf_noninteractive): Likewise.
1217 * print.c (printchar, strout): Likewise.
1218 * process.c (create_process, Faccept_process_output)
1219 (wait_reading_process_output, read_process_output, send_process)
1220 (wait_reading_process_output): Likewise.
1221 * profiler.c (make_log, handle_profiler_signal): Likewise.
1222 * regex.c (re_exec): Likewise.
1223 * regex.h: Likewise.
1224 * search.c (looking_at_1, Freplace_match): Likewise.
1225 * sysdep.c (get_child_status, procfs_ttyname)
1226 (procfs_get_total_memory): Likewise.
1227 * systime.h (EMACS_TIME_VALID_P): Likewise.
1228 * term.c (dissociate_if_controlling_tty): Likewise.
1229 * window.c (get_phys_cursor_glyph): Likewise.
1230 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
1231 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
1232 Likewise.
1233 * xfns.c (Fx_window_property): Likewise.
1234 * xmenu.c (set_frame_menubar): Likewise.
1235 * xselect.c (x_get_window_property, x_handle_dnd_message):
1236 Likewise.
1237 * xsmfns.c (smc_save_yourself_CB): Likewise.
1238 * xterm.c (x_scroll_bar_set_handle): Likewise.
1239
2bf7d27a
DA
12402013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
1241
1242 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
1243 to be optional or nil. Adjust comment and convert it to docstring.
1244 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
1245 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
1246
a9ebfa0b
PE
12472013-03-24 Paul Eggert <eggert@cs.ucla.edu>
1248
1249 Static checking by GCC 4.8-20130319.
1250 * image.c (gif_load): Assume pass < 3 to pacify GCC.
1251 * process.c (Fset_process_datagram_address)
1252 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
1253 * xdisp.c (get_char_face_and_encoding):
1254 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
1255 (get_glyph_face_and_encoding): Prepare face before possibly using it.
1256 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
1257
4f3576ee
KB
12582013-03-24 Ken Brown <kbrown@cornell.edu>
1259
789b5e9a
KB
1260 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
1261 fix compilation on 64-bit Cygwin, where underscores are not
1262 automatically prepended.
1263
4f3576ee
KB
1264 * w32term.c (w32_initialize): Silence compiler warning.
1265
b5b7745f
EZ
12662013-03-23 Eli Zaretskii <eliz@gnu.org>
1267
cdc0d0bd
EZ
1268 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
1269 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
562c6ee9
SM
1270 variables, to save and restore frame dimensions.
1271 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
1272 after returning from a 'fullscreen' configuration.
1273 use SendMessage instead of PostMessage to send the SC_RESTORE message,
cdc0d0bd
EZ
1274 to avoid races between the main thread and the input thread.
1275
1276 * w32term.h (struct w32_output): New members normal_width,
1277 normal_height, normal_top, normal_left, and prev_fsmode.
1278 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
1279 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1280 members of a frame.
1281
b5b7745f
EZ
1282 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1283 'fullscreen' parameter. Always record previous width and height
1284 of the frame, except when switching out of maximized modes, so
1285 that they could be restored correctly, instead of resetting to the
1286 default frame dimensions. Send SC_RESTORE command to the frame,
1287 unless we are going to send SC_MAXIMIZE, to restore the frame
1288 resize hints in the mouse pointer shown by the window manager.
1289 (Bug#14032)
1290
1291 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1292
1293 * lisp.h (get_frame_param): Adjust conditions for prototype
1294 declaration.
1295
a3454eed
KB
12962013-03-22 Ken Brown <kbrown@cornell.edu>
1297
1298 * unexcw.c: Drop unneeded inclusion of w32common.h.
1299 (report_sheap_usage): Declare.
1300 (read_exe_header): Add magic numbers for x86_64.
1301 (fixup_executable): Fix printf format specifier for unsigned long
1302 argument.
1303
5a49b79c
DA
13042013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1305
1306 * frame.h (struct frame): Put menu_bar_window under #ifdef
1307 because this member is not needed when X toolkit is in use.
1308 (fset_menu_bar_window):
1309 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1310 (free_glyphs, update_frame):
1311 * xdisp.c (expose_frame): Likewise.
1312 (display_menu_bar): Likewise. Remove redundant eassert.
1313 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1314 toolkit is in use.
1315
d6723bf7
PE
13162013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1317
7b1123d8
PE
1318 Use functions and constants to manipulate Lisp_Save_Value objects.
1319 This replaces code that used macros and strings and token-pasting.
1320 The change makes the C source a bit easier to follow,
1321 and shrinks the Emacs executable a bit.
1322 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1323 (make_save_value): Change 1st arg from string to enum. All callers
1324 changed.
1325 (INTX): Remove.
1326 (mark_object): Use if, not #if, for GC_MARK_STACK.
1327 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1328 (XSAVE_OBJECT): Now functions, not macros.
1329 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1330 the constant was never used.
1331 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1332 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1333 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1334 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1335 New constants.
1336 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1337 type3 with a single member save_type. All uses changed.
1338 (save_type, set_save_pointer, set_save_integer): New functions.
1339 * print.c (PRINTX): Remove.
1340
d6723bf7
PE
1341 * alloc.c: Remove redundant static declarations.
1342
5f24fa51
DA
13432013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1344
1345 * window.h (struct window): Convert left_col, top_line, total_lines
1346 and total_cols from Lisp_Objects to integers. Adjust comments.
1347 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1348 Remove.
1349 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1350 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1351 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1352 Adjust users where appropriate.
1353
42143acd
DA
13542013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1355
1356 * frame.h (struct frame): Drop resx and resy because the same data is
1357 available from window system-specific output context. Adjust users.
562c6ee9
SM
1358 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1359 New functions to provide defaults when no window system available.
42143acd 1360 (FRAME_RES_X, FRAME_RES_Y): New macros.
562c6ee9 1361 (NUMVAL): Move from xdisp.c.
42143acd
DA
1362 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1363 (Ffont_face_attributes, Fopen_font):
1364 * image.c (gs_load):
1365 * w32font.c (fill_in_logfont):
1366 * xdisp.c (calc_pixel_width_or_height):
1367 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1368 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1369
c0a17406
KH
13702013-03-20 Kenichi Handa <handa@gnu.org>
1371
1372 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1373 to 1 (temporary workaround until a bug related to ASCII
1374 optimization is fixed).
1375
095d384d
DA
13762013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1377
1378 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1379 Signal error if window is not internal. Adjust docstring.
1380 (delete_all_child_windows): Use combination_limit to save the buffer.
1381 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
1382 * print.c (syms_of_print): Initialize debugging output not here...
1383 (init_print_once): ...but in a new function here.
1384 * lisp.h (init_print_once): Add prototype.
1385 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 1386
748fa866
DA
13872013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1388
1389 * window.c (window_resize_check, window_resize_apply)
1390 (window_from_coordinates, recombine_windows, set_window_buffer)
1391 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1392 (Fsplit_window_internal, Fdelete_window_internal)
1393 (freeze_window_starts): Use bool for booleans.
1394 * window.h (window_frame_coordinates, resize_frame_windows)
1395 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1396
81519fd2
SM
13972013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1398
1399 * dispnew.c (bitch_at_user): Use `user-error'.
1400
6db423a9
KB
14012013-03-17 Ken Brown <kbrown@cornell.edu>
1402
1403 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1404 as return type of image_background. (Bug#13981)
1405 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1406
8f2906f5
JD
14072013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1408
960ce480 1409 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 1410 (ns_select): Don't return with result uninitialized.
960ce480 1411
8f2906f5
JD
1412 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1413 and getDirectory.
1414
81519fd2
SM
1415 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1416 New functions.
8f2906f5
JD
1417 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1418 directories. If filename is nil, get directory name (Bug#13932).
1419 Use getFilename and getDirectory.
1420 (getFilename, getDirectory): New methods for EmacsSavePanel and
1421 EmacsOpenPanel.
1422 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1423
cded56c1
PE
14242013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1425
1426 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1427
251e9147 14282013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
1429
1430 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1431 (adjust_after_replace): Make it back to static. Delete the third
1432 arg text_at_gap_tail. Cancel the code for handling it.
1433
1434 * coding.h (struct coding_system): New member eol_seen.
1435
1436 * coding.c (detect_ascii): New function.
1437 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1438 when the source bytes are actually scanned. On detecting for
1439 coding_category_utf_8_auto, call detect_ascii instead of scanning
1440 source bytes directly.
1441 (produce_chars): Call insert_from_gap with the new arg 0.
1442 (encode_coding): Likewise.
1443 (decode_coding_gap): Control ASCII optimization by the variable
1444 disable_ascii_optimization instead of #ifndef .. #endif.
1445 Deccode EOL format according to coding->eol_seen.
1446 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1447 variable.
1448
8a44e6d1
KH
1449 * lisp.h (adjust_after_replace): Cancel externing it.
1450 (insert_from_gap): Adjust prototype.
1451
5f795e34
EZ
14522013-03-15 Eli Zaretskii <eliz@gnu.org>
1453
1454 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1455 FULLSCREEN_MAXIMIZED. (Bug#13935)
1456
f258b4be
DA
14572013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1458
1459 * region-cache.c (find_cache_boundary, move_cache_gap)
1460 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1461 Simplify debugging check and convert to eassert. Adjust comment.
1462 (pp_cache): Put under ENABLE_CHECKING.
1463
a5cc4dde
EZ
14642013-03-14 Eli Zaretskii <eliz@gnu.org>
1465
1466 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1467 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1468 and WM_ACTIVATEAPP.
1469 (w32fullscreen_hook): If the frame is visible, reset
1470 f->want_fullscreen flag after changing the frame size. If the
1471 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1472 (Bug#13953)
1473
3fc5e44a
DC
14742013-03-13 Daniel Colascione <dancol@dancol.org>
1475
1476 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1477 too so that these builds can use Cygwin's file conversion
1478 functions. (We've been building and linking cygw32.o all along
1479 and just not using it.)
1480
47d7532e
PE
14812013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1482
1483 File synchronization fixes (Bug#13944).
1484 * Makefile.in (LIB_FDATASYNC): New macro.
1485 (LIBES): Use it.
1486 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1487 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1488 Don't worry about HAVE_FSYNC, since a substitute fsync is
1489 available if the system lacks one.
1490 (Fwrite_regin): Retry fsync if interrupted.
1491
c7ffccaf
EZ
14922013-03-13 Eli Zaretskii <eliz@gnu.org>
1493
4e2df81d 1494 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
1495 activated, call w32fullscreen_hook, to make sure the new frame
1496 dimensions are in effect. (Bug#13937)
1497
8a7debc1
DA
14982013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1499
1500 * xdisp.c (init_iterator): Simplify because both character and byte
1501 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
1502 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1503 character and byte positions can be obtained from marker.
8a7debc1 1504
7fd8c501
PE
15052013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1506
d9df6f40
PE
1507 Static checking by Sun C 5.12.
1508 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1509 * bytecode.c (exec_byte_code):
1510 * dispnew.c (init_display):
1511 * eval.c (error):
1512 * fileio.c (Fsubstitute_in_file_name):
1513 * keyboard.c (Fevent_convert_list):
1514 * keymap.c (Fsingle_key_description):
1515 * term.c (maybe_fatal, fatal):
1516 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1517 * xsmfns.c (Fhandle_save_session):
1518 Omit unreachable code.
1519 * keymap.c (map_keymap_char_table_item): Cast void * to
1520 a function pointer type; the C Standard requires this.
1521
7fd8c501
PE
1522 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1523 Include <sys/param.h> unconditionally, as that works elsewhere and
1524 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1525 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1526 and FreeBSD now.
1527
cb0290df
PE
15282013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1529
1530 * insdel.c (adjust_after_replace): Use bool for boolean.
1531
cbae07d5
SM
15322013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1533
1534 * keyboard.c: Move keyboard decoding to read_key_sequence.
1535 (decode_keyboard_code): Remove.
1536 (tty_read_avail_input): Don't try to decode input.
1537 (read_decoded_char): New function.
1538 (read_key_sequence): Use it.
1539
819e2da9
DC
15402013-03-10 Daniel Colascione <dancol@dancol.org>
1541
1542 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1543 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1544 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1545 w32fns.c.
1546
1547 * w32term.c (construct_drag_n_drop): Use the above macros to make
1548 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1549
1550 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1551 properly display non-ASCII frame titles in cygw32 builds.
1552
1553 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1554 call ShellExecute in cygw32 builds.
1555
1556 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1557 common file dialog code.
1558
1559 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1560 can just use du like other systems.
1561
1562 * coding.c (from_unicode_buffer): Declare.
1563 * coding.c (from_unicode_buffer): Implement.
1564
99ec1647
SM
15652013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1566
d2e24f92
SM
1567 * lread.c: Minor cleanup.
1568 (FROM_FILE_P): New macro.
1569 (skip_dyn_bytes, unreadchar, read1): Use it.
1570 (read_list): Consolidate duplicated code.
1571
99ec1647
SM
1572 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1573
138c0ae8
EZ
15742013-03-10 Eli Zaretskii <eliz@gnu.org>
1575
1576 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1577 (redisplay_internal, set_cursor_from_row, try_window)
1578 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1579 (display_line, notice_overwritten_cursor)
99ec1647
SM
1580 (mouse_face_from_buffer_pos, note_mouse_highlight):
1581 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 1582 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
1583 (mouse_face_from_string_pos, fast_find_string_pos):
1584 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
1585
1586 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1587
1588 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1589
1590 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1591 MATRIX_MODE_LINE_ROW.
1592
1593 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1594
c230dd7d
KH
15952013-03-10 handa <handa@gnu.org>
1596
1597 * lisp.h (adjust_after_replace): Extern it.
1598
1599 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1600 case of detection for coding_category_utf_8_auto.
99ec1647
SM
1601 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1602 Skip decoding if all bytes are ASCII.
c230dd7d
KH
1603
1604 * insdel.c (adjust_after_replace): Make it public. New arg
1605 text_at_gap_tail.
1606 (adjust_after_insert): Call adjust_after_replace with the new arg
1607 value 0.
1608
27a98a62
SM
16092013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1610
1611 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1612 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1613 from Elisp via unread-command-events.
1614
1615 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1616 functions to mean "no change".
1617
457882c2
PE
16182013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1619
1620 region-cache.c, scroll.c, search.c: Use bool for booleans.
1621 * lisp.h (compile_pattern):
1622 * scroll.c (do_scrolling, do_direct_scrolling):
1623 * search.c (struct regexp_cache, compile_pattern_1)
1624 (compile_pattern, string_match_1, search_command)
1625 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1626 (search_regs_saved, Fregexp_quote):
1627 Use bool for boolean.
1628 * region-cache.c (region_cache_forward, region_cache_backward):
1629 Fix comments to match code: these functions return int, not boolean.
1630
b5426561
DA
16312013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1632
1633 * search.c (find_newline): Accept start and end byte positions
1634 as arguments and allow -1 if not known.
1635 (find_newline_no_quit): Likewise for start position.
1636 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1637 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1638 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
1639 * editfns.c (Fconstrain_to_field): Break long line.
1640 Adjust call to find_newline.
b5426561
DA
1641 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1642 Use DEC_BOTH to start next search from the previous buffer
1643 position, where appropriate.
1644 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1645 (get_visually_first_element, move_it_vertically_backward): Likewise.
1646 Obtain byte position from the display iterator, where appropriate.
1647
0bce5d9e
PE
16482013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1649
1650 print.c, process.c: Use bool for booleans.
1651 * lisp.h (wait_reading_process_output):
1652 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1653 (strout, debug_output_compilation_hack, float_to_string, print)
1654 (print_object):
1655 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1656 (decode_status, status_message, create_process, create_pty)
1657 (Fmake_network_process, Fnetwork_interface_info)
1658 (wait_reading_process_output, read_process_output)
1659 (write_queue_push, write_queue_pop, process_send_signal)
1660 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1661 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1662 Use bool for booleans.
1663 * process.c (Fnetwork_interface_list): Remove unused local.
1664 (connect_counter): Now EMACS_INT, not int.
1665
36075a19
DA
16662013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1667
1668 * bidi.c (bidi_fetch_char): Swap first and second arguments
1669 to match other functions accepting character and byte positions.
1670 Adjust comment.
1671 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1672 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1673 when you need just to move to the previous buffer position.
1674 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1675
4aae1914
EZ
16762013-03-07 Eli Zaretskii <eliz@gnu.org>
1677
1678 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1679
c54aa166
DA
16802013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1681
1682 Avoid character to byte conversions in motion subroutines.
1683 * indent.h (compute_motion, vmotion): Add byte position argument.
1684 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1685 Add eassert.
1686 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1687 Use list5 for return value.
1688 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1689 Adjust comments, style and calls to compute_motion.
1690 (Fvertical_motion): Adjust call to vmotion.
1691 * window.c (Fdelete_other_windows_internal): Record window start
1692 byte position and adjust call to vmotion.
1693 (window_scroll_line_based): Likewise with call to compute_motion.
1694 Use SET_PT_BOTH.
1695 (Frecenter): Adjust calls to vmotion.
1696
3de717bd
DA
16972013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1698
1699 * lisp.h (list2i, list3i): New functions.
1700 (list4i): Move from window.c and make LISP_INLINE.
1701 * editfns.c (make_lisp_time):
1702 * fns.c (Flocale_info):
1703 * keyboard.c (parse_modifiers):
1704 * xterm.c (x_ewmh_activate_frame): Use list2i.
1705 * instel.c (signal_after_change):
1706 * nsfns.m (Fx_server_version, Fxw_color_values):
1707 * w32fns.c (Fxw_color_values, Fx_server_version):
1708 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1709 * fileio.c (Fvisited_file_modtime):
1710 * nsfns.m (Fns_display_usable_bounds):
1711 * w32.c (ltime): Use list4i.
1712
d26e478e
EZ
17132013-03-06 Eli Zaretskii <eliz@gnu.org>
1714
a611149e
EZ
1715 * search.c (find_newline_no_quit): Rename from find_next_newline.
1716 Add commentary.
1717
1718 * lisp.h (find_newline_no_quit): Rename prototype.
1719
1720 * xdisp.c (back_to_previous_line_start)
1721 (forward_to_next_line_start, get_visually_first_element)
1722 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1723 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1724 * bidi.c (bidi_find_paragraph_start): Callers of
1725 find_newline_no_quit changed.
1726
d26e478e
EZ
1727 * msdos.c: Change encoding to cp850. (Bug#13879)
1728 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1729
1af1a51a
DA
17302013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1731
1732 Coding system support cleanup and minor refactoring.
1733 * coding.h (enum coding_result_code): Remove
1734 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1735 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1736 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1737 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1738 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1739 (decode_coding_region, encode_coding_region, decode_coding_string):
1740 Remove unused compatibility macros.
1741 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1742 (record_conversion_result): Adjust user.
1743 (syms_of_coding): Likewise.
1744 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1745 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1746 (decode_coding_object): Simplify since xrealloc never returns NULL.
1747 Add eassert.
1748
0bafabe7 17492013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 1750
9b1c3271 1751 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
1752 * sysdep.c (list_system_processes)
1753 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 1754 Make it a stub in this case; otherwise the build might fail,
0845a75c 1755 and this code hasn't been tested on such hosts anyway.
725eb027 1756 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
1757 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1758 and analyzed by Jérémie Courrèges-Anglas in
1759 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 1760
ffc65bee
DA
17612013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1762
1763 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1764 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1765 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1766 * bidi.c (bidi_find_paragraph_start): Likewise.
1767 * indent.c (vmotion): Likewise.
1768
70743157
PE
17692013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1770
1771 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1772 * filelock.c: Include <c-ctype.h>.
1773 (MAX_LFINFO): New top-level constant.
1774 (lock_info_type): Remove members pid, boot_time. Add members at,
1775 dot, colon. Change user member to be the entire buffer, not a
1776 pointer. This allows us to handle the case where a foreign
1777 pid or boot time exceeds the local range. All uses changed.
1778 (LINKS_MIGHT_NOT_WORK): New constant.
1779 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1780 (defined_WINDOWSNT): Remove.
1781 (MAKE_LOCK_NAME, file_in_lock_file_name):
1782 Always use .#FILE (not .#-FILE) for the file lock,
1783 even if it is a regular file.
1784 (rename_lock_file): New function.
1785 (create_lock_file): Use it.
1786 (create_lock_file, read_lock_data):
1787 Prefer a symbolic link for the lock file, falling back on a
1788 regular file if symlinks don't work. Do not try to create
1789 symlinks on MS-Windows, due to security hassles. Stick with
1790 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1791 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1792 host may be using a Windowsish file system, and cannot use
1793 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1794 doesn't work. Don't fail merely because of a symlink-contents
1795 length limit in the current file system; fall back on regular
1796 files. Increase the symlink contents length limit to 8 KiB, this
1797 should be big enough for any real use and doesn't crunch the
1798 stack.
1799 (create_lock_file, lock_file_1, read_lock_data):
1800 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1801 (lock_file_1): Return error number, not bool. All callers changed.
1802 (ELOOP): New macro, if not already defined.
1803 (read_lock_data): Return size of lock file contents, not Lisp object.
1804 All callers changed. Handle a race condition if some other process
1805 replaces a regular-file lock with a symlink lock or vice versa,
1806 while we're trying to read the lock.
1807 (current_lock_owner): Parse contents more carefully, to help avoid
1808 confusing a regular-file lock with some other application's use
1809 of the file. Check for lock file contents being too long, or
1810 not parsing correctly.
1811 (current_lock_owner, lock_file):
1812 Allow foreign pid and boot times that exceed the local range.
1813 (current_lock_owner, lock_if_free, lock_file):
1814 Simplify allocation of lock file contents.
1815 * w32.c (sys_rename_replace): New function, containing most of
1816 the contents of the old sys_rename.
1817 (sys_rename): Use it.
1818 (fchmod): New dummy function.
1819 * w32.h (sys_rename_replace, fchmod): New decls.
1820
05e193f1
EZ
18212013-03-05 Eli Zaretskii <eliz@gnu.org>
1822
1823 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1824 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1825 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1826 <dmantipov@yandex.ru>.
1827
3bfc46eb
DA
18282013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1829
1830 * composite.c (get_composition_id, fill_gstring_header):
1831 Use make_uninit_vector where appropriate.
1832 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1833 * xselect.c (clean_local_selection_data): Likewise.
1834
84ac6f9d
PE
18352013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1836
1837 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1838 * image.c (imagemagick_load_image): Calculate height and width
1839 after flattening the image, not before.
1840
42926ec8
DA
18412013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1842
1843 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1844 * ftfont.c (ftfont_shape_by_flt): Likewise.
1845 * w32uniscribe.c (uniscribe_shape): Likewise.
1846
b5029e23
PE
18472013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1848
1849 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1850 The old approach, which fell back on DIR/.#FILE.0 through
1851 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1852 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1853 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1854 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1855 because the locking mechanism was never reliable in that case).
1856 This patch fixes this and other bugs discovered by a code
1857 inspection that was prompted by
1858 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1859 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1860 to avoid interoperability problems between the MS-Windows and
1861 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1862 instances of Emacs now ignore each others' locks.
1863 * filelock.c (defined_WINDOWSNT): New constant.
1864 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1865 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1866 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1867 regular files on MS-Windows hosts.
1868 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1869 Use SAFE_ALLOCA to avoid problems with long file names.
1870 (MAX_LFINFO): Now a local constant, not a global macro.
1871 (IS_LOCK_FILE): Remove.
1872 (lock_file_1): Don't inspect errno if symlink call succeeds;
1873 that's not portable.
1874 (lock_file): Document that this function can return if lock
1875 creation fails.
2db41375 1876 (lock_file): Don't access freed storage.
b5029e23 1877
b270d116
AS
18782013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1879
1880 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1881
81c23309
PE
18822013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1883
1884 * textprop.c: Use bool for booleans.
1885 (validate_interval_range, Fadd_text_properties)
1886 (Fremove_text_properties): Prefer bool to int when either works.
1887
18f2ac09
EZ
18882013-03-02 Eli Zaretskii <eliz@gnu.org>
1889
27a98a62
SM
1890 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1891 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1892 modify_region, re-do processing starting from the call to
1893 validate_interval_range. (Bug#13743)
1894
929aeac6 18952013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1896
1897 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1898 (Bug#13546).
1899
531e70ec
EZ
19002013-02-27 Eli Zaretskii <eliz@gnu.org>
1901
1902 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1903 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1904 access to the lock file until it is written and closed.
1905 (Bug#13807)
1906
6e65b9cc
PE
19072013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1908
1909 * callint.c (Qcall_interactively):
1910 * macros.c (Qexecute_kbd_macro):
1911 Now static.
1912
3b166f09
BG
19132013-02-26 Bastien Guerry <bzg@gnu.org>
1914
1915 * window.c (Frecenter): Tiny docstring enhancement.
1916
ecc0fdd4
PE
19172013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1918
1919 Minor textprop integer cleanup.
1920 * intervals.h, textprop.c (add_text_properties_from_list):
1921 Return void, not int, since nobody uses the return value.
1922 * textprop.c (validate_plist, add_properties, remove_properties)
1923 (Fadd_text_properties):
1924 Don't assume list length fits in int.
1925 (interval_has_all_properties, interval_has_some_properties)
1926 (interval_has_some_properties_list, add_properties, remove_properties)
1927 (Fadd_text_properties, Fremove_text_properties)
1928 (Fremove_list_of_text_properties, text_property_stickiness):
1929 Use bool for booleans.
1930 (Fadd_text_properties, Fremove_text_properties):
1931 (Fremove_list_of_text_properties):
1932 Reindent do-while as per GNU style.
1933
0248b0d7
EZ
19342013-02-25 Eli Zaretskii <eliz@gnu.org>
1935
343a2aef
EZ
1936 Implement CLASH_DETECTION for MS-Windows.
1937
1938 * filelock.c [WINDOWSNT]: Include w32.h.
1939 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1940 function of that name. Up-case the macro arguments.
1941 (IS_LOCK_FILE): New macro.
1942 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1943 (create_lock_file): New function, with body extracted from
1944 lock_file_1.
1945 [WINDOWSNT]: Implement lock files by writing a regular file with
1946 the lock information as its contents.
1947 (read_lock_data): New function, on Posix platforms just calls
1948 emacs_readlinkat.
1949 [WINDOWSNT]: Read the lock info from the file.
1950 (current_lock_owner): Call read_lock_data instead of calling
1951 emacs_readlinkat directly.
1952 (lock_file) [WINDOWSNT]: Run the file name through
1953 dostounix_filename.
1954
1955 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1956 just check if the process by that PID exists.
1957
1958 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1959 also present, as doing so will fail to error out if the file
1960 already exists.
1961
1962 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1963
0248b0d7
EZ
1964 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1965 (Fremove_list_of_text_properties): Skip all of the intervals in
1966 the region between START and END that already have resp. don't
27a98a62
SM
1967 have the requested properties, not just the first one.
1968 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1969 properties. (Bug#13743)
1970
b5071fc7
SM
19712013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1972
1973 * callint.c (Fcall_interactively): Use the right lexical environment
1974 for `interactive' specs (bug#13811).
1975 * eval.c (Feval): Accept a lexical environment.
1976
1ddc2bd6
PE
19772013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1978
1979 Simplify data_start configuration (Bug#13783).
1980 This is a followon simplification to the fix for Bug#13650.
1981 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1982 (START_FILES): Remove. All uses removed.
1983 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1984 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1985 (buildobj.h): Use it.
1986 ($(ALLOBJS)): Depend on globals.h.
1987 (temacs$(EXEEXT)): Use $(ALLOBJS).
1988 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1989 * deps.mk (vm-limit.o):
1990 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1991 Do not depend on mem-limits.h.
1992 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1993 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1994 [__GNUC__ && !ORDINARY_LINK]: Remove.
1995 * mem-limits.h, pre-crt0.c: Remove.
1996 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1997 * unexcoff.c (etext): New decl.
1998 (make_hdr): Use DATA_START instead of start_of_data.
1999 * vm-limit.c: Move most of mem-limits.h's contents here.
2000 (data_start): New decl. It's OK if this is approximate,
2001 so simplify-away some unnecessary exactness.
2002 (POINTER): Remove; all uses removed.
2003 (data_space_start): Now char *, to avoid casts.
2004 (exceeds_lisp_ptr): New function, replacing the old
2005 EXCEEDS_LISP_PTR macro. All uses changed.
2006 (check_memory_limits): Simplify and remove casts.
2007 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
2008 (memory_warnings): Use data_start instead of start_of_data.
2009
51aa2a8b
AS
20102013-02-24 Andreas Schwab <schwab@linux-m68k.org>
2011
2012 * xdisp.c (set_message): Only check for debug-on-message if STRING
2013 is a string. (Bug#13797)
2014
1938d88c
PE
20152013-02-24 Paul Eggert <eggert@cs.ucla.edu>
2016
2017 Fix regression introduced by July 10 filelock.c patch.
2018 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
2019 2012-07-10 patch to this file. Reported by Eli Zaretskii in
2020 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
2021 and diagnosed by Andreas Schwab in
2022 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
2023
fcee5028
PE
20242013-02-22 Paul Eggert <eggert@cs.ucla.edu>
2025
2026 Assume C89 or better.
2027 * ralloc.c (SIZE, POINTER, NIL):
2028 * vm-limit.c (POINTER):
2029 Remove, replacing all uses with C89 equivalents. These old
2030 symbols were present only for porting to pre-C89 platforms.
2031
d78cf5ed
CB
20322013-02-22 Claudio Bley <claudio.bley@gmail.com>
2033
2034 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
2035 This avoids warning messages reported as part of Bug#13546.
2036
6bcd97a4
KB
20372013-02-21 Ken Brown <kbrown@cornell.edu>
2038
2039 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
2040
b6c2bfff
SM
20412013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
2042
e11dacb5
SM
2043 * sheap.c (report_sheap_usage): Prefer message1_nolog.
2044
b6c2bfff
SM
2045 * keyboard.c (Qcommand_execute): New var.
2046 (command_loop_1, read_char): Use it.
2047 (Fcommand_execute): Remove, replace by an Elisp implementation.
2048 (syms_of_keyboard): Adjust accordingly.
2049
f4ad7ea1 20502013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 2051
d69f1120
DC
2052 * sheap.c (report_sheap_usage): Use message, not message1, so
2053 that we don't try to create a buffer while we're in the middle
2054 of dumping Emacs. Explain why.
b6c2bfff 2055
2a14a4f1 20562013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 2057
2a14a4f1
DA
2058 * search.c (find_newline): Return byte position in bytepos.
2059 Adjust comment.
b6c2bfff
SM
2060 (find_next_newline_no_quit, find_before_next_newline):
2061 Add bytepos argument.
2a14a4f1
DA
2062 * lisp.h (find_newline, find_next_newline_no_quit)
2063 (find_before_next_newline): Adjust prototypes.
2064 * bidi.c (bidi_find_paragraph_start):
2065 * editfns.c (Fconstrain_to_field, Fline_end_position):
2066 * indent.c (compute_motion, vmotion):
2067 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
2068 (get_visually_first_element, move_it_vertically_backward):
2069 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
2070
872faefb 20712013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
2072
2073 * w32proc.c (new_child): Avoid leaking handles if the subprocess
2074 resources were not orderly released.
2075
fd80c659
EZ
20762013-02-17 Eli Zaretskii <eliz@gnu.org>
2077
2078 * xdisp.c (x_draw_vertical_border): For a window that is neither
2079 the leftmost nor the rightmost, redraw both the left and the right
2080 vertical borders. (Bug#13723)
2081
2f73da9c
SM
20822013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
2083
2084 * xml.c (init_libxml2_functions):
2085 * sound.c (sound_warning):
2086 * sheap.c (report_sheap_usage):
2087 * process.c (wait_reading_process_output):
2088 * msdos.c (XMenuActivate):
2089 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
2090 * keyboard.c (top_level_1):
2091 * editfns.c (Fmessage, Fmessage_box):
2092 * callint.c (Fcall_interactively):
2093 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
2094
fd9547e8
JD
20952013-02-17 Jan Djärv <jan.h.d@swipnet.se>
2096
2097 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
2098 * frame.c (syms_of_frame): ... to here.
2099
f277993b
EZ
21002013-02-16 Eli Zaretskii <eliz@gnu.org>
2101
c7939585
EZ
2102 * w32.c (sys_chown): Remove unused function.
2103
cd91fb4b
EZ
2104 * w32term.c <input_signal_count>: Declare 'volatile'
2105 unconditionally. (Bug#9066)
2106
f277993b
EZ
2107 * w32.c (set_errno): Reset h_errno and don't set it to any other
2108 value. Set errno instead.
2109 (check_errno): Reset h_errno.
2110 (sys_socket, socket_to_fd, sys_bind, sys_connect)
2111 (sys_gethostname, sys_getservbyname, sys_getpeername)
2112 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2113 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
2114 h_errno.
2115 (sys_gethostbyname): Set h_errno only errors detected.
2116
e454145b
PE
21172013-02-15 Paul Eggert <eggert@cs.ucla.edu>
2118
2119 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
2120
bcf7fe2a
EZ
21212013-02-15 Eli Zaretskii <eliz@gnu.org>
2122
ef9c57e2
EZ
2123 * keyboard.c (read_char): Fix calculation of auto-save time out
2124 when auto-save-timeout is less than 4. (Bug#13720)
2125
ef862e20 2126 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 2127 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 2128
bcf7fe2a
EZ
2129 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
2130 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
2131 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
2132 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
2133 make sure errno is set to an appropriate value. (Bug#13546)
2134 (socket_to_fd): Add assertion against indexing fd_info[] with a
2135 value that is out of bounds.
2136 (sys_accept): If fd is negative, do not set up the child_process
2137 structure for reading.
2138
0063fdb1
DA
21392013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
2140
2141 * composite.c (fill_gstring_header): Remove useless prototype.
2142 Break long line.
2143 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
2144 * print.c (PRINTDECLARE, print_object):
2145 * search.c (compile_pattern, fast_looking_at, search_buffer):
2146 (simple_search, boyer_moore, Freplace_match):
2147 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
2148 (get_overlay_arrow_glyph_row, display_mode_element):
2149 (decode_mode_spec_coding, message3):
2150 * xfaces.c (face_at_string_position): Use bool for booleans.
2151 Adjust comments.
2152
648e5523 21532013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 2154
35b3a27e
PE
2155 Fix AIX port (Bug#13650).
2156 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
2157 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
2158 was #undeffed earlier, so it cannot be used as a macro here.
2159 Use the constant and not the macro.
35b3a27e 2160
648e5523 21612013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 2162
0e4e7b74
EZ
2163 * w32proc.c (new_child): If no vacant slots are found in
2164 child_procs[], make another pass looking for slots whose process
2165 has exited or died. (Bug#13546)
2166
6e432f0c
EZ
2167 * w32.c (sys_pipe): When failing due to file descriptors above
2168 MAXDESC, set errno to EMFILE.
2169 (_sys_read_ahead): Update cp->status when failing to read serial
2170 communications input, so that the status doesn't stay at
2171 STATUS_READ_IN_PROGRESS. (Bug#13546)
2172
51b3a99c
JD
21732013-02-14 Jan Djärv <jan.h.d@swipnet.se>
2174
2175 * gtkutil.c (tb_size_cb): New function.
2176 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
2177
e31560a7
SM
21782013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
2179
2180 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
2181 an event.
2182
fe336261
SM
21832013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2184
2185 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
2186
5a655b9f
DA
21872013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
2188
2189 * font.c (font_range): Add pos_byte argument. Adjust comment
2190 and break long line.
2191 * font.h (font_range): Adjust prototype.
2192 * composite.c (autocmp_chars): Pass byte position to font_range.
2193 Break long line. Remove useless prototype and format comment.
2194
1a359750
GM
21952013-02-13 Glenn Morris <rgm@gnu.org>
2196
2197 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
2198
01fcc3a5 21992013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 2200
f53f992a
PE
2201 Improve AIX port some more (Bug#13650).
2202 With this, it should be as good as it was in 23.3, though it's
2203 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
2204 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
2205 * unexaix.c (start_of_text): Remove.
2206 (_data, _text): Declare as char[], not int, as AIX manual suggests.
2207 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
2208 (orig_load_scnptr, orig_data_scnptr):
2209 Now off_t, not long, since they are file offsets.
2210 (make_hdr): Use _data, not start_of_data ().
2211 This is the key part of the fix.
2212 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
2213 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
2214
4458c255
PE
2215 * pre-crt0.c (data_start): Initialize to 1.
2216 This ports to compilers that optimize the external declaration
2217 'int x = 0;' as if it were 'int x;' to shrink the executable.
2218
227be86d
PE
2219 Improve AIX port (Bug#13650).
2220 This doesn't fix the bug, but it makes progress: Emacs builds now.
2221 * unexaix.c: Include inttypes.h, stdarg.h.
2222 (report_error, report_error_1): Mark as _Noreturn.
2223 (report_error): Don't report the wrong errno.
2224 (report_error_1): Now varargs. All callers changed.
2225 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
2226 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
2227 (write_ptr): Use %p to print address rather than %lx and a cast
2228 to unsigned long. Grow buffer a bit, to be safer.
2229
01fcc3a5 22302013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
2231
2232 * bidi.c (bidi_resolve_neutral): After finding the next
2233 non-neutral character, accept NEUTRAL_ON type as well, because
2234 directional control characters, such as LRE and RLE, have their
2235 type converted to that by bidi_resolve_weak. This avoids aborts
2236 when LRE/RLE follows a run of neutrals.
2237 (bidi_move_to_visually_next): Assert that return value of
2238 bidi_peek_at_next_level is non-negative. Negative values will
2239 cause an infloop.
2240
83be8524
PE
22412013-02-13 Paul Eggert <eggert@cs.ucla.edu>
2242
2243 Minor getenv-related fixes.
2244 * callproc.c (Fcall_process_region) [!DOS_NT]:
2245 Avoid unnecessary duplicate call to getenv.
2246 * callproc.c (init_callproc):
2247 * dispnew.c (init_display):
2248 * sysdep.c (sys_subshell):
2249 Omit unnecessary cast of getenv or egetenv.
2250
45b2b768
JB
22512013-02-13 Juanma Barranquero <lekktu@gmail.com>
2252
2253 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
2254 Update dependencies.
2255
33b49d71
EZ
22562013-02-12 Eli Zaretskii <eliz@gnu.org>
2257
2258 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
2259 marker's position.
2260 (display_line): Set w->region_showing to the value of
2261 it->region_beg_charpos, not to -1. This fixes redisplay
2262 optimization when cursor is moved up after M->. (Bug#13623)
2263 (Bug#13626)
c4131562
EZ
2264 (try_scrolling): Scroll text up more if point is too close to ZV
2265 and inside the scroll margin. This makes sure point is moved
2266 outside the scroll margin in these cases.
33b49d71
EZ
2267
2268 * window.h (struct window): region_showing can no longer be
2269 negative.
2270
b09a4810
PE
22712013-02-11 Paul Eggert <eggert@cs.ucla.edu>
2272
a84b7c53
PE
2273 Tune by using memchr and memrchr.
2274 * doc.c (Fsnarf_documentation):
2275 * fileio.c (Fsubstitute_in_file_name):
2276 * search.c (find_newline, scan_newline):
2277 * xdisp.c (pos_visible_p, display_count_lines):
2278 Use memchr and memrchr rather than scanning byte-by-byte.
2279 * search.c (find_newline): Rename from scan_buffer.
2280 Omit first arg TARGET, as it's always '\n'. All callers changed.
2281
b09a4810
PE
2282 Clean up read_key_sequence a tiny bit more.
2283 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2284 (read_key_sequence): Remove unused locals.
2285
99d0d6dc
SM
22862013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2287
2288 Clean up read_key_sequence a bit; reread active keymaps after first event.
2289 * keyboard.c (read_char, read_char_x_menu_prompt)
2290 (read_char_minibuf_menu_prompt):
2291 Replace nmaps+maps with a single `map' arg.
2292 (follow_key): Operate on a single map.
2293 (active_maps): New function.
2294 (test_undefined): Also return true for nil bindings.
2295 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2296 a single (composed) keymap. Remember `first_event' to choose the right
2297 set of active keymaps. Recompute the set of keymaps after receiving
2298 the first event. Remove GOBBLE_FIRST_EVENT.
2299 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2300 * keyboard.h (read_char): Update declaration.
2301 * lread.c (read_filtered_event): Adjust call to read_char.
2302
f5e1b680
EZ
23032013-02-11 Eli Zaretskii <eliz@gnu.org>
2304
99d0d6dc
SM
2305 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2306 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
2307 in the window. (Bug#13675)
2308
f74de345
DA
23092013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2310
2311 * marker.c (set_marker_internal): If desired position is passed
2312 as a marker, avoid call to buf_charpos_to_bytepos.
2313 * window.c (Fset_window_point): Omit redundant type checking.
2314 (Fset_window_start): Likewise. Format comment.
2315 (window_scroll_pixel_based): Use set_marker_restricted_both
2316 with character and byte positions obtained from an iterator.
2317 (Fset_window_configuration): Use set_marker_restricted_both.
2318 * xdisp.c (message_dolog): Likewise.
2319
a4ba3963
EZ
23202013-02-10 Eli Zaretskii <eliz@gnu.org>
2321
99d0d6dc
SM
2322 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2323 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
2324 too far. This speeds up some redisplay operations. (Bug#13675)
2325
68643cde
DA
23262013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2327
2328 * syntax.c (scan_sexps_forward): Fix byte position calculation
2329 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2330
7ba11bee
PE
23312013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2334 that was not needed.
2335
eff1c190
PE
23362013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2337
2338 Minor hashing refactoring.
2339 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2340 (sxhash_float): Return EMACS_UINT, for consistency with the other
2341 hash functions.
2342 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2343 non-static inline function and therefore can't use static vars.
2344 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2345 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2346 with the other hash functions.
2347
6b48c831
EZ
23482013-02-09 Eli Zaretskii <eliz@gnu.org>
2349
4dde2087
EZ
2350 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2351 XXXXXX part of the temporary file pattern is not downcased even
2352 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 2353
8549f9e8
EZ
2354 * xdisp.c (decode_mode_spec): Remove handling of %t.
2355
6b48c831
EZ
2356 * msdos.c (careadlinkatcwd): Remove.
2357
75a65c7e
SM
23582013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2359
2360 * lread.c (skip_dyn_bytes): New function (bug#12598).
2361 (read1): Use it. Use getc instead of READCHAR to read bytes.
2362 (load_each_byte): Remove. Update users.
2363
8ca30920
DA
23642013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2365
2366 * search.c (scan_buffer): Calculate end byte position just once.
2367 (scan_newline): Do not recalculate start_byte.
2368 (search_command): Use eassert.
2369 * syntax.c (struct lisp_parse_state): New member location_byte.
2370 (scan_sexps_forward): Record from_byte and avoid redundant
2371 character to byte position calculation ...
2372 (Fparse_partial_sexp): ... here. Break too long line.
2373
25721f5b
DA
23742013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2375
2376 * lisp.h (make_uninit_vector): New function.
2377 * alloc.c (Fvector, Fmake_byte_code):
2378 * ccl.c (Fregister_ccl_program):
2379 * charset.c (Fdefine_charset_internal, define_charset_internal):
2380 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2381 * composite.c (syms_of_composite):
2382 * font.c (Fquery_font, Ffont_info, syms_of_font):
2383 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2384 * ftfont.c (ftfont_shape_by_flt):
2385 * indent.c (recompute_width_table):
2386 * nsselect.m (clean_local_selection_data):
2387 * syntax.c (init_syntax_once):
2388 * w32unsubscribe.c (uniscribe_shape):
2389 * window.c (Fcurrent_window_configuration):
2390 * xfaces.c (Fx_family_fonts):
2391 * xselect.c (selection_data_to_lisp_data): Use it.
2392
9a9d91d9
DA
23932013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2394
2395 * coding.c (Fdefine_coding_system_internal): Use AREF where
2396 argument is known to be a vector.
2397 * fns.c (Flocale_info): Likewise for ASET.
2398 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2399 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2400
6871e574
JD
24012013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2402
2403 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2404 height.
2405
2406 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2407 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2408 updateCollectionBehaviour.
2409
2410 * nsterm.m (NEW_STYLE_FS): Remove.
2411 (ns_last_use_native_fullscreen): New variable.
2412 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2413 (x_set_window_size): Do not take title bar and tool bar into account
2414 if isFullscreen returns YES.
2415 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2416 (check_native_fs): New function.
2417 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2418 (ns_term_init): Remove NEW_STYLE_FS.
2419 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2420 and tool bar if isFullscreen returns NO.
2421 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2422 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2423 with HAVE_NATIVE_FS.
2424 (window:willUseFullScreenPresentationOptions:): New method.
2425 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2426 Hide toolbar if not enabled (Bug#13444).
2427 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2428 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2429 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2430 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2431 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2432 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2433 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2434 (syms_of_nsterm): Add ns-use-native-fullscreen.
2435
3f011c7f
PE
24362013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2437
2438 * fileio.c (Qchoose_write_coding_system): Now static.
2439
86f7c0fe
EZ
24402013-02-04 Eli Zaretskii <eliz@gnu.org>
2441
2442 * xdisp.c (window_buffer_changed): region_showing can be negative,
2443 which still means region is being displayed.
2444 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
2445 whole window when showing region and the mark has changed.
2446 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
2447 (display_line): If it->region_beg_charpos is non-zero, set the
2448 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2449
2450 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2451 not bitfield of 1 bit.
2452
5257b701
DC
24532013-02-03 Daniel Colascione <dancol@dancol.org>
2454
2455 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2456 daemon mode works on cygw32 when Emacs is installed and not just
2457 during development.
2458
8ea41ea9
PE
24592013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 Avoid file time stamp bug on MS-Windows (Bug#13149).
2462 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2463 as FAT32 doesn't update time stamps when truncating them.
2464 Also, check that a file time stamp is not a multiple of 100 ns;
2465 this should catch all instances of the problem on MS-Windows,
2466 as its native file system resolution is 100 ns or worse, and
2467 checking for a non-multiple of 100 ns should impose only a small
2468 overhead on systems with ns resolution.
2469
94fbc901 24702013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 2471
e7ac588e
EZ
2472 Avoid encoding file names on MS-Windows when they need to be run
2473 through dostounix_filename.
2474 * w32.c (normalize_filename): Accept an additional argument
2475 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2476 downcase it even if w32-downcase-file-names is non-nil.
2477 (dostounix_filename): Accept an additional argument MULTIBYTE and
2478 pass it to normalize_filename.
2479 (emacs_root_dir): Adjust.
2480
2481 * msdos.h (dostounix_filename): Adjust prototype.
2482
2483 * w32.h (dostounix_filename): Adjust prototype.
2484
2485 * msdos.c (dostounix_filename): Accept an additional argument and
2486 ignore it.
2487 (init_environment): Adjust callers of dostounix_filename.
2488
2489 * fileio.c (Ffile_name_directory, file_name_as_directory)
2490 (directory_file_name, Fexpand_file_name)
2491 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2492 dostounix_filename.
2493 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2494 non-nil.
2495 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2496 variables, as egetenv is case-insensitive for DOS_NT.
2497
2498 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2499 with an encoded file name.
2500
99d0d6dc
SM
2501 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2502 Adjust calls to dostounix_filename.
e7ac588e
EZ
2503
2504 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2505
2506 * unexw32.c (unexec): Adjust call to dostounix_filename.
2507
2508 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2509
2510 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2511 dostounix_filename.
2512
2513 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2514 dostounix_filename.
2515
e7c3fb06
EZ
2516 * callproc.c (Fcall_process): Make sure program name in PATH and
2517 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2518 is passed to exec/spawnve, which fails unless the file-name
2519 encoding is UTF-8.
2520
18a80473
EZ
2521 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2522 even if w32-quote-process-args is nil.
2523
35e85499
PE
25242013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2525
2526 Fix timestamp bug when write-region appends nothing (Bug#13149).
2527 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2528 the file's time stamp doesn't change if Emacs happens to write nothing
2529 to the file, and on a buggy file system this could cause Emacs to
2530 incorrectly infer that the file system doesn't have the bug.
2531 Avoid this problem by inhibiting the inference in this case.
2532
422ff52b
DA
25332013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2534
2535 * window.h (struct window): Convert base_line_number, base_line_pos
2536 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2537 Convert region_showing member from Lisp_Object to bitfield.
2538 Remove sequence_number member. Adjust comments.
2539 * window.c (sequence_number): Remove.
2540 (make_window): Initialize column_number_displayed.
2541 * print.c (print_object): Follow the printed representation of
2542 frames and print window pointer to distinguish between windows.
2543 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2544 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2545 (wset_column_number_displayed, wset_region_showing): Remove.
2546 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2547 (try_scrolling, try_cursor_movement, redisplay_window)
2548 (try_window_reusing_current_matrix, try_window_id, display_line)
2549 (display_mode_lines, decode_mode_spec): Adjust users.
2550 * .gdbinit (pwinx): Do not print sequence_number.
2551
8654f9d7
PE
25522013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2553
2554 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2555 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2556 * dired.c: Include <fcntl.h>.
2557 (open_directory): New function, which uses open and fdopendir
2558 rather than opendir. DOS_NT platforms still use opendir, though.
2559 (directory_files_internal, file_name_completion): Use it.
2560 (file_attributes): New function, with most of the old Ffile_attributes.
2561 (directory_files_internal, Ffile_attributes): Use it.
2562 (file_attributes, file_name_completion_stat): First arg is now fd,
2563 not dir name. All uses changed. Use fstatat rather than lstat +
2564 stat.
2565 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2566 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2567 (emacs_readlinkat): New function, with much of the old
2568 Ffile_symlink_p, but with an fd argument for speed.
2569 It uses readlinkat rather than careadlinkatcwd, so that it
2570 need not assume the working directory.
2571 (Ffile_symlink_p): Use it.
2572 * filelock.c (current_lock_owner): Use emacs_readlinkat
2573 rather than emacs_readlink.
2574 * lisp.h (emacs_readlinkat): New decl.
2575 (READLINK_BUFSIZE, emacs_readlink): Remove.
2576 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2577 (emacs_norealloc_allocator, emacs_readlink): Remove.
2578 This stuff is moved to fileio.c.
2579 * w32.c (fstatat, readlinkat): New functions.
2580 (careadlinkat): Don't check that fd == AT_FDCWD.
2581 (careadlinkatcwd): Remove; no longer needed.
2582
9dbda100
GM
25832013-01-31 Glenn Morris <rgm@gnu.org>
2584
2585 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
2586 (Fwrite_region): Update for new choose_write_coding_system args.
2587 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
2588 (syms_of_fileio): Add choose-write-coding-system.
2589
3f82a88a 25902013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
2591
2592 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2593 (sys_close): Zero out the flags for the file descriptor before
2594 closing it. (Bug#13546)
2595
806fed21 2596 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
2597 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2598 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
2599 DBCS. (Bug#13553)
2600
6ee4509a
EZ
2601 * w32.c (w32_get_long_filename, init_environment, readlink):
2602 Support file names encoded in DBCS codepages.
26854e9c
EZ
2603 (readlink): Use the current file-name-coding-system, not the ANSI
2604 codepage, to decode and handle targets of symlinks.
6ee4509a 2605
cf01a359
EZ
26062013-01-28 Eli Zaretskii <eliz@gnu.org>
2607
2608 * w32.c (opendir): Now accepts a 'const char *'.
2609
6fd326b7
DA
26102013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2611
2612 Remove obsolete redisplay code. See the discussion at
2613 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2614 * dispnew.c (preemption_period, preemption_next_check): Remove.
2615 (Vredisplay_preemption_period): Likewise.
2616 (update_frame, update_single_window, update_window, update_frame_1):
2617 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2618 used, following the 2012-06-22 change.
2619
d8cd7742
EZ
26202013-01-25 Eli Zaretskii <eliz@gnu.org>
2621
2622 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2623
266fee4f
DA
26242013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2625
2626 * font.c (num_fonts): Remove the leftover from old
2627 debugging code. Adjust comment style here and there.
59e624b3
DA
2628 * insdel.c (insert_1): Remove.
2629 * lisp.h (insert_1): Remove prototype.
2630 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 2631
830e46e6 26322013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
2633
2634 * w32.c (max_filename_mbslen): New function.
2635 (normalize_filename, readdir): Use it to detect locales where ANSI
2636 encoding of file names uses a double-byte character set (DBCS).
2637 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
2638 CharNextExA, instead of incrementing a 'char *' pointer.
2639 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 2640
81abbb95
EZ
2641 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2642 request of memory reservation to 1.7GB. (Bug#13065)
2643
830e46e6 26442013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
2645
2646 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2647 at check_extra_latin label. (Bug#13505)
2648
fd3ceb09
DA
26492013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2650
2651 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2652 Avoid redundant calls to strlen.
2653
edfa7fa0
DA
26542013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2655
2656 Drop async_visible and async_iconified fields of struct frame.
2657 This is possible because async input is gone; for details, see
2658 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2659 * frame.h (struct frame): Remove async_visible and async_iconified
2660 members, convert garbaged to unsigned bitfield. Adjust comments.
2661 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2662 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2663 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2664 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2665 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2666 * w32term.c: Ditto.
2667 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2668 properly. Likewise for obscured.
2669 * xterm.c: Ditto.
266fee4f 2670 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
2671 properly.
2672 * nsterm.m: Ditto.
2673 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2674
5ad86e34
DA
26752013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2676
2677 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2678 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2679
b09cca6a
SM
26802013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2681
2682 * xdisp.c (message2, message2_nolog): Remove functions.
2683 (message3, message3_nolog): Extract nbytes and multibyteness directly
2684 from the string. Change all callers.
2685 (message3_nolog): Don't set message_enable_multibyte since set_message
2686 will reset it anyway.
2687 (message1, message1_nolog): Use message3.
2688 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2689 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2690 (set_message): Drop all but the second arg, which has to be a string.
2691 (set_message_1): Simplify now that we know that a1 is NULL and the
2692 second arg is a string.
2693 * frame.h (struct frame): Remove `message_buf' field.
2694 Use glyphs_initialized_p instead.
2695 (FRAME_MESSAGE_BUF): Remove macro.
2696 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2697 * lisp.h (message2, message2_nolog): Remove declarations.
2698 (message3, message3_nolog): Update declarations.
2699 * keyboard.c (read_char_minibuf_menu_text)
2700 (read_char_minibuf_menu_width): Remove vars.
2701 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2702 to correctly handle multibyte strings.
2703 * frame.c (delete_frame): Don't free message_buf any more.
2704 * editfns.c (message_text, message_length): Remove vars.
2705 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2706 * fileio.c (auto_save_error): Use message3 instead of message2.
2707 * dispnew.c (adjust_frame_message_buffer): Remove function.
2708
54ab1c5a
EZ
27092013-01-23 Eli Zaretskii <eliz@gnu.org>
2710
2711 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2712 real estate used for the tool bar and the menu bar.
2713
6c27465b
DA
27142013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2715
2716 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2717 hidden buffer is prepared to modification (Bug#13164).
2718
9d93ce29
DA
27192013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2720
2721 * window.h (struct window): Change window_end_valid member from
2722 Lisp_Object to a bitfield. Adjust comments.
2723 (wset_window_end_valid): Remove.
2724 * window.c (adjust_window_count): Clear window_end_valid.
2725 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2726 (Fwindow_line_height, set_window_buffer, Frecenter)
2727 (Fsplit_window_internal, Fdelete_other_windows_internal)
2728 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2729 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2730 * xdisp.c (check_window_end, reconsider_clip_changes)
2731 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2732 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2733 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2734
1dcb8ea2
DA
27352013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2736
2737 * xdisp.c (mark_window_display_accurate): Simplify the loop
2738 assuming that the only one of vchild, hchild or buffer window
2739 slots is non-nil. Call mark_window_display_accurate_1 for
2740 the leaf windows only.
2741 (mark_window_display_accurate_1): Always assume leaf window.
2742 Adjust comment.
2743
b41b8a7e
PE
27442013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2745
593a5f2e
PE
2746 * emacs.c (Qkill_emacs_hook): Now static.
2747
b41b8a7e
PE
2748 * fileio.c (Finsert_file_contents): Simplify.
2749 Remove unnecessary assignments and tests.
2750
84e5ed96
EZ
27512013-01-21 Eli Zaretskii <eliz@gnu.org>
2752
2753 * w32.c (acl_set_file): Don't test for errors unless
2754 set_file_security returns FALSE. Avoids spurious errors when
2755 saving files.
2756
2ef88fd4
DA
27572013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2758
2759 * fileio.c (Finsert_file_contents): Revert code introduced at
2760 2013-01-18 in favor of the simpler and generally better fix.
2761 Save stack space by removing 'buffer' and reusing 'read_buf'
2762 where appropriate.
2763
d7a0a7c9
PE
27642013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2765
2766 * lisp.h (eabs): Define unconditionally (Bug#13419).
2767 The old "#if !defined (eabs)" was an unnecessary revenant of back
2768 when this macro was called "abs". Document 'eabs' better.
2769
795e7a5b 27702013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
2771
2772 * fns.c (Frandom): Doc fix.
2773
59ac2d13
EZ
27742013-01-19 Eli Zaretskii <eliz@gnu.org>
2775
2776 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2777 segfault when there are lots of overlays.
2778
2779 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
2780 when there are lots of overlays.
2781 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
2782 for the details and a way to reproduce.
2783
b3fbb395
PE
27842013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2785
3a955a1f
PE
2786 * fileio.c: Use O_APPEND to append.
2787 This corresponds better to the natural interpretation of "append",
2788 and avoids the need to open the output file twice, or to invoke
2789 lseek when APPEND is neither nil nor a number.
2790 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2791 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2792 file possibly twice, and lseeking to its end; this avoids the
2793 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2794 at the same time: the combination is never needed and apparently
2795 it doesn't work with DOS_NT.
2796
21cd50b8
PE
2797 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2798 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2799
b3fbb395
PE
2800 Allow floating-point file offsets.
2801 Problem reported by Vitalie Spinu in
2802 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2803 * fileio.c (emacs_lseek): Remove.
2804 (file_offset): New function.
2805 (Finsert_file_contents, Fwrite_region): Use it.
2806
73c14218
CY
28072013-01-19 Chong Yidong <cyd@gnu.org>
2808
2809 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2810 aborting on Fsignal (Bug#13289).
2811
6a9465f3
EZ
28122013-01-19 Eli Zaretskii <eliz@gnu.org>
2813
2814 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2815 set_file_security as failure due to insufficient privileges.
2816 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 2817 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 2818
fa705c99
PE
28192013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2820
9fe43ff6
PE
2821 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2822 The bug was observed on Ubuntu operating inside a virtual machine,
2823 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2824 The workaround introduces a race condition on non-buggy hosts,
2825 but it's an unlikely race and anyway there's a nearly identical
2826 nearby race that can't be fixed.
2827 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2828 New static vars.
2829 (Fwrite_region): Test for file system time stamp bug.
2830 (init_fileio): New function.
2831 * lisp.h (init_fileio): Declare it.
2832 * emacs.c (main): Call it.
2833
fa705c99
PE
2834 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2835 and make it more consistent with other stat-failure diagnostics.
2836
e07469fa
DA
28372013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2838
99d0d6dc
SM
2839 Fix crash when inserting data from non-regular files.
2840 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
2841 for the error description produced by valgrind.
2842 * fileio.c (read_non_regular): Rename to read_contents.
2843 Free Lisp_Save_Value object used to pass parameters.
2844 (read_non_regular_quit): Rename to read_contents_quit.
2845 (Finsert_file_contents): Redesign internal file reading loop to adjust
2846 gap and end positions after each read and so help make_gap to work
2847 properly. Do not signal an I/O error too early and so do not leave
2848 not yet decoded characters in a buffer, which was the reason of
2849 redisplay crash. Use list2 to build return value. Adjust comments.
2850
67722112
PE
28512013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2852
2853 Close a race when statting and reading files (Bug#13149).
2854 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2855 This avoids a race if the file is renamed between stat and open.
2856 This race is not the problem originally noted in Bug#13149;
2857 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2858
468afbac
DA
28592013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2860
2861 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2862 objects, related functions and macros.
2863 (make_save_value): Adjust prototype.
2864 (make_save_pointer): New prototype.
2865 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2866 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2867 * alloc.c (format_save_value): Rename to make_save_value.
2868 (make_save_pointer): New function.
2869 (record_xmalloc): Use make_save_pointer.
2870 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2871 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2872 Change users of make_save_value to make_save_pointer.
2873 Likewise for format_save_value and make_save_value.
2874
0e70695a
DA
28752013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2876
2877 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2878 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2879 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2880 debugging stubs.
2881
963ea40f
PE
28822013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2883
2884 * alloc.c (free_save_value): Now static.
2885
3346c1d0
DA
28862013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2887
2888 * keymap.c (map_keymap_internal): Use format_save_value.
2889 (map_keymap_char_table_item): Adjust accordingly.
2890 * fileio.c (non_regular_fd, non_regular_inserted)
2891 (non_regular_nbytes): Remove.
99d0d6dc
SM
2892 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2893 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2894 (read_non_regular): Use XSAVE_ macros to extract parameters.
2895 Adjust comment.
2896 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2897 format_save_value.
2898 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2899
2b30549c
DA
29002013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2901
2902 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2903 extraction from any Lisp_Save_Value slot. Add type checking.
2904 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2905 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2906 * xselect.c: All users changed.
2907
1b971ac1
DA
29082013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2909
2910 Some convenient bits to deal with Lisp_Save_Values.
2911 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2912 (allocate_misc): Remove prototype.
2913 (format_save_value): New prototype.
2914 * alloc.c (allocate_misc): Revert back to static.
2915 (format_save_value): New function to build Lisp_Save_Value
2916 object with the specified internal structure.
2917 (make_save_value): Reimplement using format_save_value.
2918 * editfns.c (save_excursion_save): Use format_save_value.
2919 (save_excursion_restore): Use XSAVE_OBJECT.
2920
c50cf2ea
PE
29212013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2922
2923 Avoid needless casts with XSAVE_POINTER.
2924 * alloc.c (mark_object) [GC_MARK_STACK]:
2925 * dired.c (directory_files_internal_unwind):
2926 * fileio.c (do_auto_save_unwind):
2927 * gtkutil.c (pop_down_dialog):
2928 * keymap.c (map_keymap_char_table_item):
2929 * lread.c (load_unwind):
2930 * nsmenu.m (pop_down_menu):
2931 * print.c (print_object) [GC_MARK_STACK]:
2932 * xfns.c (clean_up_file_dialog):
2933 * xmenu.c (cleanup_widget_value_tree):
2934 Omit casts between XSAVE_POINTER and a pointer type.
2935
9d5a1260
DA
29362013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2937
2938 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2939 * eval.c (eval_sub): Protect `form' from being GCed before its
2940 car and cdr becomes protected with the backtrace entry.
2941
73ebd38f
DA
29422013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2943
2944 Make Lisp_Save_Value more versatile storage for up to four objects.
2945 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2946 (struct Lisp_Save_Value): New layout. Adjust comments.
2947 (XSAVE_POINTER): New macro.
2948 (XSAVE_INTEGER): Likewise.
2949 (allocate_misc): Add prototype.
2950 (free_misc): Likewise.
2951 * alloc.c (allocate_misc): Now global.
2952 (free_misc): Likewise. Adjust comment.
2953 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2954 (free_save_value): Likewise.
2955 (mark_object): Likewise.
2956 * editfns.c (save_excursion_save): Pack everything within
2957 Lisp_Save_Value and so avoid xmalloc.
2958 (save_excursion_restore): Adjust to match new layout. Use free_misc
2959 because we do not allocate extra memory any more. Add eassert.
2960 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2961 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2962 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2963 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2964 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2965
b826986f
JD
29662013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2967
2968 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2969 (nsfont_draw): Remove disabling of LCD smoothing.
2970 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2971 Bug#11484 with LCD smoothing on.
b826986f 2972
c0511b57 29732013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2974
b6f960a0
PE
2975 Fix SIGDANGER handlers, for AIX (Bug#13408).
2976 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2977 Move handlers here from emacs.c; they were out of place.
2978
616763d5
JD
29792013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2980
2981 * xterm.c (syms_of_xterm): Adjust documentation for
2982 scroll-bar-adjust-thumb-portion.
2983
0b59090b 29842012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2985
2986 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2987 determine whether scroll bar thumb size should be adjusted or
2988 not. Use variable for MOTIF.
2989
2990 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2991 GTK.
2992
7bc916b4
JD
29932013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2994
eac4d08f
JD
2995 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2996 event is generated.
2997 (doCommandBySelector:): Set processingCompose to NO.
2998
7bc916b4
JD
2999 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
3000 Remove check for fkeys count > zero, block/unblock fixes the real bug.
3001 (nsfont_list_family): Add block/unblock_input calls.
3002 (nsfont_open): Move block_input earlier. Add unblock_input before early
3003 return.
3004 (nsfont_draw): Add block/unblock_input calls.
3005
bdc9b756
PE
30062013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
3007
3008 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
3009 for old_charpos and old_bytepos.
3010
ee56a6dc
PE
30112013-01-12 Paul Eggert <eggert@cs.ucla.edu>
3012
3013 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
3014 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
3015 Clear tzvalbuf_in_environ if this workaround is in effect.
3016 Problem and fix reported by Kazuhiro Ito.
3017
9fc9a531
AH
30182013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
3019
99d0d6dc
SM
3020 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
3021 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
3022
3023 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
3024 doc string cross-reference(s).
3025
3026 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
3027 string cross-reference(s).
3028
6020559a
DA
30292013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
3030
3031 Avoid unnecessary byte position calculation for the gap movement.
3032 Since all users of move_gap do CHAR_TO_BYTE for other purposes
3033 anyway, all of them should use move_gap_both instead.
3034 * lisp.h (move_gap): Remove prototype.
3035 * insdel.c (move_gap): Remove.
3036 (move_gap_both): Add eassert.
3037 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
3038 * xml.c (parse_region): Likewise.
3039
b8956427
PE
30402013-01-11 Paul Eggert <eggert@cs.ucla.edu>
3041
3042 emacsclient -t should not suspend Emacs server (Bug#13387)
3043 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
3044 New functions.
3045 * term.c (init_tty): Use them instead of rolling our own code.
3046 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
3047 switches from 'signal' to 'pthread_sigmask', which is safer in
3048 multithreaded applications.
3049 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
3050 which has already arranged for that.
3051 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
3052 This is the main part of the bug fix.
3053
0b59090b 30542013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
3055
3056 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
3057 x_last_font_name (Bug#13403).
3058
58cc0a01
DA
30592013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
3060
3061 Omit buffer_slot_type_mismatch and use generic predicates to enforce
3062 the type of per-buffer values where appropriate.
3063 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
3064 predicate, which is how it's really used now. Adjust comment.
3065 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
3066 * buffer.c (buffer_slot_type_mismatch): Remove.
3067 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
3068 predicate. Adjust comment.
3069 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
3070 fill-column, left-margin, tab-width, buffer-saved-size,
3071 left-margin-width, right-margin-width, left-fringe-width,
3072 right-fringe-width, scroll-bar-width and buffer-display-count.
3073 Use Qstringp for default-directory, buffer-file-name,
3074 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
3075 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
3076 line-spacing.
3077 * data.c (store_symval_forwarding): Adjust to call the predicate.
3078
5104861e
JB
30792013-01-09 Juanma Barranquero <lekktu@gmail.com>
3080
3081 * w32.c (get_name_and_id, acl_set_file):
3082 * w32term.c (w32fullscreen_hook): Remove unused local variables.
3083
eefd7278
DA
30842013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
3085
3086 * lisp.h (make_gap_1): New prototype.
3087 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
3088 gap size values.
3089 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
3090 naming convention.
3091 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 3092 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
3093 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
3094 (make_gap_1): New function to adjust the gap of any buffer.
3095 * coding.c (coding_alloc_by_making_gap): Use it.
3096 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
3097 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
3098
073ca75b
JL
30992013-01-08 Juri Linkov <juri@jurta.org>
3100
3101 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
3102 of (supports :underline (:style wave)). (Bug#13000)
3103
3bace969
AH
31042013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
3105
3106 * undo.c (Fprimitive_undo): Move to simple.el.
3107 (syms_of_undo): Remove declarations for Sprimitive_undo.
3108
63a63bd4
SM
31092013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
3110
3111 * keyboard.c (echo_add_key): Rename from echo_add_char.
3112
56ed110a
CY
31132013-01-06 Chong Yidong <cyd@gnu.org>
3114
3115 * keyboard.c (echo_add_char): New function, factored out from
3116 echo_char. Don't add a space if the previous echo string was
3117 empty (Bug#13255).
3118 (echo_char): Use it.
3119 (read_key_sequence): When echoing mock input, ensure that the
3120 trailing dash is properly added.
3121
b630991b
EZ
31222013-01-05 Eli Zaretskii <eliz@gnu.org>
3123
3124 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
3125 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
3126 digits for buffer positions, before misalignment starts.
3127 Display "0" for integer "object" field.
b630991b
EZ
3128 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
3129 Display the newline glyph more unambiguously.
3130
f032a318
YM
31312013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3132
3133 * nsterm.m (ns_draw_underwave):
3134 * w32term.c (w32_draw_underwave):
3135 * xterm.c (x_draw_underwave): Make underwave look more triangular
3136 and also degrade gracefully for small fonts. (Bug#13000)
3137
4240dd3c
YM
3138 * nsterm.m (ns_draw_text_decoration):
3139 * w32term.c (x_draw_glyph_string):
3140 * xterm.c (x_draw_glyph_string): Don't use previous underline
3141 thickness and position if previous underline type is underwave.
3142
553081a5
SM
31432013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
3144
3145 * fileio.c (Ffile_acl): Undocument return format.
3146
9539d465 31472013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
3148
3149 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
3150
71376d4b
PE
31512013-01-02 Paul Eggert <eggert@cs.ucla.edu>
3152
3153 Simplify via eabs.
3154 * dired.c (file_name_completion):
3155 * doc.c (get_doc_string):
3156 * floatfns.c (round2):
3157 * font.c (font_score, font_delete_unmatched):
3158 * fringe.c (compute_fringe_widths):
3159 * lread.c (read_list):
3160 * minibuf.c (Ftry_completion):
3161 * term.c (tty_ins_del_lines):
3162 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
3163 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
3164
a7f11948
EZ
31652012-12-31 Eli Zaretskii <eliz@gnu.org>
3166
3167 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
3168 correctly.
3169 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
3170 for the bug this caused.
3171
84cc1ab6
PE
31722012-12-30 Paul Eggert <eggert@cs.ucla.edu>
3173
3174 * coding.c (Qmac): Now static.
3175
5a1d858b
JD
31762012-12-30 Jan Djärv <jan.h.d@swipnet.se>
3177
3178 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
3179 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
3180 handlebox_widget. Set toolbar_in_hbox to false/true, set
3181 toolbar_is_packed to true.
3182 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
3183 (update_frame_tool_bar): Check toolbar_is_packed for packing.
3184 Show all on TOOLBAR_TOP_WIDGET.
3185 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
3186 by TOOLBAR_TOP_WIDGET.
3187 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
3188 Check toolbar_is_packed.
8b745d92
JD
3189 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
3190 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3191 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
3192 false.
3193 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3194 (xg_update_menubar): Update title only if
3195 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3196 (xg_update_submenu): Skip tearoff only if
3197 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
3198 (xg_initialize): Initialize xg_detached_menus only if
3199 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
3200
3201 * xterm.h (struct x_output): Surround handlebox_widget with
3202 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
3203 toolbar_in_hbox is bool.
3204
d5e5e7b4 32052012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
3206
3207 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
3208 (LIBS_GNUSTEP): Define.
3209 (LIBES): Add $(LIBS_GNUSTEP).
3210 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
3211
d5e5e7b4 32122012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
3213
3214 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
3215 continuation glyph on a TTY with an indication of an empty line.
3216 (Bug#13277)
3217
e7ae8039
EZ
32182012-12-29 Eli Zaretskii <eliz@gnu.org>
3219
ccad023b
EZ
3220 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
3221 file's SELinux context or ACLs successfully set, nil otherwise.
3222 (Bug#13298)
8d23a331 3223 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 3224
e7ae8039
EZ
3225 * w32proc.c (reader_thread): Avoid passing NULL handles to
3226 SetEvent and WaitForSingleObject.
3227
7456e13f
PE
32282012-12-28 Paul Eggert <eggert@cs.ucla.edu>
3229
3230 Port EXTERNALLY_VISIBLE to Clang 3.2.
3231 * conf_post.h (__has_attribute): New macro.
3232 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
3233
1ab0c851
GM
32342012-12-27 Glenn Morris <rgm@gnu.org>
3235
3236 * cygw32.c (Fcygwin_convert_file_name_to_windows)
3237 (Fcygwin_convert_file_name_from_windows): Doc fixes.
3238
82e2a1f0 32392012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 3240
63a63bd4
SM
3241 * fileio.c (file_name_as_directory, directory_file_name):
3242 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
3243 came from a multibyte or a unibyte Lisp string; all callers
3244 adjusted. Don't assume the input string is always multibyte.
3245 (Bug#13262)
3246 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
3247 don't ENCODE_FILE them, and return a unibyte string if the input
3248 was unibyte.
3249 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
3250 don't assume the input strings will always be multibyte. If the
3251 input strings are multibyte, decode strings obtained from C
3252 library functions.
3253
8847a0de
DA
32542012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3255
3256 * lisp.h (toplevel): Add two notices to the comment about
3257 defining a new Lisp data type.
6cda572a
DA
3258 * print.c (print_object): If Lisp_Save_Value object's pointer
3259 is the address of a memory area containing Lisp_Objects, try
3260 to print them.
3261 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 3262
4b298d5a
DA
32632012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
3264
3265 * keyboard.c (record_asynch_buffer_change): Initialize an event
3266 only if it's really needed.
3267 * frame.h (enum output_method): Remove output_mac member since
3268 it's a leftover from the deleted code.
3269 * frame.c (Fframep): Adjust user here ...
3270 * terminal.c (Fterminal_live_p): ... and here.
3271 * coding.c (Qmac): Now here because it's only used to denote
3272 end-of-line encoding type.
3273 (syms_of_coding): DEFSYM it.
3274 * frame.h (Qmac): Remove duplicated declaration.
3275
12384b01
PE
32762012-12-26 Paul Eggert <eggert@cs.ucla.edu>
3277
3278 * window.c (select_window_1): Now static, since it's used only here.
3279
f1665bdc
EZ
32802012-12-25 Eli Zaretskii <eliz@gnu.org>
3281
3282 * window.c (window_body_cols): Subtract display margins from the
3283 window body width on TTYs as well. See
3284 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3285 for the original report.
3286
9a0d4f34
DA
32872012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3288
3289 * xdisp.c (redisplay_window): Remove inner local variable
3290 because the outer shadowed one has the same meaning.
cd78d9b1
DA
3291 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3292 set but never used.
3293 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3294 (xg_create_tool_bar): Adjust users.
9a0d4f34 3295
f9e7c67e
DA
32962012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3297
3298 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3299 * buffer.c (Fget_buffer_create): Use it to set compact field of
3300 struct buffer_text to avoid accessing an uninitialized value
3301 when compact_buffer is called for the first time.
3302 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
3303 (Fset_buffer_modified_p): Use buffer_window_count to check
3304 whether the buffer is displayed in some window.
3305 * xdisp.c (message_dolog): Likewise.
f9e7c67e 3306
299614f3
EZ
33072012-12-23 Eli Zaretskii <eliz@gnu.org>
3308
40ff07a5
EZ
3309 * w32.c (acl_set_file): If setting the file security descriptor
3310 fails, and the new DACL is identical to the existing one, silently
3311 return success. This fixes problems for users backing up their
3312 own files without having the necessary privileges for setting
3313 security descriptors.
3314
299614f3
EZ
3315 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3316 values.
3317 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3318 after WaitForSingleObject returns normally. This expedites reader
3319 thread shutdown when delete_child triggers it.
3320 (reap_subprocess): More accurate commentary for why we call
3321 delete_child only when cp->fd is negative.
3322
3323 * w32.c (sys_close): Do not call delete_child on a subprocess
3324 whose handle is not yet closed. Instead, set its file descriptor
3325 to a negative value, so that reap_subprocess will call
63a63bd4
SM
3326 delete_child on that subprocess when its SIGCHLD arrives.
3327 This avoids closing handles used for communications between sys_select
299614f3
EZ
3328 and reader_thread, which doesn't give sys_select a chance to
3329 notice that the process exited and invoke the SIGCHLD handler for
3330 it.
3331
cf162aee
JD
33322012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3333
3334 * nsfns.m (Fns_do_applescript): Run event loop until script has
3335 been executed (Bug#12969).
3336 (ns_run_ascript): Chech as_script for nil, set to nil after
3337 executing script.
3338
94900bfe
MR
33392012-12-22 Martin Rudalics <rudalics@gmx.at>
3340
3341 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3342
b2faf49c
EZ
33432012-12-22 Eli Zaretskii <eliz@gnu.org>
3344
3345 * w32term.c (w32fullscreen_hook): New function.
3346 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3347
7efa3fb3
EZ
33482012-12-21 Eli Zaretskii <eliz@gnu.org>
3349
bb085aed
EZ
3350 * fileio.c (Finsert_file_contents): Doc fix.
3351
7efa3fb3
EZ
3352 * w32proc.c (new_child, delete_child, find_child_pid): For a
3353 subprocess, consider its slot being in use as long as its process
3354 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3355 slot when a new process is started immediately after killing
3356 another one, without waiting enough time for the first process to
3357 be reaped and resources allocated for it be orderly freed.
3358 (Bug#13086)
3359 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3360
c1f02afa
CY
33612012-12-21 Chong Yidong <cyd@gnu.org>
3362
3363 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3364
5bec25eb
CY
3365 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3366
a4b0cca1 33672012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
3368
3369 * w32.c (get_name_and_id): Always pass NULL as the first argument
3370 of lookup_account_sid. Avoids crashes with UNC file names that
3371 refer to DFS domains, not to specific machine names. (Bug#12621)
3372 Remove now unused argument FNAME; all callers changed.
3373 (get_file_owner_and_group): Remove now unused argument FNAME; all
3374 callers changed.
3375
34b4b7eb
CY
33762012-12-21 Chong Yidong <cyd@gnu.org>
3377
3378 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3379 error for invalid chars, don't check for a nil return value.
3380
13002885
DA
33812012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3382
3383 Avoid calls to CHAR_TO_BYTE if byte position is known.
3384 * editfns.c (make_buffer_string_both): Use move_gap_both.
3385 (Fbuffer_string): Use make_buffer_string_both.
3386 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3387 Adjust comment.
3388 (buf_bytepos_to_charpos): Likewise.
3389 (charpos_to_bytepos): Remove.
3390 * fileio.c (Finsert_file_contents): Use move_gap_both.
3391 * search.c (Freplace_match): Likewise.
9a0d4f34 3392 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
3393 names for byte positions.
3394 * lisp.h (charpos_to_bytepos): Remove prototype.
3395 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3396 * insdel.c (move_gap): Likewise.
3397
99e9311c
PE
33982012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3399
3400 * xdisp.c (redisplay_internal): Remove now-unused local.
3401
e02230bf
SM
34022012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3403
3404 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3405 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 3406 proper value of frame-local variables (bug#13225).
e02230bf 3407
1687fb14
DA
34082012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3409
3410 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3411 Rename 4th argument since it may be buffer or string. Adjust comment.
3412 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3413
a2f07cd2
DA
34142012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3415
3416 * coding.c (Fdetect_coding_region): Do not check start and end with
3417 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3418 (code_convert_region): Likewise.
3419
474d441e
EZ
34202012-12-18 Eli Zaretskii <eliz@gnu.org>
3421
3422 * w32.c (acl_get_file, acl_set_file): Run the file name through
3423 map_w32_filename, and resolve any symlinks in the file name, like
3424 Posix platforms do.
3425 (acl_set_file): Call revert_to_self, if any privileges were
3426 enabled.
3427
8725c076
JB
34282012-12-17 Juanma Barranquero <lekktu@gmail.com>
3429
3430 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3431 ($(BLD)/w32.$(O)): Update dependencies.
3432
1e101a4b
SM
34332012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3434
3435 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3436 propagate redisplay's scrolling (if any) to the right window.
3437 (redisplay_internal): Use ensure_selected_frame.
3438 (display_mode_lines): Complete last fix.
3439 * window.c (select_window_1): New func, extracted from select_window.
3440 (select_window): Use it.
3441 * window.h (select_window_1): Declare.
3442
66447e07
EZ
34432012-12-17 Eli Zaretskii <eliz@gnu.org>
3444
3445 Emulate Posix ACL APIs on MS-Windows.
3446 * w32.c: Include sddl.h and sys/acl.h.
3447 (SDDL_REVISION_1): Define if not already defined.
3448 (g_b_init_get_security_descriptor_dacl)
3449 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3450 (g_b_init_is_valid_security_descriptor)
3451 (g_b_init_set_file_security): New static flags.
3452 (globals_of_w32): Initialize them to zero.
3453 (SetFileSecurity_Name): New string constant.
3454 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3455 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3456 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3457 (IsValidSecurityDescriptor_Proc): New typedefs.
3458 (get_file_security, get_security_descriptor_owner)
3459 (get_security_descriptor_group): Set errno to ENOTSUP.
3460 (set_file_security, get_security_descriptor_dacl)
3461 (is_valid_security_descriptor, convert_sd_to_sddl)
3462 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3463 (acl_free, acl_get_file, acl_set_file): New functions.
3464
3465 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3466
207a7ef0
PE
34672012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3470 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3471 for some of that bug's symptoms can now cause Emacs to abort.
3472 Remove the workaround.
3473 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3474 The bug that caused SIGCHLD to get lost has been fixed, and the
3475 workaround for it can now cause Emacs to abort.
3476
17fdfc15
PE
34772012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3478
3479 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3480 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3481 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3482
7c3d167f
RF
34832012-12-16 Romain Francoise <romain@orebokech.com>
3484
3485 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3486 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 3487 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
3488 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3489
3490 * Makefile.in (LIBACL_LIBS): New macro.
3491 (LIBES): Use it.
3492
7d80ea23
PE
34932012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3494
3495 * fileio.c (internal_delete_file): Use bool for boolean.
3496
b0728617
EZ
34972012-12-15 Eli Zaretskii <eliz@gnu.org>
3498
3499 Fix bug #13079 on MS-Windows with temp files not being deleted.
3500 * w32.h (_child_process): New members input_file and
3501 pending_deletion.
3502 (register_child): First argument is now pid_t.
3503 (record_infile, record_pending_deletion): New prototypes.
3504
3505 * w32proc.c (new_child): Initialize input_file and
3506 pending_deletion members of the child.
3507 (delete_child): Delete the child's temporary input file, if any,
3508 that is pending deletion.
3509 (register_child): First argument is now pid_t.
3510 (record_infile, record_pending_deletion): New functions.
3511 (reap_subprocess): Fix a typo in DebPrint string.
3512 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3513
3514 * fileio.c (internal_delete_file): Return an int again: non-zero
3515 if delete-file succeeds, zero otherwise.
3516
3517 * lisp.h (internal_delete_file): Adjust prototype.
3518
3519 * callproc.c (Fcall_process): Don't overwrite infile with result
3520 of DECODE_FILE.
3521 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3522 asynchronous subprocess, record the name of the input file name,
3523 if any.
3524 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3525 delete the file, record it as pending deletion when the subprocess
3526 exits.
3527
7e90af26
EZ
35282012-12-14 Eli Zaretskii <eliz@gnu.org>
3529
3530 * editfns.c [HAVE_PWD_H]: Include grp.h.
3531
3532 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3533
97976f9f
PE
35342012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3535
3536 Fix permissions bugs with setgid directories etc. (Bug#13125)
3537 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3538 to mark it as a placeholder. The old value was often wrong.
3539 The only user of this attribute has been changed to use
3540 file-ownership-preserved-p instead, with its new group arg.
3541 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3542
26ec1f49
SM
35432012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3544
ad966fe7
SM
3545 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3546 Keep selected_window and selected_frame in sync.
26ec1f49 3547
5c207910
EZ
35482012-12-14 Eli Zaretskii <eliz@gnu.org>
3549
3550 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3551 try to get accurate owner and group information from NT file
3552 security APIs. This is to make most callers of 'stat' and
3553 'lstat', which don't need that information, much faster.
3554
26ec1f49
SM
3555 * dired.c (Ffile_attributes) [WINDOWSNT]:
3556 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
3557 owner and group information from 'lstat'.
3558
893f52d8
PE
35592012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3560
4c95c9a5
PE
3561 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3562 as that confuses set-auto-coding, so insist on the head-read
3563 returning the full 1024 bytes. Let lseek compute the tail offset;
3564 less work for us. Do not ignore I/O errors when reading the tail.
3565
893f52d8
PE
3566 * xdisp.c: Minor style fixes.
3567 (init_iterator): Hoist assignment out of if-expression.
3568 (markpos_of_region): Callers now test for sign, not for -1.
3569
40d1e434
DA
35702012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3571
3572 Minor redisplay optimization when the region length is zero.
3573 * xdisp.c (markpos_of_region): New function.
3574 (init_iterator): Do not highlight the region of zero length.
3575 (redisplay_window): Check whether the region is of non-zero length.
3576 (try_cursor_movement): Allow if the region length is zero.
3577 (try_window_reusing_current_matrix, try_window_id): Likewise.
3578
727f9739 35792012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
3580
3581 * search.c (search_buffer): Check the inverse translations of each
3582 character in pattern when the buffer being searched is unibyte.
3583 (Bug#13084)
3584
727f9739 35852012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
3586
3587 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3588 files, fixing a regression from 24.2.
645c6a30 3589 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 3590
d20704ef
PE
35912012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3592
3593 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3594 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3595 Remove unnecessary S_ISLNK test, as (contra the comments) this
3596 function can't copy symlinks. Improve quality of error message
3597 when attempting to copy files that are neither regular files nor
3598 directories.
3599
2dd61a9b
DA
36002012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3601
3602 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3603 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3604 * window.c (Frecenter):
3605 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3606 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3607
cc98b684
DC
36082012-12-12 Daniel Colascione <dancol@dancol.org>
3609
1e101a4b 3610 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
3611 the dumped Emacs is not a sparse file, greatly improving Cygwin
3612 "make bootstrap" performance.
3613
38e791fd
MA
36142012-12-11 Michael Albinus <michael.albinus@gmx.de>
3615
3616 * inotify.c (inotify_callback): Generate an Emacs event for every
3617 incoming inotify event.
3618
f9d1448f
EZ
36192012-12-11 Eli Zaretskii <eliz@gnu.org>
3620
3621 * xdisp.c (handle_face_prop): Fix logic of computing
3622 it->start_of_box_run_p.
3623 (append_space_for_newline): If the glyph row is R2L, reset the
3624 iterator's end_of_box_run_p flag before prepending the space glyph.
3625 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3626 iterator's start_of_box_run_p flag before prepending the stretch.
3627 (append_glyph, produce_image_glyph, append_composite_glyph)
3628 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3629 left_box_line_p and right_box_line_p flags of the glyph for R2L
3630 glyph rows. (Bug#13011)
3631
c6afe371
DA
36322012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3633
3634 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3635 if changed buffer is not shown in a window.
3636 * insdel.c (prepare_to_modify_buffer): Likewise.
3637 * window.c (replace_buffer_in_windows_safely): Do nothing
3638 if buffer is not shown in a window.
3639 (Fforce_window_update): Likewise if string or buffer argument
3640 is passed.
3641
1b47babd
EZ
36422012-12-11 Eli Zaretskii <eliz@gnu.org>
3643
3644 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3645 encoded_file_name, which is what it is.
3646
4c1acb95
DA
36472012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3648
3649 Consistently use marker_position and marker_byte_position.
3650 * fringe.c (Ffringe_bitmaps_at_pos):
3651 * indent.c (Fvertical_motion):
3652 * insdel.c (prepare_to_modify_buffer):
3653 * keyboard.c (make_lispy_position):
3654 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3655 (window_scroll_pixel_based, displayed_window_lines)
3656 (Fset_window_configuration):
3657 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3658 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3659 Replace direct access to marker fields with calls
3660 to marker_position and/or marker_byte_position.
3661
0eeb69fe
JB
36622012-12-11 Juanma Barranquero <lekktu@gmail.com>
3663
3664 * makefile.w32-in (SIG2STR_H): New macro.
3665 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3666 ($(BLD)/w32notify.$(O)): Update dependencies.
3667
1cf1bbd5
DC
36682012-12-10 Daniel Colascione <dancol@dancol.org>
3669
8db4b52f
DC
3670 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3671 Windows file notification functionality unless WINDOWSNT.
3672
1cf1bbd5
DC
3673 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3674 declarations.
3675
3676 * w32fns.c (cache_system_info): Initialize the global hinst
3677 variable here so various initialization calls DTRT.
3678
1e101a4b 3679 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
3680 (hinst): Remove unneeded extern declaration.
3681 (_start): Remove initialization of above variables; remove
3682 initialization of hinst, as cache_system_info now does that.
3683
3684 * emacs.c (main): Call cache_system_info early in startup; we
3685 previously weren't calling it in Cygwin builds.
3686
26ec1f49
SM
3687 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3688 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
3689 and link it to Emacs.
3690
98a07056
DA
36912012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3692
3693 Per-buffer window counters.
3694 * buffer.h (struct buffer): New member window_count.
3695 (buffer_window_count): New function.
3696 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3697 Initialize window_count.
3698 (Fkill_buffer): Verify window_count for the buffer being killed.
3699 (modify_overlay): Do not force redisplay if buffer is not shown
3700 in any window.
3701 (init_buffer_once): Initialize window_count for buffer_defaults
3702 and buffer_local_symbols.
3703 * window.h (buffer_shared): Remove declaration.
3704 (wset_buffer): Convert from inline ...
3705 * window.c (wset_buffer): ... to an ordinary function.
3706 (adjust_window_count): New function.
3707 (make_parent_window): Use it.
3708 * xdisp.c (buffer_shared): Remove.
3709 (redisplay_internal, redisplay_window): Adjust users.
3710 (buffer_shared_and_changed): Use per-buffer window counter.
3711
2b8c9064
EZ
37122012-12-10 Eli Zaretskii <eliz@gnu.org>
3713
3714 Support for filesystem notifications on MS-Windows.
3715 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3716 and this is a TTY frame, signal the caller that keyboard input is
3717 available.
3718
3719 * w32xfns.c (drain_message_queue): Now returns an int: an
3720 indication whether any WM_EMACS_FILENOTIFY messages were found in
3721 the queue.
3722
3723 * w32inevt.c (handle_file_notifications): New function.
3724 (w32_console_read_socket): Call it to process file notifications.
3725
3726 * w32console.c (initialize_w32_display): Record the main thread ID
3727 in dwMainThreadId.
3728
3729 * deps.mk (inotify.o): New dependency list.
3730
3731 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3732
3733 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3734 (WM_EMACS_END): Bump value by 1.
3735 (notification_buffer_in_use, file_notifications)
3736 (notifications_size, notifications_desc): Declare.
3737 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3738 Add prototypes.
3739
3740 * w32term.c (lispy_file_action, queue_notifications): New functions.
3741 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3742 <Qrenamed_to>: New symbols.
3743 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3744
3745 * w32notify.c: New file, implements file event notifications for
3746 MS-Windows.
3747
3748 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3749 by posting it to the w32_read_socket queue.
3750
1e101a4b 3751 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
3752
3753 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3754 (GLOBAL_SOURCES): Add w32notify.c
3755 ($(BLD)/w32notify.$(O)): New set of dependencies.
3756
3757 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3758
1e101a4b
SM
3759 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3760 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
3761 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3762 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3763 w32notify-handle-event by default.
3764
3765 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3766 syms_of_w32notify.
3767
81606b10
RS
37682012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3769
2b8c9064 3770 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 3771 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
3772
3773 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3774
3775 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3776 (syms_of_keyboard): DEFSYM it.
3777 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3778 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3779 Qfile_inotify events.
3780 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3781 special-event-map to inotify-handle-event.
3782
3783 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3784
3785 * Makefile.in (base_obj): Add inotify.o.
3786
3787 * inotify.c: New file.
3788
265c2fbf 37892012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
3790
3791 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3792
265c2fbf 37932012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
3794
3795 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3796 DWORD_PTR, for compatibility with 64-bit builds.
3797
a06ae17d 3798 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
3799 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3800 (system_process_attributes): Use SIZE_T rather than DWORD, for
3801 compatibility with 64-bit builds.
3802
265c2fbf 38032012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
3804
3805 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3806
265c2fbf 38072012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
3808
3809 * indent.c (Fvertical_motion): If a display string will be
3810 displayed on the left or the right margin, don't consider it as a
3811 factor in cursor positioning. (Bug#13108)
3812
265c2fbf 38132012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
3814
3815 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3816
5f460827
PE
38172012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3818
3819 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3820 for string length.
3821
a16e75cd
EZ
38222012-12-08 Eli Zaretskii <eliz@gnu.org>
3823
3824 * w32.c (unsetenv): Return 0 if the input string is too long.
3825
5745a7df
PE
38262012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3827
3828 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3829 * alloc.c (xputenv): New function.
3830 * dbusbind.c (Fdbus_init_bus):
3831 * emacs.c (main):
3832 * xterm.c (x_term_init):
3833 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3834 * editfns.c (initial_tz): Move static var decl up.
3835 (tzvalbuf_in_environ): New static var.
8a621d53 3836 (init_editfns): Initialize these two static vars.
5745a7df
PE
3837 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3838 Save old TZ value on stack, if it's small.
3839 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3840 instead, use xputenv+unsetenv to set and restore TZ.
3841 (environbuf): Remove static var. All uses removed.
3842 (Fset_time_zone_rule): Do not save TZ and environ;
3843 no longer needed here.
3844 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3845 Move to inside set_time_zone_rule; they don't need file scope any more.
3846 (set_time_zone_rule): Maintain the TZ=value string separately.
3847 (syms_of_editfns): Don't initialize initial_tz;
3848 init_editfns now does it.
3849 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3850 * lisp.h (xputenv): New decl.
3851
c56efa40
FP
38522012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3853
3854 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3855
75ceee05
EZ
38562012-12-08 Eli Zaretskii <eliz@gnu.org>
3857
3858 * w32.c (unsetenv, sys_putenv): New functions.
3859
1b6dbfeb
CY
38602012-12-08 Chong Yidong <cyd@gnu.org>
3861
3862 * editfns.c (Finsert_char): Make the error message more
3863 informative (Bug#12992).
3864
d983a10b
PE
38652012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3866
7be78020
PE
3867 Simplify get_lim_data.
3868 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3869 Remove USG and vlimit methods; no longer used these days.
3870 Add #error catchall just in case.
3871
d983a10b
PE
3872 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3873 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3874 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3875 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3876 (deleted_pid_list, Fdelete_process, create_process)
3877 (record_child_status_change, handle_child_signal, deliver_child_signal)
3878 (init_process_emacs, syms_of_process):
3879 Assume SIGCHLD is defined.
3880 (parse_signal): Remove. All uses removed.
3881 (abbr_to_signal): New static function.
3882 (Fsignal_process): Use it to convert signal names to ints.
3883 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3884 kill (getpgrp (), ...).
3885 (emacs_sigaction_init): Assume SIGCHLD is defined.
3886 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3887 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3888 * syssignal.h (EMACS_KILLPG): Remove.
3889 All uses replaced by 'kill' with a negative pid.
3890 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3891 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3892
9cdde1e2
PE
38932012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3894
3895 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3896 This will cause a production Emacs to dump core instead of
3897 infinite-looping.
3898
822995f8
DA
38992012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3900
3901 * frame.c (make_frame): Do not set window's buffer to t.
3902 * window.c (Fsplit_window_internal): Likewise. Previously it was
3903 used to indicate that the window is being set up. Now we use
3904 set_window_buffer for all new windows, so the condition in ...
3905 (Fset_window_buffer): ... is always true and can be removed.
3906
ed08365b
DA
39072012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3908
3909 Convenient macro to check whether the buffer is hidden.
3910 * buffer.h (BUFFER_HIDDEN_P): New macro.
3911 * frame.c (make_frame): Use it. Adjust comment.
3912 * buffer.c (candidate_buffer): New function.
3913 (Fother_buffer, other_buffer_safely): Use it.
3914
e86f5134
EZ
39152012-12-06 Eli Zaretskii <eliz@gnu.org>
3916
3917 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3918 if the child process is still running. Instead, exit the wait
3919 loop and return zero. (Bug#13086)
3920
1700db3c
DA
39212012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3922
3923 * frame.h (x_char_width, x_char_height): Remove prototypes.
3924 * w32term.h (x_char_width, x_char_height): Likewise.
3925 * xfns.c (x_char_width, x_char_height): Remove.
3926 * w32fns.c (x_char_width, x_char_height): Likewise.
3927 * nsfns.c (x_char_width, x_char_height): Likewise.
3928 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3929 all window frames.
3930 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3931 * keyboard.c (command_loop_1): Remove prototype.
3932 (command_loop_2, top_level_1): Add static to match prototype.
3933
35fb8050
PE
39342012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3935
3936 Fix a recently-introduced delete-process race condition.
3937 * callproc.c, process.h (record_kill_process):
3938 New function, containing part of the old call_process_kill.
3939 (call_process_kill): Use it.
3940 This does not change call_process_kill's behavior.
3941 * process.c (Fdelete_process): Use record_kill_process to fix a
3942 race condition that could cause Emacs to lose track of a child.
3943
565212e5
DA
39442012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3945
3946 Avoid code duplication between prev_frame and next_frame.
3947 * frame.c (candidate_frame): New function. Add comment.
3948 (prev_frame, next_frame): Use it. Adjust comment.
3949
d8ad4d3f 39502012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3951
3952 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3953 fails, signal an error instead of continuing with an empty
3954 string. (Bug#13079)
7c2fcf9b
EZ
3955 Encode expanded temp file pattern before passing it to mkstemp or
3956 mktemp.
d3cefd13 3957
2e7cddd3
EZ
3958 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3959 Encode the file name before passing it to dostounix_filename, in
3960 case it will downcase it (under w32-downcase-file-names).
3961 (Bug#12933)
3962
644d3f0d
PE
39632012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3964
3965 Minor call-process cleanups.
3966 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3967 at the same time as other platforms, to simplify analysis.
3968 No need for fd0_volatile since we have synch_process_fd.
3969 Avoid needless emacs_close; arg is always negative.
3970
396376f1
AS
39712012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3972
3973 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3974 processes.
3975
350f51ad
DA
39762012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3977
3978 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3979 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3980 and mouse_face_hidden members to a bitfields.
3981 * frame.h (struct frame): Remove set-but-not-used space_width member.
3982 (FRAME_SPACE_WIDTH): Remove.
3983 * nsterm.m, w32term.c, xterm.c: Adjust users.
3984 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3985 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3986 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3987 members to a bitfields.
3988
bc9dbce6
PE
39892012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3990
bb5f74ee
PE
3991 Don't let call-process be a zombie factory (Bug#12980).
3992 Fixing this bug required some cleanup of the signal-handling code.
3993 As a side effect, this change also fixes a longstanding rare race
3994 condition whereby Emacs could mistakenly kill unrelated processes,
3995 and it fixes a bug where a second C-g does not kill a recalcitrant
3996 synchronous process in GNU/Linux and similar platforms.
3997 The patch should also fix the last vestiges of Bug#9488,
3998 a bug which has mostly been fixed on the trunk by other changes.
3999 * callproc.c, process.h (synch_process_alive, synch_process_death)
4000 (synch_process_termsig, sync_process_retcode):
4001 Remove. All uses removed, to simplify analysis and so that
4002 less consing is done inside critical sections.
4003 * callproc.c (call_process_exited): Remove. All uses replaced
4004 with !synch_process_pid.
4005 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
4006 These take the role of what used to be in unwind-protect arg.
4007 All uses changed.
4008 (block_child_signal, unblock_child_signal):
4009 New functions, to avoid races that could kill innocent-victim processes.
4010 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
4011 (call_process_kill): Record killed processes as deleted, so that
4012 zombies do not clutter up the system. Do this inside a critical
4013 section, to avoid a race that would allow the clutter.
4014 (call_process_cleanup): Fix code so that the second C-g works again
4015 on common platforms such as GNU/Linux.
4016 (Fcall_process): Create the child process in a critical section,
4017 to fix a race condition. If creating an asynchronous process,
4018 record it as deleted so that zombies do not clutter up the system.
4019 Do unwind-protect for WINDOWSNT too, as that's simpler in the
4020 light of these changes. Omit unnecessary call to emacs_close
4021 before failure, as the unwind-protect code does that.
4022 * callproc.c (call_process_cleanup):
4023 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
4024 * process.c (record_deleted_pid): New function, containing
4025 code refactored out of Fdelete_process.
4026 (Fdelete_process): Use it.
4027 (process_status_retrieved): Remove. All callers changed to use
4028 child_status_change.
4029 (record_child_status_change): Remove, folding its contents into ...
4030 (handle_child_signal): ... this signal handler. Now, this
4031 function is purely a handler for SIGCHLD, and is not called after
4032 a synchronous waitpid returns; the synchronous code is moved to
4033 wait_for_termination. There is no need to worry about reaping
4034 more than one child now.
4035 * sysdep.c (get_child_status, child_status_changed): New functions.
4036 (wait_for_termination): Now takes int * status and bool
4037 interruptible arguments, too. Do not record child status change;
4038 that's now the caller's responsibility. All callers changed.
4039 Reimplement in terms of get_child_status.
4040 (wait_for_termination_1, interruptible_wait_for_termination):
4041 Remove. All callers changed to use wait_for_termination.
4042 * syswait.h: Include <stdbool.h>, for bool.
4043 (record_child_status_change, interruptible_wait_for_termination):
4044 Remove decls.
4045 (record_deleted_pid, child_status_changed): New decls.
4046 (wait_for_termination): Adjust to API changes noted above.
4047
bc9dbce6
PE
4048 * bytecode.c, lisp.h (Qbytecode): Remove.
4049 No longer needed after 2012-11-20 interactive-p changes.
4050
3cf3c607
EZ
40512012-12-03 Eli Zaretskii <eliz@gnu.org>
4052
4053 * xdisp.c (redisplay_window): If the cursor is visible, but inside
4054 the scroll margin, move point outside the margin. (Bug#13055)
4055
005c8d13
JD
40562012-12-03 Jan Djärv <jan.h.d@swipnet.se>
4057
4058 * gtkutil.c (my_log_handler): New function.
4059 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
4060
20edc1c9
DA
40612012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4062
4063 * lisp.h (modify_region): Rename to...
4064 (modify_region_1): ...new prototype.
4065 * textprop.c (modify_region): Now static. Adjust users.
4066 * insdel.c (modify_region): Rename to...
4067 (modify_region_1): ...new function to work with current buffer.
4068 Adjust comment and users. Use true and false for booleans.
4069
62c2e5ed
DA
40702012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
4071
4072 * alloc.c (free_save_value): New function.
4073 (safe_alloca_unwind): Use it.
4074 * lisp.h (free_save_value): New prototype.
4075 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
4076 Add comment.
4077 (save_excursion_restore): Adjust to match saved data structure.
4078 Use free_save_value to offload some work from GC. Drop obsolete
4079 #if 0 code.
4080
c5bc2d1d 40812012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
4082
4083 * fileio.c (Vauto_save_list_file_name): Doc fix.
4084
c5bc2d1d 40852012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
4086
4087 * w32fns.c: Remove prototype of atof.
1e101a4b 4088 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 4089 builds.
1e101a4b 4090 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
4091
4092 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
4093 with 64-bit builds.
4094
4095 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4096 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
4097 defined.
4098
c5bc2d1d 40992012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 4100
a9de9f0c 4101 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 4102
21e54a94
PE
41032012-12-02 Paul Eggert <eggert@cs.ucla.edu>
4104
2dd2e622
PE
4105 Fix xpalloc confusion after memory is exhausted.
4106 * alloc.c (xpalloc): Comment fix.
4107 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
4108 and signals an error, do not clear charset_table_size, as
4109 charset_table is still valid.
4110 * doprnt.c (evxprintf): Clear *BUF after freeing it.
4111
21e54a94
PE
4112 Use execve to avoid need to munge environ (Bug#13054).
4113 * callproc.c (Fcall_process):
4114 * process.c (create_process):
8a621d53 4115 Don't save and restore environ; no longer needed.
21e54a94
PE
4116 * callproc.c (child_setup):
4117 Use execve, not execvp, to preserve environ.
4118
3e5490f7
PE
41192012-12-01 Paul Eggert <eggert@cs.ucla.edu>
4120
4121 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
4122
75b4f59c
YM
41232012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4124
4125 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
4126 display for sliced images (Bug#10500).
4127
4128 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
4129
f8aff4c6
JB
41302012-11-30 Juanma Barranquero <lekktu@gmail.com>
4131
4132 * doc.c (Fdocumentation): Re-add handling of function-documentation,
4133 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
4134
3940b924
DA
41352012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
4136
4137 * xdisp.c (window_outdated): Remove eassert since it hits
4138 some suspicious corner cases (see Bug#13007 and Bug#13012).
4139 (mode_line_update_needed): New function.
4140 (redisplay_internal, redisplay_window): Use it.
4141 (ensure_selected_frame): New function.
4142 (redisplay_internal, unwind_redisplay): Use it.
4143 (redisplay_internal): Move comment about buffer_shared...
4144 (buffer_shared_and_changed): ...near to its real use.
4145
4a9204fe
PE
41462012-11-29 Paul Eggert <eggert@cs.ucla.edu>
4147
4148 * callproc.c (Fcall_process): Don't misreport vfork failure.
4149
60aeceb8
PE
41502012-11-28 Paul Eggert <eggert@cs.ucla.edu>
4151
4152 * callproc.c (Fcall_process): Fix vfork portability problems.
4153 Do not assume that fd[0], count, filefd, and save_environ survive
4154 vfork. Fix bug whereby wrong errno value could be reported for
4155 pipe failure. Some minor cleanups, too, as follows. Move buf and
4156 bufsize to the context where they're needed. Change new_argv to
4157 be of type char **, as this is more convenient and avoids casts.
4158 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
4159 Now local constants, not macros.
4160
00dc3ead
KH
41612012-11-18 Kenichi Handa <handa@gnu.org>
4162
4163 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
4164 for the variable "f".
4165
e1bf05c1
KH
41662012-11-13 Kenichi Handa <handa@gnu.org>
4167
4168 * font.c (font_unparse_xlfd): Exclude special characters from the
4169 generating XLFD name.
4170
22626a85
PE
41712012-11-27 Paul Eggert <eggert@cs.ucla.edu>
4172
350e0088
PE
4173 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
4174 * dired.c (stat_uname, stat_gname):
4175 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
4176
22626a85
PE
4177 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
4178 * dired.c (directory_files_internal, file_name_completion):
4179 Assume EAGAIN and EINTR are defined.
350e0088 4180
22626a85
PE
4181 * fileio.c (Fcopy_file): Assume EISDIR is defined.
4182 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
4183 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
4184 * lread.c (readbyte_from_file): Assume EINTR is defined.
4185 * process.c (wait_reading_process_output, send_process) [subprocesses]:
4186 Assume EIO and EAGAIN are defined.
4187 * unexcoff.c (write_segment): Assume EFAULT is defined.
4188
5c9cf0a3 41892012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
4190
4191 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
4192 (Bug#11964)
4193
22294a56
EZ
4194 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
4195 highlighting on the frame was cleared. Prevents assertion
4196 violations when repeatedly clicking on the "Top" link of the
4197 "bread-crumbs" in Info buffers.
4198
5fbab051
PE
41992012-11-25 Paul Eggert <eggert@cs.ucla.edu>
4200
4201 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
4202
bcd77a2b
KB
42032012-11-24 Ken Brown <kbrown@cornell.edu>
4204
4205 * keyboard.c (HAVE_MOUSE):
4206 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
4207 were always defined.
4208
d125ca15 42092012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 4210
24becea4
EZ
4211 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
4212 between bpos_covered and bpos_max. This fixes cursor display when
4213 several display strings follow each other.
4214
8654a41b
EZ
4215 * .gdbinit (pgx): If the glyph's object is a string, display the
4216 pointer to string data, rather than the value of the string object
4217 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
4218
cb5867b1
EZ
4219 * indent.c (Fvertical_motion): If the starting position is covered
4220 by a display string, return to one position before that, to avoid
4221 overshooting it inside move_it_to. (Bug#12930)
4222
f418b22e
DA
42232012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
4224
4225 * frame.h (struct frame): Remove display_preempted member
4226 since all users are dead long ago.
4227 * nsterm.h (struct x_output): Use the only dummy member.
4228 * w32menu.c (pending_menu_activation): Remove since not
4229 really used.
4230 (set_frame_menubar): Adjust user.
4231 * w32term.h (struct x_output): Drop outdated #if 0 code.
4232 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
4233 asked_for_visible and menubar_active members.
4234 Drop unused pending_menu_activation member.
f418b22e
DA
4235 * xterm.h (struct x_output): Drop outdated #if 0 code.
4236 Use bitfields for explicit_parent, asked_for_visible,
4237 has_been_visible and net_wm_state_hidden_seen members.
4238
a879f0ea
EZ
42392012-11-23 Eli Zaretskii <eliz@gnu.org>
4240
4241 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
4242 of a literal "/". (Bug#12955)
4243 (gl-stamp): Invoke fc.exe directly, not through cmd.
4244
95ef7787
PE
42452012-11-23 Paul Eggert <eggert@cs.ucla.edu>
4246
4247 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
4248 * dired.c: Assume HAVE_DIRENT_H.
4249 (NAMLEN): Remove, replacing with ...
4250 (dirent_namelen): New function. All uses changed. Use the GNU macro
4251 _D_EXACT_NAMELEN if available, as it's faster than strlen.
4252 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
4253 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
4254 * makefile.w32-in (DIR_H): Remove. All uses replaced with
4255 $(NT_INC)/dirent.h.
4256 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
4257 * ndir.h: Rename to ../nt/inc/dirent.h.
4258 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
4259 Do not include <dirent.h>; no longer needed.
4260 * w32.c: Include <dirent.h> rather than "ndir.h".
4261
12645ae6
CY
42622012-11-23 Chong Yidong <cyd@gnu.org>
4263
4264 * xftfont.c (xftfont_open): Remove duplicate assignment.
4265
5c747675
DA
42662012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4267
4268 * alloc.c (Fgarbage_collect): Unblock input after clearing
4269 gc_in_progress to avoid note_mouse_highlight glitch with GC.
4270 * frame.h (FRAME_MOUSE_UPDATE): New macro.
4271 * msdos.c (IT_frame_up_to_date): Use it here...
4272 * w32term.c (w32_frame_up_to_date): ...here...
4273 * xterm.c (XTframe_up_to_date): ...and here...
4274 * nsterm.m (ns_frame_up_to_date): ...but not here.
4275 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
4276 Adjust users.
4277 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
4278 Do not check whether GC is in progress.
4279
6ceeb5f1
DA
42802012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4281
4282 * xdisp.c (window_buffer_changed): New function.
4283 (update_menu_bar, update_tool_bar): Use it to
4284 simplify large 'if' statements.
4285 (redisplay_internal): Generalize commonly used
4286 'tail' and 'frame' local variables.
4287
ec84768f
EZ
42882012-11-22 Eli Zaretskii <eliz@gnu.org>
4289
4290 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4291 with Windows system header.
4292
9239d970
PE
42932012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4294
4295 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4296 * alloc.c: Assume unistd.h exists.
4297 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4298 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4299 (getwd) [USG]: Remove; no longer needed.
4300 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4301 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4302 * w32.h (getcwd): Remove decl.
4303
954bba56
SM
43042012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4305
4306 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4307 Make it set selected_window as well.
4308 (update_tool_bar): Use it.
4309
6ef2e5ef 43102012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
4311
4312 * emacs.c (main): Set the G_SLICE environment variable for all
4313 Cygwin builds, not just GTK builds. See
4314 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4315
6ef2e5ef 43162012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
4317
4318 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4319 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4320 Define for the MSVC compiler.
4321
6ef2e5ef 4322 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
4323
4324 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4325 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4326 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
4327 dostounix_filename assumes it gets a unibyte string.
4328 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
4329 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4330
eadf1faa
SM
43312012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4332
4333 Conflate Qnil and Qunbound for `symbol-function'.
4334 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4335 * lread.c (init_obarray): Set `function' fields to Qnil.
4336 * eval.c (Fcommandp): Ignore Qunbound.
4337 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4338 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4339 Test NILP rather than Qunbound.
4340 (Ffmakunbound): Set to Qnil.
4341 (Fsymbol_function): Never signal an error.
4342 (Finteractive_form): Ignore Qunbound.
4343
b83fdfa9
PE
43442012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4345
4346 * eval.c (interactive_p): Remove no-longer-used decl.
4347
952580c5
DA
43482012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4349
4350 * xdisp.c (buffer_shared): Adjust comment.
4351 (buffer_shared_and_changed): New function.
4352 (prepare_menu_bars, redisplay_internal): Use it to
4353 decide whether all windows or frames should be updated.
ea6de9b1
DA
4354 (window_outdated): New function.
4355 (text_outside_line_unchanged_p, redisplay_window): Use it.
4356 (redisplay_internal): Likewise. Fix indentation.
952580c5 4357
23ba2705
SM
43582012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4359
4360 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4361 (syms_of_eval): Remove corresponding defsubr.
4362 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4363
6e9f7997
DC
43642012-11-19 Daniel Colascione <dancol@dancol.org>
4365
4366 * w32fns.c (Fx_file_dialog):
4367 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4368 cygwin_convert_file_name*.
4369
4370 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4371 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4372
552a1590
PE
43732012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4374
4375 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4376
2ac9538d 43772012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
4378
4379 * w32select.c: Include w32common.h before w32term.h, so that
4380 windows.h gets included before w32term.h uses some of its
4381 features, see below.
4382
23ba2705
SM
4383 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4384 New typedefs.
4385 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4386 New prototypes.
d8715cdf
EZ
4387 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4388
2ac9538d 43892012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
4390
4391 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4392 (ns_select): Return at once if events are held (Bug#12834).
4393
2ac9538d 43942012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 4395
4396 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4397 Needed following 2012-10-20 change. (Bug#12902)
4398
c1f7ba3a
JB
43992012-11-18 Juanma Barranquero <lekktu@gmail.com>
4400
4401 * w32proc.c (waitpid): Remove unused label get_result.
4402
a75ce9d3
JB
44032012-11-17 Juanma Barranquero <lekktu@gmail.com>
4404
4405 * makefile.w32-in (SYSWAIT_H): New macro.
4406 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4407 ($(BLD)/sysdep.$(O)): Update dependencies.
4408
49cdacda
PE
44092012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4410
4411 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4412 * callproc.c (relocate_fd): Assume F_DUPFD.
4413 * emacs.c, term.c (O_RDWR): Remove.
4414 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4415 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4416 * nsterm.m: Assume <fcntl.h> exists.
4417 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4418 (create_pty, Fmake_network_process, server_accept_connection)
4419 (wait_reading_process_output, init_process_emacs):
4420 Assume O_NONBLOCK.
4421 (wait_reading_process_output): Put in a special case for WINDOWSNT
4422 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4423 It's not clear this is needed, but it's a more-conservative change.
4424 (create_process): Assume FD_CLOEXEC.
4425 (create_process, create_pty): Assume O_NOCTTY.
4426 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4427 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4428 Omit if not DOS_NT, since F_GETFL is not defined there.
4429 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4430 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4431 (O_NOCTTY): Remove.
4432 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4433 lack it, since gnulib guarantees this.
4434 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4435
22bae83f
EZ
44362012-11-17 Eli Zaretskii <eliz@gnu.org>
4437
6ad30855
EZ
4438 * w32.c (faccessat): Pretend that directories have the execute bit
4439 set. Emacs expects that, e.g., in files.el:cd-absolute.
4440
22bae83f
EZ
4441 * w32proc.c (create_child): Don't clip the PID of the child
4442 process to fit into an Emacs integer, as this is no longer a
4443 restriction.
4444 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4445 reaping only the process specified by PID argument, if that is
4446 positive. Use PID instead of dead_child to know which process to
4447 reap. Wait for the child to die only if WNOHANG is not in
4448 OPTIONS.
4449 (sys_select): Don't set dead_child.
4450
4451 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4452 as it is no longer needed.
4453
4454 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4455 no longer needed.
4456 (record_child_status_change): Remove the setting of
4457 record_at_most_one_child for the !WNOHANG case.
4458
a631d0e0
PE
44592012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4460
4461 Fix problems in ns port found by static checking.
4462 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4463 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4464 not to process group.
4465 (ns_select): Use emacs_write, not write, as that's more robust
4466 in the presence of signals.
4467 (fd_handler:): Check for read errors.
4468
d56f2e49
GM
44692012-11-16 Glenn Morris <rgm@gnu.org>
4470
4471 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4472
96e05507 44732012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
4474
4475 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4476
96e05507 44772012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
4478
4479 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4480 use the same value of thread handle.
4481 (start_timer_thread): If the timer thread exited (due to error),
4482 clean up by closing the two handles it used. Duplicate the caller
4483 thread's handle here, so it gets duplicated only once, when
4484 launching the timer thread. Set priority of the timer thread, not
4485 the caller thread.
4486 (getitimer): Don't duplicate the caller thread's handle here.
4487 (Bug#12832)
4488
96e05507 44892012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
4490
4491 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4492 called (Bug#12834).
4493
3d082a26
PE
44942012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4495
4496 Remove no-longer-used pty_max_bytes variable.
4497 * process.c (pty_max_bytes): Remove; unused.
4498 (send_process): Do not set it.
4499
b72c161c
JB
45002012-11-15 Juanma Barranquero <lekktu@gmail.com>
4501
4502 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4503 Update dependencies.
4504
bf20ea80
PE
45052012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4506
4507 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4508 This follows up on the 2012-09-29 patch that removed indirection
4509 for the 'function' field. Reported by Sergey Vinokurov in
4510 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4511
14f20728
EZ
45122012-11-14 Eli Zaretskii <eliz@gnu.org>
4513
4514 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4515 different name, as the MS runtime does not have such a function,
4516 and probably never will.) All callers changed. Ignore DIRFD
4517 value if PATH is an absolute file name, to match Posix spec
4518 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4519 symlinks.
4520
77731919
DA
45212012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4522
4523 * xdisp.c (echo_area_display, redisplay_internal):
4524 Omit redundant check whether frame_garbaged is set.
4525
73dcdb9f
PE
45262012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 Use faccessat, not access, when checking file permissions (Bug#12632).
4529 This fixes a bug that has been present in Emacs since its creation.
4530 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4531 which must set some sort of record. (Torek's bug report was against
4532 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4533 same common flaw.) See Torek's Usenet posting
4534 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4535 Posted: Fri Apr 8 14:18:56 1983.
4536 * Makefile.in (LIB_EACCESS): New macro.
4537 (LIBES): Use it.
4538 * callproc.c (init_callproc):
4539 * charset.c (init_charset):
4540 * fileio.c (check_existing, check_executable, check_writable)
4541 (Ffile_readable_p):
4542 * lread.c (openp, load_path_check):
4543 * process.c (allocate_pty):
4544 * xrdb.c (file_p):
4545 Use effective UID when checking permissions, not real UID.
4546 * callproc.c (init_callproc):
4547 * charset.c (init_charset):
4548 * lread.c (load_path_check, init_lread):
4549 Test whether directories are accessible, not merely whether they exist.
4550 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4551 * fileio.c (check_existing, check_executable, check_writable)
4552 (Ffile_readable_p):
4553 Use symbolic names instead of integers for the flags, as they're
4554 portable now.
4555 (check_writable): New arg AMODE. All uses changed.
4556 Set errno on failure.
4557 (Ffile_readable_p): Use faccessat, not stat + open + close.
4558 (Ffile_writable_p): No need to call check_existing + check_writable.
4559 Just call check_writable and then look at errno. This saves a syscall.
4560 dir should never be nil; replace an unnecessary runtime check
4561 with an eassert. When checking the parent directory of a nonexistent
4562 file, check that the directory is searchable as well as writable, as
4563 we can't create files in unsearchable directories.
4564 (file_directory_p): New function, which uses 'stat' on most platforms
4565 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4566 (Ffile_directory_p, Fset_file_times): Use it.
4567 (file_accessible_directory_p): New function, which uses a single
4568 syscall for efficiency.
4569 (Ffile_accessible_directory_p): Use it.
4570 * xrdb.c (file_p): Use file_directory_p.
4571 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4572 * lread.c (openp): When opening a file, use fstat rather than
4573 stat, as that avoids a permissions race. When not opening a file,
4574 use file_directory_p rather than stat.
4575 (dir_warning): First arg is now a usage string, not a format.
4576 Use errno. All uses changed.
4577 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4578 that merely introduced a race.
4579 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4580 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4581 and similarly for the other O_* flags.
4582 * w32.c (sys_faccessat): Rename from sys_access and switch to
4583 faccessat's API. All uses changed.
4584 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4585 (magic_db): Rename from magic_file_p.
4586 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4587 char *, so that we don't have to test for file existence
4588 separately from opening the file for reading. This removes a race
4589 fixes a permission-checking problem, and simplifies the code.
4590 All uses changed.
4591 (file_p): Remove; no longer needed.
4592
2a14f83b
DA
45932012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4594
4595 Omit glyphs initialization at startup.
4596 * dispnew.c (glyphs_initialized_initially_p): Remove.
4597 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4598 (Fredraw_frame): Move actual code from here...
c7085245 4599 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
4600 (Fredraw_display): Use redraw_frame.
4601 * xdisp.c (clear_garbaged_frames): Likewise.
4602
f78ee6af 46032012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
4604
4605 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4606 passed to pint2str and pint2hrstr to be at most the size of the
4607 frame's decode_mode_spec_buffer. This avoids crashes with very
4608 large values of FIELD_WIDTH argument to decode_mode_spec.
4609 (Bug#12867)
4610
b95a9c0c
PE
46112012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4612
4613 Fix a race with verify-visited-file-modtime (Bug#12863).
4614 Since at least 1991 Emacs has ignored an mtime difference of no
4615 more than one second, but my guess is that this was to work around
4616 file system bugs that were fixed long ago. Since the race is
4617 causing problems now, let's remove that code.
4618 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4619 whose time stamp is off by no more than a second. Insist that the
4620 file time stamps match exactly.
4621
be49ba74
DA
46222012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4623
4624 * frame.h (struct frame): Convert external_tool_bar member to
4625 1-bit unsigned bitfield.
4626 * termhooks.h (struct terminal): Remove mouse_moved member since
4627 all users are long dead. Adjust comment on mouse_position_hook.
4628
5b04e9f9
DA
46292012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4630
4631 Simplify by using FOR_EACH_FRAME here and there.
4632 * frame.c (next_frame, prev_frame, other_visible_frames)
4633 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4634 * w32term.c (x_window_to_scroll_bar): Likewise.
4635 * window.c (window_list): Likewise.
4636 * xdisp.c (x_consider_frame_title): Likewise.
4637 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4638 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4639 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4640 * xmenu.c (menubar_id_to_frame): Likewise.
4641 * xselect.c (frame_for_x_selection): Likewise.
4642 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4643 (x_window_to_menu_bar): Likewise.
4644 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4645
76ae24d7
PE
46462012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4647
12cc4337
PE
4648 * data.c (Qdefalias_fset_function): Now static.
4649
76ae24d7
PE
4650 Another tweak to vectorlike_header change.
4651 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4652 Remove, and replace all uses with ...
4653 (next_in_free_list, set_next_in_free_list):
4654 New functions, which respect C's aliasing rules better.
4655
1479c557
PE
46562012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4657
4658 * window.c (list4i): Rename from 'quad'. All uses changed.
4659 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4660
11235c03
JB
46612012-11-11 Juanma Barranquero <lekktu@gmail.com>
4662
4663 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4664 warning about mixing declarations and code in ISO C90.
4665
6baf66d5 46662012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
4667
4668 * window.c (Fsplit_window_internal): Set combination limit of
4669 new parent window to t iff Vwindow_combination_limit is t;
4670 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 4671 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 4672
6baf66d5 46732012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
4674
4675 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4676 amount when the scroll margins are too large. When scrolling
4677 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
4678 scroll margin within a reasonable number of screen lines.
4679 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
4680 point is positioned many lines beyond the window top/bottom.
4681 (Bug#12811)
4682
508f51f5
EZ
4683 * ralloc.c (relinquish): If real_morecore fails to return memory
4684 to the system, don't crash; instead, leave the last heap
4685 unchanged and return. (Bug#12774)
4686
32e5c58c
SM
46872012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4688
4689 * lisp.h (AUTOLOADP): New macro.
4690 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4691 * data.c (Ffset): Remove special ad-advice-info handling.
4692 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4693 (Fsubr_arity): CSE.
4694 (Finteractive_form): Simplify.
4695 (Fquo): Don't insist on having at least 2 arguments.
4696 (Qdefalias_fset_function): New var.
4697
719b0aa5
JD
46982012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4699
4ab15c3e
JD
4700 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4701
719b0aa5
JD
4702 * nsfont.m (Qcondensed, Qexpanded): New variables.
4703 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4704 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4705
535cc8e9
DA
47062012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4707
4708 Fix recently introduced crash on MS-Windows (Bug#12839).
4709 * w32term.h (struct scroll_bar): Use convenient header.
4710 (SCROLL_BAR_VEC_SIZE): Remove.
4711 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4712
7d377c48
DA
47132012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4714
4715 Tweak last vectorlike_header change.
4716 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4717 vectorlike object on the free list. This is introduced to avoid
4718 some (but not all) pointer casting and aliasing problems, see
4719 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4720 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4721 objects.
4722 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4723
7ad27466
JD
47242012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4725
32e5c58c 4726 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
4727 been removed, so remove them here also.
4728
57618ecf
SM
47292012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4730
4731 * doc.c (Fdocumentation): Handle new property
4732 dynamic-docstring-function to replace the old ad-advice-info.
4733
53371430
PE
47342012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4735
4736 * fns.c (Qeql, hashtest_eq): Now static.
4737
61ddb1b9
SM
47382012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4739
4740 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4741 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4742 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4743 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4744
04a2d0d3
PE
47452012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4746
4747 Use same hash function for hashfn_profiler as for hash_string etc.
4748 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4749 * lisp.h (sxhash_combine): New inline function, with the contents
4750 of the old SXHASH_COMBINE.
4751 * profiler.c (hashfn_profiler): Use it, instead of having a
4752 special hash function containing a comparison that always yields 1.
4753
de5ef41a
SM
47542012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4755
4756 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4757 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4758 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4759 Remove unused vars.
4760
a23c4171
JD
47612012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4762
4763 * image.c (xpm_make_color_table_h): Fix compiler error because
4764 make_hash_table changed.
4765
0b59090b 47662012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
4767
4768 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4769
b7432bb2
SM
47702012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4771
4772 Use ad-hoc comparison function for the profiler's hash-tables.
4773 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4774 (make_log): Use them.
4775 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4776 call Fequal any more.
4777 (Ffunction_equal): New function.
4778 (cmpfn_profiler, hashfn_profiler): New functions.
4779 (syms_of_profiler): Initialize them.
4780 * lisp.h (struct hash_table_test): New struct.
4781 (struct Lisp_Hash_Table): Use it.
4782 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4783 * fns.c (make_hash_table): Take a struct to describe the test.
4784 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4785 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4786 (hash_lookup, hash_remove_from_table): Move assertion checking of
4787 hashfn result here. Check hash-equality before calling cmpfn.
4788 (Fmake_hash_table): Adjust call to make_hash_table.
4789 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4790 (syms_of_fns): Initialize them.
4791 * emacs.c (main): Move syms_of_fns earlier.
4792 * xterm.c (syms_of_xterm):
4793 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4794 * print.c (print_object): Adjust to new hash-table struct.
4795 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4796
88002743
EZ
47972012-11-08 Eli Zaretskii <eliz@gnu.org>
4798
4799 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4800 value of w32-scroll-lock-modifier is neither nil nor one of the
4801 known key modifiers. (Bug#12806)
4802
914adc42
DA
48032012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4804
4805 Shrink struct vectorlike_header to the only size field.
4806 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4807 Adjust comment.
4808 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4809 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4810 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4811 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4812 information from the vector header. Adjust comment.
4813 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4814 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4815 layout.
4816 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4817 (struct vectorlike_header): Remove next member. Adjust comment.
4818 (struct Lisp_Subr): Add convenient header. Adjust comment.
4819 (allocate_pseudovector): Adjust prototype.
4820 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4821 (sweep_string, lisp_malloc): Remove useless prototypes.
4822 (enum mem_type): Adjust comment.
4823 (NEXT_IN_FREE_LIST): New macro.
4824 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4825 (Fmake_bool_vector): Likewise.
4826 (struct large_vector): New type to represent allocation unit for
4827 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4828 (large_vectors): Change type to struct large_vector.
4829 (allocate_vector_from_block): Simplify.
4830 (PSEUDOVECTOR_NBYTES): Replace with...
4831 (vector_nbytes): ...new function. Adjust users.
4832 (sweep_vectors): Adjust processing of large vectors.
4833 (allocate_vectorlike): Likewise.
4834 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4835 Add easserts. Adjust XSETPVECTYPESIZE usage.
4836 (allocate_buffer): Use BUFFER_PVEC_INIT.
4837 (live_vector_p): Adjust to match large vector.
4838 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4839 * buffer.h (struct buffer): Add next member.
4840 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4841 New macros.
4842 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4843 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4844 (copy_hash_table): Adjust to match vector header change.
4845 * lread.c (defsubr): Use XSETPVECTYPE.
4846 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4847 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4848 (xvecsize): New command.
4849
c66f21ea
DA
48502012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4851
4852 * keyboard.c (event_to_kboard): Do not dereference
4853 frame_or_window field of SELECTION_REQUEST_EVENT
4854 and SELECTION_CLEAR_EVENT events (Bug#12814).
4855 * xterm.h (struct selection_input_event): Adjust comment.
4856
eb147960
EZ
48572012-11-07 Eli Zaretskii <eliz@gnu.org>
4858
dab72075
EZ
4859 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4860 such as Scroll Lock, if the respective keys are treated as
4861 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 4862 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 4863
5890e400
DA
48642012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4865
4866 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4867
b6b3b294
PE
48682012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 Restore some duplicate definitions (Bug#12814).
4871 This undoes part of the 2012-11-03 changes. Some people build
4872 with plain -g rather than with -g3, and they need the duplicate
4873 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4874 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4875 Define as macros, as well as as enums or as constants.
4876
e770aad5
JD
48772012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4878
4879 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4880 to keypad keys (Bug#12816).
4881
68f8f1c0
PE
48822012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4883
4884 Minor adjustments of recently-changed frame functions.
4885 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4886 known to be a frame (we're in the FRAMEP branch).
4887 * lisp.h (Qframep): Remove decl. frame.h declares this.
4888 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4889 since they're meant for Lisp fixnum values.
4890
72f94d4b
DA
48912012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4892
4893 * window.c (Fwindow_combination_limit): Revert to the only
4894 required argument and adjust docstring as suggested in
4895 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4896 by Martin Rudalics <rudalics@gmx.at>.
4897
d9f07150
DA
48982012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4899
4900 Widely used frame validity and checking functions.
4901 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4902 * frame.c (decode_live_frame, decode_any_frame): New functions.
4903 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4904 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4905 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4906 (Fframe_pointer_visible_p): Use decode_any_frame.
4907 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4908 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4909 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4910 (Fframe_focus): Likewise. Allow zero number of arguments.
4911 Adjust docstring.
4912 (frame_buffer_list, frame_buffer_predicate): Remove.
4913 * lisp.h (frame_buffer_predicate): Remove prototype.
4914 * buffer.c (Fother_buffer): Use decode_any_frame.
4915 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4916 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4917 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4918 (Fclose_font, Ffont_info): Use decode_live_frame.
4919 * fontset.c (check_fontset_name): Likewise.
4920 * terminal.c (Fframe_terminal): Likewise.
4921 * w32fns.c (check_x_frame): Likewise.
4922 * window.c (Fminibuffer_window, Fwindow_at)
4923 (Fcurrent_window_configuration): Likewise.
4924 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4925 Likewise. Allow zero number of arguments. Adjust docstring.
4926 * dispnew.c (Fredraw_frame): Likewise.
4927 * xfaces.c (frame_or_selected_frame): Remove.
4928 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4929 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4930 (Fframe_face_alist): Use decode_live_frame.
4931 * xfns.c (check_x_frame): Likewise.
4932
89bc0592
DA
49332012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4934
4935 * window.c (quad): New function.
4936 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4937 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4938 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4939 (Fwindow_line_height): Use it.
4940 (Fwindow_fringes): Use list3.
4941 (Fwindow_scroll_bars): Use list4.
4942 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4943 (Fwindow_combination_limit): Allow zero number of arguments.
4944
c8e3a9c3
EZ
49452012-11-05 Eli Zaretskii <eliz@gnu.org>
4946
4947 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4948
8e2417bf 4949 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4950 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4951 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4952
209c6a58
CY
49532012-11-05 Chong Yidong <cyd@gnu.org>
4954
4955 * process.c (wait_reading_process_output): Revert previous change.
4956
8148369c
PE
49572012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4958
dd0333b6
PE
4959 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4960 This removes code that has been obsolete since around 1990.
4961 * callproc.c (Fcall_process):
4962 * emacs.c (main):
4963 * process.c (create_process):
4964 * term.c (dissociate_if_controlling_tty):
4965 Assume setsid exists.
4966 * callproc.c (child_setup): Assume setpgid exists and behaves as
4967 per POSIX.1-1988 or later.
4968 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4969 * emacs.c (shut_down_emacs):
4970 * sysdep.c (sys_suspend, init_foreground_group):
4971 Assume getpgrp behaves as per POSIX.1-1998 or later.
4972 * msdos.c (setpgrp): Remove.
4973 (tcgetpgrp, setpgid, setsid): New functions.
4974 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4975 * term.c (no_controlling_tty): Remove; unused.
4976 * w32proc.c (setpgrp): Remove.
4977 (setsid, tcgetpgrp): New functions.
4978
8148369c
PE
4979 Simplify by assuming __fpending.
4980 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4981 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4982 Do not assume that __fpending's result fits in int.
4983
76abf5e5
PE
49842012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4985
06b63c9b
PE
4986 Remove EMACS_OUTQSIZE+sleep hack.
4987 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4988 than 2400 bps, which throttled Emacs by having it sleep.
4989 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4990 was added, and anyway those old terminals are long dead.
4991 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4992 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4993
76abf5e5
PE
4994 Fix data-loss with --version (Bug#9574).
4995 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4996 as we can't assume that emacs_strerror is initialized, and strerror
4997 is good enough here.
4998 (main): Invoke atexit earlier, to catch earlier instances of
4999 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
5000
8f31e74b
MM
50012012-11-04 Michael Marchionna <tralfaz@pacbell.net>
5002
5003 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
5004 (keyDown): Remap keypad keys to X11 virtual key codes.
5005
0d879dca
PE
50062012-11-03 Paul Eggert <eggert@cs.ucla.edu>
5007
7ccfb720
PE
5008 Fix data-loss with --batch (Bug#9574).
5009 * emacs.c: Include <close-stream.h>.
5010 (close_output_streams): New function.
5011 (main): Pass it to atexit, so that Emacs closes stdout and stderr
5012 and handles errors appropriately.
5013 (Fkill_emacs): Don't worry about flushing, as close_output_stream
5014 does that now.
5015
0b3d4a47
PE
5016 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
5017 The symptom is a diagnostic "GLib-WARNING **: In call to
5018 g_spawn_sync(), exit status of a child process was requested but
5019 SIGCHLD action was set to SIG_IGN and ECHILD was received by
5020 waitpid(), so exit status can't be returned." The diagnostic
5021 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
5022 The real bug is a race condition between Emacs and glib: Emacs
5023 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
5024 so that glib can't find it. Work around the bug by invoking
5025 waitpid only on subprocesses that Emacs itself creates.
5026 * process.c (create_process, record_child_status_change):
5027 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
5028 know the pid rather than having the callee infer it.
5029 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
5030 (create_process): Set new 'alive' member if child is created.
5031 (process_status_retrieved): New function.
5032 (record_child_status_change): Use it.
5033 Accept negative 1st argument, which means to wait for the
5034 processes that Emacs already knows about. Move special-case code
5035 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
5036 processes that have already been waited for, by testing and
5037 clearing new 'alive' member.
5038 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
5039 now does this internally.
5040 (handle_child_signal): Let record_child_status_change do all
5041 the work, since we do not want to reap all exited child processes,
5042 only the child processes that Emacs itself created.
5043 * process.h (Lisp_Process): New boolean member 'alive'.
5044
0d879dca
PE
5045 Omit duplicate definitions no longer needed with gcc -g3.
5046 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
5047 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
5048 Define only as macros. There's no longer any need to also define
5049 these symbols as enums or as constants, since we now assume
5050 gcc -g3 when debugging.
5051
3478f4b5
EZ
50522012-11-03 Eli Zaretskii <eliz@gnu.org>
5053
5054 * lisp.mk: Adjust comments to the fact that term/internal is now
5055 loaded from loadup.el.
5056
5057 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
5058 (msdos_fatal_signal): New function.
5059 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
5060 its argument list.
5061
5062 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
5063 for GCC versions before 4.
5064 (emacs_raise): Define to call msdos_fatal_signal.
5065
5066 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
5067 iterator when starting in the middle of a display or overlay
5068 string. (Bug#12745)
5069
85fabcb7
CY
50702012-11-03 Chong Yidong <cyd@gnu.org>
5071
5072 * process.c (wait_reading_process_output): Clean up the last
5073 change.
5074
893cc455
CY
50752012-11-03 Jim Paris <jim@jtan.com> (tiny change)
5076
5077 * process.c (wait_reading_process_output): Avoid a race condition
5078 with SIGIO delivery (Bug#11536).
5079
0f7b074f
CY
50802012-11-03 Chong Yidong <cyd@gnu.org>
5081
5082 * buffer.c (cursor_type): Untabify docstring.
5083
3737fee7
DA
50842012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5085
5086 * frame.h (struct frame): Drop can_have_scroll_bars member
5087 which is meaningless for a long time. Adjust comments.
5088 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
5089 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
5090
b6a9e8b1
DA
50912012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
5092
5093 * window.c (decode_next_window_args): Update window arg after
5094 calling decode_live_window and so fix crash reported at
5095 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
5096 by Juanma Barranquero <lekktu@gmail.com>.
5097 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
5098 * font.c (Ffont_at): Likewise.
5099
600d4768
JD
51002012-11-01 Jan Djärv <jan.h.d@swipnet.se>
5101
5102 * widget.c (resize_cb): New function.
5103 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
5104 (EmacsFrameResize): Check if all is up to date before changing frame
5105 size.
5106
1005b4b9
EZ
51072012-11-02 Eli Zaretskii <eliz@gnu.org>
5108
5109 Implement backtrace output for fatal errors on MS-Windows.
5110 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
5111 (BACKTRACE_LIMIT_MAX): New macro.
5112 (w32_backtrace): New function.
5113 (emacs_abort): Use w32_backtrace when the user chooses not to
5114 attach a debugger. Update the text of the abort dialog.
5115
b9e9df47
DA
51162012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5117
5118 Window-related stuff cleanup here and there.
5119 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
5120 Use decode_any_window.
5121 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
5122 * xdisp.c (Fformat_mode_line): Likewise.
5123 * font.c (Ffont_at): Use decode_live_window.
5124 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
5125 * window.c (decode_next_window_args): Likewise.
5126 (decode_any_window): Remove static.
5127 * window.h (decode_any_window): Add prototype.
5128 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
5129 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
5130 respectively.
5131
2b371ff7
DA
51322012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
5133
5134 Remove pad from struct input_event.
5135 * termhooks.h (struct input_event): Remove padding field.
5136 Adjust comment.
5137 * keyboard.c (event_to_kboard): Simplify because frame_or_window
5138 member is never cons for a long time. Adjust comment.
5139 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
5140 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
5141 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
5142 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
5143
7e8b50d9
EZ
51442012-11-01 Eli Zaretskii <eliz@gnu.org>
5145
5146 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
5147
322aea6d
PE
51482012-10-31 Paul Eggert <eggert@cs.ucla.edu>
5149
5150 Fix crash when using Emacs as commit editor for git (Bug#12697).
5151 * callproc.c (setpgrp): Remove macro, as we now use setpgid
5152 and it is configured in conf_post.h.
5153 (Fcall_process): Don't invoke both setsid and setpgid; the former
5154 is enough, if it exists.
5155 * callproc.c (Fcall_process, child_setup):
5156 * process.c (create_process): Use setpgid.
5157 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
5158 for the real thing.
5159 * dispnew.c (init_display): Initialize the foreground group
5160 if we are running a tty display.
5161 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
5162 * lisp.h (init_foreground_group): New decl.
5163 * sysdep.c (inherited_pgroup): New static var.
5164 (init_foreground_group, tcsetpgrp_without_stopping)
5165 (narrow_foreground_group, widen_foreground_group): New functions.
5166 (init_sys_modes): Narrow foreground group.
5167 (reset_sys_modes): Widen foreground group.
5168
220cb2bd
MA
51692012-10-31 Michael Albinus <michael.albinus@gmx.de>
5170
5171 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
5172
218e997a
MR
51732012-10-31 Martin Rudalics <rudalics@gmx.at>
5174
5175 * minibuf.c (read_minibuf): Restore current buffer since
5176 choose_minibuf_frame calling Fset_frame_selected_window may
5177 change it (Bug#12766).
5178
02615da0
JD
51792012-10-30 Jan Djärv <jan.h.d@swipnet.se>
5180
5181 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
5182
aee5b18e
KH
51832012-10-30 Kenichi Handa <handa@gnu.org>
5184
5185 * font.c (Ffont_at): If WINDOW is specified and it is not
5186 displaying the current buffer, signal an error.
5187
ba116008
DC
51882012-10-29 Daniel Colascione <dancol@dancol.org>
5189
de5ef41a
SM
5190 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
5191 In preparation for fixing bug#12739, move these functions from
ba116008
DC
5192 here...
5193
5194 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
5195 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
5196 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 5197
640bf8ad
EZ
51982012-10-28 Eli Zaretskii <eliz@gnu.org>
5199
5200 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
5201 (timer_loop, getitimer, setitimer): Use it instead of
5202 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
5203 'clock'.
5204 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
5205 literal 10000.
5206
64ccff5f
JD
52072012-10-28 Jan Djärv <jan.h.d@swipnet.se>
5208
5209 * nsterm.m (NO_APPDEFINED_DATA): New define.
5210 (last_appdefined_event_data): New variable
5211 (last_appdefined_event): Remove.
5212 (ns_select): Initialize t from last_appdefined_event_data instead
5213 of [last_appdefined_event data1].
5214 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
5215 remove last_appdefined_event (Bug#12698).
5216
e483264c
SM
52172012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
5218
5219 * frame.c (x_set_font): Catch internal error.
5220
6c16c13e
EZ
52212012-10-27 Eli Zaretskii <eliz@gnu.org>
5222
e483264c
SM
5223 Avoid overflow in w32 implementation of interval timers.
5224 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
5225 actually executes.
5226 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
5227 'volatile ULONGLONG' types. All the other data which was
5228 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
5229 (GetThreadTimes_Proc): New typedef.
5230 (w32_get_timer_time): New function, returns a suitable time value
5231 for the timer.
5232 (timer_loop): Enter critical section when accessing ULONGLONG
5233 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
5234 atomic. Call 'w32_get_timer_time' instead of 'clock'.
5235 Remove unused variable.
6c16c13e
EZ
5236 (init_timers): Initialize s_pfn_Get_Thread_Times.
5237 (start_timer_thread): Don't assign itimer->caller_thread here.
5238 (getitimer): Assign itimer->caller_thread here.
5239 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 5240 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 5241
ccc83f50
EZ
52422012-10-26 Eli Zaretskii <eliz@gnu.org>
5243
5244 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
5245 mouse movement events if the menu bar is active. This avoids
5246 producing a busy "hour-glass" cursor by Windows if the mouse
5247 pointer is positioned over a tooltip shown for some menu item.
5248
69deda53
PE
52492012-10-25 Paul Eggert <eggert@cs.ucla.edu>
5250
5251 Don't assume process IDs fit in int.
5252 * emacs.c (shut_down_emacs) [!DOS_NT]:
5253 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
5254 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
5255 Use pid_t, not int, to store process IDs, as 'int'
5256 is not wide enough on a few platforms (e.g., AIX and IRIX).
5257
7e70a152
KH
52582012-10-23 Kenichi Handa <handa@gnu.org>
5259
5260 The following change is to make face-font-rescale-alist work
5261 correctly for non-ASCII fonts.
5262
5263 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
5264 (font_open_for_lface): Handle Vface_font_rescale_alist.
5265
49238e7f
CY
52662012-10-23 Chong Yidong <cyd@gnu.org>
5267
5268 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
5269
5ec86886
JD
52702012-10-21 Jan Djärv <jan.h.d@swipnet.se>
5271
ef446959
JD
5272 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
5273 for screen font.
5274 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
5275
5ec86886
JD
5276 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
5277 event (Bug#12681).
5278
ee7a418d
GM
52792012-10-21 Glenn Morris <rgm@gnu.org>
5280
5281 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5282
4973679b
PE
52832012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5284
5285 Port to OpenBSD 5.1.
5286 * frame.c (Fmouse_position, Fmouse_pixel_position):
5287 * xdisp.c (produce_stretch_glyph):
5288 Declare local vars only when they're needed.
5289 This is clearer and avoids a warning on OpenBSD about unused vars.
5290 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5291 This is safer, and avoids OpenBSD warnings about unused vars.
5292 * keyboard.c (record_menu_key): Remove unnecessary decl.
5293 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5294 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5295 as our definition clashes with OpenBSD's.
5296 * xfaces.c (load_face_colors, check_lface_attrs)
5297 (get_lface_attributes_no_remap, get_lface_attributes)
5298 (lface_fully_specified_p, x_supports_face_attributes_p)
5299 (tty_supports_face_attributes_p, face_fontset, realize_face)
5300 (realize_x_face, realize_tty_face):
5301 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5302 merely Lisp_Object *. This is more informative and avoids
5303 a warning on OpenBSD about accessing beyond an object's size.
5304
c664f463
CY
53052012-10-20 Chong Yidong <cyd@gnu.org>
5306
5307 * lread.c (Fload): Doc fix (Bug#12592).
5308
6ec83f92 53092012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
5310
5311 * font.c (Ffont_at): Fix previous change.
5312
d2824928
EZ
53132012-10-19 Eli Zaretskii <eliz@gnu.org>
5314
e483264c
SM
5315 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5316 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
5317 for the reasons.
5318
d2824928
EZ
5319 * alloc.c (NSTATICS): Decrease to 0x800.
5320
f60d391f
SM
53212012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5322
4a0e1924 5323 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
5324 error (bug#12677).
5325
1a9327d5
JD
53262012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5327
5328 * nsterm.m (ns_select): Check writefds before call to
5329 FD_ISSET (Bug#12668).
5330
14145a1e
DC
53312012-10-18 Daniel Colascione <dancol@dancol.org>
5332
5333 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5334 (staticpro): If we run out of staticpro slots, die with an
5335 informative error instead of just calling emacs_abort.
5336
1f76f6f5
MR
53372012-10-18 Martin Rudalics <rudalics@gmx.at>
5338
5339 Fix two flaws reported by Dmitry Antipov.
5340 * window.c (Ftemp_output_buffer_show): Remove.
5341 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5342 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5343
fcf14875
EZ
53442012-10-17 Eli Zaretskii <eliz@gnu.org>
5345
1f76f6f5
MR
5346 * makefile.w32-in ($(BLD)/w32.$(O)):
5347 ($(BLD)/vm-limit.$(O)):
5348 ($(BLD)/term.$(O)):
5349 ($(BLD)/unexw32.$(O)):
5350 ($(BLD)/fileio.$(O)):
a68089e4
EZ
5351 ($(BLD)/dispnew.$(O)): Update dependencies.
5352
5353 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5354 Add prototypes.
5355
5356 * w32proc.c: Include ctype.h.
5357
5358 * w32.h (init_environment, check_windows_init_file)
5359 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5360 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5361 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5362 (sys_link): Add prototypes.
5363
5364 * w32.c: Include w32select.h.
5365 (sys_access, e_malloc, sys_select): Add prototypes.
5366 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5367
5368 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5369
5370 * unexw32.c: Include lisp.h and w32.h.
5371
5372 * term.c [WINDOWSNT]: Include w32term.h.
5373
5374 * process.c [WINDOWSNT]: Add prototype of sys_select.
5375
5376 * fileio.c [WINDOWSNT]: Include w32.h.
5377
5378 * dispnew.c [WINDOWSNT]: Include w32.h.
5379
fcf14875
EZ
5380 * cygw32.c (Fcygwin_convert_path_to_windows)
5381 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5382 Lisp_Object values. (Bug#12661)
5383
5384 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5385 to Lisp_Object. (Bug#12661)
5386
fe0b1ec4
KH
53872012-10-17 Kenichi Handa <handa@gnu.org>
5388
5389 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5390 invalidate.
5391
d556ebf9
DA
53922012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5393
5394 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 5395 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 5396
f0863a54
DA
53972012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5398
5399 Do not verify indirection counters of killed buffers (Bug#12579).
5400 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5401 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5402
12fbe755
DA
54032012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5404
5405 * alloc.c (Fmake_byte_code): Fix typo in comment.
5406 * print.c (print_interval): Define as static to match prototype.
5407 * indent.c (disptab_matches_widthtab, recompute_width_table):
5408 Convert to eassert.
5409
61655b89
DA
54102012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5411
5412 * editfns.c (get_system_name): Remove.
5413 * lisp.h (get_system_name): Remove prototype.
5414 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5415 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5416
9520f2f2
DC
54172012-10-15 Daniel Colascione <dancol@dancol.org>
5418
5419 * dbusbind.c: Add comment explaining reason for previous change.
5420
dca778d5
MR
54212012-10-15 Martin Rudalics <rudalics@gmx.at>
5422
5423 * window.c (Fwindow_end): Rewrite check whether cached position
5424 can be used (Bug#12600).
5425 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5426 Set windows_or_buffers_changed.
5427
3e0341b0
DC
54282012-10-15 Daniel Colascione <dancol@dancol.org>
5429
5430 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5431 enabled by undefining the symbol "interface", which the platform
5432 headers define to something incompatible.
5433
33d4113c
DC
54342012-10-14 Daniel Colascione <dancol@dancol.org>
5435
5436 * image.c (init_tiff_functions, init_imagemagick_functions)
5437 (init_svg_functions): Fix cygw32 build break by using these
5438 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5439
a36fb15e
JD
54402012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5441
5442 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5443
537f336d
JD
54442012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5445
5446 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5447
0ba06a77
KH
54482012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5449
5450 * coding.c (detect_coding): Set coding->id before calling
5451 this->detector.
5452
ce2fe65a
AS
54532012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5454
5455 * fileio.c: Formatting fixes.
5456
d6453ce4
PE
54572012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5458
5459 Fix some stat-related races.
5460 * fileio.c (Fwrite_region): Avoid race condition if a file is
5461 removed or renamed by some other process immediately after Emacs
5462 writes it but before Emacs stats it. Do not assume that stat (or
5463 fstat) succeeds.
5464 * image.c (slurp_file): Resolve the file name with fopen + fstat
5465 rather than stat + fopen.
5466 (pbm_read_file) [0]: Remove unused code with stat race.
5467 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5468 Remove ineffective code with stat race.
5469
06485aa8
SM
54702012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5471
5472 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5473
167e3640
JD
54742012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5475
5476 * nsterm.m (hold_event_q): New static variable.
5477 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5478 ! q_event_ptr.
5479 (hold_event): New function.
5480 (ns_read_socket): If hold_event_q have events, store them and
5481 return (Bug#12384).
5482 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5483 is zero (Bug#12384).
5484
c40239df
JB
54852012-10-12 Juanma Barranquero <lekktu@gmail.com>
5486
5487 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5488
bb385a92
EZ
54892012-10-12 Eli Zaretskii <eliz@gnu.org>
5490
2a9f1099
EZ
5491 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5492
bb385a92
EZ
5493 * fileio.c (check_existing): New function.
5494 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5495 instead of calling 'stat', when what's needed is to check whether
5496 a file exists. This avoids expensive system calls on MS-Windows.
5497 (Bug#12587)
5498
8599b23a 5499 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
5500
5501 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5502 determine whether a file exists and is not a directory.
5503
5504 * lisp.h (check_existing): Add prototype.
5505
2b9c2e68
JD
55062012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5507
5508 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5509
81749a23
GM
55102012-10-12 Glenn Morris <rgm@gnu.org>
5511
5512 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5513
5253a5fd
SM
55142012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5515
389a94a5
SM
5516 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5517
5253a5fd
SM
5518 * eval.c (Fautoload): Remember previous autoload status in load-history.
5519
7cded46f
PE
55202012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5521
5522 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5523 * lread.c (load_each_byte, new_backquote_flag, readchar)
5524 (read_filtered_event, lisp_file_lexically_bound_p)
5525 (safe_to_load_version, Fload, complete_filename_p, openp)
5526 (build_load_history, readevalloop, read_escape, read1)
5527 (string_to_number, read_vector, read_list):
5528 * macros.c (Fstart_kbd_macro):
5529 * marker.c (CONSIDER):
5530 * menu.c (parse_single_submenu, digest_single_submenu)
5531 (find_and_return_menu_selection, Fx_popup_menu):
5532 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5533 (Ftry_completion):
5534 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5535 (ns_menu_show):
5536 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5537 (xmenu_show, xdialog_show):
5538 Use bool for booleans.
5539 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5540 as it's not a predicate. All uses changed. Omit unnecessary
5541 buffer termination.
5542
549c3414
DA
55432012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5544
5545 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5546 (save_excursion_restore): Do not restore mark if it was not saved.
5547
e85aafe7
PE
55482012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5549
fd2f90cf
PE
5550 * marker.c (cached_modiff): EMACS_INT, not int.
5551
c1af190b
PE
5552 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5553 instead of having a wrong decl.
e85aafe7
PE
5554 * nsmenu.m (waiting_for_input): Remove wrong decl.
5555
e738ca56
PE
55562012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5557
9fa1de30
PE
5558 keyboard.c, keymap.c: Use bool for booleans.
5559 * dispnew.c (sit_for): Distinguish between 3-way display_option
5560 and boolean do_display.
5561 * keyboard.c (single_kboard, this_command_key_count_reset)
5562 (waiting_for_input, echoing, immediate_quit, input_pending)
5563 (interrupt_input, interrupts_deferred, pop_kboard)
5564 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5565 (command_loop_1, adjust_point_for_property)
5566 (safe_run_hooks_error, input_polling_used, read_char):
5567 (help_char_p, readable_events, kbd_buffer_events_waiting)
5568 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5569 (lucid_event_type_list_p, get_input_pending):
5570 (gobble_input, menu_separator_name_p, menu_bar_item)
5571 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5572 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5573 (keyremap_step, test_undefined, read_key_sequence)
5574 (detect_input_pending, detect_input_pending_ignore_squeezables)
5575 (detect_input_pending_run_timers, requeued_events_pending_p)
5576 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5577 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5578 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5579 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5580 (accessible_keymaps_1, Fkey_description, push_key_description):
5581 (shadow_lookup, struct where_is_internal_data)
5582 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5583 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5584 (describe_map, describe_vector):
5585 * menu.c (single_menu_item):
5586 * nsmenu.m (ns_update_menubar):
5587 * process.c (wait_reading_process_output):
5588 * search.c (scan_buffer, scan_newline):
5589 Use bool for boolean.
5590 * keyboard.c (timers_run, swallow_events)
5591 (detect_input_pending_run_timers):
5592 * process.c (wait_reading_process_output):
5593 Use unsigned for counter where wraparound-on-overflow is desired,
5594 since unsigned is guaranteed to have that behavior and signed is not.
5595 (read_char): Use ptrdiff_t for string length.
5596 (get_input_pending): Remove first argument, since it was always
5597 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5598 and behave as if it had that value. Return new value of
5599 input_pending. All callers changed.
5600 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5601 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5602 a string length.
5603 * keymap.c (push_key_description): Omit last arg, which was always 1.
5604 All callers changed.
5605
e738ca56
PE
5606 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5607
29f21cdf
JB
56082012-10-10 Juanma Barranquero <lekktu@gmail.com>
5609
5610 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5611 ($(BLD)/term.$(O)): Update dependencies.
5612
6aea7528
DA
56132012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5614
5615 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5616 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5617 initializer for PVEC_NORMAL_VECTOR.
5618
5f3f57be
PE
56192012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5620
5621 Clean out old termopts cruft.
5622 * termopts.h (flow_control, meta_key): Remove unused decls.
5623 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5624 Don't include termopts.h.
5625
3e98c68e
DA
56262012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5627
5628 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5629
77e344e5
PE
56302012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5631
5632 * commands.h (immediate_quit): Remove duplicate decl.
5633
5683d7cd
JD
56342012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5635
5636 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5637 caching.
5638 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 5639 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 5640
cf5fc6db
EZ
56412012-10-09 Eli Zaretskii <eliz@gnu.org>
5642
b15736e6
EZ
5643 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5644 match what GetLastError returns. Explain why the function is
5645 needed.
5646
cf5fc6db
EZ
5647 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5648 'is_tooltip_frame', to avoid confusion with its global namesake.
5649
f99714ce
DC
56502012-10-08 Daniel Colascione <dancol@dancol.org>
5651
5652 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
5653 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5654 build that caused Emacs to display the hourglass cursor forever.
f99714ce 5655
fd59cb29
GM
5656 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5657 which is broken under remote desktop, calculate the number of
5658 colors available for a display based on the display's number of
5659 planes and number of bits per pixel per plane. (bug#10397).
5660
62c480c9 56612012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 5662
62c480c9
JD
5663 * nsfont.m (Vfonts_in_cache): New variable.
5664 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5665 are used. Add cached fonts to Vfonts_in_cache.
5666 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5667
607446ba
JB
56682012-10-08 Juanma Barranquero <lekktu@gmail.com>
5669
fd5125ad
JB
5670 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5671 in nt/config.nt.
46979e0b
JB
5672 (FONT_H): Define after FRAME_H.
5673 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5674 Update dependencies.
fd5125ad 5675
607446ba
JB
5676 * w32term.c: Remove leftover declaration of keyboard_codepage.
5677
b6f4e300
EZ
56782012-10-08 Eli Zaretskii <eliz@gnu.org>
5679
c54ebba4
EZ
5680 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5681 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5682 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5683 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
5684 ($(BLD)/unexw32.$(O)):
5685 ($(BLD)/w32.$(O)):
5686 ($(BLD)/w32console.$(O)):
5687 ($(BLD)/w32fns.$(O)):
5688 ($(BLD)/w32heap.$(O)):
5689 ($(BLD)/w32menu.$(O)):
15c720a3 5690 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 5691
b6f4e300
EZ
5692 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5693 'const char *'.
5694 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5695
501199a3
DC
56962012-10-08 Daniel Colascione <dancol@dancol.org>
5697
5698 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5699 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5700 accidental message numbering hole. Change other messages to
5701 match.
5702
5703 * w32select.h (HAVE_W32SELECT): Remove.
5704
5705 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 5706 w32common.h instead of w32heap.h.
501199a3
DC
5707
5708 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5709 (get_allocation_unit, get_processor_type, get_w32_major_version)
5710 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5711 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5712 (OS_NT, os_subtype, cache_system_info): Move declarations to
5713 w32common.
5714
5715 * w32heap.c: Include w32common.h.
5716 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
5717 (w32_minor_version, w32_build_number, w32_subtype):
5718 Remove duplicate definitions.
501199a3
DC
5719
5720 * w32fns.c: Include w32common.h; include w32heap.h only in
5721 WINDOWSNT.
5722
5723 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5724 Use `report_file_error' instead of `error' in order to better
5725 inform users of what went wrong. Increase NTGUI_UNICODE file
5726 dialog box file name length to 32k, the maximum allowed by the NT
5727 kernel.
5728
5729 * w32common.h: New file.
5730 (ROUND_UP, ROUND_DOWN, get_page_size)
5731 (get_allocation_unit, get_processor_type, get_w32_major_version)
5732 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5733 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5734 (OS_NT, os_subtype, cache_system_info): Move here.
5735
5736 * unexw32.c, unexcw.c: Include w32common.h.
5737
5738 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5739 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5740 to call syms_of_w32select.
5741
5742 * cygw32.h: Remove obsolete EXFUN declarations.
5743
5744 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5745
5746 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5747 of w32inevt.o from SOME_MACHINE_OBJECTS.
5748
93aa5c81
DC
57492012-10-08 Daniel Colascione <dancol@dancol.org>
5750
5751 * image.c: Permanent fix for JPEG compilation issue --- limit
5752 jpeglib `boolean' redefinition to Cygwin builds.
5753
d424f3d8
EZ
57542012-10-08 Eli Zaretskii <eliz@gnu.org>
5755
8ee4c6ce
EZ
5756 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5757
d424f3d8
EZ
5758 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5759 Cygwin.
5760
e08348a0
DC
57612012-10-08 Daniel Colascione <dancol@dancol.org>
5762
5763 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5764 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5765 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5766 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5767 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5768 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5769 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5770 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5771 now a supported configuration.
5772
5773 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 5774 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
5775
5776 * conf_post.h:
5777 (_DebPrint) declare tracing facility for W32 debugging. We need
5778 to unify tracing later.
5779
5780 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5781 unconditional use of W32 Unicode functions. Cygwin runs only on
5782 100% Unicode operating systems.
5783
5784 * cygw32.c: New file. Define Cygwin-specific facilities.
5785 (Fcygwin_convert_path_to_windows)
5786 (Fcygwin_convert_path_from_windows): New user functions for
5787 accessing Cygwin path-munging routines.
5788
5789 * cygw32.h: New file.
5790 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5791 UTF-16LE strings temporarily inside non-Lisp-visible string
5792 objects.
5793
5794 (w32_strerror): Just what it says on the tin.
5795
5796 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5797 also run for Cygwin; both systems have the same problem with using
5798 GUI facilities in a forked child. Also call syms_of_cygw32,
5799 syms_of_w32select in correct places.
5800
5801 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5802 needs fork-then-exec for daemon launching.
5803
5804 * font.h: Include frame.h.
5805
5806 * image.c: Use the image library cache machinery only when we're
5807 compiling for native WINDOWSNT; Cygwin can use shared libraries
5808 like any other Unixlike system.
5809
5810 * keyboard.c: Clarify a comment regarding the input loop.
5811
5812 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5813 functions directly instead of trying to detect at runtime that our
5814 host operating system supports them. We make this change for two
5815 reasons: Cygwin lacks support for the multibyte character
5816 conversion functions used by the legacy menu code, and Cygwin
5817 never needs to rely on non-Unicode APIs.
5818
5819 * unexw32.c (hinst): Declare extern.
5820
5821 * w32.c: Change header order;
5822 (w32_strerror): Move to w32fns.c because we need it for
5823 non-WINDOWSNT builds.
5824
5825 * w32.h: Add #error macro to make sure we don't include w32.h for
5826 Cygwin builds. Remove w32select declarations.
5827
5828 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 5829 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
5830
5831 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5832 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5833 POSIXy alternative.
5834 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5835 (w32_major_version, w32_minor_version, w32_build_number)
5836 (os_subtype, sound_type): Define here
5837 (w32_defined_color): Make color parameter const for consistency
5838 with other _defined_color functions.
5839 (w32_createwindow): Unconditionally call w32_init_class instead of
5840 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5841 through the code is complex and unnecessary because class
5842 registration is practically free.
5843 (w32_name_of_message): New EMACSDEBUG-only function.
5844 (Fset_message_beep): Move here
5845 (Fx_open_connection): Require that the display name for Windows be
5846 "w32" for consistency, emacsclient disambiguation, and maybe, one
5847 day, multi-window-system support.
5848 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5849 Cygwin files for W32 GUI facilities, since these clearly don't
5850 expect Cygwin names.
5851 (_DebPrint): Define.
5852 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5853 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5854 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5855 (w32_last_error): Remove.
5856
5857 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5858
5859 * w32heap.c (syspage_mask): Declare here.
5860 (cache_system_info): Remove.
5861
5862 * w32inevt.c (faked_key): Define globally, not statically.
5863 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5864 (w32_console_toggle_lock_key): Move to w32fns.c.
5865
5866 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5867
5868 * w32proc.c (_DebPrint): Move to w32fns.c.
5869 * w32select.c: Include string.h, stdio.h for Cygwin.
5870 * w32select.h: New File.
5871
5872 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5873 get_osfhandle.
5874 (w32_message_fd): New variable. Under Cygwin, holds the file
5875 descriptor the system used to tell us about pending thread
5876 messages.
5877
5878 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5879 that prevented compilation under non-WINDOWSNT systems.
5880
5881 (w32_initialize): Open /dev/windows and assign it to
5882 w32_message_fd. Provide w32 feature.
5883
5884 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5885 (WM_EMACS_INPUT_READY): add.
5886 (prepend_msg, w32_message_fd): Declare globally.
5887
5888 * w32xfns.c:
5889 (keyboard_handle): Use only when WINDOWSNT.
5890 (notify_msg_ready): New function. Posts a message to the main
5891 thread's message queue under CYGWIN, which wakes up the main
5892 thread from select(2) by making the /dev/windows file descriptor
5893 ready. Under WINDOWSNT, it sets an event the same way the old
5894 code did.
5895
5896 (post, prepend_msg): Actually call notify_msg_ready instead of
5897 setting the input event directly.
5898
98daa893
EZ
58992012-10-07 Eli Zaretskii <eliz@gnu.org>
5900
5901 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5902 but it still has blocs in it, don't return it to the system,
5903 instead of aborting. (Bug#12402)
5904
3bc0a2f7
JD
59052012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5906
8ad5b73b 5907 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5908
335f5ae4
JD
5909 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5910 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5911 (syms_of_nsterm): Remove comment about Panther and above for
5912 ns-antialias-text.
335f5ae4
JD
5913 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5914 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5915 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5916
5917 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5918 MAC_OS_X_VERSION_10_4.
5919
8ad5b73b
JD
5920 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5921 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5922
5923 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5924
5925 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5926 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5927
3bc0a2f7
JD
5928 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5929 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5930 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5931 Remove ns_in_resize check.
3bc0a2f7
JD
5932 (ns_clear_frame_area): Remove resize handle code.
5933
5934 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5935 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5936 Remove ns_in_resize check.
3bc0a2f7 5937
c622b48f
PE
59382012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5939
5940 Improve sys_siglist detection.
5941 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5942 defined as a macro, as is done in Solaris.
5943 (sys_siglist_entries): New macro.
5944 (save_strsignal): Use it.
5945 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5946 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5947
04fafa46
JD
59482012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5949
5950 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5951 fullscreen/Fullscreen.
5952
5953 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5954 tobar_height is new.
5955
5956 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5957 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5958 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5959 (windowDidResize:): Check for correct window if old style fullscreen.
5960 Capitalize word in comment. Remove incorrect comment.
5961 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5962 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5963 error in drawing background.
1f9f395d 5964 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5965 Set toolbar values to zero, save old height in tobar_height.
5966 Restore tool bar height when leaving fullscreen.
5967 (canBecomeMainWindow): New function.
5968
c6e21c03
PE
59692012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5970
5971 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5972
0d9f584b
EZ
59732012-10-05 Eli Zaretskii <eliz@gnu.org>
5974
a65fbb5f
EZ
5975 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5976
0d9f584b 5977 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5978 that time stamps of directories could also be changed.
5979 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5980 FILE_WRITE_ATTRIBUTES access rights.
5981
5982 * fileio.c (Fset_file_times): Special-case ignoring errors for
5983 directories only on MSDOS, not on MS-Windows.
5984
e8757f09 59852012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5986
5987 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5988
7604f298
EZ
59892012-10-04 Eli Zaretskii <eliz@gnu.org>
5990
5991 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5992 see whether CreateFile failed.
5993
88d69b7d
PE
59942012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5995
5996 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5997 to avoid similar races.
5998 * keyboard.c (pending_signals): Now bool, not int.
5999
7509f454
PE
6000 Port timers to OpenBSD, plus check for timer failures.
6001 OpenBSD problem reported by Han Boetes.
6002 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
6003 and/or setitimer.
6004 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
6005 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
6006 like OpenBSD, which has timer_settime but does not declare it.
6007 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
6008 whether to use itimerspec-related primitives. All uses of
6009 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
6010
a3c5c0c5
PE
60112012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6012
6013 * profiler.c (handle_profiler_signal): Fix a malloc race
6014 that caused Emacs to hang on Fedora 17 when profiling Lisp.
6015
914e743b
JD
60162012-10-02 Jan Djärv <jan.h.d@swipnet.se>
6017
6018 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
6019
d8ab37a8
EZ
60202012-10-02 Eli Zaretskii <eliz@gnu.org>
6021
6022 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
6023 consistent with the change in return value of 'safe_strsignal'.
6024
b3ecad33
PE
60252012-10-02 Paul Eggert <eggert@cs.ucla.edu>
6026
0a99eee1
PE
6027 Prefer plain 'static' to 'static inline' (Bug#12541).
6028 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
6029 (bidi_set_sor_type, bidi_push_embedding_level)
6030 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
6031 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
6032 (bidi_cache_search, bidi_cache_ensure_space)
6033 (bidi_cache_iterator_state, bidi_cache_find)
6034 (bidi_peek_at_next_level, bidi_set_paragraph_end)
6035 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
6036 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
6037 Now 'static', not 'static inline'.
6038
b3ecad33
PE
6039 Count overruns when profiling; change units to ns.
6040 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
6041 Give extra weight to samples after overruns, to attempt to count
6042 the time more accurately.
6043 (setup_cpu_timer): Change sampling interval units from ms to ns, since
6044 the underlying primitives nominally do ns.
6045 (Fprofiler_cpu_start): Document the change. Mention that
6046 the sampling intervals are only approximate.
6047
090cf9db
SM
60482012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
6049
6050 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
6051
6052 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
6053 case for the special 0 coding-system.
6054
6055 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
6056 (Fmake_overlay): Remove redundant tests.
64edc777 6057 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 6058
81550bf4
JB
60592012-10-02 Juanma Barranquero <lekktu@gmail.com>
6060
6061 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
6062 Update dependencies.
6063
aa1ba90e
PE
60642012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6065
6066 Fix a malloc race condition involving strsignal.
6067 A signal can arrive in the middle of a malloc, and Emacs's signal
6068 handler can invoke strsignal, which can invoke malloc, which is
6069 not portable. This race condition bug makes Emacs hang on GNU/Linux.
6070 Fix it by altering the signal handler so that it does not invoke
6071 strsignal.
6072 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
6073 * process.c (status_message): Use const pointer, in case strsignal
6074 is #defined to safe_strsignal.
6075 * sysdep.c (sys_siglist, init_signals): Always define and
6076 initialize a substitute sys_siglist if the system does not define
6077 one, even if HAVE_STRSIGNAL.
6078 (safe_strsignal): Rename from strsignal. Always define,
6079 using sys_siglist. Return a const pointer.
6080 * syssignal.h (safe_strsignal): New decl.
6081 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
6082
ace917bd
EZ
60832012-10-01 Eli Zaretskii <eliz@gnu.org>
6084
6085 * w32proc.c (timer_loop): Fix code that waits for timer
6086 expiration, to avoid high CPU usage.
6087
9eb71b9c
SM
60882012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
6089
6090 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
6091 (sweep_weak_table): Remove redundant prototypes.
6092
b3317662
FP
60932012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
6094
6095 * emacs.c: Move the inclusion of TERM_HEADER after including
6096 windows.h on WINDOWSNT. This avoids compilation problems with
6097 MSVC.
6098
f0e5f225
EZ
60992012-10-01 Eli Zaretskii <eliz@gnu.org>
6100
2d7d1608
EZ
6101 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
6102 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
6103 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
6104 as the previous version used 'void *'.
6105
6106 * ralloc.c (ROUNDUP): Fix last change.
6107 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
6108 'size_t'.
6109
f0e5f225
EZ
6110 * w32proc.c <disable_itimers>: New static flag.
6111 (init_timers): Initialize it to zero, after creating the critical
6112 sections used by the timer threads.
6113 (term_timers): Set to 1 before deleting the critical sections.
6114 (getitimer, setitimer): If disable_itimers is non-zero, return an
6115 error indication without doing anything. Reported by Fabrice
6116 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
6117 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
6118 return results.
6119 [!HAVE_SETITIMER]: Behave as the previous version that didn't
6120 support timers.
f0e5f225
EZ
6121
6122 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
6123 term_ntproc after all the other bookkeeping, to get timers working
6124 as long as possible.
6125
82ef37c1
PE
61262012-10-01 Paul Eggert <eggert@cs.ucla.edu>
6127
b3a4c387
PE
6128 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
6129 Suggested by Juri Linkov in
6130 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
6131
b0ab8123
PE
6132 Prefer plain 'static' to 'static inline' (Bug#12541).
6133 With static functions, modern compilers inline pretty well by
6134 themselves; advice from programmers often hurts as much as it helps.
6135 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
6136 this change shrinks the text size of the Emacs executable by 1.1%
6137 without affecting CPU significantly in my benchmark.
6138 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
6139 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
6140 (mark_maybe_object, mark_maybe_pointer, bounded_number):
6141 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
6142 (bset_auto_fill_function, bset_auto_save_file_format)
6143 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
6144 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
6145 (bset_cache_long_line_scans, bset_case_fold_search)
6146 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
6147 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
6148 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
6149 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
6150 (bset_header_line_format, bset_indicate_buffer_boundaries)
6151 (bset_indicate_empty_lines, bset_invisibility_spec)
6152 (bset_left_fringe_width, bset_major_mode, bset_mark)
6153 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
6154 (bset_name, bset_overwrite_mode, bset_pt_marker)
6155 (bset_right_fringe_width, bset_save_length)
6156 (bset_scroll_bar_width, bset_scroll_down_aggressively)
6157 (bset_scroll_up_aggressively, bset_selective_display)
6158 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
6159 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
6160 (set_buffer_overlays_after):
6161 * category.c (bset_category_table):
6162 * charset.c (read_hex):
6163 * coding.c (produce_composition, produce_charset)
6164 (handle_composition_annotation, handle_charset_annotation)
6165 (char_encodable_p):
6166 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
6167 (assign_row, set_frame_matrix_frame, make_current)
6168 (add_row_entry):
6169 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
6170 * fns.c (maybe_resize_hash_table):
6171 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
6172 * gmalloc.c (register_heapinfo):
6173 * image.c (lookup_image_type):
6174 * intervals.c (set_interval_object, set_interval_left)
6175 (set_interval_right, copy_interval_parent, rotate_right)
6176 (rotate_left, balance_possible_root_interval):
6177 * keyboard.c (kset_echo_string, kset_kbd_queue)
6178 (kset_keyboard_translate_table, kset_last_prefix_arg)
6179 (kset_last_repeatable_command, kset_local_function_key_map)
6180 (kset_overriding_terminal_local_map, kset_real_last_command)
6181 (kset_system_key_syms, clear_event, set_prop):
6182 * lread.c (digit_to_number):
6183 * marker.c (attach_marker, live_buffer, set_marker_internal):
6184 * nsterm.m (ns_compute_glyph_string_overhangs):
6185 * process.c (pset_buffer, pset_command)
6186 (pset_decode_coding_system, pset_decoding_buf)
6187 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
6188 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
6189 (pset_status, pset_tty_name, pset_type, pset_write_queue):
6190 * syntax.c (bset_syntax_table, dec_bytepos):
6191 * terminal.c (tset_param_alist):
6192 * textprop.c (interval_has_some_properties)
6193 (interval_has_some_properties_list):
6194 * window.c (wset_combination_limit, wset_dedicated)
6195 (wset_display_table, wset_hchild, wset_left_fringe_width)
6196 (wset_left_margin_cols, wset_new_normal, wset_new_total)
6197 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
6198 (wset_right_fringe_width, wset_right_margin_cols)
6199 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
6200 (wset_vertical_scroll_bar_type, wset_window_parameters):
6201 * xdisp.c (wset_base_line_number, wset_base_line_pos)
6202 (wset_column_number_displayed, wset_region_showing)
6203 (window_box_edges, run_window_scroll_functions)
6204 (append_glyph_string_lists, prepend_glyph_string_lists)
6205 (append_glyph_string, set_glyph_string_background_width)
6206 (append_glyph, append_composite_glyph)
6207 (take_vertical_position_into_account):
6208 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
6209 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
6210 (lface_hash, lface_same_font_attributes_p, lookup_face):
6211 * xml.c (libxml2_loaded_p):
6212 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
6213 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
6214 Now 'static', not 'static inline'.
6215
05584c31
PE
6216 * bidi.c: Tune.
6217 (bidi_copy_it): Do the whole copy with a single memcpy.
6218 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
6219
86ec63ba
PE
6220 Revert the FOLLOW-SYMLINKS change for file-attributes.
6221 Doing it right would require several changes to Tramp, and there's
6222 not enough time to get that tested before the freeze today.
6223 * dired.c (directory_files_internal, Ffile_attributes):
6224 Undo last change.
6225
82ef37c1
PE
6226 * frame.c (x_report_frame_params): Port better to wider ints.
6227 Do not assume that EMACS_UINT is the same width as uprintmax_t,
6228 or that pointers can be printed in 15 decimal digits.
6229 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
6230
62aba0d4
FP
62312012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
6232
6233 Support x64 build on MS-Windows.
6234 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
6235 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
6236 compatibility with x64.
5e4daaf3 6237 (x_get_focus_frame): Add prototype.
62aba0d4
FP
6238
6239 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
6240 defining an XRectangle structure.
6241
6242 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
6243 arithmetics for compatibility with x64.
6244
6245 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
6246 compatibility with x64.
6247
6248 * w32heap.h: Adjust prototypes and declarations.
6249
6250 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
6251 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
6252 DWORD, long, and unsigned long, for compatibility with x64.
6253 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
6254 (sbrk): Argument is now of type ptrdiff_t.
6255
6256 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
6257 less than 0x0500.
6258 (w32_msg_pump): Use WPARAM type for 'result'.
6259
6260 * w32.c (init_environment, get_emacs_configuration): Support AMD64
6261 architecture.
6262 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
6263 compatibility with x64.
6264
6265 * vm-limit.c (lim_data): Now size_t.
6266 (check_memory_limits): Adjust prototypes of real_morecore and
6267 __morecore to receive argument of type ptrdiff_t. Use size_t for
6268 five_percent and data_size.
6269
6270 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
6271 variables, for compatibility with x64.
6272 (rva_to_section, offset_to_section, relocate_offset)
6273 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
6274 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
6275 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
6276 for compatibility with x64.
6277
6278 * sysdep.c (STDERR_FILENO): Define if not already defined.
6279
6280 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6281 (__morecore): Argument type is now ptrdiff_t.
6282 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6283 (relinquish): Use ptrdiff_t type for 'excess'.
6284 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6285
6286 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6287 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6288 instead of a literal number.
6289
6290 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6291 (min): Define only if not already defined.
6292
6293 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6294 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6295 hosts.
6296
6297 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6298 'bitmaps' is a pointer.
6299
6300 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6301
6302 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6303
e7a2937b
PE
63042012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6305
6306 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6307 * dired.c (directory_files_internal, Ffile_attributes):
6308 New arg follow_symlinks. All uses changed.
6309
b43d62ae
SM
63102012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6311
6312 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6313
c06c382a
EZ
63142012-09-30 Eli Zaretskii <eliz@gnu.org>
6315
6316 Support atimers and CPU profiler via profile.c on MS-Windows.
6317 * w32proc.c (sig_mask, crit_sig): New static variables.
6318 (sys_signal): Support SIGALRM and SIGPROF.
6319 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 6320 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
6321 sigfillset, and sigprocmask are no longer no-ops.
6322 (sigismember): New function.
6323 (struct itimer_data): New definition.
6324 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6325 (crit_prof): New static variables.
6326 (MAX_SINGLE_SLEEP): New definition.
6327 (timer_loop, stop_timer_thread, term_timers, init_timers)
6328 (start_timer_thread, getitimer, setitimer): New functions.
6329 (alarm): No longer a no-op, calls setitimer.
6330
6331 * w32.c (term_ntproc): Call term_timers.
6332 (init_ntproc): Make sure all signals are unblocked at startup, to
6333 erase any traces of dumping. Call init_timers.
6334
6335 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6336 Windows-specific code to display the hourglass mouse pointer is no
6337 longer used.
6338 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6339 to hourglass timer expiration.
6340 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6341 Remove, no longer used.
b43d62ae
SM
6342 (w32_note_current_window, show_hourglass, hide_hourglass):
6343 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
6344 window systems.
6345 (syms_of_w32fns): Don't initialize hourglass_timer.
6346
6347 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6348 WINDOWSNT as well.
6349 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6350
6351 * w32.h (init_timers, term_timers): Add prototypes.
6352
95402d5f
KH
63532012-09-30 Kenichi Handa <handa@gnu.org>
6354
6355 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6356 to the buffer relocation which may be caused by ccl_driver.
6357
dd946752
JD
63582012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6359
d7e642cc
JD
6360 * xfns.c (Fx_file_dialog): Update comment.
6361
6362 * w32fns.c (Fx_file_dialog): Update comment.
6363
6364 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6365 Initialize panel name field if OSX >= 10.6.
6366
6367 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6368
dd946752
JD
6369 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6370
6371 * nsterm.m (NEW_STYLE_FS): New define.
6372 (ns_fullscreen_hook, windowWillEnterFullScreen)
6373 (windowDidEnterFullScreen, windowWillExitFullScreen)
6374 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6375 (setFSValue): New functions.
6376 (EmacsFSWindow): New implementation.
6377 (canBecomeKeyWindow): New function for EmacsFSWindow.
6378 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6379 (dealloc): Release nonfs_window if in fullscreen.
6380 (updateFrameSize:): Call windowDidMove to update top/left.
6381 (windowWillResize:toSize:): Check if frame is still maximized.
6382 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6383 next_maximized, maximized_width, maximized_height and nonfs_window.
6384 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6385 tbar_height.
6386 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 6387 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
6388
6389 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6390 (EmacsView): Add variables for fullscreen.
6391 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6392 (EmacsFSWindow): New interface for fullscreen.
6393
427730eb
JB
63942012-09-30 Juanma Barranquero <lekktu@gmail.com>
6395
6396 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6397
48de8b12
CY
63982012-09-30 Chong Yidong <cyd@gnu.org>
6399
6400 * fns.c (Frandom): Doc fix.
6401
5938d519
MR
64022012-09-30 Martin Rudalics <rudalics@gmx.at>
6403
6404 * window.c (Vwindow_combination_limit): New default value.
6405 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6406
cb5b0266
PE
64072012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6408
6409 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6410 Suggested by Eli Zaretskii in
6411 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6412
84f72efd
EZ
64132012-09-30 Eli Zaretskii <eliz@gnu.org>
6414
6415 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6416 HAVE_TIMER_SETTIME is defined.
6417
9d4dcdc9
PE
64182012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6419
d89460ed
PE
6420 Profiler improvements: more-accurate timers, overflow checks.
6421 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6422 signal.h, setjmp.h. Include systime.h instead.
6423 (saturated_add): New function.
6424 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6425 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6426 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6427 New static vars.
84f72efd 6428 (enum profiler_cpu_running): New enum.
d89460ed
PE
6429 (profiler_cpu_running): Now of that enum type, not bool.
6430 All uses changed to store the new value.
6431 (handle_profiler_signal): Rename from sigprof_handler_1,
6432 for consistency with other handlers. Do not check whether
6433 cpu_log is a hash-table if garbage collecting, since it
6434 doesn't matter in that case.
6435 (deliver_profiler_signal): Rename from sigprof_handler,
6436 for consistency with other handlers.
6437 (setup_cpu_timer): New function, with much of what used to be in
6438 Fprofiler_cpu_start. Check for out-of-range argument.
6439 Prefer timer_settime if available, and prefer
6440 thread cputime clocks, then process cputime clocks, then
6441 monotonic clocks, to the old realtime clock. Use make_timeval
6442 to round more-correctly when falling back to setitimer.
6443 (Fprofiler_cpu_start): Use it.
6444 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6445 Don't assume that passing NULL as the 2nd argument of setitimer
6446 is the same as passing a pointer to all-zero storage.
6447 Ignore SIGPROF afterwards.
6448 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6449 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6450 non-fatal signal handlers. Ignore SIGPROF on startup.
6451 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6452 in profiler.c, since sysdep.c now uses it.
6453
9d4dcdc9
PE
6454 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6455 Suggested by Eli Zaretskii in
6456 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6457
8e5691a0
JB
64582012-09-29 Juanma Barranquero <lekktu@gmail.com>
6459
6460 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6461
e7c1b6ef
SM
64622012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6463
6464 * lisp.h (struct backtrace): Remove indirection for `function' field.
6465 * xdisp.c (redisplay_internal):
6466 * profiler.c (record_backtrace, sigprof_handler_1):
6467 * alloc.c (Fgarbage_collect):
6468 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6469 (Fbacktrace_frame): Adjust accordingly.
6470
e61d39cd 64712012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
6472
6473 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6474 (Frun_hook_with_args_until_failure): Doc fixes.
6475
404043ea
EZ
64762012-09-28 Eli Zaretskii <eliz@gnu.org>
6477
6478 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6479 Qautomatic_redisplay and change the symbol name. All users changed.
6480
704d3f45
TM
64812012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6482
6483 * profiler.c (sigprof_handler): Fix race condition.
6484
757140ff
GM
64852012-09-28 Glenn Morris <rgm@gnu.org>
6486
6487 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6488
a615a3ae
PE
64892012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6490
6491 Check more robustly for timer_settime.
89d17fd0
PE
6492 * Makefile.in (LIB_TIMER_TIME): New macro.
6493 (LIBES): Add it.
a615a3ae
PE
6494 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6495 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6496 call timer_settime.
6497
3670daf7
TM
64982012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6499
6500 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6501
6a586b7f
JB
65022012-09-26 Juanma Barranquero <lekktu@gmail.com>
6503
6504 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6505
41c8bfcf
PE
65062012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6507
6508 * character.h (MAYBE_UNIFY_CHAR): Remove.
6509 * charset.c, charset.h (maybe_unify_char): Now static.
6510 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6511 Since this stuff is now private to charset.c, there's no need for
6512 a public macro and no need to inline by hand.
6513
3a880af4 65142012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
6515 Stefan Monnier <monnier@iro.umontreal.ca>
6516 Juanma Barranquero <lekktu@gmail.com>
611b7507 6517
3a880af4
SM
6518 * profiler.c: New file.
6519 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
6520 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6521 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
6522 * emacs.c (main): Call syms_of_profiler.
6523 * alloc.c (Qautomatic_gc): New constant.
6524 (MALLOC_PROBE): New macro.
6525 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6526 (total_bytes_of_live_objects): New function.
6527 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6528 Call malloc_probe for the memory profiler.
6529 (syms_of_alloc): Define Qautomatic_gc.
6530 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6531 race condition.
6532 (struct backtrace): Move definition...
6533 * lisp.h (struct backtrace): ..here.
6534 (Qautomatic_gc, profiler_memory_running): Declare vars.
6535 (malloc_probe, syms_of_profiler): Declare functions.
6536 * xdisp.c (Qautomatic_redisplay): New constant.
6537 (redisplay_internal): Record itself in backtrace_list.
6538 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 6539
5938d519 65402012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
65412012-09-25 Juanma Barranquero <lekktu@gmail.com>
6542
6543 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6544
e26fd2e4
PE
65452012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6546
6547 Prefer POSIX timers if available.
6548 They avoid a race if the timer is too close to the current time.
6549 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6550 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 6551 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 6552
eedec3ee
EZ
65532012-09-25 Eli Zaretskii <eliz@gnu.org>
6554
6555 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6556 CHAR_STRING_ADVANCE.
6557 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6558 STRING_CHAR_ADVANCE.
6559
aa15c6bb
JB
65602012-09-25 Juanma Barranquero <lekktu@gmail.com>
6561
6562 Move Vlibrary_cache to emacs.c and reset before dumping.
6563
6564 * lisp.h (reset_image_types): Declare.
6565 [WINDOWSNT] (Vlibrary_cache): Declare.
6566
6567 * image.c (reset_image_types): New function.
6568
6569 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6570 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6571 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6572
6573 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6574 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6575
6576 * w32.h (Vlibrary_cache): Do not declare.
6577
54d629be
EZ
65782012-09-25 Eli Zaretskii <eliz@gnu.org>
6579
16b22fef
EZ
6580 * w32proc.c (sys_signal): Handle all signals defined by the
6581 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6582 handlers for signals supported by Windows. Don't override
6583 term_ntproc as the handler for SIGABRT.
6584 (sigaction): Rewrite to call sys_signal instead of duplicating its
6585 code.
6586 (sys_kill): Improve commentary.
6587
6588 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6589 consistency with a signature of a signal handler. All callers
6590 changed.
6591 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6592 install term_ntproc as a signal handler for SIGABRT, as that
6593 should be done by the dumped Emacs.
6594
6595 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6596
6597 * w32select.c (term_w32select): Protect against repeated
6598 invocation by setting clipboard_owner to NULL after calling
6599 DestroyWindow.
6600
6601 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6602 and term_ntproc to their modified signatures.
6603
54d629be
EZ
6604 * character.c (char_string, string_char): Remove calls to
6605 MAYBE_UNIFY_CHAR. See the discussion starting at
6606 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6607 for the details.
6608
59f7af81
CY
66092012-09-25 Chong Yidong <cyd@gnu.org>
6610
6611 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6612
22e8cf4a
SM
66132012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6614
6615 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6616 when encountering an unknown bytecode.
6617
578098f3
PE
66182012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6619
6620 image.c, indent.c: Use bool for booleans.
6621 * dispextern.h (struct image_type): Members valid_p, load, init
6622 now return bool, not int. All uses changed.
6623 * image.c: Omit unnecessary static decls.
6624 (x_create_bitmap_mask, x_build_heuristic_mask):
6625 Return void, not int, since callers don't care about the return value.
6626 (x_create_bitmap_mask, define_image_type, valid_image_p)
6627 (struct image_keyword, parse_image_spec, image_spec_value)
6628 (check_image_size, image_background)
6629 (image_background_transparent, x_clear_image_1)
6630 (postprocess_image, lookup_image, x_check_image_size)
6631 (x_create_x_image_and_pixmap, xbm_image_p)
6632 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6633 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6634 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6635 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6636 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6637 (png_image_p, init_png_functions, png_load_body, png_load)
6638 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6639 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6640 (init_gif_functions, gif_load, imagemagick_image_p)
6641 (imagemagick_load_image, imagemagick_load, svg_image_p)
6642 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6643 (gs_load):
6644 * nsimage.m (ns_load_image):
6645 * nsterm.m (ns_defined_color):
6646 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6647 * xfns.c (x_defined_color):
6648 * xterm.c (x_alloc_lighter_color_for_widget)
6649 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6650 (x_alloc_lighter_color):
6651 * indent.c (disptab_matches_widthtab, current_column)
6652 (scan_for_column, string_display_width, indented_beyond_p)
6653 (compute_motion, vmotion, Fvertical_motion):
6654 Use bool for booleans.
6655
a5f2b6ec
CY
66562012-09-24 Chong Yidong <cyd@gnu.org>
6657
6658 * chartab.c (Fset_char_table_default): Obsolete function removed.
6659
18e27ea8
PE
66602012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6661
afea8a8a
PE
6662 Move pid_t related decls out of lisp.h.
6663 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6664 (interruptible_wait_for_termination):
6665 Move these decls from lisp.h to syswait.h, since they use pid_t.
6666 Needed on FreeBSD; see Herbert J. Skuhra in
6667 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6668 * callproc.c: Include syswait.h.
6669
18e27ea8
PE
6670 gnutls.c, gtkutil.c: Use bool for boolean.
6671 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6672 (emacs_gnutls_handle_error):
6673 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6674 (xg_hide_tooltip, xg_create_frame_widgets)
6675 (create_dialog, xg_uses_old_file_dialog)
6676 (xg_get_file_with_chooser, xg_get_file_with_selection)
6677 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6678 (xg_item_label_same_p, xg_update_menubar)
6679 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6680 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6681 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6682 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6683 (update_frame_tool_bar, free_frame_tool_bar):
6684 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6685 * nsmenu.m (ns_update_menubar):
6686 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6687 * xfns.c (Fx_show_tip) [USE_GTK]:
6688 Use bool for boolean.
6689 * gtkutil.c (xg_update_frame_menubar):
6690 * xmenu.c (update_frame_menubar):
6691 Return void, not int, since caller ignores return value.
6692 * gtkutil.c (xg_change_toolbar_position):
6693 Return void, not 1.
6694
af0e9f75
JB
66952012-09-23 Juanma Barranquero <lekktu@gmail.com>
6696
6697 * makefile.w32-in (BLOCKINPUT_H): Remove.
6698 (SYSSIGNAL_H): New macro.
6699 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6700 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6701 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6702 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6703 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6704 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6705 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6706 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6707 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6708 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6709 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6710 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6711 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6712 ($(BLD)/w32xfns.$(O)): Update dependencies.
6713
5101529e
EZ
67142012-09-23 Eli Zaretskii <eliz@gnu.org>
6715
6716 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6717 fatal_error_backtrace.
6718
6719 * w32proc.c (sys_kill): Undo last change: don't do anything when
6720 invoked to deliver SIGABRT to our own process. This is now
6721 handled by emacs_raise.
6722
2c3ee0ad
JB
67232012-09-23 Juanma Barranquero <lekktu@gmail.com>
6724
6725 * w32term.c (w32_read_socket): Remove leftover reference to
6726 interrupt_input_pending.
6727
62a1d661
PE
67282012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6729
6730 Do not use SA_NODEFER.
6731 Problem reported by Dani Moncayo in
6732 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6733 * alloc.c (die):
6734 * sysdep.c (emacs_abort): Do not reset signal handler.
6735 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6736 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6737 wanted even on POSIXish hosts, and it doesn't work on Windows.
6738
a0942b9a
JD
67392012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6740
6741 * xterm.c (x_term_init): Call fixup_locale before and after calling
6742 gtk_init (Bug#12392).
6743
d07ff9db
CY
67442012-09-23 Chong Yidong <cyd@gnu.org>
6745
6746 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6747 Vdynamic_library_alist.
6748
6749 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6750 (Fgnutls_available_p): Caller changed.
6751
6752 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6753 (Flibxml_parse_xml_region): Likewise.
6754
6755 * dispextern.h (struct image_type): Remove arg from init function.
6756
6757 * image.c (Finit_image_library, lookup_image_type)
6758 (define_image_type): Remove now-unneeded second arg.
6759 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6760 (init_tiff_functions, init_gif_functions, init_svg_functions):
6761 Arglist and w32_delayed_load calling convention changed.
6762 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 6763 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 6764
4d7e6e51
PE
67652012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6766
6767 Simplify and avoid signal-handling races (Bug#12471).
6768 * alloc.c (die):
6769 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6770 Avoid recursive loop if there's a fatal error in the function itself.
6771 * atimer.c (pending_atimers):
6772 * blockinput.h: Don't include "atimer.h"; no longer needed.
6773 (interrupt_input_pending): Remove. All uses removed.
6774 pending_signals now counts both atimers and ordinary interrupts.
6775 This is less racy than having three separate pending-signal flags.
6776 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6777 (input_blocked_p):
6778 Rename from their upper-case counterparts BLOCK_INPUT,
6779 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6780 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6781 This makes it easier to access volatile variables more accurately.
6782 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6783 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6784 that's more reliable if the code is buggy and sets
6785 interrupt_input_blocked to a negative value. All uses changed.
6786 * atimer.c (deliver_alarm_signal):
6787 Remove. No need to deliver this to the parent; any thread can
6788 handle this signal now. All uses replaced by underlying handler.
6789 * atimer.c (turn_on_atimers):
6790 * dispnew.c (handle_window_change_signal):
6791 * emacs.c (handle_danger_signal):
6792 * keyboard.c (kbd_buffer_get_event):
6793 Don't reestablish signal handler; not needed with sigaction.
6794 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6795 (UNBLOCK_INPUT_TO):
6796 Rework to avoid unnecessary accesses to volatile variables.
6797 (UNBLOCK_INPUT_TO): Now a function.
6798 (totally_unblock_input, unblock_input): New decls.
6799 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6800 (init_data): Remove. Necessary stuff now done in init_signal.
6801 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6802 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6803 (fatal_error_code): Remove; no longer needed.
6804 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6805 it doesn't always backtrace. All uses changed. No need to reset
6806 signal to default, since sigaction and/or die does that for us now.
6807 Use emacs_raise (FOO), not kill (getpid (), FOO).
6808 (main): Check more-accurately whether we're dumping.
6809 Move fatal-error setup to sysdep.c
6810 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6811 * gtkutil.c (xg_get_file_name, xg_get_font):
6812 Remove no-longer-needed signal-mask manipulation.
6813 * keyboard.c, process.c (POLL_FOR_INPUT):
6814 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6815 * keyboard.c (read_avail_input): Remove.
6816 All uses replaced by gobble_input.
6817 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6818 (kbd_buffer_store_event_hold, gobble_input):
6819 (record_asynch_buffer_change) [USABLE_SIGIO]:
6820 (store_user_signal_events):
6821 No need to mess with signal mask.
6822 (gobble_input): If blocking input and there are terminals, simply
6823 set pending_signals to 1 and return. All hooks changed to not
6824 worry about whether input is blocked.
6825 (process_pending_signals): Clear pending_signals before processing
6826 them, in case a signal comes in while we're processing.
6827 By convention callers now test pending_signals before calling us.
6828 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6829 New functions, to support changes to blockinput.h.
6830 (handle_input_available_signal): Now extern.
6831 (reinvoke_input_signal): Remove. All uses replaced by
6832 handle_async_input.
6833 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
6834 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6835 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
6836 Clear sigmask reliably, even if Fsignal returns, which it can.
6837 Omit unnecessary accesses to volatile var.
6838 (quit_throw_to_read_char): No need to restore sigmask.
6839 * keyboard.c (gobble_input, handle_user_signal):
6840 * process.c (wait_reading_process_output):
6841 Call signal-handling code rather than killing ourselves.
6842 * lisp.h: Include <float.h>, for...
6843 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6844 (pending_signals): Now volatile.
6845 (syms_of_data): Now const if IEEE floating point.
6846 (handle_input_available_signal) [USABLE_SIGIO]:
6847 (terminate_due_to_signal, record_child_status_change): New decls.
6848 * process.c (create_process): Avoid disaster if memory is exhausted
6849 while we're processing a vfork, by tightening the critical section
6850 around the vfork.
6851 (send_process_frame, process_sent_to, handle_pipe_signal)
6852 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6853 ignores SIGPIPE.
6854 (send_process): No need for setjmp/longjmp any more, since the
6855 SIGPIPE stuff is now gone. Instead, report an error if errno
6856 is EPIPE.
6857 (record_child_status_change): Now extern. PID and W are now args.
6858 Return void, not bool. All callers changed.
6859 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6860 Remove. All uses removed. This bug should be fixed now in a
6861 different way.
6862 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6863 and record the child status change directly. This avoids the
6864 need to futz with the signal mask.
6865 (process_fatal_action): Move here from emacs.c.
6866 (emacs_sigaction_flags): New function, containing
6867 much of what used to be in emacs_sigaction_init.
6868 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6869 caught by emacs, to make races less likely.
6870 (deliver_process_signal): Rename from handle_on_main_thread.
6871 All uses changed.
6872 (BACKTRACE_LIMIT_MAX): Now at top level.
6873 (thread_backtrace_buffer, threadback_backtrace_pointers):
6874 New static vars.
6875 (deliver_thread_signal, deliver_fatal_thread_signal):
6876 New functions, for more-accurate delivery of thread-specific signals.
6877 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6878 (deliver_arith_signal): Handle in this thread, not
6879 in the main thread, since it's triggered by this thread.
6880 (maybe_fatal_sig): New function.
6881 (init_signals): New arg DUMPING so that we can be more accurate
6882 about whether we're dumping. Caller changed.
6883 Treat thread-specific signals differently from process-general signals.
6884 Block all signals while handling fatal error; that's safer.
6885 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6886 on IEEE hosts.
6887 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6888 Ignore SIGPIPE unless batch.
6889 (emacs_backtrace): Output backtrace for the appropriate thread,
6890 which is not necessarily the main thread.
6891 * syssignal.h: Include <stdbool.h>.
6892 (emacs_raise): New macro.
6893 * xterm.c (x_connection_signal): Remove; no longer needed
6894 now that we use sigaction.
6895 (x_connection_closed): No need to mess with sigmask now.
6896 (x_initialize): No need to reset SIGPIPE handler here, since
6897 init_signals does this for us now.
6898
8f4635e9
JD
68992012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6900
6901 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6902 background rect may be larger (Bug#12245).
8f4635e9 6903
3296976d
CY
69042012-09-23 Chong Yidong <cyd@gnu.org>
6905
6906 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6907
d41e491e
PE
69082012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6909
6910 * .gdbinit: Just stop at fatal_error_backtrace.
6911 See Stefan Monnier's request in
6912 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6913 Remove no-longer-used query of system type.
6914
c88b867f
CY
69152012-09-22 Chong Yidong <cyd@gnu.org>
6916
6917 * search.c (Freplace_match): Doc fix (Bug#12325).
6918
6919 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6920
6921 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6922 (Fline_end_position): Doc fix.
6923
6924 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6925
bb4d86b4
CY
69262012-09-22 Chong Yidong <cyd@gnu.org>
6927
6928 * dispextern.h (struct image_type): Add new slot, storing a type
6929 initialization function.
6930
6931 * image.c (define_image_type): Call the image initializer function
6932 if it is defined. Arguments and return value changed.
6933 (valid_image_p, make_image): Callers changed.
6934 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6935 (gif_type, imagemagick_type, svg_type, gs_type):
6936 Add initialization functions.
bb4d86b4
CY
6937 (Finit_image_library): Call lookup_image_type.
6938 (CHECK_LIB_AVAILABLE): Macro deleted.
6939 (lookup_image_type): Call define_image_type here, rather than via
6940 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6941 (syms_of_image): Move define_image_type calls for xbm_type and
6942 pbm_type to lookup_image_type.
6943
df9685f3
EZ
69442012-09-22 Eli Zaretskii <eliz@gnu.org>
6945
6946 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6947 'idle_timers' from here ...
6948 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6949 lists, to avoid infloops when the timer does something stupid,
6950 like reinvoke itself with the same or smaller time-out.
6951 (Bug#12447)
6952
8e17c9ba
MR
69532012-09-22 Martin Rudalics <rudalics@gmx.at>
6954
6955 * window.c (Fsplit_window_internal): Handle only Qt value of
6956 Vwindow_combination_limit separately.
6957 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6958 (Vwindow_combination_limit): New default value.
6959 Rewrite doc-string.
8e17c9ba 6960
589bd69b
EZ
69612012-09-22 Eli Zaretskii <eliz@gnu.org>
6962
6963 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6964 the new overlay string. (Bug#10159)
6965
01108e3f
PE
69662012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6967
6968 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6969 or that fprintf is async-signal-safe. POSIX doesn't require
6970 either assumption.
6971
82f8cd94
CY
69722012-09-22 Chong Yidong <cyd@gnu.org>
6973
6974 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6975 (Bug#8207).
6976
3cccbd87
KH
69772012-09-22 Kenichi Handa <handa@gnu.org>
6978
6979 * composite.c (composition_reseat_it): Handle the case that a
6980 grapheme cluster is not covered by a single font (Bug#12352).
6981
09c01941
CY
69822012-09-21 Chong Yidong <cyd@gnu.org>
6983
6984 * image.c (define_image_type): Avoid adding duplicate types to
6985 image_types (Bug#12463). Suggested by Jörg Walter.
6986
acfa068f 69872012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6988
6989 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6990 (print_load_command_name): Add case LC_DATA_IN_CODE.
6991 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6992
acfa068f 69932012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6994
6995 * eval.c (Frun_hook_with_args_until_success)
6996 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6997
acfa068f 69982012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6999
7000 * fileio.c (Ffile_selinux_context): Only call freecon when
7001 lgetfilecon succeeded.
7002 (Fset_file_selinux_context): Likewise. (Bug#12444)
7003
acfa068f 70042012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
7005
7006 * xdisp.c (try_window_reusing_current_matrix): Under bidi
7007 reordering, locate the cursor by calling set_cursor_from_row; if
7008 that fails, clear the desired glyph matrix before returning a
7009 failure indication to the caller. Fixes leaving garbled display
7010 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
7011 (compute_stop_pos_backwards): Fix a typo that caused crashes while
7012 scrolling through multibyte text.
aa36e4d2 7013
e99f70c8
SM
70142012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
7015
7016 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
7017 calling mark_vectorlike since that's the one that marks the window.
7018 (mark_discard_killed_buffers): Mark the final cdr.
7019 * window.h (struct window): Move prev/next_buffers to the
7020 non-standard fields.
7021 * window.c (make_window): Initialize prev/next_buffers manually.
7022
f75beb47
PE
70232012-09-20 Paul Eggert <eggert@cs.ucla.edu>
7024
7025 Omit unused arg EXPECTED from socket hooks.
7026 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
7027 * nsterm.m (ns_term_init):
7028 * termhooks.h (struct terminal.read_socket_hook):
7029 * w32inevt.c (w32_console_read_socket):
7030 * w32term.c (w32_read_socket):
7031 * xterm.c (XTread_socket):
7032 Omit unused arg EXPECTED. All callers changed.
7033 (store_user_signal_events): Return void, not int, since callers no
7034 longer care about the return value. All uses changed.
7035
b019b76a
JB
70362012-09-20 Juanma Barranquero <lekktu@gmail.com>
7037
7038 * w32gui.h (XParseGeometry): Do not declare.
7039
05642592
PE
70402012-09-19 Paul Eggert <eggert@cs.ucla.edu>
7041
e4bce92a 7042 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 7043 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
7044 <http://bugs.gnu.org/12471#8> (last line).
7045
05642592
PE
7046 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
7047 (XParseGeometry): Now static. Substitute extremal values for
7048 values that are out of range.
7049
e543ae91
JD
70502012-09-19 Jan Djärv <jan.h.d@swipnet.se>
7051
7052 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
7053
7054 * nsfns.m (XParseGeometry): Remove.
7055 (Fx_create_frame): Call x_set_offset to correctly interpret
7056 top_pos in geometry.
7057
3a880af4 7058 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
7059 (Fx_parse_geometry): If there is a space in string, call
7060 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
7061
45ba16c7
EZ
70622012-09-17 Eli Zaretskii <eliz@gnu.org>
7063
c8b9f1bc
EZ
7064 * search.c (scan_buffer): Use character positions in calls to
7065 region_cache_forward and region_cache_backward, not byte
7066 positions. (Bug#12196)
7067
b4c932a2
EZ
7068 * w32term.c (w32_read_socket): Set pending_signals to 1, like
7069 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
7070
45ba16c7
EZ
7071 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
7072 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
7073 emacs_blocked_malloc, now deleted.
7074
eeceac93
PE
70752012-09-17 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
7078 The workaround was for improving performance on Solaris 2.4, but
7079 is getting in the way now. Emacs will still work if someone is
7080 still running Solaris 2.4 in a museum somewhere; Sun dropped
7081 support for Solaris 2.4 in 2003.
7082 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
7083 * process.c (create_process) [HAVE_WORKING_VFORK]:
7084 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
7085 since Emacs no longer uses vfork on that platform.
7086
78f83752
GM
70872012-09-17 Glenn Morris <rgm@gnu.org>
7088
7089 * emacs.c: Use COPYRIGHT.
7090
634b8cac
PE
70912012-09-16 Paul Eggert <eggert@cs.ucla.edu>
7092
0caaedb1
PE
7093 Remove configure's --without-sync-input option (Bug#12450).
7094 When auditing signal-handling in preparation for cleaning it up,
7095 I found that SYNC_INPUT has race conditions and would be a real
7096 pain to fix. Since it's an undocumented and deprecated
7097 configure-time option, now seems like a good time to remove it.
7098 Also see <http://bugs.gnu.org/11080#16>.
7099 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
7100 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
7101 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7102 (malloc_hysteresis):
7103 (check_depth) [XMALLOC_OVERRUN_CHECK]:
7104 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
7105 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
7106 (dont_register_blocks, bytes_used_when_reconsidered)
7107 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
7108 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
7109 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 7110 Remove. All uses removed.
0caaedb1
PE
7111 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
7112 implementation, one that depends on whether the new macro
7113 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
7114 is defined.
7115 * atimer.c (run_timers, handle_alarm_signal):
7116 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
7117 (handle_async_input, process_pending_signals)
7118 (handle_input_available_signal, init_keyboard):
7119 * nsterm.m (ns_read_socket):
7120 * process.c (wait_reading_process_output):
7121 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
7122 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
7123 (emacs_write):
7124 * xterm.c (XTread_socket):
7125 Assume SYNC_INPUT.
7126 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
7127 * eval.c (handling_signal): Remove. All uses removed.
7128 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
7129 All uses replaced with the SYNC_INPUT version.
7130 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
7131 Remove decls.
7132 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7133 Now static.
7134
634b8cac
PE
7135 * font.c (Ffont_shape_gstring): Remove unused local.
7136
83da1b55
GM
71372012-09-16 Glenn Morris <rgm@gnu.org>
7138
518650a5
GM
7139 * Makefile.in (clean): No longer run nextstep's clean.
7140
83da1b55
GM
7141 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
7142 (ns_frag): Remove.
7143 (ns-app): Move here from ns.mk, and simplify.
7144 (clean): Simplify nextstep entry.
7145 * ns.mk: Remove file.
7146
85a43e2e
KH
71472012-09-17 Kenichi Handa <handa@gnu.org>
7148
7149 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
7150 not covert the last few charactes.
7151
ba13e616 71522012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
7153
7154 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
7155 here, but just check the validity of glyphs in the glyph-string.
7156
a8c729af
MR
71572012-09-16 Martin Rudalics <rudalics@gmx.at>
7158
3a880af4
SM
7159 * window.c (Fwindow_parameter, Fset_window_parameter):
7160 Accept any window as argument (Bug#12452).
a8c729af 7161
c077c059
JD
71622012-09-16 Jan Djärv <jan.h.d@swipnet.se>
7163
7164 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
7165 to ns_term_init to avoid memory leak.
7166
7167 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
7168 explicit retain/release.
7169 (ns_term_init): Only allow one display. Initialize outerpool and
7170 ns_*_types.
7171
39a57ad0
PE
71722012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 Port _setjmp fix to POSIXish hosts as well as Microsoft.
7175 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
7176 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
7177 the Microsoft problem in a different way, by altering ../nt/config.nt.
7178
7105c8cb
EZ
71792012-09-15 Eli Zaretskii <eliz@gnu.org>
7180
7181 * w32xfns.c:
7182 * w32uniscribe.c:
7183 * w32term.c:
7184 * w32select.c:
7185 * w32reg.c:
7186 * w32proc.c:
7187 * w32menu.c:
7188 * w32inevt.c:
7189 * w32heap.c:
7190 * w32font.c:
7191 * w32fns.c:
7192 * w32console.c:
7193 * w32.c:
7194 * w16select.c: Remove inclusion of setjmp.h, as it is now included
7195 by lisp.h. This completes removal of setjmp.h inclusion
7196 erroneously announced in the previous commit. (Bug#12446)
7197
7198 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
7199 more accurate.
7200
7201 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
7202 not defined as a macro. The latter happens on MS-Windows.
7203 (Bug#12446)
7204
0328b6de
PE
72052012-09-15 Paul Eggert <eggert@cs.ucla.edu>
7206
7207 Port better to POSIX hosts lacking _setjmp (Bug#12446).
7208 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 7209 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
7210 only reason for the instance was because "lisp.h" was included.
7211 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
7212 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
7213 and _longjmp with the new symbols. Emacs already uses _setjmp if
7214 available, so this change affects only POSIXish hosts that have
7215 sigsetjmp but not _setjmp, such as some versions of Solaris and
7216 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
7217 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
7218 (png_load_body) [HAVE_PNG]:
7219 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
7220 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
7221 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
7222 since PNG requires jmp_buf. This is the only exception to the
7223 general rule that we now use sys_setjmp and sys_longjmp.
7224 This exception is OK since this code does not change the signal
7225 mask or longjmp out of a signal handler.
7226
2af03429
PE
72272012-09-14 Paul Eggert <eggert@cs.ucla.edu>
7228
7229 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
7230 Include "syssignal.h", for 'main_thread'.
7231
2f294edf
DA
72322012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
7233
7234 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
7235 * insdel.c (replace_range, replace_range_2):
7236 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
7237 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
7238 Remove redundant check before calling offset_intervals.
7239
6b533e9c
MR
72402012-09-14 Martin Rudalics <rudalics@gmx.at>
7241
7242 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
7243 current buffer (Bug#12387).
7244
2a7931e3
JB
72452012-09-14 Juanma Barranquero <lekktu@gmail.com>
7246
7247 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
7248
c18e885b
PE
72492012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 Use a more backwards-compatible timer format (Bug#12430).
7252 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
7253 vector element, not from the 4th, since PSECS is now at the end.
7254 (Fcurrent_idle_time): Doc fix.
7255
d59a1afb
DA
72562012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
7257
7258 Function to mark objects and remove killed buffers at once.
7259 * alloc.c (discard_killed_buffers): Rename to ...
7260 (mark_discard_killed buffers) ... new name. Add marking
7261 of remaining objects. Fix comment. Adjust users.
7262 (mark_object): Do not touch frame buffer lists here.
7263 * frame.c (delete_frame): Reset frame buffer lists here.
7264
5f0cb45a
PE
72652012-09-13 Paul Eggert <eggert@cs.ucla.edu>
7266
8ea47e3a
PE
7267 Better workaround for GNOME bug when --enable-gcc-warnings.
7268 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
7269 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
7270 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
7271
4a4bbad2
PE
7272 Simplify SIGIO usage (Bug#12408).
7273 The code that dealt with SIGIO was crufty and confusing, e.g., it
7274 played tricks like "#undef SIGIO" but these tricks were not used
7275 consistently. Simplify mostly by not #undeffing standard symbols,
7276 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
7277 or not as we please) rather than "defined SIGIO" (standard symbol
7278 that we probably shouldn't #undef).
7279 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7280 Modules that need it can include it.
7281 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7282 * dispextern.h (ignore_sigio): New decl.
7283 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7284 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7285 * emacs.c (shut_down_emacs):
7286 * keyboard.c (kbd_buffer_store_event_hold):
7287 Use ignore_sigio rather than invoking 'signal' directly.
7288 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7289 for FIONREAD.
7290 (FIONREAD, SIGIO): Do not #undef.
7291 (tty_read_avail_input): Use #error rather than a syntax error.
7292 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7293 for I_PIPE, used by SETUP_SLAVE_PTY.
7294 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7295 * sysdep.c (croak): Remove; no longer needed. This bit of
7296 temporary code, with Fred N. Fish's comment that it's temporary,
7297 has been in Emacs since at least 1992!
7298 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7299 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7300 * syssignal.h (croak): Remove decl.
7301 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7302 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7303 now that we're termios-only.
7304 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7305 * term.c (dissociate_if_controlling_tty): Use #error rather than
7306 a run-time error.
7307
5f0cb45a
PE
7308 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7309 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7310 to work around GNOME bug 683906.
7311 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7312 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7313 This works around GCC bug 54561.
7314
40bce90b
PE
73152012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7316
7317 More fixes for 'volatile' and setjmp/longjmp.
7318 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7319 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7320 (png_load_body) [HAVE_PNG]:
7321 (jpeg_load_body) [HAVE_JPEG]:
7322 New function, with most of the old parent function's body.
7323 (png_load) [HAVE_PNG]:
7324 (jpeg_load) [HAVE_JPEG]:
7325 Invoke the new function, to avoid longjmp munging our locals.
7326 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7327 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7328 longjmp is passed 2, as the C standard doesn't guarantee this.
7329 Instead, store the failure code into mgr->failure_code.
7330
bfeae2cf
SM
73312012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7332
7333 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7334 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7335 (syms_of_keyboard): Remove support for unread-command-char.
7336
8099e36b
EZ
73372012-09-12 Eli Zaretskii <eliz@gnu.org>
7338
7339 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7340 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7341 violation. (Bug#12426)
7342
92547ff9
PE
73432012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7344
7345 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7346
45b82ad0
SM
73472012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7348
7349 * eval.c: Add `inhibit-debugger'.
7350 (Qinhibit_debugger): New symbol.
7351 (call_debugger): Bind it instead of Qdebug_on_error.
7352 (maybe_call_debugger): Test Vinhibit_debugger.
7353 (syms_of_eval): Define inhibit-debugger.
7354 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7355 (syms_of_xdisp): Remove inhibit-debug-on-message.
7356
5779a1dc
PE
73572012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7358
50f2e553
PE
7359 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7360 If a nonvolatile local variable is written before a _longjmp to
7361 the frame containing the variable, and is read after the _longjmp,
7362 the value read is indeterminate. Some local variables of type
7363 'struct handler' and 'struct catchtag' are used in this way, so
7364 mark each of their slots as volatile if the slot can be set before
7365 _longjmp and read afterwards.
7366 * lisp.h (struct handler): var and chosen_clause are now volatile.
7367 (struct catchtag): val, next, and pdlcount are now volatile.
7368
ae1d87e2
PE
7369 * bidi.c (bidi_push_it, bidi_pop_it):
7370 * fns.c (copy_hash_table):
7371 * image.c (define_image_type):
7372 * keyboard.c (kbd_buffer_store_event_hold):
7373 * process.c (Fprocess_send_eof):
7374 * xfaces.c (x_create_gc) [HAVE_NS]:
7375 * xgselect.c (xg_select):
7376 Prefer assignment to memcpy when either will do.
7377
5779a1dc
PE
7378 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7379 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7380 time an item is removed. No need to mark this function 'inline';
7381 the compiler knows better than we do.
7382
c4c9756b
JD
73832012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7384
7385 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7386 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7387 to change_frame_size (Bug#12388).
7388 (windowDidResize:): Pass YES to updateFrameSize.
7389
7390 * nsterm.h: Add delay parameter to updateFrameSize.
7391
d73e321c
DA
73922012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7393
7394 Discard killed buffers from deleted window and frame objects.
7395 This reduces an amount of references to killed buffers and
7396 helps GC to reclaim them faster.
7397 * alloc.c (discard_killed_buffers): New function.
7398 (mark_object): Use it for deleted windows and frames.
7399 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 7400 or deleted frame, restore its global binding.
d73e321c
DA
7401 * data.c (swap_in_global_binding): Add GC notice.
7402 (swap_in_symval_forwarding): Use convenient set_blv_where.
7403 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7404 * window.h: ... to here.
7405
e578f381
DA
74062012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7407
7408 Convenient macro to check whether the buffer is live.
7409 * buffer.h (BUFFER_LIVE_P): New macro.
7410 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7411 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7412
3057e615
YM
74132012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7414
7415 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7416 composition cases (Bug#12364).
7417
7418 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7419 overhang of succeeding glyphs overlapping box cursor.
7420
7421 * w32term.c (x_draw_glyph_string): Likewise.
7422
6fda35f2
PE
74232012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7424
c990426a
PE
7425 Simplify, document, and port floating-point (Bug#12381).
7426 The porting part of this patch fixes bugs on non-IEEE platforms
7427 with frexp, ldexp, logb.
7428 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7429 Now static.
7430 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7431 support, by removing commented-out code and briefly listing the
7432 C89 functions excluded. The commented-out stuff was confusing
7433 maintenance, e.g., we thought we needed cbrt but it was commented out.
7434 (logb): Remove decl; no longer needed.
7435 (isfinite): New macro, if not already supplied.
7436 (isnan): Don't replace any existing macro.
7437 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7438 are present on all C89 platforms.
7439 (Ffrexp): Do not special-case zero, as frexp does the right thing
7440 for that case.
7441 (Flogb): Do not use logb, as it doesn't have the desired meaning
7442 on hosts that use non-base-2 floating point. Instead, stick with
7443 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7444 frexp, to avoid getting an unspecified result.
7445
6fda35f2
PE
7446 * xdisp.c (Qinhibit_debug_on_message): Now static.
7447
16130a58
JD
74482012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7449
7450 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7451 NSBezierPath (Bug#12131).
7452
d105a573
CY
74532012-09-10 Chong Yidong <cyd@gnu.org>
7454
7455 * fns.c (Fdelq, Fdelete): Doc fix.
7456
ff55dfe8
PE
74572012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7458
7459 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7460 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7461
e7032e7c
SM
74622012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7463
7464 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7465 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7466 Use it.
7467
e9957956
EZ
74682012-09-09 Eli Zaretskii <eliz@gnu.org>
7469
aba05ce9
EZ
7470 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7471 left fringe if the window has a left margin. This avoids leaving
7472 traces of the cursor because its leftmost pixel is not drawn over.
7473
e9957956
EZ
7474 * dispnew.c (update_window_line): When the left margin area of a
7475 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7476 that screen line. (Bug#12277)
7477
f6196b87
PE
74782012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 Assume C89 or later for math functions (Bug#12381).
7481 This simplifies the code, and makes it a bit smaller and faster,
7482 and (most important) makes it easier to clean up signal handling
7483 since we can stop worring about floating-point exceptions in
7484 library code. That was a problem before C89, but the problem
7485 went away many years ago on all practical Emacs targets.
7486 * data.c, image.c, lread.c, print.c:
7487 Don't include <math.h>; no longer needed.
7488 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7489 might be autoconfigured, as that never happens.
7490 * data.c (fmod):
7491 * doprnt.c (DBL_MAX_10_EXP):
7492 * print.c (DBL_DIG):
7493 Remove. C89 or later always defines these.
7494 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7495 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7496 (arith_error, domain_error, domain_error2):
7497 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7498 no longer needed -- we simply return what C returns. All uses removed.
7499 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7500 the wrapped code.
7501 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7502 Remove. All uses expanded, as these macros are no longer used
7503 more than once and are now more trouble than they're worth.
7504 (Ftan): Use tan, not sin / cos.
7505 (Flogb): Assume C89 frexp.
7506 (fmod_float): Assume C89 fmod.
7507 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7508 (init_floatfns): Remove. All uses removed.
7509
9d7f1863
JD
75102012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7511
7512 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7513 compositeToPoint for OSX < 10.6 (Bug#12390).
7514
eabf0404
PE
75152012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7516
7517 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7518 This produces more-accurate results.
7519
0b3b1d23
JD
75202012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7521
7522 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7523 changes (Bug#12088).
7524
6dcef6ec
CY
75252012-09-08 Chong Yidong <cyd@gnu.org>
7526
7527 * syntax.c (Fstring_to_syntax): Doc fix.
7528
aa7d57c5
JD
75292012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7530
7531 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7532 in the internal border.
7533 (x_set_window_size): Remove static variables and their usage.
7534 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
7535 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7536 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
7537 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7538 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7539 (ns_fix_rect_ibw): Remove.
7540 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7541 (ns_dumpglyphs_box_or_relief): Ditto.
7542 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7543 adjustment.
7544 (ns_dumpglyphs_image): Ditto.
fc0c31f8 7545 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
7546 border adjustment.
7547 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7548 their usage. Add fringe_extended_p and its use as in other terms.
7549 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7550 scroll bar was removed.
7551 (updateFrameSize): New function.
7552 (windowDidResize): Move code to updateFrameSize and call it.
7553
7554 * nsterm.h (EmacsView): Add updateFrameSize.
7555
1a5432bc
CY
75562012-09-07 Chong Yidong <cyd@gnu.org>
7557
b4f5313e
CY
7558 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7559
1a5432bc
CY
7560 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7561
1a4f1e9b
PE
75622012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7563
7564 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
7565 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7566 Problem introduced when merging patches. Noted by Eli Zaretskii in
7567 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
7568 * floatfns.c: Comment fix.
7569 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7570 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7571 and anyway the declaration is harmless even if SIGDANGER is not defined.
7572 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7573 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7574 source files not surprisingly expected syssignal.h to define, or
7575 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7576 Include <sys/ioctl.h>, for FIONREAD.
7577 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7578 This eliminates a problem whereby other files mysteriously had
7579 to include "syssignal.h" before including "systty.h" if they
7580 wanted to use "#ifdef SIGIO".
7581
bc8000ff
EZ
75822012-09-07 Eli Zaretskii <eliz@gnu.org>
7583
3e6d6928
EZ
7584 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7585
7586 * w32.c (sigemptyset): Empty the set.
7587 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7588
bc8000ff
EZ
7589 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7590
b4fa72f2
DA
75912012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7592
7593 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7594 (mark_object): Likewise for frame objects.
7595
30730c93
PE
75962012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7597
7598 * syssignal.h (handle_on_main_thread): Always declare,
7599 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7600 This ports to platforms without HAVE_PTHREAD.
7601
2fe28299
PE
76022012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7603
7604 Signal-handler cleanup (Bug#12327).
7605 Emacs's signal handlers were written in the old 4.2BSD style with
7606 sigblock and sigmask and so forth, and this led to some
7607 inefficiencies and confusion. Rewrite these to use
7608 pthread_sigmask etc. without copying signal sets around. Also,
7609 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7610 'signal', and instead use functions that do not attempt to take
7611 over the system name space. This patch causes Emacs's text
7612 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7613 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7614 Do not include <signal.h> or "syssignal.h", as these
7615 modules do not use signals.
7616 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7617 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7618 Do not include <signal.h>, as "syssignal.h" does that for us now.
7619 * atimer.c (sigmask_atimers): New function.
7620 (block_atimers, unblock_atimers): New functions,
7621 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7622 All uses replaced.
7623 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7624 no longer needed here.
7625 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 7626 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
7627 * sysdep.c (struct save_signal): New member 'action', replacing
7628 old member 'handler'.
7629 (save_signal_handlers, restore_signal_handlers):
7630 Use sigaction instead of 'signal' to save and restore.
7631 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7632 New function. All users of 'signal' modified to use set_sighandler
7633 if they're writeonly, and to use sys_signal if they're read+write.
7634 (emacs_sigaction_init, forwarded_signal): New functions.
7635 (sys_signal): Remove. All uses replaced by calls to sigaction
7636 and emacs_sigaction_init, or by direct calls to 'signal'.
7637 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7638 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7639 all uses replaced by pthread_sigmask etc. calls.
7640 * syssignal.h: Include <signal.h>.
7641 (emacs_sigaction_init, forwarded_signal): New decls.
7642 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7643 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7644 (sigmask, sys_sigmask): Remove; no longer needed.
7645 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7646 (sigblock, sigunblock, sigfree):
7647 (sigsetmask) [!defined sigsetmask]:
7648 Remove. All uses replaced by pthread_sigmask.
7649 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7650 no longer need to be replaced, and its typical old uses
7651 are now done via emacs_sigaction_init and sigaction.
7652 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7653 (sys_sigdel): Remove; unused.
7654 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7655
0216c128
EZ
76562012-09-06 Eli Zaretskii <eliz@gnu.org>
7657
7658 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7659 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7660
c752cfa9
DA
76612012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7662
7663 Explicitly mark buffer_defaults and buffer_local_symbols.
7664 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7665 mark_local_symbols here.
7666 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7667 since special buffers aren't marked here any more.
7668 (allocate_buffer): Chain new buffer with all_buffers here...
7669 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7670 not here.
7671 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7672 (syms_of_buffer): Remove staticpro of the above.
7673 (init_buffer_once): Set names for buffer_defaults and
7674 buffer_local_symbols.
7675
a864ef14
PE
76762012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7677
7678 Use bool for booleans in font-related modules.
7679 * font.c (font_intern_prop, font_style_to_value)
7680 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7681 (generate_otf_features, font_check_otf_features, font_check_otf)
7682 (font_match_p, font_list_entities, font_at):
7683 * fontset.c (fontset_id_valid_p, reorder_font_vector
7684 (fontset_find_font, Fset_fontset_font)
7685 (face_suitable_for_char_p) [0]:
7686 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7687 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7688 (m17n_flt_initialized, ftfont_shape_by_flt):
7689 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7690 * nsfont.m (nsfont_draw):
7691 * w32font.c (w32font_draw):
7692 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7693 Use bool for booleans.
7694 * font.h: Adjust to above API changes.
7695 (struct font, struct font_driver, struct font_driver_list):
7696 Use bool for booleans.
7697 (struct font): Remove useless member encoding_type.
7698 All users removed.
7699 * fontset.c, xftfont.c: Omit unnecessary static decls.
7700
0699fc18
DA
77012012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7702
7703 * alloc.c (mark_object): Revert window marking code
7704 since it's unsafe for the Fset_window_configuration.
7705
20ef56db
PE
77062012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7707
2fe28299 7708 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
7709 Be more systematic about preserving errno whenever a signal
7710 handler returns, even if it's not in the main thread. Do this by
7711 renaming signal handlers to distinguish between signal delivery
7712 and signal handling. All uses changed.
7713 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7714 * data.c (deliver_arith_signal): Rename from arith_error.
7715 * dispnew.c (deliver_window_change_signal): Rename from
7716 window_change_signal.
7717 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7718 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7719 * keyboard.c (deliver_input_available_signal): Rename from
7720 input_available_signal.
7721 (deliver_user_signal): Rename from handle_user_signal.
7722 (deliver_interrupt_signal): Rename from interrupt_signal.
7723 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7724 (deliver_child_signal): Rename from sigchld_handler.
7725 * atimer.c (handle_alarm_signal):
7726 * data.c (handle_arith_signal):
7727 * dispnew.c (handle_window_change_signal):
7728 * emacs.c (handle_fatal_signal, handle_danger_signal):
7729 * keyboard.c (handle_input_available_signal):
7730 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7731 * process.c (handle_pipe_signal, handle_child_signal):
7732 New functions, with the actual signal-handling code taken from the
7733 original respective signal handlers, sans the sporadic attempts to
7734 preserve errno, since that's now done by handle_on_main_thread.
7735 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7736 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7737 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7738 Move to sysdep.c.
7739 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7740 Move initialization of main_thread to sysdep.c's init_signals.
7741 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7742 our usage, and simplifies the mainline code.
7743 (record_child_status_change): New static function, as a helper
7744 for handle_child_signal, and with most of the old child handler's
7745 contents.
7746 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7747 (handle_child_signal): Use the above.
7748 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7749 Moved here from emacs.c.
7750 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7751 code moved here from emacs.c's main function.
7752 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
7753 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7754 This lets callers save and restore errno properly.
20ef56db 7755
e3ccf108
DA
77562012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7757
7758 Remove redundant or unused things here and there.
7759 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7760 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7761 * editfns.c (Fcompare_buffer_substrings): Likewise.
7762 * frame.h (struct terminal, struct font_driver_list):
7763 Remove redundant declarations.
7764 * window.h (Qleft, Qright): Likewise.
7765
697e1e39
DA
77662012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7767
7768 Do not mark objects from deleted buffers, windows and frames.
7769 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7770 (mark_object): Likewise for windows and frames.
7771
c1ca42ca
DA
77722012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7773
7774 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7775 buffer_defaults and buffer_local_symbols as valid objects.
7776 Return special value to denote them.
7777
014d93be
PE
77782012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7779
f75d7a91
PE
7780 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7781 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7782 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7783 (file_name_absolute_p, Fsubstitute_in_file_name):
7784 (check_executable, check_writable, Ffile_accessible_directory_p)
7785 (Fset_file_selinux_context, Fdefault_file_modes)
7786 (Finsert_file_contents, choose_write_coding_system)
7787 (Fwrite_region, build_annotations, a_write, e_write)
7788 (Fdo_auto_save):
7789 * filelock.c (boot_time_initialized, get_boot_time)
7790 (get_boot_time_1, lock_file_1, within_one_second):
7791 * floatfns.c (in_float):
7792 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7793 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7794 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7795 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7796 * window.c (compare_window_configurations):
7797 Use bool for booleans.
7798 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7799 (Fdefault_file_modes): Now mode_t, not int, for modes.
7800 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7801 (internal_delete_file): Now returns void, not a (boolean) int,
7802 since nobody was looking at the return value.
7803 * lisp.h, window.h: Adjust to above API changes.
7804
014d93be
PE
7805 * xdisp.c (set_message): Simplify and reindent last change.
7806
776f29e1
JB
78072012-09-05 Juanma Barranquero <lekktu@gmail.com>
7808
7809 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7810
7f7e0167
LI
78112012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7812
7813 * eval.c (call_debugger): Make the function non-static so that we
7814 can call it from set_message.
7815
7816 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7817 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7818
cf29dd84
PE
78192012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7820
7821 Give more-useful info on a fatal error (Bug#12328).
7822 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7823 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7824 of doing the work ourselves.
7825 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7826 do most of the work.
7827 (fatal_error_backtrace): New function, taken from the guts
7828 of the old fatal_error_signal, but with a new option to output
7829 a backtrace.
7830 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7831 info about the signal than just its number.
7832 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7833 * sysdep.c: Include <execinfo.h>
7834 (emacs_backtrace): New function, taken partly from the previous
7835 code of the 'die' function.
7836 (emacs_abort): Call fatal_error_backtrace rather than abort.
7837
972debf2
SM
78382012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7839
7840 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7841 eager (load-time) macro-expansion.
7842 * lisp.mk (lisp): Add macroexp.
7843
1088b922
PE
78442012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7845
7846 Simplify redefinition of 'abort' (Bug#12316).
7847 Do not try to redefine the 'abort' function. Instead, redo
7848 the code so that it calls 'emacs_abort' rather than 'abort'.
7849 This removes the need for the NO_ABORT configure-time macro
7850 and makes it easier to change the abort code to do a backtrace.
7851 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7852 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7853 Remove; sysdep.c's emacs_abort now takes its place.
7854 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7855 'abort' changed to use 'emacs_abort'.
7856 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7857 (abort) [!defined abort]: Rename to ...
7858 (emacs_abort): ... new name.
7859 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7860 the place of the old 'abort' in emacs.c.
7861 * w32.c, w32fns.c (abort): Do not #undef.
7862 * w32.c (emacs_abort): Rename from w32_abort.
7863
30934d33
EZ
78642012-09-04 Eli Zaretskii <eliz@gnu.org>
7865
7866 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7867 offsets[j].dv, since the y axis of the screen coordinates points
7868 down, while the y axis of the font definition coordinates points
7869 up. This fixes display of Arabic diacritics such as KASRA and
7870 KASRATAN. (Bug#11860)
7871
af26b72c
PE
78722012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7873
7874 Be more systematic about _setjmp vs setjmp.
7875 * alloc.c (test_setjmp, mark_stack):
7876 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7877 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7878 (png_load, my_error_exit, jpeg_load):
7879 * process.c (send_process_trap, send_process):
7880 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7881 The underscored versions are up to 30x faster on some hosts.
7882 Formerly, the code used setjmp+longjmp sometimes and
7883 _setjmp+_longjmp at other times, with no particular reason to
7884 prefer setjmp+longjmp.
7885
26d4541d
PE
78862012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7887
d42f4f0f 7888 Fix minor problem found by static checking.
26d4541d 7889 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7890
c5e28e39
MR
78912012-09-03 Martin Rudalics <rudalics@gmx.at>
7892
7893 * buffer.c (Fdelete_all_overlays): New function.
7894
3eab3ca9
CY
78952012-09-03 Chong Yidong <cyd@gnu.org>
7896
7897 * gtkutil.c: Add extern decl for Qxft.
7898
c04889f8
PE
78992012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7900
1882aa38
PE
7901 * emacs.c, eval.c: Use bool for boolean.
7902 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7903 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7904 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7905 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7906 (main, decode_env_path, Fdaemon_initialized):
7907 * eval.c (call_debugger, Finteractive_p, interactive_p):
7908 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7909 (maybe_call_debugger, Fbacktrace):
7910 * process.c (read_process_output, exec_sentinel):
7911 Use bool for booleans.
7912 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7913 All callers changed.
7914 * eval.c (interactive_p): Omit always-true boolean argument
7915 EXCLUDE_SUBRS_P. All callers changed.
7916 * dispextern.h, lisp.h: Reflect above API changes.
7917 * firstfile.c (dummy): Use the address of 'main', whose signature
7918 won't change, instead of the address of 'initialize', whose
7919 signature just changed from int to bool.
7920 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7921 * msdos.c (fatal_error_in_progress): ... from here.
7922 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7923 of incrementing it.
7924 (redisplay_internal, unwind_redisplay): Simply clear
7925 REDISPLAYING_P when unwinding, instead of saving its previous,
7926 always-false value and then restoring it.
7927
a411ac43
PE
7928 Clean up some extern decls.
7929 Mostly, this hoists extern decls out of .c files and into .h files.
7930 That way, we're more likely to catch errors if the interfaces change.
7931 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7932 declare xg_mark_data.
7933 * dispextern.h (x_frame_parm_handlers):
7934 * font.h (Qxft):
7935 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7936 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7937 (Qultra_bold, Qoblique, Qitalic):
7938 Move extern decl here from .c file.
7939 * alloc.c (xg_mark_data) [USE_GTK]:
7940 * doc.c (Qclosure):
7941 * eval.c (Qlexical_binding):
7942 * fns.c (time) [!HAVE_UNISTD_H]:
7943 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7944 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7945 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7946 * lread.c (Qinternal_interpreter_environment):
7947 * minibuf.c (Qbuffer):
7948 * process.c (QCfamily, QCfilter):
7949 * widget.c (free_frame_faces):
7950 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7951 * xfont.c (x_clear_errors):
7952 * xterm.c (x_frame_parm_handlers):
7953 Remove now-redundant extern decls.
7954 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7955 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7956 Now static.
7957 * xfaces.c: Remove unnecessary static decls.
7958 * xterm.c (updating_frame): Remove decl of nonexistent object.
7959
c04889f8
PE
7960 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7961 when building globals.h, as the objects that are not built on
7962 this host are not needed to compile C files on this host.
7963
8b339673
JD
79642012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7965
7966 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7967
7968 * frame.h: Add missing prototype for x_wm_set_size_hint.
7969
a08d4ba7
PE
79702012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7971
7972 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7973 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7974 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7975 (Fsubstitute_command_keys):
7976 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7977 (save_excursion_save, save_excursion_restore)
7978 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7979 (format_time_string, general_insert_function)
7980 (make_buffer_string, make_buffer_string_both)
7981 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7982 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7983 (copy_text, insert_1, insert_1_both, insert_from_string)
7984 (insert_from_string_before_markers, insert_from_string_1)
7985 (insert_from_buffer, insert_from_buffer_1, replace_range)
7986 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7987 (del_range_2, modify_region):
7988 * intervals.c (intervals_equal, balance_possible_root_interval)
7989 (adjust_intervals_for_insertion, merge_properties_sticky)
7990 (graft_intervals_into_buffer, lookup_char_property)
7991 (adjust_for_invis_intang, set_point_both)
7992 (get_property_and_range, compare_string_intervals)
7993 (set_intervals_multibyte_1, set_intervals_multibyte):
7994 * keyboard.c (decode_timer):
7995 Use bool for boolean.
7996 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7997 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7998
48c948de
CY
79992012-09-02 Chong Yidong <cyd@gnu.org>
8000
8001 * keymap.c (push_key_description): Print M-TAB as C-M-i
8002 (Bug#11758).
8003
6c49a40b
JB
80042012-09-02 Juanma Barranquero <lekktu@gmail.com>
8005
8006 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
8007 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
8008 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
8009 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
8010 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
8011 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
8012 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8013
4dfbd238
EZ
80142012-09-01 Eli Zaretskii <eliz@gnu.org>
8015
7e510e28
EZ
8016 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
8017 more than one grapheme cluster passed to the shaper: compute the
8018 offset adjustment values separately for each cluster. (Bug#11860)
8019
4dfbd238
EZ
8020 * image.c: Restore mistakenly removed inclusion of w32.h. Without
8021 it, GCC doesn't see prototypes of w32_delayed_load, and complains
8022 about implicit conversions from integer to pointer.
8023
86571ae0
DC
80242012-09-01 Daniel Colascione <dancol@dancol.org>
8025
8026 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
8027 system used too early.
8028
0e23ef9d
PE
80292012-09-01 Paul Eggert <eggert@cs.ucla.edu>
8030
8031 Better seed support for (random).
8032 * emacs.c (main): Call init_random.
8033 * fns.c (Frandom): Set the seed from a string argument, if given.
8034 Remove long-obsolete Gentzel cruft.
8035 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
8036 (init_random): New function.
8037
17a2cbbd
DC
80382012-09-01 Daniel Colascione <dancol@dancol.org>
8039
8040 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
8041 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
8042 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
8043 x_wm_set_size_hint, x_query_colors, x_real_positions,
8044 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
8045 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
8046 all of which have been moved to common code.
8047
8048 * xfaces.c: Include TERM_HEADER instead of listing all possible
8049 window-system headers.
8050
8051 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
8052 to match header.
8053
8054 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
8055 directly accessing frame internals.
8056
f18cbb28 8057 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
8058 globals_of_w32font.
8059
8060 * process.c: Include TERM_HEADER instead of listing all possible
8061 window-system headers.
8062
3a880af4
SM
8063 * nsterm.h: Remove declarations now in frame.h.
8064 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
8065
8066 * menu.c: Include TERM_HEADER instead of listing all possible
8067 window-system headers.
8068
8069 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
8070 window system.
8071
8072 * keyboard.c: Include TERM_HEADER instead of listing all possible
8073 window-system headers.
8074
8075 * image.c: Include TERM_HEADER instead of listing all possible
8076 window-system headers. Declare Vlibrary_cache when compiling for
8077 Windows.
8078
8079 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
8080 window system declarations.
8081
8082 * frame.h: Move common functions here: set_frame_menubar,
8083 x_set_window_size, x_sync, x_get_focus_frame,
8084 x_set_mouse_position, x_set_mouse_pixel_position,
8085 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
8086 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
8087 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
8088 x_activate_menubar, x_real_positions, x_bitmap_icon,
8089 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
8090 and x_query_colors.
8091
8092 * frame.c: Include TERM_HEADER instead of listing all possible
8093 window-system headers.
8094
8095 * font.c: Include TERM_HEADER instead of listing all possible
8096 window-system headers.
8097
8098 * emacs.c: Include TERM_HEADER.
8099
f18cbb28
EZ
8100 * dispnew.c: Include TERM_HEADER instead of listing all possible
8101 window-system headers.
17a2cbbd 8102
f18cbb28 8103 * ccl.h: Include character.h.
17a2cbbd
DC
8104
8105 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
8106 the current window system; include in list of objects to link into
8107 Emacs.
8108
c650a5de
DA
81092012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8110
8111 Remove mark_ttys function and fix tty_display_info initialization.
8112 * lisp.h (mark_ttys): Remove prototype.
8113 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
8114 to mark_ttys because all possible values of 'top_frame' slot are
8115 the frames which are reachable from Vframe_list.
8116 * term.c (mark_ttys): Remove.
8117 (init_tty): Safely initialize 'top_frame' slot with Qnil.
8118
4e0f6479
DA
81192012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8120
8121 Change struct frame bitfields from unsigned char to unsigned.
8122 * frame.h (struct frame): Change type of 'display_preempted',
8123 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
8124 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
8125 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
8126 bitfields from unsigned char to unsigned.
8127
8b96a52c
DA
81282012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
8129
8130 Remove unused member of struct x_output and struct w32_output.
8131 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
8132 * w32term.h (struct w32_output): Likewise.
8133
b4444c8a
JD
81342012-08-30 Jan Djärv <jan.h.d@swipnet.se>
8135
8136 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
8137 does not become zero (Bug#12234).
8138
b98521db
PE
81392012-08-30 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
8142 for GCC 4.7.1 x86-64.
8143
31d02438
GM
81442012-08-30 Glenn Morris <rgm@gnu.org>
8145
8146 * lread.c (init_lread): For out-of-tree builds, only add the
8147 source directory's site-lisp dir to the load-path if it exists,
8148 consistent with in-tree builds. (Bug#12302)
8149
7f8941d8
JD
81502012-08-28 Jan Djärv <jan.h.d@swipnet.se>
8151
8152 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 8153 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
8154 (windowShouldClose:): Set window_closed.
8155 (dealloc): New member, free button_values.
fc0c31f8
JB
8156 (process_dialog:): Make member function. Remove window argument,
8157 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
8158 in button_values.
8159 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 8160 with tag. Remove return self, declare return value as void.
7f8941d8
JD
8161 (addString:row:): Remove return self, declare return value as void.
8162 (addSplit): Remove return self, declare return value as void.
8163 (clicked:): Remove return self, declare return value as void.
fc0c31f8 8164 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
8165 (initFromContents:isQuestion:): Adjust call to process_dialog.
8166 Code formatting change.
8167 (timeout_handler:): Set timer_fired to YES.
8168 (runDialogAt:): Set timer_fired to NO.
8169 Handle click on close button as quit.
8170
8171 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
8172 Add window_closed and button_values. Add void as return value for
8173 add(Button|String|Split). addButton takes int instead of Lisp_Object.
8174 Add process_dialog as new member.
8175
eada0861 81762012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 8177
eada0861
GM
8178 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
8179 is not one of the heaps we manage. (Bug#12242)
8180
81812012-08-28 Glenn Morris <rgm@gnu.org>
8182
8183 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
8184
457294dd
MR
81852012-08-28 Martin Rudalics <rudalics@gmx.at>
8186
8187 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
8188 auto-buffer-name window parameter. Install revision of reverted
8189 fix.
457294dd 8190
4f2daf31
DA
81912012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8192
8193 Do not allow to set major mode for a dead buffer.
8194 * buffer.c (Fset_buffer_major_mode): Signal an error
8195 if the buffer is dead.
8196 (Fother_buffer, other_buffer_safely): Remove redundant
8197 nested declaration.
8198
66322887
DA
81992012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8200
8201 Always use set_buffer_if_live to restore original buffer at unwind.
8202 * buffer.h (record_unwind_current_buffer): New function.
8203 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
8204 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
8205 * undo.c, window.c: Adjust users.
8206 * buffer.c (set_buffer_if_live): Fix comment.
8207
a3d794a1
DA
82082012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8209
8210 Fix usage of set_buffer_internal.
8211 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
8212 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
8213 * coding.c (decode_coding): Omit redundant test.
8214 * fileio.c (decide_coding_unwind): Likewise.
8215 * fns.c (secure_hash): Likewise.
8216 * insdel.c (modify_region): Likewise.
8217 * keyboard.c (command_loop_1): Likewise.
8218 * print.c (PRINTFINISH): Likewise.
8219 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
8220
59ea14cd
PE
82212012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8222
8223 * dispnew.c: Use bool for boolean.
8224 (frame_garbaged, display_completed, delayed_size_change)
8225 (fonts_changed_p, add_window_display_history)
8226 (add_frame_display_history, verify_row_hash)
8227 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
8228 (row_equal_p, realloc_glyph_pool)
8229 (allocate_matrices_for_frame_redisplay)
8230 (showing_window_margins_p)
8231 (adjust_frame_glyphs_for_frame_redisplay)
8232 (build_frame_matrix_from_leaf_window, make_current)
8233 (mirrored_line_dance, mirror_line_dance, update_frame)
8234 (update_window_tree, update_single_window)
8235 (check_current_matrix_flags, update_window, update_text_area)
8236 (update_window_line, set_window_update_flags, scrolling_window)
8237 (update_frame_1, scrolling, buffer_posn_from_coords)
8238 (do_pending_window_change, change_frame_size)
8239 (change_frame_size_1, sit_for):
8240 Use bool for boolean.
8241 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
8242 and remove last int (actually boolean) argument, which was always 0.
8243 All callers changed.
8244 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
8245 * dispextern.h (struct composition_it): Use bool for boolean.
8246 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
8247 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
8248 * dired.c (file_name_completion):
8249 Use bool for boolean. (This was missed in an earlier change.)
8250
95072a94
MR
82512012-08-27 Martin Rudalics <rudalics@gmx.at>
8252
8253 * window.c (Fset_window_configuration): Revert first part of
8254 last change.
8255
0f19feff
JD
82562012-08-27 Jan Djärv <jan.h.d@swipnet.se>
8257
8258 * nsterm.h (NSPanel): New class variable dialog_return.
8259
3a880af4
SM
8260 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
8261 Initialize dialog_return.
0f19feff
JD
8262 (windowShouldClose:): Use stop instead of stopModalWithCode.
8263 (clicked:): Ditto, and also set dialog_return (Bug#12258).
8264 (timeout_handler:): Use stop instead of abortModal. Send a dummy
8265 event.
8266 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
8267 modal loop returns.
8268
f10fe38f
PE
82692012-08-27 Paul Eggert <eggert@cs.ucla.edu>
8270
de1339b0
PE
8271 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
8272 * composite.c (find_composition, composition_gstring_p)
8273 (composition_reseat_it, find_automatic_composition):
8274 * data.c (let_shadows_buffer_binding_p)
8275 (let_shadows_global_binding_p, set_internal, make_blv)
8276 (Fmake_variable_buffer_local, Fmake_local_variable)
8277 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
8278 (cons_to_signed, arith_driver):
8279 * dbusbind.c (xd_in_read_queued_messages):
8280 * dired.c (directory_files_internal, file_name_completion):
8281 Use bool for booleans.
8282 * dired.c (file_name_completion):
8283 * process.h (fd_callback):
8284 Omit int (actually boolean) argument. It wasn't being used.
8285 All uses changed.
8286 * composite.h, lisp.h: Reflect above API changes.
8287
f10fe38f
PE
8288 * cmds.c, coding.c: Use bool for booleans.
8289 * cmds.c (move_point, Fself_insert_command):
8290 * coding.h (struct composition status, struct coding_system):
8291 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8292 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8293 (emacs_mule_char, decode_coding_emacs_mule)
8294 (encode_coding_emacs_mule, detect_coding_iso_2022)
8295 (decode_coding_iso_2022, encode_invocation_designation)
8296 (encode_designation_at_bol, encode_coding_iso_2022)
8297 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8298 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8299 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8300 (encode_coding_raw_text, detect_coding_charset)
8301 (decode_coding_charset, encode_coding_charset, detect_eol)
8302 (detect_coding, get_translation_table, produce_chars)
8303 (consume_chars, reused_workbuf_in_use)
8304 (make_conversion_work_buffer, code_conversion_save)
8305 (decode_coding_object, encode_coding_object)
8306 (detect_coding_system, char_encodable_p)
8307 (Funencodable_char_position, code_convert_region)
8308 (code_convert_string, code_convert_string_norecord)
8309 (Fset_coding_system_priority):
8310 * fileio.c (Finsert_file_contents):
8311 Use bool for booleans.
8312 * coding.h, lisp.h: Reflect above API changes.
8313 * coding.c: Remove unnecessary static function decls.
8314 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8315 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8316 not a boolean 'int', since callers never look at the return value.
8317 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8318 * coding.h (decoding_buffer_size, encoding_buffer_size)
8319 (emacs_mule_string_char): Remove unused extern decls.
8320 (struct iso_2022_spec, struct coding_system):
8321 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8322 (struct emacs_mule_spec): Remove unused field 'full_support'.
8323 All initializations removed.
8324 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8325
5474c384
DA
83262012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8327
f10fe38f 8328 Fix spare memory change (Bug#12286).
5474c384
DA
8329 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8330 (valid_lisp_object_p): Likewise.
8331
c4b6914d
MR
83322012-08-27 Martin Rudalics <rudalics@gmx.at>
8333
8334 * window.c (Fset_window_configuration): Record any window's old
8335 buffer if it's replaced (see Bug#8789). If the new current
8336 buffer doesn't appear in the selected window, go to its old
8337 point (Bug#12208).
8338
35aaa1ea
DA
83392012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8340
8341 Special MEM_TYPE_SPARE to denote reserved memory.
8342 * alloc.c (enum mem_type): New memory type.
8343 (refill_memory_reserve): Use new type for spare memory.
8344 This prevents live_cons_p and live_string_p from incorrect
8345 detection of uninitialized objects from spare memory as live.
8346
6af64513
PE
83472012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8348
8b2e00a3
PE
8349 Spelling fixes.
8350 * Makefile.in (.PHONY): versioclean -> versionclean.
8351
b52d6985
PE
8352 Remove unused external symbols.
8353 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8354 * window.c (Qwindow_valid_p, decode_valid_window):
8355 Now static, not extern.
8356 * data.c (Qinterval): Remove; unused.
8357 (syms_of_data): Do not define 'interval'.
8358 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8359 * window.h (decode_valid_window):
8360 Remove decls.
8361
d5172d4f
PE
8362 * character.c, charset.c, chartab.c: Use bool for booleans.
8363 * character.c (lisp_string_width, string_count_byte8)
8364 (string_escape_byte8):
8365 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8366 (load_charset_map_from_file, map_charset_chars)
8367 (Fdefine_charset_internal, define_charset_internal)
8368 (Fdeclare_equiv_charset, find_charsets_in_text)
8369 (Ffind_charset_region, char_charset, Fiso_charset):
8370 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8371 (sub_char_table_set, sub_char_table_set_range)
8372 (char_table_set_range, optimize_sub_char_table)
8373 (map_sub_char_table):
8374 Use bool for boolean.
8375 * character.c (str_to_unibyte): Omit last boolean argument; it was
8376 always 0. All callers changed.
8377 * character.h, charset.h: Adjust to match previous changes.
8378 * character.h (char_printable_p): Remove decl of nonexistent function.
8379 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8380 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8381 are all boolean, so make them single-bit bitfields.
8382
6af64513
PE
8383 * lisp.h (ASET): Remove attempt to detect side effects.
8384 It was meant to be temporary and it often doesn't work,
8385 because when IDX has side effects the behavior of IDX==IDX
8386 is undefined. See Stefan Monnier in
8387 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8388
e1f29348
BR
83892012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8390
8391 * lisp.h (functionp): New function (extracted from Ffunctionp).
8392 (FUNCTIONP): Use it.
8393 * eval.c (Ffunctionp): Use it.
8394
17c05d74
PE
83952012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8396
0f46bc75
PE
8397 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8398 as that's faster and simpler than static storage. Don't bother
8399 with the g_main_context_query overhead if g_main_context_pending
8400 says no events are pending.
8401 (gfds, gfds_size): Remove these static vars.
8402 (xgselect_initialize): Remove; no longer needed.
8403 All uses and decls removed.
8404
ee4c0f69
PE
8405 * emacs.c (fatal_error_signal_hook): Remove.
8406 All uses removed. This leftover from old code was always 0.
8407
17c05d74
PE
8408 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8409 * casefiddle.c (casify_object, casify_region):
8410 * casetab.c (set_case_table):
8411 * category.c, category.h (word_boundary_p):
8412 * category.h (CHAR_HAS_CATEGORY):
8413 Use bool for booleans, instead of int.
8414
391ceac5
EZ
84152012-08-25 Eli Zaretskii <eliz@gnu.org>
8416
8417 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8418
2f221583
PE
84192012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8420
f4a681b0
PE
8421 On assertion failure, print backtrace if available.
8422 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8423 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8424 * Makefile.in (LIB_EXECINFO): New macro.
8425 (LIBES): Use it.
8426
2f221583
PE
8427 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8428 * bytecode.c (exec_byte_code):
8429 * callint.c (check_mark, Fcall_interactively):
8430 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8431 (getenv_internal, sync_process_alive, call_process_exited):
8432 * lisp.h (USE_SAFE_ALLOCA):
8433 Use bool for booleans, instead of int.
8434 * lisp.h, process.h: Adjust prototypes to match above changes.
8435 * callint.c (Fcall_interactively): Don't assume the mark's
8436 offset fits in 'int'.
8437
37ef52bb
PE
84382012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8439
8440 * buffer.c, buffer.h: Use bool for boolean.
8441 * buffer.c (reset_buffer_local_variables)
8442 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8443 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8444 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8445 (overlay_touches_p, overlay_strings, Foverlay_put)
8446 (report_overlay_modification, call_overlay_mod_hooks):
8447 (mmap_enlarge, mmap_set_vars):
8448 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8449 Use bool for booleans, instead of int.
8450 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8451 since the 1-or-0 return value is always ignored anyway.
8452 (mmap_initialized_p):
8453 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8454 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8455
2cc21167
PE
84562012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8457
8458 * bidi.c: Use bool for boolean.
8459 This is a bit more readable, and makes the text segment of bidi.o
8460 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8461 Presumably it's faster too.
8462 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8463 Now bool.
8464 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8465 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8466 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8467 (bidi_explicit_dir_char, bidi_level_of_next_char)
8468 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8469 Use bool for booleans, instead of int.
8470 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8471 (bidi_unshelve_cache): Adjust decls to match code.
8472
7db4ddf4
MR
84732012-08-23 Martin Rudalics <rudalics@gmx.at>
8474
8475 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8476 argument.
8477
b1bb8011
PE
84782012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8479
8480 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8481 * atimer.h: Include <stdbool.h>.
8482
ff687885
DN
84832012-08-22 Dan Nicolaescu <dann@gnu.org>
8484
8485 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8486 compile time tests instead of run time tests on systems that do
8487 not use them.
8488 (FRAME_MAC_P): Remove leftover from deleted code.
8489 * frame.c (syms_of_frame): Remove leftover from deleted code.
8490
4ce7a138
JD
84912012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8492
8493 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8494
d733ec6d
PE
84952012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8496
8497 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8498 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 8499 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
8500 (fontset_add): Return void, for FONTSET_ADD.
8501
d0d2d26f
PE
85022012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8503
fce31d69
PE
8504 * alloc.c: Use bool for booleans.
8505 (gc_in_progress, abort_on_gc)
8506 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8507 (dont_register_blocks) [GC_MALLOC_CHECK]:
8508 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8509 (check_string_bytes, make_specified_string, memory_full)
8510 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8511 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8512 (mark_stack, valid_pointer_p, make_pure_string)
8513 (Fgarbage_collect, survives_gc_p, gc_sweep):
8514 Use bool for booleans, instead of int.
8515 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8516 Remove unused local.
8517 * alloc.c (PURE_POINTER_P):
8518 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8519 * editfns.c (Fformat):
8520 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8521 (Fdo_auto_save):
8522 * fns.c (sweep_weak_table):
8523 * lisp.h (suppress_checking, push_message, survives_gc_p)
8524 (make_pure_string, gc_in_progress, abort_on_gc):
8525 * lread.c (readchar, read1):
8526 * print.c (Fprin1_to_string):
8527 * xdisp.c (push_message):
8528 Use bool for booleans affected directly or indirectly by
8529 alloc.c's changes.
8530
d0d2d26f
PE
8531 Make recently-introduced setters macros.
8532 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8533 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8534 (set_fontset_default, set_fontset_fallback): Rename from their
8535 upper-case counterparts, and make them functions rather than macros.
8536 This is more consistent with the other recently-introduced setters.
8537 These don't need to be inline, since they're local.
8538
d18e2bb6
JD
85392012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8540
8541 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8542 the loop (Bug#12247).
8543
1b9d9d16
PE
85442012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8545
8546 * lisp.h (vcopy): Use memcpy rather than our own loop.
8547 This fixes a performance regression introduced by the recent
8548 addition of vcopy. This means 'vcopy' will need to be modified
8549 for a copying collector, but that's OK. Also, tighten the
8550 checking in the assertion.
8551
b2f09701
EZ
85522012-08-21 Eli Zaretskii <eliz@gnu.org>
8553
8554 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8555 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8556 non-base glyph for the width of the base character, according to
e1f29348
BR
8557 what x_draw_composite_glyph_string_foreground expects.
8558 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
8559 expectations, to produce correct width of the composed character.
8560 Reverse the sign of the DU offset produced by ScriptPlace.
8561
9b994fed
PE
85622012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8563
8564 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8565
086ca913
DA
85662012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8567
8568 Avoid direct writes to contents member of struct Lisp_Vector.
8569 * lisp.h (vcopy): New function to copy data into vector.
8570 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8571 * fns.c (Ffillarray): Use ASET.
8572 * keyboard.c (timer_check_2): Use AREF and ASET.
8573 (append_tool_bar_item, Frecent_keys): Use vcopy.
8574 * lread.c (read_vector): Use ASET.
8575 * msdos.c (Frecent_doskeys): Use vcopy.
8576 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8577 (Finternal_merge_in_global_face): Use ASET and vcopy.
8578 * xfont.c (xfont_list_pattern): Likewise.
8579
5481664a
MR
85802012-08-21 Martin Rudalics <rudalics@gmx.at>
8581
8582 * window.c (Fwindow_point): For the selected window always return
8583 the position of its buffer's point.
8584 (Fset_window_point): For the selected window always go in its
8585 buffer to the specified position.
8586
6d470bdd
DA
85872012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8588
8589 Setter macros for fontsets.
8590 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8591 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8592 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8593 Adjust users.
8594
24564fe1
GM
85952012-08-20 Glenn Morris <rgm@gnu.org>
8596
8597 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8598 Don't assume that `ln -f' works.
8599
0a05a035
EZ
86002012-08-20 Eli Zaretskii <eliz@gnu.org>
8601
8602 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8603 and later about non-assignments with no effect. See discussion at
8604 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8605 details.
8606
e46f2325
DA
86072012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8608
8609 Inline setter functions for Lisp_Objects slots of struct specbinding.
8610 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8611 Adjust users.
8612
734fbd86
MR
86132012-08-20 Martin Rudalics <rudalics@gmx.at>
8614
8615 * window.c (select_window): Always make selected window's buffer
8616 current.
8617
f1a95992
DA
86182012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8619
8620 Use AREF and ASET for docstrings of category tables.
8621 * category.h (CATEGORY_DOCSTRING): Use AREF.
8622 (SET_CATEGORY_DOCSTRING): Use ASET.
8623 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8624
e83064be
DA
86252012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8626
8627 Inline setter functions for hash table members.
8628 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8629 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8630 (set_hash_key_and_value, set_hash_index, set_hash_next)
8631 (set_hash_hash): New functions.
8632 * charset.c, fns.c: Adjust users.
8633
4ce60d2e
DA
86342012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8635
8636 Inline getter and setter functions for per-buffer values.
8637 * buffer.h (per_buffer_default, set_per_buffer_default)
8638 (per_buffer_value, set_per_buffer_value): New functions.
8639 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8640 * buffer.c, data.c: Adjust users.
8641
c06c9690
JB
86422012-08-20 Juanma Barranquero <lekktu@gmail.com>
8643
8644 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8645
32bd4250
PE
86462012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8647
bad03192 8648 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
8649 as gnulib does this if the system doesn't.
8650 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
8651 Remove declaration. MS-Windows declares it on stdlib.h which is
8652 included by conf_post.h.
b69a6d22
PE
8653 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8654 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8655 * vm-limit.c: Include <unistd.h>, for 'environ'.
8656
22d7feb2
PE
8657 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8658 (start_of_data): Remove decl; mem-limits.h provides it.
8659
32bd4250
PE
8660 * xdisp.c (handle_invisible_prop): Make it a bit faster
8661 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8662
450809af
CY
86632012-08-19 Chong Yidong <cyd@gnu.org>
8664
8665 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8666 ends (Bug#3874).
8667
9e677988
AS
86682012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8669
6b1319ce
AS
8670 * .gdbinit: Use call instead of set when calling a function in the
8671 inferior.
8672
9e677988
AS
8673 * data.c (set_internal): Don't use set_blv_found.
8674 (Fkill_local_variable): Likewise.
8675
d7191076
AA
86762012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8677
8678 * nsfont.m (ns_ascii_average_width): Ensure the string
8679 ascii_printable is initialized with a null-terminated character
8680 array. Otherwise, it can contain undesired extra characters.
8681
e757f1c6
PE
86822012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8683
8684 port new setting code to Sun C 5.8 2005/10/13
8685 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8686 Return void, not Lisp_Object. Otherwise, the compiler
8687 complains about (A?B:C) where B is void and C is Lisp_Object
8688 when compiling CHAR_TABLE_SET, due to the recent change to
8689 the API of sub_char_table_set_contents.
8690
a999ce26
CY
86912012-08-18 Chong Yidong <cyd@gnu.org>
8692
8693 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8694 for the string case (Bug#3874).
8695
3f22b86f
PE
86962012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8697
39eb03f1
PE
8698 * buffer.h (BSET): Remove (Bug#12215).
8699 Replace all uses with calls to new setter functions.
8700 (bset_bidi_paragraph_direction, bset_case_canon_table)
8701 (bset_case_eqv_table, bset_directory, bset_display_count)
8702 (bset_display_time, bset_downcase_table)
8703 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8704 (bset_last_selected_window, bset_local_var_alist)
8705 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8706 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8707 (bset_width_table):
8708 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8709 (bset_auto_fill_function, bset_auto_save_file_format)
8710 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8711 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8712 (bset_cache_long_line_scans, bset_case_fold_search)
8713 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8714 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8715 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8716 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8717 (bset_header_line_format, bset_indicate_buffer_boundaries)
8718 (bset_indicate_empty_lines, bset_invisibility_spec)
8719 (bset_left_fringe_width, bset_major_mode, bset_mark)
8720 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8721 (bset_name, bset_overwrite_mode, bset_pt_marker)
8722 (bset_right_fringe_width, bset_save_length)
8723 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8724 (bset_scroll_up_aggressively, bset_selective_display)
8725 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8726 (bset_word_wrap, bset_zv_marker):
8727 * category.c (bset_category_table):
8728 * syntax.c (bset_syntax_table):
8729 New setter functions.
8730
6a09a33b
PE
8731 * process.h (PSET): Remove (Bug#12215).
8732 Replace all uses with calls to new setter functions.
8733 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8734 (PROCESS_INLINE): New macro.
8735 (pset_childp): New setter function.
8736 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8737 * process.c (PROCESS_INLINE):
8738 Define to EXTERN_INLINE, so that the corresponding functions
8739 are compiled into code.
8740 (pset_buffer, pset_command, pset_decode_coding_system)
8741 (pset_decoding_buf, pset_encode_coding_system)
8742 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8743 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8744 (pset_type, pset_write_queue): New setter functions.
8745
e8c17b81
PE
8746 * window.h (WSET): Remove (Bug#12215).
8747 Replace all uses with calls to new setter functions.
8748 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8749 (WINDOW_INLINE): New macro.
8750 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8751 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8752 (wset_total_lines, wset_vertical_scroll_bar)
8753 (wset_window_end_pos, wset_window_end_valid)
8754 (wset_window_end_vpos): New setter functions.
8755 * window.c (WINDOW_INLINE):
8756 Define to EXTERN_INLINE, so that the corresponding functions
8757 are compiled into code.
8758 (wset_combination_limit, wset_dedicated, wset_display_table)
8759 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8760 (wset_new_normal, wset_new_total, wset_next_buffers)
8761 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8762 (wset_prev_buffers, wset_right_fringe_width)
8763 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8764 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8765 (wset_window_parameters):
8766 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8767 (wset_column_number_displayed, wset_region_showing):
8768 New setter functions.
8769
3f22b86f
PE
8770 * termhooks.h (TSET): Remove (Bug#12215).
8771 Replace all uses with calls to new setter functions.
8772 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8773 (TERMHOOKS_INLINE): New macro.
8774 (tset_charset_list, tset_selection_alist): New setter functions.
8775 * terminal.c (TERMHOOKS_INLINE):
8776 Define to EXTERN_INLINE, so that the corresponding functions
8777 are compiled into code.
8778 (tset_param_alist): New setter function.
8779
742af32f
PE
87802012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8781
15dbb4d6
PE
8782 * keyboard.h (KSET): Remove (Bug#12215).
8783 Replace all uses with calls to new setter functions.
8784 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8785 (KEYBOARD_INLINE): New macro.
8786 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8787 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8788 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8789 New setter functions.
8790 * keyboard.c (KEYBOARD_INLINE):
8791 Define to EXTERN_INLINE, so that the corresponding functions
8792 are compiled into code.
8793 (kset_echo_string, kset_kbd_queue)
8794 (kset_keyboard_translate_table, kset_last_prefix_arg)
8795 (kset_last_repeatable_command, kset_local_function_key_map)
8796 (kset_overriding_terminal_local_map, kset_real_last_command)
8797 (kset_system_key_syms): New setter functions.
8798
f00af5b1
PE
8799 * frame.h (FSET): Remove (Bug#12215).
8800 Replace all uses with calls to new setter functions.
8801 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8802 (FRAME_INLINE): New macro.
8803 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8804 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8805 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8806 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8807 (fset_param_alist, fset_root_window, fset_scroll_bars)
8808 (fset_selected_window, fset_title, fset_tool_bar_items)
8809 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8810 * frame.c (FRAME_INLINE):
8811 Define to EXTERN_INLINE, so that the corresponding functions
8812 are compiled into code.
8813 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8814
0c94c8d6
PE
8815 A few more naming-convention fixes for getters and setters.
8816 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8817 and rename from buffer_overlays_set_before.
8818 (set_buffer_overlays_after): Move here from buffer.h, and rename
8819 from buffer_overlays_set_after.
8820 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8821 All uses changed.
8822 (set_buffer_intervals): Rename from buffer_set_intervals.
8823 * intervals.c (set_interval_object): Move here from intervals.h,
8824 and rename from interval_set_object.
8825 (set_interval_left): Move here from intervals.h, and rename from
8826 interval_set_left.
8827 (set_interval_right): Move here from intervals.h, and rename from
8828 interval_set_right.
8829 (copy_interval_parent): Move here from intervals.h, and rename from
8830 interval_copy_parent.
8831 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8832 (set_interval_plist): Rename from interval_set_plist.
8833 Return void, not Lisp_Object, since no caller uses the result.
8834 * lisp.h (string_intervals): Rename from string_get_intervals.
8835 (set_string_intervals): Rename from string_set_intervals.
8836
34dabdb7
PE
8837 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8838 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 8839 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
8840 All uses changed. See the end of
8841 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8842
742af32f
PE
8843 * lisp.h (CSET): Remove (Bug#12215).
8844 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8845 (set_char_table_purpose): New functions,
8846 replacing CSET. All uses changed. For example, replace
8847 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 8848 "set_char_table_parent (char_table, parent);".
742af32f
PE
8849 The old version was confusing because it used the same name
8850 'parent' for two different things.
8851
a04e2c62
DA
88522012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8853
8854 Functions to get and set Lisp_Object fields of buffer-local variables.
8855 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8856 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8857 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8858 * data.c, eval.c, frame.c: Adjust users.
8859
383dcbf9
CY
88602012-08-17 Chong Yidong <cyd@gnu.org>
8861
8862 * xfaces.c (merge_face_vectors): If the target font specfies a
8863 font spec, make the font's attributes take precedence over
8864 directly-specified attributes.
8865 (merge_face_ref): Recognize :font.
8866
44386687
DA
88672012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8868
8869 Do not use memcpy for copying intervals.
8870 * intervals.c (reproduce_interval): New function.
8871 (reproduce_tree, reproduce_tree_obj): Use it.
8872 (reproduce_tree_obj): Remove prototype.
8873
927c7216
PE
88742012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8875
8876 * lisp.h (duration_to_sec_usec): Remove unused decl.
8877
93044f7b
AA
88782012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8879
8880 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8881 to an allocated instance of NSString, not to the class itself.
8882
9851e4a5
JB
88832012-08-17 Juanma Barranquero <lekktu@gmail.com>
8884
8885 * makefile.w32-in (C_CTYPE_H): New macro.
8886 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8887 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8888 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8889
620f13b0
PE
88902012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8891
8892 Use ASCII tests for character types.
8893 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8894 * xfns.c, xterm.c:
8895 Don't include <ctype.h>; was not needed.
8896 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8897 * sysdep.c, xfaces.c:
8898 Include <c-ctype.h> instead of <ctype.h>.
8899 * nsterm.m: Include <c-ctype.h>.
8900 * charset.c (read_hex):
8901 * doc.c (Fsnarf_documentation):
8902 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8903 (DRIVE_LETTER) [DOS_NT]:
8904 (Ffile_name_directory, Fexpand_file_name)
8905 (Fsubstitute_in_file_name):
8906 * font.c (font_parse_xlfd, font_parse_fcname):
8907 * frame.c (x_set_font_backend):
8908 * gtkutil.c (xg_get_font):
8909 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8910 * nsimage.m (hexchar):
8911 * nsterm.m (ns_xlfd_to_fontname):
8912 * sysdep.c (system_process_attributes):
8913 * xfaces.c (hash_string_case_insensitive):
8914 Use C-locale tests instead of locale-specific tests for character
8915 types, since we want the ASCII interpretation here, not the
8916 interpretation suitable for whatever happens to be the current locale.
8917
52162052
MR
89182012-08-16 Martin Rudalics <rudalics@gmx.at>
8919
8920 Consistently check windows for validity/liveness
8921 (Bug#11984, Bug#12025, Bug#12026).
8922 * lisp.h (CHECK_VALID_WINDOW): New macro.
8923 * window.c (decode_window): Rename to decode_live_window.
8924 (decode_valid_window, Fwindow_valid_p): New functions.
8925 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8926 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8927 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8928 (Fwindow_prev_sibling, Fwindow_combination_limit)
8929 (Fset_window_combination_limit, Fwindow_use_time)
8930 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8931 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8932 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8933 (Fwindow_hscroll, Fset_window_hscroll)
8934 (Fwindow_redisplay_end_trigger)
8935 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8936 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8937 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8938 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8939 (Fwindow_end, Fset_window_point, Fset_window_start)
8940 (Fpos_visible_in_window_p, Fwindow_line_height)
8941 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8942 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8943 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8944 (Fset_window_parameter, Fwindow_display_table)
8945 (Fset_window_display_table, Fdelete_other_windows_internal)
8946 (Fset_window_buffer, Fset_window_new_total)
8947 (Fset_window_new_normal, Fdelete_window_internal)
8948 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8949 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8950 (Fwindow_scroll_bars): Check whether argument window is a valid or
8951 live window. Update doc-strings.
8952 (syms_of_window): New symbol Qwindow_valid_p.
8953 * keyboard.c (Fposn_at_x_y): Check whether argument
8954 frame_or_window denotes a valid window.
8955
2751c80f
DA
89562012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8957
8958 Fix previous char table change.
8959 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8960 * chartab.c (optimize_sub_char_table): Likewise.
8961
032a42c8
CY
89622012-08-16 Chong Yidong <cyd@gnu.org>
8963
a2d19368
CY
8964 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8965
032a42c8
CY
8966 * xfont.c (xfont_open):
8967 * xftfont.c (xftfont_open): Set the font's max_width field.
8968
8969 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8970 min_width to space_width and average_width to the average over
8971 printable ASCII characters.
8972 (ns_char_width): Code cleanup.
8973 (ns_ascii_average_width): New utility function.
8974
8975 * font.h (struct font): Update comments.
8976
a098c930
DA
89772012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8978
032a42c8 8979 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8980 * lisp.h (CSET): New macro.
8981 (char_table_set_extras, char_table_set_contents)
8982 (sub_char_table_set_contents): New function.
8983 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8984 * syntax.c: Adjust users.
8985
8be3a09c
SM
89862012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8987
8988 * eval.c (eval_sub): Bind lexical-binding.
8989 * lread.c (Qlexical_binding): Make non-static.
8990
ac4845a6
JD
89912012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8992
ddee6515
JD
8993 * nsmenu.m (popupSession): Remove.
8994 (pop_down_menu): Remove endModalSession.
8995 (timeout_handler:): New method.
8996 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8997 Call runModalForWindow. Check timer_fired when it returns.
8998 If not set, cancel timer and break out of loop.
8999 Otherwise loop again, with a new timeout.
9000
9001 * nsterm.m: Include fcntl.h if present.
9002 (fd_entry, t_readfds, inNsSelect): Remove.
9003 (select_writefds, select_valid, select_timeout, selfds)
9004 (select_mutex, apploopnr): Add.
9005 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
9006 Otherwise call kbd_buffer_store_event.
9007 (ns_send_appdefined): Remove release of fd_entry.
9008 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
9009 Increment and decrement apploopnr.
9010 (ns_select): If no file descriptors, just do a NSTimer.
9011 Otherwise copy read/write masks and start select thread (fd_handler).
9012 Start main loop and wait for application defined event.
9013 Inform select thread to stop selecting after main loop is exited.
9014 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 9015 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
9016 (fd_handler:): Loop forever, wait for info from the main thread
9017 to either start or stop selecting. When select returns, send
9018 and appdefined event.
9019 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
9020 If not call kbd_buffer_store_event.
9021
9022 * nsterm.h (EmacsApp): fd_handler takes id argument.
9023 (EmacsDialogPanel): Add timer_fired and timeout_handler.
9024
ac4845a6
JD
9025 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
9026
eb424fe3
EZ
90272012-08-15 Eli Zaretskii <eliz@gnu.org>
9028
9029 * region-cache.c (move_cache_gap): Update gap_len using the actual
9030 growth of the boundaries array. Do not change cache_len.
9031 (Bug#12196)
9032
4e6a86c6
DA
90332012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9034
9035 Generalize and cleanup font subsystem checks.
9036 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
9037 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
9038 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 9039
5bf192ca
DA
90402012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
9041
9042 * gtkutil.c (xg_get_font): Use pango_units_to_double.
9043
f2045622
CY
90442012-08-15 Chong Yidong <cyd@gnu.org>
9045
8be3a09c
SM
9046 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
9047 When using the new font chooser, use gtk_font_chooser_get_font_desc to
9048 extract the font descriptor instead of just the font name.
9049 In that case, return a font spec instead of a string.
f2045622
CY
9050 (x_last_font_name): Move to this file from xfns.c.
9051
9052 * xfns.c (Fx_select_font): The return value can also be a font
9053 spec. Move x_last_font_name management to gtkutil.c.
9054
9055 * xfaces.c: Make font weight and style symbols non-static.
9056
7f6feb56
SM
90572012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
9058
9059 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
9060 (bug#12117).
9061
fecbd8ff
SM
90622012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
9063
9064 * alloc.c (Fgarbage_collect): Use plural form consistently.
9065
9b8d5165
EZ
90662012-08-14 Eli Zaretskii <eliz@gnu.org>
9067
9068 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
9069 iteration through the command loop. Fixes a problem whereby mouse
9070 movements are ignored until the first mouse click.
9071
f5d9e83a
PE
90722012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9073
9074 Use bool, not int, for Lisp booleans.
9075 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
9076 makes Emacs a bit smaller and presumably a bit faster.
9077 * lisp.h: Include <stdbool.h>.
9078 (struct Lisp_Boolfwd, defvar_bool):
9079 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
9080 * regex.c [!emacs]: Include <stdbool.h>.
9081 (false, true): Remove; <stdbool.h> does this for us now.
9082
55802e4a
CY
90832012-08-14 Chong Yidong <cyd@gnu.org>
9084
4abcdac8
CY
9085 * character.c (Fcharacterp): Doc fix (Bug#12076).
9086
9087 * data.c (Findirect_variable): Doc fix (Bug#11040).
9088
55802e4a
CY
9089 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
9090
9091 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 9092 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 9093
8e99d072
BR
90942012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
9095
9096 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
9097 (bug#12022).
9098
08908aca
MR
90992012-08-14 Martin Rudalics <rudalics@gmx.at>
9100
9101 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
9102 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
9103 * minibuf.c (choose_minibuf_frame, read_minibuf):
9104 * w32fns.c (x_create_tip_frame):
9105 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
9106 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
9107
56120d6f
PE
91082012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9109
9110 * intervals.c (offset_intervals): Remove obsolete comment.
9111
67b77c0b
AS
91122012-08-14 Andreas Schwab <schwab@linux-m68k.org>
9113
9114 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
9115
f48b82fd
GR
91162012-08-14 Gergely Risko <gergely@risko.hu>
9117
9118 * coding.c (decode_coding): Record buffer modification before
9119 disabling undo_list (Bug#11773).
9120
fd318b54
DA
91212012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9122
9123 Revert and cleanup some recent overlay changes.
9124 * buffer.h (enum overlay_type): Remove.
9125 (buffer_get_overlays, buffer_set_overlays): Likewise.
9126 (buffer_set_overlays_before, buffer_set_overlays_after):
9127 New function. Adjust users.
9128 (unchain_both): Add eassert.
9129
41a62dd9
DA
91302012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
9131
9132 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
9133
5884c324
PE
91342012-08-14 Paul Eggert <eggert@cs.ucla.edu>
9135
9136 * gtkutil.c (xg_mark_data): Don't assume C99.
9137
ca06f160
JD
91382012-08-13 Jan Djärv <jan.h.d@swipnet.se>
9139
9140 * gtkutil.c (xg_frame_tb_info): New struct.
9141 (TB_INFO_KEY): New define.
9142 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
9143 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
9144 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
9145 if not present.
9146 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 9147 is up to date. Otherwise store new data.
ca06f160
JD
9148 (free_frame_tool_bar): Free xg_frame_tb_info if present.
9149
7864a3f7
DA
91502012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9151
9152 Use KSET for write access to Lisp_Object members of struct kboard.
9153 * keyboard.h (KSET): New macro.
9154 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
9155 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
9156 * xterm.c: Adjust users.
9157
4c31be61
DA
91582012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
9159
9160 Use BSET for write access to Lisp_Object members of struct buffer.
9161 * buffer.h (BSET): New macro.
9162 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
9163 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
9164 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
9165 * window.c, xdisp.c, xfns.c: Adjust users.
9166
14ae4239
BT
91672012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
9168
9169 * lread.c (syms_of_lread): Initialize Vlexical_binding.
9170
32bcadb4
JD
91712012-08-11 Jan Djärv <jan.h.d@swipnet.se>
9172
3d29b2ce 9173 * nsterm.m (not_in_argv): New function.
fc0c31f8 9174 (application:openFile, application:openTempFile:):
3d29b2ce
JD
9175 (application:openFileWithoutUI:, application:openFiles:): Open file
9176 if not_in_argv returns non-zero (bug#12171).
9177
32bcadb4 9178 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
9179 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
9180 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
9181 (xg_get_font_name): Use those functions/macros here.
9182 Reported by Frans Oilinki <moilinki@gmail.com>.
9183
9ff9402d 91842012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
9185
9186 * unexmacosx.c (copy_data_segment): Copy initialized data in
9187 statically linked libraries from input file rather than memory.
9188
db74a5fc
YM
9189 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
9190 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
9191 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
9192
25e65510
GM
91932012-08-10 Glenn Morris <rgm@gnu.org>
9194
9195 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
9196 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
9197
7961135c
DA
91982012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9199
9200 Fix last change to allow compilation with low optimization levels.
9201 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
9202 Reported by Jan Djärv <jan.h.d@swipnet.se>.
9203
42b3a444
DA
92042012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9205
9206 Use common inline syntax in intervals.h.
9207 * intervals.h (INTERVALS_INLINE): New macro.
9208 Change all users from LISP_INLINE.
9209
9fb0c957
DA
92102012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9211
9212 Define Qnone once for all platforms.
9213 * frame.c (Qnone): Define here.
9214 (syms_of_frame): DEFSYM it.
9215 * lisp.h (Qnone): New declaration.
9216 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
9217 * xfns.c: Remove duplication. Adjust users.
9218
65e8ee52
DA
92192012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
9220
9221 Remove unused macros from intervals.h.
9222 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
9223 * intervals.c: Adjust comment.
9224
9b855fd6
EZ
92252012-08-10 Eli Zaretskii <eliz@gnu.org>
9226
9227 * w32fns.c <w32_unicode_gui>: New static variable.
9228 (globals_of_w32fns): Initialize it according to os_subtype.
9229 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
9230 testing os_subtype.
9231
39cb9e56 92322012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
9233 Eli Zaretskii <eliz@gnu.org>
9234
9235 Fix bug #10299 with Unicode characters sent by customized
9236 keyboards created by MSKLC.
9237 * w32fns.c (INIT_WINDOW_CLASS): New macro.
9238 (w32_init_class): Use it to initialize the Emacs class with either
9239 ANSI or Unicode API calls.
9240 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
9241 later.
9242 (w32_wnd_proc): If the character code sent by WM_CHAR or
9243 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
9244 original message. Call DefWindowProcW on NT and later.
9245
9374581a
GM
92462012-08-10 Glenn Morris <rgm@gnu.org>
9247
4b94e8cf
GM
9248 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
9249
9374581a
GM
9250 * lisp.h (DIRECTORY_SEP): Let configure set it.
9251
a2752828
DA
92522012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
9253
9254 Use TSET for write access to Lisp_Object slots of struct terminal.
9255 * termhooks.h (TSET): New macro.
9256 * coding.c, terminal.c, xselect.c: Adjust users.
9257
cc92c454
SM
92582012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
9259
9260 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
9261 the failing expression, include them in the error message.
9262 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
9263 * lisp.h (internal_condition_case_n): Update declaration.
9264
4cb3e6b3
DA
92652012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9266
9267 Inline functions to examine and change buffer overlays.
9268 * buffer.c (unchain_both): New function.
9269 * buffer.h (buffer_get_overlays, buffer_set_overlays):
9270 (buffer_has_overlays): New function.
9271 (enum overlay_type): New enum.
9272 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
9273 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
9274
8707c1e5
DA
92752012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9276
9277 Inline functions to examine and change buffer intervals.
9278 * alloc.c (mark_interval_tree): Remove.
9279 (MARK_INTERVAL_TREE): Simplify.
9280 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9281 * intervals.c (buffer_balance_intervals): New function.
9282 (graft_intervals_into_buffer): Adjust indentation.
9283 (set_intervals_multibyte): Simplify.
9284 * buffer.h (BUF_INTERVALS): Remove.
9285 (buffer_get_intervals, buffer_set_intervals): New function.
9286 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9287 * intervals.c, textprop.c: Adjust users.
9288
ad8c997f
DA
92892012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9290
9291 Inline functions to examine and change string intervals.
9292 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9293 (string_get_intervals, string_set_intervals): New function.
9294 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9295 * lread.c, print.c, textprop.c: Adjust users.
9296
32ac3a6b
GM
92972012-08-08 Glenn Morris <rgm@gnu.org>
9298
9299 * lisp.mk (lisp): Remove language/persian.elc.
9300
77c7bcb1
DA
93012012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9302
9303 Cleanup intervals.
9304 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9305 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
9306 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9307 Adjust comment. Move under #if 0.
77c7bcb1
DA
9308 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9309 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9310
9c08a8d4
DA
93112012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9312
9313 Check total length of intervals with eassert.
9314 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9315 * intervals.c: Change all users to eassert.
9316
26d16b35
EZ
93172012-08-07 Eli Zaretskii <eliz@gnu.org>
9318
14ae4239
BT
9319 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9320 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
9321 INTERNAL_FIELD in Lisp_Cons.
9322
c644523b
DA
93232012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9324
9325 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9326 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9327 name since all xname users are fixed long time ago. Do not
9328 use INTERNAL_FIELD.
9329 (set_symbol_name, set_symbol_function, set_symbol_plist):
9330 (set_symbol_next, set_overlay_plist): New function.
9331 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9332 (struct Lisp_Overlay): Likewise.
9333 (CVAR, MVAR, SVAR): Remove.
9334 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9335 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9336 * xterm.c: Adjust users.
9337 * .gdbinit: Change to use name field of struct Lisp_Symbol
9338 where appropriate.
9339
6a3d20cc
DA
93402012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9341
9342 Basic functions to set Lisp_Object and pointer slots of intervals.
9343 * intervals.h (interval_set_parent, interval_set_object):
9344 (interval_set_left, interval_set_right, interval_set_plist):
9345 (interval_copy_parent): New function.
9346 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
9347 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9348 Adjust indentation.
6a3d20cc
DA
9349 (INTERVAL_SIZE): Remove. Adjust users.
9350 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9351
4d2b044c
DA
93522012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9353
9354 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9355 * process.h (PGET): Remove.
9356 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9357 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9358
d3d50620
DA
93592012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9360
9361 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9362 * window.h (WGET): Remove.
9363 (struct window): Do not use INTERNAL_FIELD.
9364 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9365 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9366 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9367 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9368 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9369 Adjust users.
9370
d10a51dc
CY
93712012-08-07 Chong Yidong <cyd@gnu.org>
9372
9373 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9374 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9375 (Fdelete_window_internal): Signal an error if the window is not on
9376 a live frame (Bug#12025).
9377
e69b0960
DA
93782012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9379
9380 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9381 * frame.h (FGET): Remove.
9382 (struct frame): Do not use INTERNAL_FIELD.
9383 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9384 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9385 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9386 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9387
25a20a3a
JB
93882012-08-06 Juanma Barranquero <lekktu@gmail.com>
9389
9390 * w32.c: Silence compiler warnings.
9391 (map_w32_filename): Remove unused variable `is_fat'.
9392 (chase_symlinks): Add parentheses around expression.
9393
1c6f11f4
GM
93942012-08-06 Glenn Morris <rgm@gnu.org>
9395
1db4583a
GM
9396 * sysdep.c: Respect BROKEN_GETWD.
9397
1c6f11f4
GM
9398 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9399 Let configure handle it.
9400 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9401
2b90362b
DA
94022012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9403
9404 Use GCALIGNMENT where appropriate.
9405 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9406 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9407 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9408
5f50daf2
EZ
94092012-08-06 Eli Zaretskii <eliz@gnu.org>
9410
14ae4239
BT
9411 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9412 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 9413
cbcc7007
SM
94142012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9415
9416 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9417 that should be sufficient for everyone.
9418
4d365fa4
JD
94192012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9420
9421 * keyboard.c (timer_check_2): Add break so timer_check returns next
9422 timeout.
9423
dd86bd82
DA
94242012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9425
9426 Fix Windows build errors introduced after converting to WGET and WSET.
9427 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9428 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9429
054e1668
JD
94302012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9431
9432 * nsterm.m (ns_frame_rehighlight): Use FSET.
9433
9434 * nsmenu.m (ns_update_menubar): Use FSET.
9435
21238f11
DA
94362012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9437
9438 Separate read and write access to Lisp_Object slots of Lisp_Process.
9439 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9440 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9441
077288cf
DA
94422012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9443
9444 Separate read and write access to Lisp_Object slots of struct window.
9445 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9446 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9447 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9448 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9449 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9450 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9451 Adjust users.
9452
71688bd7
DA
94532012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9454
9455 Fix Windows build errors introduced after converting to FGET and FSET.
9456 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9457 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9458 (w32_judge_scroll_bars): Change to use FSET.
9459 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9460
f99bac93
DA
94612012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9462
9463 Fix replacement typo.
9464 * window.c (replace_window): Set root_window instead of
9465 selected_window. This fixes a total window subsystem
9466 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9467
8c2a0f2d
GM
94682012-08-06 Glenn Morris <rgm@gnu.org>
9469
9470 * lisp.mk (lisp): Add language/persian.elc.
9471
edd74c35
DA
94722012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9473
9474 Separate read and write access to Lisp_Object slots of struct frame.
9475 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9476 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9477 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9478 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9479 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9480
8671676c
AS
94812012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9482
9483 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9484
663e2b3f
DA
94852012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9486
9487 Generalize common compile-time constants.
9488 * lisp.h (header_size, bool_header_size, word_size): Now here.
9489 (struct Lisp_Vector): Add comment.
9490 (struct Lisp_Bool_Vector): Move up to define handy constants.
9491 (VECSIZE, PSEUDOVECSIZE): Simplify.
9492 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9493 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9494 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9495 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9496 * xfont.c, xmenu.c: Use word_size where appropriate.
9497
d32e47af
LM
94982012-08-05 Lawrence Mitchell <wence@gmx.li>
9499
9500 * search.c (Freplace_match): Treat \? in the replacement text
9501 literally (Bug#8161).
9502
e5d9c0d1
CY
95032012-08-05 Chong Yidong <cyd@gnu.org>
9504
9505 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9506 * frame.c (Vdelete_frame_functions):
9507 * emacs.c (Vkill_emacs_hook): Doc fix.
9508
8da0576b
EZ
95092012-08-04 Eli Zaretskii <eliz@gnu.org>
9510
9511 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9512 --with-x-toolkit=no builds.
9513 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9514
02676e5d
CY
95152012-08-04 Chong Yidong <cyd@gnu.org>
9516
9517 * syntax.c (Fmodify_syntax_entry): Doc fix.
9518
97147da9
EZ
95192012-08-04 Eli Zaretskii <eliz@gnu.org>
9520
76151e2c
EZ
9521 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9522 * w32.c (init_environment): Change the default values of many
9523 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
9524 them into environment when they were not already defined.
9525 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 9526 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
9527 (check_windows_init_file): Now external, not static.
9528 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
9529 called when Vload_path is already set up.
9530
9531 * w32.h (check_windows_init_file): Add prototype.
9532
9533 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9534 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9535 compatibility with Posix platforms.
9536 (main): Move the call to check_windows_init_file to here from
9537 w32.c.
9538 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9539 any, in the DEFALT argument into the root of the Emacs build or
9540 installation tree, as appropriate.
9541
9542 * callproc.c (init_callproc_1): Call decode_env_path instead of
9543 doing its equivalent by hand.
9544 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9545 the code that sets Vexec_path run on MS-Windows.
9546
9547 * lread.c (init_lread): Add comments to #ifdef's.
9548
97147da9
EZ
9549 * msdos.c (dos_set_window_size, IT_update_begin)
9550 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9551 instead of direct references.
9552
185ee146
PE
95532012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9554
9555 Export DEFAULT_REHASH_* to GDB.
9556 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9557 Now constants, not macros.
9558
8834c57a
PE
95592012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9560
98c6f1e3
PE
9561 Remove unnecessary casts involving pointers.
9562 These casts are no longer needed now that we assume C89 or later,
9563 since they involve casting to or from void *.
9564 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9565 (make_pure_float, make_pure_vector):
9566 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9567 * macros.c (Fstart_kbd_macro):
9568 * menu.c (find_and_return_menu_selection):
9569 * minibuf.c (read_minibuf_noninteractive):
9570 * sysdep.c (closedir):
9571 * xdisp.c (x_produce_glyphs):
9572 * xfaces.c (compare_fonts_by_sort_order):
9573 * xfns.c (x_real_positions, select_visual):
9574 * xselect.c (x_stop_queuing_selection_requests)
9575 (x_get_window_property, x_get_window_property_as_lisp_data):
9576 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9577 Remove unnecessary pointer casts.
9578 * alloc.c (record_xmalloc): New function.
9579 * lisp.h (record_xmalloc): New decl.
9580 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9581 more like a function. This is because the pointer cast is not
9582 needed. All uses changed.
9583 * print.c (print_string, print_error_message): Avoid length recalc.
9584
8834c57a
PE
9585 Improve fix for macroexp crash with debugging (Bug#12118).
9586 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9587 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9588 not supposed to be invoked from the garbage collector.
9589 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9590 (gc_aset): New function, which is like ASET but can be
9591 used in the garbage collector.
9592 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9593 (set_hash_index): Use it instead of ASET.
9594
6dad7178
EZ
95952012-08-03 Eli Zaretskii <eliz@gnu.org>
9596
9597 Support symlinks on latest versions of MS-Windows.
9598 * w32.c: Include winioctl.h and aclapi.h.
9599 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9600 (revert_to_self): Forward declarations of static functions.
9601 <static BOOL g_b_init_get_security_info>:
9602 <g_b_init_create_symbolic_link>: New static flags.
9603 (globals_of_w32): Initialize them to zero.
9604 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9605 (map_w32_filename): Improve commentary. Simplify switch.
9606 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9607 headers (most versions of MinGW w32api don't).
9608 (get_security_info, create_symbolic_link)
9609 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9610 New functions.
9611 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9612 in the argument file name.
9613 (sys_access): Call unc_volume_file_attributes only if
9614 GetFileAttributes fails with network-related error codes.
9615 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9616 have the required privileges.
14ae4239 9617 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
9618 get_file_security_desc.
9619 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
9620 with addition of handling of symlinks and support for 'lstat'.
9621 If possible, get file's attributes and security information by
6dad7178
EZ
9622 handle, not by name. Produce S_IFLNK bit for symlinks, when
9623 called from 'lstat'.
9624 (stat, lstat): New functions, call 'stat_worker'.
9625 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9626 symlinks when the underlying filesystem supports them.
9627
f162bcc3
PE
96282012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9629
79ea6c20
PE
9630 Fix macroexp crash on Windows with debugging (Bug#12118).
9631 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9632 checking subscripts; problem introduced with the recent
9633 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9634 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9635 since it's used in non-static inline functions now.
9636
c0ce93fd
PE
9637 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9638 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 9639
f162bcc3
PE
9640 Use C99-style 'extern inline' if available.
9641 * buffer.h (BUFFER_INLINE):
9642 * category.h (CATEGORY_INLINE):
9643 * character.h (CHARACTER_INLINE):
9644 * charset.h (CHARSET_INLINE):
9645 * composite.h (COMPOSITE_INLINE):
9646 * dispextern.h (DISPEXTERN_INLINE):
9647 * lisp.h (LISP_INLINE):
9648 * systime.h (SYSTIME_INLINE):
9649 New macro, replacing 'static inline' in this header.
9650 * buffer.h, category.h, character.h, charset.h, composite.h:
9651 * dispextern.h, lisp.h, systime.h:
9652 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9653 * alloc.c (LISP_INLINE):
9654 * buffer.c (BUFFER_INLINE):
9655 * category.c (CATEGORY_INLINE):
9656 * character.c (CHARACTER_INLINE):
9657 * charset.c (CHARSET_INLINE):
9658 * composite.c (COMPOSITE_INLINE):
9659 * dispnew.c (DISPEXTERN_INLINE):
9660 * sysdep.c (SYSTIME_INLINE):
9661 Define to EXTERN_INLINE, so that the corresponding functions
9662 are compiled into code.
9663 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9664 (INLINE_HEADER_END): New macros.
9665 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9666 since it's used in non-static inline functions now.
a8333d03 9667 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 9668
837b365b
GM
96692012-08-02 Glenn Morris <rgm@gnu.org>
9670
d66b744d
GM
9671 * s/: Remove empty directory.
9672
837b365b
GM
9673 * s/ms-w32.h: Move to ../nt/inc.
9674 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9675 Update for new ms-w32.h location.
9676
13294f95
PE
96772012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9678
9679 Port to Solaris 8.
9680 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9681
90df0db3
GM
96822012-08-02 Glenn Morris <rgm@gnu.org>
9683
9684 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9685 hard-coding the path separator.
9686
4939150c
PE
96872012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9688
9689 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9690 This how ASET and AREF are supposed to work, and makes
9691 it easier to think about future improvements. See
9692 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9693 * charset.h (set_charset_attr): New function.
9694 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9695 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9696 (aref_addr): New function. All uses of &AREF(...) changed.
9697 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9698 (set_hash_index): New functions. All lvalue-style uses of
9699 HASH_KEY etc. changed.
9700 * keyboard.c (set_prop): New function. All lvalue-style uses
9701 of PROP changed.
9702
947b2afd
AA
97032012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9704
9705 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9706 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 9707 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
9708 * nsfns.m (ns_set_name_as_filename): Likewise.
9709 * nsmenu.m (ns_update_menubar): Likewise.
9710 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9711
4f5d0325
EZ
97122012-08-01 Eli Zaretskii <eliz@gnu.org>
9713
2008beae
EZ
9714 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9715 Adapt to latest changes in field names of the corresponding Lisp
288479f6 9716 objects.
2008beae 9717
4f5d0325
EZ
9718 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9719
fe3cc771
GM
97202012-08-01 Glenn Morris <rgm@gnu.org>
9721
9722 * s/msdos.h: Remove file.
9723 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9724 * Makefile.in (S_FILE): Remove.
9725 (config_h): Remove S_FILE.
9726
c90acc54
JB
97272012-08-01 Juanma Barranquero <lekktu@gmail.com>
9728
9729 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9730 Remove; moved to nt/config.nt.
9731
d8a05828
DA
97322012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9733
9734 Use INTERNAL_FIELD for conses and overlays.
9735 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9736 Remove obsolete comment.
9737 (MVAR): New macro.
9738 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9739 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9740
8271d590
DA
97412012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9742
9743 Use INTERNAL_FIELD for symbols.
9744 * lisp.h (SVAR): New macro. Adjust users.
9745 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9746 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9747
3193acd2
DA
97482012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9749
9750 Use INTERNAL_FIELD for processes.
9751 * process.h (PVAR): New macro. Adjust style.
9752 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9753 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9754
3a45383a
DA
97552012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9756
9757 Use INTERNAL_FIELD for windows.
9758 * window.h (WVAR): New macro.
9759 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9760 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9761 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9762 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9763 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9764 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9765
c1dbc63c
PE
97662012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9767
9768 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9769
5c0c0e8a
GM
97702012-08-01 Glenn Morris <rgm@gnu.org>
9771
9772 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9773 Move to configure.ac.
9774
552a99b4
JB
97752012-08-01 Juanma Barranquero <lekktu@gmail.com>
9776
9777 * makefile.w32-in (CONFIG_H): Update dependencies.
9778 (CONF_POST_H): New macro.
9779
9780 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9781
8d8e2dfe
GM
97822012-07-31 Glenn Morris <rgm@gnu.org>
9783
bc96620a
GM
9784 * Makefile.in (S_FILE): No longer set by configure.
9785
476b1b2d
GM
9786 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9787 is available.
9788 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9789
b2c7a106
GM
9790 * process.h (NULL_DEVICE):
9791 * emacs.c (SEPCHAR):
9792 * editfns.c (USER_FULL_NAME): Let configure set them.
9793
d53d062a
GM
9794 * s/README, s/template.h: Remove files.
9795
4515017f
GM
9796 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9797
8d8e2dfe
GM
9798 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9799 Move to configure.ac.
9800
5b20b3cc
EZ
98012012-07-31 Eli Zaretskii <eliz@gnu.org>
9802
1e0afd9a
EZ
9803 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9804 resulting renaming of 'struct frame' members.
9805
5b20b3cc
EZ
9806 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9807
9808 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9809 after introduction of FVAR.
9810
f1310128
JD
98112012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9812
79e721e0
JD
9813 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9814
9815 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9816 instead of compositeToPoint.
9817 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9818
8d7c7eed 9819 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 9820
e34f7f79
DA
98212012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9822
9823 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9824 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 9825 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
9826 (BVAR): Change to use INTERNAL_FIELD.
9827 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9828 (KVAR): Change to use INTERNAL_FIELD.
9829 * frame.h (FVAR): New macro.
9830 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
9831 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9832 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9833 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
9834 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9835
c09bfb2f
DA
98362012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9837
9838 Miscellaneous fixes for non-default X toolkits.
9839 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9840 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9841 Move under #ifdef USE_LUCID.
9842 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9843 definition and usage to avoid warnings.
9844
14c114ae
JD
98452012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9846
9847 * nsterm.m (openFiles): Fix previous checkin.
9848
3bd21e82
PE
98492012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9850
9851 * indent.c (compute_motion): Remove unused local.
9852
c1529ded
GM
98532012-07-31 Glenn Morris <rgm@gnu.org>
9854
400d5621
GM
9855 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9856
268e2432
GM
9857 * conf_post.h [USG5_4]:
9858 Move remaining contents of s/usg5-4-common.h here.
9859 * s/usg5-4-common.h: Remove file.
9860
7552f3ee
GM
9861 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9862 * s/irix6-5.h: Remove file.
9863
6a381852
GM
9864 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9865 * s/darwin.h: Remove file.
9866
c1529ded
GM
9867 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9868 * s/hpux10-20.h: Remove file, which is now empty.
9869
b429a4ee
GM
98702012-07-30 Glenn Morris <rgm@gnu.org>
9871
9872 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9873 * Makefile.in (config_h): Add conf_post.h.
9874 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9875
adff3182
JD
98762012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9877
9878 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9879 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9880 (openFile, openTempFile, openFileWithoutUI, openFiles):
9881 Open files only if ns_do_open_file.
adff3182 9882
c32af1e4
PE
98832012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9884
7393bcbb
PE
9885 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9886 This no-op macro hasn't been needed for many years.
9887 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9888
c32af1e4
PE
9889 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9890 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9891 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9892 gdb_make_enums_visible.
9893 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9894 (DIRECTORY_SEP): Now a constant, not a macro.
9895
302fc036
EZ
98962012-07-30 Eli Zaretskii <eliz@gnu.org>
9897
9898 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9899 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9900
9901 * w32term.c <w32_keyboard_codepage>: Renamed from
9902 keyboard_codepage and now external. All users changed.
9903
9904 * w32term.h: Add declaration of w32_keyboard_codepage.
9905
9906 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9907 the codepage to translate keys to Unicode. If this argument is
9908 -1, use the value returned by GetConsoleCP. All callers changed.
9909
88fb40b4
PE
99102012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9911
0aee6912
PE
9912 Update .PHONY listings in makefiles.
9913 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9914 bootstrap-clean, distclean, maintainer-clean, versioclean,
9915 extraclean, frc.
9916
88fb40b4
PE
9917 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9918 This is a bit clearer. Fix some commentary typos.
9919
0a763bd1
GM
99202012-07-30 Glenn Morris <rgm@gnu.org>
9921
32bac6d6
GM
9922 * s/netbsd.h: Let configure include signal.h if needed.
9923 Remove file, which is now empty.
9924
b65e7c46
GM
9925 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9926 Let configure set them.
9927 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9928 No more need to undefine.
0a763bd1 9929
169304bd
AS
99302012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9931
9932 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9933 non-single-byte char when adding meta modifier. (Bug#12090)
9934
6cd7a139
DA
99352012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9936
9937 Convert safe_call to use variable number of arguments.
9938 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9939 (safe_call2): Fix comment.
9940 * lisp.h (safe_call): Adjust prototype.
9941 * coding.c (encode_coding_object): Change to use safe_call2.
9942 * xfaces.c (merge_face_heights): Change to use safe_call1.
9943
d34d6ffc
GM
99442012-07-30 Glenn Morris <rgm@gnu.org>
9945
7b8a48e4 9946 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9947 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9948
d34d6ffc
GM
9949 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9950 Remove empty files.
9951
03a660a6
PE
99522012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9953
9954 Export to GDB most of lisp.h's remaining object-like macros.
9955 * lisp.h (min, max): Move earlier, because they're used earlier now.
9956 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9957 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9958 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9959 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9960 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9961 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9962 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9963 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9964 Now constants, for GDB. They need not be macros.
9965 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9966 Now constants, for GDB, as well as macros, for static initializers.
9967 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9968 Move to after the definition of struct Lisp_Char_Table,
9969 since the former now needs that type defined.
9970 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9971 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9972 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9973 New enums, for gdb_make_enums_visible.
9974 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9975 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9976 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9977 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9978 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9979 enum maxargs, enum MAX_ALLOCA.
9980 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9981 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9982 no longer needed, now that they are done in lisp.h.
9983
e499d0ee
DA
99842012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9985
9986 Cleanup string bytes checking.
9987 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9988 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9989 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9990 (check_sblock, compact_small_strings): Simplify.
9991
d5040d2d
PE
99922012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9993
9994 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9995 These macros are confusing and no longer need to be defined, as
9996 the enum values now suffice. All uses replaced with definiens.
9997 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9998
7f259ae6
JB
99992012-07-29 Juanma Barranquero <lekktu@gmail.com>
10000
10001 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
10002 ($(BLD)/w32console.$(O)): Update dependencies.
10003
7e63e0c3
DA
100042012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10005
10006 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
10007 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
10008 time. Adjust users.
10009 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
10010
ffd817eb
JD
100112012-07-29 Jan Djärv <jan.h.d@swipnet.se>
10012
10013 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
10014 setting sitelisp (Bug#12010).
10015
417a7a0e
EZ
100162012-07-29 Eli Zaretskii <eliz@gnu.org>
10017
14ae4239 10018 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
10019
10020 * w32heap.c (cache_system_info):
10021 * w32.c (sys_rename):
10022 * w32proc.c (find_child_console, sys_kill): All users changed.
10023
387d4d92
PE
100242012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10025
10026 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
10027
55a6cca6
EZ
100282012-07-29 Eli Zaretskii <eliz@gnu.org>
10029
10030 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
10031
dbcf001c
DA
100322012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10033
10034 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
10035 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
10036 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 10037
e2688e4a
DA
100382012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
10039
10040 Generalize marker debugging code under MARKER_DEBUG and use eassert.
10041 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
10042 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
10043 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
10044 (replace_range, replace_range_2, del_range_2): Change to eassert.
10045 * marker.c (byte_char_debug_check): Adjust style.
10046
b46a6a83
PE
100472012-07-29 Paul Eggert <eggert@cs.ucla.edu>
10048
10049 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
10050 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
10051 long-ago-commented-out code that talks about "WIN32".
10052 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
10053 All uses changed.
10054
e32a5799
PE
100552012-07-28 Paul Eggert <eggert@cs.ucla.edu>
10056
10057 Use Gnulib stdalign module (Bug#9772, Bug#9960).
10058 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
10059 Simplify by using alignof.
10060 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
10061 * lisp.h: Include <stdalign.h>.
10062 (GCALIGNMENT): New macro and constant.
10063 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
10064 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
10065 (stdalign): New macro, if not already defined.
10066
df81cd29
EZ
100672012-07-28 Eli Zaretskii <eliz@gnu.org>
10068
01bd1b0d
EZ
10069 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
10070 * w32inevt.c: Include w32inevt.h.
10071 (w32_read_console_input): New inline function, calls either
10072 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
10073 w32_console_unicode_input.
10074 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
10075 (w32_kbd_patch_key, key_event): Use the codepage returned by
10076 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
10077 (key_event): use uChar.UnicodeChar only if
10078 w32_console_unicode_input is non-zero.
10079
10080 * w32console.c: Include w32heap.h.
10081 <w32_console_unicode_input>: New global variable.
10082 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
10083 family of Windows, zero otherwise.
10084
10085 * w32inevt.h: Declare w32_console_unicode_input.
10086
df81cd29
EZ
10087 * xdisp.c (init_iterator): Don't reference tip_frame in a build
10088 --without-x. (Bug#11742)
10089
c20fdd9e
PE
100902012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10091
10092 Adjust GDB to reflect pvec_type changes (Bug#12036).
10093 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
10094 2012-07-04 changes to pseudovector representation.
10095 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 10096
32770973 100972012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
10098
10099 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
10100 bus address.
10101 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
10102
3438fe21
EZ
101032012-07-27 Eli Zaretskii <eliz@gnu.org>
10104
bcfbc9de
EZ
10105 * alloc.c (listn): Fix the order the arguments are consed onto the
10106 list.
10107
3438fe21
EZ
10108 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
10109 enumeration constants, as PURE and HEAP are too general, and clash
10110 with other headers and sources, such as gmalloc.c and the
10111 MS-Windows system headers. All users changed.
10112
eeaea515
DA
101132012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10114
10115 Revert last save_excursion_save and save_excursion_restore changes.
10116 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
10117 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
10118
073c88c2
DA
101192012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10120
10121 Fix recently-introduced typos in Windows port.
10122 Reported by Martin Rudalics <rudalics@gmx.at>.
10123 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 10124 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 10125
4706125e
PE
101262012-07-27 Paul Eggert <eggert@cs.ucla.edu>
10127
10128 Improve GDB symbol export (Bug#12036).
10129 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
10130 arms of an 'if', not using conditional expressions; otherwise GDB
10131 complains about the types in the unevaluated arm when the argument
10132 is an integer literal.
10133 (xgetint): Simplify expression.
10134 * alloc.c (gdb_make_enums_visible): New constant. This ports to
10135 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
10136 Zaretskii in <http://bugs.gnu.org/12036#13>.
10137 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
10138 needed now that we have gdb_make_enums_visible.
10139 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
10140 (enum enum_USE_LSB_TAG):
10141 New enum types, packaging up enums that need to be exported to GDB.
10142
694b6c97
DA
101432012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10144
10145 Utility function to make a list from specified amount of objects.
10146 * lisp.h (enum constype): New datatype.
10147 (listn): New prototype.
10148 * alloc.c (listn): New function.
10149 (Fmemory_use_count, syms_of_alloc): Use it.
10150 * buffer.c (syms_of_buffer): Likewise.
10151 * callint.c (syms_of_callint): Likewise.
10152 * charset.c (define_charset_internal): Likewise.
10153 * coding.c (syms_of_coding): Likewise.
10154 * keymap.c (syms_of_keymap): Likewise.
10155 * search.c (syms_of_search): Likewise.
10156 * syntax.c (syms_of_syntax): Likewise.
10157 * w32.c (init_environment): Likewise.
10158 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
10159 * xdisp.c (syms_of_xdisp): Likewise.
10160 * xfns.c (syms_of_xfns): Likewise.
10161
6195f384
DA
101622012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
10163
10164 Fast save_excursion_save and save_excursion_restore.
10165 * lisp.h (struct Lisp_Excursion): New data type.
10166 (PVEC_EXCURSION): New pseudovector type.
10167 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
10168 to deal with it. Adjust comments.
10169 (init_marker, attach_marker): New prototype.
10170 (unchain_marker): Adjust prototype.
10171 * marker.c (attach_marker): Change to global.
10172 (init_marker): New function.
10173 * alloc.c (Fmake_marker, build_marker): Use it.
10174 (build_marker): More easserts.
10175 (mark_object): Handle struct Lisp_Excursion.
10176 * editfns.c (save_excursion_save, save_excursion_restore):
10177 Reimplement to use struct Lisp_Excursion. Add comments.
10178
5eceb8fb
PE
101792012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10180
10181 Fix export of symbols to GDB (Bug#12036).
10182 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
10183 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
10184 emacs.c, as this is a more-suitable home. Had this been done earlier
10185 the fix for 12036 would have avoided some of the problems noted in
10186 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
10187 would have been more obvious.
562157c8
PE
10188 * emacs.c: Do not include <verify.h>; no longer needed.
10189 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
10190 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
10191 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10192 Remove; now done in lisp.h.
10193 * lisp.h (PUBLISH_TO_GDB): New macro.
10194 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
10195 (DATA_SEG_BITS): Use it.
10196 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
10197 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
10198 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
10199 not be usable in #if. This simplifies things.
10200
d6749401
JB
102012012-07-26 Juanma Barranquero <lekktu@gmail.com>
10202
10203 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
10204
1781b9e9
PE
102052012-07-26 Paul Eggert <eggert@cs.ucla.edu>
10206
d89518db 10207 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
10208 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
10209 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
10210 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
10211 Adjust to changes in lisp.h and emacs.c, by using
10212 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
10213 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
10214 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
10215 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
10216 instead of gdb_valbits.
10217 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
10218 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
10219 instead of gdb_array_mark_flag.
10220 (xboolvector): Get size from $->size, not $->header.size.
10221 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
10222 (xreload, hook-run, hookpost-run): Remove.
10223 * emacs.c: Include <verify.h>.
10224 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
10225 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
10226 Remove.
10227 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
10228 (gdb_USE_LSB_TAG): New enum constants.
10229 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
10230 Also define these as enum constants, so they're visible to GDB.
10231 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
10232 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
10233 as constants, so they're visible to GDB.
10234 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
10235 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
10236 Now enum constants, not macros, so they're visible to GDB.
10237 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
10238 more convenient now. All uses changed.
10239 (VALMASK) [USE_LSB_TAG]: Also define in this case.
10240 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
10241
3628596a
DA
102422012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
10243
10244 Explicitly free restriction data that are not needed anymore.
10245 * editfns.c (save_restriction_restore): Free restriction data.
10246
7abaf5cc
SM
102472012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
10248
10249 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
10250 add argument, tune behavior, and adjust all callers.
10251
71f88e00
PE
102522012-07-25 Paul Eggert <eggert@cs.ucla.edu>
10253
10254 Use typedef for EMACS_INT, EMACS_UINT.
10255 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
10256 than macros. This simplifies debugging in the usual case, since
10257 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
10258 and it allows expressions involving EMACS_INT casts.
10259 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
10260
57ec3034
JD
102612012-07-25 Jan Djärv <jan.h.d@swipnet.se>
10262
10263 * nsterm.m (ns_read_socket): Return early if there is a modal
10264 window (Bug#12043).
10265
8137e7b3
MR
102662012-07-25 Martin Rudalics <rudalics@gmx.at>
10267
10268 * frame.c (Fredirect_frame_focus): In doc-string don't mention
10269 that FOCUS-FRAME can be omitted.
10270
04e9897c
DA
102712012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
10272
10273 Adjust buffer text indirection counters at the end of Fkill_buffer.
10274 * buffer.c (Fkill_buffer): Adjust indirection counters when the
10275 buffer is definitely dead. This should really fix an issue reported
10276 by Christoph Scholtes again. (Bug#12007).
10277 (init_buffer_once): Initialize indirection counters of
10278 buffer_defaults and buffer_local_symbols (for sanity and safety).
10279
8a0484e1
EZ
102802012-07-24 Eli Zaretskii <eliz@gnu.org>
10281
10282 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10283 and continuation glyphs on tooltip frames, leave them at zero.
10284 Avoids continued lines in tooltips. (Bug#11832)
10285
fa691a83
DA
102862012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10287
10288 Simplify copy_overlay.
04e9897c 10289 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
10290 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10291
436bc8e0
EZ
102922012-07-23 Eli Zaretskii <eliz@gnu.org>
10293
10294 * print.c (print_object): Don't crash when a frame's name is nil
10295 or invalid. (Bug#12025)
10296
10297 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10298 it signals an error when a tooltip frame is being created.
10299
d7a7fda3
DA
103002012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10301
10302 Cleanup miscellaneous objects allocation and initialization.
10303 * alloc.c (allocate_misc): Change to static. Add argument to
10304 specify the subtype. Adjust comment and users.
10305 (build_overlay): New function.
10306 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10307 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10308 (allocate_misc): Remove prototype.
10309 (build_overlay): Add prototype.
10310
103112012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
10312
10313 Swap buffer text indirection counters in Fbuffer_swap_text.
10314 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10315 This avoids crash reported by Christoph Scholtes at
10316 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10317
9d7fa573
JD
103182012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10319
10320 * nsmenu.m (Popdown_data): New struct.
10321 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10322 free Popdown_data.
10323 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10324 (initWithContentRect): Make imgView and contentView non-static
10325 and autorelease them. Also autorelease img and matrix (Bug#12005).
10326 (dealloc): Remove (Bug#12005).
10327
0dd6d66d
DA
103282012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10329
10330 Adjust consing_since_gc when objects are explicitly freed.
10331 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10332 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10333 (free_cons, free_misc): Subtract object size from consing_since_gc.
10334
d36d71df
DA
103352012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10336
10337 Simplify and cleanup markers positioning code.
10338 * marker.c (attach_marker): More useful eassert.
10339 (live_buffer, set_marker_internal): New function.
10340 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10341 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10342
fb9ea40f
PE
103432012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10344
10345 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10346 as it's limited by the amount of memory, not by INT_MAX.
10347
2d5c5f7d
EZ
103482012-07-21 Eli Zaretskii <eliz@gnu.org>
10349
07fb592e
EZ
10350 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10351 in special-event-map. See the discussion at
10352 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10353 for the reasons.
10354
37a9eac8 10355 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
10356 info.dwItemData. Fixes crashes on 64-bit Windows.
10357 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 10358
c4328746
JD
103592012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10360
fc0c31f8 10361 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 10362 (conversationIdentifier): Return value is NSInteger.
784051c4 10363 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 10364
6e5d1c12
CY
103652012-07-21 Chong Yidong <cyd@gnu.org>
10366
10367 * window.c (decode_any_window): Signal an error if the window is
10368 on a dead frame (Bug#11984).
10369
9928463d
DA
103702012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10371
10372 Add indirection counting to speed up Fkill_buffer.
10373 * buffer.h (struct buffer): New member.
10374 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10375 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10376 base buffer indirection counter.
10377 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10378 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10379 through buffer list if indirection counter is 0.
10380
f8643a6b
DA
103812012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10382
10383 Extend the value returned by Fgarbage_collect with heap statistics.
10384 * alloc.c (Qheap): New symbol.
10385 (syms_of_alloc): DEFSYM it.
10386 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10387 (Fmemory_free): Remove.
10388 (syms_of_alloc): Don't defsubr it.
10389 * buffer.c (Fcompact_buffer): Remove.
10390 (syms_of_buffer): Don't defsubr it.
10391
dac616ff
DA
103922012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10393
10394 Make maybe_gc inline.
10395 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10396 * lisp.h (consing_since_gc, gc_relative_threshold)
10397 (memory_full_cons_threshold): Revert declaration.
10398 (maybe_gc): Remove prototype, define as inline.
10399 * alloc.c: Remove old commented-out code.
10400 (consing_since_gc, gc_relative_threshold)
10401 (memory_full_cons_threshold): Revert to global.
10402 (maybe_gc): Remove.
10403
d7ea76b4
DA
104042012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10405
10406 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10407 * lisp.h (build_unibyte_string): New function.
10408 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10409 * sysdep.c, w32fns.c, xfns.c: Use it.
10410 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10411 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10412 Adjust users accordingly.
10413 * font.h (font_open_by_name): Adjust prototype.
10414
765e61e3
DA
104152012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10416
10417 Cleanup calls to Fgarbage_collect.
10418 * lisp.h (maybe_gc): New prototype.
10419 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10420 Remove declarations.
10421 * alloc.c (maybe_gc): New function.
10422 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10423 Make them static.
10424 * bytecode.c (MAYBE_GC): Use maybe_gc.
10425 * eval.c (eval_sub, Ffuncall): Likewise.
10426 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10427 to avoid dependency from auto-save feature.
10428
52b852c7
PE
104292012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10430
10431 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10432 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10433 'for_each_per_buffer_object_at'.
10434 All uses changed. It's better to use upper-case for macros that
10435 cannot be implemented as functions, to give the reader a clue
10436 that they're special.
10437
5db81e33
SM
104382012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10439
10440 * alloc.c (Fgarbage_collect): Tweak docstring.
10441
5b835e1d
DA
104422012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10443
10444 Tweak the value returned from Fgarbage_collect again.
10445 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10446 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10447 Adjust documentation.
10448 (total_vector_bytes): Rename to total_vector_slots, adjust
10449 accounting.
10450 (total_free_vector_bytes): Rename to total_free_vector_slots,
10451 adjust accounting.
10452 (Qstring_bytes, Qvector_slots): New symbols.
10453 (syms_of_alloc): DEFSYM them.
10454
9cd47b72
DA
104552012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10456
10457 Buffer compaction primitive which may be used from Lisp.
10458 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10459 (syms_of_buffer): Register Fcompact_buffer.
10460 * alloc.c (Fgarbage_collect): Use compact_buffer.
10461 * buffer.h (compact_buffer): New prototype.
10462 (struct buffer_text): New member.
10463
d17337e5
DA
104642012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10465
10466 New macro to iterate over all buffers, miscellaneous cleanups.
10467 * lisp.h (all_buffers): Remove declaration.
10468 * buffer.h (all_buffers): Add declaration, with comment.
10469 (for_each_buffer): New macro.
10470 * alloc.c (Fgarbage_collect, mark_object): Use it.
10471 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10472 (init_buffer): Likewise.
10473 * data.c (Fset_default): Likewise.
10474 * coding.c (code_conversion_restore): Remove redundant check
10475 for dead buffer.
10476 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10477
60cfd278
AS
104782012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10479
10480 Fix bug that created negative-length intervals.
10481 * intervals.c (merge_interval_right, merge_interval_left):
10482 Do not zero out this interval if it is absorbed by its children,
10483 as this interval's total length doesn't change in that case. See
10484 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10485
d06714cb
PE
104862012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10487
83713154
PE
10488 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10489 when invoking (make-bool-vector N t) and N is a positive
10490 multiple of 8 -- the last 8 bits were mistakenly cleared.
10491
d06714cb
PE
10492 Remove some struct layout assumptions in bool vectors.
10493 * alloc.c (bool_header_size): New constant.
10494 (header_size, word_size): Move earlier, as they're now used earlier.
10495 Use 'word_size' in a few more places, where it's appropriate.
10496 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10497 padding before the data member of a bool vector.
10498 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10499 than doing the check by hand with an abort ().
10500
464d5a5e
SM
105012012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10502
5fbc0409
SM
10503 * eval.c (Fdefvar): Don't check constants since we only set the var if
10504 it's not yet defined anyway (bug#11904).
10505
464d5a5e
SM
10506 * lisp.h (last_undo_boundary): Declare new var.
10507 * keyboard.c (command_loop_1): Set it.
10508 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10509 were auto-added by the command loop (bug#11774).
10510
8dc2e44a
AS
105112012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10512
10513 * w32font.c (Qsymbol): Remove local definition.
10514 (syms_of_w32font): Don't DEFSYM it.
10515
169925ec
DA
105162012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10517
10518 Fix sweep_vectors to handle large bool vectors correctly.
10519 * alloc.c (sweep_vectors): Account total_vector_bytes for
10520 bool vectors larger than VBLOCK_BYTES_MAX.
10521
5fbfb018
CY
105222012-07-18 Chong Yidong <cyd@gnu.org>
10523
10524 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10525 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10526
3ab6e069
DA
105272012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10528
10529 Return more descriptive data from Fgarbage_collect.
10530 Suggested by Stefan Monnier in
10531 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10532 * alloc.c (bounded_number): New function.
10533 (total_buffers, total_vectors): New variable.
10534 (total_string_size): Rename to total_string_bytes, adjust users.
10535 (total_vector_size): Rename to total_vector_bytes, adjust users.
10536 (sweep_vectors): Account total_vectors and total_vector_bytes.
10537 (Fgarbage_collect): New return value. Adjust documentation.
10538 (gc_sweep): Account total_buffers.
10539 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10540 (VECTOR_SIZE): Remove.
10541 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10542 (Qinterval, Qmisc): New symbols.
10543 (syms_of_data): Initialize them.
10544 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10545 (Qcons, Qbuffer): New declarations.
10546
6d02fe5b
PE
105472012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10548
10549 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10550 Round up, not down. Improve doc.
10551
b7ffe040
DA
105522012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10553
10554 Restore old code in allocate_string_data to avoid Faset breakage.
10555 Reported by Julien Danjou <julien@danjou.info> in
10556 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10557 * alloc.c (allocate_string_data): Restore old code with minor
10558 adjustments, fix comment to explain this subtle issue.
10559
4dc7c8d5
SM
105602012-07-17 Eli Zaretskii <eliz@gnu.org>
10561
10562 Remove FILE_SYSTEM_CASE.
10563 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10564
10565 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10566 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10567 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10568 call-process-region passes it through expand-file-name.
10569
10570 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10571
105722012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10573
10574 Fix crash when creating indirect buffer (Bug#11917)
10575 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10576 Don't handle unbound variables specially if non-zero.
10577 (Fbuffer_local_variables): Pass zero.
10578 (clone_per_buffer_values): Pass non-zero.
10579
105802012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10581
10582 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10583 to make the loop interruptible.
10584
105852012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10586
10587 * gnutls.c (emacs_gnutls_handshake): Only retry if
10588 GNUTLS_E_INTERRUPTED.
10589
cce7fefc
DA
105902012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10591
10592 Cleanup and convert miscellaneous checks to eassert.
10593 * alloc.c (mark_interval): Fix comment, partially rephrase
10594 old comment from intervals.h (see below).
10595 * intervals.c (find_interval, adjust_intervals_for_insertion)
10596 (delete_interval, adjust_intervals_for_deletion)
10597 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10598 Convert to eassert.
10599 (adjust_intervals_for_insertion, make_new_interval):
10600 Remove obsolete and unused code.
10601 * intervals.h (struct interval): Remove obsolete comment.
10602 * textprotp.c (erase_properties): Remove unused code.
10603 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10604 (Fremove_list_of_text_properties): Convert to eassert.
10605
9ea10cc3
CY
106062012-07-17 Chong Yidong <cyd@gnu.org>
10607
10608 * editfns.c (Finsert_char): Doc fix.
10609
3900d5de
DA
106102012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10611
10612 Fix previous change to make Fmemory_free always accurate.
10613 * alloc.c (make_interval): Update total_free_intervals.
10614 (make_float): Likewise for total_free_floats.
10615 (free_cons, Fcons): Likewise for total_free_conses.
10616 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10617 Likewise for total_free_vector_bytes.
10618 (Fmake_symbol): Likewise for total_free_symbols.
10619 (bytes_free): Remove.
10620
7098646f
DA
106212012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10622
10623 Simple free memory accounting feature.
10624 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10625 (sweep_vectors): Accumulate size of free vectors.
10626 (Fgarbage_collect): Setup bytes_free.
10627 (Fmemory_free): New function.
10628 (syms_of_alloc): Register it.
10629
22657b40
DA
106302012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10631
10632 Cleanup overlays checking.
10633 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10634 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10635 eassert and OVERLAYP.
10636 (sort_overlays): Change to use OVERLAYP.
10637
ddfc8813
RK
106382012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10639
10640 * editfns.c (Finsert_char): Make it interactive, and make the
10641 second arg optional. Copy interactive spec and docstring from
10642 ucs-insert.
10643
7c26cf3c
PE
106442012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10645
10646 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10647 Unlike the other wrapped functions, fabs has an unspecified
10648 effect on errno.
10649
5d127af9
JD
106502012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10651
10652 * nsterm.m (keyDown): Interpret flags without left/right bits
10653 as the left key (Bug#11670).
10654
6a0dd1d7
DA
106552012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10656
10657 Remove empty and useless init functions.
10658 * lisp.h (init_character_once, init_fns, init_image)
10659 (init_filelock, init_sound): Remove prototype.
10660 * character.c (init_character_once): Remove.
10661 * filelock.c (init_filelock): Likewise.
10662 * fns.c (init_fns): Likewise.
10663 * image.c (init_image): Likewise.
10664 * sound.c (init_sound): Likewise.
10665 * emacs.c (main): Adjust accordingly.
10666
7a6136fd
DA
106672012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10668
10669 * gtkutil.h: Tiny cleanups.
10670 (use_old_gtk_file_dialog): Remove useless declaration.
10671 (xg_uses_old_file_dialog): Add suggested const attribute.
10672
ce811ad9
EZ
106732012-07-15 Eli Zaretskii <eliz@gnu.org>
10674
10675 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10676 (bidi_paragraph_init): Use it to limit search forward for a strong
10677 directional character in abnormally large paragraphs full of
10678 neutral or weak characters. (Bug#11943)
10679
c9adfeaa
SF
106802012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10681
10682 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10683 the toolbar (Bug#9451).
10684 (xg_make_tool_item): Give the widget event box a transparent
10685 background.
10686
fff62aa9
DA
106872012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10688
10689 Cleanup basic allocation variables and functions.
10690 * alloc.c (ignore_warnings, init_intervals, init_float)
10691 (init_cons, init_symbol, init_marker): Remove.
10692 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10693 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10694 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10695 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10696 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10697 (staticidx, init_alloc_once, init_strings, free_ablock):
10698 Remove redundant initialization.
10699 * fns.c (init_weak_hash_tables): Remove.
10700 * lisp.h (init_weak_hash_tables): Remove prototype.
10701
9730daca
DA
107022012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10703
10704 Use zero_vector where appropriate.
10705 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10706 accordingly.
10707 * lisp.h (zero_vector): New declaration.
10708 * font.c (null_vector): Remove.
10709 (syms_of_font): Remove initialization and staticpro.
10710 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10711 * keymap.c (Faccessible_keymaps): Likewise.
10712
2e2d2a13
LL
107132012-07-15 Leo Liu <sdl.web@gmail.com>
10714
10715 * fringe.c: Fix typo in comments.
10716
cd276f6e
LL
107172012-07-14 Leo Liu <sdl.web@gmail.com>
10718
10719 * fringe.c: Add a new bitmap exclamation-mark.
10720
5a1131d9
EZ
107212012-07-14 Eli Zaretskii <eliz@gnu.org>
10722
10723 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10724
10725 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10726 (HAVE_MENUS): Don't define, defined by editing config.in with
10727 msdos/sed2v2.inp.
10728 (GMALLOC_INHIBIT_VALLOC): Don't define.
10729 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10730
22e983b7
JB
107312012-07-14 Juanma Barranquero <lekktu@gmail.com>
10732
10733 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10734
5b3f250f
GM
107352012-07-14 Glenn Morris <rgm@gnu.org>
10736
10737 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10738 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10739 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10740
33d63ff4
GM
107412012-07-13 Glenn Morris <rgm@gnu.org>
10742
5b633342
GM
10743 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10744
33d63ff4
GM
10745 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10746 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10747
b55b9f85
JD
107482012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10749
0dc8cf50
JD
10750 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10751 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10752 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10753 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10754 where appropriate.
10755 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10756 as boolean expression.
10757 (x_set_window_size): Remove unused variable toolbar.
10758 (ns_get_color_default, ns_mod_to_lisp): Remove.
10759 (ns_mouse_position): Remove unused variables xchar and ychar.
10760 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10761 (ns_set_vertical_scroll_bar): Remove unused variable count.
10762 (ns_delete_terminal): Remove unused variable i.
10763 (ns_term_init): Remove unused variables r, g and b.
10764 (mouseDown): Remove unused variable window.
10765 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10766 (initFrameFromEmacs): Remove unused variable vbextra.
10767 (mouseEntered): Remove unused variables p and dpyinfo.
10768 (mouseExited): Remove unused variables p and r.
10769 (ns_define_frame_cursor, ns_clear_frame_area)
10770 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10771 (menuDown): Assign [sender tag] to variable and cast the variable.
10772
10773 * nsterm.h (menuDown): Add id as type to argument sender.
10774 (ns_display_info_for_name): Add Lisp_Object argument.
10775 (ns_term_init): Add Lisp_Object argument.
10776 (ns_map_event_to_object): Add void argument.
10777 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10778 prototype with arguments and only declare if __OBJC__.
10779 (nxatoms_of_nsselect): Add void argument.
10780 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10781 (ns_alloc_autorelease_pool): Add void argument.
10782 (ns_release_autorelease_pool): Add void* argument.
10783 (ns_get_defaults_value): Add const char* argument.
10784
10785 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10786 (initFromContents): Use SSDATA where appropriate.
10787 (ns_update_menubar): Add braces to ambigous if-else.
10788 (initWithTitle): Put () around assignment in if statement.
10789 (ns_menu_show): Remove unused variables window and keymap.
10790 (update_frame_tool_bar): Remove unused variable selected_p.
10791 (initWithContentRect): Remove unused variable this_cmd_name.
10792
10793 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10794 appropriate.
10795 (setXBMColor): Remove unused variable len.
10796 (setPixmapData): Put () around assignment in loop statement.
10797
10798 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10799 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10800 where appropriate.
10801 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10802 around assignment in loop statement.
10803 (nsfont_open): Remove unused variable i.
10804 (nsfont_open): Remove unused variable len.
10805 (nsfont_draw): Remove unused variable cs.
10806
10807 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10808 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10809 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10810 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10811 (Fns_font_name, Fns_perform_service)
10812 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10813 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10814 (ns_set_name): Remove unused variable view.
10815 (x_set_menu_bar_lines): Remove unused variable olines.
10816 (x_set_tool_bar_lines): Remove unused variable root_window.
10817 (Fns_list_colors): Put () around assignment in while statement.
10818 (Fns_perform_service): Remove unused variable len.
10819 (Fns_display_usable_bounds): Remove unused variable top.
10820 (syms_of_nsfns): Remove unused variable i.
10821
b55b9f85
JD
10822 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10823 memcpy (Bug#11907).
10824
ed9265fc 108252012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
10826
10827 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10828 and free it with DestroyExceptionInfo (Bug#11558).
10829
ef099b57
JB
108302012-07-13 Juanma Barranquero <lekktu@gmail.com>
10831
10832 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10833 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10834 Set here, not in nt/config.nt.
10835
ea814a5d
EZ
108362012-07-13 Eli Zaretskii <eliz@gnu.org>
10837
10838 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10839 cursor overflow into the last glyph on display line when the right
10840 fringe is off. (Bug#11832)
10841
1a952767
PE
108422012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10843
10844 * xdisp.c (produce_special_glyphs): Now static.
10845 * dispextern.h (produce_special_glyphs): Remove decl.
10846
983188fd
GM
108472012-07-13 Glenn Morris <rgm@gnu.org>
10848
8d7c7eed 10849 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
10850 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10851
983188fd
GM
10852 * s/usg5-4-common.h (USG, USG5):
10853 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10854 * s/sol2-6.h (SOLARIS2):
10855 * s/irix6-5.h (IRIX6_5):
10856 * s/hpux10-20.h (USG, USG5, HPUX):
10857 * s/gnu-linux.h (USG, GNU_LINUX):
10858 * s/freebsd.h (BSD_SYSTEM):
10859 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10860 * s/cygwin.h (CYGWIN):
10861 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10862 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10863
d1e68667 108642012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
10865
10866 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 10867
6de0e799
GM
108682012-07-13 Glenn Morris <rgm@gnu.org>
10869
739ae010
GM
10870 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10871
dbee5793
GM
10872 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10873
6de0e799
GM
10874 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10875 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10876
b82da769
GM
108772012-07-12 Glenn Morris <rgm@gnu.org>
10878
4fae5a7a 10879 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10880
10881 * process.c (init_process_emacs): Rename from init_process.
10882 The old name is also the name of a Mach system call.
10883 * lisp.h, emacs.c: Update for this name change.
10884 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10885 longer needed.
10886
5a979817
EZ
108872012-07-12 Eli Zaretskii <eliz@gnu.org>
10888
10889 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10890 memmove call that removes glyphs covered by the left truncation
10891 glyph. Improve commentary.
10892 (display_line): Fix display of continuation glyphs on GUI frames
10893 when the right fringe is turned off and variable-size fonts are
10894 used in the window. Move the code that appends a stretch glyph to
10895 produce_special_glyphs, so that it could be used for truncation
10896 and continuation glyphs alike.
10897 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10898 glyph of a suitably computed width, to align the special glyphs at
10899 the window margin. Code moved from display_line. (Bug#11832)
10900
3e91a053
GM
109012012-07-12 Glenn Morris <rgm@gnu.org>
10902
ba9e4b84
GM
10903 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10904
10905 * s/gnu-linux.h, s/hpux10-20.h:
10906 Do not unconditionally define HAVE_XRMSETDATABASE.
10907
3e91a053
GM
10908 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10909
b300b1f4
PE
109102012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10911
10912 Fix typos that broke OS X build.
10913 Reported by Randal L. Schwartz in
10914 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10915 * nsterm.m (ns_timeout): Add missing local decl.
10916 (ns_get_color): snprintf -> sprintf, to fix typo.
10917
6e777848
GM
109182012-07-12 Glenn Morris <rgm@gnu.org>
10919
3f922c37
GM
10920 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10921 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10922 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10923 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10924
0ab7b23a
GM
10925 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10926 Move PTY_OPEN to configure.
10927
6e777848
GM
10928 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10929 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10930 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10931
4a7edc24
DA
109322012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10933
10934 Use empty_unibyte_string where applicable.
10935 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10936 * lread.c (read1): Likewise.
10937 * xsettings.c (syms_of_xsettings): Likewise.
10938
308aab79
GM
109392012-07-12 Glenn Morris <rgm@gnu.org>
10940
42bd1719
GM
10941 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10942 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10943 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10944 * s/hpux10-20.h (RUN_TIME_REMAP):
10945 * s/bsd-common.h (TABDLY): Move to configure.
10946
10947 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10948
10949 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10950
ea0bbd17 10951 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10952 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10953
10954 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10955
308aab79
GM
10956 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10957 * s/template.h: Move NARROWPROTO to configure.
10958
ee1cf5cf
GM
109592012-07-11 Glenn Morris <rgm@gnu.org>
10960
30fe9bf4
GM
10961 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10962 unused since 2011-01-17 change to systty.h.
10963
ee1cf5cf
GM
10964 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10965 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10966 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10967
63e47e07
PE
109682012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10969
10970 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10971
c43fb4c3
GM
109722012-07-11 Glenn Morris <rgm@gnu.org>
10973
10974 * s/darwin.h, s/gnu-linux.h, s/template.h:
10975 Move INTERRUPT_INPUT to configure.
10976
e8df9267
DA
109772012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10978
10979 Minor adjustments to interning code.
10980 * lisp.h (intern, intern_c_string): Redefine as static inline
10981 wrappers for intern_1 and intern_c_string_1, respectively.
10982 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10983 * lread.c (intern_1, intern_c_string_1, oblookup):
10984 Simplify Vobarray checking.
e8df9267
DA
10985 * font.c (font_intern_prop): Likewise. Adjust comment.
10986 * w32font.c (intern_font_name): Likewise.
10987
34348bd4
AS
109882012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10989
d96a1e0c
AS
10990 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10991
34348bd4
AS
10992 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10993 of Fcar/Fcdr if possible.
10994 * font.c (check_otf_features): Likewise.
10995 * fontset.c (Fnew_fontset): Likewise.
10996 * gnutls.c (Fgnutls_boot): Likewise.
10997 * minibuf.c (read_minibuf): Likewise.
10998 * msdos.c (IT_set_frame_parameters): Likewise.
10999 * xmenu.c (Fx_popup_dialog): Likewise.
11000 * w32menu.c (Fx_popup_dialog): Likewise.
11001
c8add24e
GM
110022012-07-11 Glenn Morris <rgm@gnu.org>
11003
4b575b3c
GM
11004 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
11005 since nothing has defined it on these platforms.
11006
09f4e3b0
GM
11007 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
11008 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
11009
172bedef
GM
11010 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11011 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
11012 Move CLASH_DETECTION to configure.
11013
249685df
GM
11014 * s/gnu.h: Remove file, which is now empty.
11015
c8add24e
GM
11016 * s/gnu.h, s/gnu-linux.h:
11017 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
11018
b41253a3
JW
110192012-07-11 John Wiegley <johnw@newartisans.com>
11020
11021 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
11022 function attribute, so we only use it if it exists in the
11023 compiler.
11024
d923b542
DA
110252012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11026
11027 Avoid call to strlen in fast_c_string_match_ignore_case.
11028 * search.c (fast_c_string_match_ignore_case): Change to use
11029 length argument. Adjust users accordingly.
11030 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
11031
5ebbef1d
PE
110322012-07-11 Paul Eggert <eggert@cs.ucla.edu>
11033
bb352260
PE
11034 Assume mkdir, rmdir.
11035 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
11036 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
11037
57054ddd
PE
11038 Assume rename.
11039 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
11040
b747d3f7
PE
11041 Assume perror.
11042 * s/hpux10-20.h (HAVE_PERROR): Remove.
11043 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
11044 Remove dummy definition, as this problem was obsolete long ago.
11045
5ebbef1d
PE
11046 Assume strerror.
11047 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
11048
984e7f30
DA
110492012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
11050
11051 Avoid calls to strlen in font processing functions.
11052 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
11053 (font_open_by_name): Change to use length argument.
11054 Adjust users accordingly.
d923b542
DA
11055 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
11056 Adjust prototypes.
11057 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
11058 Change to return ptrdiff_t.
984e7f30
DA
11059 (xfont_list_pattern, xfont_match): Use length returned by
11060 xfont_decode_coding_xlfd.
11061 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
11062
20e94fdd
GM
110632012-07-11 Glenn Morris <rgm@gnu.org>
11064
9d596af3
GM
11065 * s/darwin.h, s/freebsd.h, s/netbsd.h:
11066 Move DONT_REOPEN_PTY to configure.
11067
20e94fdd
GM
11068 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
11069 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
11070
e99a530f
PE
110712012-07-10 Paul Eggert <eggert@cs.ucla.edu>
11072
22ffb973
PE
11073 Remove "#define unix" that is no longer needed (Bug#11905).
11074 * s/aix4-2.h (unix): Remove; no longer needed.
11075
e9a9ae03
PE
11076 EMACS_TIME simplification (Bug#11875).
11077 This replaces macros (which typically do not work in GDB)
11078 with functions, typedefs and enums, making the code easier to debug.
11079 The functional style also makes code easier to read and maintain.
11080 * systime.h: Include <sys/time.h> on all hosts, not just if
11081 WINDOWSNT, since 'struct timeval' is needed in general.
11082 (EMACS_TIME): Now a typedef, not a macro.
11083 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
11084 not macros.
11085 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
11086 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
11087 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
11088 (EMACS_TIME_LE): Now functions, not macros.
11089 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
11090 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
11091 which are not functions. All uses rewritten to use:
11092 (make_emacs_time): New function.
11093 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
11094 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
11095 not functions. All uses rewritten to use the following, respectively:
11096 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
11097 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 11098 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
11099 * fileio.c (Fcopy_file):
11100 * xterm.c (XTflash): Get the current time closer to when it's used.
11101 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
11102
ffacb126
PE
11103 * bytecode.c (targets): Suppress -Woverride-init warnings.
11104
e99a530f
PE
11105 Simplify by avoiding confusing use of strncpy etc.
11106 * doc.c (Fsnarf_documentation):
11107 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
11108 * frame.c (Fmake_terminal_frame):
11109 * gtkutil.c (get_utf8_string):
11110 * lread.c (openp):
11111 * nsmenu.m (ns_update_menubar):
11112 * regex.c (regerror):
11113 Prefer memcpy to strncpy and strncat when either will do.
11114 * fileio.c (Fsubstitute_in_file_name):
11115 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
11116 (menu_separator_name_p):
11117 * nsmenu.m (ns_update_menubar):
11118 Prefer memcmp to strncmp when either will do.
11119 * nsterm.m: Include <ftoastr.h>.
11120 (ns_get_color):
11121 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
11122 Prefer snprintf to strncpy.
11123 * nsterm.m (ns_term_init):
11124 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
11125 * nsterm.m (ns_term_init):
11126 Avoid the need for strncpy, by using build_string or
11127 make_unibyte_string directly. Use dtoastr, not snprintf.
11128 * process.c (Fmake_network_process): Diagnose service names that
11129 are too long, rather than silently truncating them or creating
11130 non-null-terminated names.
11131 (Fnetwork_interface_info): Likewise, for interface names.
11132 * sysdep.c (system_process_attributes) [GNU_LINUX]:
11133 Prefer sprintf to strncat.
11134 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
11135 Prefer vsnprintf to vsprintf + strncpy.
11136
c59592b3
GM
111372012-07-10 Glenn Morris <rgm@gnu.org>
11138
11139 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
11140 Clarify fallback case.
11141
7d7bbefd
DA
111422012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11143
11144 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
11145 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
11146 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 11147 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
11148 where argument type is known to be a Lisp_Cons.
11149
3a4c8000
TT
111502012-07-10 Tom Tromey <tromey@redhat.com>
11151
11152 * bytecode.c (BYTE_CODE_THREADED): New macro.
11153 (BYTE_CODES): New macro. Replaces all old byte-code defines.
11154 (enum byte_code_op): New type.
11155 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
11156 (exec_byte_code): Use them. Use token threading when applicable.
11157
2a0213a6
DA
111582012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11159
11160 Optimize pure C strings initialization.
11161 * lisp.h (make_pure_string): Fix prototype.
11162 (build_pure_c_string): New function, defined as static inline. This
11163 provides a better opportunity to optimize away calls to strlen when
11164 the function is called with compile-time constant argument.
11165 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
11166 argument, adjust users accordingly. Use build_pure_c_string where
11167 appropriate.
11168 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
11169 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
11170 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
11171
cb1caeaf
DA
111722012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11173
11174 Avoid calls to strlen in miscellaneous functions.
11175 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
11176 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
11177 * lread.c (openp): Likewise.
11178
c293e30c
DA
111792012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
11180
11181 Avoid calls to strlen in path processing functions.
11182 * fileio.c (file_name_as_directory): Add comment. Change to add
11183 srclen argument and return the length of result. Adjust users
11184 accordingly.
11185 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
11186 swap 1st and 2nd arguments to obey the common convention.
11187 Adjust users accordingly.
c293e30c
DA
11188 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
11189
9e059e3f
GM
111902012-07-10 Glenn Morris <rgm@gnu.org>
11191
d02eb359
GM
11192 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
11193 Move PENDING_OUTPUT_COUNT definition to configure.
11194
882cf227
GM
11195 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
11196 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
11197 * s/gnu.h (DATA_START): Move definitions to configure.
11198
af6e839f
GM
11199 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
11200 We include usg5-4-common.h, which defines them both.
11201
40289a12
GM
11202 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
11203 O_RDONLY already includes it).
11204
9e059e3f
GM
11205 Stop ns builds setting the EMACSLOADPATH environment variable.
11206 * nsterm.m (ns_load_path): Rename from ns_init_paths.
11207 Now it does not set EMACSLOADPATH, just returns the load-path string.
11208 * nsterm.h: Update accordingly.
11209 * lread.c [HAVE_NS]: Include nsterm.h.
11210 (init_lread) [HAVE_NS]: Use ns_load_path.
11211 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
11212
7c4e8ec0
GM
112132012-07-09 Glenn Morris <rgm@gnu.org>
11214
d4f600ff
GM
11215 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
11216 since the included bsd-common.h does so.
11217
cbb31951
GM
11218 Stop ns builds setting the EMACSPATH environment variable.
11219 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
11220 (ns_init_paths): Do not set EMACSPATH.
11221 * nsterm.h (ns_exec_path): Add it.
11222 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
11223 Use ns_exec_path.
11224
7c4e8ec0
GM
11225 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
11226
26bccfae
PE
112272012-07-09 Paul Eggert <eggert@cs.ucla.edu>
11228
a0bee46f
PE
11229 * process.c (wait_reading_process_output): 'waitchannels' was unset
11230 when read_kbd || !NILP (wait_for_cell); fix this.
11231
5994c183
PE
11232 Add GCC-style 'const' attribute to functions that can use it.
11233 * character.h (char_resolve_modifier_mask):
11234 * keyboard.h (make_ctrl_char):
11235 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
11236 (init_character_once, next_almost_prime, init_fns, init_image)
11237 (flush_pending_output, init_sound):
11238 * mem-limits.h (start_of_data):
11239 * menu.h (finish_menu_items):
11240 Add ATTRIBUTE_CONST.
11241 * emacs.c (DEFINE_DUMMY_FUNCTION):
11242 Declare the dummy function with ATTRIBUTE_CONST.
11243 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
11244 Add decls with ATTRIBUTE_CONST.
11245
26bccfae
PE
11246 Minor improvements to make_formatted_string.
11247 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
11248 where int is good enough, as vsprintf returns an int.
11249 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
11250
a8290ec3
DA
112512012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11252
11253 Use make_formatted_string to avoid double length calculation.
11254 * lisp.h (make_formatted_string): New prototype.
11255 * alloc.c (make_formatted_string): New function.
11256 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 11257 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
11258 * editfns.c (Fcurrent_time_zone): Likewise.
11259 * filelock.c (get_boot_time): Likewise.
11260 * frame.c (make_terminal_frame, set_term_frame_name)
11261 (x_report_frame_params): Likewise.
11262 * image.c (gs_load): Likewise.
11263 * minibuf.c (get_minibuffer): Likewise.
11264 * msdos.c (dos_set_window_size): Likewise.
11265 * process.c (make_process): Likewise.
11266 * xdisp.c (ensure_echo_area_buffers): Likewise.
11267 * xsettings.c (apply_xft_settings): Likewise.
11268
d01ba2f1
GM
112692012-07-09 Glenn Morris <rgm@gnu.org>
11270
11271 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
11272 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
11273 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
11274 * nsterm.h (ns_etc_directory): Add it.
11275 * callproc.c [HAVE_NS]: Include nsterm.h.
11276 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
11277
f1f924b6
DA
112782012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
11279
11280 Move marker debugging code under MARKER_DEBUG.
11281 * marker.c (MARKER_DEBUG): Move marker debugging code under
11282 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11283 for bootstrap with --enable-checking (~3x slowdown reported
11284 by Juanma Barranquero <lekktu@gmail.com>).
11285 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11286
ab531b66
PE
112872012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11288
11289 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11290 See <http://bugs.gnu.org/11825#29>.
11291
c4b3bc8a
EZ
112922012-07-08 Eli Zaretskii <eliz@gnu.org>
11293
11294 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11295 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
11296 (display_line): Add commentary about displaying truncation glyphs
11297 on GUI frames.
11298 (produce_special_glyphs): Move here from term.c.
11299
11300 * term.c (produce_special_glyphs): Move to xdisp.c.
11301
11302 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11303 section.
c4b3bc8a 11304
b676b881
AS
113052012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11306
f17c5273
AS
11307 * xdisp.c (display_line): Avoid warning about implicit declaration
11308 of FRAME_FONT.
11309
298819b9
AS
11310 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11311
b676b881
AS
11312 * lisp.h: Remove empty conditional.
11313
6045c4fd
PE
113142012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11315
b3350bf9
PE
11316 * lread.c (load_path_check): Now static.
11317
6045c4fd
PE
11318 Fix some minor --with-ns problems found by static checking.
11319 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11320 (x_set_font) [!HAVE_X_WINDOWS]:
11321 * image.c (xpm_load_image) [HAVE_NS]:
11322 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11323 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11324 Remove unused local.
11325 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11326 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11327 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11328 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11329 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11330 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11331 Fix pointer signedness problem.
11332 * xfaces.c (FRAME_X_FONT_TABLE):
11333 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11334
929e7845
GM
113352012-07-07 Glenn Morris <rgm@gnu.org>
11336
11337 * lread.c (load_path_check): New function, split from init_lread.
11338 (init_lread): Reorganize. Motivation:
11339 If EMACSLOADPATH is set, check/warn about that rather than the
11340 defaults, which we are not going to use. Hence we can remove
11341 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11342 Don't warn if site-lisp directories are missing.
11343 If not installed, start from a blank load-path, since
11344 PATH_LOADSEARCH refers to the eventual installation directories.
11345
58dd0aa4
EZ
113462012-07-07 Eli Zaretskii <eliz@gnu.org>
11347
11348 Support truncation and continuation glyphs on GUI frames, when
11349 fringes are disabled. (Bug#11832)
11350 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
11351 continuation glyphs even if on GUI frames.
11352 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
11353 or both, are absent.
11354 (start_display, move_it_in_display_line_to): Handle the case of a
11355 GUI frame without a fringe to display continuation or truncation
11356 glyphs.
11357 (insert_left_trunc_glyphs): Support GUI frames: make sure
11358 truncation glyphs overwrite enough glyphs from the current line to
11359 have sufficient space in pixels.
11360 (display_line): Support truncation and continuation glyphs on GUI
11361 frames. If some spare pixels are left on the line after inserting
11362 the truncation glyphs, fill that space with a stretch glyph of a
11363 suitably computed width.
11364
11365 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11366 produce_glyphs, to support GUI sessions.
11367
31571fd7
PE
113682012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11369
5a16b9bc
PE
11370 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11371
f3047c75
PE
11372 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11373
31571fd7
PE
11374 Do not require float-time's arg to fit in time_t (Bug#11825).
11375 This works better on hosts where time_t is unsigned, and where
11376 float-time is applied to the (negative) difference between two times.
11377 * editfns.c (decode_time_components): Last arg is now double *,
11378 not int *, and means to store all the result as a double, without
11379 worrying about whether the seconds part fits in time_t.
11380 All callers changed.
11381 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11382 All callers changed.
11383 (Ffloat_time): Do not fail merely because the specified time falls
11384 outside of time_t range.
11385
4516fbef
GM
113862012-07-07 Glenn Morris <rgm@gnu.org>
11387
11388 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11389 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11390 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11391
07adc2c6
JB
113922012-07-07 Juanma Barranquero <lekktu@gmail.com>
11393
11394 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11395 Update dependencies.
11396
11397 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11398
fd573f31
PE
113992012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11400
fee5959d
PE
11401 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11402 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11403 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11404 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11405 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11406 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11407
fd573f31
PE
11408 * xfont.c (compare_font_names): Redo to omit the need for casts.
11409
ddadbc0e
AS
114102012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11411
fca8d6b6
AS
11412 * xfns.c (Fx_change_window_property): Doc fix.
11413 * w32fns.c (Fx_change_window_property): Doc fix.
11414
ddadbc0e
AS
11415 * w32fns.c (Fx_window_property): Accept the same arguments as the
11416 X Windows version. Doc fix.
11417 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11418
ed9265fc 114192012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
11420 Eli Zaretskii <eliz@gnu.org>
11421
11422 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11423 Windows-specific code from nt/config.nt moved here.
11424 Obsolete settings removed.
11425
216ee680
PE
114262012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11427
11428 * process.c: Avoid unnecessary calls to gettime.
11429 (wait_reading_process_output): Don't get the time of day
11430 when gobbling data immediately and not waiting, as there's no need
11431 for it in that case. This removes a FIXME.
11432
bdd091e4
JD
114332012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11434
11435 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11436 is defined (Bug#11768).
11437
9d44f8ce
DA
114382012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11439
11440 Fix marker debugging code.
11441 * marker.c (byte_char_debug_check): Do not perform the check
11442 if buffer is not multibyte.
090bd7cb
JB
11443 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11444 Call byte_char_debug_check with correct arguments.
9d44f8ce 11445
90fc4786
DA
114462012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11447
11448 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
11449 * marker.c (byte_char_debug_check, count_markers):
11450 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
11451 (byte_debug_flag): Remove.
11452 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11453 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11454
7b7ae965
DA
114552012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11456
4e57b342
DA
11457 Avoid code repetition in marker-related functions.
11458 * marker.c (attach_marker): New function.
11459 (Fset_marker, set_marker_restricted, set_marker_both)
11460 (set_marker_restricted_both): Use it.
11461 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11462 Consistently rename charno to charpos.
11463 (marker_position): Add eassert.
11464 (marker_byte_position): Convert to eassert.
11465
114662012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11467
11468 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 11469 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 11470 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 11471
657924ff
DA
114722012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11473
11474 Introduce fast path for the widely used marker operation.
11475 * alloc.c (build_marker): New function.
11476 * lisp.h (build_marker): New prototype.
11477 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11478 * composite.c (autocmp_chars): Likewise.
11479 * editfns.c (buildmark): Remove.
11480 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11481 (save_restriction_save): Use build_marker.
11482 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11483 * window.c (save_window_save): Likewise.
11484
041a49a6
DA
114852012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11486
11487 Do not use Fdelete_overlay in delete_all_overlays
11488 to avoid redundant calls to unchain_overlay.
11489 * buffer.c (drop_overlay): New function.
11490 (delete_all_overlays, Fdelete_overlay): Use it.
11491 * minibuf.c (get_minibuffer): Fix comment.
11492
7dca65a4
PE
114932012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11494
11495 Port to OpenBSD 5.1 amd64.
11496 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11497 This is needed for OpenBSD, and should be harmless on all BSD systems.
11498 Also, include <sys/sysctl.h>, as it should be available on all
11499 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11500 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11501 use p_pid member, not kp_proc.pid.
11502
8eb876e2
GM
115032012-07-06 Glenn Morris <rgm@gnu.org>
11504
11505 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11506
38182d90
PE
115072012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11508
11509 More xmalloc and related cleanup.
11510 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11511 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11512 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11513 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11514 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11515 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11516 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11517 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11518 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11519 * xterm.c:
11520 Omit needless casts involving void * pointers and allocation.
11521 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11522 as the former is more robust if P's type is changed.
11523 Prefer xzalloc to xmalloc + memset 0.
11524 Simplify malloc-or-realloc to realloc.
11525 Don't worry about xmalloc returning a null pointer.
11526 Prefer xstrdup to xmalloc + strcpy.
11527 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11528 growing it.
11529 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11530 alloca of a constant.
11531
6dd5a677
EZ
115322012-07-05 Eli Zaretskii <eliz@gnu.org>
11533
11534 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11535 hscroll is larger than the line width. Fixes long and futile
11536 looping inside extend_face_to_end_of_line (on a TTY) producing
11537 glyphs that are not needed and thrown away.
11538
6b312f0f
DA
115392012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11540
11541 * marker.c (set_marker_restricted_both): Simplify by using
11542 clip_to_bounds.
11543
f520ef9b
PE
115442012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11545
11546 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11547
383b7c95
JD
115482012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11549
11550 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11551 not defined (Bug#11768).
11552 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11553 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11554 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11555 followed by gtk_box_set_homogeneous (Bug#11768).
11556 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
11557 (update_theme_scrollbar_width, xg_create_scroll_bar):
11558 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
11559 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11560 (is_box_type): New function (Bug#11768).
11561 (xg_tool_item_stale_p): Call is_box_type.
5293d758 11562 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
11563 with default display (Bug#11768).
11564
d6e7bf45
EZ
115652012-07-05 Eli Zaretskii <eliz@gnu.org>
11566
11567 * xdisp.c (window_hscroll_limited): New function.
11568 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11569 coordinates when window's hscroll is set to insanely large
11570 values. (Bug#11857)
11571
431391ec
JB
115722012-07-05 Juanma Barranquero <lekktu@gmail.com>
11573
11574 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11575 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11576
23f86fce
DA
115772012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11578
11579 Cleanup xmalloc.
11580 * lisp.h (xzalloc): New prototype. Omit needless casts.
11581 * alloc.c (xzalloc): New function. Omit needless casts.
11582 * charset.c: Omit needless casts. Convert all calls to
11583 xmalloc with following memset to xzalloc.
11584 * dispnew.c: Likewise.
11585 * fringe.c: Likewise.
11586 * image.c: Likewise.
11587 * sound.c: Likewise.
11588 * term.c: Likewise.
11589 * w32fns.c: Likewise.
11590 * w32font.c: Likewise.
11591 * w32term.c: Likewise.
11592 * xfaces.c: Likewise.
11593 * xfns.c: Likewise.
11594 * xterm.c: Likewise.
11595 * atimer.c: Omit needless casts.
11596 * buffer.c: Likewise.
11597 * callproc.c: Likewise.
11598 * ccl.c: Likewise.
11599 * coding.c: Likewise.
11600 * composite.c: Likewise.
11601 * doc.c: Likewise.
11602 * doprnt.c: Likewise.
11603 * editfns.c: Likewise.
11604 * emacs.c: Likewise.
11605 * eval.c: Likewise.
11606 * filelock.c: Likewise.
11607 * fns.c: Likewise.
11608 * gtkutil.c: Likewise.
11609 * keyboard.c: Likewise.
11610 * lisp.h: Likewise.
11611 * lread.c: Likewise.
11612 * minibuf.c: Likewise.
11613 * msdos.c: Likewise.
11614 * print.c: Likewise.
11615 * process.c: Likewise.
11616 * region-cache.c: Likewise.
11617 * search.c: Likewise.
11618 * sysdep.c: Likewise.
11619 * termcap.c: Likewise.
11620 * terminal.c: Likewise.
11621 * tparam.c: Likewise.
11622 * w16select.c: Likewise.
11623 * w32.c: Likewise.
11624 * w32reg.c: Likewise.
11625 * w32select.c: Likewise.
11626 * w32uniscribe.c: Likewise.
11627 * widget.c: Likewise.
11628 * xdisp.c: Likewise.
11629 * xmenu.c: Likewise.
11630 * xrdb.c: Likewise.
11631 * xselect.c: Likewise.
11632
0497dc44
PE
116332012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11634
11635 * fileio.c (time_error_value): Check the right error number.
11636 Problem reported by Troels Nielsen in
11637 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11638
356e7178
PE
116392012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11640
4e71fd89
PE
11641 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11642 This should be fixed in a better way; see Eli Zaretskii in
11643 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11644 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11645
f0941253
PE
11646 * fileio.c (time_error_value): Rename from special_mtime.
11647 The old name's problems were noted by Eli Zaretskii in
11648 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11649
065c9eb4
PE
11650 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11651 This variable's comment says Emacs needs at least one GDB-visible
11652 symbol of type enum pvec_type, to work around GDB problems.
11653 The symbol's value doesn't matter.
11654
356e7178
PE
11655 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11656 that causes compilation to fail on pre-C99 compilers.
11657
ed9265fc 116582012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
11659
11660 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11661 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11662
3884d954
DA
116632012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11664
d209e2fb 11665 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
11666 headers for buffer_defaults and buffer_local_symbols.
11667 Reported by Juanma Barranquero <lekktu@gmail.com>.
11668
ee28be33
SM
116692012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11670
11671 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11672 * lisp.h (enum pvec_type): Use fewer bits.
11673 (PSEUDOVECTOR_SIZE_BITS): New constant.
11674 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11675 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11676 change in pvec_type.
11677 (PSEUDOVECTOR_TYPEP): New macro.
11678 (TYPED_PSEUDOVECTORP): Use it.
11679 * fns.c (internal_equal): Adapt code to extract pvectype.
11680 * emacs.c (gdb_pvec_type): Update type.
11681 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11682 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11683 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11684 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11685 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11686 abusing vector->header.next.nbytes.
11687 (live_vector_p): Use PVEC_TYPE.
11688 (mark_object): Adapt code to extract pvectype. Use switch.
11689
c7f2cd7f
PE
116902012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11691
11692 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11693 Tighten new eassert a bit.
11694
8ce70ed2
DA
116952012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11696
11697 Fix compilation with --enable-gcc-warnings and -O1
11698 optimization level.
11699 * doprnt.c (doprnt): Change type of tem to int, initialize
11700 to avoid compiler warning. Add eassert.
11701 * search.c (simple_search): Initialize match_byte to avoid
11702 compiler warning. Add eassert.
11703
dea7f1e5
PE
117042012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11705
24a212eb
PE
11706 Avoid weird behavior with large horizontal scrolls.
11707 Without this change, for example, large hscroll values would
11708 mess up Emacs's display on Fedora 15 x86, presumably due to
11709 overflows in int calculations in the display code.
11710 Also, if buffers had long lines, Emacs would freeze.
11711 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11712 (set_window_hscroll): New function, containing the old guts of
11713 Fset_window_hscroll. Return the clipped value.
11714 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11715 This avoids the need to check against PTRDIFF_MAX.
11716
dea7f1e5
PE
11717 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11718
76046526
DA
117192012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11720
11721 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11722
39adff0d
PE
117232012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11724
63807d47
PE
11725 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11726 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11727 since GCC 4.4.6 issues a bogus warning for them.
11728
39adff0d
PE
11729 Fix bugs in file timestamp newness comparisons.
11730 * fileio.c (Ffile_newer_than_file_p):
11731 * lread.c (Fload): Use full timestamp resolution of files,
11732 not just the 1-second resolution, so that files that are only
11733 slightly newer still count as newer.
11734 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11735 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11736
dbeed9a6
PE
117372012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11738
11739 * fileio.c: Improve handling of file time marker. (Bug#11852)
11740 (special_mtime): New function.
11741 (Finsert_file_contents, Fverify_visited_file_modtime):
11742 Use it to set special mtime values consistently.
11743
636334d6
AS
117442012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11745
11746 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11747 marker for non-existing file. (Bug#11852)
11748
e2017fe2
GM
117492012-07-03 Glenn Morris <rgm@gnu.org>
11750
11751 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11752 and did not make it into globals.h).
11753
404dbd37
TT
117542012-07-03 Tom Tromey <tromey@redhat.com>
11755
11756 * window.c (Fset_window_margins, Fset_window_fringes)
11757 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11758 * textprop.c (Fprevious_property_change): No longer static.
11759 * syntax.c (Fsyntax_table_p): No longer static.
11760 * process.c (Fget_process, Fprocess_datagram_address): No longer
11761 static.
11762 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11763 * keyboard.c (Fcommand_execute): No longer static.
11764 Remove EXFUN.
11765 * insdel.c (Fcombine_after_change_execute): No longer static.
11766 * image.c (Finit_image_library): No longer static.
11767 * fileio.c (Fmake_symbolic_link): No longer static.
11768 * eval.c (Ffetch_bytecode): No longer static.
11769 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
11770 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11771 No longer static.
404dbd37
TT
11772 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11773 static.
11774 * dired.c (Ffile_attributes): No longer static.
11775 * composite.c (Fcomposition_get_gstring): No longer static.
11776 * callproc.c (Fgetenv_internal): No longer static.
11777
11778 * ccl.h: Remove EXFUNs.
11779 * buffer.h: Remove EXFUNs.
11780 * dispextern.h: Remove EXFUNs.
11781 * intervals.h: Remove EXFUNs.
11782 * fontset.h: Remove EXFUN.
11783 * font.h: Remove EXFUNs.
11784 * dosfns.c (system_process_attributes): Remove EXFUN.
11785 * keymap.h: Remove EXFUNs.
11786 * lisp.h: Remove EXFUNs.
11787 * w32term.h: Remove EXFUNs.
11788 * window.h: Remove EXFUNs.
11789 * xsettings.h: Remove EXFUN.
11790 * xterm.h: Remove EXFUN.
11791
8e4fd1e1
GM
117922012-07-03 Glenn Morris <rgm@gnu.org>
11793
11794 * lisp.h (Frandom): Make it visible to C.
11795 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11796 buffer for invisible buffers. (Bug#1229)
11797
ca95b3eb
DA
117982012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11799
11800 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11801 values which aren't power of 2.
14ae4239 11802 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 11803 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
11804 accordingly.
11805
7555c33f
SM
118062012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11807
11808 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11809
11810 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11811
d12e8f5a
DA
118122012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11813
11814 * alloc.c (allocate_vector_block): Remove redundant
11815 calls to mallopt if DOUG_LEA_MALLOC is defined.
11816 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11817 avoid calls to mallopt if zero_vector is returned.
11818
296094c3
DA
118192012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11820
11821 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11822 is enabled, avoid dereferencing NULL current_sblock if
11823 running undumped.
11824
36429c89
DA
118252012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11826
11827 Cleanup basic buffer management.
11828 * buffer.h (struct buffer): Change layout to use generic vector
11829 marking code. Fix some comments. Change type of 'clip_changed'
11830 to bitfield. Remove unused #ifndef old.
11831 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11832 (GET_OVERLAYS_AT): Fix indentation.
11833 (for_each_per_buffer_object_at): New macro.
11834 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11835 (Fbuffer_local_variables): Use it.
11836 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11837 * alloc.c (allocate_buffer): Adjust to match new layout of
11838 struct buffer. Fix comment.
11839 (mark_overlay): New function.
11840 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11841 Lisp area of struct buffer.
11842 (mark_object): Use it. Adjust marking of misc objects
11843 and related comments.
11844
3b3e4cac
PE
118452012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11846
11847 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11848 wrapper that is not needed because the wrapped code is a no-op (zero
11849 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11850 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11851
cf5c0175
DA
118522012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11853
11854 * alloc.c (mark_buffer): Simplify. Remove prototype.
11855 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 11856 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
11857 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11858 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 11859
ca26824c
GM
118602012-06-30 Glenn Morris <rgm@gnu.org>
11861
2e4c5312
GM
11862 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11863
ca26824c
GM
11864 * epaths.in (PATH_SITELOADSEARCH): New.
11865 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11866 This is rather than relying on --enable-locallisppath elements
11867 having "site-lisp" in their names. (Bug#10208#25, 11658)
11868
0d23c240
EZ
118692012-06-30 Eli Zaretskii <eliz@gnu.org>
11870
c9240d7a
EZ
11871 * w32proc.c (sys_select): Accept and ignore one more argument.
11872
11873 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11874
0d23c240 11875 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11876 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11877
11878 * sysdep.c: Don't include dos.h and dosfns.h.
11879
11880 * process.c (sys_select):
11881 * msdos.c (sys_select): Accept one more argument and ignore it.
11882
11883 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11884 adapt data types and code to that.
11885
11886 * dosfns.c:
11887 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11888 which clashes with the gnulib function of the same name.
11889
af5a5a98
AS
118902012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11891
c5e4379c
AS
11892 * font.c (font_style_to_value, font_style_symbolic)
11893 (font_prop_validate_style): Add type checks for values in
11894 font_style_table.
11895
af5a5a98
AS
11896 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11897 argument.
11898 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11899 uses.
11900
8d38f461
EZ
119012012-06-29 Eli Zaretskii <eliz@gnu.org>
11902
2e5a6631
EZ
11903 * xdisp.c (try_window_id): Undo last change.
11904
8d38f461
EZ
11905 * w32.c (getwd): Adjust commentary about startup_dir.
11906 (init_environment): Always call sys_access, even in non-MSVC
11907 builds. Don't chdir to the directory of the Emacs executable.
11908 This undoes code from 1997 which was justified by the need to
11909 "avoid conflicts when removing and renaming directories". But its
11910 downside was that every relative file name was being interpreted
11911 relative to the directory of the Emacs executable, which can never
11912 be TRT. In particular, it broke sys_access when called with
11913 relative file names.
11914 (sys_access): Map GetLastError to errno.
11915
2af3565e
DA
119162012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11917
11918 * window.h (struct window): Change type of 'fringes_outside_margins'
11919 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11920 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11921 Adjust comment.
11922 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11923 to ptrdiff_t.
11924
c8d3a25c 119252012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11926
c8d3a25c
GM
11927 * gnutls.c (emacs_gnutls_handshake):
11928 Add QUIT to make the loop interruptible.
57570cd3 11929
c8d3a25c 119302012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11931
c8d3a25c
GM
11932 * charset.c (init_charset): Make lack of etc/charsets fatal.
11933
3e984ee8
DA
119342012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11935
11936 * editfns.c (region_limit): Fix type mismatch.
11937
ef884f23
DA
119382012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11939
11940 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11941 undefined. Convert from xassert to eassert.
11942 * nsmenu.m: Convert from xassert to eassert.
11943 * nsterm.m: Likewise.
11944
7d7e0027
SM
119452012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11946
11947 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11948
aa754e6a
PE
119492012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11950
11951 Avoid integer overflow on scroll-left and scroll-right.
11952 * window.c (HSCROLL_MAX): New macro.
11953 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11954 overflow when requested scroll falls outside ptrdiff_t range.
11955
80b00b08
DA
119562012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11957
11958 * window.h (struct window): Change type of 'hscroll',
11959 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11960 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11961 Adjust users accordingly.
11962 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11963 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11964 from EMACS_INT to ptrdiff_t.
11965 (make_window): Omit redundant initialization.
11966
62b2bcf6
JB
119672012-06-28 Juanma Barranquero <lekktu@gmail.com>
11968
11969 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11970
45942c7d
DA
119712012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11972
11973 * window.h (struct window): Change type of 'use_time' and
11974 'sequence_number' from Lisp_Object to int.
11975 * frame.c (make_frame): Adjust users accordingly.
11976 * print.c (print_object): Likewise.
11977 * window.c (select_window, Fwindow_use_time, make_parent_window)
11978 (make_window): Likewise.
11979
e509cfa6
DA
119802012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11981
11982 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11983 enabled with --enable-checking=[all,glyphs] configure option.
11984 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11985 adjust comments accordingly.
11986 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11987 undefined, adjust comments accordingly.
11988 * image.c: Likewise.
11989 * scroll.c: Likewise.
11990 * w32fns.c: Likewise.
11991 * w32term.c: Likewise.
11992 * xdisp.c: Likewise.
11993 * xfaces.c: Likewise.
11994 * xfns.c: Likewise.
11995 * xterm.c: Likewise.
11996
a54e2c05
DA
119972012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11998
11999 Generalize run-time debugging checks.
12000 * dispextern.h (XASSERTS): Remove.
12001 * fontset.c (xassert): Remove.
12002 Convert from xassert to eassert.
12003 * alloc.c: Convert from xassert to eassert.
12004 * bidi.c: Likewise.
12005 * dispnew.c: Likewise.
12006 * fns.c: Likewise.
12007 * fringe.c: Likewise.
12008 * ftfont.c: Likewise.
12009 * gtkutil.c: Likewise.
12010 * image.c: Likewise.
12011 * keyboard.c: Likewise.
12012 * menu.c: Likewise.
12013 * process.c: Likewise.
12014 * scroll.c: Likewise.
12015 * sound.c: Likewise.
12016 * term.c: Likewise.
12017 * w32console.c: Likewise.
12018 * w32fns.c: Likewise.
12019 * w32term.c: Likewise.
12020 * window.c: Likewise.
12021 * xdisp.c: Likewise.
12022 * xfaces.c: Likewise.
12023 * xfns.c: Likewise.
12024 * xselect.c: Likewise.
12025 * xterm.c: Likewise.
12026
1ec4b7b2
SM
120272012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
12028
12029 * fns.c (maybe_resize_hash_table): Output message when growing the
12030 purify-hashtable.
12031
2014308a
DA
120322012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12033
12034 * alloc.c (allocate_string_data): Remove dead code.
12035 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
12036 avoid GCC warning about unused macro.
12037
246155eb
DA
120382012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12039
12040 * alloc.c (allocate_string): Omit intervals initialization.
12041 * alloc.c (make_uninit_multibyte_string): Initialize intervals
12042 as in make_pure_string and make_pure_c_string.
12043
43184b7b
DA
120442012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12045
d209e2fb 12046 * alloc.c (allocate_string): Fix last change.
43184b7b 12047
3fe6dd74
DA
120482012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
12049
d209e2fb 12050 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
12051 to memset, add explicit initialization where appropriate.
12052
1ba6038a
GM
120532012-06-27 Glenn Morris <rgm@gnu.org>
12054
12055 * lisp.mk (lisp): Remove paths.elc.
12056
c89926a5
CY
120572012-06-27 Chong Yidong <cyd@gnu.org>
12058
12059 * doc.c (Fsubstitute_command_keys): Fix punctuation.
12060
ed6b3510
JW
120612012-06-26 John Wiegley <johnw@newartisans.com>
12062
1ec4b7b2 12063 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
12064 on Mac OS X Lion: __mod_init_func and __mod_term_func.
12065
ed6b3510
JW
12066 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
12067 when building with Clang.
12068
8edd4a2b
SM
120692012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
12070
12071 * eval.c (Fapply): Allow calling it with a single argument.
12072
f6f62d1b
EZ
120732012-06-26 Eli Zaretskii <eliz@gnu.org>
12074
12075 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
12076 _stricmp and _strnicmp.
12077 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
12078
62efea5e
DA
120792012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12080
12081 * alloc.c (allocate_window): Zero out non-Lisp part of newly
12082 allocated window.
12083 (allocate_process): Likewise for new process.
8edd4a2b 12084 (allocate_terminal): Change to use offsetof.
62efea5e
DA
12085 (allocate_frame): Likewise.
12086 * frame.c (make_frame): Omit redundant initialization.
12087 * window.c (make_parent_window): Use memset.
12088 (make_window): Omit redundant initialization.
12089 * process.c (make_process): Omit redundant initialization.
12090 * terminal.c (create_terminal): Likewise.
12091
42997f4d
DA
120922012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12093
12094 * term.c (delete_tty): Remove redundant call to memset.
12095
1130ecfc
DA
120962012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12097
12098 * alloc.c: Remove build_string.
12099 * lisp.h: Define build_string as static inline. This provides
12100 a better opportunity to optimize away calls to strlen when the
12101 function is called with compile-time constant argument.
12102 * image.c (imagemagick_error): Convert to build_string.
12103 * w32proc.c (sys_spawnve): Likewise.
12104 * xterm.c (x_term_init): Likewise.
12105
cf38a720
PE
121062012-06-26 Paul Eggert <eggert@cs.ucla.edu>
12107
99027bdd
PE
12108 Use sprintf return value instead of invoking strlen on result.
12109 In the old days this wasn't portable, since some sprintf
12110 implementations returned char *. But they died out years ago and
12111 Emacs already assumes sprintf returns int.
12112 Similarly for float_to_string.
12113 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
12114 * ccl.c (ccl_driver):
12115 * character.c (string_escape_byte8):
12116 * data.c (Fnumber_to_string):
12117 * doprnt.c (doprnt):
12118 * print.c (print_object):
12119 * xdisp.c (message_dolog):
12120 * xfns.c (syms_of_xfns):
12121 Use sprintf or float_to_string result to avoid need to call strlen.
12122 * data.c (Fnumber_to_string):
12123 Use make_unibyte_string, since the string must be ASCII.
12124 * lisp.h, print.c (float_to_string): Now returns int length.
12125 * term.c (produce_glyphless_glyph):
12126 Use sprintf result rather than recomputing it.
12127
cf38a720
PE
12128 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
12129 * Makefile.in (ALL_CFLAGS):
12130 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
12131 * gmalloc.c, regex.c: Include <config.h> unconditionally.
12132
3511c784
DA
121332012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12134
0a08eb21 12135 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
12136 strcasecmp if available.
12137 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
12138
fb7da12e
AS
121392012-06-25 Andreas Schwab <schwab@linux-m68k.org>
12140
12141 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
12142 Avoid comma operator.
12143 * menu.c (push_submenu_start, push_submenu_end)
12144 (push_left_right_boundary, push_menu_pane): Likewise.
12145 * msdos.c (dos_rawgetc): Likewise.
12146
afa2ffd8
DA
121472012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12148
12149 * xfns.c (xic_create_fontsetname): Remove redundant calls
12150 to memset.
12151
b3b4476b
PE
121522012-06-25 Paul Eggert <eggert@cs.ucla.edu>
12153
4495ff38
PE
12154 * gtkutil.c (get_utf8_string): Remove redundant assignment.
12155 sprintf already null-terminates its output.
12156
b3b4476b
PE
12157 * xfns.c (x_window): Remove redundant cast.
12158
b00876c9
DA
121592012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
12160
12161 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
12162 `const char *' to `char *' to avoid compiler warning.
12163
d188e26b
PE
121642012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12165
885d1d74
PE
12166 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
12167 instead of truncating it to 63 (admittedly a generous limit).
12168
d188e26b
PE
12169 * process.c: Fix spelling and caps in comments.
12170
e2f560b1
DN
121712012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
12172
e86db54b 12173 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
12174 * sysdep.c (setpgrp): Remove definition, not used in this file.
12175
7583a3a1
JB
121762012-06-24 Juanma Barranquero <lekktu@gmail.com>
12177
12178 * makefile.w32-in: Update dependencies.
12179
696056c2
EZ
121802012-06-24 Eli Zaretskii <eliz@gnu.org>
12181
12182 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
12183 (SYSTIME_H): Add nt/inc/sys/time.h.
12184
12185 * systime.h [WINDOWSNT]: Include sys/time.h.
12186
12187 * s/ms-w32.h (struct timespec): Definition moved from
12188 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
12189
845ca893
PE
121902012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12191
12192 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
12193 * buffer.h (buffer_slot_type_mismatch):
12194 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12195 * eval.c (unwind_to_catch):
12196 * image.c (my_png_error, my_error_exit):
12197 * keyboard.c (quit_throw_to_read_char, user_error)
12198 (Fexit_recursive_edit, Fabort_recursive_edit):
12199 * lisp.h (die, args_out_of_range, args_out_of_range_3)
12200 (wrong_type_argument, buffer_overflow, __executable_start)
12201 (memory_full, buffer_memory_full, string_overflow, Fthrow)
12202 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
12203 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
12204 (fatal):
12205 (child_setup) [!DOS_NT]:
12206 * lread.c (end_of_file_error, invalid_syntax):
12207 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
12208 * puresize.h (pure_write_error):
12209 * search.c (matcher_overflow):
12210 * sound.c (sound_perror, alsa_sound_perror):
12211 * sysdep.c, syssignal.h (croak):
12212 * term.c (maybe_fatal, vfatal):
12213 * textprop.c (text_read_only):
12214 * undo.c (user_error):
12215 * unexmacosx.c (unexec_error):
12216 * xterm.c (x_ins_del_lines, x_delete_glyphs):
12217 Use _Noreturn rather than NO_RETURN.
12218 No need for separate decl merely because of _Noreturn.
12219 * sound.c (sound_warning, parse_sound):
12220 Remove unnecessary forward decls.
12221
f1dd8073
PE
122222012-06-24 Paul Eggert <eggert@cs.ucla.edu>
12223
12224 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
12225 * lisp.h (WAIT_READING_MAX): New macro.
12226 * dispnew.c (Fsleep_for, sit_for):
12227 * keyboard.c (kbd_buffer_get_event):
12228 * process.c (Faccept_process_output):
12229 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
12230 This improves on the previous patch, which introduced a bug
12231 when time_t is unsigned and as wide as intmax_t.
12232 See <http://bugs.gnu.org/9000#51>.
12233
b82c1755
EZ
122342012-06-23 Eli Zaretskii <eliz@gnu.org>
12235
12236 * dispnew.c (sit_for, Fsleep_for):
12237 * keyboard.c (kbd_buffer_get_event):
12238 * process.c (Faccept_process_output): Avoid compiler warnings when
12239 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
12240
ca300656
JB
122412012-06-23 Juanma Barranquero <lekktu@gmail.com>
12242
049ec95b
JB
12243 * makefile.w32-in: Update dependencies.
12244
ca300656
JB
12245 * w32.c (ltime): Add return type and declare static.
12246 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
12247
db7b8d06
PE
122482012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12249
12250 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
12251 Privately reported by Herbert J. Skuhra.
12252 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12253 All uses changed.
12254 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
12255 not make_lisp_timeval, when the argument is of type EMACS_TIME.
12256
0bd8297f
EZ
122572012-06-23 Eli Zaretskii <eliz@gnu.org>
12258
96512555
EZ
12259 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
12260 last argument of make_unibyte_string.
12261
0bd8297f
EZ
12262 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
12263 language ID in the event parameters.
12264
12265 * w32term.c (w32_read_socket): Put the new keyboard codepage into
12266 event.code, not the obscure "character set ID".
12267
63def6b6
CY
122682012-06-23 Chong Yidong <cyd@gnu.org>
12269
12270 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
12271
e8a02204
EZ
122722012-06-23 Eli Zaretskii <eliz@gnu.org>
12273
388cdec0
EZ
12274 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
12275 * w32.c (fdutimens): New function.
12276
12277 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
12278
12279 * s/ms-w32.h (pselect): Redirect to sys_select.
12280
12281 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12282
e8a02204
EZ
12283 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12284 in the logic of incrementing and decrementing the value of
12285 use_relocatable_buffers.
12286
d054f3fb
PE
122872012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12288
12289 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12290 Privately reported by Herbert J. Skuhra.
12291 [__FreeBSD__]: Remove "*/" typo after "#include".
12292 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12293 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12294 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12295 Don't assume EMACS_TIME and struct timeval are the same type.
12296
d35af63c
PE
122972012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12298
12299 Support higher-resolution time stamps (Bug#9000).
12300 The time stamps are only nanosecond-resolution at the C level,
12301 since that's the best that any real-world system supports now.
12302 But they are picosecond-resolution at the Lisp level, as that's
12303 easy, and leaves room for future OS improvements.
12304
12305 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12306 (LIBES): Use it.
12307
12308 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12309 Don't get current time unless it's needed.
12310
12311 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12312 now provides it if it's absent.
12313 (start_atimer): Port to higher-res time stamps.
12314 Check for time stamp overflow. Don't get current time more
12315 often than is needed.
12316
12317 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12318 Include systime.h, not time.h.
12319 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12320
12321 * dired.c: Include stat-time.h.
12322 (Ffile-attributes): File times now have higher resolution.
12323
12324 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12325 (struct image): Timestamp now has higher resolution.
12326
12327 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12328 has at least microseconds now. All uses removed.
12329 (update_frame, update_single_window, update_window, update_frame_1)
12330 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 12331 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
12332
12333 * editfns.c (time_overflow): Now extern.
12334 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12335 (float-time, Fformat_time_string, Fcurrent_time_string)
12336 (Fcurrent_time_zone): Accept and generate higher-resolution
12337 time stamps.
12338 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12339 (decode_time_components, lisp_seconds_argument): New functions.
12340 (make_time): Now static.
12341 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12342 Report an error if the time is invalid, rather than having the caller
12343 do that.
12344
12345 * fileio.c: Include <stat-time.h>
12346 (Fcopy_file): Copy higher-resolution time stamps.
12347 Prefer to set the time stamp via a file descriptor if that works.
12348 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12349 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12350 (Fvisited_file_modtime, Fset_visited_file_modtime):
12351 Support higher-resolution time stamps.
12352
12353 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12354
12355 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12356
12357 * image.c (prepare_image_for_display, clear_image_cache)
12358 (lookup_image): Port to higer-resolution time stamps.
12359
12360 * keyboard.c (start_polling, bind_polling_period):
12361 Check for time stamp overflow.
12362 (read_char, kbd_buffer_get_event, timer_start_idle)
12363 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12364 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12365 Port to higher-resolution time stamps. Do not assume time_t is signed.
12366 (decode_timer): New function. Timers are now vectors of length 9,
12367 not 8, to accommodate the picosecond component.
12368 (timer_check_2): Use it.
12369
12370 * nsterm.m (select_timeout, timeval_subtract): Remove.
12371 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12372 as they're a bit more accurate and handle overflow better.
12373 (ns_select): Change prototype to be compatible with pselect.
12374 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12375 * nsterm.h (ns_select): Adjust prototype.
12376
12377 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12378 us-resolution time stamps.
12379 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12380
12381 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12382
12383 * lisp.h (time_overflow): New decl.
12384 (wait_reading_process_output): First arg is now intmax_t, not int,
12385 to accommodate larger waits.
12386
12387 * process.h (struct Lisp_Process.read_output_delay):
12388 Now counts nanoseconds, not microseconds.
12389 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12390 EMACS_HAS_USECS.
12391 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12392 (wait_reading_process_output):
12393 Port to ns-resolution time stamps.
12394 (Faccept_process_output, wait_reading_process_output):
12395 Check for time stamp overflow. Do not assume time_t is signed.
12396 (select_wrapper): Remove; we now use pselect.
12397 (Fprocess_attributes): Now generates ns-resolution time stamps.
12398
12399 * sysdep.c: Include utimens.h. Don't include utime.h
12400 or worry about struct utimbuf; gnulib does that for us now.
12401 (gettimeofday): Remove; gnulib provides a substitute.
12402 (make_timeval): New function.
12403 (set_file_times): Now sets ns-resolution time stamps.
12404 New arg FD; all uses changed.
12405 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12406 (system_process_attributes):
12407 Now returns ns-resolution time stamp. All uses changed.
12408 Check for time stamp overflow.
12409
12410 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12411 provides a substitute now.
12412
12413 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12414 since it guarantees struct timespec.
12415 (EMACS_TIME): Now struct timespec, so that we can support
12416 ns-resolution time stamps.
12417 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12418 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12419 (EMACS_USECS): Remove.
12420 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12421 so multiply the arg by 1000 before storing it.
12422 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12423 New macros.
12424 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12425 Port to ns-resolution time stamps.
12426 (EMACS_TIME_NEG_P): Remove; replaced by....
12427 (EMACS_TIME_SIGN): New macro.
12428 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12429 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12430 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12431 (make_timeval, make_lisp_time, decode_time_components): New decls.
12432 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12433 that it mishandled time_t overflow. You can't compare by subtracting!
12434 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12435 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12436
12437 * term.c: Include <sys/time.h>.
12438 (timeval_to_Time): New function, for proper overflow wraparound.
12439 (term_mouse_position, term_mouse_click): Use it.
12440
12441 * undo.c (record_first_change): Support higher-resolution time stamps
12442 in the undo buffer.
12443 (Fprimitive_undo): Use them when restoring time stamps.
12444
12445 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12446 (w32_get_internal_run_time):
12447 Port to higher-resolution Emacs time stamps.
12448 (ltime): Now accepts single 64-bit integer, as that's more convenient
12449 for callers.
12450
12451 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12452
12453 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12454 for compatibility with pselect. Support ns-resolution time stamps.
12455
12456 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12457
12458 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12459 Check for time stamp overflow, and support ns-resolution time stamps.
12460
12461 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12462 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12463 (timeval_subtract): Remove; no longer needed.
12464 (XTflash, XTring_bell, x_wait_for_event):
12465 Port to ns-resolution time stamps. Don't assume time_t is signed.
12466
b6a92dfe
CY
124672012-06-22 Chong Yidong <cyd@gnu.org>
12468
12469 * xdisp.c (x_consider_frame_title): Revert last change.
12470
d251c37c
EZ
124712012-06-22 Eli Zaretskii <eliz@gnu.org>
12472
12473 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12474 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12475 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12476 staticidx goes up to 1597 out of 1600 = 0x640.)
12477
f10deafb
PE
124782012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12479
12480 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12481 Otherwise, the umask might be mistakenly 0 while handling input signals.
12482
ec6de1e2
SM
124832012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12484
12485 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12486
28be1ada
DA
124872012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12488
12489 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12490 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12491 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12492 access to `contents' member of Lisp_Vector objects with AREF and ASET
12493 where appropriate.
12494
c6bf3022
CY
124952012-06-19 Chong Yidong <cyd@gnu.org>
12496
12497 * frame.c (delete_frame): When selecting a frame on a different
12498 text terminal, do not alter the terminal's top-frame.
12499
12500 * xdisp.c (format_mode_line_unwind_data): Record the target
12501 frame's selected window and its terminal's top-frame.
12502 (unwind_format_mode_line): Restore them.
12503 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12504 Callers changed.
12505 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12506 since tty frames can be explicitly named.
12507 (prepare_menu_bars): Likewise.
12508
12509 * term.c (Ftty_top_frame): New function.
12510
defd4196
PE
125112012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12512
12513 Port byte-code-meter to modern targets.
12514 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12515 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 12516 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
12517 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12518 (METER_1, METER_2): Simplify.
12519
1053a871
SM
125202012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12521
12522 * data.c (Fdefalias): Return `symbol' (bug#11686).
12523
b7e8d081
MR
125242012-06-18 Martin Rudalics <rudalics@gmx.at>
12525
12526 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
12527 gets killed during executing of this function (Bug#11665).
12528 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
12529 (Vkill_buffer_query_functions): In doc-string say that functions
12530 run by this hook should not change the current buffer.
12531
7ea2b339
PE
125322012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12533
12534 Fix recently-introduced process.c problems found by static checking.
12535 * process.c (write_queue_push, write_queue_pop, send_process):
12536 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12537 (write_queue_pop): Fix pointer signedness problem.
12538 (send_process): Remove unused local.
12539
96a313a1
CY
125402012-06-17 Chong Yidong <cyd@gnu.org>
12541
12542 * xdisp.c (redisplay_internal): No need to redisplay terminal
12543 frames that are not on top.
12544
20ca2e94
TN
125452012-06-17 Troels Nielsen <bn.troels@gmail.com>
12546
12547 * process.c (make_process): Initialize write_queue.
12548 (write_queue_push, write_queue_pop): New functions.
12549 (send_process): Use them to maintain correct ordering of process
12550 writes (Bug#10815).
12551
9a900ca9
PE
125522012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12553
310fbfa8
PE
12554 * lisp.h (eassert): Assume C89 or later.
12555 This removes the need for CHECK.
12556 (CHECK): Remove. Its comments about always evaluating its
12557 argument were confusing, as 'eassert' typically does not evaluate
12558 its argument.
12559
27bb1ca4
PE
12560 * coding.c (produce_chars): Use ptrdiff_t, not int.
12561
9a900ca9
PE
12562 * xterm.c (x_draw_underwave): Check for integer overflow.
12563 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12564
41b7f8bc 125652012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
12566
12567 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12568 referenced (Bug#11583).
12569
9b0e3eba
AA
125702012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12571
12572 Implement wave-style variant of underlining.
12573 * dispextern.h (face_underline_type): New enum.
12574 (face): Add field for underline type.
12575 * nsterm.m (ns_draw_underwave): New function.
12576 (ns_draw_text_decoration): Use it.
12577 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12578 New functions.
12579 (x_draw_glyph_string): Use them.
12580 * xfaces.c (Qline, Qwave): New Lisp objects.
12581 (check_lface_attrs, merge_face_ref)
1053a871
SM
12582 (Finternal_set_lisp_face_attribute, realize_x_face):
12583 Handle wave-style underline face attributes.
9b0e3eba
AA
12584 * xterm.c (x_draw_underwave): New function.
12585 (x_draw_glyph_string): Use it.
12586
0fb52f11
JB
125872012-06-16 Juanma Barranquero <lekktu@gmail.com>
12588
12589 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12590 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12591 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12592 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12593 ($(BLD)/w32select.$(O)): Update dependencies.
12594
e5560ff7
AS
125952012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12596
12597 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12598 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12599 * character.c (_fetch_multibyte_char_p): Remove.
12600 * alloc.c: Include "character.h" before "buffer.h".
12601 * bidi.c: Likewise.
12602 * buffer.c: Likewise.
12603 * bytecode.c: Likewise.
12604 * callint.c: Likewise.
12605 * callproc.c: Likewise.
12606 * casefiddle.c: Likewise.
12607 * casetab.c: Likewise.
12608 * category.c: Likewise.
12609 * cmds.c: Likewise.
12610 * coding.c: Likewise.
12611 * composite.c: Likewise.
12612 * dired.c: Likewise.
12613 * dispnew.c: Likewise.
12614 * doc.c: Likewise.
12615 * dosfns.c: Likewise.
12616 * editfns.c: Likewise.
12617 * emacs.c: Likewise.
12618 * fileio.c: Likewise.
12619 * filelock.c: Likewise.
12620 * font.c: Likewise.
12621 * fontset.c: Likewise.
12622 * fringe.c: Likewise.
12623 * indent.c: Likewise.
12624 * insdel.c: Likewise.
12625 * intervals.c: Likewise.
12626 * keyboard.c: Likewise.
12627 * keymap.c: Likewise.
12628 * lread.c: Likewise.
12629 * macros.c: Likewise.
12630 * marker.c: Likewise.
12631 * minibuf.c: Likewise.
12632 * nsfns.m: Likewise.
12633 * nsmenu.m: Likewise.
12634 * print.c: Likewise.
12635 * process.c: Likewise.
12636 * regex.c: Likewise.
12637 * region-cache.c: Likewise.
12638 * search.c: Likewise.
12639 * syntax.c: Likewise.
12640 * term.c: Likewise.
12641 * textprop.c: Likewise.
12642 * undo.c: Likewise.
12643 * unexsol.c: Likewise.
12644 * w16select.c: Likewise.
12645 * w32fns.c: Likewise.
12646 * w32menu.c: Likewise.
12647 * window.c: Likewise.
12648 * xdisp.c: Likewise.
12649 * xfns.c: Likewise.
12650 * xmenu.c: Likewise.
12651 * xml.c: Likewise.
12652 * xselect.c: Likewise.
12653
2f07e6af
EZ
126542012-06-16 Eli Zaretskii <eliz@gnu.org>
12655
1053a871
SM
12656 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12657 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 12658 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
12659 row.
12660 (handle_face_prop): Use chunk-relative overlay string index when
12661 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
12662 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12663 the rightmost. (Bug#11720)
2f07e6af 12664
29b83cec
AS
126652012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12666
12667 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12668 (CATEGORY_MEMBER): Enforce 1/0 value.
12669 * category.c (_temp_category_set): Remove.
12670
4c5501e9
EZ
126712012-06-16 Eli Zaretskii <eliz@gnu.org>
12672
12673 * window.c (Fdelete_other_windows_internal)
12674 (Fdelete_window_internal): Don't access frame's mouse highlight
12675 info of the initial frame. (Bug#11677)
12676
2b570124
PE
126772012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12678
e93864f9
PE
12679 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12680 Assume USE_2_TAGS_FOR_INTS.
12681 (xreload): Adjust $tagmask width to match recent lisp.h change.
12682
2b570124
PE
12683 Simplify lisp.h in minor ways that should not affect code.
12684 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12685 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12686 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12687 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12688 (INTTYPEBITS): New macro, for clarity.
12689 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
12690 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12691 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
12692 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12693 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12694
81755f69
JB
126952012-06-13 Juanma Barranquero <lekktu@gmail.com>
12696
12697 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12698
16192a57
GM
126992012-06-13 Glenn Morris <rgm@gnu.org>
12700
12701 * s/bsd-common.h (BSD4_3):
12702 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12703
646b5f55
AS
127042012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12705
12706 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12707 instead of union.
12708 (XLI, XIL): Define.
1053a871
SM
12709 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12710 Use them.
12711 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 12712 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 12713 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
12714 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12715 * frame.c (delete_frame): Remove outdated comment.
12716 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12717 USE_LISP_UNION_TYPE.
12718 (Fw32_unregister_hot_key): Likewise.
12719 (Fw32_toggle_lock_key): Likewise.
12720 * w32menu.c (add_menu_item): Likewise.
12721 (w32_menu_display_help): Use XIL instead of checking
12722 USE_LISP_UNION_TYPE.
12723 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12724 (init_heap): Likewise.
12725 * w32term.c (w32_read_socket): Update comment.
12726
1d3823c9
GM
127272012-06-13 Glenn Morris <rgm@gnu.org>
12728
c62ff706
GM
12729 * s/usg5-4-common.h, src/s/unixware.h:
12730 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12731
1d3823c9
GM
12732 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12733
bfe3e0a2
PE
127342012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12735
12736 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12737 * alloc.c (make_number) [!defined make_number]:
12738 Remove, as lisp.h always defines this now.
12739 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12740 (roundup_size): Verify that it is a power of 2.
12741 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12742 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12743 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12744 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12745 USE_LSB_TAG now is always defined to be either 0 or 1.
12746 All uses changed.
12747 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12748 code works fine either way, and efficiency is not a concern here,
12749 as the union type is for debugging, not for production.
12750 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12751 Use an inline function on all platforms when using the union type,
12752 since this is simpler and 'static inline' can be used portably
12753 within Emacs now.
12754 (LISP_INITIALLY_ZERO): New macro.
12755 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12756 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12757
45fa9c0f
GM
127582012-06-12 Glenn Morris <rgm@gnu.org>
12759
b4492cba
GM
12760 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12761
12762 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 12763
45fa9c0f
GM
12764 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12765 Move BROKEN_SIGIO to configure.
12766
12767 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12768 Move NO_TERMIO to configure.
12769
0e25d334
CY
127702012-06-12 Chong Yidong <cyd@gnu.org>
12771
12772 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12773 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12774 MagickExportImagePixels is undefined.
12775
43682bb6
PE
127762012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12777
12778 * image.c (imagemagick_load_image): Remove unused label.
12779
a9be7d2b
GM
127802012-06-11 Glenn Morris <rgm@gnu.org>
12781
12782 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12783 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12784 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12785 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12786
3017f87f
SM
127872012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12788
12789 * alloc.c (make_byte_code): New function.
12790 (Fmake_byte_code): Use it. Don't purify here.
12791 * lread.c (read1): Use it as well to avoid extra allocation.
12792
1b9b4cf4
CY
127932012-06-11 Chong Yidong <cyd@gnu.org>
12794
12795 * image.c (imagemagick_load_image): Implement transparency.
12796
95988fcf
AS
127972012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12798
12799 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12800 account for preceding backslashes. (Bug#11663)
12801
cd4eb164
CY
128022012-06-09 Chong Yidong <cyd@gnu.org>
12803
12804 * term.c: Support italics in capable terminals (Bug#9652).
12805 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12806 (turn_on_face): Output using TS_enter_italic_mode if available.
12807 Don't handle unused blinking and alt-charset cases.
12808 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12809 and tty_alt_charset_p cases.
12810 (tty_capable_p, init_tty): Support italics.
12811
12812 * termchar.h (struct tty_display_info): Add field for italics.
12813 Remove unused blink field.
12814
12815 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12816 Handle slant.
12817
12818 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12819 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12820 tty_alt_charset_p. Add tty_italic_p.
12821
ff88beb8
MA
128222012-06-09 Michael Albinus <michael.albinus@gmx.de>
12823
12824 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12825 dbus_type_is_basic if available.
12826 (xd_extract_signed, xd_extract_unsigned): Rename from
12827 extract_signed and extract_unsigned, respectively. Adapt callers.
12828
44286096
CY
128292012-06-09 Chong Yidong <cyd@gnu.org>
12830
1682701f
CY
12831 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12832
44286096
CY
12833 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12834 case (Bug#9752).
12835
d86feb17
PE
128362012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12837
12838 * xdisp.c (vmessage): Treat frame message as multibyte.
12839 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12840 would generate the diagnostic "Making \302\247 buffer-local while
12841 let-bound!".
12842
d5c20fe8
EZ
128432012-06-08 Eli Zaretskii <eliz@gnu.org>
12844
12845 * dispnew.c (showing_window_margins_p): Undo last change, which
12846 was done due to an inadvertent commit.
12847 (adjust_frame_glyphs_for_frame_redisplay): Do call
12848 showing_window_margins_p.
12849
513749ee
SM
128502012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12851
12852 * eval.c (Fmake_var_non_special): New primitive.
12853 (syms_of_eval): Defsubr it.
12854 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12855
d4a8f5c1
JB
128562012-06-08 Juanma Barranquero <lekktu@gmail.com>
12857
12858 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12859 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12860
8bbbc977
EZ
128612012-06-08 Eli Zaretskii <eliz@gnu.org>
12862
12863 * alloc.c (allocate_vectorlike): Fix last change.
12864
f3372c87
DA
128652012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12866
12867 Block-based vector allocation of small vectors.
12868 * lisp.h (struct vectorlike_header): New field `nbytes',
12869 adjust comment accordingly.
12870 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 12871 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12872 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12873 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
f4ad7ea1
JB
12874 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12875 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12876 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
f3372c87
DA
12877 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12878 (roundup_size): New constant.
12879 (struct vector_block): New data type.
12880 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12881 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12882 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12883 (sweep_vectors): New functions.
12884 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12885 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12886 or equal to VBLOCK_BYTES_MAX.
12887 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12888 (init_alloc_once): Add call to init_vectors.
12889
4f18a4ed
SM
128902012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12891
12892 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12893
86f158bc
PE
128942012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12895
12896 * doprnt.c (doprnt): Truncate multibyte char correctly.
12897 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12898 would mishandle a string argument "Xc" if X was a multibyte
12899 character of length 2: it would truncate after X's first byte
12900 rather than including all of X.
12901
c5cfcbe0
CY
129022012-06-06 Chong Yidong <cyd@gnu.org>
12903
12904 * buffer.c (word_wrap): Doc fix.
12905
c05cf390
PE
129062012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12907
12908 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12909
0c3461de
GM
129102012-06-03 Glenn Morris <rgm@gnu.org>
12911
12912 * xdisp.c (tool-bar-style): Doc fix.
12913
c71232db
UM
129142012-06-03 Ulrich Müller <ulm@gentoo.org>
12915
12916 * Makefile.in (PAXCTL): Define.
12917 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12918 binary via PaX flags if the paxctl utility is available.
12919 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12920 Restore PaX flags to their default. (Bug#11398)
12921
383f7350
CY
129222012-06-03 Chong Yidong <cyd@gnu.org>
12923
12924 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12925 buffer (Bug#11226).
12926
5f2c76c6
CY
129272012-06-03 Chong Yidong <cyd@gnu.org>
12928
12929 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12930 (note_mode_line_or_margin_highlight): If there is no help echo,
12931 use mode-line-default-help-echo. Handle the case where the mouse
12932 position is past the end of the mode line string.
12933
12934 * buffer.c (buffer_local_value_1): New function, split from
12935 Fbuffer_local_value; can return Qunbound.
12936 (Fbuffer_local_value): Use it.
12937 (Vmode_line_format): Docstring tweaks.
12938
773d47f6
PE
129392012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12940
12941 * sysdep.c (system_process_attributes): Improve comment.
12942
f2d6a3df
SM
129432012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12944
12945 * keyboard.c: Export real-this-command to Elisp.
12946 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12947 and DEFVAR it. Update all users.
12948
63810350
PE
129492012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12950
7bd5c1f4
PE
12951 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12952
63810350
PE
12953 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12954 Convert pctcpu and pctmem to Lisp float properly.
12955 Let the compiler fold better, as 100.0/0x8000 is exact.
12956
a2821611
AS
129572012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12958
12959 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12960 cons_block.
12961
5fceba1d
PE
129622012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12963
12964 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12965
c98ff5dd
DA
129662012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12967
12968 For a 'struct window', replace some Lisp_Object fields to
12969 bitfields where appropriate, remove unused fields.
12970 * window.h (struct window): Remove unused 'last_mark_x' and
12971 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12972 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12973 Change type of 'force_start', 'optional_new_start',
12974 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12975 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12976
ca34e0be
PE
129772012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12978
12979 Pacify gcc -Wdouble-precision when using Xaw.
12980 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12981 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12982 Use 'float' consistently, rather than 'float' in most places
12983 and 'double' in a couple of places.
12984
efc00ab1 129852012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12986
12987 * xdisp.c (handle_stop): Detect whether we have overlay strings
12988 loaded by testing it->current.overlay_string_index to be
12989 non-negative, instead of checking whether n_overlay_strings is
12990 positive. (Bug#11587)
12991
efc00ab1 129922012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12993
12994 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12995
12996 * doc.c (Fsubstitute_command_keys): Doc fix.
12997
efc00ab1 129982012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12999
13000 * search.c (search_buffer): Remove calls to
13001 r_alloc_inhibit_buffer_relocation, as it is now called by
13002 maybe_unify_char, which was the cause of relocation of buffer text
13003 in bug#11519.
13004
efc00ab1 130052012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
13006
13007 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
13008 for the duration of call to load_charset, to avoid problems with
13009 callers of maybe_unify_char that access buffer text through C
13010 pointers.
13011
13012 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
13013 decrement the inhibition flag, instead of just setting or
13014 resetting it.
13015
ba93a187
PE
130162012-05-31 Paul Eggert <eggert@cs.ucla.edu>
13017
13018 Remove obsolete '#define static' cruft.
13019 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
13020 This #undef was "temporary" in 2000; it is no longer needed
13021 now that '#define static' has gone away.
13022 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
13023 (gray_bitmap_bits): Remove; no longer needed.
13024 All uses replaced with definiens.
13025 * xterm.c: Include "bitmaps/gray.xbm".
13026
9e4bf381
PE
130272012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13028
13029 Clean up __executable_start, monstartup when --enable-profiling.
13030 The following changes affect the code only when profiling.
13031 * dispnew.c (__executable_start): Rename from safe_bcopy.
13032 Define only on platforms that need it.
13033 * emacs.c: Include <sys/gmon.h> when profiling.
13034 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
13035 (__executable_start): Remove decl, since lisp.h does it now.
13036 (safe_bcopy): Remove decl; no longer has that name.
13037 (main): Coalesce #if into single bit of code, for simplicity.
13038 Cast pointers to uintptr_t, since standard libraries want integers
13039 and not pointers.
13040 * lisp.h (__executable_start): New decl.
13041
32d72c2f
GM
130422012-05-31 Glenn Morris <rgm@gnu.org>
13043
13044 * image.c (Fimagemagick_types): Doc fix.
13045
baac5bc7
JM
130462012-05-30 Jim Meyering <meyering@redhat.com>
13047
13048 * callproc.c (Fcall_process_region): Include directory component
13049 in mkstemp error message (Bug#11586).
13050
72cb32cf
PE
130512012-05-30 Paul Eggert <eggert@cs.ucla.edu>
13052
13053 * alloc.c, lisp.h (make_pure_vector): Now static.
13054
61b108cc
SM
130552012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
13056
13057 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
13058 Move to byte-run.el.
13059 (Fautoload): Do the hash-doc more carefully.
13060 * data.c (Fdefalias): Purify definition, except for keymaps.
13061 (Qdefun): Move from eval.c.
13062 * lisp.h (Qdefun): Remove.
13063 * lread.c (read1): Tiny simplification.
13064
471fe23d
TN
130652012-05-29 Troels Nielsen <bn.troels@gmail.com>
13066
934f3f58 13067 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
13068 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
13069 Bug#9642, but explicitly check that the buffer the overlay would
13070 be moved to is live and rearrange lines to make sure that errors
13071 will not put the overlay in an inconsistent state.
13072 (Fdelete_overlay): Cosmetics.
13073
85d0efd1
EZ
130742012-05-28 Eli Zaretskii <eliz@gnu.org>
13075
13076 * w32term.c (my_bring_window_to_top): New function.
13077 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
13078 could be different from the original one.
13079 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
13080 (Bug#11513)
13081
13082 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
13083 by calling BringWindowToTop.
13084
13085 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
13086 (WM_EMACS_END): Increase by one.
13087
da92a98c
PE
130882012-05-28 Paul Eggert <eggert@cs.ucla.edu>
13089
13090 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
13091 This avoids undefined behavior that might cause the eassert
13092 to not catch an out-of-range value.
13093
74d1f848
JB
130942012-05-28 Juanma Barranquero <lekktu@gmail.com>
13095
13096 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
13097 Update dependencies.
13098
9e1a06fc
EZ
130992012-05-27 Eli Zaretskii <eliz@gnu.org>
13100
13101 * bidi.c (bidi_mirror_char): Fix last change.
13102
f3dd7312
AS
131032012-05-27 Andreas Schwab <schwab@linux-m68k.org>
13104
13105 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
13106 when referring to sectname field in printf format.
13107
81899c91
PE
131082012-05-27 Paul Eggert <eggert@cs.ucla.edu>
13109
57b81a9f
PE
13110 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
13111 Only r_alloc_inhibit_buffer_relocation needed to be added;
13112 the others were already declared.
13113
81899c91
PE
13114 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
13115 before checking whether it's out of range. Put the check inside
13116 eassert. See
13117 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
13118
33017faf 131192012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
13120
13121 * callproc.c (Fcall_process): Restore a line that was accidentally
13122 commented out in the 2011-02-13 change (bug#11547).
13123
33017faf 131242012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
13125
13126 * lisp.h [REL_ALLOC]: Add prototypes for external functions
13127 defined on ralloc.c.
13128
13129 * buffer.c [REL_ALLOC]: Remove prototypes of
13130 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
13131 they are now on lisp.h.
13132
13133 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
13134
13135 * search.c (search_buffer): Use it to inhibit relocation of buffer
13136 text while re_search_2 is doing its job, because re_search_2 is
13137 passed C pointers to buffer text. (Bug#11519)
13138
23415acf
EZ
13139 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
13140 Update value to 24.
13141
44e27368
EZ
13142 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
13143 state after an additional call to move_it_in_display_line_to, keep
13144 the values of it->max_ascent and it->max_descent found for the
13145 entire line.
13146 (pos_visible_p): Revert the comparison against bottom_y to what it
13147 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
13148 (Bug#11464)
13149
c1892f11
PE
131502012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13151
13152 Fix coding-related core dumps with gcc -ftrapv.
13153 The code was computing A - B, where A and B are pointers, and B is
13154 random garbage. This can lead to core dumps on platforms that
13155 have special pointer registers, and it also leads to core dumps on
13156 x86-64 when compiled with gcc -ftrapv. The fix is to compute
13157 A - B only when B is initialized properly.
13158 * coding.c (coding_set_source, coding_set_destination): Return void.
13159 (coding_change_source, coding_change_destinations): New functions,
13160 with the old behaviors of coding_set_source and coding_set_destination.
13161 All callers that need an offset changed to use these new functions.
13162
eb7afdad
GM
131632012-05-26 Glenn Morris <rgm@gnu.org>
13164
13165 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
13166
f12fdf02
EZ
131672012-05-26 Eli Zaretskii <eliz@gnu.org>
13168
53a63be6 13169 Extend mouse support on W32 text-mode console.
61b108cc
SM
13170 * xdisp.c (draw_row_with_mouse_face):
13171 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 13172
eb3f6f01 13173 * w32console.c: Include window.h.
61b108cc
SM
13174 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
13175 New functions.
eb3f6f01
EZ
13176 (initialize_w32_display): Initialize mouse-highlight data.
13177
53a63be6
EZ
13178 * w32inevt.c: Include termchar.h and window.h.
13179 (do_mouse_event): Support mouse-autoselect-window. When the mouse
13180 moves, call note_mouse_highlight. If help_echo changed, call
13181 gen_help_event to produce help-echo message in the echo area.
13182 Call clear_mouse_face if mouse_face_hidden is set in the mouse
13183 highlight info.
13184
4cfd81f6
PE
131852012-05-26 Paul Eggert <eggert@cs.ucla.edu>
13186
13187 * lread.c (read1): Simplify slightly to avoid an overflow warning
13188 with GCC 4.7.0 on x86-64.
13189
4446092a
EZ
131902012-05-26 Eli Zaretskii <eliz@gnu.org>
13191
13192 * bidi.c (bidi_mirror_char): Revert last change: an int is
13193 definitely wide enough here.
13194
42b2a986 131952012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 13196
42b2a986 13197 Fix integer width and related bugs (Bug#9874).
eb106a49 13198 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
13199 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
13200 (string_bytes, check_sblock, allocate_string_data):
13201 (compact_small_strings, Fmake_bool_vector, make_string)
13202 (make_unibyte_string, make_multibyte_string)
13203 (make_string_from_bytes, make_specified_string)
13204 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
13205 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
13206 (mark_vectorlike):
13207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13208 (allocate_pseudovector):
13209 Use int, not EMACS_INT, where int is wide enough.
13210 (inhibit_garbage_collection, Fgarbage_collect):
13211 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13212 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
13213 int might not be wide enough.
13214 (bidi_cache_search, bidi_cache_find, bidi_init_it)
13215 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
13216 (bidi_at_paragraph_end, bidi_find_paragraph_start)
13217 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
13218 (bidi_level_of_next_char, bidi_move_to_visually_next):
13219 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13220 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
13221 (Fkill_buffer, Fset_buffer_major_mode)
13222 (advance_to_char_boundary, Fbuffer_swap_text)
13223 (Fset_buffer_multibyte, overlays_at, overlays_in)
13224 (overlay_touches_p, struct sortvec, record_overlay_string)
13225 (overlay_strings, recenter_overlay_lists)
13226 (adjust_overlays_for_insert, adjust_overlays_for_delete)
13227 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
13228 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
13229 (Foverlay_recenter, last_overlay_modification_hooks_used)
13230 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
13231 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
13232 (validate_region): Omit unnecessary test for b <= e,
13233 since that's guaranteed by the previous test.
d311d28c
PE
13234 (adjust_overlays_for_delete): Avoid pos + length overflow.
13235 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
13236 (report_overlay_modification):
13237 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13238 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
13239 Omit pointer cast, which isn't needed anyway, and doesn't work
13240 after the EMACS_INT -> ptrdiff_t change.
02481186 13241 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
13242 * buffer.h: Adjust decls to match defn changes elsewhere.
13243 (struct buffer_text, struct buffer):
13244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13245 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
13246 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
13247 not int, to avoid needless 32-bit limit on 64-bit hosts.
13248 (exec_byte_code): Use tighter memory-full test, one that checks
13249 for alloca overflow. Don't compute the address of the object just
13250 before an array, as that's not portable. Use EMACS_INT, not
13251 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
13252 * callint.c (Fcall_interactively):
13253 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13254 * callproc.c (call_process_kill, Fcall_process):
13255 Don't assume pid_t fits into an Emacs fixnum.
13256 (call_process_cleanup, Fcall_process, child_setup):
13257 Don't assume pid_t fits into int.
13258 (call_process_cleanup, Fcall_process, delete_temp_file)
13259 (Fcall_process_region):
13260 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13261 (Fcall_process): Simplify handling of volatile integers.
13262 Use int, not EMACS_INT, where int will do.
13263 * casefiddle.c (casify_object, casify_region, operate_on_word)
13264 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
13265 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13266 (casify_object): Avoid integer overflow when overallocating buffer.
13267 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 13268 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
13269 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
13270 * category.h (CATEGORYP): Don't assume arg is nonnegative.
13271 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
13272 integers are now checked earlier. All uses replaced with XINT.
13273 (ccl_driver):
13274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13275 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
13276 (ccl_driver, Fregister_code_conversion_map):
13277 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
13278 (resolve_symbol_ccl_program): Check that vector header is in range.
13279 Always copy the vector, so that we can check its contents reliably
13280 now rather than having to recheck each instruction as it's being
13281 executed. Check that vector words fit in 'int'.
13282 (ccl_get_compiled_code, Fregister_ccl_program)
13283 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13284 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13285 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13286 contents are in range.
13287 (Fccl_execute_on_string): Check that status is in range.
13288 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13289 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13290 Accept and return EMACS_INT, not int, because callers can pass values
13291 out of 'int' range.
13292 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13293 (multibyte_chars_in_text, parse_str_as_multibyte)
13294 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13295 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13296 (string_escape_byte8, Fget_byte):
13297 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 13298 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
13299 avoid mishandling large integers.
13300 * character.h: Adjust decls to match defn changes elsewhere.
13301 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13302 (Ffind_charset_region):
13303 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13304 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13305 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 13306 Don't assume fixnum fits in int.
d311d28c
PE
13307 (load_charset_map_from_vector, Fmap_charset_chars):
13308 Remove now-unnecessary CHECK_NATNUMs.
13309 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
13310 Don't rely on undefined behavior with signed left shift overflow.
13311 Don't assume unsigned int fits into fixnum, or that fixnum fits
13312 into unsigned int. Don't require max_code to be a valid fixnum;
13313 that's not true for gb10830 4-byte on a 32-bit host. Allow
13314 invalid_code to be a cons, for the same reason. Require code_offset
13315 to be a character. Avoid int overflow if max_char is close
13316 to INT_MAX.
13317 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13318 this is intended anyway and avoids some undefined behavior.
13319 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13320 INDEX_TO_CODE_POINT, as that's what it expects.
13321 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
13322 * charset.h (DECODE_CHAR): Return int, not unsigned;
13323 this is what was intended anyway, and it avoids undefined behavior.
13324 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13325 integer-overflow issues.
13326 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13327 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13328 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
13329 * chartab.c (Fmake_char_table, Fset_char_table_range)
13330 (uniprop_get_decoder, uniprop_get_encoder):
13331 Don't assume fixnum fits in int.
13332 * cmds.c (move_point): New function, that does the gist of
13333 Fforward_char and Fbackward_char, but does so while checking
13334 for integer overflow more accurately.
c96e5d6a 13335 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
13336 (Fforward_line, Fend_of_line, internal_self_insert)
13337 (internal_self_insert):
13338 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13339 Fix a FIXME, by checking for integer overflow when calculating
13340 target_clm and actual_clm.
13341 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 13342 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
13343 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13344 (coding_alloc_by_making_gap, alloc_destination)
13345 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13346 (encode_coding_utf_16, detect_coding_emacs_mule)
13347 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13348 (detect_coding_iso_2022, decode_coding_iso_2022)
13349 (encode_invocation_designation, encode_designation_at_bol)
13350 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13351 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13352 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13353 (encode_coding_ccl, encode_coding_raw_text)
13354 (detect_coding_charset, decode_coding_charset)
13355 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13356 (produce_composition, produce_charset, produce_annotation)
13357 (decode_coding, handle_composition_annotation)
13358 (handle_charset_annotation, consume_chars, decode_coding_gap)
13359 (decode_coding_object, encode_coding_object, detect_coding_system)
13360 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13361 (code_convert_region, code_convert_string)
8f50130c
PE
13362 (Fdefine_coding_system_internal)
13363 (coding_set_source, coding_set_destination):
d311d28c
PE
13364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13365 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13366 (Fdefine_coding_system_internal):
13367 Don't assume fixnums fit in int.
13368 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 13369 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
13370 (Funencodable_char_position, Fcheck_coding_systems_region)
13371 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 13372 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 13373 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 13374 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 13375 Don't access memory outside of the args array.
d311d28c 13376 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
13377 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13378 result of ENCODE_CHAR.
d311d28c
PE
13379 * coding.h: Adjust decls to match defn changes elsewhere.
13380 (struct coding_system):
13381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13382 * composite.c (get_composition_id, find_composition)
13383 (run_composition_function, update_compositions)
13384 (compose_text, composition_gstring_put_cache)
13385 (composition_gstring_p, composition_gstring_width)
13386 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13387 (composition_compute_stop_pos, composition_reseat_it)
13388 (composition_update_it, struct position_record)
13389 (find_automatic_composition, composition_adjust_point)
13390 (Fcomposition_get_gstring, Ffind_composition_internal):
13391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13392 (update_compositions):
13393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13394 * composite.h: Adjust decls to match defn changes elsewhere.
13395 (struct composition):
13396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13397 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13398 Do not attempt to compute the address of the object just before a
13399 buffer; this is not portable.
13400 (Faref, Faset):
13401 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13402 (Faset): Use int, not EMACS_INT, where int is wide enough.
13403 (Fstring_to_number): Don't assume fixnums fit in int.
13404 (Frem): Don't assume arg is nonnegative.
13405 * dbusbind.c (xd_append_arg): Check for integers out of range.
13406 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 13407 (extract_signed, extract_unsigned): New functions.
243e0530
PE
13408 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13409 (xd_get_connection_references): Return ptrdiff_t, not int.
13410 All uses changed.
13411 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13412 (xd_read_message_1):
13413 Use int, not unsigned, where the dbus API uses int.
13414 (Fdbus_message_internal): Don't overflow mtype.
13415 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
13416 * dired.c (directory_files_internal, file_name_completion, scmp)
13417 (file_name_completion_stat):
13418 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13419 (file_name_completion): Don't overflow matchcount.
13420 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13421 * dispextern.h: Adjust decls to match defn changes elsewhere.
13422 (struct text_pos, struct glyph, struct bidi_saved_info)
13423 (struct bidi_string_data, struct bidi_it, struct composition_it)
13424 (struct it):
13425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13426 (struct display_pos, struct composition_it, struct it):
13427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13428 * dispnew.c (increment_matrix_positions)
13429 (increment_row_positions, mode_line_string)
13430 (marginal_area_string):
13431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 13432 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
13433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13434 (duration_to_sec_usec): New function, to check for overflow better.
13435 (Fsleep_for, sit_for): Use it.
13436 * doc.c (get_doc_string, store_function_docstring):
13437 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13438 (get_doc_string, Fsnarf_documentation):
13439 Use int, not EMACS_INT, where int is wide enough.
13440 (get_doc_string):
13441 Use SAFE_ALLOCA, not alloca.
13442 Check for overflow when converting EMACS_INT to off_t.
13443 * doprnt.c (doprnt):
13444 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13445 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13446 Don't assume uid_t fits into fixnum.
13447 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13448 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13449 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13450 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13451 (general_insert_function)
13452 (Finsert_char, make_buffer_string, make_buffer_string_both)
13453 (update_buffer_properties, Fbuffer_substring)
13454 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13455 (Fsubst_char_in_region, check_translation)
13456 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13457 (transpose_markers, Ftranspose_regions):
13458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13459 (clip_to_bounds): Move to lisp.h as an inline function).
13460 (Fconstrain_to_field): Don't assume integers are nonnegative.
13461 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13462 (Fsubst_char_in_region, Fsave_restriction):
13463 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13464 (Femacs_pid): Don't assume pid_t fits into fixnum.
13465 (lo_time): Use int, not EMACS_INT, when int suffices.
13466 (lisp_time_argument): Check for usec out of range.
13467 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
13468 (Fuser_login_name, Fuser_full_name): Signal an error
13469 if a uid argument is out of range, rather than relying on
13470 undefined behavior.
c8d5c857
PE
13471 (Fformat_time_string): Remove now-unnecessary check.
13472 lisp_time_argument checks for out-of-range usec now.
243e0530 13473 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
13474 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13475 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13476 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13477 (init_cmdargs, Fdump_emacs):
13478 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13479 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13480 the bottom (typically) 32 bits of the fixnum.
13481 * eval.c (specpdl_size, call_debugger):
13482 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13483 (when_entered_debugger, Fbacktrace_debug):
13484 Don't assume fixnum can fit in int.
13485 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13486 the object just before a buffer; this is not portable.
13487 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13488 (grow_specpdl, unbind_to):
13489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13490 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13491 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 13492 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
13493 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13494 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13495 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13496 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13497 (a_write, e_write):
13498 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13499 (Fcopy_file, non_regular_nbytes, read_non_regular)
13500 (Finsert_file_contents):
13501 Use int, not EMACS_INT, where int is wide enough.
13502 (READ_BUF_SIZE): Verify that it fits in int.
13503 (Finsert_file_contents): Check that counts are in proper range,
13504 rather than assuming fixnums fit into ptrdiff_t etc.
13505 Don't assume fixnums fit into int.
125b3835 13506 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
13507 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13508 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
13509 (string_char_to_byte, string_byte_to_char)
13510 (string_make_multibyte, string_to_multibyte)
13511 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13512 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13513 (substring_both, Fdelete, internal_equal, Ffillarray)
13514 (Fclear_string, mapcar1)
13515 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13516 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13517 (larger_vector, make_hash_table, maybe_resize_hash_table)
13518 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13519 (Fmaphash, secure_hash):
13520 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13521 (concat): Check for string index and length overflow.
13522 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13523 (Frequire):
13524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13525 (larger_vector): New API (vec, incr_min, size_max) replaces old
13526 one (vec, new_size, init). This catches size overflow.
13527 INIT was removed because it was always Qnil.
13528 All callers changed.
13529 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13530 the upper bound on a hash table index size.
13531 (make_hash_table, maybe_resize_hash_table): Use it.
13532 (secure_hash): Computer start_byte and end_byte only after
13533 they're known to be in ptrdiff_t range.
13534 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13535 (Ffont_get_glyphs, Ffont_at):
13536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13537 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13538 (Flist_fonts, Fopen_font):
13539 Don't assume fixnum can fit in int.
13540 (check_gstring): Don't assume index can fit in int.
13541 (font_match_p): Check that fixnum is a character, not a nonnegative
13542 fixnum, since the later code needs to stuff it into an int.
13543 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13544 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13545 conversion overflow issues.
13546 (Fopen_font): Check for integer out of range.
13547 (Ffont_get_glyphs): Don't assume index can fit in int.
13548 * font.h: Adjust decls to match defn changes elsewhere.
13549 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13550 integer overflow.
13551 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13552 printmax_t, where ptrdiff_t is wide enough.
13553 (Finternal_char_font):
13554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13555 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13556 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13557 (Fset_frame_position, x_set_frame_parameters)
13558 (x_set_line_spacing, x_set_border_width)
13559 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13560 Check that fixnums are in proper range for system types.
13561 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13562 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13563 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13564 Use SAFE_ALLOCA_LISP, not alloca.
13565 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13566 intptr_t is wide enough.
13567 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13568 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13569 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13570 Check for fixnum out of range.
13571 * ftfont.c (ftfont_list): Don't assume index fits in int.
13572 Check that fixnums are in proper range for system types.
13573 (ftfont_shape_by_flt):
13574 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
13575 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13577 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13578 Check that fixnums are in proper range for system types.
13579 * gnutls.h: Adjust decls to match defn changes elsewhere.
13580 * gtkutil.c (xg_dialog_run):
13581 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13582 (update_frame_tool_bar):
13583 Check that fixnums are in proper range for system types.
13584 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 13585 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
13586 * indent.c (last_known_column, last_known_column_point):
13587 (current_column_bol_cache):
13588 (skip_invisible, current_column, check_display_width):
13589 (check_display_width, scan_for_column, current_column_1)
13590 (Findent_to, Fcurrent_indentation, position_indentation)
13591 (indented_beyond_p, Fmove_to_column, compute_motion):
13592 (Fcompute_motion, Fvertical_motion):
13593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13594 (last_known_column_modified): Use EMACS_INT, not int.
13595 (check_display_width):
13596 (Fcompute_motion):
13597 Check that fixnums and floats are in proper range for system types.
13598 (compute_motion): Don't assume index or fixnum fits in int.
13599 (compute_motion, Fcompute_motion):
13600 Use int, not EMACS_INT, when it is wide enough.
13601 (vmotion): Omit local var start_hpos that is always 0; that way
13602 we don't need to worry about overflow in expressions involving it.
13603 * indent.h: Adjust decls to match defn changes elsewhere.
13604 (struct position):
13605 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13606 Use int, not EMACS_INT, where int is wide enough.
13607 Remove unused members ovstring_chars_done and tab_offset;
13608 all uses removed.
13609 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13610 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13611 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13612 (make_gap, copy_text, insert, insert_and_inherit)
13613 (insert_before_markers, insert_before_markers_and_inherit)
13614 (insert_1, count_combining_before, count_combining_after)
13615 (insert_1_both, insert_from_string)
13616 (insert_from_string_before_markers, insert_from_string_1)
13617 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13618 (adjust_after_replace, adjust_after_insert, replace_range)
13619 (replace_range_2, del_range, del_range_1, del_range_byte)
13620 (del_range_both, del_range_2, modify_region)
13621 (prepare_to_modify_buffer, signal_before_change)
13622 (signal_after_change, Fcombine_after_change_execute):
13623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13624 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13625 (balance_an_interval, split_interval_right, split_interval_left)
13626 (find_interval, next_interval, update_interval)
13627 (adjust_intervals_for_insertion, delete_node, delete_interval)
13628 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13629 (static_offset_intervals, offset_intervals)
13630 (merge_interval_right, merge_interval_left, make_new_interval)
13631 (graft_intervals_into_buffer, temp_set_point_both)
13632 (temp_set_point, set_point, adjust_for_invis_intang)
13633 (set_point_both, move_if_not_intangible, get_property_and_range)
13634 (get_local_map, copy_intervals, copy_intervals_to_string)
13635 (compare_string_intervals, set_intervals_multibyte_1):
13636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13637 * intervals.h: Adjust decls to match defn changes elsewhere.
13638 (struct interval):
13639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13640 * keyboard.c (this_command_key_count, this_single_command_key_start)
13641 (before_command_key_count, before_command_echo_length, echo_now)
13642 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13643 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13644 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13645 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13646 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13647 (last_non_minibuf_size, last_point_position, echo_truncate)
13648 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13649 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13650 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13651 (stuff_buffered_input):
13652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13653 (last_auto_save, command_loop_1, read_char):
13654 Use EMACS_INT, not int, to avoid integer overflow.
13655 (record_char): Avoid overflow in total_keys computation.
13656 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13657 * keyboard.h: Adjust decls to match defn changes elsewhere.
13658 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13659 (Fkey_description, Fdescribe_vector, Flookup_key):
13660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13661 (click_position): New function, to check that positions are in range.
13662 (Fcurrent_active_maps):
13663 (describe_command):
13664 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13665 (Faccessible_keymaps, Fkey_description):
13666 (preferred_sequence_p):
13667 Don't assume fixnum can fit into int.
13668 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13669 Check for integer overflow in size calculations.
13670 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13671 avoid mishandling large integers.
13672 * lisp.h: Adjust decls to match defn changes elsewhere.
13673 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13674 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13675 (struct Lisp_Marker):
13676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13677 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
13678 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13679 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13680 All callers changed.
13681 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13682 Assume the arg has valid form, since it always does.
13683 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13684 unsigned integer system type.
13685 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13686 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13687 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13688 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13689 (duration_to_sec_usec): New decl.
13690 * lread.c (read_from_string_index, read_from_string_index_byte)
13691 (read_from_string_limit, readchar, unreadchar, openp)
13692 (read_internal_start, read1, oblookup):
13693 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13694 (Fload, readevalloop, Feval_buffer, Feval_region):
13695 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13696 (openp): Check for out-of-range argument to 'access'.
13697 (read1): Use int, not EMACS_INT, where int is wide enough.
13698 Don't assume fixnum fits into int.
6efdadfd 13699 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
13700 (read_filtered_event): Use duration_to_sec_usec
13701 to do proper overflow checking on durations.
d311d28c
PE
13702 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13703 in size calculation.
13704 (Fexecute_kbd_macro):
13705 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13706 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13707 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13708 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13709 (set_marker_both, set_marker_restricted_both, marker_position)
13710 (marker_byte_position, Fbuffer_has_markers_at):
13711 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13712 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 13713 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
13714 It now merely ensures that the menu is large enough, without
13715 necessarily growing it, as this avoids some integer overflow issues.
13716 All callers changed.
13717 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13719 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13720 Use SAFE_ALLOCA_LISP, not alloca.
13721 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13722 to EMACS_INT. Check that fixnums are in proper range for system types.
13723 * minibuf.c (minibuf_prompt_width, string_to_object)
13724 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13725 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13726 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13727 (get_minibuffer, read_minibuf_unwind):
13728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13729 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13730 this simplifies overflow checking. All callers changed.
13731 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13732 (Ftest_completion):
13733 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13734 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13735 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13736 Check that fixnums are in proper range for system types.
13737 (Fx_create_frame, Fx_show_tip):
13738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13739 * nsfont.m (ns_findfonts, nsfont_list_family):
13740 Don't assume fixnum fits in long.
13741 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13742 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13743 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13744 wide enough.
17fdb222 13745 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
13746 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13747 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13748 (PRINTDECLARE, PRINTPREPARE):
13749 (strout, print_string):
13750 (print, print_preprocess, print_check_string_charset_prop)
13751 (print_object):
13752 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13753 (PRINTDECLARE):
13754 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13755 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13756 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 13757 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 13758 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
13759 (print_error_message): Use SAFE_ALLOCA, not alloca.
13760 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
13761 (print_depth, new_backquote_output, print_number_index):
13762 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
13763 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13764 (Fset_process_window_size, Fformat_network_address)
13765 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 13766 (sigchld_handler):
d311d28c 13767 Check that fixnums are in proper range for system types.
d44287d4 13768 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
13769 Check for process-ids out of pid_t range rather than relying on
13770 undefined behavior.
e4d81efc 13771 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
13772 (Fformat_network_address, read_process_output, send_process)
13773 (Fprocess_send_region, status_notify):
13774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13775 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13776 (wait_reading_process_output, read_process_output, exec_sentinel):
13777 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13778 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13779 (Faccept_process_output): Use duration_to_sec_usec to do proper
13780 overflow checking on durations.
dde14581
PE
13781 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13782 Don't assume pid_t fits in int.
02481186
PE
13783 * process.h (struct Lisp_Process): Members tick and update_tick
13784 are now of type EMACS_INT, not int.
b62b53e8
PE
13785 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13786 configured --with-wide-int.
d311d28c
PE
13787 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13788 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13789 * search.c (looking_at_1, string_match_1):
13790 (fast_string_match, fast_c_string_match_ignore_case)
13791 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13792 (scan_newline, find_before_next_newline, search_command)
13793 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13794 (set_search_regs, wordify):
13795 (Freplace_match):
13796 (Fmatch_data):
13797 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13798 (string_match_1, search_buffer, set_search_regs):
13799 (Fmatch_data):
13800 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13801 (wordify): Check for overflow in size calculation.
13802 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13803 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13804 Check that fixnums are in proper range for system types.
13805 * sound.c (struct sound_device)
13806 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13808 (Fplay_sound_internal):
13809 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 13810 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
13811 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13812 (Fparse_partial_sexp):
13813 Don't assume fixnums can fit in int.
13814 (struct lisp_parse_state, find_start_pos, find_start_value)
13815 (find_start_value_byte, find_start_begv)
13816 (update_syntax_table, char_quoted, dec_bytepos)
13817 (find_defun_start, prev_char_comend_first, back_comment):
13818 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13819 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13820 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13821 (Finternal_describe_syntax_value): Check that match_lisp is a
13822 character, not an integer, since the code stuffs it into int.
13823 (scan_words, scan_sexps_forward):
13824 Check that fixnums are in proper range for system types.
13825 (Fforward_word):
13826 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13827 (scan_sexps_forward):
13828 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13829 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13830 * syntax.h: Adjust decls to match defn changes elsewhere.
13831 (struct gl_state_s):
13832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
13833 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13834 MOST_POSITIVE_FIXNUM.
d311d28c
PE
13835 * sysdep.c (wait_for_termination_1, wait_for_termination)
13836 (interruptible_wait_for_termination, mkdir):
13837 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13838 (emacs_read, emacs_write):
13839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
13840 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13841 and double all fit in int.
d311d28c
PE
13842 * term.c (set_tty_color_mode):
13843 Check that fixnums are in proper range for system types.
13844 * termhooks.h (struct input_event):
13845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13846 * textprop.c (validate_interval_range, interval_of)
13847 (Fadd_text_properties, set_text_properties_1)
13848 (Fremove_text_properties, Fremove_list_of_text_properties)
13849 (Ftext_property_any, Ftext_property_not_all)
13850 (copy_text_properties, text_property_list, extend_property_ranges)
13851 (verify_interval_modification):
13852 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13853 (Fnext_single_char_property_change)
13854 (Fprevious_single_char_property_change):
13855 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
13856 (copy_text_properties):
13857 Check for integer overflow in index calculation.
d311d28c
PE
13858 * undo.c (last_boundary_position, record_point, record_insert)
13859 (record_delete, record_marker_adjustment, record_change)
13860 (record_property_change):
13861 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13862 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13863 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13864 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13865 (Fx_hide_tip, Fx_file_dialog):
13866 * w32menu.c (set_frame_menubar):
13867 Use ptrdiff_t, not int, for consistency with rest of code.
13868 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13869 (select_window, Fdelete_other_windows_internal)
13870 (window_scroll_pixel_based, window_scroll_line_based)
13871 (Frecenter, Fset_window_configuration):
13872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13873 (Fset_window_hscroll, run_window_configuration_change_hook)
13874 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13875 (Fscroll_other_window, Frecenter):
d311d28c
PE
13876 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13877 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13878 Don't assume fixnum fits in int.
13879 (Fset_window_scroll_bars):
13880 Check that fixnums are in proper range for system types.
13881 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13882 (string_pos, c_string_pos, number_of_chars, init_iterator)
13883 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13884 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13885 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13886 (face_before_or_after_it_pos, handle_invisible_prop)
13887 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13888 (display_prop_intangible_p, string_buffer_position_lim)
13889 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13890 (get_overlay_strings_1, get_overlay_strings)
13891 (iterate_out_of_display_property, forward_to_next_line_start)
13892 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13893 (get_next_display_element, set_iterator_to_next)
13894 (get_visually_first_element, compute_stop_pos_backwards)
13895 (handle_stop_backwards, next_element_from_buffer)
13896 (move_it_in_display_line_to, move_it_in_display_line)
13897 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13898 (add_to_log, message_dolog, message_log_check_duplicate)
13899 (message2, message2_nolog, message3, message3_nolog
13900 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13901 (current_message_1, truncate_echo_area, truncate_message_1)
13902 (set_message, set_message_1, store_mode_line_noprop)
13903 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13904 (text_outside_line_unchanged_p, check_point_in_composition)
13905 (reconsider_clip_changes)
13906 (redisplay_internal, set_cursor_from_row, try_scrolling)
13907 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13908 (redisplay_window, find_last_unchanged_at_beg_row)
13909 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13910 (trailing_whitespace_p, find_row_edges, display_line)
13911 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13912 (display_mode_element, store_mode_line_string)
13913 (pint2str, pint2hrstr, decode_mode_spec)
13914 (display_count_lines, display_string, draw_glyphs)
13915 (x_produce_glyphs, x_insert_glyphs)
13916 (rows_from_pos_range, mouse_face_from_buffer_pos)
13917 (fast_find_string_pos, mouse_face_from_string_pos)
13918 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13919 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13920 (safe_call, init_from_display_pos, handle_fontified_prop)
13921 (handle_single_display_spec, load_overlay_strings)
13922 (with_echo_area_buffer, setup_echo_area_for_printing)
13923 (display_echo_area, echo_area_display)
13924 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13925 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13926 (redisplay_window, dump_glyph_row, display_mode_line)
13927 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13928 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13929 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13930 (handle_single_display_spec, build_desired_tool_bar_string)
13931 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13932 (get_specified_cursor_type):
13933 Check that fixnums are in proper range for system types.
13934 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13935 (Flookup_image_map):
13936 Don't assume fixnums fit in int.
13937 (compare_overlay_entries):
13938 Avoid mishandling comparisons due to subtraction overflow.
13939 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13940 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13941 (handle_tool_bar_click):
13942 Use int, not unsigned, since we prefer signed and the signedness
13943 doesn't matter here.
13944 (get_next_display_element, next_element_from_display_vector):
13945 Use int, not EMACS_INT, when int is wide enough.
13946 (start_hourglass): Use duration_to_sec_usec to do proper
13947 overflow checking on durations.
13948 * xfaces.c (Fbitmap_spec_p):
13949 Check that fixnums are in proper range for system types.
13950 (compare_fonts_by_sort_order):
13951 Avoid mishandling comparisons due to subtraction overflow.
13952 (Fx_family_fonts, realize_basic_faces):
13953 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13954 (Fx_family_fonts):
13955 Don't assume fixnum fits in int.
13956 Use SAFE_ALLOCA_LISP, not alloca.
13957 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13958 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13959 (face_at_buffer_position, face_for_overlay_string)
13960 (face_at_string_position):
13961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13962 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13963 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13964 (Fx_show_tip):
13965 Check that fixnums are in proper range for system types.
13966 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13967 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13969 (Fx_change_window_property): Don't assume fixnums fit in int.
13970 * xfont.c (xfont_chars_supported):
13971 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13972 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13973 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13974 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13975 * xml.c (parse_region):
13976 * xrdb.c (magic_file_p):
13977 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13978 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13979 (x_get_local_selection, x_reply_selection_request)
13980 (x_handle_selection_request, wait_for_property_change):
13981 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13982 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13983 short is wide enough.
13984 (x_send_client_event): Don't assume fixnum fits in int.
13985 * xterm.c (x_x_to_emacs_modifiers):
13986 Don't assume EMACS_INT overflows nicely into int.
13987 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13988 may come from Lisp.
13989 (handle_one_xevent): NATNUMP can eval its arg twice.
13990 (x_connection_closed):
13991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13992 * xterm.h: Adjust decls to match defn changes elsewhere.
13993 (struct scroll_bar): Use struct vectorlike_header
13994 rather than rolling our own approximation.
13995 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13996
c6574eb5
GM
139972012-05-25 Glenn Morris <rgm@gnu.org>
13998
13999 * lisp.mk (lisp): Update for more files being compiled now.
14000
e8d32c7e
SM
140012012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
14002
48def666
SM
14003 * lread.c: Remove `read_pure' which makes no difference.
14004 (read_pure): Remove var.
14005 (unreadpure): Remove function.
14006 (readevalloop): Don't call read_list with -1 flag.
14007 (read1, read_vector): Don't test read_pure any more.
14008 (read_list): Simplify.
14009
e8d32c7e
SM
14010 * fileio.c, character.h: Minor style tweaks.
14011
4b2addb7
DA
140122012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
14013
14014 * window.h (clip_changed): Remove useless declaration.
14015
584461b2
JB
140162012-05-22 Juanma Barranquero <lekktu@gmail.com>
14017
14018 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
14019 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
14020
34374650
PE
140212012-05-22 Paul Eggert <eggert@cs.ucla.edu>
14022
14023 Remove src/m/*.
14024 This directory predates autoconf and is no longer needed nowadays.
14025 Move its few remaining bits of functionality to where they're needed.
14026 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
14027 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
14028 * m/template.h: Remove.
14029 * Makefile.in (M_FILE): Remove. All uses removed.
14030 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
14031 * lisp.h (USE_LSB_TAG):
14032 * mem-limits.h (EXCEEDS_LISP_PTR):
14033 Use VAL_MAX, not VALBITS, in #if.
14034 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
14035 (EMACS_UINT): Define unconditionally now.
14036 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
14037 (BITS_PER_EMACS_INT): New constants, replacing
14038 what used to be in config.h, but not useful in #if.
14039 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
14040 define them any more.
14041 (VAL_MAX): New macro.
14042 (VALMASK): Use it.
14043 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
14044 BITS_PER_EMACS_INT, in #if.
14045 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
14046 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
14047 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
14048 * s/ms-w32.h (DATA_START):
14049 Move here from removed file m/intel386.h.
14050 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
14051 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
14052
261cb4bb
PE
140532012-05-21 Paul Eggert <eggert@cs.ucla.edu>
14054
14055 Assume C89 or later.
14056 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
14057 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
14058 (xrealloc):
14059 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
14060 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
14061 * textprop.c, tparam.c (NULL): Remove.
14062 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
14063 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
14064 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
14065 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
14066 * xterm.c (input_signal_count): Assume volatile works.
14067
ff23cd9f
KB
140682012-05-21 Ken Brown <kbrown@cornell.edu>
14069
14070 * xgselect.c (xg_select): Fix first argument in call to 'select'
14071 (bug#11508).
14072
1b170bc6
KB
140732012-05-20 Ken Brown <kbrown@cornell.edu>
14074
14075 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 14076 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 14077
b2f4d39f
KB
140782012-05-19 Ken Brown <kbrown@cornell.edu>
14079
14080 * xfns.c (x_in_use): Remove `static' qualifier.
14081 * xterm.h (x_in_use): Declare.
14082 * xgselect.c: Include xterm.h.
14083 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
14084 and `display_arg' (bug#9754).
14085
003fdae2
PE
140862012-05-19 Paul Eggert <eggert@cs.ucla.edu>
14087
9232a6d9
PE
14088 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
14089
003fdae2
PE
14090 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
14091 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
14092
784b56e2
EZ
140932012-05-18 Eli Zaretskii <eliz@gnu.org>
14094
14095 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
14096
14097 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 14098 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
14099
14100 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
14101 reference to image_cache->refcount.
14102 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
14103
a0a79cde
JL
141042012-05-17 Juri Linkov <juri@jurta.org>
14105
14106 * search.c (Fword_search_regexp, Fword_search_backward)
14107 (Fword_search_forward, Fword_search_backward_lax)
14108 (Fword_search_forward_lax): Move functions to isearch.el
14109 (bug#10145, bug#11381).
14110
b0572523
PE
141112012-05-16 Paul Eggert <eggert@cs.ucla.edu>
14112
14113 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
14114
9660f5fc
SM
141152012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
14116
14117 * lread.c (init_obarray): Declare Qt and Qnil as special.
14118
4374de83
GM
141192012-05-14 Glenn Morris <rgm@gnu.org>
14120
14121 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 14122 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 14123
dc44c39a
PE
141242012-05-14 Paul Eggert <eggert@cs.ucla.edu>
14125
078c97cb
PE
14126 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
14127
dc44c39a
PE
14128 * unexaix.c: Port to more-recent AIX compilers.
14129 (report_error, report_error_1, make_hdr, copy_sym)
14130 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
14131 Make arguments const char *, not char *, to avoid violations of C
14132 standard and to fix some AIX warnings reported by Gilles Pion.
14133
e18afed7 141342012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
14135
14136 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
14137 already have overlays loaded.
14138 (handle_single_display_spec): Before returning without displaying
14139 fringe bitmap, synchronize the bidi iterator with the main display
14140 iterator, by calling iterate_out_of_display_property.
14141 (iterate_out_of_display_property): Detect buffer iteration by
14142 testing that it->string is a Lisp string.
14143 (get_next_display_element): When the current object is exhausted,
14144 and there's something on it->stack, call set_iterator_to_next to
14145 proceed with what's on the stack, instead of returning zero.
14146 (set_iterator_to_next): If called at the end of a Lisp string,
14147 proceed to consider_string_end without incrementing string
14148 position. Don't increment display vector index past the end of
14149 the display vector. (Bug#11417)
c8fb9dc6
EZ
14150 (pos_visible_p): Don't report a position visible when move_it_to
14151 stopped at the last line of window, which happens to be scanned
14152 backwards by the bidi iteration. (Bug#11464)
ac268e67 14153
e18afed7 141542012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
14155
14156 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
14157 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
14158 are on a TTY, and thus unable to display on the fringes.
14159 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
14160 so we need to signal to the caller that this is a "replacing"
14161 display spec. This fixes display when the spec is invalid or we
14162 are on a TTY.
14163
e18afed7 141642012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
14165
14166 * unexaix.c (make_hdr): Fix typo in prototype.
14167 This bug broke the build on AIX. Problem reported by Gilles Pion.
14168
9d0a235a
MA
141692012-05-14 Michael Albinus <michael.albinus@gmx.de>
14170
14171 * keyboard.c (kbd_buffer_get_event): Read special events also in
14172 batch mode. (Bug#11415)
14173
9e6b06ed
GM
141742012-05-12 Glenn Morris <rgm@gnu.org>
14175
14176 * ns.mk: Update for ns_appbindir no longer having trailing "/".
14177
c1a1d7a3
EZ
141782012-05-12 Eli Zaretskii <eliz@gnu.org>
14179
14180 * lisp.mk (lisp): Add newcomment.elc.
14181
3fe7cdc8
GM
141822012-05-12 Glenn Morris <rgm@gnu.org>
14183
14184 * Makefile.in (MKDIR_P): New, set by configure.
14185 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
14186
53f7d2c0
PE
141872012-05-11 Paul Eggert <eggert@cs.ucla.edu>
14188
14189 Remove unused function hourglass_started.
14190 * dispextern.h (hourglass_started):
14191 * w32fns.c (hourglass_started):
14192 * xdisp.c (hourglass_started): Remove.
14193
75aafb17
JB
141942012-05-10 Juanma Barranquero <lekktu@gmail.com>
14195
14196 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
14197 Update dependencies.
14198
12959e8e
PE
141992012-05-10 Paul Eggert <eggert@cs.ucla.edu>
14200
97107e2e
PE
14201 * xgselect.c (xg_select): Put maxfds+1 into a var.
14202 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
14203
12959e8e
PE
14204 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
14205
836d29b3
DA
142062012-05-10 Dave Abrahams <dave@boostpro.com>
14207
14208 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
14209 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
14210
5cb67954
MA
142112012-05-09 Michael Albinus <michael.albinus@gmx.de>
14212
14213 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 14214 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
14215 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
14216 Initialize xd_registered_buses.
14217
3478ec45
PE
142182012-05-09 Paul Eggert <eggert@cs.ucla.edu>
14219
b263a6b0
PE
14220 Untag more efficiently if USE_LSB_TAG.
14221 This is based on a proposal by YAMAMOTO Mitsuharu in
14222 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
14223 For an admittedly artificial (nth 8000 longlist) benchmark on
14224 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
14225 Emacs's overall text size by 1%.
14226 * lisp.h (XUNTAG): New macro.
14227 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
14228 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
14229 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
14230 * eval.c (Fautoload):
14231 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
14232 * frame.h (XFRAME): Use XUNTAG.
14233
3478ec45
PE
14234 Port recent dbusbind.c changes to 32-bit --with-wide-int.
14235 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
14236 Remove unportable assumptions about print widths of types like
14237 dbus_uint32_t.
14238 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
14239 intptr_t when converting between pointer and integer, to avoid GCC
14240 warnings about wrong width.
14241
666b903b 142422012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
14243
14244 * w32proc.c (new_child): Force Windows to reserve only 64KB of
14245 stack for each reader_thread, instead of defaulting to 8MB
14246 determined by the linker. This avoids failures in creating
14247 subprocesses on Windows 7, see the discussion in this thread:
14248 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
14249
b120cc17
JC
142502012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
14251
14252 Fix up display of the *Minibuf-0* buffer in the mini window.
14253 * keyboard.c (read_char): Don't clear the echo area if there's no
14254 message to clear.
14255 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 14256 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 14257
9a4b36f8
MA
142582012-05-07 Michael Albinus <michael.albinus@gmx.de>
14259
14260 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
14261 batch mode.
14262
e5f9458f
CY
142632012-05-06 Chong Yidong <cyd@gnu.org>
14264
14265 * lisp.mk (lisp): Update.
14266
eceeb5fc 142672012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
14268
14269 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
14270
71873e2b
SM
142712012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
14272
14273 * data.c (PUT_ERROR): New macro.
14274 (syms_of_data): Use it. Add new error type `user-error'.
14275 * undo.c (user_error): New function.
14276 (Fprimitive_undo): Use it.
14277 * print.c (print_error_message): Adjust print style for `user-error'.
14278 * keyboard.c (user_error): New function.
14279 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14280
ab0fa4e4
PE
142812012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14282
14283 Do not limit current-time-string to years 1000..9999.
14284 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14285 (Fcurrent_time_string): Support any year that is supported by the
14286 underlying localtime representation. Don't use asctime, as it
14287 has undefined behavior for years outside the range -999..9999.
14288
7ed806a7
PE
142892012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14290
14291 Fix race conditions involving setenv, gmtime, localtime, asctime.
14292 Without this fix, interrupts could mess up code that uses these
14293 nonreentrant functions, since setting TZ invalidates existing
14294 tm_zone or tzname values, and since most of these functions return
14295 pointers to static storage.
14296 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14297 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14298 Grow the critical sections to include not just invoking
14299 localtime/gmtime, but also accessing these functions' results
14300 including their tm_zone values if any, and any related TZ setting.
14301 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
14302 so that the struct tm is saved in the critical section.
14303 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
14304 motivated by the fact that memory allocation needs to be outside
14305 the critical section.
14306
0c16dfed
DA
143072012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14308
14309 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14310 with RESET_INTERVAL.
14311
14312 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14313 Remove duplicated buffer name initialization.
14314
3f83ace8
JM
143152012-05-02 Jim Meyering <jim@meyering.net>
14316
14317 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14318
c7b8541e
JM
14319 * xfns.c (x_window): Use xstrdup (Bug#11375).
14320
90207a15 143212012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
14322
14323 * xdisp.c (pos_visible_p): If already at a newline from the
14324 display string before the 'while' loop, don't walk back the glyphs
14325 from it3.glyph_row. Solves assertion violation when the display
14326 string begins with a newline (egg.el). (Bug#11367)
14327
b593d6a9
AH
143282012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14329
14330 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14331 Move to simple.el.
14332
4737362e
GM
143332012-05-01 Glenn Morris <rgm@gnu.org>
14334
99cf43f9
GM
14335 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14336 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14337 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14338 All were removed before 23.1.
14339
9311dcff
GM
14340 * dispnew.c: Remove HAVE_LIBNCURSES test;
14341 it is always true on relevant platforms.
14342
4d5c6349
GM
14343 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14344 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14345
4737362e
GM
14346 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14347
74dd3a6b
AS
143482012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14349
14350 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14351 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14352 Remove.
14353
13c379ee
PE
143542012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14355
14356 Do not avoid creating empty evaporating overlays (Bug#9642).
14357 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14358 That is, do not delete an evaporating overlay if it becomes
14359 empty after its bounds are adjusted to fit within its buffer.
14360 This fix caused other problems, and I'm reverting it until we get
14361 to the bottom of them.
14362
a8e7d6d7 143632012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
14364
14365 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14366
a8e7d6d7 143672012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
14368
14369 * xdisp.c (pos_visible_p): If the window start position is beyond
14370 ZV, start the display from buffer beginning. Prevents assertion
14371 violation in init_iterator when the minibuffer window is scrolled
14372 via the scroll bar.
14373
14374 * window.c (window_scroll_pixel_based): Likewise.
14375
a8e7d6d7 143762012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
14377
14378 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14379
a8e7d6d7 143802012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
14381
14382 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14383 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14384
a8e7d6d7 143852012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 14386
b593d6a9
AH
14387 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14388 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 14389
1c6900d9
EZ
143902012-04-26 Eli Zaretskii <eliz@gnu.org>
14391
4c3fa1d9
EZ
14392 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14393 display element, check also the underlying string or buffer
14394 character. (Bug#11341)
14395
1c6900d9
EZ
14396 * w32menu.c: Include w32heap.h.
14397 (add_menu_item): If the call to AppendMenuW (via
14398 unicode_append_menu) fails, disable Unicode menus only if we are
14399 running on Windows 9X/Me.
14400
42bf8205
AS
144012012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14402
14403 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14404 (xgetint): Add missing shift for LSB tags.
14405
b1bac16e
MR
144062012-04-24 Martin Rudalics <rudalics@gmx.at>
14407
14408 * keyboard.c (read_char): Don't wipe echo area for select window
14409 events: These might get delayed via `mouse-autoselect-window'
14410 (Bug#11304).
14411
d69621cc
JB
144122012-04-24 Juanma Barranquero <lekktu@gmail.com>
14413
14414 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14415 manipulation of :loaded-from data.
14416
02fd101b
JB
144172012-04-23 Juanma Barranquero <lekktu@gmail.com>
14418
14419 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14420 now a cons (bug#11311).
14421
888bec30
PE
144222012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14423
89a438bd
PE
14424 Do not create empty overlays with the evaporate property (Bug#9642).
14425 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14426 if it becomes empty after its bounds are adjusted to fit within
14427 its buffer. Without this fix, in a nonempty buffer (let ((o
14428 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14429 yields an empty overlay that has the evaporate property, which is
14430 not supposed to happen.
14431
1068fe4d
PE
14432 Fix minor GTK3 problems found by static checking.
14433 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14434 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14435 (struct _EmacsFixedClass, emacs_fixed_get_type):
14436 Move decls here from emacsgtkfixed.h, since they needn't be public.
14437 (emacs_fixed_get_type): Now static.
14438 (emacs_fixed_class_init): Omit unused local.
14439 (emacs_fixed_child_type): Remove; unused.
14440 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14441 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14442 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14443 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14444 (EMACS_FIXED_GET_CLASS): Remove; unused.
14445 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14446
888bec30
PE
14447 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14448 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14449
de85e130
PE
144502012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14451
d0baac98 14452 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 14453 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
14454 (__malloc_size_t, __malloc_ptrdiff_t):
14455 Remove. All uses removed, replaced by the definiens if needed,
14456 since we can assume C89 or better now.
14457 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14458 (protect_malloc_state, align, get_contiguous_space)
14459 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14460 (malloc_atfork_handler_child, malloc_enable_thread)
14461 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14462 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14463 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14464 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14465 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14466 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14467 Define using prototypes, not old style.
14468 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14469 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14470 (align): Don't assume that signed integer overflow wraps around.
14471 Omit unused local var.
14472 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14473 (_free_internal_nolock, memalign, mallochook, reallochook):
14474 Omit no-longer-needed casts.
14475 (valloc): Use getpagesize, not __getpagesize.
14476 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14477 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14478
de85e130
PE
14479 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14480
dcbf5805
MA
144812012-04-22 Michael Albinus <michael.albinus@gmx.de>
14482
14483 Move functions from C to Lisp. Make non-blocking method calls
14484 the default. Implement further D-Bus standard interfaces.
14485
14486 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14487 (QCdbus_request_name_allow_replacement)
14488 (QCdbus_request_name_replace_existing)
14489 (QCdbus_request_name_do_not_queue)
14490 (QCdbus_request_name_reply_primary_owner)
14491 (QCdbus_request_name_reply_in_queue)
14492 (QCdbus_request_name_reply_exists)
14493 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14494 (QCdbus_registered_serial, QCdbus_registered_method)
14495 (QCdbus_registered_signal): New Lisp objects.
14496 (XD_DEBUG_MESSAGE): Use sizeof.
14497 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14498 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14499 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14500 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14501 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14502 (xd_signature, xd_append_arg): Allow float for integer types.
14503 (xd_get_connection_references): New function.
b593d6a9
AH
14504 (xd_get_connection_address): Rename from xd_initialize.
14505 Return cached address.
dcbf5805
MA
14506 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14507 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14508 level.
14509 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 14510 Return number of refcounts.
dcbf5805
MA
14511 (Fdbus_get_unique_name): Make stronger parameter check.
14512 (Fdbus_message_internal): New defun.
14513 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14514 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14515 (Fdbus_send_signal, Fdbus_register_service)
14516 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14517 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14518 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14519 (Vdbus_compiled_version, Vdbus_runtime_version)
14520 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14521 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14522 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
14523 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14524 Adapt docstring.
dcbf5805 14525
52828e02
PE
145262012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14527
da05bc4c
PE
14528 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14529 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14530 Do not assume ptrdiff_t is the same width as 'int'.
14531
52828e02
PE
14532 * alloc.c: Handle unusual debugging option combinations.
14533 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14534 since the two debugging options are incompatible.
14535 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14536 is defined.
14537 (mem_init, mem_insert, mem_insert_fixup):
14538 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14539 (NEED_MEM_INSERT): Remove; no longer needed.
14540
f01769f9
LL
145412012-04-22 Leo Liu <sdl.web@gmail.com>
14542
14543 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14544
5790543d
PE
145452012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14546
14547 * sysdep.c [__FreeBSD__]: Minor cleanups.
14548 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14549 Use Emacs indenting style more consistently. Avoid some casts.
14550 Use 'double' consistently rather than mixing 'float' and 'double'.
14551
b91b7e4d
EW
145522012-04-21 Eduard Wiebe <usenet@pusto.de>
14553
b593d6a9
AH
14554 * sysdep.c (list_system_processes, system_process_attributes):
14555 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 14556
6114eb15
AS
145572012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14558
14559 * lisp.mk (lisp): Update.
14560
2f38dff7
PE
145612012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14562
14563 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14564 It is never used otherwise.
14565
4ae29f89
SM
145662012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14567
14568 * print.c (print_preprocess): Only check print_depth if print-circle
14569 is nil.
14570 (print_object): Check for cycles even when print-circle is nil and
14571 print-gensym is t, but only check print_depth if print-circle is nil.
14572
f30d612a
CY
145732012-04-20 Chong Yidong <cyd@gnu.org>
14574
14575 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14576 set the status to "failed" and ensure that sentinel is run.
14577
c07a4c0b 145782012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
14579
14580 * process.c (Fset_process_inherit_coding_system_flag)
14581 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 14582 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 14583
c07a4c0b 145842012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
14585
14586 * xdisp.c (string_buffer_position_lim): Limit starting position to
14587 BEGV.
14588 (set_cursor_from_row): If called for a mode-line or header-line
14589 row, return zero immediately.
14590 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
14591 farther than the first row after the header line, if any.
14592 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
14593 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14594
c07a4c0b 145952012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14596
4ae29f89
SM
14597 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14598 (bug#11238).
ad3a2b41 14599
c07a4c0b 146002012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 146012012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
14602
14603 configure: new option --enable-gcc-warnings (Bug#11207)
14604 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14605 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14606 (ALL_CFLAGS): Use new macros rather than old.
14607 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14608 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14609 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14610 -Wunused-result, -Wunused-variable. This should go away once
14611 the Emacs and Gnulib regex code is merged.
14612 (xmalloc, xrealloc): Now static.
14613
aba027e8
PE
146142012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14615
14616 * dired.c (Fsystem_groups): Remove unused local.
14617
e5a36063
GM
146182012-04-17 Glenn Morris <rgm@gnu.org>
14619
14620 * dired.c (Fsystem_users): Doc fix.
14621
316411f0
DA
146222012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14623
14624 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14625 (syms_of_dired): Add them.
14626
9426aba4
PE
146272012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14628
b62a57be
PE
14629 Fix minor alloc.c problems found by static checking.
14630 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14631 New extern decls, to avoid calling undeclared functions.
14632 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14633 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14634 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14635 (NEED_MEM_INSERT): New macro.
14636 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 14637 Remove one incorrect comment and fix another.
b62a57be 14638
3539f31f
PE
14639 Fix minor ralloc.c problems found by static checking.
14640 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14641 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14642 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14643 (r_alloc_sbrk): Now static.
14644
a041960a
PE
14645 Improve ralloc.c interface checking.
14646 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14647 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14648 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14649 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14650 [REL_ALLOC]: ... to here, to check interface.
14651 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14652 Remove decls. This fixes an "It stinks!".
14653
9426aba4
PE
14654 * alloc.c (which_symbols): Fix alignment issue / type clash.
14655
d55c12ed
AS
146562012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14657
14658 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14659 (struct Lisp_Misc_Any): Likewise.
14660 (struct Lisp_Free): Likewise.
14661 * alloc.c (union aligned_Lisp_Symbol): Define.
14662 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14663 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14664 (union aligned_Lisp_Misc): Define.
14665 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14666 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 14667 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 14668
b948ce8b
PE
146692012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14670
14671 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14672 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14673 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14674 * s/netbsd.h, s/sol2-6.h:
14675 Remove definition of GC_MARK_STACK, since the default now works.
14676 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14677 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14678 no longer the default.
14679 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14680
35dc09a1 146812012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14682
35dc09a1
GM
14683 * lread.c (lisp_file_lexically_bound_p):
14684 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 14685
35dc09a1
GM
146862012-04-14 Eli Zaretskii <eliz@gnu.org>
14687
14688 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14689 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14690
146912012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14692
14693 * nsterm.m (constrainFrameRect): Always constrain when there is only
14694 one screen (Bug#10962).
14695
bcd86815
KB
146962012-04-13 Ken Brown <kbrown@cornell.edu>
14697
14698 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14699
c25df26e
RT
147002012-04-13 Reuben Thomas <rrt@sc3d.org>
14701
14702 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14703
0fc59f1e
DC
147042012-04-11 Daniel Colascione <dancol@dancol.org>
14705
14706 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14707 against is gone. It's better to use vfork now so that when Cygwin
14708 gains a new, working vfork, we use it automatically (bug#10398).
14709
de8c03dc
SM
147102012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14711
14712 * window.c (save_window_save): Obey window-point-insertion-type.
14713
2f097256
GM
147142012-04-11 Glenn Morris <rgm@gnu.org>
14715
14716 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14717
453b951e
SM
147182012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14719
14720 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14721
75f1671a 147222012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
14723
14724 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14725 (force_quit_count): New var.
14726 (handle_interrupt): Use it.
14727
2a8ce227
JB
147282012-04-10 Juanma Barranquero <lekktu@gmail.com>
14729
14730 * w32.c (w32_delayed_load): Record the full path of the library
14731 being loaded (bug#10424).
14732
935396c0
GM
147332012-04-09 Glenn Morris <rgm@gnu.org>
14734
05920a43
GM
14735 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14736 not just in the obarray, before snarfing them. (Bug#11036)
14737
935396c0
GM
14738 * Makefile.in ($(leimdir)/leim-list.el):
14739 Pass EMACS rather than BUILT_EMACS.
14740
a18ecafa
TZ
147412012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14742
14743 * process.c (make_process):
14744 * process.h: Add integer `gnutls_handshakes_tried' member to
14745 process struct.
14746
6bbef4e5
JC
14747 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14748 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
14749
14750 * gnutls.c (gnutls_log_function2i): Convenience log function.
14751 (emacs_gnutls_read): Use new log functions,
14752 `gnutls_handshakes_tried' process member, and
14753 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14754 attempts per process (connection).
14755
b4d3bc10
CY
147562012-04-09 Chong Yidong <cyd@gnu.org>
14757
14758 * eval.c (Fuser_variable_p, user_variable_p_eh)
14759 (lisp_indirect_variable): Functions deleted.
14760 (Fdefvar): Caller changed.
14761
14762 * callint.c (Finteractive, Fcall_interactively):
14763 * minibuf.c (Fread_variable): Callers changed.
14764
70f4d973
EZ
147652012-04-09 Eli Zaretskii <eliz@gnu.org>
14766
14767 * xdisp.c (set_cursor_from_row): If the display string appears in
14768 the buffer at position that is closer to point than the position
14769 after the display string, display the cursor on the first glyph of
14770 the display string. Fixes cursor display when a 'display' text
14771 property immediately follows invisible text. (Bug#11094)
14772
cb3c2e3e
PE
147732012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14774
14775 composite.c: use 'double' consistently
14776 * composite.c (get_composition_id): Use 'double' consistently
14777 instead of converting 'float' to 'double' and vice versa; this is
14778 easier to understand and avoids a GCC warning.
14779
fd06db5d
GM
147802012-04-09 Glenn Morris <rgm@gnu.org>
14781
50fe702a
GM
14782 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14783 preparation for dumping it with emacs. (Bug#4789)
14784 (leimdir): New variable.
14785 ($(leimdir)/leim-list.el): New rule.
14786 (emacs$(EXEEXT)): Depend on leim-list.el.
14787
fd06db5d
GM
14788 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14789 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14790 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14791
55c131ee
AS
147922012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14793
14794 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14795 proper alignment.
14796
9209588f
JB
147972012-04-07 Juanma Barranquero <lekktu@gmail.com>
14798
14799 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14800 Remove unused local variable.
14801
e3fb2efb
PE
148022012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14803
14804 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14805 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14806 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14807 objects, as mark_maybe_pointer will catch them otherwise.
14808 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14809 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14810
b5385551
PE
148112012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14812
14813 Fix typo that broke non-Windows builds.
14814 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14815
9078ead6
EZ
148162012-04-07 Eli Zaretskii <eliz@gnu.org>
14817
14818 Support building on MS-Windows with libxml2.
14819
14820 * makefile.w32-in (OBJ2): Add xml.$(O).
14821 (GLOBAL_SOURCES): Add xml.c.
14822 ($(BLD)/xml.$(O)): New dependency list.
14823
14824 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14825 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14826 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14827 [!WINDOWSNT]: New macros.
14828 (init_libxml2_functions, libxml2_loaded_p): New functions.
14829 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14830 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14831 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14832 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14833 linked in).
6bbef4e5
JC
14834 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14835 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
14836 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14837
14838 * emacs.c: Don't include libxml/parser.h.
14839 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14840 xmlCleanupParser directly.
14841
14842 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14843
3811fdf3
EZ
148442012-04-07 Eli Zaretskii <eliz@gnu.org>
14845
14846 * indent.c (Fvertical_motion): If there is a display string at
14847 point, use it.vpos to compute how many lines to backtrack after
14848 move_it_to point. (Bug#11133)
14849
2f8e16b2
EZ
148502012-04-06 Eli Zaretskii <eliz@gnu.org>
14851
14852 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14853 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14854 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14855 macros related to unification of CJK characters. For the details,
14856 see the discussion following the message here:
14857 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14858
3d439cd1
CY
148592012-04-04 Chong Yidong <cyd@gnu.org>
14860
14861 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14862
8bc53d00
EZ
148632012-04-01 Eli Zaretskii <eliz@gnu.org>
14864
14865 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14866 instead of alloca. (Bug#11138)
14867
3b0512a3
AS
148682012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14869
14870 * w32menu.c (is_simple_dialog): Properly check lisp types.
14871 (Bug#11141)
14872
8427ddd2
EZ
148732012-03-31 Eli Zaretskii <eliz@gnu.org>
14874
979022ef
EZ
14875 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14876 position we get to after a call to move_it_to fails the
14877 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14878 only if we wind up in a string from display property. (Bug#11063)
14879
a6b1c7cc
EZ
14880 * window.c (Fdelete_other_windows_internal): Invalidate the row
14881 and column information about mouse highlight, so that redisplay
14882 restores it after reallocating the glyph matrices. (Bug#7464)
14883
8427ddd2
EZ
14884 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14885 string comes from a `display' text property, use the buffer
14886 position of that property as if we actually saw that position in
14887 the row's glyphs.
697ba24b
EZ
14888 (move_it_by_lines): Remove the assertion that
14889 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14890 violated when there's a before-string at the beginning of a line.
14891 (Bug#11063)
8427ddd2 14892
65a0a738
EZ
148932012-03-30 Eli Zaretskii <eliz@gnu.org>
14894
14895 * xdisp.c (append_space_for_newline): If the default face was
14896 remapped, use the remapped face for the appended newline.
14897 (extend_face_to_end_of_line): Use the remapped default face for
14898 extending the face to the end of the line.
14899 (display_line): Call extend_face_to_end_of_line when the default
14900 face was remapped. (Bug#11068)
14901
581355cc
EZ
149022012-03-29 Eli Zaretskii <eliz@gnu.org>
14903
14904 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14905
e8fc049f
SM
149062012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14907
14908 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14909
4fb9a543
GM
149102012-03-27 Glenn Morris <rgm@gnu.org>
14911
14912 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14913 Doc fixes.
14914
679910f1
KH
149152012-03-26 Kenichi Handa <handa@m17n.org>
14916
14917 * dispextern.h (struct glyph): Fix previous change. Change the
14918 bit length of glyphless.ch to 25 (Bug#11082).
14919
90d49b7f
CY
149202012-03-26 Chong Yidong <cyd@gnu.org>
14921
14922 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14923 (command_loop_1): Use it; inhibit selection update for
14924 handle-select-window too (Bug#8996).
14925
f514f6f0
FP
149262012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14927
e8fc049f 14928 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14929
bf43fa51
KH
149302012-03-25 Kenichi Handa <handa@m17n.org>
14931
14932 * dispextern.h (struct glyph): Change the bit length of
14933 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14934
8a0c01dd
EZ
149352012-03-24 Eli Zaretskii <eliz@gnu.org>
14936
14937 * s/ms-w32.h (tzname): Include time.h before redirecting to
14938 _tzname. Fixes the MSVC build. (Bug#9960)
14939
7d1c3a76
AS
149402012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14941
8ed79523
AS
14942 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14943 characters.
14944
7d1c3a76
AS
14945 * xterm.c (XTread_socket): Only modify handling_signal if
14946 !SYNC_INPUT. (Bug#11080)
14947
e99a9b8b
EZ
149482012-03-23 Eli Zaretskii <eliz@gnu.org>
14949
14950 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14951 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14952 when fetching a multibyte character consumes more bytes than
14953 CHAR_BYTES returns, due to unification of CJK characters in
14954 string_char. (Bug#11073)
14955
5063c0e1
TN
149562012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14957
14958 * process.c (wait_reading_process_output): Handle pty disconnect
14959 by refraining from sending oneself a SIGCHLD (bug#10933).
14960
9f851fbd
CY
149612012-03-22 Chong Yidong <cyd@gnu.org>
14962
14963 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14964
5063c0e1 14965 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14966 Mark string as coming from a prefix property.
14967 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14968 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14969
fb5b8aca
CY
149702012-03-21 Chong Yidong <cyd@gnu.org>
14971
14972 * xfaces.c (Vface_remapping_alist): Doc fix.
14973
62356a1b
EZ
149742012-03-20 Eli Zaretskii <eliz@gnu.org>
14975
14976 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14977 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14978 Doc fixes.
62356a1b 14979
025de85b
CY
149802012-03-20 Chong Yidong <cyd@gnu.org>
14981
14982 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14983 to reflect default non-nil value of redisplay-dont-pause.
14984
4827f94e
KH
149852012-03-19 Kenichi Handa <handa@m17n.org>
14986
14987 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14988 it fit in a valid range (Bug#11003).
14989
e50a24a2
EZ
149902012-03-18 Eli Zaretskii <eliz@gnu.org>
14991
14992 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14993 that is not from display property, accept the row as a "cursor
14994 row" if one of the string's character has a non-nil `cursor'
14995 property. Fixes cursor positioning when there are newlines in
14996 overlay strings, e.g. in icomplete.el. (Bug#11035)
14997
9af5ed87
PE
149982012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14999
15000 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
15001
d1f55f16
CY
150022012-03-12 Chong Yidong <cyd@gnu.org>
15003
15004 * eval.c (inhibit_lisp_code): Rename from
15005 inhibit_window_configuration_change_hook; move from window.c.
15006
15007 * xfns.c (unwind_create_frame_1, Fx_create_frame):
15008 * window.c (run_window_configuration_change_hook)
15009 (syms_of_window): Callers changed.
15010
66c5eebd
CY
150112012-03-11 Chong Yidong <cyd@gnu.org>
15012
413df973
CY
15013 * keymap.c (Fkey_description): Doc fix (Bug#9700).
15014
66c5eebd
CY
15015 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
15016
1de11f56
CY
150172012-03-10 Chong Yidong <cyd@gnu.org>
15018
15019 * frame.c (other_visible_frames): Don't assume the selected frame
15020 is visible (Bug#10955).
15021
cae07000
SM
150222012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
15023
15024 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
15025
89c94350
JD
150262012-03-08 Jan Djärv <jan.h.d@swipnet.se>
15027
15028 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
15029 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
15030 zero (Bug#10954).
15031
999dd333
GM
150322012-03-03 Glenn Morris <rgm@gnu.org>
15033
01a6dcc8 15034 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 15035
de0100f2
EZ
150362012-03-02 Eli Zaretskii <eliz@gnu.org>
15037
15038 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
15039 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
15040 (redisplay_window, next_element_from_string): Fix typos in
15041 comments.
3e441275
EZ
15042 (redisplay_window): Pass to move_it_vertically the margin in
15043 pixels, not in screen lines.
de0100f2 15044
96a72ee9
GM
150452012-03-02 Glenn Morris <rgm@gnu.org>
15046
15047 * buffer.c (buffer-list-update-hook): Doc fix.
15048
312508d7
EZ
150492012-02-29 Eli Zaretskii <eliz@gnu.org>
15050
15051 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
15052 push_it before setting up the iterator for the first overlay
15053 string, even if we have an empty string loaded.
15054 (next_overlay_string): If there's an empty string on the iterator
15055 stack, pop the stack. (Bug#10903)
15056
27f3c637
PE
150572012-02-25 Paul Eggert <eggert@cs.ucla.edu>
15058
15059 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
15060 Suggested by Stefan Monnier in
15061 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
15062 * alloc.c (widen_to_Lisp_Object): New static function.
15063 (mark_memory): Also mark Lisp_Objects by fetching pointer words
15064 and widening them to Lisp_Objects. This would work even if
15065 USE_LSB_TAG is defined and wide integers are used, which might
15066 happen in a future version of Emacs.
15067
3c9dfce6
CY
150682012-02-25 Chong Yidong <cyd@gnu.org>
15069
fa74b241
CY
15070 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
15071 Doc fix.
15072
3c9dfce6
CY
15073 * xselect.c (Fx_selection_exists_p): Doc fix.
15074 (x_clipboard_manager_save_all): Print an informative message
15075 before saving to clipboard manager.
15076
9486df08
CY
150772012-02-24 Chong Yidong <cyd@gnu.org>
15078
15079 * keyboard.c (process_special_events): Handle all X selection
15080 requests in kbd_buffer, not just the next one (Bug#8869).
15081
f01d3321
CY
150822012-02-23 Chong Yidong <cyd@gnu.org>
15083
15084 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
15085 call when setting menu-bar-lines and tool-bar-lines parameters.
15086 (unwind_create_frame_1): New helper function.
15087
15088 * window.c (inhibit_window_configuration_change_hook): New var.
15089 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 15090 (syms_of_window): Initialize it.
f01d3321 15091
86b847b6
CY
150922012-02-22 Chong Yidong <cyd@gnu.org>
15093
15094 * xterm.c (x_draw_image_relief): Add missing type check for
15095 Vtool_bar_button_margin (Bug#10743).
15096
a59225b1
CY
150972012-02-21 Chong Yidong <cyd@gnu.org>
15098
15099 * fileio.c (Vfile_name_handler_alist): Doc fix.
15100
15101 * buffer.c (Fget_file_buffer): Protect against invalid file
15102 handler return value.
15103
310f5bd4
PE
151042012-02-20 Paul Eggert <eggert@cs.ucla.edu>
15105
cb3a28cc
PE
15106 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
15107 when computing $valmask.
15108
310f5bd4
PE
15109 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
15110 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
15111 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
15112 It's useless in that case, and it can cause problems on hosts
15113 that allocate halves of EMACS_INT values separately.
15114 Reported by Dan Horák. Diagnosed by Andreas Schwab in
15115 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
15116 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
15117 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
15118 it avoids undefined behavior on hosts where shifting right by more
15119 than the word width has undefined behavior.
15120
2375c96a
CY
151212012-02-19 Chong Yidong <cyd@gnu.org>
15122
15123 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
15124 (Funhandled_file_name_directory, Ffile_name_as_directory)
15125 (Fdirectory_file_name, Fexpand_file_name)
15126 (Fsubstitute_in_file_name): Protect against invalid file handler
15127 return values (Bug#10845).
15128
3eb49e71
EZ
151292012-02-18 Eli Zaretskii <eliz@gnu.org>
15130
15131 * .gdbinit (pitx): Fix incorrect references to fields of the
15132 iterator stack.
15133
7b926f3f
CY
151342012-02-17 Chong Yidong <cyd@gnu.org>
15135
15136 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
15137
11273115
PE
151382012-02-15 Paul Eggert <eggert@cs.ucla.edu>
15139
15140 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
15141 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
15142
c3a70e2b
CY
151432012-02-15 Chong Yidong <cyd@gnu.org>
15144
15145 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
15146 marked as special. Also, starting docstrings with * is obsolete.
15147
0ca43699
AS
151482012-02-13 Andreas Schwab <schwab@linux-m68k.org>
15149
15150 * gnutls.c (emacs_gnutls_write): Fix last change.
15151
2e8f3c56
LI
151522012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
15153
15154 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
15155 send_process.
15156
af70074f
SM
151572012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
15158
15159 * keymap.c (Fsingle_key_description): Handle char ranges.
15160
95986d52
CY
151612012-02-12 Chong Yidong <cyd@gnu.org>
15162
afd83bd1
CY
15163 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
15164 as that creates a dangerous corner case.
15165
95986d52
CY
15166 * window.c (Fdelete_window_internal): Invalidate the mouse
15167 highlight (Bug#9904).
15168
bd7da63e
GM
151692012-02-12 Glenn Morris <rgm@gnu.org>
15170
15171 * xselect.c (Fx_own_selection_internal)
15172 (Fx_get_selection_internal, Fx_disown_selection_internal)
15173 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
15174 * nsselect.m (Fx_own_selection_internal)
15175 (Fx_disown_selection_internal, Fx_selection_exists_p)
15176 (Fx_selection_owner_p, Fx_get_selection_internal):
15177 Sync docs and argument specs with the xselect.c versions.
15178
77abcbc2
LI
151792012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
15180
15181 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
15182
90b671e2
EZ
151832012-02-11 Eli Zaretskii <eliz@gnu.org>
15184
1c0ca0b7
EZ
15185 * w32select.c (Fx_selection_exists_p): Sync doc string and
15186 argument list with xselect.c. (Bug#10783)
15187
15188 * w16select.c (Fx_selection_exists_p): Sync doc string and
15189 argument list with xselect.c. (Bug#10783)
90b671e2 15190
49241268
GM
151912012-02-10 Glenn Morris <rgm@gnu.org>
15192
15193 * fns.c (Fsecure_hash): Doc fix.
15194
f998bbe7 151952012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
15196
15197 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
15198
0992bd9c
CY
151992012-02-07 Chong Yidong <cyd@gnu.org>
15200
15201 * buffer.c (Fbuffer_local_variables)
15202 (buffer_lisp_local_variables): Handle unbound vars correctly;
15203 don't let Qunbound leak into Lisp.
15204
af008560
GM
152052012-02-07 Glenn Morris <rgm@gnu.org>
15206
dd605cc4
GM
15207 * image.c (Fimagemagick_types): Doc fix.
15208
af008560
GM
15209 * image.c (imagemagick-render-type): Change it from a lisp object
15210 to an integer. Move the doc here from the lisp manual.
15211 Treat all values not equal to 0 the same.
15212
1449fa1d
CY
152132012-02-06 Chong Yidong <cyd@gnu.org>
15214
15215 * doc.c (store_function_docstring): Avoid applying docstring of
15216 alias to base function (Bug#2603).
15217
3723ec07
AS
152182012-02-04 Andreas Schwab <schwab@linux-m68k.org>
15219
15220 * .gdbinit (pp1, pv1): Remove redundant defines.
15221 (pr): Use pp.
15222
79c1cc1e
CY
152232012-02-04 Chong Yidong <cyd@gnu.org>
15224
15225 * nsterm.m: Declare a global (Bug#10694).
15226
d7f29f8e
EZ
152272012-02-04 Eli Zaretskii <eliz@gnu.org>
15228
cae07000
SM
15229 * w32.c (get_emacs_configuration_options):
15230 Include --enable-checking, if specified, in the return value.
d7f29f8e 15231
3b95a6f9
MR
152322012-02-04 Martin Rudalics <rudalics@gmx.at>
15233
15234 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
15235 after rounding frame sizes. (Bug#9723)
15236
d6fa96a6
EZ
152372012-02-04 Eli Zaretskii <eliz@gnu.org>
15238
15239 * keyboard.c (adjust_point_for_property): Don't position point
15240 before BEGV. (Bug#10696)
15241
df0b2940
PE
152422012-02-03 Paul Eggert <eggert@cs.ucla.edu>
15243
15244 Handle overflow when computing char display width (Bug#9496).
15245 * character.c (char_width): Return EMACS_INT, not int.
15246 (char_width, c_string_width): Check for overflow when
15247 computing the width; this is possible now that individual
15248 characters can have unbounded width. Problem introduced
15249 by merge from Emacs 23 on 2012-01-19.
15250
6bee44d6
MA
152512012-02-02 Michael Albinus <michael.albinus@gmx.de>
15252
15253 * dbusbind.c (Fdbus_register_method): Mention the return value
15254 :ignore in the docstring.
15255
44f92739
GM
152562012-02-02 Glenn Morris <rgm@gnu.org>
15257
1b9f60cc
GM
15258 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
15259
44f92739
GM
15260 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15261 Unconditionally set to t. (Bug#10673)
15262 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15263 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15264 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
15265
c5d3843c
KH
152662012-02-02 Kenichi Handa <handa@m17n.org>
15267
15268 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
15269 0, do not call append_composite_glyph.
15270
159462d4 152712012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
15272
15273 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
15274 NULL (Bug#6988).
15275 (x_produce_glyphs): If the component of a composition is a null
15276 string, set it->pixel_width to 1 to avoid zero-width glyph.
15277
78cef877
EZ
152782012-02-01 Eli Zaretskii <eliz@gnu.org>
15279
15280 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15281 first 2 arguments are identical. This makes inserting large
15282 output from a subprocess an order of magnitude faster on
15283 MS-Windows, where all sbrk'ed memory is always contiguous.
15284
97897668
GM
152852012-01-31 Glenn Morris <rgm@gnu.org>
15286
15287 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 15288 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
15289 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15290
31fd3586
GM
152912012-01-29 Glenn Morris <rgm@gnu.org>
15292
15293 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15294
0e24a8b2
CY
152952012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15296
15297 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15298
cc0adcb0
CY
152992012-01-28 Chong Yidong <cyd@gnu.org>
15300
15301 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15302
acc28cb9
CY
153032012-01-26 Chong Yidong <cyd@gnu.org>
15304
9c69cfb7
CY
15305 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15306
acc28cb9
CY
15307 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15308 repeat counts (Bug#10507).
15309
48da7392
GM
153102012-01-26 Glenn Morris <rgm@gnu.org>
15311
15312 * lread.c (syms_of_lread): Doc fix.
15313
14af5f7f
CY
153142012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15315
15316 * coding.c (encode_designation_at_bol): Change return value to
15317 EMACS_INT.
15318
0b21c100
CY
153192012-01-25 Chong Yidong <cyd@gnu.org>
15320
15321 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15322
3c2907f7
CY
153232012-01-21 Chong Yidong <cyd@gnu.org>
15324
15325 * floatfns.c (Fcopysign): Make the second argument non-optional,
15326 since nil is not allowed anyway.
15327
959ad23f
AS
153282012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15329
15330 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15331 (send_process): Likewise.
15332
34a02f46
MR
153332012-01-19 Martin Rudalics <rudalics@gmx.at>
15334
15335 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
15336 (Vwindow_persistent_parameters): Do not use Qstate.
15337 Rewrite doc-strings.
34a02f46 15338
1259009a 153392012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
15340
15341 * character.c (char_width): New function.
70d4fdf6
GM
15342 (Fchar_width, c_string_width, lisp_string_width):
15343 Use char_width (Bug#9496).
25ed9e61 15344
6a6ee00d
MR
153452012-01-16 Martin Rudalics <rudalics@gmx.at>
15346
15347 * window.c (Vwindow_persistent_parameters): New variable.
15348 (Fset_window_configuration, save_window_save): Handle persistent
15349 window parameters.
15350
c85efaf7
EZ
153512012-01-14 Eli Zaretskii <eliz@gnu.org>
15352
15353 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15354 thrashing the stack of the thread. (Bug#9087)
15355
5944709e
PE
153562012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15357
15358 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15359
e71f5d99
EZ
153602012-01-11 Eli Zaretskii <eliz@gnu.org>
15361
15362 * xdisp.c (rows_from_pos_range): Handle the case where the
15363 highlight ends on a newline. (Bug#10464)
15364 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15365 he end column for display of highlight that ends on a newline
15366 before a R2L line.
15367
ce316182
GM
153682012-01-11 Glenn Morris <rgm@gnu.org>
15369
15370 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15371 from load-path also when installation-directory is nil. (Bug#10208)
15372
5b43da69
GM
153732012-01-10 Glenn Morris <rgm@gnu.org>
15374
74cc8ff9
GM
15375 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15376
7d8d6e4e
GM
15377 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15378 Update template values to be closer to their typical values these days.
5b43da69 15379
a0db8d43
EZ
153802012-01-09 Eli Zaretskii <eliz@gnu.org>
15381
15382 * xdisp.c (rows_from_pos_range): Accept additional argument
15383 DISP_STRING, and accept any glyph in a row whose object is that
15384 string as eligible for mouse highlight. Fixes mouse highlight of
15385 display strings from overlays. (Bug#10464)
15386
9a0115ab 153872012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 15388
b9110d6a 15389 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
15390 * fileio.c (auto_saving_dir_umask): New static var.
15391 (Fmake_directory_internal): Use it.
15392 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15393 creating the directory. The old code temporarily assigns
15394 too-generous permissions to the directory.
15395 (do_auto_save_eh): Clear it.
b9110d6a 15396 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
15397 that the var is always cleared.
15398
6c1bd3f3
EZ
153992012-01-07 Eli Zaretskii <eliz@gnu.org>
15400
15401 * search.c (scan_buffer): Pass character positions to
15402 know_region_cache, not byte positions. (Bug#6540)
15403
069d2b50
L
154042012-01-07 LynX <_LynX@bk.ru> (tiny change)
15405
15406 * w32.c (sys_rename): Report EXDEV when rename of a directory
15407 fails because the target is on another logical disk. (Bug#10284)
15408
75bf0d33
DB
154092012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15410
15411 * xterm.c (x_embed_request_focus): New function.
15412
15413 * xterm.h: Add prototype.
15414
15415 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15416
1c6e5a32
GM
154172012-01-05 Glenn Morris <rgm@gnu.org>
15418
15419 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15420
651e947e
EZ
154212012-01-01 Eli Zaretskii <eliz@gnu.org>
15422
15423 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15424 Load gnutls_transport_set_lowat only if GnuTLS version is below
15425 2.11.1.
15426 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15427 GnuTLS versions below 2.11.1.
15428
3778cdd8
AL
154292011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15430
15431 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15432 to the doc string advising against its use for altering the way
15433 windows are scrolled.
15434
0e5317f7
KH
154352011-12-28 Kenichi Handa <handa@m17n.org>
15436
15437 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15438 coding-system ASCII compatible only when it does not produce BOM
15439 on encoding (Bug#10383).
15440
93d5ca1f
JD
154412011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15442
15443 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15444 can scroll.
15445 (create_and_show_popup_menu): Always use menu_position_func for
15446 Gtk3 (Bug#10361).
15447
ca22b785
AS
154482011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15449
15450 * callint.c (Fcall_interactively): Don't truncate prompt string.
15451
d048e1e6
EZ
154522011-12-23 Eli Zaretskii <eliz@gnu.org>
15453
15454 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15455 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 15456 resumed from there (after widening). (Bug#10360)
d048e1e6 15457
5ccaba1f
JD
154582011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15459
15460 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15461
204ee57f
JD
154622011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15463
b81d40f0
JB
15464 * nsterm.m (x_free_frame_resources):
15465 Release f->output_data.ns->miniimage.
204ee57f
JD
15466 (ns_index_color): Fix indentation. Do not retain
15467 color_table->colors[i].
15468
15469 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15470 before returning.
15471
15472 * nsfns.m (x_set_background_color): Assign return value from
15473 ns_index_color to face-background instead of NSColor*.
15474 (ns_implicitly_set_icon_type): Fix indentation.
15475 Change assignment in for loop to comparison.
15476
15477 * emacs.c (ns_pool): New variable.
15478 (main): Assign ns_pool.
15479 (Fkill_emacs): Call ns_release_autorelease_pool.
15480
15481 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15482 autorelease fdesc, release fdAttrs and tdict.
15483 (ns_get_covering_families): Release charset.
15484 (ns_findfonts): Release NSFontDescriptor created with new.
15485 (ns_uni_to_glyphs): Fix indentation.
15486 (setString): Release attrStr before assigning new value.
15487
c803b2b7
JD
154882011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15489
678f4426
JD
15490 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15491 and NS_IMPL_COCOA.
15492 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15493 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15494
cd394be1 154952011-12-18 David Reitter <reitter@cmu.edu>
678f4426 15496
5fecd5fc
JD
15497 * nsterm.m (ns_term_init): Subscribe for notifications
15498 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15499 to method trackingNotification in EmacsMenu.
15500
15501 * nsmenu.m (trackingMenu): New variable.
3771cb17 15502 (trackingNotification): New method (from Aquamacs).
5fecd5fc 15503 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 15504 from Aquamacs (Bug#7030).
678f4426
JD
15505
155062011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 15507
c803b2b7
JD
15508 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15509 (symbol_to_nsstring): Fix indentation.
15510 (ns_symbol_to_pb): New function.
cae07000
SM
15511 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15512 (Fns_rotate_cut_buffers_internal): Remove.
15513 (Fns_store_selection_internal): Rename from
c803b2b7
JD
15514 Fns_store_cut_buffer_internal.
15515 (ns_get_foreign_selection, Fx_own_selection_internal)
15516 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
15517 (Fns_get_selection_internal, Fns_store_selection_internal):
15518 Use ns_symbol_to_pb and check if return value is nil.
15519 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15520 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
15521 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15522 renamed to Sns_store_selection_internal.
15523 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15524 and remove this function.
15525 (ns_handle_selection_clear): Remove, never used.
15526 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15527 here.
15528
e1b01a3a
KB
155292011-12-17 Ken Brown <kbrown@cornell.edu>
15530
15531 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15532 GID is unknown (Bug#10257).
15533
2adb6e85
PE
155342011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15535
15536 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15537 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15538 which caused a build failure on GNU/Linux IA-64. This problem was
15539 introduced by my 2011-10-07 patch.
15540
d1d7b339
JL
155412011-12-15 Juri Linkov <juri@jurta.org>
15542
15543 * image.c (imagemagick_error): New function. (Bug#10112)
15544 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15545 Use `imagemagick_error' where ImageMagick functions return
15546 `MagickFalse'.
15547 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15548 proper order.
15549
100d5755
KH
155502011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15551
15552 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15553 fill background (Bug#8992).
15554
454592a6
MR
155552011-12-13 Martin Rudalics <rudalics@gmx.at>
15556
15557 * window.c (Vwindow_combination_resize)
15558 (Vwindow_combination_limit): Use t instead of non-nil in
15559 doc-strings.
61d4b438
MR
15560 (Vrecenter_redisplay): Add first sentence of doc-string on
15561 separate line.
53524d93 15562 (Frecenter): Fix doc-string typo.
454592a6 15563
3633e3aa
KH
155642011-12-11 Kenichi Handa <handa@m17n.org>
15565
15566 * coding.c (Funencodable_char_position): Pay attention to the
15567 buffer text relocation (Bug#9389).
15568
7b9d523a 155692011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 15570
7b9d523a
JD
15571 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15572 gtk_init (Bug#10100).
15573
b73189c6
EZ
155742011-12-10 Eli Zaretskii <eliz@gnu.org>
15575
15576 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15577 IT->string is nil. (Bug#10263)
15578
f7dfe5d6
JD
155792011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15580
83faebb4
JD
15581 * nsterm.h (x_free_frame_resources): Declare.
15582
f7dfe5d6
JD
15583 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15584 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15585
15586 * nsterm.h (ns_get_defaults_value): Declare.
15587
15588 * nsterm.m (ns_default): Call ns_get_defaults_value.
15589
7cd4e72c
EZ
155902011-12-09 Eli Zaretskii <eliz@gnu.org>
15591
15592 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15593 (Bug#10170)
15594
b34d7317
YM
155952011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15596
15597 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15598 that where the value of an _OBJC_* symbol points to is in the .bss
15599 section (Bug#10240).
15600
76470ad1
KH
156012011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15602
15603 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 15604 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 15605
745fff94
KH
156062011-12-08 Kenichi Handa <handa@m17n.org>
15607
15608 * ftfont.c (get_adstyle_property): Fix previous change
15609 (Bug#10233).
15610
6e44397c
JB
156112011-12-07 Juanma Barranquero <lekktu@gmail.com>
15612
15613 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15614 dirs from the default value of EMACSLOADPATH (bug#10208).
15615
7efa6272
GM
156162011-12-07 Glenn Morris <rgm@gnu.org>
15617
15618 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15619 installation and source directories as well. (Bug#10208)
15620
f6fc4d87
CY
156212011-12-06 Chong Yidong <cyd@gnu.org>
15622
15623 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15624
2bf26180
GM
156252011-12-06 Glenn Morris <rgm@gnu.org>
15626
15627 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15628 as an error, not just -1. (Bug#10217)
15629
3a6ad4f0
CY
156302011-12-05 Chong Yidong <cyd@gnu.org>
15631
15632 * keyboard.c (process_special_events): New function.
15633 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15634
75a3b399
PE
156352011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15636
15637 * coding.c (encode_designation_at_bol): Don't use uninitialized
15638 local variable (Bug#9318).
15639
c3c9e25e
KH
156402011-12-05 Kenichi Handa <handa@m17n.org>
15641
15642 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15643 return Qnil (Bug#8046, Bug#10193).
15644
5eb05ea3
KH
156452011-12-05 Kenichi Handa <handa@m17n.org>
15646
15647 * coding.c (encode_designation_at_bol): New args charbuf_end and
15648 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
15649 (coding_set_source): Return how many bytes coding->source was
15650 relocated.
15651 (coding_set_destination): Return how many bytes
15652 coding->destination was relocated.
15653 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 15654 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
15655
156562011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15657
15658 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15659 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15660 macro (Bug#9318).
15661
156622011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15663
15664 The following changes are to fix Bug#9318.
15665
a79703f5 15666 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
15667 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15668 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 15669 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 15670
7dbda6df
JB
156712011-12-05 Juanma Barranquero <lekktu@gmail.com>
15672
15673 * lisp.h (process_quit_flag): Fix external declaration.
15674
6d5eb5b0
SM
156752011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15676
15677 Don't macro-inline non-performance-critical code.
15678 * eval.c (process_quit_flag): New function.
15679 * lisp.h (QUIT): Use it.
15680
a0c3fad0
JD
156812011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15682
15683 * nsfns.m (get_geometry_from_preferences): New function.
15684 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15685
6c07aac2
AS
156862011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15687
15688 * emacs.c (Qkill_emacs): Define.
15689 (syms_of_emacs): Initialize it.
15690 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15691 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
15692 (quit_throw_to_read_char): Add parameter `from_signal'.
15693 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
15694 * lisp.h (QUIT): Call Fkill_emacs if requested.
15695
c052ead4
JD
156962011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15697
15698 * widget.c (update_wm_hints): Return if wmshell is null.
15699 (widget_update_wm_size_hints): New function.
15700
15701 * widget.h (widget_update_wm_size_hints): Declare.
15702
15703 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15704 widget_update_wm_size_hints (Bug#10104).
15705
9e49252b
EZ
157062011-12-03 Eli Zaretskii <eliz@gnu.org>
15707
15708 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15709 before a newline, prepare the bidi iterator for consuming the
15710 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 15711 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 15712
02b16839
JL
157132011-12-02 Juri Linkov <juri@jurta.org>
15714
15715 * search.c (Fword_search_regexp): New Lisp function created from
15716 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15717 (Fword_search_backward, Fword_search_forward)
15718 (Fword_search_backward_lax, Fword_search_forward_lax):
15719 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15720 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15721
0068070e
SM
157222011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15723
15724 * fileio.c (Finsert_file_contents): Move after-change-function call
15725 to before the "handled:" label, since all "goto handled" appear in
15726 cases where the *-change-functions have already been properly called
15727 (bug#10117).
15728
3360a3fc
AS
157292011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15730
15731 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15732 waiting for input. (Bug#10169)
15733
73d6c093
EZ
157342011-11-30 Eli Zaretskii <eliz@gnu.org>
15735
15736 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15737 verifies glyph row's hash code--we have just reallocated the
15738 glyphs, so their contents can be complete garbage. (Bug#10164)
15739
febe6bea
JB
157402011-11-30 Juanma Barranquero <lekktu@gmail.com>
15741
15742 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15743
801a4313
EZ
157442011-11-30 Eli Zaretskii <eliz@gnu.org>
15745
15746 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15747 attributes are tested _before_ calling verify_row_hash, to protect
15748 against GCC re-ordering of the tests. (Bug#10164)
15749
2b56b87e
JD
157502011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15751
15752 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15753
15754 * xterm.c (handle_one_xevent): Only set async_visible and friends
15755 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 15756 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
15757 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15758
dbf31225
PE
157592011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15760
15761 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15762 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15763 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15764 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15765 All uses changed to use GCPRO1 etc.
15766 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15767 Revert to old implementation (i.e., before 2011-03-11).
15768
1305621b
YM
157692011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15770
15771 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15772 of scroll runs so as to avoid assigning disabled bogus rows and
15773 unnecessary graphics copy operations.
15774
8c9afb46
EZ
157752011-11-27 Eli Zaretskii <eliz@gnu.org>
15776
15777 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15778 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15779 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15780 (malloc, free, realloc, calloc): Redirect to e_* only when
15781 compiling Emacs.
15782
15783 * lisp.h (GCTYPEBITS): Move before first use.
15784 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15785 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15786 this macro definition.
15787
15788 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15789 _MSC_VER.
15790
54e9e3bf
JD
157912011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15792
6d5eb5b0
SM
15793 * gtkutil.c (xg_create_frame_widgets):
15794 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
15795 present with Gtk+ 2.0.
15796
83aca1cb
PE
157972011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15798
15799 * fileio.c (Finsert_file_contents): Undo previous change; see
15800 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15801
5b76caa4
PE
158022011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15803
15804 Rename locals to avoid shadowing.
15805 * fileio.c (Finsert_file_contents):
15806 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15807 * process.c (wait_reading_process_output):
15808 Rename inner 'proc' to 'p' to avoid shadowing.
15809 Indent for consistency with usual Emacs style.
15810
8c535114
EZ
158112011-11-25 Eli Zaretskii <eliz@gnu.org>
15812
15813 * xdisp.c (redisplay_window): If cursor row is not fully visible
15814 after recentering, and scroll-conservatively is set to a large
15815 number, scroll window by a few more lines to make the cursor fully
15816 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
15817 (start_display): Don't move to the next line if the display should
15818 start at a newline that is part of a display vector or an overlay
15819 string. (Bug#10119)
8c535114 15820
fa4fdb5c
JL
158212011-11-24 Juri Linkov <juri@jurta.org>
15822
15823 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15824 after the `MagickPingImage' call. (Bug#10112)
15825
90ec88df
CY
158262011-11-23 Chong Yidong <cyd@gnu.org>
15827
15828 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15829
56e2e794
MR
158302011-11-23 Martin Rudalics <rudalics@gmx.at>
15831
15832 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15833 making another buffer current. (Bug#10114)
15834
b6e64c41
GM
158352011-11-23 Glenn Morris <rgm@gnu.org>
15836
15837 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15838
6b21de18
CY
158392011-11-23 Chong Yidong <cyd@gnu.org>
15840
15841 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15842 using it (Bug#5984).
15843
b12cd789
EZ
158442011-11-22 Eli Zaretskii <eliz@gnu.org>
15845
15846 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15847 and header-lines, as they don't have one computed for them.
15848 (Bug#10098)
15849
15850 * .gdbinit (prow): Make displayed values more self-explaining.
15851 Add row's hash code.
15852
261b6fd4
LMI
158532011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15854
15855 * process.c (wait_reading_process_output): Fix asynchrounous
15856 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 15857 (wait_reading_process_output): Add comment and URL.
261b6fd4 15858
e7cfd277
JD
158592011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15860
15861 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15862
a9b9b7f5
CY
158632011-11-21 Chong Yidong <cyd@gnu.org>
15864
15865 * window.c (Fnext_window, Fprevious_window): Doc fix.
15866
b0d15b4f
SM
158672011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15868
15869 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15870
fe7a3057
JB
158712011-11-20 Juanma Barranquero <lekktu@gmail.com>
15872
15873 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15874
d2999b1a
MR
158752011-11-20 Martin Rudalics <rudalics@gmx.at>
15876
15877 * window.c (Fset_window_combination_limit): Rename argument
15878 STATUS to LIMIT.
15879 (Vwindow_combination_limit): Remove "status" from doc-string.
15880
d5ff9cd0
AS
158812011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15882
15883 * m/ibms390.h: Remove.
15884 * m/ibms390x.h: Don't include "ibms390.h".
15885
a5bb9bd3
SM
158862011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15887
15888 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15889 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15890
cd1181db
JB
158912011-11-20 Juanma Barranquero <lekktu@gmail.com>
15892
15893 * casetab.c (Fset_case_table):
15894 * charset.c (Fcharset_after): Fix typos.
15895
615a3b8d 158962011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15897
17e845af
PE
15898 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15899 Otherwise, valgrind does not work on some platforms.
15900 Problem reported by Andreas Schwab in
6a0bf43d
PE
15901 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15902 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15903 is set, removing the need for VIRT_ADDRESS_VARIES.
15904 (PURE_P): Use a more-efficient implementation that needs just one
15905 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15906 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15907 to 4 (xorl, subq, cmpq, setbe).
15908 * alloc.c (pure): Always extern now, since that's the
15909 VIRT_ADDR_VARIES behavior.
15910 (PURE_POINTER_P): Use a single comparison, not two, for
15911 consistency with the new puresize.h.
15912 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15913 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15914 Remove VIRT_ADDR_VARIES no longer needed.
15915
f8fe6f96
EZ
159162011-11-19 Eli Zaretskii <eliz@gnu.org>
15917
15918 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15919 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15920 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15921 behave as if the cursor position were at the window margin.
15922
15923 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15924 and the cursor position is out of bounds, behave as if the cursor
15925 position were at the window margin. (Bug#10075)
15926
df05a53c
CY
159272011-11-18 Chong Yidong <cyd@gnu.org>
15928
15929 * window.c (Fwindow_combination_limit): Make first argument
15930 non-optional, since it is meaningless for live windows like the
15931 selected window.
61ccba97 15932
2071918e
DA
159332011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15934
15935 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15936
b50a28de
SM
159372011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15938
15939 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15940 (graft_intervals_into_buffer): Simplify.
15941
015137db
EZ
159422011-11-18 Eli Zaretskii <eliz@gnu.org>
15943
15944 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15945 hash values of the two rows.
15946 (copy_row_except_pointers): Preserve the used[] arrays and the
15947 hash values of the two rows. (Bug#10035)
68c95424 15948 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15949
15950 * xdisp.c (row_hash): New function, body extracted from
15951 compute_line_metrics.
15952 (compute_line_metrics): Call row_hash, instead of computing the
15953 hash code inline.
15954
15955 * dispnew.c (verify_row_hash): Call row_hash for computing the
15956 hash code of a row, instead of duplicating code from xdisp.c.
15957
15958 * dispextern.h (row_hash): Add prototype.
15959
a2addb04
TH
159602011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15961
15962 * frame.c (delete_frame): Don't delete the terminal when the last
15963 X frame is closed if emacs is built with GTK toolkit.
15964
df85d315
JB
159652011-11-17 Juanma Barranquero <lekktu@gmail.com>
15966
15967 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15968
a0c2d0ae
MR
159692011-11-17 Martin Rudalics <rudalics@gmx.at>
15970
15971 * window.c (Vwindow_splits): Rename to
15972 Vwindow_combination_resize. Suggested by Juri Linkov.
15973 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15974 of Vwindow_splits.
15975
58179cce
JB
159762011-11-16 Juanma Barranquero <lekktu@gmail.com>
15977
7877f373
JB
15978 * nsfns.m (Fns_font_name):
15979 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15980
b6f67890
MR
159812011-11-16 Martin Rudalics <rudalics@gmx.at>
15982
15983 * window.h (window): Rename slot "nest" to "combination_limit".
15984 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15985 (Fset_window_nest): Rename to Fset_window_combination_limit.
15986 (Vwindow_nest): Rename to Vwindow_combination_limit.
15987 (recombine_windows, make_parent_window, make_window)
15988 (Fsplit_window_internal, saved_window)
15989 (Fset_window_configuration, save_window_save): Rename all
15990 occurrences of window_nest to window_combination_limit.
15991
c7015153
JB
159922011-11-15 Juanma Barranquero <lekktu@gmail.com>
15993
15994 * image.c (imagemagick_load_image): Fix typo.
15995
322ad6ec
EZ
159962011-11-14 Eli Zaretskii <eliz@gnu.org>
15997
15998 * xdisp.c (display_line): Move the call to
15999 highlight_trailing_whitespace before the call to
16000 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
16001 faces of all the glyphs to compute ROW's hash value.
16002 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 16003
f067b8ec
JB
160042011-11-14 Juanma Barranquero <lekktu@gmail.com>
16005
16006 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
16007 just return (bug#10044).
16008
1e5b2111
EZ
160092011-11-12 Eli Zaretskii <eliz@gnu.org>
16010
7ef3cbd5
EZ
16011 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
16012 with user-defined heap size. Bump the default size of the temacs
16013 heap to 27MB, to avoid memory warning when running temacs.
16014 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
16015
1e5b2111
EZ
16016 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
16017 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
16018 (verify_row_hash) [XASSERTS]: New function.
16019 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
16020 that the hash value of glyph rows is correct.
1e5b2111 16021
89d61221
MR
160222011-11-12 Martin Rudalics <rudalics@gmx.at>
16023
16024 * window.h (window): Remove splits slot.
16025 * window.c (Fwindow_splits, Fset_window_splits): Remove.
16026 (Fdelete_other_windows_internal, make_parent_window)
16027 (make_window, Fsplit_window_internal, Fdelete_window_internal)
16028 (Fset_window_configuration, save_window_save): Don't deal with
16029 split status of windows.
16030 (saved_window): Remove splits slot.
16031 (Vwindow_splits): Rewrite doc-string.
16032
97f18cc8
JD
160332011-11-11 Jan Djärv <jan.h.d@swipnet.se>
16034
16035 * xfns.c (unwind_create_frame):
16036 * nsfns.m (unwind_create_frame):
16037 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
16038 Vframe_list (Bug#9999).
16039
22a648b4
DA
160402011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
16041
0b381c7e 16042 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 16043
659afede
KH
160442011-11-11 Kenichi Handa <handa@m17n.org>
16045
16046 * callproc.c (Fcall_process): Set the member dst_multibyte of
16047 process_coding.
16048
9ac0394b
KH
160492011-11-11 Johan Bockgård <bojohan@gnu.org>
16050
16051 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
16052 avoid a crash (bug#9496).
16053
2fbdc249
CY
160542011-11-09 Chong Yidong <cyd@gnu.org>
16055
16056 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
16057 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
16058
ac6b1f81
PE
160592011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16060
16061 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
16062
09db192c
PE
160632011-11-08 Paul Eggert <eggert@cs.ucla.edu>
16064
16065 Avoid some portability problems by eschewing 'extern inline' functions.
16066 The trivial performance wins aren't worth the portability hassles; see
16067 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
16068 et seq.
16069 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16070 (window_box_width, window_box_left, window_box_left_offset)
16071 (window_box_right, window_box_right_offset): Undo previous change,
16072 by removing the "extern"s.
16073 * intervals.c (adjust_intervals_for_insertion)
16074 (adjust_intervals_for_deletion): Undo previous change,
16075 making these static again.
16076 (offset_intervals, temp_set_point_both, temp_set_point)
16077 (copy_intervals_to_string): No longer inline.
16078 * xdisp.c (window_text_bottom_y, window_box_width)
16079 (window_box_height, window_box_left_offset)
16080 (window_box_right_offset, window_box_left, window_box_right)
16081 (window_box): No longer inline.
16082
105216ed
CY
160832011-11-08 Chong Yidong <cyd@gnu.org>
16084
16085 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
16086 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
16087 Signal an error if not a live window.
105216ed
CY
16088 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
16089 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
16090
ae9e237f
JB
160912011-11-07 Juanma Barranquero <lekktu@gmail.com>
16092
16093 * lisp.h (syms_of_abbrev): Remove declaration.
16094 Reported by CHENG Gao <chenggao@royau.me>.
16095
c7aa8333
EZ
160962011-11-07 Eli Zaretskii <eliz@gnu.org>
16097
16098 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
16099 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
16100 of temacs in GUI mode.
16101
be7f5545
MR
161022011-11-07 Martin Rudalics <rudalics@gmx.at>
16103
16104 * window.h: Declare delete_all_child_windows instead of
16105 delete_all_subwindows.
16106 * window.c (Fwindow_nest, Fset_window_nest)
16107 (Fset_window_new_total, Fset_window_new_normal)
16108 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
16109 (delete_all_subwindows): Rename to delete_all_child_windows.
16110 (Fdelete_other_windows_internal, Fset_window_configuration):
16111 Call delete_all_child_windows instead of delete_all_subwindows.
16112 * frame.c (delete_frame): Call delete_all_child_windows instead
16113 of delete_all_subwindows.
16114
ca78dc43
PE
161152011-11-07 Paul Eggert <eggert@cs.ucla.edu>
16116
16117 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
16118 This is also needed for porting to any host where GC_MARK_STACK is
16119 not GC_MAKE_GCPROS_NOOPS.
16120 (which_symbols): Use it.
16121
a0241d01
KH
161222011-11-07 Kenichi Handa <handa@m17n.org>
16123
16124 * coding.c (coding_set_destination): Check coding->src_pos only
16125 when coding->src_object is a buffer (bug#9910).
16126
16127 * process.c (send_process): Set the member src_multibyte of coding
16128 to 0 (bug#9911) when sending a unibyte text.
16129
16130 * callproc.c (Fcall_process): Set the member src_multibyte of
16131 process_coding to 0 (bug#9912).
16132
a64bfdfa 161332011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
16134
16135 * xmenu.c (cleanup_widget_value_tree): New function.
16136 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
16137 calling free_menubar_widget_value_tree directly (Bug#9830).
16138
cb41b32a
PE
161392011-11-06 Paul Eggert <eggert@cs.ucla.edu>
16140
16141 Fix some portability problems with 'inline'.
16142 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
16143 (window_box_width, window_box_left, window_box_left_offset)
16144 (window_box_right, window_box_right_offset): Declare extern.
16145 Otherwise, these inline functions do not conform to C99 and
16146 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
16147 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
16148 * intervals.c (adjust_intervals_for_insertion)
16149 (adjust_intervals_for_deletion): Now extern, because otherwise the
16150 extern inline functions 'offset_intervals' couldn't refer to it.
16151 (static_offset_intervals): Remove.
16152 (offset_intervals): Rewrite using the old contents of
16153 static_offset_intervals. The old version didn't conform to C99
16154 because an extern inline function contained a reference to an
16155 identifier with static linkage.
16156
b7041366
AS
161572011-11-06 Andreas Schwab <schwab@linux-m68k.org>
16158
16159 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
16160 GC.
16161
88a37c4d
EZ
161622011-11-06 Eli Zaretskii <eliz@gnu.org>
16163
16164 * xdisp.c (init_iterator, reseat_to_string): Don't set the
16165 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
16166 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
16167 return Qleft_to_right.
16168
49745b39
CY
161692011-11-06 Chong Yidong <cyd@gnu.org>
16170
16171 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
16172 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
16173 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
16174 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
16175 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
16176 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
16177 (Fwindow_vscroll): Doc fix.
16178 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
16179 argument, since it makes no sense to pass a live window and for
16180 consistency with window-child.
16181
1f05cd82
CS
161822011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
16183
16184 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
16185 support MSVC.
16186
22610910
JR
161872011-11-05 Jason Rumney <jasonr@gnu.org>
16188
16189 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
16190 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
16191 fonts (Bug#6029).
16192 (add_font_entity_to_list): Fix logic errors in mixed boolean and
16193 bitwise arithmetic preventing use of unicode-sip and non-truetype
16194 opentype fonts.
16195
a06776b2
EZ
161962011-11-05 Eli Zaretskii <eliz@gnu.org>
16197
3ad924ba
EZ
16198 * s/ms-w32.h (fstat, stat, utime): Move redirections to
16199 "emacs"-only part.
16200
a06776b2
EZ
16201 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
16202 initialization code to keep similarity to xfns.c after changes
16203 from 2011-11-05.
16204
c9e7db78
JD
162052011-11-05 Jan Djärv <jan.h.d@swipnet.se>
16206
a97f8f3f
JD
16207 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
16208 (unwind_create_frame): New function (Bug#9943).
16209 (Fx_create_frame): Restructure code to be more similar to the one in
16210 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
16211 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
16212 Move terminal->reference_count++ just before making the frame official
16213 (Bug#9943).
16214
16215 * nsterm.m (x_free_frame_resources): New function.
16216 (x_destroy_window): Move code to x_free_frame_resources.
16217
c9e7db78 16218 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
16219 (Fx_create_frame, x_create_tip_frame):
16220 Move terminal->reference_count++ just before making the frame
75f1671a 16221 official. Move initialization of image_cache_refcount and
c9e7db78
JD
16222 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
16223
a6fc3b5c
EZ
162242011-11-05 Eli Zaretskii <eliz@gnu.org>
16225
16226 Support MSVC build with newer versions of Visual Studio.
16227 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
16228 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
16229 nt/gmake.defs.
16230
16231 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
16232 which are not supported by MSVC.
16233 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
16234 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
16235 bitfields.
16236 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
16237 types in bitfields.
16238 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
16239
16240 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
16241
58179cce 162422011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
16243
16244 Support MSVC build with newer versions of Visual Studio.
16245 * w32.c: Don't include w32api.h for MSVC.
16246 (init_environment) [_MSC_VER]: Call sys_access, not _access.
16247
16248 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
16249 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
16250 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
16251 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
16252 e_* cousins.
16253 (alloca) [_MSC_VER]: Define to _alloca.
16254
16255 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
16256
16257 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
16258
a58c13ed
EZ
162592011-11-04 Eli Zaretskii <eliz@gnu.org>
16260
16261 * xdisp.c (note_mouse_highlight): If either of
16262 previous/next-single-property-change returns nil, treat that as
16263 the beginning or the end of the buffer. (Bug#9955)
16264
fe0b6370
JD
162652011-11-04 Jan Djärv <jan.h.d@swipnet.se>
16266
a58c13ed 16267 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
16268 label is not null (Bug#9951).
16269 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
16270 may be NULL.
16271
89bd5ee1
EZ
162722011-11-04 Eli Zaretskii <eliz@gnu.org>
16273
16274 * window.c (Fwindow_body_size): Mention in the doc string that the
16275 return value is in frame's canonical units. (Bug#9949)
16276
84c3edb9
EZ
162772011-11-03 Eli Zaretskii <eliz@gnu.org>
16278
4e2fb5c7
EZ
16279 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16280
84c3edb9 16281 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 16282 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 16283 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 16284
bc17a887
EZ
162852011-11-01 Eli Zaretskii <eliz@gnu.org>
16286
16287 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16288 Don't stop backward scan on the continuation glyph, even though
16289 its CHARPOS is positive.
6d5eb5b0
SM
16290 (mouse_face_from_buffer_pos, note_mouse_highlight):
16291 Rename cover_string to disp_string.
bc17a887 16292
4ee88440
MR
162932011-11-01 Martin Rudalics <rudalics@gmx.at>
16294
16295 * window.c (temp_output_buffer_show): Don't use
16296 Vtemp_buffer_show_specifiers.
16297 (Vtemp_buffer_show_specifiers): Remove unused variable.
16298
c2ff3c02
EZ
162992011-10-30 Eli Zaretskii <eliz@gnu.org>
16300
16301 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16302 past the beginning of the current glyph matrix.
16303
58179cce 163042011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
16305
16306 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16307 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16308 HAVE_GTK3 (Bug#9869).
b77a6a7f 16309
3b574623
JD
16310 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16311 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16312
b77a6a7f
JD
16313 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16314
16315 * xterm.c: Declare x_handle_net_wm_state to return int.
16316 (handle_one_xevent): Check if we are iconified but don't have
16317 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16318 (get_current_wm_state): Return non-zero if not hidden,
16319 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16320 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16321 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16322 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16323
196e41e4
PE
163242011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16325
16326 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16327 so that this new function doesn't get optimized away by a
16328 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16329
021f2e1a
AS
163302011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16331
16332 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16333
8b058d44
EZ
163342011-10-29 Eli Zaretskii <eliz@gnu.org>
16335
16336 Fix the `xbytecode' command.
16337 * .gdbinit (xprintbytestr): New command.
b50a28de 16338 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
16339 (xbytecode): Print the byte-code string as well.
16340
4452fb80
EZ
163412011-10-29 Kim Storm <storm@cua.dk>
16342
8b058d44
EZ
16343 * alloc.c (which_symbols): New function.
16344
21b72067
AS
163452011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16346
16347 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16348 line. (Bug#9903)
16349
83ed7b5c
GM
163502011-10-29 Glenn Morris <rgm@gnu.org>
16351
16352 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16353 Not clear what it was for, and it causes various bugs. (Bug#9839)
16354
5a7a728b
EZ
163552011-10-28 Eli Zaretskii <eliz@gnu.org>
16356
16357 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16358 possible random value that matches one of those tested as
16359 condition to clear the mouse face.
16360
d3d0842f
CY
163612011-10-28 Chong Yidong <cyd@gnu.org>
16362
16363 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16364
31b39d13
DN
163652011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16366
16367 * window.c (make_window): Initialize phys_cursor_on_p.
16368
9aba6043
SM
163692011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16370
16371 * lisp.h (struct Lisp_Symbol): Update comments.
16372
c20992f4
JB
163732011-10-28 Juanma Barranquero <lekktu@gmail.com>
16374
16375 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16376
db4f02f2
EZ
163772011-10-28 Eli Zaretskii <eliz@gnu.org>
16378
16379 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16380 <oslsachem@gmail.com> for helping to debug this.
16381
16382 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16383 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16384 (g_b_init_get_glyph_outline_w): New static variables.
16385 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16386 (GetGlyphOutlineW_Proc): New typedefs.
16387 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
16388 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16389 New functions.
16390 (w32font_open_internal, compute_metrics):
16391 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
16392 instead of calling the "wide" APIs directly.
16393
16394 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16395
16396 * w32.h (syms_of_w32font): Add prototype.
16397
87e68db4
JB
163982011-10-27 Juanma Barranquero <lekktu@gmail.com>
16399
16400 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16401 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16402 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16403 (Fmove_to_window_line): Doc fix.
16404
435c1d67
CY
164052011-10-27 Chong Yidong <cyd@gnu.org>
16406
16407 * process.c (make_process): Set gnutls_state to NULL.
16408
16409 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16410 non-NULL, regardless of GNUTLS_INITSTAGE.
16411 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16412 an error. Set process slots as soon as we allocate them.
16413
16414 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16415
9c6c6f49
CY
164162011-10-27 Chong Yidong <cyd@gnu.org>
16417
9aba6043
SM
16418 * gnutls.c (emacs_gnutls_deinit): New function.
16419 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
16420 (Fgnutls_deinit, Fgnutls_boot): Use it.
16421
16422 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16423 (deactivate_process): Call emacs_gnutls_deinit.
16424
657d08d3
JB
164252011-10-27 Juanma Barranquero <lekktu@gmail.com>
16426
16427 * image.c (x_create_x_image_and_pixmap):
16428 * w32.c (sys_rename, w32_delayed_load):
16429 * w32font.c (fill_in_logfont):
16430 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16431
5430d399
JB
164322011-10-26 Juanma Barranquero <lekktu@gmail.com>
16433
16434 * w32fns.c (w32_default_color_map): New function,
16435 extracted from Fw32_default_color_map.
a7ef684b 16436 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 16437
fe0055fa
PE
164382011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16439
16440 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16441
e6346438
SM
164422011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16443
16444 * keyboard.c (test_undefined): New function (bug#9751).
16445 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16446
e112cc37
ET
164472011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16448
16449 * sysdep.c (init_sys_modes): Fix the check for the controlling
16450 terminal (Bug#6649).
16451
7b5d6677
EZ
164522011-10-20 Eli Zaretskii <eliz@gnu.org>
16453
16454 * dispextern.h (struct bidi_it): New member next_en_type.
16455
16456 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16457 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16458 current character, check also for next_en_type being WEAK_EN.
16459 (bidi_resolve_weak): Don't enter the expensive loop if the current
16460 position is before next_en_pos. Record the bidi type of the first
16461 non-ET, non-BN character we find, in addition to its position.
16462 (bidi_level_of_next_char): Invalidate next_en_type when
16463 next_en_pos is over-stepped.
16464
7da0b018
PE
164652011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16466
16467 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16468 * editfns.c: Rewrite current-time-zone so that it invokes
16469 the equivalent of (format-time-string "%Z") to get the time zone name.
16470 This fixes a bug when the time zone name contains characters that
16471 need converting from the system time locale to Emacs internal format.
16472 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16473 that patch fixed format-time-string to do the conversion, but
16474 I forgot to fix current-time-zone.
16475 (format_time_string): New function, containing most of
16476 what Fformat_time_string used to contain.
16477 (Fformat_time_string): Rewrite in terms of format_time_string.
16478 This doesn't change this function's behavior.
16479 (current-time-zone): Rewrite to use format_time_string.
16480 This fixes the bug reported by Michael Schierl in
16481 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16482 Jason Rumney's 2007-06-07 change worked around this bug, but
16483 didn't fix it.
16484 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16485
8547b010
EZ
164862011-10-19 Eli Zaretskii <eliz@gnu.org>
16487
16488 * xdisp.c (start_display): If the character at POS is displayed
16489 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
16490 (try_window_reusing_current_matrix): If a line ends in a display
16491 vector or the next line starts in a display vector, continue
16492 redrawing the window even though the character position of
16493 start_row was reached.
8547b010
EZ
16494 (Bug#9771, part 2)
16495
4e948d15
CY
164962011-10-18 Chong Yidong <cyd@gnu.org>
16497
16498 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16499 with nobreak-char-display too.
16500
4787455f
EZ
165012011-10-18 Eli Zaretskii <eliz@gnu.org>
16502
16503 Fix part 3 of bug#9771.
16504 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16505 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16506 non-neutral characters if the current character is a paragraph
16507 separator (a.k.a. Newline). This avoids running the same
16508 expensive loop twice, once when we consume the preceding newline
16509 and the other time when the line actually needs to be displayed.
16510 Avoid the loop when we see neutrals on the base embedding level
16511 following a character whose directionality is the same as the
16512 paragraph's. This avoids running the expensive loop when a line
16513 ends in a long sequence of neutrals, like control characters.
16514 Add assertion against STRONG_AL type. Slightly rearrange code
16515 that determines the type of a neutral given the first non-neutral
16516 that follows it.
16517 (bidi_level_of_next_char): Set next_en_pos to zero when
16518 invalidating its info.
16519
2c91f553
EZ
165202011-10-17 Eli Zaretskii <eliz@gnu.org>
16521
16522 * xdisp.c (push_display_prop): Determine whether to record string
16523 or buffer position by IT->string, not by IT->method. Allow
16524 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
16525 (move_it_vertically_backward): Don't look for character position
16526 immediately after the newline when in a continuation line.
16527 (Bug#9771, part 1)
2c91f553 16528
c7b08b0d
MR
165292011-10-15 Martin Rudalics <rudalics@gmx.at>
16530
16531 * window.c (coordinates_in_window): Rewrite and delabelize
16532 vertical border check. (Bug#5357) (Bug#9618)
16533
6b02f655
SM
165342011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16535
16536 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16537 errors in XSetWindowBorder (bug#9310).
16538
81d40c92
DA
165392011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16540
16541 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16542 avoid crash when xmalloc overrun checking is enabled.
16543
d4172c3b
EZ
165442011-10-13 Eli Zaretskii <eliz@gnu.org>
16545
16546 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16547 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16548 cursor motion with <left> and <right> arrow keys.
16549
16550 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16551 some callers set that themselves.
16552
b00eea75
EZ
165532011-10-12 Eli Zaretskii <eliz@gnu.org>
16554
16555 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16556 display string and the previous row comes from the same string and
16557 is empty. (Bug#9739) (Bug#9738)
16558
8fe012c4
SM
165592011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16560
16561 * doc.c (get_doc_string): Encode file name (bug#9735).
16562
0074aef2
EZ
165632011-10-12 Eli Zaretskii <eliz@gnu.org>
16564
79beb178
EZ
16565 * bidi.c (bidi_level_of_next_char):
16566 * xdisp.c (get_visually_first_element): Remove old incorrect
16567 comments regarding the Unicode Line Separator character.
16568
0074aef2
EZ
16569 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16570
6e4b3fbe
DA
165712011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16572
16573 * alloc.c (Fgc_status): Do not access beyond zombies array
16574 boundary if nzombies > MAX_ZOMBIES.
16575 * alloc.c (dump_zombies): Add missing format specifier.
16576
0324f3af
PE
165772011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16578
b5525cac
PE
16579 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16580 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16581
0324f3af
PE
16582 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16583 Some packages use them to denote characters with modifiers.
16584
e9b5f888
AS
165852011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16586
16587 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16588 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16589 matching a pp-number. Rename parameter var to var1.
16590
127827c0
SM
165912011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16592
16593 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16594
c8fd3bd0
GM
165952011-10-08 Glenn Morris <rgm@gnu.org>
16596
16597 * callint.c (Fcall_interactively): Give a more explicit error for the
16598 'c' case with a non-character input. (Bug#8479)
16599
352ec8ff
EZ
166002011-10-08 Eli Zaretskii <eliz@gnu.org>
16601
03669ccb
EZ
16602 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16603 lines.
7061c986
EZ
16604 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16605 lines that are hscrolled on the left.
03669ccb 16606
352ec8ff
EZ
16607 * dispnew.c (buffer_posn_from_coords): Account for a possible
16608 presence of header-line. (Bug#4426)
16609
a66cfb1c
SM
166102011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16611
6b02f655
SM
16612 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16613 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 16614
7c5ee88e
PE
166152011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16616
16617 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16618 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16619 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16620 this makes Emacs dump core during garbage collection on rare
16621 occasions. sizeof is obviously inferior to offsetof here, so
16622 stick with offsetof.
16623 (GC_POINTER_ALIGNMENT): New macro.
16624 (mark_memory): Omit 3rd (offset) arg; caller changed.
16625 Don't assume EMACS_INT alignment is the same as pointer alignment.
16626
df1bbe5b
SM
166272011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16628
16629 * keyboard.c (read_key_sequence_remapped): New var.
16630 (read_key_sequence): Compute remapping in the right buffer.
16631 (command_loop_1): Use read_key_sequence's remapping directly.
16632
51553db6
SM
166332011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16634
32c1fffd
SM
16635 * dired.c (file_name_completion): Don't expand file name.
16636 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16637 before checking file name handler.
16638
51553db6
SM
16639 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16640 they've been requested explicitly (bug#9591).
16641
b6bd1599 166422011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
16643
16644 * keymap.c (Fsingle_key_description): Use make_specified_string
16645 instead of build_string to build string from push_key_description.
16646 (Bug#5193)
16647
f701dc2a
PE
166482011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16649
4222c55d
PE
16650 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16651 This fixes a Y2038 bug on 64-bit hosts.
16652 * buffer.c (reset_buffer):
16653 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16654 (Fclear_buffer_auto_save_failure):
16655 Use 0, not -1, to represent an unset failure time, since time_t
16656 might not be signed.
16657
f701dc2a
PE
16658 Remove dependency on glibc malloc internals.
16659 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16660 Move back here from lisp.h, but with their new implementations.
16661 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16662 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16663 * charset.c (charset_table_init): New static var.
16664 (syms_of_charset): Use it instead of xmalloc. This removes a
16665 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16666 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16667 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16668 Move back to alloc.c.
16669 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16670 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16671
9ceebf39
JD
166722011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16673
16674 * nsterm.m (windowDidResize): Call x_set_window_size only when
16675 ns_in_resize is true. Otherwise set pixelwidth/height and
16676 call change_frame_size (Bug#9628).
16677
cb993c58
PE
166782011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16679
3930c88b
PE
16680 Port --enable-checking=all to Fedora 14 x86-64.
16681 * charset.c (syms_of_charset): Also account for glibc malloc's
16682 internal overhead when calculating the initial malloc maximum.
16683
cb993c58
PE
16684 Port --enable-checking=all to Fedora 14 x86.
16685 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16686 Move to lisp.h.
16687 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16688 (overrun_check_realloc, overrun_check_free):
16689 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16690 That way, xmalloc returns a properly-aligned pointer even if
16691 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16692 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16693 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16694 into account when calculating the initial malloc maximum.
16695 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16696 Move here from alloc.c, so that charset.c can use it too.
16697 Properly align; the old code wasn't right for common 32-bit hosts
16698 when configured with --enable-checking=all.
16699 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16700 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16701
31bed486
EZ
167022011-09-29 Eli Zaretskii <eliz@gnu.org>
16703
04c70788 16704 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
16705 use EDOM.
16706
fbcaa2f3
EZ
167072011-09-28 Eli Zaretskii <eliz@gnu.org>
16708
16709 * xdisp.c (compute_display_string_end): If there's no display
16710 string at CHARPOS, return -1.
16711
16712 * bidi.c (bidi_fetch_char): When compute_display_string_end
16713 returns a negative value, treat the character as a normal
16714 character not covered by a display string. (Bug#9624)
16715
a239d4e9
JB
167162011-09-28 Juanma Barranquero <lekktu@gmail.com>
16717
16718 * lread.c (Fread_from_string): Fix typo in docstring.
16719
88652fd5
EZ
167202011-09-27 Eli Zaretskii <eliz@gnu.org>
16721
16722 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16723 newline, reseat the iterator instead of bidi-iterating there one
16724 character at a time. (Bug#9610)
32c1fffd
SM
16725 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16726 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 16727
ed497dd4
AS
167282011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16729
16730 * lread.c (readevalloop): Use correct code for NBSP.
16731 (read1): Likewise. (Bug#9608)
16732
b2bf61aa
MA
167332011-09-25 Michael Albinus <michael.albinus@gmx.de>
16734
16735 * dbusbind.c (Fdbus_register_signal): When service is not
16736 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16737
32bbb17c
GM
167382011-09-25 Glenn Morris <rgm@gnu.org>
16739
16740 * buffer.c (truncate-lines): Doc fix.
16741
94e0933e
CY
167422011-09-24 Chong Yidong <cyd@stupidchicken.com>
16743
16744 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16745 (Fset_window_next_buffers): Doc fix.
16746
cddde921
GM
167472011-09-24 Glenn Morris <rgm@gnu.org>
16748
16749 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16750
1260aef1
PE
167512011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16752
25b4bfa0
PE
16753 Fix minor problems found by static checking.
16754 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
16755 * indent.c (Fvertical_motion): Fix == vs = typo.
16756
e3cbd34b
EZ
167572011-09-24 Eli Zaretskii <eliz@gnu.org>
16758
a66cfb1c
SM
16759 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16760 Default value is now t. Doc fix.
6bf7006f 16761
e3cbd34b 16762 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 16763 logic when moving up, not only when moving down. Fix the
e3cbd34b 16764 confusing name and values of the it_overshoot_expected variable;
32c1fffd 16765 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
16766
16767 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16768 CHARPOS is covered by a display string which includes newlines.
16769 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16770 is covered by a display string with embedded newlines.
16771
a3de0cbd
MA
167722011-09-24 Michael Albinus <michael.albinus@gmx.de>
16773
16774 * dbusbind.c (Fdbus_register_signal): Add match rule to
16775 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
16776 (Fdbus_register_method, Vdbus_registered_objects_table):
16777 Fix docstring.
a3de0cbd 16778
b260039d
JM
167792011-09-24 Jim Meyering <meyering@redhat.com>
16780
32c1fffd 16781 do not ignore write error for any output size
b260039d
JM
16782 The previous change was incomplete.
16783 While it makes emacs --batch detect the vast majority of stdout
16784 write failures, errors were still ignored whenever the output size is
16785 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16786 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16787 && echo FAIL: ignored write error
16788 FAIL: ignored write error
16789 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16790 && echo FAIL: ignored write error
16791 FAIL: ignored write error
16792 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16793
8eca8a7c
AS
167942011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16795
16796 * emacs.c (Fkill_emacs): In noninteractive mode exit
16797 non-successfully if a write error occurred on stdout. (Bug#9574)
16798
3341db62
EZ
167992011-09-21 Eli Zaretskii <eliz@gnu.org>
16800
16801 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16802 the xassert test.
16803
16804 * dispextern.h (struct it): Update the comment documenting what
16805 can it->OBJECT be.
16806
8c203dbf
EZ
168072011-09-20 Eli Zaretskii <eliz@gnu.org>
16808
16809 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16810 a display string, extend search for cursor position to end of row.
16811 (find_row_edges): If the row ends in a newline from a display
16812 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16813 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
16814 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16815 non-empty line. Fixes confusing cursor motion with arrow keys at
16816 the beginning of a line that starts with whitespace.
8c203dbf 16817
a4824228
LMI
168182011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16819
16820 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16821 (bug#9493).
16822
33ed493b
CY
168232011-09-18 Chong Yidong <cyd@stupidchicken.com>
16824
16825 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16826 boolean (Bug#9154).
16827
56cd55c8
EZ
168282011-09-18 Eli Zaretskii <eliz@gnu.org>
16829
16830 * xdisp.c (display_line): Record maximum and minimum buffer
16831 positions even if no glyphs were produced (e.g., by a zero-width
16832 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16833 buffer positions that will be removed from the glyph row because
16834 they don't fit.
c02dcedf
EZ
16835 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16836 column is beyond frame width: don't subtract 1 "pixel" when
16837 computing width of the stretch.
3e62b7e0
EZ
16838 (reseat_at_next_visible_line_start): Undo the change made on
16839 2011-09-17 that saved paragraph information and restored it after
16840 the call to `reseat'. (Bug#9545)
56cd55c8 16841
5ed99d36 168422011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
16843
16844 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16845 and turn window cursor on if cleared (Bug#9415).
16846
5ed99d36 168472011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
16848
16849 * search.c (boyer_moore): Take unibyte characters from pattern
16850 literally. (Bug#9458)
16851
9bade7b2
EZ
168522011-09-18 Eli Zaretskii <eliz@gnu.org>
16853
16854 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16855
e5e9d610
PE
168562011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16857
87e4427a
PE
16858 Fix minor problem found by static checking.
16859 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16860 initialized, to pacify gcc -Wuninitialized.
16861
e5e9d610
PE
16862 * fileio.c: Report proper errno when syscall falls.
16863 (Finsert_file_contents): Save and restore errno,
16864 so that report_file_error outputs the correct diagnostic.
16865 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16866
a1674f0b
EZ
168672011-09-18 Eli Zaretskii <eliz@gnu.org>
16868
16869 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16870
fbfb6dd4
EZ
168712011-09-17 Eli Zaretskii <eliz@gnu.org>
16872
16873 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16874 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16875
bb187662
EZ
168762011-09-17 Eli Zaretskii <eliz@gnu.org>
16877
1137e8b8 16878 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16879 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16880
16881 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16882 (bidi_find_paragraph_start): Search back for paragraph beginning
16883 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16884 (bidi_move_to_visually_next): Only trigger paragraph-related
16885 computations when the last character is a newline or at EOB, not
16886 just any NEUTRAL_B. (Bug#9470)
16887
bb187662
EZ
16888 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16889 truncated lines if point is covered by a display string. (Bug#9524)
16890
2e621251
PE
168912011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16892
16893 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16894 (cons_to_x_long): New function.
16895 (lisp_data_to_selection_data): Use it. Correct the test for
16896 short-versus-long data; it was negated. Break out of vector
16897 loop, for efficiency, when a long datum is discovered.
16898
91a15bc6
SM
168992011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16900
16901 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16902
b41c3a35
EZ
169032011-09-16 Eli Zaretskii <eliz@gnu.org>
16904
16905 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16906 GCC PR/17406) by declaring this function with external scope.
16907
7812ba2d
PE
169082011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16909
16910 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16911 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16912
cf7edc2a
AS
169132011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16914
16915 * editfns.c (Fformat): Correctly handle text properties on "%%".
16916
bd01620e
EZ
169172011-09-15 Eli Zaretskii <eliz@gnu.org>
16918
16919 * xterm.c (x_draw_composite_glyph_string_foreground):
16920 * w32term.c (x_draw_composite_glyph_string_foreground):
16921 * term.c (encode_terminal_code):
16922 * composite.c (composition_update_it, get_composition_id):
16923 * xdisp.c (get_next_display_element)
16924 (fill_composite_glyph_string): Add comments about special meaning
16925 of TAB characters in a composition.
16926
a02719a3
PE
169272011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16928
16929 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16930 This occurs when processing a multibyte format.
16931 Problem reported by Wolfgang Jenker.
a02719a3 16932
72589a3c
JB
169332011-09-15 Johan Bockgård <bojohan@gnu.org>
16934
16935 * xdisp.c (try_cursor_movement): Only check for exact match if
16936 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16937
1c14176c
PE
169382011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16939
16940 Remove unused external symbols.
16941 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16942 * xdisp.c (calc_pixel_width_or_height): Now static.
16943 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16944 * indent.c (check_display_width):
16945 * w32term.c: Fix comment to match code.
16946 * xterm.c, xterm.h (x_catching_errors): Remove.
16947
d2eea5b5
PE
169482011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16949
16950 * xselect.c: Use signed conversions more consistently (Bug#9498).
16951 (selection_data_to_lisp_data): Assume incoming selection data are
16952 signed integers, not unsigned. This is to be consistent with
16953 outgoing selection data, which was modified to use signed integers
16954 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16955 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16956 expects long, not unsigned long.
16957
46888499
EZ
169582011-09-14 Eli Zaretskii <eliz@gnu.org>
16959
16960 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16961 computation of loop end. Reported by Johan Bockgård
16962 <bojohan@gnu.org>.
16963
ef8ef9fb
CY
169642011-09-13 Chong Yidong <cyd@stupidchicken.com>
16965
16966 * frame.c (Fother_visible_frames_p): Function deleted.
16967
fa819fed
EZ
169682011-09-12 Eli Zaretskii <eliz@gnu.org>
16969
16970 * indent.c (compute_motion): Process display vector front to back
16971 rather than the other way around. (Bug#2496)
16972
2ba8e008
SM
169732011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16974
16975 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16976
20f53c69
CY
169772011-09-11 Chong Yidong <cyd@stupidchicken.com>
16978
16979 * minibuf.c (Fread_from_minibuffer): Doc fix.
16980
d562d7a4
EZ
169812011-09-11 Eli Zaretskii <eliz@gnu.org>
16982
16983 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16984 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16985
1c4d7f3d
LMI
169862011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16987
16988 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16989 value for non-existent files.
16990
b885bf36
EZ
169912011-09-11 Eli Zaretskii <eliz@gnu.org>
16992
16993 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16994 set its "size" to -1. This will set the modtime_size field of
16995 the corresponding buffer to -1, which is what
16996 verify-visited-file-modtime expects for files that do not exist.
16997 (Bug#9139)
16998
6612f0bf
PE
169992011-09-11 Paul Eggert <eggert@cs.ucla.edu>
17000
17001 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
17002 here ...
17003 * lisp.h: ... from here. push_key_description is no longer
17004 defined in keyboard.c, so its declaration should not be in
17005 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
17006 logically belongs with push_key_description.
17007
dfb3f755
PE
170082011-09-10 Paul Eggert <eggert@cs.ucla.edu>
17009
17010 * buffer.h: Include <sys/types.h> instead of <time.h>.
17011 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
17012 Problem reported by Herbert J. Skuhra.
17013
3134906c
LMI
170142011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
17015
17016 * xml.c (parse_region): Make the parsing work for
17017 non-comment-starting XML files again (bug#9144).
17018
8d903f4e
AS
170192011-09-10 Andreas Schwab <schwab@linux-m68k.org>
17020
17021 * image.c (gif_load): Fix calculation of bottom and right corner.
17022 (Bug#9468)
17023
80ad64f4
EZ
170242011-09-10 Eli Zaretskii <eliz@gnu.org>
17025
17026 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
17027 redisplay in small windows.
17028
208a048d
EZ
170292011-09-09 Eli Zaretskii <eliz@gnu.org>
17030
17031 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
17032
9b1c252e
MR
170332011-09-08 Martin Rudalics <rudalics@gmx.at>
17034
17035 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
17036 Operate on live windows only.
17037
2949f33b
JB
170382011-09-08 Juanma Barranquero <lekktu@gmail.com>
17039
17040 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
17041
e08dcafd
EZ
170422011-09-07 Eli Zaretskii <eliz@gnu.org>
17043
17044 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
17045 only under bidi iteration.
17046
115b96bd
JD
170472011-09-07 Jan Djärv <jan.h.d@swipnet.se>
17048
17049 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
17050
c8199d0f
PE
170512011-09-06 Paul Eggert <eggert@cs.ucla.edu>
17052
17053 isnan: Fix porting problem to Solaris 10 with bundled gcc.
17054 Without this fix, the command to link temacs failed due to an
17055 undefined symbol __builtin_isnan. This is because
17056 /usr/include/iso/math_c99.h #defines isnan(x) to
17057 __builtin_isnan(x), but the bundled gcc, which identifies itself
17058 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
17059 a __builtin_isnan.
17060 * floatfns.c (isnan): #undef, and then #define to a clone of
17061 what's in data.c.
17062 (Fisnan): Always define, since it's always available now.
17063 (syms_of_floatfns): Always define isnan at the Lisp level.
17064
e39b275c 170652011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
17066
17067 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
17068
b2db44d9 170692011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 17070
f4af5137 17071 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
17072 The previous code assumed that file offsets (off_t values) fit in
17073 EMACS_INT variables, which is not true on typical 32-bit hosts.
17074 The code messed up by falsely reporting buffer overflow in cases
17075 such as (insert-file-contents "big" nil 1 2) into an empty buffer
17076 when "big" contains more than 2**29 bytes, even though this
17077 inserts just one byte and does not overflow the buffer.
17078 (Finsert_file_contents): Store file offsets as off_t
17079 values, not as EMACS_INT values. Check for overflow when
17080 converting between EMACS_INT and off_t. When checking for
17081 buffer overflow or for overlap, take the offsets into account.
17082 Don't use EMACS_INT for small values where int suffices.
17083 When checking for overlap, fix a typo: ZV was used where
17084 ZV_BYTE was intended.
17085 (Fwrite_region): Don't assume off_t fits into 'long'.
17086 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
17087
ecfc0a49
MA
170882011-09-05 Michael Albinus <michael.albinus@gmx.de>
17089
17090 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
17091
6511acf2 170922011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 17093
0999621a 17094 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
17095
17096 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 17097 (esprintf, exprintf, evxprintf): New functions.
62f19c19 17098 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 17099 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
17100 (modify_event_symbol): Do not assume that the length of
17101 name_alist_or_stem is safe to alloca and fits in int.
17102 (Fexecute_extended_command): Likewise for function name and binding.
17103 (Frecursion_depth): Wrap around reliably on integer overflow.
17104 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
17105 since some callers pass EMACS_INT values.
17106 (Fsingle_key_description): Don't crash if symbol name contains more
17107 than MAX_ALLOCA bytes.
17108 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
17109 (get_minibuffer): Arg is now EMACS_INT, not int.
17110 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 17111 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
17112 * window.h (command_loop_level, minibuf_level): Reflect API changes.
17113
2be7d702
PE
17114 * dbusbind.c (signature_cat): New function.
17115 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
17116 Do not overrun buffer; instead, report string overflow.
17117
9d1df220
PE
17118 * dispnew.c (add_window_display_history): Don't overrun buffer.
17119 Truncate instead; this is OK since it's just a log.
17120
33ef5c64
PE
17121 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
17122 even if the time zone offset is outlandishly large.
17123 Don't mishandle offset == INT_MIN.
17124
66c6fdd5
PE
17125 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
17126 when creating daemon; the previous buffer-overflow check was incorrect.
17127
d749b01b
PE
17128 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
17129 which has the guts of the old verror function.
17130
b5cd1905
PE
17131 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
17132 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
17133
6e1a67fb
PE
17134 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
17135 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 17136 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 17137 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
17138 length of string rather than counting it via multiple sprintfs;
17139 that's simpler and more reliable.
c21721cc
PE
17140 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
17141 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
17142 sprintf, in case result does not fit in int.
17143
c57b67fc
PE
17144 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
17145 (fontset_from_font): Print it.
17146
8a401434
PE
17147 * frame.c (tty_frame_count): Now printmax_t, not int.
17148 (make_terminal_frame, set_term_frame_name): Print it.
17149 (x_report_frame_params): In X, window IDs are unsigned long,
17150 not signed long, so print them as unsigned.
17151 (validate_x_resource_name): Check for implausibly long names,
17152 and don't assume name length fits in 'int'.
17153 (x_get_resource_string): Don't blindly alloca invocation name;
17154 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
17155 not fit in int.
17156
6e1a67fb
PE
17157 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
17158 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
17159 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
17160
0df02bf3
PE
17161 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
17162 Use esprintf, not sprintf, in case result does not fit in int.
17163
48e30793
PE
17164 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17165 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
17166 it as a large positive number.
17167 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
17168 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
17169
a66ff6d8
PE
17170 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
17171 in case result does not fit in int.
17172
aca216ff
PE
17173 * print.c (float_to_string): Detect width overflow more reliably.
17174 (print_object): Make sprintf buffer a bit bigger, to avoid potential
17175 buffer overrun. Don't assume list length fits in 'int'. Treat
17176 print length of 0 as 0, not as infinity; to be consistent with other
17177 uses of print length in this function. Don't overflow print length
17178 index. Don't assume hash table size fits in 'long', or that
17179 vectorlike size fits in 'unsigned long'.
17180
31c286f7
PE
17181 * process.c (make_process): Use printmax_t, not int, to format
17182 process-name gensyms.
17183
55e5faa1
PE
17184 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
17185
80f2e268
PE
17186 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
17187 to avoid potential buffer overrun.
17188
670741ab
PE
17189 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
17190 if X resource line is longer than 512 bytes.
17191
b7163a50
PE
17192 * xfns.c (x_window): Make sprintf buffer a bit bigger
17193 to avoid potential buffer overrun.
17194
ae58ff1f
PE
17195 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
17196
c43c8a6a
PE
17197 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
17198
3f8236f4
PE
171992011-09-04 Paul Eggert <eggert@cs.ucla.edu>
17200
53e9fe90 17201 Integer overflow fixes for scrolling, etc.
6511acf2
PE
17202 Without these, Emacs silently mishandles large integers sometimes.
17203 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
17204 it were "C-u 1 M-x recenter" on a typical 64-bit host.
17205
6511acf2
PE
17206 * xdisp.c (try_window_id): Check Emacs fixnum range before
17207 converting to 'int'.
806add1d 17208
6511acf2 17209 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
17210 Check that an Emacs fixnum is in range before assigning it to 'int'.
17211 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
17212 values converted from Emacs fixnums.
17213 (Frecenter): Don't wrap around a line count if it is out of 'int'
17214 range; instead, treat it as an extreme value.
17215 (Fset_window_configuration, compare_window_configurations):
17216 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
17217
6511acf2
PE
17218 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
17219 that can exceed INT_MAX. Check that EMACS_INT value is in range
17220 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
17221 (match_limit): Don't assume that a fixnum can fit in 'int'.
17222
6511acf2 17223 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
17224 exceed INT_MAX.
17225
6511acf2 17226 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
17227 (Fvertical_motion): Don't wrap around LINES values that don't fit
17228 in 'int'. Instead, treat them as extreme values. This is good
17229 enough for windows, which can't have more than INT_MAX lines anyway.
17230
fcb901a7
LMI
172312011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17232
0f2f6b6d
LMI
17233 * Require libxml/parser.h to avoid compilation warning.
17234
fcb901a7
LMI
17235 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
17236
17237 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
17238 since this reportedly can destroy thread storage.
17239
6e20a0d4
CY
172402011-08-30 Chong Yidong <cyd@stupidchicken.com>
17241
17242 * syntax.c (find_defun_start): Update all cache variables if
17243 exiting early (Bug#9401).
17244
148ae00e
EZ
172452011-08-30 Eli Zaretskii <eliz@gnu.org>
17246
f6cfbd8f
EZ
17247 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
17248
148ae00e
EZ
17249 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
17250 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
17251 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
17252
17253 * term.c (tty_append_glyph): New function.
17254 (produce_stretch_glyph): Static function and its prototype deleted.
17255
a66cfb1c
SM
17256 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
17257 Add prototypes.
148ae00e 17258
c4a07a4c
PE
172592011-08-29 Paul Eggert <eggert@cs.ucla.edu>
17260
17261 * image.c (parse_image_spec): Check for nonnegative, not for positive,
17262 when checking :margin (Bug#9390).
17263 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 17264 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
17265 so that the name doesn't mislead. All uses changed.
17266
6bc8cd65
JB
172672011-08-28 Johan Bockgård <bojohan@gnu.org>
17268
17269 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
17270 set_tty_hooks.
17271
dca4927e
EZ
172722011-08-27 Eli Zaretskii <eliz@gnu.org>
17273
17274 * xdisp.c (move_it_to): Don't bail out early when reaching
17275 position beyond to_charpos, if we are scanning backwards.
17276 (move_it_vertically_backward): When DY == 0, make sure we get to
17277 the first character in the line after the newline.
17278
f2cad773
PE
172792011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17280
17281 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17282 (ccl_driver): Do not generate an out-of-range pointer.
17283 (Fccl_execute_on_string): Remove unnecessary check for
17284 integer overflow, noted by Stefan Monnier in
17285 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17286 Remove a FIXME that didn't need fixing.
17287 Simplify the newly-introduced buffer reallocation code.
17288
0cae2cdb
JB
172892011-08-27 Juanma Barranquero <lekktu@gmail.com>
17290
17291 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17292
5fc295a4 172932011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 17294
70c60eb2 17295 Integer and memory overflow issues (Bug#9196).
726e0ab1 17296
d31850da
PE
17297 * doc.c (get_doc_string): Rework so that
17298 get_doc_string_buffer_size is the actual buffer size, rather than
17299 being 1 less than the actual buffer size; this makes xpalloc more
17300 convenient.
17301
a69fbedb
PE
17302 * image.c (x_allocate_bitmap_record, cache_image):
17303 * xselect.c (Fx_register_dnd_atom):
17304 Simplify previous changes by using xpalloc.
17305
fe5c5d37
PE
17306 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17307 since either will do and ptrdiff_t is convenient with xpalloc.
17308
0065d054
PE
17309 * charset.c (charset_table_size)
17310 (struct charset_sort_data.priority): Now ptrdiff_t.
17311 (charset_compare): Don't overflow if priorities differ greatly.
17312 (Fsort_charsets): Don't assume list length fits in int.
17313 Check for size-calculation overflow when allocating sort data.
17314 (syms_of_charset): Allocate an initial charset table that is
17315 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17316
17317 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17318
17319 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17320 The actual value is always <= INT_MAX, and leaving it unsigned made
17321 overflow checking harder.
17322
17323 * dispextern.h (struct glyph_matrix.rows_allocated)
17324 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17325 with xpalloc. The values are still always <= INT_MAX.
17326
17327 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17328
17329 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17330 (SAFE_NALLOCA): New macro.
17331
17332 * region-cache.c (struct boundary.pos, find_cache_boundary)
17333 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17334 (set_cache_region, invalidate_region_cache)
17335 (revalidate_region_cache, know_region_cache, region_cache_forward)
17336 (region_cache_backward, pp_cache):
17337 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17338 so that ptrdiff_t * can be passed to xpalloc.
17339 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17340 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17341 (pp_cache): Don't assume cache_len fits in int.
17342 * region-cache.h: Adjust extern decls to match.
17343
17344 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17345 EMACS_INT, since either will do, for xpalloc.
17346
17347 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17348 (xnmalloc, xnrealloc, xpalloc): New functions.
17349
726e0ab1
PE
17350 * bidi.c (bidi_shelve_header_size): New constant.
17351 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17352 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17353
51f30bc5 17354 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
17355 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17356 (overlay_strings):
17357 Don't update size of array until after memory allocation succeeds,
17358 because xmalloc/xrealloc may not return.
0065d054
PE
17359 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17360 now that we have proper integer overflow checking.
17361 (record_overlay_string, overlay_strings): Catch overflows when
17362 calculating size of overlay_str_buf.
726e0ab1 17363
0065d054
PE
17364 * callproc.c (Fcall_process): Check for size overflow when
17365 calculating size of args2.
17366 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17367 Normally we prefer signed values, but sticking with ptrdiff_t would
17368 require adding more-complicated checks.
726e0ab1
PE
17369
17370 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17371 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17372 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 17373 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
17374
17375 * character.c (Fstring): Check for size-calculation overflow.
17376
17377 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17378 unnecessary integer overflow. Check for size overflow.
17379 (encode_coding_object): Don't update size until xmalloc succeeds.
17380
17381 * composite.c (get_composition_id): Check for overflow in glyph
17382 length calculations.
17383
17384 Integer and memory overflow fixes for display code.
17385 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17386 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17387 (scrolling_window): Check for overflow in size calculations.
17388 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17389 Don't assume glyph table len fits in int.
17390 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17391 (row_table_size): Now ptrdiff_t, not int.
17392 (scrolling_window): Avoid overflow in size calculations.
17393 Don't update size until allocation succeeds.
17394 * fns.c (concat): Check for overflow in size calculations.
17395 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17396 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17397 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17398
17399 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17400 (get_doc_string): Check for size calculation overflow.
17401 Don't update size until allocation succeeds.
17402 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17403 EMACS_INT, where ptrdiff_t will do.
17404 (Fsubstitute_command_keys): Check for string overflow.
17405
17406 * editfns.c (set_time_zone_rule): Don't assume environment length
17407 fits in int.
17408 (message_length): Now ptrdiff_t, not int.
17409 (Fmessage_box): Don't update size until allocation succeeds.
17410 Don't assume message length fits in int.
17411 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17412
0065d054
PE
17413 * emacs.c (main): Do not reallocate argv, since there is a null at
17414 the end that can be overwritten, and this way there's no need to
17415 worry about size-calculation overflow.
17416 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
17417
17418 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17419 alloc succeeds.
17420 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17421
17422 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17423 (x_set_scroll_bar_width, x_figure_window_size):
17424 Check for integer overflow.
17425 (x_set_alpha): Do not assume XINT fits in int.
17426
17427 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17428 This is for the members text_lines, text_cols, total_lines, total_cols,
17429 where the system imposes an 'int' limit.
17430
17431 * fringe.c (Fdefine_fringe_bitmap):
17432 Don't update size until alloc works.
17433
17434 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17435 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17436
17437 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17438 Check for size-calculation overflow.
17439 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17440 do, as we prefer signed integers.
17441 (id_to_widget.max_size, id_to_widget.used)
17442 (xg_store_widget_in_map, xg_remove_widget_from_map)
17443 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17444 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17445 Use and return ptrdiff_t, not int.
17446 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17447 * gtkutil.h: Change prototypes to match the above.
17448
17449 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17450 are duplicate now that they've been promoted to lisp.h.
17451 (x_allocate_bitmap_record, x_alloc_image_color)
17452 (make_image_cache, cache_image, xpm_load):
17453 Don't update size until alloc is done.
17454 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17455 (x_detect_edges):
3256efce 17456 Check for size calculation overflow.
726e0ab1
PE
17457 (ct_colors_allocated_max): New constant.
17458 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17459 overflow.
3256efce 17460
726e0ab1
PE
17461 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17462 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17463 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17464 Use ptrdiff_t, not int, to count maps.
17465 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
17466 calculations. Don't update size until allocation succeeds.
17467 Redo calculations to avoid overflow.
726e0ab1
PE
17468 * keyboard.h: Change prototypes to match the above.
17469
17470 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17471 to count maps.
17472 (current_minor_maps): Check for size calculation overflow.
17473 * keymap.h: Change prototypes to match the above.
17474
17475 * lread.c (read1, init_obarray): Don't update size until alloc done.
17476
17477 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17478 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17479
726e0ab1
PE
17480 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17481 Now ptrdiff_t, not int.
17482 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17483 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17484
17485 * process.c (Fnetwork_interface_list): Check for overflow
17486 in size calculation.
17487
17488 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17489
17490 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17491 overflow. Don't bother calling xmalloc when xrealloc will do.
17492
17493 * search.c (Freplace_match): Check for size calculation overflow.
17494 (Fset_match_data): Don't assume list lengths fit in 'int'.
17495
17496 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17497 for command line length. Do not attempt to address one before the
17498 beginning of an array, as that's not portable.
17499
17500 * term.c (max_frame_lines): Remove; unused.
17501 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17502 not int.
17503 (encode_terminal_code, calculate_costs): Check for size
17504 calculation overflow.
17505 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17506 table lengths and related sizes. Don't update size until alloc
17507 done. Redo calculations to avoid overflow.
17508 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17509
17510 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17511 subtracting pointers.
17512 (gobble_line): Check for overflow more carefully. Don't update size
17513 until alloc done.
17514
17515 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17516 Don't update size until alloc done.
17517 Redo size calculations to avoid overflow.
17518 Check for size calculation overflow.
0065d054 17519 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
17520
17521 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17522 Use ptrdiff_t, not int, for sizes.
17523 (store_mode_line_noprop_char): Don't update size until alloc done.
17524
0065d054
PE
17525 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17526 Use ptrdiff_t, not int, for sizes.
17527 (Finternal_make_lisp_face, cache_face):
17528 Check for size calculation overflow.
17529 (cache_face): Treat size calculation overflows as if they were
17530 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
17531
17532 * xfns.c (x_encode_text, x_set_name_internal)
17533 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17534 sizes, since they can exceed INT_MAX in size. Check for size
17535 calculation overflow.
17536
0065d054
PE
17537 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17538 (xg_select): Check for size calculation overflow.
726e0ab1
PE
17539 Don't update size until alloc done.
17540
0065d054 17541 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 17542 as sprintf is limited to int lengths.
1d526e2f 17543
252c5ee1
PE
17544 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17545 (X_LONG_MIN): New macros.
864d7ce7
PE
17546 Use them to make the following changes clearer.
17547 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17548 This change doesn't affect the value now, but it may help remind
17549 future maintainers not to raise the value too much later.
17550 (SELECTION_QUANTUM): Remove, replacing with ...
17551 (selection_quantum): ... new function, which avoids overflow.
17552 All uses changed.
17553 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17554 assumption that selection length fits in 'int'.
17555 (x_reply_selection_request, x_handle_selection_request)
17556 (x_get_window_property, receive_incremental_selection)
17557 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17558 (lisp_data_to_selection_data, clean_local_selection_data):
17559 Use ptrdiff_t, not int, to record length of selection.
17560 (x_reply_selection_request, x_get_window_property)
17561 (receive_incremental_selection, x_property_data_to_lisp):
17562 Redo calculations to avoid overflow.
17563 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 17564 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
17565 something.
17566 (x_get_window_property, receive_incremental_selection)
17567 (lisp_data_to_selection_data, x_property_data_to_lisp):
17568 Check for size-calculation overflow.
17569 (x_get_window_property, receive_incremental_selection)
17570 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17571 Don't store size until memory allocation succeeds.
17572 (x_get_window_property): Plug memory leak on memory exhaustion.
17573 Don't double-block input; malloc is safe here. Don't assume 2**34
17574 - 4 fits in unsigned long. Add an xassert to check
17575 XGetWindowProperty overflow. Be more careful about overflow
17576 calculations, and distinguish size from memory overflow better.
17577 (receive_incremental_selection): When tracing, don't assume
17578 unsigned int is less than INT_MAX.
17579 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17580 harmful) conversions of unsigned short to int.
17581 (lisp_data_to_selection_data): Don't assume that integers
17582 in the range -65535 through -1 fit in an X unsigned short.
17583 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17584 result parameters unless successful. Rely on cons_to_unsigned
17585 to report problems with elements; the old code wasn't right anyway.
17586 (x_check_property_data): Check for int overflow; we cannot use
17587 a wider type due to X limits.
17588 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17589
726e0ab1 17590 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 17591
0065d054
PE
17592 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17593 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
17594 (x_color_cells): Don't store size until memory allocation succeeds.
17595 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 17596 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
17597 (x_term_init): Don't assume length fits in int (sprintf is limited
17598 to int size).
bc18e09d 17599
ebfa62c0
PE
17600 Use ptrdiff_t for composition IDs.
17601 * character.c (lisp_string_width):
17602 * composite.c (composition_table_size, n_compositions)
17603 (get_composition_id, composition_gstring_from_id):
17604 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17605 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17606 * window.c (Frecenter):
17607 Use ptrdiff_t, not int, for composition IDs.
17608 * composite.c (get_composition_id): Check for integer overflow.
17609 * composite.h: Adjust prototypes to match the above changes.
17610
d3411f89
PE
17611 Use ptrdiff_t for hash table indexes.
17612 * category.c (hash_get_category_set):
17613 * ccl.c (ccl_driver):
17614 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17615 * coding.c (coding_system_charset_list, detect_coding_system):
17616 * coding.h (struct coding_system.id):
17617 * composite.c (get_composition_id, gstring_lookup_cache):
17618 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17619 * image.c (xpm_get_color_table_h):
17620 * lisp.h (hash_lookup, hash_put):
17621 * minibuf.c (Ftest_completion):
17622 Use ptrdiff_t for hash table indexes, not int (which is too
17623 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17624 32-bit --with-wide-int hosts).
17625
e097a6fa
PE
17626 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17627 Add a FIXME comment about memory leaks.
17628 (syms_of_charset): Don't assume xmalloc returns.
17629
5637687f
PE
17630 Don't assume that stated character widths fit in int.
17631 * character.c (Fchar_width, c_string_width, lisp_string_width):
17632 * character.h (CHAR_WIDTH):
17633 * indent.c (MULTIBYTE_BYTES_WIDTH):
17634 Use sanitize_char_width to avoid undefined and/or bad behavior
17635 with outlandish widths.
a66cfb1c 17636 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
17637 now that we have two such functions. All uses changed.
17638 (sanitize_char_width): New inline function.
17639
a2271ba2
PE
17640 Don't assume that tab-width fits in int.
17641 * character.h (sanitize_width): New inline function.
17642 (SANE_TAB_WIDTH): New macro.
17643 (ASCII_CHAR_WIDTH): Use it.
17644 * indent.c (sane_tab_width): Remove. All uses replaced by
17645 SANE_TAB_WIDTH (current_buffer).
17646 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17647
18c52557
PE
17648 * fileio.c: Integer overflow issues with file modes.
17649 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17650
caeeedc1
PE
17651 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17652 Remove unreachable code.
17653 (read_hex, load_charset_map_from_file): Check for integer overflow.
17654
6df6ae42 17655 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
17656 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17657 (x_send_scroll_bar_event): Likewise. Check that the size does not
17658 exceed limits imposed by XClientMessageEvent, as well as the usual
17659 ptrdiff_t and size_t limits.
17660
b13995db
PE
17661 * keyboard.c: Overflow, signedness and related fixes.
17662 (make_lispy_movement): Use same integer type in forward decl
17663 that is used in the definition.
17664 (read_key_sequence, keyremap_step):
17665 Change bufsize argument back to int, undoing my 2011-03-30 change.
17666 We prefer signed types, and int is wide enough here.
17667 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17668 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17669 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17670 length, not size_t. Use ptrdiff_t for index, not int.
17671 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17672 possibility of integer overflow.
17673
13464394
PE
17674 Overflow, signedness and related fixes for images.
17675
17676 * dispextern.h (struct it.stack[0].u.image.image_id)
17677 (struct_it.image_id, struct image.id, struct image_cache.size)
17678 (struct image_cache.used, struct image_cache.ref_count):
17679 * gtkutil.c (update_frame_tool_bar):
17680 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17681 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17682 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17683 * nsmenu.m (update_frame_tool_bar):
17684 * xdisp.c (calc_pixel_width_or_height):
17685 * xfns.c (image_cache_refcount):
17686 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17687 on typical 64-bit hosts.
17688
17689 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17690 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17691 Omit unnecessary casts to int.
17692 (parse_image_spec): Check that integers fall into 'int' range
17693 when the callers expect that.
17694 (image_ascent): Redo ascent calculation to avoid int overflow.
17695 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17696 (lookup_image): Remove unnecessary tests.
17697 (xbm_image_p): Locals are now of int, not EMACS_INT,
17698 since parse_image_check makes sure they fit into int.
17699 (png_load, gif_load, svg_load_image):
17700 Prefer int to unsigned where either will do.
17701 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
17702 old tiff_error_handler and tiff_warning_handler.
17703 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
17704 stack buffer overflows. It uses only the features of vsnprintf
17705 that are common to both POSIX and native Microsoft.
17706 (tiff_error_handler, tiff_warning_handler): Use it.
17707 (tiff_load, gif_load, imagemagick_load_image):
17708 Don't assume :index value fits in 'int'.
17709 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17710 (imagemagick_load_image): Check that crop parameters fit into
17711 the integer types that MagickCropImage accepts. Don't assume
17712 Vimagemagick_render_type has a nonnegative value. Don't assume
17713 size_t fits in 'long'.
17714 (gs_load): Use printmax_t to print the widest integers possible.
17715 Check for integer overflow when computing image height and width.
17716
c11821d4
EZ
177172011-08-26 Eli Zaretskii <eliz@gnu.org>
17718
17719 * xdisp.c (redisplay_window): Don't force window start if point
17720 will be invisible in the resulting window. (Bug#9324)
17721
0c95fcf7
EZ
177222011-08-25 Eli Zaretskii <eliz@gnu.org>
17723
17724 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17725 the display spec is of the form `(space ...)'.
17726 (handle_display_spec): Return the value returned by
17727 handle_single_display_spec, not just 1 or zero.
17728 (handle_single_display_spec): If the display spec is of the form
17729 `(space ...)', and specifies display in the text area, return 2
17730 rather than 1.
fee65a97 17731 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
17732 accurately, and prefer exact match for point under bidi.
17733 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
17734
17735 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17736 into disp_prop; all users changed.
17737
17738 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17739 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17740 for the text covered by the display property.
17741
e4ed06f1
CY
177422011-08-25 Chong Yidong <cyd@stupidchicken.com>
17743
17744 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17745 Change return value to nil.
17746 (Frecord_buffer): Delete unused function.
17747
f67cdd7f
EZ
177482011-08-24 Eli Zaretskii <eliz@gnu.org>
17749
5980d4c6
EZ
17750 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17751 buffers, return left-to-right.
8610fe8b
EZ
17752 (set_cursor_from_row): Consider candidate row a win if its glyph
17753 represents a newline and point is on that newline. Fixes cursor
17754 positioning on the newline at EOL of R2L text within L2R
17755 paragraph, and vice versa.
17756 (try_cursor_movement): Check continued rows, in addition to
17757 continuation rows. Fixes unwarranted scroll when point enters a
17758 continued line of R2L text within an L2R paragraph, or vice versa.
17759 (cursor_row_p): Consider the case of point being equal to
17760 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17761 from the end of a short line to the beginning of a continued line
17762 of R2L text within L2R paragraph.
17763 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17764 composed characters.
5980d4c6 17765
f67cdd7f
EZ
17766 * bidi.c (bidi_check_type): Use xassert.
17767 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17768 members.
17769
bca633fb
EZ
177702011-08-23 Eli Zaretskii <eliz@gnu.org>
17771
17772 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17773 a character.
17774
4a5885a7
CY
177752011-08-23 Chong Yidong <cyd@stupidchicken.com>
17776
17777 * nsfont.m (ns_otf_to_script): Fix typo.
17778
0902a04e
KH
177792011-08-22 Kenichi Handa <handa@m17n.org>
17780
17781 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17782 extra slot even if the purpose is char-code-property-table.
17783
1a2e6670
EZ
177842011-08-23 Eli Zaretskii <eliz@gnu.org>
17785
8ddde651
EZ
17786 * xdisp.c (redisplay_window): When computing centering_position,
17787 account for the height of the header line. (Bug#8874)
17788
425cc014
EZ
17789 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17790 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17791 candidate is selected by the mouse, and that candidate has a
17792 composed character under the mouse.
17793
1a2e6670
EZ
17794 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17795 coordinates reported by pos-visible-in-window-p for a composed
17796 character in column zero.
17797
8b76d6f8
SM
177982011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17799
17800 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17801
dac347dd
EZ
178022011-08-22 Eli Zaretskii <eliz@gnu.org>
17803
17804 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17805 consider it a hit if to_charpos is anywhere in the range of the
17806 composed buffer positions.
17807
e013fb34
CY
178082011-08-22 Chong Yidong <cyd@stupidchicken.com>
17809
17810 * image.c (gif_load): Don't assume that each subimage has the same
17811 dimensions as the base image. Handle disposal method that is
17812 "undefined" by the gif spec (Bug#9335).
17813
bd1ba3e8
CY
178142011-08-20 Chong Yidong <cyd@stupidchicken.com>
17815
17816 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 17817 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 17818
54a1215b
EZ
178192011-08-19 Eli Zaretskii <eliz@gnu.org>
17820
823564e5
EZ
17821 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17822 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17823 from an Org mode buffer to a Speedbar frame.
17824
54a1215b
EZ
17825 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17826 a composition, take its buffer position from IT->cmp_it.charpos.
17827 Fixes cursor positioning at the beginning of a line that begins
17828 with a composed character.
17829
9778ebcc
EZ
178302011-08-18 Eli Zaretskii <eliz@gnu.org>
17831
0be6ee06
EZ
17832 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17833 character bidirectional type, use STRONG_L instead. Fixes crashes
17834 in a buffer produced by `describe-categories'.
17835
9778ebcc
EZ
17836 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17837 members before the level stack, so they would be saved and
17838 restored when copying iterator state. Fixes incorrect reordering
17839 around TABs covered by display properties.
17840
156bffbe
AS
178412011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17842
6b02f655 17843 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 17844
72ad093b
CY
178452011-08-17 Chong Yidong <cyd@stupidchicken.com>
17846
17847 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
17848 (internal_condition_case_2, internal_condition_case_n):
17849 Remove unnecessary aborts (Bug#9081).
72ad093b 17850
35774242
EZ
178512011-08-17 Eli Zaretskii <eliz@gnu.org>
17852
17853 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17854 has no `load' handler, try opening the file locally. (Bug#9311)
17855
db76dd85
KB
178562011-08-16 Ken Brown <kbrown@cornell.edu>
17857
17858 * gmalloc.c: Expand comment.
17859
b215eee5
EZ
178602011-08-16 Eli Zaretskii <eliz@gnu.org>
17861
17862 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17863 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17864
a4579d33
KB
178652011-08-16 Ken Brown <kbrown@cornell.edu>
17866
17867 Fix memory allocation problems in Cygwin build (Bug#9273).
17868
17869 * unexcw.c ( __malloc_initialized): Declare external variable.
17870 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17871
8b76d6f8
SM
17872 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17873 New variables.
a4579d33
KB
17874 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17875 dumped emacs.
17876 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17877 in the static heap.
17878 [CYGWIN] (special_realloc): New function.
17879 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17880 requests to realloc storage in the static heap.
17881
3ebec551
PE
178822011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17883
17884 * bidi.c (bidi_initialize): Remove unused local.
17885
9fd8be00
EZ
178862011-08-15 Eli Zaretskii <eliz@gnu.org>
17887
6b02f655
SM
17888 * bidimirror.h:
17889 * biditype.h: Remove file.
17890 * makefile.w32-in ($(BLD)/bidi.$(O)):
17891 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17892
17893 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17894
17895 * chartab.c: Improve commentary for the uniprop_table API.
17896
32413314
EZ
17897 * bidi.c (bidi_paragraph_init): Support zero value of
17898 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17899 (bidi_initialize): Use uniprop_table instead of including
17900 biditype.h and bidimirror.h.
32413314 17901
9fd8be00
EZ
17902 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17903 coordinates of the iterator when restoring from ppos_it.
17904 (Bug#9296)
17905
5cf2b69b
KH
179062011-08-14 Kenichi Handa <handa@m17n.org>
17907
17908 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17909 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17910
daf17d00
EZ
179112011-08-14 Eli Zaretskii <eliz@gnu.org>
17912
17913 * xdisp.c (move_it_in_display_line_to): Don't invoke
17914 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17915 ppos_it. Fixes vertical cursor motion when line beginning is
17916 covered by an image. (Bug#9296)
17917
08e3161a
JD
179182011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17919
17920 * nsterm.h (ns_run_ascript): Declare.
17921 (NSAPP_DATA2_RUNASSCRIPT): Define.
17922
17923 * nsfns.m (as_script, as_result, as_status): New static variables.
17924 (ns_run_ascript): New function.
5e617bc2 17925 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17926 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17927 the event loop. Get status from as_status (Bug#7276).
17928
17929 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17930 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17931 the event loop (Bug#7276).
17932
a3720aa2
AS
179332011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17934
17935 * gnutls.c (QCgnutls_bootprop_priority)
17936 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17937 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17938 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17939 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17940 (QCgnutls_bootprop_verify_hostname_error)
17941 (QCgnutls_bootprop_callbacks_verify): Rename from
17942 Qgnutls_bootprop_..., all uses changed.
17943
17944 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17945 uses changed.
17946
0a0d27fb
PE
179472011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17948
19d5c50c
PE
17949 * xfaces.c (Qframe_set_background_mode): Now static.
17950 * dispextern.h (Qframe_set_background_mode): Remove decl.
17951
0a0d27fb
PE
17952 * process.c (Fnetwork_interface_info): Declare local only if needed.
17953
377538cb
JD
179542011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17955
17956 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17957 (Fnetwork_interface_list): Allocate in increments of bytes instead
17958 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17959 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17960 sockaddr.
17961 (struct ifflag_def): notrailers is smart on OSX.
17962 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17963 Get hardware address with getifaddrs if available.
17964
08fff70c
EZ
179652011-08-12 Eli Zaretskii <eliz@gnu.org>
17966
17967 * xdisp.c (iterate_out_of_display_property): xassert that
17968 IT->position is set to within IT->object's boundaries. Break from
17969 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17970 when IT->position is set up wrongly due to some bug.
17971 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17972 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17973 entry. Force push_it to save on the stack the current
17974 buffer/string position, to be restored by pop_it. Fix flags in
17975 the iterator structure wrt the object coming from a display
17976 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17977 properties. (Bug#9284)
17978
7be1c708 179792011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17980
7be1c708
CY
17981 * fontset.c (fontset_get_font_group): Add proper type checks.
17982 (Bug#9172)
aac0c6e3 17983
7be1c708 179842011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17985
7be1c708
CY
17986 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17987 and LC_VERSION_MIN_MACOSX.
17988 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17989 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17990
97bb72a6
EZ
179912011-08-08 Eli Zaretskii <eliz@gnu.org>
17992
17993 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17994 no-display-properties-and-no-overlays under bidi display.
17995 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17996 properties and overlays.
97bb72a6 17997
d5617611
CY
179982011-08-08 Chong Yidong <cyd@stupidchicken.com>
17999
37e11a63
CY
18000 * editfns.c (Fset_time_zone_rule): Document relationship with the
18001 setenv function.
18002
d5617611
CY
18003 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
18004 the font entity extracted from the cache (Bug#8109).
18005
58872834
CY
180062011-08-07 Chong Yidong <cyd@stupidchicken.com>
18007
18008 * composite.c (autocmp_chars): Don't reset point. That is done by
18009 restore_point_unwind (Bug#5984).
18010
75bfc667
JL
180112011-08-07 Juri Linkov <juri@jurta.org>
18012
18013 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
18014 to show the arg `TIME' instead of `TIMEVAL'.
18015
d1410150
EZ
180162011-08-06 Eli Zaretskii <eliz@gnu.org>
18017
18018 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
18019 display property strides EOL and includes a newline, as in
18020 longlines-mode. (Bug#9254)
75b771e4
EZ
18021 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
18022 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
18023
18024 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
18025 is non-zero, even if the data buffer is NULL. Fixes a crash in
18026 vertical-motion with longlines-mode. (Bug#9254)
18027
35928349
EZ
180282011-08-05 Eli Zaretskii <eliz@gnu.org>
18029
ec7cc85b
EZ
18030 * bidi.c <bidi_cache_total_alloc>: Now static.
18031 (bidi_initialize): Initialize bidi_cache_total_alloc.
18032
8b76d6f8 18033 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
18034 cache. (Bug#9221)
18035
18036 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
18037 amount allocated this far in `bidi_cache_total_alloc'.
18038 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
18039 non-zero, only free the data buffer without restoring the cache
18040 contents. All callers changed.
18041
18042 * dispextern.h (bidi_unshelve_cache): Update prototype.
18043
18044 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
18045 (move_it_in_display_line, move_it_to)
18046 (move_it_vertically_backward, move_it_by_lines): Replace the call
18047 to xfree to an equivalent call to bidi_unshelve_cache.
18048 (move_it_in_display_line_to): Fix logic of returning
412b6358 18049 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 18050
e2e2423b
EZ
180512011-08-05 Eli Zaretskii <eliz@gnu.org>
18052
18053 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
18054 came from a string character with a `cursor' property. (Bug#9229)
18055
ae9e757a
JD
180562011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18057
18058 * Makefile.in (LIB_PTHREAD): New variable.
18059 (LIBES): Add LIB_PTHREAD (Bug#9216).
18060
18061 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
18062 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
18063
213bd7f2
AS
180642011-08-04 Andreas Schwab <schwab@linux-m68k.org>
18065
6b02f655 18066 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 18067
99aaf75f
JD
180682011-08-04 Jan Djärv <jan.h.d@swipnet.se>
18069
18070 * xterm.c (x_find_topmost_parent): New function.
18071 (x_set_frame_alpha): Find topmost parent window with
18072 x_find_topmost_parent and set the property there also (bug#9181).
18073 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
18074
c74e9d86
PE
180752011-08-04 Paul Eggert <eggert@cs.ucla.edu>
18076
18077 * callproc.c (Fcall_process): Avoid vfork clobbering
18078 the local vars buffer, coding_systems, current_dir.
18079
640c8776
SM
180802011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
18081
18082 * keymap.c (Fmake_composed_keymap): Move to subr.el.
18083
f26d0e4c
PE
180842011-08-03 Paul Eggert <eggert@cs.ucla.edu>
18085
8a10d76c
PE
18086 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
18087 so that it is not optimized away.
18088
f26d0e4c
PE
18089 * xdisp.c (compute_display_string_pos): Remove unused local.
18090
55439c61
EZ
180912011-08-02 Eli Zaretskii <eliz@gnu.org>
18092
18093 Fix slow cursor motion and scrolling in large buffers with
18094 selective display, like Org Mode buffers. (Bug#9218)
18095
18096 * dispextern.h (struct bidi_it): New member disp_prop_p.
18097
18098 * xdisp.c: Remove one-slot cache of display string positions.
18099 (compute_display_string_pos): Accept an additional argument
5e617bc2 18100 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
18101 for a display string or property. If found, set DISP_PROP_P
18102 non-zero.
18103
18104 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
18105 DISP_PROP_P, and pass it to compute_display_string_pos.
18106 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
18107 non-zero. All callers of bidi_fetch_char changed.
18108
fb33fa43
SM
181092011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
18110
18111 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
18112
b099e063
DM
181132010-12-03 Don March <don@ohspite.net>
18114
18115 * keymap.c (Fdefine_key): Fix non-prefix key error message when
18116 last character M-[char] is translated to ESC [char] (bug#7541).
18117
5cc7f7af
KH
181182011-08-02 Kenichi Handa <handa@m17n.org>
18119
d0fffa3f 18120 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
18121
18122 * chartab.c (uniprop_table): Make it non-static.
18123
525d5e6e
EZ
181242011-08-01 Eli Zaretskii <eliz@gnu.org>
18125
18126 * xdisp.c (forward_to_next_line_start): Accept additional argument
18127 BIDI_IT_PREV, and store into it the state of the bidi iterator had
18128 on the newline.
18129 (reseat_at_next_visible_line_start): Use the bidi iterator state
18130 returned by forward_to_next_line_start to restore the state of
18131 it->bidi_it after backing up to previous newline. (Bug#9212)
18132
31011111
AS
181332011-07-30 Andreas Schwab <schwab@linux-m68k.org>
18134
18135 * regex.c (re_comp): Protoize.
18136 (re_exec): Fix return type.
18137 (regexec): Fix type of `ret'. (Bug#9203)
18138
476371c4
PE
181392011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18140
e5d76069
PE
18141 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
18142 This is needed if max-image-size is a floating-point number.
18143
9a79b20c
AS
181442011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18145
18146 * print.c (print_object): Print empty symbol as ##.
18147
18148 * lread.c (read1): Read ## as empty symbol.
18149
d8c2fa78
AA
181502011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
18151
18152 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
18153 setting frame foreground color (Bug#9175).
18154 (x_set_background_color): Likewise.
18155
ffe57a7a
AA
18156 * nsmenu.m (-setText): Size tooltip dimensions precisely to
18157 contents (Bug#9176).
18158 (EmacsTooltip -init): Remove bezels and add shadows to
18159 tooltip windows.
18160
bf3492a5
AA
18161 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
18162 or scroll bar (Bug#8470).
18163
d55e9c53
AA
18164 * nsfont.m (nsfont_open): Remove assignment to voffset and
18165 unnecessary vars hshink, expand, hd, full_height, min_height.
18166 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
18167
18168 * nsterm.h (nsfont_info): Remove voffset field.
18169
d8c2fa78 181702011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
18171
18172 Implement strike-through and overline on NextStep (Bug#8863).
18173
18174 * nsfont.m (nsfont_open): Use underline position provided by font,
18175 instead of hard-coded value of 2.
18176 (nsfont_draw): Call ns_draw_text_decoration instead.
18177
18178 * nsterm.h: Add declaration for ns_draw_text_decoration.
18179
18180 * nsterm.m (ns_draw_text_decoration): New function for drawing
18181 underline, overline, and strike-through.
18182 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
18183 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 18184 accommodate underlining, etc.
4843aac3 18185
4cc60b9b
EZ
181862011-07-28 Eli Zaretskii <eliz@gnu.org>
18187
bc7ece87
EZ
18188 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
18189 default.
4cc60b9b 18190
476371c4
PE
181912011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18192
66606eea
PE
18193 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
18194 Without this fix, if a signal arrives just after memory fills up,
18195 'malloc' might be invoked reentrantly.
18196
476371c4
PE
18197 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
18198 In other words, assume that every image size is allowed, on non-X
18199 hosts. This assumption is probably wrong, but it lets Emacs compile.
18200
f3fcc40d
AS
182012011-07-28 Andreas Schwab <schwab@linux-m68k.org>
18202
18203 * regex.c (re_iswctype): Convert return values to boolean.
18204
350c992f
EZ
182052011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
18206
18207 * xdisp.c (compute_display_string_pos): Don't use cached display
18208 string position if the buffer had its restriction changed.
18209 (Bug#9184)
18210
5266b4bb
PE
182112011-07-28 Paul Eggert <eggert@cs.ucla.edu>
18212
18213 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
18214
2573a837 182152011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 18216
41f55ccd 18217 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 18218
39e378da
PE
18219 * bidi.c: Integer size and overflow fixes.
18220 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
18221 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
18222 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18223 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
18224 (bidi_find_other_level_edge):
18225 Use ptrdiff_t instead of EMACS_INT where either will do.
18226 This works better on 32-bit hosts configured --with-wide-int.
18227 (bidi_cache_ensure_space): Check for size-calculation overflow.
18228 Use % rather than repeated addition, for better worst-case speed.
18229 Don't set bidi_cache_size until after xrealloc returns, because it
18230 might not return.
18231 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
18232 (bidi_cache_ensure_space): Also check that the bidi cache size
18233 does not exceed that of the largest Lisp string or buffer. See Eli
18234 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 18235
5e927815
PE
18236 * alloc.c (__malloc_size_t): Remove.
18237 All uses replaced by size_t. See Andreas Schwab's note
18238 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
18239
ca4aa935
PE
18240 * image.c: Improve checking for integer overflow.
18241 (check_image_size): Assume that f is nonnull, since
18242 it is always nonnull in practice. This is one less thing to
18243 worry about when checking for integer overflow later.
18244 (x_check_image_size): New function, which checks for integer
18245 overflow issues inside X.
18246 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
18247 This removes the need for a memory_full check.
18248 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
18249 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
18250 (xbm_read_bitmap_data): Change locals back to 'int', since
18251 their values must fit in 'int'.
18252 (xpm_load_image, png_load, tiff_load):
18253 Invoke x_create_x_image_and_pixmap earlier,
18254 to avoid much needless work if the image is too large.
18255 (tiff_load): Treat overly large images as if
18256 x_create_x_image_and_pixmap failed, not as malloc failures.
18257 (gs_load): Use x_check_image_size.
18258
5f8f9cc2
PE
18259 * gtkutil.c: Omit integer casts.
18260 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
18261 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
18262
5adf60bc
PE
18263 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
18264
c8907a93
PE
18265 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
18266 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
18267 would wrongly return t on a 64-bit host.
18268
e3c25c68
PE
18269 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
18270 The plain *_OVERFLOW macros run afoul of GCC bug 49705
18271 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
18272 and therefore cause GCC to emit a bogus diagnostic in some cases.
18273
3f791afe
PE
18274 * image.c: Integer signedness and overflow and related fixes.
18275 This is not an exhaustive set of fixes, but it's time to
18276 record what I've got.
18277 (lookup_pixel_color, check_image_size): Remove redundant decls.
18278 (check_image_size): Don't assume that arbitrary EMACS_INT values
18279 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18280 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18281 (tiff_load, imagemagick_load_image):
18282 Check for overflow in size calculations.
18283 (x_create_x_image_and_pixmap): Remove unnecessary test for
18284 xmalloc returning NULL; that can't happen.
18285 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18286 (xpm_color_bucket): Use better integer hashing function.
18287 (xpm_cache_color): Don't possibly over-allocate memory.
18288 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18289 (gif_memory_source):
18290 Use ptrdiff_t, not int or size_t, to record sizes.
18291 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18292 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18293 either works, as we prefer signed integers.
18294 (tiff_read_from_memory, tiff_write_from_memory):
18295 Return tsize_t, not size_t, since that's what the TIFF API wants.
18296 (tiff_read_from_memory): Don't fail simply because the read would
18297 go past EOF; instead, return a short read.
18298 (tiff_load): Omit no-longer-needed casts.
18299 (Fimagemagick_types): Don't assume size fits into 'int'.
18300
3cc5a532
PE
18301 Improve hashing quality when configured --with-wide-int.
18302 * fns.c (hash_string): New function, taken from sxhash_string.
18303 Do not discard information about ASCII character case; this
18304 discarding is no longer needed.
18305 (sxhash-string): Use it. Change sig to match it. Caller changed.
18306 * lisp.h: Declare it.
18307 * lread.c (hash_string): Remove, since we now use fns.c's version.
18308 The fns.c version returns a wider integer if --with-wide-int is
18309 specified, so this should help the quality of the hashing a bit.
18310
b312a492
PE
18311 * emacs.c: Integer overflow minor fix.
18312 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18313 Define only if GNU_LINUX.
18314 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18315
dfd153ae
PE
18316 * dispnew.c: Integer signedness and overflow fixes.
18317 Remove unnecessary forward decls, that were a maintenance hassle.
18318 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18319 All uses changed.
18320 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18321 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18322 (prepare_desired_row, line_draw_cost):
18323 Use int, not unsigned, where either works.
18324 (save_current_matrix, restore_current_matrix):
18325 Use ptrdiff_t, not size_t, where either works.
18326 (init_display): Check for overflow more accurately, and without
18327 relying on undefined behavior.
18328
a81d11a3
PE
18329 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18330 Remove, replacing with the new symbols in lisp.h. All uses changed.
18331 * fileio.c (make_temp_name):
18332 * filelock.c (lock_file_1, lock_file):
18333 * xdisp.c (message_dolog):
18334 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18335 Use pMd etc. instead.
18336 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18337 replacing the pWIDE etc. symbols removed from editfns.c.
18338
3300e6fd
PE
18339 * keyboard.h (num_input_events): Now uintmax_t.
18340 This is (very slightly) less likely to mess up due to wraparound.
18341 All uses changed.
18342
fd05c7e9
PE
18343 * buffer.c: Integer signedness fixes.
18344 (alloc_buffer_text, enlarge_buffer_text):
18345 Use ptrdiff_t rather than size_t when either will do, as we prefer
18346 signed integers.
18347
903fe15d
PE
18348 * alloc.c: Integer signedness and overflow fixes.
18349 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18350 (__malloc_size_t): Default to size_t, not to int.
18351 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18352 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18353 Prefer ptrdiff_t to size_t when either would do, as we prefer
18354 signed integers.
18355 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18356 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18357 Now const. Initialize with values that are in range even if char
18358 is signed.
18359 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18360 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18361 These functions do the right thing with sizes > 2**32.
18362 (check_depth): Now ptrdiff_t, not int.
18363 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18364 Adjust to new way of storing sizes. Check for size overflow bugs
18365 in rest of code.
18366 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18367 slightly wrong anyway, as it missed one instance of
18368 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18369 (refill_memory_reserve): Omit needless cast to size_t.
18370 (mark_object_loop_halt): Mark as externally visible.
18371
ac82cc6a
PE
18372 * xselect.c: Integer signedness and overflow fixes.
18373 (Fx_register_dnd_atom, x_handle_dnd_message):
18374 Use ptrdiff_t, not size_t, since we prefer signed.
18375 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18376 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18377 x_dnd_atoms_size and x_dnd_atoms_length.
18378
c2d1e36d
PE
18379 * doprnt.c: Prefer signed to unsigned when either works.
18380 * eval.c (verror):
18381 * doprnt.c (doprnt):
18382 * lisp.h (doprnt):
18383 * xdisp.c (vmessage):
18384 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18385 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18386 prefer signed arithmetic to avoid comparison confusion.
18387 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18388 but is a bit tricky.
18389
0e926e56
PE
18390 Assume freestanding C89 headers, string.h, stdlib.h.
18391 * data.c, doprnt.c, floatfns.c, print.c:
18392 Include float.h unconditionally.
18393 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18394 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18395 * regex.c: Likewise for stddef.h, string.h.
18396 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18397 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18398 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18399 (STDC_HEADERS): Remove obsolete defines.
18400 * sysdep.c: Include limits.h unconditionally.
18401
9cfdb3ec
PE
18402 Assume support for memcmp, memcpy, memmove, memset.
18403 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18404 * regex.c (memcmp, memcpy):
18405 Remove; we assume C89 now.
18406
18407 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18408 (__malloc_safe_bcopy): Remove; no longer needed.
18409
cf950e6b 18410 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
18411 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18412 well either way, and we prefer signed to unsigned.
18413
dbf38e02
LMI
184142011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18415
18416 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18417 closes the connection while we're reading (bug#9182).
18418
d6f0886c 184192011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 18420
d6f0886c
JD
18421 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18422 are specified (Bug#9168).
24e0f6b1 18423
2eb1f9e6
PE
184242011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18425
18426 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18427 Found by GCC static checking and --with-wide-int on a 32-bit host.
18428
22381272 184292011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
18430
18431 * xdisp.c (compute_display_string_pos): Fix logic of caching
18432 previous display string position. Initialize cached_prev_pos to
18433 -1. Fixes slow-down at the beginning of a buffer.
18434
f25e39b4
EZ
184352011-07-24 Eli Zaretskii <eliz@gnu.org>
18436
18437 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18438 for attrs[LFACE_FONTSET_INDEX].
18439
04c4b52e
PE
184402011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18441
18442 * xml.c (parse_region): Remove unused local
18443 that was recently introduced.
18444
c1734fbd
EZ
184452011-07-23 Eli Zaretskii <eliz@gnu.org>
18446
be18c5a5
EZ
18447 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18448 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18449
c1734fbd
EZ
18450 * xdisp.c (move_it_in_display_line_to): Record the best matching
18451 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
18452 exit if none of the characters scanned was an exact match.
18453 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
18454 when exact match is impossible due to invisible text, and the
18455 lines are truncated.
18456
a258d627
JD
184572011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18458
18459 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18460 for OSX >= 10.7.
18461
b6d5a689
EZ
184622011-07-22 Eli Zaretskii <eliz@gnu.org>
18463
0f74f785
EZ
18464 Fix a significant slow-down of cursor motion with C-n, C-p,
18465 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18466 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 18467 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
18468 (next_element_from_buffer): Call compute_stop_pos_backwards to
18469 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
18470 base_level_stop.
18471 (reseat): Don't look for prev_stop, as that could mean a very long
18472 run.
18473 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18474 <cached_disp_overlay_modiff>: Cache for last found display string
18475 position.
551918c1 18476 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
18477 about the same buffer in the same area of character positions, and
18478 the buffer wasn't changed since the time the display string
18479 position was cached.
551918c1 18480
b2d0c91a
EZ
184812011-07-22 Eli Zaretskii <eliz@gnu.org>
18482
18483 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18484 is an integer, which is important for empty lines. (Bug#9149)
18485
043604ee
CY
184862011-07-22 Chong Yidong <cyd@stupidchicken.com>
18487
18488 * frame.c (Fmodify_frame_parameters): In tty case, update the
18489 default face if necessary (Bug#4238).
18490
da4adb04
CY
184912011-07-21 Chong Yidong <cyd@stupidchicken.com>
18492
18493 * editfns.c (Fstring_to_char): No need to explain what a character
18494 is in the docstring (Bug#6576).
18495
9abd0532
LMI
184962011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18497
18498 * xml.c (parse_region): Make sure we always return a tree.
18499
36881d16
HK
185002011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18501
18502 * xml.c (parse_region): If a document contains only comments,
18503 return that, too.
18504
1e98674d
LMI
185052011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18506
18507 * xml.c (make_dom): Return comments, too.
18508
590bd467
PE
185092011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18510
18511 Port to OpenBSD.
18512 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18513 and the surrounding thread.
18514 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18515 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18516 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18517 timer goes off.
18518 * s/openbsd.h (BROKEN_SIGIO): Define.
18519 * unexelf.c (unexec) [__OpenBSD__]:
18520 Don't update the .mdebug section of the Alpha COFF symbol table.
18521
f41628b2
LMI
185222011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18523
18524 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18525 (bug#8460).
18526
b59b67c5
PE
185272011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18528
15e3a074
PE
18529 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18530 This fixes some race conditions on the permissions of any newly
18531 created file.
18532
41bed37d
PE
18533 * alloc.c (valid_pointer_p): Use pipe, not open.
18534 This fixes some permissions issues when debugging.
18535
b59b67c5
PE
18536 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18537 If fchown fails to set both uid and gid, try to set just gid,
18538 as that is sometimes allowed. Adjust the file's mode to eliminate
18539 setuid or setgid bits that are inappropriate if fchown fails.
18540
925a6be7
SM
185412011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18542
18543 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18544 to compare Lisp_Objects.
18545 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18546 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18547 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18548
52968808
AS
185492011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18550
0a6a104b
AS
18551 * lread.c (read_integer): Unread even EOF character.
18552 (read1): Likewise. Properly record start position of symbol.
18553
52968808
AS
18554 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18555 symbol character follows.
18556
9e381cdd
PE
185572011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18558
18559 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18560 This works around a problem with the previous change to Fcopy_file.
18561 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18562 and without this change, GCC might complain about discarding
18563 fchown's return value.
18564
b5641435
JB
185652011-07-16 Juanma Barranquero <lekktu@gmail.com>
18566
18567 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18568
a8031457
PE
185692011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18570
18571 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18572
dd889327
LMI
185732011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18574
750c33f7
LMI
18575 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18576 it's used from the C level.
18577
dd889327
LMI
18578 * process.c: Use the same condition for POLL_FOR_INPUT in both
18579 keyboard.c and process.c (bug#1858).
18580
87e86684
LM
185812011-07-09 Lawrence Mitchell <wence@gmx.li>
18582
18583 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18584 (Fgnutls_boot): Use it.
18585
64348f40
AS
185862011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18587
18588 * doc.c (Fsubstitute_command_keys): Revert last change.
18589
1d698799
LMI
185902011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18591
f863868c
LMI
18592 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18593 quotes the next character, and doesn't affect other longer
18594 sequences (bug#8935).
18595
1d698799
LMI
18596 * lread.c (syms_of_lread): Clarify that is isn't only
18597 `eval-buffer' and `eval-defun' that's affected by
18598 `lexical-binding' (bug#8460).
18599
aa4b6df6
EZ
186002011-07-15 Eli Zaretskii <eliz@gnu.org>
18601
18602 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 18603 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 18604
5d856da6
PE
186052011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18606
ad6042bb
PE
18607 Fix minor problems found by static checking.
18608 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18609 (elsz): Now a signed constant, not a size_t var. We prefer signed
18610 types to unsigned, to avoid integer comparison confusion. Without
18611 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18612 "cannot optimize loop, the loop counter may overflow", a symptom
18613 of the confusion.
f00bbb22 18614 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
18615 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18616
6468f31c
LMI
186172011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18618
49080b10
LMI
18619 * search.c (Fre_search_backward): Mention `case-fold-search' in
18620 all the re_search_* functions (bug#8138).
18621
6468f31c
LMI
18622 * keyboard.c (Fopen_dribble_file): Document when the file is
18623 closed (bug#8056).
18624
c965adc5
EZ
186252011-07-14 Eli Zaretskii <eliz@gnu.org>
18626
df9733bf
EZ
18627 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18628 bidi_cache_idx.
18629
0bb23927
EZ
18630 Support bidi reordering of display and overlay strings.
18631 * xdisp.c (compute_display_string_pos)
18632 (compute_display_string_end): Accept additional argument STRING.
18633 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18634 (reseat_to_string): Initialize bidi_it->string.s and
18635 bidi_it->string.schars.
18636 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
18637 NULL (avoids a crash in bidi_paragraph_init).
18638 Initialize itb.string.lstring.
0bb23927
EZ
18639 (init_iterator): Call bidi_init_it only of a valid
18640 buffer position was specified. Initialize paragraph_embedding to
18641 L2R.
18642 (reseat_to_string): Initialize the bidi iterator.
18643 (display_string): If we need to ignore text properties of
18644 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18645 original value of -1 will not work with bidi.)
18646 (compute_display_string_pos): First arg is now struct
18647 `text_pos *'; all callers changed. Support display properties on
18648 Lisp strings.
18649 (compute_display_string_end): Support display properties on Lisp
18650 strings.
18651 (init_iterator, reseat_1, reseat_to_string): Initialize the
18652 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18653 when iterating on a string not from display properties).
640c8776
SM
18654 (compute_display_string_pos, compute_display_string_end):
18655 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
18656 arrow keys.
18657 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
18658 base_level_stop; instead, set base_level_stop to BEGV.
18659 Fixes crashes in vertical-motion.
0bb23927
EZ
18660 (next_element_from_buffer): Improve commentary for when
18661 the iterator is before prev_stop.
18662 (init_iterator): Initialize bidi_p from the default value of
18663 bidi-display-reordering, not from buffer-local value. Use the
18664 buffer-local value only if initializing for buffer iteration.
18665 (handle_invisible_prop): Support invisible properties on strings
18666 that are being bidi-reordered.
18667 (set_iterator_to_next): Support bidi reordering of C strings and
18668 Lisp strings.
18669 (next_element_from_string): Support bidi reordering of Lisp
18670 strings.
18671 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
18672 (display_string): Support display of R2L glyph rows.
18673 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
18674 (init_iterator): Don't initialize it->bidi_p for strings
18675 here.
18676 (reseat_to_string): Initialize it->bidi_p for strings here.
18677 (next_element_from_string, next_element_from_c_string)
18678 (next_element_from_buffer): Add xassert's for correspondence
18679 between IT's object being iterated and it->bidi_it.string
18680 structure.
18681 (face_before_or_after_it_pos): Support bidi iteration.
18682 (next_element_from_c_string): Handle the case of the first string
18683 character that is not the first one in the visual order.
18684 (get_visually_first_element): New function, refactored from common
18685 parts of next_element_from_buffer, next_element_from_string, and
18686 next_element_from_c_string.
18687 (tool_bar_lines_needed, redisplay_tool_bar)
18688 (display_menu_bar): Force left-to-right direction. Add a FIXME
18689 comment for making that be controlled by a user option.
18690 (push_it, pop_it): Save and restore the state of the
18691 bidi iterator. Save and restore the bidi_p flag.
18692 (pop_it): Iterate out of display property for string iteration as
18693 well.
18694 (iterate_out_of_display_property): Support iteration over strings.
18695 (handle_single_display_spec): Set up it->bidi_it for iteration
18696 over a display string, and call bidi_init_it.
18697 (handle_single_display_spec, next_overlay_string)
18698 (get_overlay_strings_1, push_display_prop): Set up the bidi
18699 iterator for displaying display or overlay strings.
18700 (forward_to_next_line_start): Don't use the shortcut if
18701 bidi-iterating.
18702 (back_to_previous_visible_line_start): If handle_display_prop
18703 pushed the iterator stack, restore the internal state of the bidi
18704 iterator by calling bidi_pop_it same number of times.
18705 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18706 and we are bidi-iterating, don't decrement the iterator position;
18707 instead, set the first_elt flag in the bidi iterator, to produce
18708 the same effect.
18709 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18710 (push_display_prop): xassert that we are iterating a buffer.
18711 (push_it, pop_it): Save and restore paragraph_embedding member.
18712 (handle_single_display_spec, next_overlay_string)
18713 (get_overlay_strings_1, reseat_1, reseat_to_string)
18714 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18715 correctly. Don't assume unibyte strings are not bidi-reordered.
18716 (compute_display_string_pos)
18717 (compute_display_string_end): Fix handling the case of C string.
18718 (push_it, pop_it): Save and restore from_disp_prop_p.
18719 (handle_single_display_spec, push_display_prop): Set the
18720 from_disp_prop_p flag.
18721 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18722 (pop_it): Call iterate_out_of_display_property only if we are
18723 popping after iteration over a string that came from a display
18724 property. Fix a typo in popping stretch info. Add an assertion
18725 for verifying that the iterator position is in sync with the bidi
18726 iterator.
18727 (handle_single_display_spec, get_overlay_strings_1)
18728 (push_display_prop): Fix initialization of paragraph direction for
18729 string when that of the parent object is not yet determined.
18730 (reseat_1): Call bidi_init_it to resync the bidi
18731 iterator with IT's position. (Bug#7616)
18732 (find_row_edges): If ROW->start.pos gives position
18733 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18734 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18735 Reset the from_disp_prop_p flag.
18736 (SAVE_IT, RESTORE_IT): New macros.
18737 (pos_visible_p, face_before_or_after_it_pos)
18738 (back_to_previous_visible_line_start)
18739 (move_it_in_display_line_to, move_it_in_display_line)
18740 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18741 (try_scrolling, redisplay_window, display_line): Use them when
18742 saving a temporary copy of the iterator and restoring it back.
18743 (back_to_previous_visible_line_start, reseat_1)
18744 (init_iterator): Empty the bidi cache "stack".
18745 (move_it_in_display_line_to): If iterator ended up at
18746 EOL, but we never saw any buffer positions smaller than
18747 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18748 motion in bidi-reordered lines.
18749 (move_it_in_display_line_to): Record prev_method and prev_pos
18750 immediately before the call to set_iterator_to_next. Fixes cursor
18751 motion in bidi-reordered lines with stretch glyphs and strings
18752 displayed in margins. (Bug#8133) (Bug#8867)
18753 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18754 TO_CHARPOS.
640c8776
SM
18755 (pos_visible_p): Support positions in bidi-reordered lines.
18756 Save and restore bidi cache.
0bb23927
EZ
18757
18758 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18759 (bidi_paragraph_info): Delete unused struct.
18760 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18761 (bidi_cache_start): New variable.
18762 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18763 to zero.
18764 (bidi_cache_fetch_state, bidi_cache_search)
18765 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18766 (bidi_cache_find, bidi_peek_at_next_level)
18767 (bidi_level_of_next_char, bidi_find_other_level_edge)
18768 (bidi_move_to_visually_next): Compare cache index with
18769 bidi_cache_start rather than with zero.
18770 (bidi_fetch_char): Accept new argument STRING; all callers
18771 changed. Support iteration over a string. Support strings with
18772 display properties. Support unibyte strings. Fix the type of
18773 `len' according to what STRING_CHAR_AND_LENGTH expects.
18774 (bidi_paragraph_init, bidi_resolve_explicit_1)
18775 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
18776 (bidi_level_of_next_char, bidi_move_to_visually_next):
18777 Support iteration over a string.
0bb23927
EZ
18778 (bidi_set_sor_type, bidi_resolve_explicit_1)
18779 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18780 can now be zero (for strings); special values 0 and -1 were
18781 changed to -1 and -2, respectively.
18782 (bidi_char_at_pos): New function.
18783 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18784 Call it instead of FETCH_MULTIBYTE_CHAR.
18785 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18786 initialized to valid values.
18787 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18788 values.
18789 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18790 the test for valid cached positions. Fix the logic for looking up
18791 the sentinel state in the cache. GCPRO the Lisp string we are
18792 iterating.
18793 (bidi_push_it, bidi_pop_it): New functions.
18794 (bidi_initialize): Initialize the bidi cache start stack pointer.
18795 (bidi_cache_ensure_space): New function, refactored from part of
18796 bidi_cache_iterator_state. Don't assume the required size is just
18797 one BIDI_CACHE_CHUNK away.
18798 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18799 (bidi_count_bytes, bidi_char_at_pos): New functions.
18800 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18801 always valid if bidi_cache_idx is valid.
18802 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18803 is valid if it's going to be used.
18804 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18805 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
18806 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18807 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
18808 (bidi_find_other_level_edge, bidi_cache_start_stack):
18809 All variables related to cache indices are now EMACS_INT.
c965adc5 18810
0bb23927
EZ
18811 * dispextern.h (struct bidi_string_data): New structure.
18812 (struct bidi_it): New member `string'. Make flag members be 1-bit
18813 fields, and put them last in the struct.
640c8776
SM
18814 (compute_display_string_pos, compute_display_string_end):
18815 Update prototypes.
0bb23927
EZ
18816 (bidi_push_it, bidi_pop_it): Add prototypes.
18817 (struct iterator_stack_entry): New members bidi_p,
18818 paragraph_embedding, and from_disp_prop_p.
18819 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
18820 (bidi_shelve_cache, bidi_unshelve_cache):
18821 Declare prototypes.
0bb23927
EZ
18822
18823 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18824 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18825 and vector-like objects.
18826
18827 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18828 cache around display iteration.
18829
18830 * window.c (Fwindow_end, window_scroll_pixel_based)
18831 (displayed_window_lines, Frecenter): Save and restore the bidi
18832 cache around display iteration.
18833
3bbd2265
LMI
188342011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18835
18836 * editfns.c (Fdelete_region): Clarify the use of the named
18837 parameters (bug#6788).
18838
adc47434
MR
188392011-07-14 Martin Rudalics <rudalics@gmx.at>
18840
18841 * indent.c (Fvertical_motion): Set and restore w->pointm when
18842 saving and restoring the window's buffer (Bug#9006).
18843
837c31f8
LMI
188442011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18845
18846 * editfns.c (Fstring_to_char): Clarify just what is returned
18847 (bug#6576). Text by Eli Zaretskii.
18848
ac389d0c
JB
188492011-07-13 Juanma Barranquero <lekktu@gmail.com>
18850
18851 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18852
0be0ce47
EZ
188532011-07-13 Eli Zaretskii <eliz@gnu.org>
18854
18855 * buffer.c (mmap_find): Fix a typo.
18856
cd18e7e3
JB
188572011-07-13 Johan Bockgård <bojohan@gnu.org>
18858
18859 Fix execution of x selection hooks.
18860 * xselect.c (Qx_lost_selection_functions)
18861 (Qx_sent_selection_functions): New vars.
18862 (syms_of_xselect): DEFSYM them.
18863 (x_handle_selection_request): Pass Qx_sent_selection_functions
18864 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18865 (x_handle_selection_clear,x_clear_frame_selections):
18866 Pass Qx_lost_selection_functions rather than
18867 Vx_lost_selection_functions to Frun_hook_with_args.
18868
47ea7f44
PE
188692011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18870
ac389d0c 18871 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18872 The old code sometimes used this field without initializing it.
18873
47ea7f44
PE
18874 * alloc.c (gc_sweep): Don't read past end of array.
18875 In theory, the old code could also have corrupted Emacs internals,
18876 though it'd be very unlikely.
18877
bc985c87
AS
188782011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18879
18880 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18881 argument. (Bug#4026)
bc985c87 18882
0cf34688
LMI
188832011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18884
b3dadd76
LMI
18885 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18886 key" (bug#4257).
18887
0cf34688
LMI
18888 * window.c (Fset_window_start): Doc fix (bug#4199).
18889 (Fset_window_hscroll): Ditto.
18890
270768cd
PE
188912011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18892
077e3dda 18893 Fix minor new problems caught by GCC 4.6.1.
270768cd 18894 * term.c (init_tty): Remove unused local.
490011a6 18895 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18896 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18897 not used otherwise.
270768cd 18898
b1f58454
CY
188992011-07-12 Chong Yidong <cyd@stupidchicken.com>
18900
18901 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18902
22b9578d
LMI
189032011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18904
6e70ab07
LMI
18905 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18906 are the mini-buffer and the echo area (bug#3320).
18907
22b9578d
LMI
18908 * term.c (init_tty): Remove support for supdup, c10 and perq
18909 terminals, which are no longer supported (bug#1482).
18910
8974cc9f
JB
189112011-07-10 Johan Bockgård <bojohan@gnu.org>
18912
18913 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18914
a560d974
JD
189152011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18916
18917 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18918 for non-popups (Bug#3642).
18919
1dae0f0a
AS
189202011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18921
268c2c36 18922 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18923 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18924 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18925 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18926 * data.c (fmod): Likewise.
18927 * dispnew.c (swap_glyphs_in_rows): Likewise.
18928 * emacs.c (memory_warning_signal): Likewise.
18929 * floatfns.c (float_error): Likewise.
18930 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18931 (otf_open, font_otf_capability, generate_otf_features)
18932 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18933 Likewise.
18934 * image.c (pbm_read_file): Likewise.
18935 * indent.c (string_display_width): Likewise.
18936 * intervals.c (check_for_interval, search_for_interval)
18937 (inc_interval_count, count_intervals, root_interval)
18938 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18939 * lread.c (defalias): Likewise.
268c2c36 18940 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18941 * regex.c (set_image_of_range_1, set_image_of_range)
18942 (regex_grow_registers): Likewise.
18943 * sysdep.c (strerror): Likewise.
18944 * termcap.c (valid_filename_p, tprint, main): Likewise.
18945 * tparam.c (main): Likewise.
18946 * unexhp9k800.c (run_time_remap, save_data_space)
18947 (update_file_ptrs, read_header, write_header, calculate_checksum)
18948 (copy_file, copy_rest, display_header): Likewise.
18949 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18950 Likewise.
18951 * xdisp.c (check_it): Likewise.
18952 * xfaces.c (register_color, unregister_color, unregister_colors):
18953 Likewise.
18954 * xfns.c (print_fontset_result): Likewise.
18955 * xrdb.c (member, fatal, main): Likewise.
18956
99033785
PE
189572011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18958
18959 Fix minor problems found by static checking (Bug#9031).
18960 * chartab.c (char_table_set_range, map_sub_char_table):
18961 Remove unused locals.
18962 (uniprop_table): Now static.
18963 * composite.c (_work_char): Remove unused static var.
18964
9cb2ac56
JB
189652011-07-09 Juanma Barranquero <lekktu@gmail.com>
18966
18967 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18968
f25661f0
JD
189692011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18970
18971 * gtkutil.c (qttip_cb): Remove code without function.
18972
8278c4fe
EZ
189732011-07-09 Eli Zaretskii <eliz@gnu.org>
18974
18975 * w32.c (pthread_sigmask): New stub.
18976
1692ae2d 189772011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18978
8a6ebd58 18979 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18980 sigprocmask is portable only for single-threaded applications, and
18981 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18982 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18983 (LIBES): Use it.
18984 * callproc.c (Fcall_process):
18985 * process.c (create_process):
18986 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18987 Use pthread_sigmask, not sigprocmask.
123403e4 18988
1b854618
JD
189892011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18990
18991 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18992 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18993 wrong (Bug#8591).
18994
3fe4b549
JD
189952011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18996
0ce7e563
JD
18997 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18998 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18999 (xg_hide_tooltip): Fix comment.
19000
3fe4b549
JD
19001 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
19002 in registerServicesMenuSendTypes.
19003 (validRequestorForSendType): Don't check ns_return_types.
19004
19005 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
19006 ns_return_type.
19007
5df75e47
JR
190082011-07-08 Jason Rumney <jasonr@gnu.org>
19009
22610910
JR
19010 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
19011 SH_SHOW for hidden windows (Bug#5482).
19012
5df75e47
JR
19013 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
19014 frame struct members of non-existent frames (Bug#6284).
19015
699c10bd
JD
190162011-07-08 Jan Djärv <jan.h.d@swipnet.se>
19017
4393663b
JD
19018 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
19019 variable firstTime not needed on OSX >= 10.6.
19020 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
19021 >= 10.5. Use setKnobProportion, setDoubleValue.
19022
19023 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
19024 (MAC_OS_X_VERSION_10_5): Define if not defined.
19025 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
19026 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
19027 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
19028
19029 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 19030 cString and lossyCString on OSX >= 10.4.
4393663b 19031
58179cce 19032 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
19033 sizeToFit on OSX >= 10.2.
19034
19035 * nsimage.m (allocInitFromFile): Don't use deprecated method
19036 bestRepresentationForDevice on OSX >= 10.6.
19037
19038 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
19039 to avoid warning.
19040
19041 * emacs.c: Declare unexec_init_emacs_zone.
19042
a63e0781
JD
19043 * nsgui.h: Fix compiler warning about gnulib redefining verify.
19044
699c10bd
JD
19045 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
19046
19047 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
19048 on svcsMenu (Bug#8842).
19049
19050 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
19051 ns_return_types.
19052 (Fns_list_services): Just return Qnil on 10.6, code not working there.
19053
19054 * nsterm.m (QUTF8_STRING): Declare.
19055 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
19056 (validRequestorForSendType): Return type is (id).
19057 Change indexOfObjectIdenticalTo to indexOfObject.
19058 Check if we have local selection before returning self (Bug#8842).
19059 (writeSelectionToPasteboard): Put local selection into paste board
19060 if we have a local selection (Bug#8842).
19061 (syms_of_nsterm): DEFSYM QUTF8_STRING.
19062
19063 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
19064 (ns_get_local_selection): Declare.
19065
54e10184
LMI
190662011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
19067
9888ff71
LMI
19068 * keymap.c (describe_map_tree): Don't insert a double newline at
19069 the end of the buffer (bug#1169) and return whether we inserted
19070 something.
19071
54e10184
LMI
19072 * callint.c (Fcall_interactively): Change "reading args" to
19073 "providing args" to try to clarify what it does (bug#1010).
19074
15fa4783
KH
190752011-07-07 Kenichi Handa <handa@m17n.org>
19076
19077 * composite.c (composition_compute_stop_pos): Ignore a static
19078 composition starting before CHARPOS (Bug#8915).
19079
19080 * xdisp.c (handle_composition_prop): Likewise.
19081
a8815b00
EZ
190822011-07-07 Eli Zaretskii <eliz@gnu.org>
19083
19084 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
19085 (Bug#9015)
19086
ef7b981d 190872011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
19088
19089 * character.h (unicode_category_t): New enum type.
19090
19091 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
19092 (Qchar_code_property_table): New variable.
19093 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
19094 (UNIPROP_COMPRESSED_FORM_P): New macros.
19095 (char_table_ascii): Uncompress the compressed values.
19096 (sub_char_table_ref): New arg is_uniprop. Callers changed.
19097 Uncompress the compressed values.
ac389d0c 19098 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
19099 (char_table_ref_and_range): Uncompress the compressed values.
19100 (sub_char_table_set): New arg is_uniprop. Callers changed.
19101 Uncompress the compressed values.
19102 (sub_char_table_set_range): Args changed. Callers changed.
19103 (char_table_set_range): Adjuted for the above change.
19104 (map_sub_char_table): Delete args default_val and parent. Add arg
19105 top. Give decoded values to a Lisp function.
640c8776 19106 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
19107 values to a Lisp function. Gcpro more variables.
19108 (uniprop_table_uncompress)
19109 (uniprop_decode_value_run_length): New functions.
19110 (uniprop_decoder, uniprop_decoder_count): New variables.
19111 (uniprop_get_decoder, uniprop_encode_value_character)
19112 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
19113 New functions.
19114 (uniprop_encoder, uniprop_encoder_count): New variables.
19115 (uniprop_get_encoder, uniprop_table)
19116 (Funicode_property_table_internal, Fget_unicode_property_internal)
19117 (Fput_unicode_property_internal): New functions.
19118 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
19119 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 19120 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
19121 char-code-property-alist.
19122
640c8776 19123 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
19124 Vunicode_category_table.
19125
640c8776 19126 * font.c (font_range): Adjust for the change of
c805dec0
KH
19127 Vunicode_category_table.
19128
76b397fb
DN
191292011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
19130
19131 * m/iris4d.h: Remove file, move contents ...
19132 * s/irix6-5.h: ... here.
19133
22b4128e
PE
191342011-07-06 Paul Eggert <eggert@cs.ucla.edu>
19135
19136 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
19137 * alloc.c (mark_buffer):
19138 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
19139 (clone_per_buffer_values): Don't assume that
22b4128e
PE
19140 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
19141 This isn't true in general, and it's particularly not true
19142 if Emacs is configured with --with-wide-int.
19143 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
19144 New macros, used in the buffer.c change.
19145
869795d6
JD
191462011-07-05 Jan Djärv <jan.h.d@swipnet.se>
19147
19148 * xsettings.c: Use both GConf and GSettings if both are available.
19149 (store_config_changed_event): Add comment.
19150 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
19151 (store_tool_bar_style_changed): New functions.
5e617bc2 19152 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
19153 (struct xsettings): Move font inside HAVE_XFT.
19154 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 19155 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 19156 Move inside HAVE_XFT.
640c8776 19157 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
19158 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
19159 also.
19160 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 19161 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 19162 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
19163 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
19164 (parse_settings): Move check for font inside HAVE_XFT.
19165 (read_settings, apply_xft_settings): Add comment.
19166 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
19167 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
19168 call store_font_name_changed.
19169 (xft_settings_event): Add comment.
19170 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
19171 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
19172 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
19173 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
19174 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
19175 (xsettings_get_system_font, xsettings_get_system_normal_font):
19176 Add comment.
869795d6 19177
d8ed26bd
PE
191782011-07-05 Paul Eggert <eggert@cs.ucla.edu>
19179
19180 Random fixes. E.g., (random) never returned negative values.
19181 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
19182 subseconds part to the entropy, as that's a bit more random.
19183 Prefer signed to unsigned, since the signedness doesn't matter and
19184 in general we prefer signed. When given a limit, use a
19185 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
19186 latter isn't right if USE_2_TAGS_FOR_INTS.
19187 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
19188 not 0..VALMASK. Don't discard "excess" bits that random () returns.
19189
cabf1cac
SM
191902011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
19191
19192 * textprop.c (text_property_stickiness):
19193 Obey Vtext_property_default_nonsticky.
19194 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
19195 * w32fns.c (syms_of_w32fns):
19196 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
19197
6e9b2be9
PE
191982011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19199
19200 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
19201 This is more efficient than Ffile_directory_p and avoids a minor race.
19202
90186c68
LMI
192032011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
19204
7c301272
LMI
19205 * buffer.c (Foverlay_put): Say what the return value is
19206 (bug#7835).
19207
c4f2d8d4
LMI
19208 * fileio.c (barf_or_query_if_file_exists): Check first if the file
19209 is a directory before asking whether to use the file name
19210 (bug#7564).
ad637907
LMI
19211 (barf_or_query_if_file_exists): Make the "File is a directory"
19212 error be more correct.
c4f2d8d4 19213
90186c68
LMI
19214 * fns.c (Frequire): Remove the mention of the .gz files, since
19215 that's installation-specific, but keep the mention of
19216 `get-load-suffixes'.
19217
da64016e
PE
192182011-07-04 Paul Eggert <eggert@cs.ucla.edu>
19219
19220 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
19221 Report string overflow if the output is too long.
19222
7d47b580
JB
192232011-07-04 Juanma Barranquero <lekktu@gmail.com>
19224
a555cb87
JB
19225 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
19226 (syms_of_gnutls): Remove duplicate DEFSYM for
19227 Qgnutls_bootprop_verify_hostname_error, an error for
19228 Qgnutls_bootprop_verify_error (which is no longer used).
19229
7d47b580
JB
19230 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
19231 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
19232 Also (re)move comments that are misplaced or no longer relevant.
19233
1e49bfab
LMI
192342011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19235
19236 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
19237
1485f4c0
CY
192382011-07-03 Chong Yidong <cyd@stupidchicken.com>
19239
19240 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
19241 and background color parameters if they have been changed.
19242
a9ab721e
LMI
192432011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
19244
19245 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
19246
cf7cff57
PE
192472011-07-03 Paul Eggert <eggert@cs.ucla.edu>
19248
2e13213d
PE
19249 * xsettings.c (SYSTEM_FONT): Define only when used.
19250 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
19251
cf7cff57
PE
19252 * keymap.c (access_keymap_1): Now static.
19253
7a8e04f7
CY
192542011-07-02 Chong Yidong <cyd@stupidchicken.com>
19255
19256 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
19257 leave any prefix arg for the up event (Bug#1586).
19258
61352f62
LMI
192592011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
19260
69bb1ef7
LMI
19261 * lread.c (syms_of_lread): Mention single symbols defined by
19262 `defvar' or `defconst' (bug#7154).
19263
61352f62 19264 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 19265 (Frequire): Mention get-load-suffixes.
61352f62 19266
28545e04
MR
192672011-07-02 Martin Rudalics <rudalics@gmx.at>
19268
19269 * window.h (window): Remove clone_number slot.
19270 * window.c (Fwindow_clone_number, Fset_window_clone_number):
19271 Remove.
19272 (make_parent_window, make_window, saved_window)
19273 (Fset_window_configuration, save_window_save): Don't deal with
19274 clone numbers.
19275 * buffer.c (Qclone_number): Remove declaration.
19276 (sort_overlays, overlay_strings): Don't deal with clone numbers.
19277
3349e122
SM
192782011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
19279
19280 Add multiple inheritance to keymaps.
19281 * keymap.c (Fmake_composed_keymap): New function.
19282 (Fset_keymap_parent): Simplify.
19283 (fix_submap_inheritance): Remove.
19284 (access_keymap_1): New function extracted from access_keymap to handle
19285 embedded parents and handle lists of maps.
19286 (access_keymap): Use it.
19287 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19288 (Fcopy_keymap): Handle embedded parents.
19289 (Fcommand_remapping, define_as_prefix): Simplify.
19290 (Fkey_binding): Simplify.
19291 (syms_of_keymap): Move minibuffer-local-completion-map,
19292 minibuffer-local-filename-completion-map,
19293 minibuffer-local-must-match-map, and
19294 minibuffer-local-filename-must-match-map to Elisp.
19295 (syms_of_keymap): Defsubr make-composed-keymap.
19296 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19297 (parse_menu_item): Trivial simplification.
19298
3279eb87
GM
192992011-07-01 Glenn Morris <rgm@gnu.org>
19300
19301 * Makefile.in (SETTINGS_LIBS): Fix typo.
19302
39cb9e56 193032011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
19304
19305 * coding.c (Fencode_coding_string): Record the last coding system
19306 used, as the function doc string says (bug#8738).
19307
0949d2b6
JD
193082011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19309
19310 * xsettings.c (store_monospaced_changed): Take new font as arg and
19311 check for change against current_mono_font.
19312 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19313 (emacs_settings_constructor, emacs_settings_get_property)
19314 (emacs_settings_set_property, emacs_settings_class_init)
19315 (emacs_settings_init, gsettings_obj): Remove.
19316 (something_changedCB): New function for HAVE_GSETTINGS.
19317 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19318 with value as argument.
19319 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19320 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 19321 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
19322 "changed".
19323
19324 * xgselect.c: Add defined (HAVE_GSETTINGS).
19325 (xgselect_initialize): Ditto.
19326
19327 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19328 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19329 xg_select.
19330
bbc6b304
PE
193312011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19332
19333 * eval.c (struct backtrace): Simplify and port the data structure.
19334 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19335 signed bit field, as this assumption is not portable and it makes
19336 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19337 "char debug_on_exit : 1" as this is not portable either; instead,
19338 use the portable "unsigned int debug_on_exit : 1". Remove unused
19339 member evalargs. Remove obsolete comments about cc bombing out.
19340
9851bfc5
JD
193412011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19342
51bb811f 19343 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
19344 Let HAVE_GSETTINGS override HAVE_GCONF.
19345 (store_monospaced_changed): New function.
19346 (EMACS_SETTINGS): A new type derived from GObject to handle
19347 GSettings notifications.
19348 (emacs_settings_constructor, emacs_settings_get_property)
19349 (emacs_settings_set_property, emacs_settings_class_init):
19350 New functions.
19351 (gsettings_client, gsettings_obj): New variables.
19352 (GSETTINGS_SCHEMA): New define.
19353 (something_changedCB): Call store_monospaced_changed.
19354 (init_gsettings): New function.
19355 (xsettings_initialize): Call init_gsettings.
19356 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19357 to NULL.
19358
640c8776 19359 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
19360 GCONF_CFLAGS/LIBS.
19361
5386012d
MR
193622011-06-29 Martin Rudalics <rudalics@gmx.at>
19363
19364 * window.c (resize_root_window, grow_mini_window)
19365 (shrink_mini_window): Rename Qresize_root_window to
19366 Qwindow_resize_root_window and Qresize_root_window_vertically to
19367 Qwindow_resize_root_window_vertically.
19368
f13e0b08
PE
193692011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19370
19371 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19372
94515237
JB
193732011-06-27 Juanma Barranquero <lekktu@gmail.com>
19374
19375 * makefile.w32-in: Redesign dependencies so they reflect more
19376 clearly which files are directly included by each source file,
19377 and not through other includes.
19378
e43b6e43
MR
193792011-06-27 Martin Rudalics <rudalics@gmx.at>
19380
19381 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19382 (sort_overlays, overlay_strings): When an overlay's clone number
19383 matches the window's clone number process the overlay even if
19384 the overlay's window property doesn't match the current window.
19385
d68443dc
MR
19386 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19387 (Fwindow_hchild): Rename to Fwindow_left_child.
19388 (Fwindow_next): Rename to Fwindow_next_sibling.
19389 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
19390 (resize_window_check): Rename to window_resize_check.
19391 (resize_window_apply): Rename to window_resize_apply.
19392 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19393 (Fdelete_other_windows_internal, resize_frame_windows)
19394 (Fsplit_window_internal, Fdelete_window_internal)
19395 (grow_mini_window, shrink_mini_window)
19396 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 19397
c7e73be5
JD
193982011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19399
19400 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19401 (emacs_fixed_set_min_size): Remove.
19402 (emacs_fixed_new): Take frame as argument.
19403
19404 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19405 (_EmacsFixedPrivate): Remove minwidth/height.
19406 Add struct frame *f.
19407 (emacs_fixed_init): Initialize priv->f.
19408 (get_parent_class, emacs_fixed_set_min_size): Remove.
19409 (emacs_fixed_new): Set priv->f to argument.
19410 (emacs_fixed_get_preferred_width)
19411 (emacs_fixed_get_preferred_height): Use min_width/height from
19412 frames size_hint to set minimum and natural (Bug#8919).
19413 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19414 and use min_width/height from frames size_hint to set
19415 min_width/height (Bug#8919).
19416
19417 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
19418 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19419 Fix indentation.
c7e73be5 19420
cf99dcf8
EZ
194212011-06-26 Eli Zaretskii <eliz@gnu.org>
19422
19423 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19424 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19425 called at ZV.
19426
029529ac
CY
194272011-06-26 Chong Yidong <cyd@stupidchicken.com>
19428
19429 * process.c (wait_reading_process_output): Bypass select if
19430 waiting for a cell while ignoring keyboard input, and input is
19431 pending. Suggested by Jan Djärv (Bug#8869).
19432
7a7ef429
PE
194332011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19434
19435 Use gnulib's dup2 module instead of rolling our own.
19436 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19437
11fdef7d 194382011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
19439
19440 * dispnew.c (scrolling_window): Before scrolling, turn off a
19441 mouse-highlight in the window being scrolled.
19442
cd3520a4
JB
194432011-06-24 Juanma Barranquero <lekktu@gmail.com>
19444
19445 Move DEFSYM to lisp.h and use everywhere.
19446
19447 * character.h (DEFSYM): Move declaration...
19448 * lisp.h (DEFSYM): ...here.
19449
19450 * gnutls.c:
19451 * minibuf.c:
19452 * w32menu.c:
19453 * w32proc.c:
19454 * w32select.c: Don't include character.h.
19455
19456 * alloc.c (syms_of_alloc):
19457 * buffer.c (syms_of_buffer):
19458 * bytecode.c (syms_of_bytecode):
19459 * callint.c (syms_of_callint):
19460 * casefiddle.c (syms_of_casefiddle):
19461 * casetab.c (init_casetab_once):
19462 * category.c (init_category_once, syms_of_category):
19463 * ccl.c (syms_of_ccl):
19464 * cmds.c (syms_of_cmds):
19465 * composite.c (syms_of_composite):
19466 * dbusbind.c (syms_of_dbusbind):
19467 * dired.c (syms_of_dired):
19468 * dispnew.c (syms_of_display):
19469 * doc.c (syms_of_doc):
19470 * editfns.c (syms_of_editfns):
19471 * emacs.c (syms_of_emacs):
19472 * eval.c (syms_of_eval):
19473 * fileio.c (syms_of_fileio):
19474 * fns.c (syms_of_fns):
19475 * frame.c (syms_of_frame):
19476 * fringe.c (syms_of_fringe):
19477 * insdel.c (syms_of_insdel):
19478 * keymap.c (syms_of_keymap):
19479 * lread.c (init_obarray, syms_of_lread):
19480 * macros.c (syms_of_macros):
19481 * msdos.c (syms_of_msdos):
19482 * print.c (syms_of_print):
19483 * process.c (syms_of_process):
19484 * search.c (syms_of_search):
19485 * sound.c (syms_of_sound):
19486 * syntax.c (init_syntax_once, syms_of_syntax):
19487 * terminal.c (syms_of_terminal):
19488 * textprop.c (syms_of_textprop):
19489 * undo.c (syms_of_undo):
19490 * w32.c (globals_of_w32):
19491 * window.c (syms_of_window):
19492 * xdisp.c (syms_of_xdisp):
19493 * xfaces.c (syms_of_xfaces):
19494 * xfns.c (syms_of_xfns):
19495 * xmenu.c (syms_of_xmenu):
19496 * xsettings.c (syms_of_xsettings):
19497 * xterm.c (syms_of_xterm): Use DEFSYM.
19498
4228cf16
TZ
194992011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19500
cd3520a4 19501 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 19502
7fcccf1e
PE
195032011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19504
7efb4e0e
PE
19505 Integer and buffer overflow fixes (Bug#8873).
19506
ff5844ad
PE
19507 * print.c (printchar, strout): Check for string overflow.
19508 (PRINTPREPARE, printchar, strout):
19509 Don't set size unless allocation succeeds.
19510
90532f02
PE
19511 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19512 for sizes. Check for string overflow more accurately.
19513 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19514
6d84508d
PE
19515 * macros.c: Integer and buffer overflow fixes.
19516 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19517 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19518 Use ptrdiff_t, not int, for sizes.
19519 Don't increment bufsize until after realloc succeeds.
19520 Check for size-calculation overflow.
19521 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19522
437b2cb4
PE
19523 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19524
8b9ac8b4
PE
19525 * lread.c: Integer overflow fixes.
19526 (read_integer): Radix is now EMACS_INT, not int,
19527 to improve quality of diagnostics for out-of-range radices.
19528 Calculate buffer size correctly for out-of-range radices.
19529 (read1): Check for integer overflow in radices, and in
19530 read-circle numbers.
82cb60d3
PE
19531 (read_escape): Avoid int overflow.
19532 (Fload, openp, read_buffer_size, read1)
19533 (substitute_object_recurse, read_vector, read_list, map_obarray):
19534 Use ptrdiff_t, not int, for sizes.
19535 (read1): Use EMACS_INT, not int, for sizes.
20270765 19536 Check for size overflow.
8b9ac8b4 19537
7fcccf1e
PE
19538 * image.c (cache_image): Check for size arithmetic overflow.
19539
bfbbd7e7
PE
19540 * lread.c: Integer overflow issues.
19541 (saved_doc_string_size, saved_doc_string_length)
19542 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19543 Now ptrdiff_t, not int.
19544 (read1): Don't assume doc string length fits in int. Check for
19545 out-of-range doc string lengths.
19546 (read_list): Don't assume file position fits in int.
39019e54 19547 (read_escape): Check for hex character overflow.
bfbbd7e7 19548
4e323265
LL
195492011-06-22 Leo Liu <sdl.web@gmail.com>
19550
19551 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19552 Move to minibuffer.el.
19553
85fece3e
PE
195542011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19555
20b84ce9 19556 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
19557 The following patches are for when GLYPH_DEBUG && !XASSERT.
19558 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19559 * dispnew.c (flush_stdout):
19560 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19561 Mark as externally visible.
19562 * dispnew.c (check_window_matrix_pointers): Now static.
19563 * dispnew.c (window_to_frame_vpos):
19564 * xfns.c (unwind_create_frame):
19565 * xterm.c (x_check_font): Remove unused local.
19566 * scroll.c (CHECK_BOUNDS):
19567 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19568 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19569 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19570 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19571 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19572 Now static.
19573 (debug_method_add): Use va_list and vsprintf rather than relying
19574 on undefined behavior with wrong number of arguments.
19575 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19576 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19577 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19578 since we're not interested in debugging glyphs with old libraries.
19579 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19580 GCC 4.6.0's static checking.
19581
0766b489
PE
195822011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19583
31fd4b32
PE
19584 Integer overflow and signedness fixes (Bug#8873).
19585 A few related buffer overrun fixes, too.
19586
b79e8648
PE
19587 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19588
0766b489
PE
19589 * dispextern.h (struct face.stipple):
19590 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19591 (x_bitmap_mask, x_allocate_bitmap_record)
19592 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19593 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19594 (x_create_bitmap_from_xpm_data):
19595 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19596 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19597 (.bitmaps_last):
19598 * xfaces.c (load_pixmap):
19599 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19600 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19601 (.bitmaps_last, struct x_output.icon_bitmap):
19602 Use ptrdiff_t, not int, for bitmap indexes.
19603 (x_allocate_bitmap_record): Check for size overflow.
19604 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19605
b081724f
PE
19606 Use ptrdiff_t, not int, for overlay counts.
19607 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19608 * editfns.c (overlays_around, get_pos_property):
19609 * textprop.c (get_char_property_and_overlay):
19610 * xdisp.c (next_overlay_change, note_mouse_highlight):
19611 * xfaces.c (face_at_buffer_position):
21514da7
PE
19612 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19613 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19614 (Fnext_overlay_change, Fprevious_overlay_change)
19615 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 19616 Use ptrdiff_t, not int, for sizes.
21514da7 19617 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 19618
3de73e5e
PE
19619 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19620
2606c57b
PE
19621 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19622 (x_session_initialize): Do not assume string length fits in int.
19623
aaafe47a
PE
19624 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19625 This is unlikely, but can occur if DPI is outlandish.
19626
2674ddc8 19627 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
19628 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19629
28154962
PE
19630 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19631 * xrdb.c (magic_file_p, search_magic_path):
19632 Omit last arg SUFFIX; it was always 0. All callers changed.
19633 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19634
7de51af5
PE
19635 * xfont.c (xfont_match): Avoid need for strlen.
19636
25ed6cc3
PE
19637 * xfns.c: Don't assume strlen fits in int.
19638 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19639
4eab31dd
PE
19640 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19641 not unsigned long, as we prefer signed integers. All callers changed.
19642 Detect integer overflow in repeat count.
19643 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 19644 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 19645
171e2a58
PE
19646 * termcap.c: Don't assume sizes fit in int and never overflow.
19647 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19648 (gobble_line): Check for size-calculation overflow.
19649
ad39faca 19650 * minibuf.c (Fread_buffer):
6e5bb2dc 19651 * lread.c (intern, intern_c_string):
74ca2eb3
PE
19652 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19653 Don't assume string length fits in int.
19654
52c61c22 19655 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
19656 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19657
b5b8c9e5
PE
19658 * font.c: Don't assume string length fits in int.
19659 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19660 Use ptrdiff_t, not int.
ccd6111c
PE
19661 (font_intern_prop): Don't assume string length fits in int.
19662 Don't assume integer property fits in fixnum.
19663 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 19664
882f0d81 19665 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 19666 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
19667 Reformulate so as not to need the command string.
19668 Invoke gzip -cd rather than gunzip, as it's more portable.
19669 (lock_info_type, lock_file_1, lock_file):
19670 Don't assume pid_t and time_t fit in unsigned long.
19671 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19672 (current_lock_owner): Prefer signed type for sizes.
19673 Use memcpy, not strncpy, where memcpy is what is really wanted.
19674 Don't assume (via atoi) that time_t and pid_t fit in int.
19675 Check for time_t and/or pid_t out of range, e.g., via a network share.
19676 Don't alloca where an auto var works fine.
19677
93f4cf88
PE
19678 * fileio.c: Fix some integer overflow issues.
19679 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19680 Don't assume string length fits in int.
19681 (directory_file_name): Don't assume string length fits in long.
19682 (make_temp_name): Don't assume pid fits in int, or that its print
19683 length is less than 20.
19684
f3e92b69
PE
19685 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19686
1bfdaf10
PE
19687 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19688
35016e9a
PE
19689 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19690
3d1e65a1
PE
19691 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19692 We prefer signed integers, even for size calculations.
19693
0b963a93
PE
19694 * emacs.c: Don't assume string length fits in 'int'.
19695 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19696 (main): Don't invoke strlen when not needed.
19697
573f4b54
PE
19698 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19699 (XD_DEBUG_MESSAGE): Don't waste a byte.
19700
989f33ba
PE
19701 * callproc.c (getenv_internal_1, getenv_internal)
19702 (Fgetenv_internal):
965d34eb
PE
19703 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19704
e4d29b33
PE
19705 * lread.c (invalid_syntax): Omit length argument.
19706 All uses changed. This doesn't fix a bug, but it simplifies the
19707 code away from its former Hollerith-constant appearance, and it's
19708 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 19709 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 19710
eb49b136
PE
19711 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19712 This didn't break anything, but it didn't help either.
19713 It's confusing to put a bogus integer in a place where the actual
19714 value does not matter.
9f62aeb1 19715 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 19716 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 19717
15375a22
PE
19718 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19719 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19720 implementation.
b61cc01c
PE
19721 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19722 We prefer signed types, and the value cannot exceed the EMACS_INT
19723 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
19724 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19725 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19726 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 19727
53b2623d
PE
19728 * indent.c (sane_tab_width): New function.
19729 (current_column, scan_for_column, Findent_to, position_indentation)
19730 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 19731 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 19732
51cab52b 19733 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 19734
f2ed8a70
PE
19735 * lisp.h (lint_assume): New macro.
19736 * composite.c (composition_gstring_put_cache):
19737 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19738
abe80cc6
PE
19739 * editfns.c, insdel.c:
19740 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 19741
b02c740e
PE
19742 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19743
ebc96716
PE
19744 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19745
b4e50fa0 19746 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 19747 Use much-faster test for byte-length change.
311d5d7c 19748 Don't assume string byte-length fits in 'int'.
a4cf38e4 19749 Check that character arg fits in 'int'.
85461888 19750 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 19751
c0c1ee9f
PE
19752 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19753
a498d7f4
PE
19754 * fns.c (concat): Catch string overflow earlier.
19755 Do not rely on integer wraparound.
19756
51cab52b
PE
19757 * dispextern.h (struct it.overlay_strings_charpos)
19758 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
19759 * xdisp.c (forward_to_next_line_start)
19760 (back_to_previous_visible_line_start)
19761 (reseat_at_next_visible_line_start, next_element_from_buffer):
19762 Don't arbitrarily truncate the value of 'selective' to int.
19763
76031fad
PE
19764 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19765
5eb55db9
PE
19766 * composite.c: Don't truncate sizes to 'int'.
19767 (composition_gstring_p, composition_reseat_it)
19768 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
19769 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19770 not EMACS_UINT, for indexes.
5eb55db9 19771
0703a717
PE
19772 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19773
d6202519
PE
19774 * buffer.c: Include <verify.h>.
19775 (struct sortvec.priority, struct sortstr.priority):
8961a454 19776 Now EMACS_INT, not int.
c20998a7 19777 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
19778 (struct sortstr.size, record_overlay_string)
19779 (struct sortstrlist.size, struct sortlist.used):
19780 Don't truncate size to int.
19781 (record_overlay_string): Check for size-calculation overflow.
d6202519 19782 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 19783
d5a19415
JM
197842011-06-22 Jim Meyering <meyering@redhat.com>
19785
029529ac 19786 Don't leak an XBM-image-sized buffer
d5a19415
JM
19787 * image.c (xbm_load): Free the image buffer after using it.
19788
a9041e6c
PE
197892011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19790
19791 Port to Sun C.
19792 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19793 that Sun C diagnosed.
19794 * fns.c (secure_hash): Fix pointer signedness issue.
19795 * intervals.c (static_offset_intervals): New function.
19796 (offset_intervals): Use it.
19797
7f3f739f
LL
197982011-06-21 Leo Liu <sdl.web@gmail.com>
19799
19800 * deps.mk (fns.o):
19801 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19802 sha512.h.
19803
19804 * fns.c (secure_hash): Rename from crypto_hash_function and change
19805 the first arg to accept symbols.
5b66d427 19806 (Fsecure_hash): New primitive.
7f3f739f
LL
19807 (syms_of_fns): New symbols.
19808
76147d94
DD
198092011-06-20 Deniz Dogan <deniz@dogan.se>
19810
19811 * process.c (Fset_process_buffer): Clarify return value in
19812 docstring.
19813
7d7d0045
CY
198142011-06-18 Chong Yidong <cyd@stupidchicken.com>
19815
19816 * dispnew.c (add_window_display_history): Use BVAR.
19817
19818 * xdisp.c (debug_method_add): Use BVAR.
19819 (check_window_end, dump_glyph_matrix, dump_glyph)
19820 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19821
19822 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19823 Likewise.
19824
19825 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19826 check till after the cache is created in init_frame_faces.
19827
ff2bc410
SM
198282011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19829
19830 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19831
28177add
PE
198322011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19833
dd3482fe
PE
19834 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19835 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19836 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19837
393d71f3 19838 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
19839 * fileio.c (Finsert_file_contents):
19840 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19841 Remove the old (too-loose) buffer overflow checks.
19842 They weren't needed, since make_gap checks for buffer overflow.
19843 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19844 The old code merely checked for Emacs fixnum overflow, and relied
19845 on undefined (wraparound) behavior. The new code avoids undefined
19846 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19847
2e6813b0 19848 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
19849 Tune. Don't use wider integers than needed. Don't use alloca.
19850 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 19851
599a9e4f
PE
19852 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19853
99561444
PE
19854 * insdel.c, lisp.h (buffer_overflow): New function.
19855 (insert_from_buffer_1, replace_range, replace_range_2):
19856 * insdel.c (make_gap_larger):
19857 * editfns.c (Finsert_char):
19858 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19859
28177add
PE
19860 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19861
e69dafad
PE
198622011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19863
4baa020d 19864 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 19865
b1c46f02
PE
19866 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19867 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19868
e69dafad
PE
19869 * fileio.c: Don't assume EMACS_INT fits in off_t.
19870 (emacs_lseek): New static function.
19871 (Finsert_file_contents, Fwrite_region): Use it.
19872 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19873
566684ea
PE
19874 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19875
e6966cd6
PE
19876 * fns.c: Don't overflow int when computing a list length.
19877 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19878 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19879 truncation on 64-bit hosts. Check for QUIT every
19880 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19881 faster and is responsive enough.
19882 (Flength): Report an error instead of overflowing an integer.
19883 (Fsafe_length): Return a float if the value is not representable
19884 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19885 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19886 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19887
dd0b0efb
PE
19888 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19889 (header_size, word_size): New constants.
19890 (allocate_vectorlike): Don't check size overflow here.
19891 (allocate_vector): Check it here instead, since this is the only
19892 caller of allocate_vectorlike that could cause overflow.
19893 Check that the new vector's length is representable as a fixnum.
19894
86fe5cfe
PE
19895 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19896 The previous code was bogus. For example, next_almost_prime (32)
19897 returned 39, which is undesirable as it is a multiple of 3; and
19898 next_almost_prime (24) returned 25, which is a multiple of 5 so
19899 why was the code bothering to check for multiples of 7?
19900
80e88859
PE
19901 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19902
4a2f0ad6
PE
19903 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19904
f66c7cf8
PE
19905 Variadic C functions now count arguments with ptrdiff_t.
19906 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19907 Back then I didn't know that the Emacs coding style prefers signed int.
19908 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19909 were being counted with int, which may truncate counts on 64-bit
19910 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19911 * lisp.h (struct Lisp_Subr.function.aMANY)
19912 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19913 Arg counts are now ptrdiff_t, not size_t.
19914 All variadic functions and their callers changed accordingly.
19915 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19916 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19917 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19918 * callint.c (Fcall_interactively): Check arg count for overflow,
19919 to avoid potential buffer overrun. Use signed char, not 'int',
19920 for 'varies' array, so that we needn't bother to check its size
19921 calculation for overflow.
19922 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19923 * eval.c (apply_lambda):
19924 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19925 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19926 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19927
a1759b76
PE
19928 * callint.c (Fcall_interactively): Don't use index var as event count.
19929
d96be9fc
PE
19930 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19931 * mem-limits.h (SIZE): Remove; no longer used.
19932
a690a978 19933 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19934
578c21e6
PE
19935 Remove unnecessary casts.
19936 * xterm.c (x_term_init):
19937 * xfns.c (x_set_border_pixel):
19938 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19939 These aren't needed now that we assume ANSI C.
19940
96f53c6c
PE
19941 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19942 It's more likely to cause problems (due to unsigned overflow)
19943 than to cure them.
19944
83c77d31
PE
19945 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19946
ee2079f1
PE
19947 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19948
6da65536
PE
19949 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19950
7147c4a4
PE
19951 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19952
193e32d9
PE
19953 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19954
e5533da6
PE
19955 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19956
9910e595
PE
19957 GLYPH_CODE_FACE returns EMACS_INT, not int.
19958 * dispextern.h (merge_faces):
19959 * xfaces.c (merge_faces):
01103c44
PE
19960 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19961 Don't assume EMACS_INT fits in int.
9910e595 19962
2638320e
PE
19963 * character.h (CHAR_VALID_P): Remove unused parameter.
19964 * fontset.c, lisp.h, xdisp.c: All uses changed.
19965
045eb8d9
PE
19966 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19967
c1f134b5
PE
19968 * fns.c (concat): Minor tuning based on overflow analysis.
19969 This doesn't fix any bugs. Use int to hold character, instead
19970 of constantly refetching from Emacs object. Use XFASTINT, not
19971 XINT, for value known to be a character. Don't bother comparing
19972 a single byte to 0400, as it's always less.
19973
395fcb93 19974 * floatfns.c (Fexpt):
327eeec8
PE
19975 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19976
abbd3d23
PE
19977 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19978 for characters.
19979
684a03ef
PE
19980 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19981
0fed43f3
PE
19982 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19983 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19984 incorrectly succeed when S was a string, because 4294967386 was
19985 truncated before it was used.
19986
8fd02eb7
PE
19987 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19988 Otherwise, an out-of-range integer could cause undefined behavior
19989 on a 64-bit host.
19990
f8c86b69
PE
19991 * composite.c: Use int, not EMACS_INT, for characters.
19992 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19993 EMACS_INT, for values that are known to be in character range.
19994 This doesn't fix any bugs but is the usual style inside Emacs and
19995 may generate better code on 32-bit machines.
19996
34206dd2
PE
19997 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19998 This is for reasons similar to the recent CHAR_STRING fix.
19999 * charset.c (Fencode_char): Check that character arg is actually
20000 a character. Pass an int to ENCODE_CHAR.
20001 * charset.h (ENCODE_CHAR): Verify that the character argument is no
20002 wider than 'int', as a compile-time check to prevent future regressions
20003 in this area.
20004
c5958d4c 20005 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
20006
20007 Make sure a 64-bit char is never passed to CHAR_STRING.
20008 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
20009 by silently ignoring the top 32 bits, allowing some values
20010 that were far too large to be valid characters.
20011 * character.h: Include <verify.h>.
20012 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
20013 arguments are no wider than unsigned, as a compile-time check
20014 to prevent future regressions in this area.
20015 * data.c (Faset):
01103c44 20016 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
20017 (Fsubst_char_in_region):
20018 * fns.c (concat):
20019 * xdisp.c (decode_mode_spec_coding):
20020 Adjust to CHAR_STRING's new requirement.
20021 * editfns.c (Finsert_char, Fsubst_char_in_region):
20022 * fns.c (concat): Check that character args are actually
20023 characters. Without this test, these functions did the wrong
20024 thing with wildly out-of-range values on 64-bit hosts.
20025
d37ca623
PE
20026 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
20027 These casts should not be needed on 32-bit hosts, either.
20028 * keyboard.c (read_char):
20029 * lread.c (Fload): Remove casts to unsigned.
20030
ea204efb
PE
20031 * lisp.h (UNSIGNED_CMP): New macro.
20032 This fixes comparison bugs on 64-bit hosts.
20033 (ASCII_CHAR_P): Use it.
20034 * casefiddle.c (casify_object):
01103c44 20035 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
20036 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
20037 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
20038 * dispextern.h (FACE_FROM_ID):
20039 * keyboard.c (read_char): Use UNSIGNED_CMP.
20040
41cb286c
PE
20041 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
20042 not to EMACS_INT, to avoid GCC warning.
20043
4a1b9832
PE
20044 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
20045
55daad71
PE
20046 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
20047 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
20048 isn't needed on 32-bit machines.
8f95c75c 20049
01103c44
PE
20050 * buffer.c (Fgenerate_new_buffer_name):
20051 Use EMACS_INT for count, not int.
0ceccced 20052 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
20053
20054 * data.c (Qcompiled_function): Now static.
20055
c6f072e7
PE
20056 * window.c (window_body_lines): Now static.
20057
20ce5912
PE
20058 * image.c (gif_load): Rename local to avoid shadowing.
20059
9c4c5f81
PE
20060 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
20061 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
20062 * alloc.c (make_save_value): Integer argument is now of type
20063 ptrdiff_t, not int.
20064 (mark_object): Use ptrdiff_t, not int.
20065 * lisp.h (pD): New macro.
20066 * print.c (print_object): Use it.
20067
c0c5c8ae
PE
20068 * alloc.c: Use EMACS_INT, not int, to count objects.
20069 (total_conses, total_markers, total_symbols, total_vector_size)
20070 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
20071 (total_free_floats, total_floats, total_free_intervals)
20072 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
20073 Now EMACS_INT, not int. All uses changed.
20074 (Fgarbage_collect): Compute overall total using a double, so that
20075 integer overflow is less likely to be a problem. Check for overflow
20076 when converting back to an integer.
5a25e253
PE
20077 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
20078 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
20079 These were 'int' variables that could overflow on 64-bit hosts;
20080 they were never used, so remove them instead of repairing them.
211a0b2a 20081 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
20082 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
20083 Previously, this ceilinged at INT_MAX, but that doesn't work on
20084 64-bit machines.
e46bb31a 20085 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 20086
c78baabf 20087 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 20088 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
20089 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
20090 when a (possibly-narrower) signed value would do just as well.
20091 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 20092
c9d624c6
PE
20093 * alloc.c: Catch some string size overflows that we were missing.
20094 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
20095 for convenience in STRING_BYTES_MAX.
20096 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
20097 The definition here is exact; the one in lisp.h was approximate.
20098 (allocate_string_data): Check for string overflow. This catches
20099 some instances we weren't catching before. Also, it catches
20100 size_t overflow on (unusual) hosts where SIZE_MAX <= min
20101 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
20102 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 20103
c9d624c6
PE
20104 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
20105 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 20106 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 20107
353032ce
PE
20108 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
20109
2bccce07
PE
20110 * alloc.c (Fmake_string): Check for out-of-range init.
20111
0ac30604
SM
201122011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
20113
20114 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
20115
c195f2de
JD
201162011-06-14 Jan Djärv <jan.h.d@swipnet.se>
20117
20118 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
20119 xg_get_default_scrollbar_width.
20120
20121 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
20122 (int_gtk_range_get_value): Move to the scroll bar part of the file.
20123 (style_changed_cb): Call update_theme_scrollbar_width and call
20124 x_set_scroll_bar_default_width and xg_frame_set_char_size for
20125 all frames (Bug#8505).
20126 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
20127 Call gtk_window_set_resizable if HAVE_GTK3.
20128 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
20129 and height if HAVE_GTK3 (Bug#8505).
20130 (scroll_bar_width_for_theme): New variable.
20131 (update_theme_scrollbar_width): New function.
20132 (xg_get_default_scrollbar_width): Move code to
20133 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
20134 (xg_initialize): Call update_theme_scrollbar_width.
20135
20136 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
20137
20138 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
20139
e10ac9f1
MR
201402011-06-12 Martin Rudalics <rudalics@gmx.at>
20141
20142 * frame.c (make_frame): Call other_buffer_safely instead of
20143 other_buffer.
20144
20145 * window.c (temp_output_buffer_show): Call display_buffer with
20146 second argument Vtemp_buffer_show_specifiers and reset latter
20147 immediately after the call.
20148 (Vtemp_buffer_show_specifiers): New variable.
20149 (auto_window_vscroll_p, next_screen_context_lines)
20150 (Vscroll_preserve_screen_position): Remove leading asterisks from
20151 doc-strings.
20152
2d3c217e 201532011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 20154
7b7f97e8 20155 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
20156 * buffer.c (Qclone_number): Remove for now, as it's unused.
20157 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
20158 (record_buffer): Remove unused local.
20159 * frame.c (other_visible_frames, frame_buffer_list): Now static.
20160 (set_frame_buffer_list): Remove; unused.
20161 * frame.h (other_visible_frames): Remove decl.
20162 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
20163 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
20164 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
20165 if HAVE_GPM.
20166 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
20167 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
20168 Define only if HAVE_GPM.
20169 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
20170 (update_hints_inhibit): Remove; never set. All uses removed.
20171 * widgetprv.h (emacsFrameClassRec): Remove decl.
20172 * window.c (delete_deletable_window): Now returns void, since it
20173 wasn't returning anything.
20174 (compare_window_configurations): Remove unused locals.
20175 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
20176 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
20177 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
20178 the same widths as pointers. This follows up on the 2011-05-06 patch.
20179 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
20180 * xterm.h: Likewise.
20181 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
20182
1384b89e
JB
201832011-06-12 Juanma Barranquero <lekktu@gmail.com>
20184
20185 * makefile.w32-in: Update dependencies.
20186 (LISP_H): Add lib/intprops.h.
20187
1100a63c
CY
201882011-06-11 Chong Yidong <cyd@stupidchicken.com>
20189
20190 * image.c (gif_load): Add animation frame delay to the metadata.
20191 (syms_of_image): Use DEFSYM. New symbol `delay'.
20192
6198ccd0
MR
201932011-06-11 Martin Rudalics <rudalics@gmx.at>
20194
20195 * window.c (delete_deletable_window): Re-add.
20196 (Fset_window_configuration): Rewrite to handle dead buffers and
20197 consequently deletable windows.
20198 (window_tree, Fwindow_tree): Remove. Supply functionality in
20199 window.el.
20200 (compare_window_configurations): Simplify code.
20201
b6e3633c
AS
202022011-06-11 Andreas Schwab <schwab@linux-m68k.org>
20203
1ab0dee5
AS
20204 * image.c (imagemagick_load_image): Fix type mismatch.
20205 (Fimagemagick_types): Likewise.
20206
b6e3633c
AS
20207 * window.h (replace_buffer_in_windows): Declare.
20208
9397e56f
MR
202092011-06-11 Martin Rudalics <rudalics@gmx.at>
20210
20211 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
20212 Qclone_number. Remove external declaration of Qdelete_window.
20213 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
20214 code.
640c8776
SM
20215 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
20216 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
20217 (Fother_buffer): Rewrite doc-string. Major rewrite for new
20218 buffer list implementation.
20219 (other_buffer_safely): New function.
20220 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
20221 calls to replace_buffer_in_windows and
20222 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
20223 if allowed.
20224 (record_buffer): Inhibit quitting and rewrite using quittable
20225 functions. Run Qbuffer_list_update_hook if allowed.
20226 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
20227 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
20228 Move switch-to-buffer to window.el.
9397e56f
MR
20229 (bury-buffer): Move to window.el.
20230 (Vbuffer_list_update_hook): New variable.
20231
20232 * lisp.h (other_buffer_safely): Add prototype in buffer.c
20233 section.
20234
20235 * window.h (resize_frame_windows): Move up in code.
20236 (Fwindow_frame): Remove EXFUN.
20237 (replace_buffer_in_all_windows): Remove prototype.
20238 (replace_buffer_in_windows_safely): Add prototype.
20239
20240 * window.c: Declare Qdelete_window static again. Move down
20241 declaration of select_count.
20242 (Fnext_window, Fprevious_window): Rewrite doc-strings.
20243 (Fother_window): Move to window.el.
20244 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
20245 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
20246 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
20247 window.el.
20248 (replace_buffer_in_windows): Implement by calling
20249 Qreplace_buffer_in_windows.
20250 (replace_buffer_in_all_windows): Remove with some functionality
20251 moved into replace_buffer_in_windows_safely.
20252 (replace_buffer_in_windows_safely): New function.
20253 (select_window_norecord, select_frame_norecord): Move in front
20254 of run_window_configuration_change_hook. Remove now obsolete
20255 declarations.
640c8776
SM
20256 (Fset_window_buffer): Rewrite doc-string.
20257 Call Qrecord_window_buffer.
9397e56f
MR
20258 (keys_of_window): Move binding for other-window to window.el.
20259
b50691aa
CY
202602011-06-11 Chong Yidong <cyd@stupidchicken.com>
20261
20262 * dispextern.h (struct image): Replace data member, whose int_val
20263 and ptr_val fields were not used by anything, with a single
20264 lisp_val object.
20265
20266 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
20267 (gif_clear_image, gif_load, imagemagick_load_image)
20268 (gs_clear_image, gs_load): Callers changed.
20269
3f754b86
PE
202702011-06-10 Paul Eggert <eggert@cs.ucla.edu>
20271
cca69397
PE
20272 * buffer.h: Include <time.h>, for time_t.
20273 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
20274
109e28d0
PE
20275 Fix minor problems found by static checking.
20276
60737f02
PE
20277 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
20278
4b66faf3
PE
20279 Make identifiers static if they are not used in other modules.
20280 * data.c (Qcompiled_function, Qframe, Qvector):
20281 * image.c (QimageMagick, Qsvg):
20282 * minibuf.c (Qmetadata):
20283 * window.c (resize_window_check, resize_root_window): Now static.
20284 * window.h (resize_window_check, resize_root_window): Remove decls.
20285
109e28d0
PE
20286 * window.c (window_deletion_count, delete_deletable_window):
20287 Remove; unused.
46a4ce9e
PE
20288 (window_body_lines): Now static.
20289 (Fdelete_other_windows_internal): Mark vars as initialized.
20290 Make sure 'resize_failed' is initialized.
20291 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20292 (resize_window_apply): Remove unused local.
20293 * window.h (delete_deletable_window): Remove decl.
20294
109e28d0 20295 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
20296 (imagemagick_load_image): Fix pointer signedness problem by changing
20297 last arg from unsigned char * to char *. All uses changed.
20298 Also, fix a local for similar reasons.
20299 Remove unused locals. Remove locals to avoid shadowing.
20300 (fn_rsvg_handle_free): Remove; unused.
20301 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 20302 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 20303
3f754b86
PE
20304 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20305
2547adb1
CY
203062011-06-10 Chong Yidong <cyd@stupidchicken.com>
20307
20308 * image.c (gif_load): Fix omitted cast error introduced by
20309 2011-06-06 change.
20310
2c8e37d4
MR
203112011-06-10 Martin Rudalics <rudalics@gmx.at>
20312
20313 * window.h (resize_proportionally, orig_total_lines)
20314 (orig_top_line): Remove from window structure.
20315 (set_window_height, set_window_width, change_window_heights)
20316 (Fdelete_window): Remove prototypes.
20317 (resize_frame_windows): Remove duplicate declaration.
20318
440a42e3
EZ
203192011-06-10 Eli Zaretskii <eliz@gnu.org>
20320
20321 * window.h (resize_frame_windows, resize_window_check)
20322 (delete_deletable_window, resize_root_window)
20323 (resize_frame_windows): Declare prototypes.
20324
20325 * window.c (resize_window_apply): Make definition be "static" to
20326 match the prototype.
20327
562dd5e9
MR
203282011-06-10 Martin Rudalics <rudalics@gmx.at>
20329
20330 * window.c: Remove declarations of Qwindow_size_fixed,
20331 window_min_size_1, window_min_size_2, window_min_size,
20332 size_window, window_fixed_size_p, enlarge_window, delete_window.
20333 Remove static from declaration of Qdelete_window, it's
20334 temporarily needed by Fbury_buffer.
20335 (replace_window): Don't assign orig_top_line and
20336 orig_total_lines.
20337 (Fdelete_window, delete_window): Remove. Window deletion is
20338 handled by window.el.
640c8776
SM
20339 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20340 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
20341 (Fdelete_other_windows): Remove. Deleting other windows is
20342 handled by window.el.
20343 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20344 handled in window.el.
20345 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20346 Window minimum sizes are handled in window.el.
20347 (shrink_windows, size_window, set_window_height)
20348 (set_window_width, change_window_heights, window_height)
20349 (window_width, CURBEG, CURSIZE, enlarge_window)
20350 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20351 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20352 handled in window.el.
20353 (make_dummy_parent): Rename to make_parent_window and give it a
20354 second argument horflag.
20355 (make_window): Don't set resize_proportionally any more.
20356 (Fsplit_window): Remove. Windows are split in window.el.
20357 (save_restore_action, save_restore_orig_size)
20358 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20359 Resize mini windows in window.el.
20360 (grow_mini_window, shrink_mini_window): Implement by calling
20361 Qresize_root_window_vertically, resize_window_check and
20362 resize_window_apply.
640c8776
SM
20363 (saved_window, Fset_window_configuration, save_window_save):
20364 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
20365 resize_proportionally.
20366 (window_min_height, window_min_width): Move to window.el.
20367 (keys_of_window): Move bindings for delete-other-windows,
20368 split-window, delete-window and enlarge-window to window.el.
20369
20370 * buffer.c: Temporarily extern Qdelete_window.
20371 (Fbury_buffer): Temporarily call Qdelete_window instead of
20372 Fdelete_window (Fbury_buffer will move to window.el soon).
20373
20374 * frame.c (set_menu_bar_lines_1): Remove code handling
20375 orig_top_line and orig_total_lines.
20376
20377 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20378 set_window_height but set heights directly.
20379 (change_frame_size_1): Use resize_frame_windows.
20380
20381 * xdisp.c (init_xdisp): Don't use set_window_height but set
20382 heights directly.
20383
640c8776
SM
20384 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20385 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
20386 run_window_configuration_change_hook.
20387
20388 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20389 instead of change_window_heights and run
20390 run_window_configuration_change_hook.
20391
1a13852e
MR
203922011-06-09 Martin Rudalics <rudalics@gmx.at>
20393
20394 * window.c (replace_window): Rename second argument REPLACEMENT to
20395 NEW. New third argument SETFLAG. Rewrite.
20396 (delete_window, make_dummy_parent): Call replace_window with
20397 third argument 1.
20398 (window_list_1): Move down in code.
20399 (run_window_configuration_change_hook): Move set_buffer part
20400 before select_frame_norecord part in order to unwind correctly.
20401 Rename count1 to count.
20402 (recombine_windows, delete_deletable_window, resize_root_window)
20403 (Fdelete_other_windows_internal)
20404 (Frun_window_configuration_change_hook, make_parent_window)
20405 (resize_window_check, resize_window_apply, Fresize_window_apply)
20406 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
20407 (Fdelete_window_internal, Fresize_mini_window_internal):
20408 New functions.
1a13852e
MR
20409 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20410
f3d1777e
MR
204112011-06-08 Martin Rudalics <rudalics@gmx.at>
20412
496e208e
MR
20413 * window.h (window): Add some new members to window structure -
20414 normal_lines, normal_cols, new_total, new_normal, clone_number,
20415 splits, nest, prev_buffers, next_buffers.
20416 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 20417 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 20418
f3d1777e
MR
20419 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20420 Remove.
496e208e
MR
20421 (make_dummy_parent): Set new members of windows structure.
20422 (make_window): Move down in code. Handle new members of window
20423 structure.
20424 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20425 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20426 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20427 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
20428 (Fset_window_next_buffers, Fset_window_clone_number):
20429 New functions.
496e208e
MR
20430 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20431 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20432 Doc-string fixes.
20433 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20434 Argument WINDOW can be now internal window too.
20435 (Fwindow_use_time): Move up in code.
20436 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20437 Rewrite doc-string.
20438 (Fset_window_configuration, saved_window)
20439 (Fcurrent_window_configuration, save_window_save): Handle new
20440 members of window structure.
b9e809c2
MR
20441 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20442 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20443 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20444 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20445 Qget_mru_window, Qresize_root_window,
20446 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20447 Qauto_buffer_name; staticpro them.
f3d1777e 20448
abde8f8c
MR
204492011-06-07 Martin Rudalics <rudalics@gmx.at>
20450
20451 * window.c (Fwindow_total_size, Fwindow_left_column)
20452 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20453 (Fwindow_list_1): New functions.
20454 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
20455 (Fwindow_width, Fscroll_left, Fscroll_right):
20456 Use window_body_cols instead of window_box_text_cols.
20457 (delete_window, Fset_window_configuration):
20458 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
20459 (delete_all_subwindows): Take a window as argument and not a
20460 structure. Rewrite.
190b47e6
MR
20461 (window_loop): Remove handling of GET_LRU_WINDOW and
20462 GET_LARGEST_WINDOW.
20463 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
20464
20465 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
20466 window_box_text_cols. delete_all_subwindows now takes a
20467 Lisp_Object as argument.
abde8f8c 20468
640c8776
SM
20469 * indent.c (compute_motion, Fcompute_motion):
20470 Use window_body_cols instead of window_box_text_cols.
abde8f8c 20471
fa8a67e6
MR
20472 * frame.c (delete_frame): Call delete_all_subwindows with root
20473 window as argument.
20474
a54e3482
DC
204752011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20476
20477 * fns.c (Fputhash): Document return value.
20478
60002bf5
CY
204792011-06-06 Chong Yidong <cyd@stupidchicken.com>
20480
20481 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20482
0c671da6 204832011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 20484
b862a52a 20485 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 20486
be44ca6c
PE
20487 Check for overflow when converting integer to cons and back.
20488 * charset.c (Fdefine_charset_internal, Fdecode_char):
20489 Use cons_to_unsigned to catch overflow.
20490 (Fencode_char): Use INTEGER_TO_CONS.
20491 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20492 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20493 * data.c (long_to_cons, cons_to_long): Remove.
20494 (cons_to_unsigned, cons_to_signed): New functions.
20495 These signal an error for invalid or out-of-range values.
20496 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20497 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20498 * font.c (Ffont_variation_glyphs):
20499 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20500 * lisp.h: Include <intprops.h>.
20501 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20502 (cons_to_signed, cons_to_unsigned): New decls.
20503 (long_to_cons, cons_to_long): Remove decls.
20504 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20505 (Fprimitive_undo): Use CONS_TO_INTEGER.
20506 * xfns.c (Fx_window_property): Likewise.
20507 * xselect.c: Include <limits.h>.
20508 (x_own_selection, selection_data_to_lisp_data):
20509 Use INTEGER_TO_CONS.
20510 (x_handle_selection_request, x_handle_selection_clear)
20511 (x_get_foreign_selection, Fx_disown_selection_internal)
20512 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20513 (lisp_data_to_selection_data): Use cons_to_unsigned.
20514 (x_fill_property_data): Use cons_to_signed.
20515 Report values out of range.
20516
d1f3d2af
PE
20517 Check for buffer and string overflow more precisely.
20518 * buffer.h (BUF_BYTES_MAX): New macro.
20519 * lisp.h (STRING_BYTES_MAX): New macro.
20520 * alloc.c (Fmake_string):
20521 * character.c (string_escape_byte8):
20522 * coding.c (coding_alloc_by_realloc):
20523 * doprnt.c (doprnt):
20524 * editfns.c (Fformat):
20525 * eval.c (verror):
20526 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20527 since they may not be the same number.
20528 * editfns.c (Finsert_char):
20529 * fileio.c (Finsert_file_contents):
20530 Likewise for BUF_BYTES_MAX.
20531
dd52fcea
PE
20532 * image.c: Use ptrdiff_t, not int, for sizes.
20533 (slurp_file): Switch from int to ptrdiff_t.
20534 All uses changed.
20535 (slurp_file): Check that file size fits in both size_t (for
20536 malloc) and ptrdiff_t (for sanity and safety).
20537
7f9bbdbb
PE
20538 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20539 if b->modtime has its maximal value.
20540
dfe18f82
PE
20541 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20542
84acfcf0
PE
20543 Don't assume time_t can fit into int.
20544 * buffer.h (struct buffer.modtime): Now time_t, not int.
20545 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20546 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20547
ccd9a01a
PE
20548 Minor fixes for signed vs unsigned integers.
20549 * character.h (MAYBE_UNIFY_CHAR):
20550 * charset.c (maybe_unify_char):
20551 * keyboard.c (read_char, reorder_modifiers):
20552 XINT -> XFASTINT, since the integer must be nonnegative.
20553 * ftfont.c (ftfont_spec_pattern):
20554 * keymap.c (access_keymap, silly_event_symbol_error):
20555 XUINT -> XFASTINT, since the integer must be nonnegative.
20556 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20557 since it makes no difference and we prefer signed.
20558 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20559 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20560 nonnegative.
20561
d6d100dd
SM
205622011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20563
20564 * window.h (Fwindow_frame): Declare.
20565
2b6148e4
PE
205662011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20567
20568 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20569 (SPARE_MEMORY): Always define.
20570 (LARGE_REQUEST): Remove.
20571 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20572
f230ecc9
MR
205732011-06-06 Martin Rudalics <rudalics@gmx.at>
20574
727e958e
MR
20575 * lisp.h: Move EXFUNS for Fframe_root_window,
20576 Fframe_first_window and Fset_frame_selected_window to window.h.
20577
20578 * window.h: Move EXFUNS for Fframe_root_window,
20579 Fframe_first_window and Fset_frame_selected_window here from
20580 lisp.h.
20581
20582 * frame.c (Fwindow_frame, Fframe_first_window)
20583 (Fframe_root_window, Fframe_selected_window)
20584 (Fset_frame_selected_window): Move to window.c.
20585 (Factive_minibuffer_window): Move to minibuf.c.
20586 (Fother_visible_frames_p): New function.
20587
20588 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20589
f230ecc9
MR
20590 * window.c (decode_window, decode_any_window): Move up in code.
20591 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20592 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
20593 (Fwindow_buffer): Move up and rewrite doc-string.
20594 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20595 (Fwindow_prev): New functions.
727e958e
MR
20596 (Fwindow_frame): Move here from frame.c. Accept any window as
20597 argument.
20598 (Fframe_root_window, Fframe_first_window)
20599 (Fframe_selected_window): Move here from frame.c. Accept frame
20600 or arbitrary window as argument. Update doc-strings.
20601 (Fminibuffer_window): Move up in code.
20602 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
20603 (Fset_frame_selected_window): Move here from frame.c.
20604 Marginal rewrite.
727e958e
MR
20605 (Fselected_window, select_window, Fselect_window): Move up in
20606 code. Minor doc-string fixes.
f230ecc9 20607
4d09bcf6
PE
206082011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20609
20610 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20611 Do not assume that spare memory exists; that assumption is valid
20612 only if SYSTEM_MALLOC.
20613 (LARGE_REQUEST): New macro, so that the issue of large requests
20614 is separated from the issue of spare memory.
20615
810928a2
AS
206162011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20617
172418ad
AS
20618 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20619 format. (Bug#8806)
20620
43f862f7
AS
20621 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20622
810928a2
AS
20623 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20624 before statements.
20625
a059fe24
JD
206262011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20627
20628 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20629
20630 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20631
20632 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20633 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20634
989bf368
JB
206352011-06-05 Juanma Barranquero <lekktu@gmail.com>
20636
20637 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20638
4b80f674
CY
206392011-06-04 Chong Yidong <cyd@stupidchicken.com>
20640
20641 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20642 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
20643 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20644 New error handlers.
4b80f674
CY
20645 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20646 Obey Vx_select_enable_clipboard_manager. Catch errors in
20647 x_clipboard_manager_save (Bug#8779).
20648 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 20649 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 20650
99a33b77 206512011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
20652
20653 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20654
99a33b77 206552011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
20656
20657 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20658 in the current matrix if keep_current_p is non-zero.
20659
8264569d
EZ
206602011-06-04 Eli Zaretskii <eliz@gnu.org>
20661
20662 * bidi.c (bidi_level_of_next_char): Fix last change.
20663
57f97249
EZ
206642011-06-03 Eli Zaretskii <eliz@gnu.org>
20665
fec2107c 20666 Support bidi reordering of text covered by display properties.
57f97249 20667
fec2107c
EZ
20668 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20669 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20670 (bidi_cache_search, bidi_cache_iterator_state)
20671 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
20672 (bidi_level_of_next_char, bidi_move_to_visually_next):
20673 Support character positions inside a run of characters covered by a
fec2107c
EZ
20674 display string.
20675 (bidi_paragraph_init, bidi_resolve_explicit_1)
20676 (bidi_level_of_next_char): Call bidi_fetch_char and
20677 bidi_fetch_char_advance instead of FETCH_CHAR and
20678 FETCH_CHAR_ADVANCE.
20679 (bidi_init_it): Initialize new members.
20680 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20681 definitions.
20682 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20683 instead of using explicit *_CHAR codes.
d6d100dd
SM
20684 (bidi_resolve_explicit, bidi_resolve_weak):
20685 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
20686 bidirectional text is supported only in multibyte buffers.
20687 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20688 it to initialize the frame_window_p member of struct bidi_it.
20689 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20690 (bidi_resolve_explicit, bidi_resolve_weak)
20691 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20692 bidi_it->nchars is non-positive.
20693 (bidi_level_of_next_char): Don't try to lookup the cache for the
20694 next/previous character if nothing is cached there yet, or if we
20695 were just reseat()'ed to a new position.
c40e2fb2 20696
0e14fe90
EZ
20697 * xdisp.c (set_cursor_from_row): Set start and stop points
20698 according to the row's direction when priming the loop that looks
20699 for the glyph on which to display cursor.
20700 (single_display_spec_intangible_p): Function deleted.
20701 (display_prop_intangible_p): Reimplement to call
20702 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
20703 Accept 3 additional arguments needed by handle_display_spec.
20704 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
20705 values: lists, `(when COND...)' forms, etc.
20706 (single_display_spec_string_p): Support property values that are
20707 lists with the argument STRING its top-level element.
20708 (display_prop_string_p): Fix the condition for processing a
20709 property that is a list to be consistent with handle_display_spec.
fec2107c 20710 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
20711 last portion of handle_display_prop.
20712 (compute_display_string_pos): Accept additional argument
20713 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20714 value of a `display' property is a "replacing spec".
20715 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20716 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20717 the display property, but just return a value indicating whether
20718 the display property will replace the characters it covers.
20719 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20720 frame_window_p members of struct bidi_it.
d6d100dd
SM
20721 (compute_display_string_pos, compute_display_string_end):
20722 New functions.
fec2107c
EZ
20723 (push_it): Accept second argument POSITION, where pop_it should
20724 jump to continue iteration.
20725 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 20726
fec2107c
EZ
20727 * keyboard.c (adjust_point_for_property): Adjust the call to
20728 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
20729
20730 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
20731 (bidi_init_it): Update prototypes.
20732 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
20733 (compute_display_string_pos, compute_display_string_end):
20734 Declare prototypes.
fec2107c
EZ
20735 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20736 EMACS_INT.
fc6f18ce 20737
40087514 207382011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 20739
57f53182
PE
20740 Malloc failure behavior now depends on size of allocation.
20741 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20742 * lisp.h: Change signatures accordingly.
20743 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20744 All callers changed. (Bug#8762)
20745
20746 * gnutls.c: Use Emacs's memory allocators.
20747 Without this change, the gnutls library would invoke malloc etc.
20748 directly, which causes problems on non-SYNC_INPUT hosts, and which
20749 runs afoul of improving memory_full behavior. (Bug#8761)
20750 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20751 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20752 xfree instead of the default malloc, realloc, free.
20753 (Fgnutls_boot): No need to check for memory allocation failure,
20754 since xmalloc does that for us.
20755
ac32cd99 20756 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
20757 * category.c (hash_get_category_set):
20758 * ccl.c (ccl_driver):
20759 * charset.c (Fdefine_charset_internal):
20760 * charset.h (struct charset.hash_index):
20761 * composite.c (get_composition_id, gstring_lookup_cache)
20762 (composition_gstring_put_cache):
20763 * composite.h (struct composition.hash_index):
20764 * dispextern.h (struct image.hash):
20765 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20766 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20767 (hashfn_equal, hashfn_user_defined, make_hash_table)
20768 (maybe_resize_hash_table, hash_lookup, hash_put)
20769 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20770 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20771 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20772 * image.c (make_image, search_image_cache, lookup_image)
20773 (xpm_put_color_table_h):
20774 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 20775 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 20776 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 20777 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
20778 * alloc.c (allocate_vectorlike):
20779 Check for overflow in vector size calculations.
20780 * ccl.c (ccl_driver):
20781 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
20782 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20783 need to be updated by these changes.
40087514
PE
20784 * fns.c (make_hash_table, maybe_resize_hash_table):
20785 Check for integer overflow with large hash tables.
0de4bb68
PE
20786 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20787 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20788 (SXHASH_REDUCE): New macro.
20789 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20790 Use it instead of discarding useful hash info with large hash values.
20791 (sxhash_float): New function.
20792 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20793 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
20794 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20795 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
20796 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20797 Adjust signatures to match updated version of code.
20798 (consing_since_gc): Now EMACS_INT, since a single hash table can
20799 use more than INT_MAX bytes.
20800
698d32e2
DN
208012011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20802
20803 Make it possible to build with GCC-4.6+ -O2 -flto.
20804
20805 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20806
fd6fa53f
SM
208072011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20808
20809 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20810 Call minibuffer-inactive-mode.
20811
864db017
JB
208122011-05-31 Juanma Barranquero <lekktu@gmail.com>
20813
20814 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20815 Update dependencies.
20816
2ad0baf4
DN
208172011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20818
20819 * data.c (init_data): Remove code for UTS, this system is not
20820 supported anymore.
20821
4fcc2638
DN
208222011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20823
20824 Don't force ./temacs to start in terminal mode.
20825
20826 * frame.c (make_initial_frame): Initialize faces in all cases, not
20827 only when CANNOT_DUMP is defined.
20828 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20829
c56e0fd5
DN
208302011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20831
20832 * dispnew.c (add_window_display_history): Use const for the string
20833 pointer. Remove declaration, not needed.
20834
333d54da 208352011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 20836
55d4c1b2 20837 Use 'inline', not 'INLINE'.
333d54da 20838 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
20839 * alloc.c, fontset.c (INLINE): Remove.
20840 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20841 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20842 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20843 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20844 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20845
738db178
DN
208462011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20847
20848 Make it possible to run ./temacs.
20849
20850 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20851 syms_of_callproc does the same thing. Remove test for
20852 "initialized", do it in the caller.
20853 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20854
620c53a6
SM
208552011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20856
20857 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20858 (read_minibuf): Use get_minibuffer.
20859 (syms_of_minibuf): Use DEFSYM.
20860 (Qmetadata): New var.
20861 * data.c (Qbuffer): Don't make it static.
20862 (syms_of_data): Use DEFSYM.
20863
e003a292
PE
208642011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20865
20866 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20867 (CCL_CODE_MIN): New macro.
20868
ed008a6d
PE
208692011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20870
3687c2ef
PE
20871 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20872
ed008a6d
PE
20873 * eval.c (Qdebug): Now static.
20874 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20875 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20876 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20877
d66c4c7c
CY
208782011-05-29 Chong Yidong <cyd@stupidchicken.com>
20879
20880 * image.c: Various fixes to ImageMagick code comments.
20881 (Fimagemagick_types): Doc fix.
20882
5fbc2025
PE
208832011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20884
0196f88a
PE
20885 Minor fixes prompted by GCC 4.6.0 warnings.
20886
20887 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20888
5fbc2025
PE
20889 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20890 (x_clipboard_manager_save_all): Move extern decl to ...
20891 * xterm.h: ... here, so that it can be checked for consistency.
20892
1dd3c2d9
CY
208932011-05-29 Chong Yidong <cyd@stupidchicken.com>
20894
20895 * xselect.c (x_clipboard_manager_save_frame)
20896 (x_clipboard_manager_save_all): New functions.
20897 (Fx_clipboard_manager_save): Lisp function deleted.
20898
20899 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20900 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20901
20902 * xterm.h: Update prototype.
20903
5ba6571d
WX
209042011-05-28 William Xu <william.xwl@gmail.com>
20905
20906 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20907 exiting (Bug#8239).
20908
3eaff834
JM
209092011-05-28 Jim Meyering <meyering@redhat.com>
20910
e1900994 20911 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20912 * fns.c (to_uchar): Define.
20913 (crypto_hash_function): Use it to convert some newly-signed
20914 variables to unsigned, to avoid sign-extension bugs. For example,
20915 without this change, (md5 "truc") would evaluate to
20916 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20917 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20918 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20919
0f6990a7
PE
209202011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20921
20922 Integer overflow fixes.
c8a9ca5a 20923
08686060
PE
20924 * dbusbind.c: Serial number integer overflow fixes.
20925 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20926 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20927 to hold a serial number that is too large for a fixnum.
20928 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20929 Check for serial numbers out of range. Decode any serial number
59568bf0 20930 that was so large that it became a float. (Bug#8722)
08686060 20931
2d1fc3c7
PE
20932 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20933 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20934 Use XFASTINT rather than XUINT when numbers are nonnegative.
20935 (xd_append_arg, Fdbus_method_return_internal):
20936 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20937 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20938 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20939 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20940 (Bug#8722)
2d1fc3c7 20941
c8a9ca5a
PE
20942 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20943
519e1d69
PE
20944 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20945
6df6ae42 20946 ccl: Add integer overflow checks.
30569699
PE
20947 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20948 (IN_INT_RANGE): New macros.
20949 (ccl_driver): Use them to check for integer overflow when
20950 decoding a CCL program. Many of the new checks are whether XINT (x)
20951 fits in int; it doesn't always, on 64-bit hosts. The new version
20952 doesn't catch all possible integer overflows, but it's an
847044ea 20953 improvement. (Bug#8719)
30569699 20954
c11285dc
PE
20955 * alloc.c (make_event_array): Use XINT, not XUINT.
20956 There's no need for unsigned here.
20957
fdccd48e
PE
20958 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20959 This follows up to the 2011-05-06 change that substituted uintptr_t
20960 for EMACS_INT. This case wasn't caught back then.
20961
37910ab2
PE
20962 Rework Fformat to avoid integer overflow issues.
20963 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20964 now (part of C89). Include <verify.h>.
20965 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20966 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20967 (Fformat): Avoid the prepass trying to compute sizes; it was only
20968 approximate and thus did not catch overflow reliably. Instead, walk
20969 through the format just once, formatting and computing sizes as we go,
20970 checking for integer overflow at every step, and allocating a larger
20971 buffer as needed. Keep track separately whether the format is
20972 multibyte. Keep only the most-recently calculated precision, rather
20973 than them all. Record whether each argument has been converted to
20974 string. Use EMACS_INT, not int, for byte and char and arg counts.
20975 Support field widths and precisions larger than INT_MAX. Avoid
20976 sprintf's undefined behavior with conversion specifications such as %#d
20977 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20978 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20979 formatting out-of-range floating point numbers with int
9173deec 20980 formats. (Bug#8668)
37910ab2 20981
2e6578fb
PE
20982 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20983
0ae6bdee
PE
20984 * data.c: Avoid integer truncation in expressions involving floats.
20985 * data.c: Include <intprops.h>.
20986 (arith_driver): When there's an integer overflow in an expression
20987 involving floating point, convert the integers to floating point
20988 so that the resulting value does not suffer from catastrophic
20989 integer truncation. For example, on a 64-bit host (* 4
20990 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20991 Do not rely on undefined behavior after integer overflow.
20992
de883a70
PE
20993 merge count_size_as_multibyte, parse_str_to_multibyte
20994 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20995 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20996 Check for integer overflow.
20997 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20998 since it's now a duplicate of the other. This is more of
20999 a character than a buffer op, so better that it's in character.c.
21000 * fns.c, print.c: Adjust to above changes.
21001
2ff916cb
PE
210022011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
21003
21004 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
21005
f1b54466
PE
210062011-05-27 Paul Eggert <eggert@cs.ucla.edu>
21007
fb1ac845
PE
21008 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21009 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
21010 (x_clipboard_manager_save): Now static.
21011 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
21012
f1b54466
PE
21013 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
21014 (crypto_hash_function): Now static.
21015 Fix pointer signedness problems. Avoid unnecessary initializations.
21016
a9f737ee
CY
210172011-05-27 Chong Yidong <cyd@stupidchicken.com>
21018
21019 * termhooks.h (Vselection_alist): Make it terminal-local.
21020
21021 * terminal.c (create_terminal): Initialize it.
21022
21023 * xselect.c: Support for clipboard managers.
21024 (Vselection_alist): Move to termhooks.h as terminal-local var.
21025 (LOCAL_SELECTION): New macro.
21026 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
21027 (symbol_to_x_atom): Remove gratuitous arg.
21028 (x_handle_selection_request, lisp_data_to_selection_data)
21029 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
21030 (x_own_selection, x_get_local_selection, x_convert_selection):
21031 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
21032 (some_frame_on_display): Delete unused function.
21033 (Fx_own_selection_internal, Fx_get_selection_internal)
21034 (Fx_disown_selection_internal, Fx_selection_owner_p)
21035 (Fx_selection_exists_p): New optional frame arg.
21036 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
21037 (x_handle_selection_clear): Don't treat other terminals with the
21038 same keyboard specially. Use the terminal-local Vselection_alist.
21039 (x_clear_frame_selections): Use Frun_hook_with_args.
21040
21041 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
21042
21043 * xterm.h: Add support for those atoms.
21044
e067f0c1
CY
210452011-05-26 Chong Yidong <cyd@stupidchicken.com>
21046
21047 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
21048 (converted_selections, conversion_fail_tag): New global variables.
21049 (x_selection_request_lisp_error): Free the above.
21050 (x_get_local_selection): Remove unnecessary code.
21051 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
21052 of converted selections stored in converted_selections.
21053 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
21054 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
21055 (x_convert_selection): New function.
21056 (x_handle_selection_event): Simplify.
21057 (x_get_foreign_selection): Don't ignore incoming requests while
21058 waiting for an answer; this will fail when we implement
21059 SAVE_TARGETS, and seems unnecessary anyway.
21060 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
21061 (Vx_sent_selection_functions): Doc fix.
21062
0f4aebc0
LL
210632011-05-26 Leo Liu <sdl.web@gmail.com>
21064
21065 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
21066
e61124cd
YM
210672011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21068
21069 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
21070
21071 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
21072 for fringe update if it has periodic bitmap.
ac389d0c 21073 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
21074 and fringe_bitmap_periodic_p.
21075
21076 * fringe.c (get_fringe_bitmap_data): New function.
21077 (draw_fringe_bitmap_1, update_window_fringes): Use it.
21078 (update_window_fringes): Record periodicity of fringe bitmap in glyph
21079 row. Mark glyph row for fringe update if periodicity changed.
21080
21081 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
21082 for fringe update unless it has periodic bitmap.
21083
f16d9837
KH
210842011-05-25 Kenichi Handa <handa@m17n.org>
21085
21086 * xdisp.c (get_next_display_element): Set correct it->face_id for
21087 a static composition.
21088
e1b90ef6
LL
210892011-05-24 Leo Liu <sdl.web@gmail.com>
21090
21091 * deps.mk (fns.o):
21092 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
21093
21094 * fns.c (crypto_hash_function, Fsha1): New function.
21095 (Fmd5): Use crypto_hash_function.
21096 (syms_of_fns): Add Ssha1.
21097
7400048f
PE
210982011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21099
21100 * gnutls.c: Remove unused macros.
21101 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
21102 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
21103 Remove macros that are defined and never used.
21104 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
21105
abb71cf4
CY
211062011-05-22 Chong Yidong <cyd@stupidchicken.com>
21107
21108 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
21109 (Fx_get_selection_internal): Minor cleanup.
21110 (Fx_own_selection_internal): Rename arguments for consistency with
21111 select.el.
21112
6307db39
PE
211132011-05-22 Paul Eggert <eggert@cs.ucla.edu>
21114
21115 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
21116
f3d4e0a4
CY
211172011-05-22 Chong Yidong <cyd@stupidchicken.com>
21118
21119 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
21120
4d8ade89
YM
211212011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21122
21123 * dispnew.c (scrolling_window): Don't exclude the case that the
21124 last enabled row in the desired matrix touches the bottom boundary.
21125
32078c8d
GM
211262011-05-21 Glenn Morris <rgm@gnu.org>
21127
21128 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
21129 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
21130 and add some more files.
32078c8d 21131
7285dc67
EZ
211322011-05-20 Eli Zaretskii <eliz@gnu.org>
21133
21134 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
21135 report_file_error introduced by the change from 2011-05-07.
21136
89d1bd22
PE
211372011-05-20 Paul Eggert <eggert@cs.ucla.edu>
21138
21139 * systime.h (Time): Define only if emacs is defined.
21140 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
21141 where the include path doesn't have X11/X.h by default. See
21142 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
21143
cd394be1 211442011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
21145
21146 * composite.c (find_automatic_composition): Fix previous change.
21147
b9704ad9
GM
211482011-05-20 Glenn Morris <rgm@gnu.org>
21149
21150 * lisp.mk: New file, split from Makefile.in.
21151 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
21152 (shortlisp): Remove.
21153 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
21154
4a720484
GM
211552011-05-19 Glenn Morris <rgm@gnu.org>
21156
21157 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
21158 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
21159 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
21160 (lisp): Set the order to that of loadup.el.
21161 (shortlisp): Make it a copy of $lisp.
21162 (SOME_MACHINE_LISP): Remove.
21163 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
21164 Use just $shortlisp, not $SOME_MACHINE_LISP too.
21165
a28d4396
KH
211662011-05-18 Kenichi Handa <handa@m17n.org>
21167
21168 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
21169 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
21170 (find_automatic_composition): Mostly rewrite for efficiency.
21171
a2b1fa8e
JB
211722011-05-18 Juanma Barranquero <lekktu@gmail.com>
21173
21174 * makefile.w32-in: Update dependencies.
21175
8e1f5610
CS
211762011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
21177
21178 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 21179 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 21180
7025ee00 211812011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 21182
cdfa6eab
PE
21183 Fix some integer overflow issues, such as string length overflow.
21184
06d6db33
PE
21185 * insdel.c (count_size_as_multibyte): Check for string overflow.
21186
2b4560a8
PE
21187 * character.c (lisp_string_width): Check for string overflow.
21188 Use EMACS_INT, not int, for string indexes and lengths; in
21189 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
21190 the resulting string length overflows an EMACS_INT; instead,
21191 report a string overflow if no precision given. When checking for
21192 precision exhaustion, use a check that cannot possibly have
21193 integer overflow. (Bug#8675)
21194 * character.h (lisp_string_width): Adjust to new signature.
21195
cb93f9be
PE
21196 * alloc.c (string_overflow): New function.
21197 (Fmake_string): Use it. This doesn't change behavior, but saves
21198 a few bytes and will simplify future changes.
21199 * character.c (string_escape_byte8): Likewise.
21200 * lisp.h (string_overflow): New decl.
21201
1a1f3366
PE
21202 Fixups, following up to the user-interface timestamp change.
21203 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
21204 for UI timestamps, instead of unsigned long.
9fbd6841
PE
21205 * msdos.c (mouse_get_pos): Likewise.
21206 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
21207 * w32gui.h (Time): Define by including "systime.h" rather than by
21208 declaring it ourselves. (Bug#8664)
21209
d4e3e4d3
PE
21210 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
21211 * image.c (clear_image_cache): Likewise.
21212
f6a24d19
PE
21213 * term.c (term_mouse_position): Don't assume time_t wraparound.
21214
08dc5ae6
PE
21215 Be more systematic about user-interface timestamps.
21216 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
21217 and sometimes 'EMACS_UINT', to represent these timestamps.
21218 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
21219 This makes the code easier to follow, and makes it easier to catch
21220 integer overflow bugs such as Bug#8664.
21221 * frame.c (Fmouse_position, Fmouse_pixel_position):
21222 Use Time, not unsigned long, for user-interface timestamps.
21223 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
21224 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
21225 * keyboard.h (last_event_timestamp): Likewise.
21226 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
21227 * menu.h (xmenu_show): Likewise.
21228 * term.c (term_mouse_position): Likewise.
21229 * termhooks.h (struct input_event.timestamp): Likewise.
21230 (struct terminal.mouse_position_hook): Likewise.
21231 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
21232 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
21233 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
21234 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
21235 what it was before.
21236 * menu.h, termhooks.h: Include "systime.h", for Time.
21237
8e55734a
PE
21238 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
21239 Don't assume that the difference between two unsigned long values
21240 can fit into an integer. At this point, we know button_down_time
21241 <= event->timestamp, so the difference must be nonnegative, so
21242 there's no need to cast the result if double-click-time is
21243 nonnegative, as it should be; check that it's nonnegative, just in
21244 case. This bug is triggered when events are more than 2**31 ms
86db42d2 21245 apart (about 25 days). (Bug#8664)
8e55734a 21246
841f1b75 21247 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 21248 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 21249
3e26f69c
PE
21250 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
21251 that always fit in int. Use a sentinel instead of a counter, to
21252 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
21253 * frame.h (struct frame): Use int for menu_bar_items_used
21254 instead of EMACS_INT, since it always fits in int.
3e26f69c 21255
5cc152c0
PE
21256 * menu.c (grow_menu_items): Check for int overflow.
21257
d89eb65e
PE
21258 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
21259
5235bd3e
PE
21260 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
21261 Before, the code was not consistent. These values cannot exceed
21262 2**31 - 1 so there's no need to make them unsigned.
21263 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
21264 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
21265 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
21266 as modifiers.
21267 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
21268
bc827e23
PE
21269 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
21270 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
21271 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
21272 presumably because the widths might not match.
21273
78eb494e
PE
21274 * window.c (size_window): Avoid needless test at loop start.
21275
04f2d78b
CB
212762011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
21277
21278 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
21279
d2fc7e3d 212802011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
21281
21282 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21283
d2fc7e3d 212842011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
21285
21286 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21287 `width' to `bar_area_x' and `bar_area_width', respectively.
21288 (x_scroll_run): Take account of fringe background extension.
21289
04f2d78b
CB
21290 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21291 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
21292 `bar_area_width', respectively.
21293 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21294 background extension.
21295
79b70037
GM
212962011-05-10 Jim Meyering <meyering@redhat.com>
21297
21298 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21299
2f142cc5
JB
213002011-05-10 Juanma Barranquero <lekktu@gmail.com>
21301
21302 * image.c (Finit_image_library): Return t for built-in image types,
21303 like pbm and xbm. (Bug#8640)
21304
57679c86
AS
213052011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21306
21307 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21308
888c9e86
EZ
213092011-05-07 Eli Zaretskii <eliz@gnu.org>
21310
b0512a1d
EZ
21311 * w32console.c (Fset_screen_color): Doc fix.
21312 (Fget_screen_color): New function.
21313 (syms_of_ntterm): Defsubr it.
21314
7285dc67
EZ
21315 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21316 unlink the temporary file if Fcall_process didn't create it in the
21317 first place.
21318 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21319 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
21320 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21321 cue to call_process_cleanup not to close that handle.
21322
4d3fcc8e
BK
213232011-05-07 Ben Key <bkey76@gmail.com>
21324
21325 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21326 one of two shell specific rules, either bootstrap-temacs-CMD or
21327 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21328 to the previous implementation of the bootstrap-temacs rule.
21329 The bootstrap-temacs-CMD rule is similar to the previous
21330 implementation of the bootstrap-temacs rule except that it
21331 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21332 variable.
21333
21334 These changes, along with some changes to nt/configure.bat,
21335 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21336 earlier fix to add support for --cflags and --ldflags options
21337 that include quotes so that it works whether make uses cmd or
21338 sh as the shell.
21339
b4289b64
MA
213402011-05-06 Michael Albinus <michael.albinus@gmx.de>
21341
21342 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21343 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21344 is a constant.
21345 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21346 a string. Handle both cases.
21347 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21348 (Fdbus_register_method): Use Qinvalid_function.
21349
af4c0e28
JB
213502011-05-06 Juanma Barranquero <lekktu@gmail.com>
21351
21352 * makefile.w32-in: Update dependencies.
21353 (LISP_H): Add inttypes.h and stdin.h.
21354 (PROCESS_H): Add unistd.h.
21355
c51453d9
EZ
213562011-05-06 Eli Zaretskii <eliz@gnu.org>
21357
21358 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21359 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21360
8ff0ac3c 213612011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 21362
4c4b566b
PE
21363 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21364
aab2b9b5
PE
21365 * term.c (vfatal): Remove stray call to va_end.
21366 It's not needed and the C Standard doesn't allow it here anyway.
21367
c378da0b
PE
21368 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21369 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21370
288b08c7
PE
21371 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21372 bytes.
21373
e3601888
PE
21374 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21375
db6c0e74
PE
21376 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21377
dd5963ea
PE
21378 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21379
88c9450f
PE
21380 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21381
2f9442b8
PE
21382 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21383
c032b5f8
PE
21384 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21385 * charset.c (Fdefine_charset_internal): Don't initialize
21386 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 21387 32-bit int (Bug#8600).
a108c10b
PE
21388
21389 * lread.c (read_integer): Be more consistent with string-to-number.
21390 Use string_to_number to do the actual conversion; this avoids
21391 rounding errors and fixes some other screwups. Without this fix,
21392 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21393 (digit_to_number): Move earlier, for benefit of read_integer.
21394 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 21395 not a digit in any supported base. (Bug#8602)
a108c10b 21396
ad5f9eea
PE
21397 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21398
aec1708a
PE
21399 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21400 to match comment at start of function. This also removes a
21401 GCC warning about overflow in a 32+64-bit port.
21402
47be4ab5
PE
21403 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21404
371cac43
PE
21405 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21406 Reported by Stefan Monnier in
21407 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
21408 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21409 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 21410
d01a7826
PE
21411 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21412 (EMACS_UINTPTR): Likewise, with uintptr_t.
21413
7fd47d5c
PE
21414 * lisp.h: Prefer 64-bit EMACS_INT if available.
21415 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21416 on 32-bit hosts that have 64-bit int, so that they can access
21417 large files.
122b0c86
PE
21418 However, temporarily disable this change unless the temporary
21419 symbol WIDE_EMACS_INT is defined.
7fd47d5c 21420
8727937b
PE
21421 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21422
8ac068ac
PE
21423 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21424 This removes an assumption that EMACS_INT and long are the same
21425 width as pointers. The assumption is true for Emacs porting targets
21426 now, but we want to make other targets possible.
21427 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21428 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21429 In the rest of the code, change types of integers that hold casted
21430 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21431 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21432 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21433 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21434 No need to cast type when ORing.
21435 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21436 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21437 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21438 assume EMACS_INT is the same width as char *.
21439 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21440 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21441 Remove no-longer-needed casts.
21442 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21443 (xg_tool_bar_help_callback, xg_make_tool_item):
21444 Use EMACS_INTPTR to hold an integer
21445 that will be cast to void *; this can avoid a GCC warning
21446 if EMACS_INT is not the same width as void *.
21447 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21448 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21449 (current_message_1, set_message_1):
21450 Use a local to convert to proper width without a cast.
21451 * xmenu.c (dialog_selection_callback): Likewise.
21452
ede49d71
PE
21453 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21454 Also, don't assume VALBITS / RAND_BITS is less than 5,
21455 and don't rely on undefined behavior when shifting a 1 left into
21456 the sign bit.
21457 * lisp.h (get_random): Change signature to match.
21458
2f30ecd0
PE
21459 * lread.c (hash_string): Use size_t, not int, for hash computation.
21460 Normally we prefer signed values; but hashing is special, because
21461 it's better to use unsigned division on hash table sizes so that
21462 the remainder is nonnegative. Also, size_t is the natural width
21463 for hashing into memory. The previous code used 'int', which doesn't
21464 retain enough info to hash well into very large tables.
21465 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21466
2a866e7b
PE
21467 * dbusbind.c: Don't possibly lose pointer info when converting.
21468 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21469 Use XPNTR rather than XHASH, so that the high-order bits of
21470 the pointer aren't lost when converting through void *.
21471
51639eac
PE
21472 * eval.c (Fautoload): Don't double-shift a pointer.
21473
92394119
PE
21474 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21475
dbdb9a7c
JB
214762011-05-06 Juanma Barranquero <lekktu@gmail.com>
21477
21478 * gnutls.c (DEF_GNUTLS_FN):
21479 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21480
db7a0b4f
AS
214812011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21482
21483 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21484 marker. (Bug#8610)
21485
cd394be1 214862011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
21487
21488 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21489 New version that can reserve upto 2GB of heap space.
21490
f7ff1b0f 214912011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
21492
21493 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21494
639c109b
TZ
214952011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21496
21497 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21498 `gnutls_certificate_set_x509_key_file'.
21499
d2127135
JB
215002011-05-05 Juanma Barranquero <lekktu@gmail.com>
21501
21502 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21503 Update dependencies.
21504
e968f4f3
JB
215052011-05-04 Juanma Barranquero <lekktu@gmail.com>
21506
21507 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21508 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21509 Remove unused parameter `fildes'.
21510 * process.c (read_process_output, send_process): Don't pass it.
21511
84d358f0
JB
215122011-05-04 Juanma Barranquero <lekktu@gmail.com>
21513
21514 Fix previous change: the library cache is defined in w32.c.
21515 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21516 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21517
0898ca10
JB
215182011-05-04 Juanma Barranquero <lekktu@gmail.com>
21519
21520 Implement dynamic loading of GnuTLS on Windows.
21521
21522 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21523 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21524 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21525 Declare.
21526
21527 * gnutls.c (Qgnutls_dll): Define.
21528 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21529 (gnutls_*): Declare function pointers.
21530 (init_gnutls_functions): New function to initialize function pointers.
21531 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21532 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21533 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21534 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21535 (emacs_gnutls_write, emacs_gnutls_read)
21536 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21537 (Fgnutls_available_p): New function.
21538 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21539 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21540 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21541
21542 * image.c: Include w32.h.
21543 (Vimage_type_cache): Delete.
21544 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21545 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21546 (w32_delayed_load): Move to w32.c.
21547
21548 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21549
21550 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21551 (w32_delayed_load): Move from image.c. When loading a library, record
21552 its filename in the :loaded-from property of the library id.
21553 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21554 Initialize and staticpro them.
21555 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21556
21557 * process.c: Include lisp.h before w32.h, not after.
21558 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21559 instead of gnutls_record_check_pending.
21560
21561 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21562
ff4de4aa
TZ
215632011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21564
21565 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21566 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21567 as passed in.
21568
abe95abb
JD
215692011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21570
21571 * xterm.c (x_set_frame_alpha): Do not set property on anything
21572 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21573
e16e55d4
JB
215742011-05-02 Juanma Barranquero <lekktu@gmail.com>
21575
21576 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21577
bafcf6a5
JB
215782011-05-02 Juanma Barranquero <lekktu@gmail.com>
21579
21580 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21581 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21582 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21583 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21584 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21585 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21586 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21587 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21588 (Qgnutls_bootprop_callbacks_verify): Make static.
21589
e7a6747f
AS
215902011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21591
19ed11ba
AS
21592 * callproc.c: Indentation fixup.
21593
e7a6747f 21594 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
21595 (wait_for_termination, interruptible_wait_for_termination):
21596 Move after wait_for_termination_1.
e7a6747f 21597
1ef14cb4
LMI
215982011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21599
21600 * sysdep.c (interruptible_wait_for_termination): New function
21601 which is like wait_for_termination, but allows keyboard
21602 interruptions.
21603
21604 * callproc.c (Fcall_process): Add (:file "file") as an option for
21605 the STDOUT buffer.
21606 (Fcall_process_region): Ditto.
21607
330d880c
EZ
216082011-04-30 Eli Zaretskii <eliz@gnu.org>
21609
8db90b73
EZ
21610 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21611 rather than `XVECTOR (FOO)->size'.
21612
330d880c
EZ
21613 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21614 inttypes.h, as a gnulib replacement is used if it not available in
21615 system headers.
21616
15cbd324
EZ
216172011-04-21 Eli Zaretskii <eliz@gnu.org>
21618
21619 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21620 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21621 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21622
21623 * coding.c (coding_alloc_by_realloc): Error out if destination
21624 will grow beyond MOST_POSITIVE_FIXNUM.
21625 (decode_coding_emacs_mule): Abort if there isn't enough place in
21626 charbuf for the composition carryover bytes. Reserve an extra
21627 space for up to 2 characters produced in a loop.
21628 (decode_coding_iso_2022): Abort if there isn't enough place in
21629 charbuf for the composition carryover bytes.
21630
216312011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 21632
ae940cca
EZ
21633 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21634 aborting when %lld or %lll format is passed.
21635 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21636 %llo or %llx format is passed. (Bug#8545)
21637
03ab8921
EZ
21638 * window.c (window_scroll_line_based): Use a marker instead of
21639 simple variables to record original value of point. (Bug#7952)
21640
afda1437
EZ
21641 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21642 produced by %s or %c overflows available buffer space. (Bug#8545)
21643
f76dee0c
PE
216442011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21645
21646 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 21647 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 21648
fdc5744d
JB
216492011-04-28 Juanma Barranquero <lekktu@gmail.com>
21650
21651 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21652
638f053a
JB
216532011-04-28 Juanma Barranquero <lekktu@gmail.com>
21654
21655 * keyboard.c (Qdelayed_warnings_hook): Define.
21656 (command_loop_1): Run `delayed-warnings-hook'
21657 if Vdelayed_warnings_list is non-nil.
21658 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21659 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21660
d178f871
EZ
216612011-04-28 Eli Zaretskii <eliz@gnu.org>
21662
21663 * doprnt.c (doprnt): Don't return value smaller than the buffer
21664 size if the message was truncated. (Bug#8545).
21665
b124fd93
JB
216662011-04-28 Juanma Barranquero <lekktu@gmail.com>
21667
21668 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21669 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21670
e810457d
PE
216712011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21672
21673 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21674
ea51cceb
JB
216752011-04-27 Juanma Barranquero <lekktu@gmail.com>
21676
21677 * makefile.w32-in: Update dependencies.
21678
94dcfacf
EZ
216792011-04-27 Eli Zaretskii <eliz@gnu.org>
21680
21681 Improve `doprnt' and its usage. (Bug#8545)
21682 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21683 `format_end'. Remove support for %l as a conversion specifier.
21684 Don't use xrealloc. Improve diagnostics when the %l size modifier
21685 is used. Update the commentary.
21686
21687 * eval.c (verror): Simplify calculation of size_t.
21688
21689 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21690 messages.
21691
f61f41d7
PE
216922011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21693
21694 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21695 change.
21696
96fb4434
PE
216972011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21698
21699 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21700 This makes this file independent of the recent pseudovector change.
21701
671875da 217022011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 21703
69e9b5a3
PE
21704 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21705
b5f869a7 21706 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 21707 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 21708 Remove unused local.
c8926152 21709 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 21710
841a1577 21711 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
21712 GCC 4.6.0 optimizes based on type-based alias analysis.
21713 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
21714 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21715 != &v->size, and therefore "v->size = 1; b->size = 2; return
21716 v->size;" must therefore return 1. This assumption is incorrect
21717 for Emacs, since it type-puns struct Lisp_Vector * with many other
21718 types. To fix this problem, this patch adds a new type struct
f904488f 21719 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
21720 and pseudovectors, and helps optimizing compilers not get fooled
21721 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21722 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
21723 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21724 the size member.
eab3844f
PE
21725 (XSETPVECTYPE): Rewrite in terms of new macro.
21726 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21727 This is a bit clearer, and further avoids the possibility of
21728 undesirable aliasing.
21729 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 21730 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
21731 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21732 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
21733 (ASIZE): Now uses header.size rather than size.
21734 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
21735 to avoid the hassle of writing XVECTOR (foo)->header.size.
21736 (struct vectorlike_header): New type.
eab3844f
PE
21737 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21738 object, to help avoid aliasing.
21739 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21740 (SUBRP): Likewise, since Lisp_Subr is a special case.
21741 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21742 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21743 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 21744 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
21745 changed to be "header.size" and "header.next".
21746 * buffer.h (struct buffer): Likewise.
21747 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21748 * frame.h (struct frame): Likewise.
21749 * process.h (struct Lisp_Process): Likewise.
21750 * termhooks.h (struct terminal): Likewise.
21751 * window.c (struct save_window_data, struct saved_window): Likewise.
21752 * window.h (struct window): Likewise.
21753 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21754 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21755 * buffer.c (init_buffer_once): Likewise.
21756 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21757 special case.
21758 * process.c (Fformat_network_address): Use local var for size,
21759 for brevity.
21760
0df1eac5
PE
21761 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21762
847ab9d1 21763 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
21764 * data.c (atof): Remove decl; no longer used or needed.
21765 (digit_to_number): Move to lread.c.
21766 (Fstring_to_number): Use new string_to_number function, to be
21767 consistent with how the Lisp reader treats infinities and NaNs.
21768 Do not assume that floating-point numbers represent EMACS_INT
21769 without losing information; this is not true on most 64-bit hosts.
21770 Avoid double-rounding errors, by insisting on integers when
21771 parsing non-base-10 numbers, as the documentation specifies.
21772 * lisp.h (string_to_number): New decl, replacing ...
21773 (isfloat_string): Remove.
bc0a5c13 21774 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 21775 (read1): Do not accept +. and -. as integers; this
452f4150
PE
21776 appears to have been a coding error. Similarly, do not accept
21777 strings like +-1e0 as floating point numbers. Do not report
21778 overflow for integer overflows unless the base is not 10 which
21779 means we have no simple and reliable way to continue.
21780 Break out the floating-point parsing into a new
21781 function string_to_number, so that Fstring_to_number parses
21782 floating point numbers consistently with the Lisp reader.
04f2d78b 21783 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
21784 (E_CHAR, EXP_INT): Remove, replacing with ...
21785 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21786 (string_to_number): New function, replacing isfloat_string.
21787 This function checks for valid syntax and produces the resulting
21788 Lisp float number too. Rework it so that string-to-number
bc0a5c13 21789 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
21790 so that overflow for non-base-10 numbers is reported only when
21791 there's no portable and simple way to convert to floating point.
452f4150 21792
67769ffc
PE
21793 * textprop.c (set_text_properties_1): Rewrite for clarity,
21794 and to avoid GCC warning about integer overflow.
21795
c20db43f
PE
21796 * intervals.h (struct interval): Use EMACS_INT for members
21797 where EMACS_UINT might cause problems. See
21798 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21799 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21800 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21801 All uses changed.
37aa2f85
PE
21802 (offset_intervals): Tell GCC not to worry about length overflow
21803 when negating a negative length.
c20db43f 21804
2538aa2f
PE
21805 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21806 (overrun_check_free): Likewise.
21807
f2d3008d
PE
21808 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21809 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21810 word size.
21811
ec8df744
PE
21812 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21813 (gnutls_make_error): Rename local to avoid shadowing.
21814 (gnutls_emacs_global_deinit): ifdef out; not used.
21815 (Fgnutls_boot): Use const for pointer to readonly storage.
21816 Comment out unused local. Fix pointer signedness problems.
21817
640ee02d
PE
21818 * lread.c (openp): Don't stuff size_t into an 'int'.
21819 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21820 about possible signed overflow.
21821
6048fb2a
PE
21822 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21823 (GDK_KEY_g): Don't define if already defined.
21824 (xg_prepare_tooltip): Avoid pointer signedness problem.
21825 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21826
fa3c87e1
PE
21827 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21828 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21829
2172544b
PE
21830 * xfns.c (Fx_window_property): Simplify a bit,
21831 to make a bit faster and to avoid GCC 4.6.0 warning.
21832 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21833
9b821a21
PE
21834 * fns.c (internal_equal): Don't assume size_t fits in int.
21835
3c616cfa
PE
21836 * alloc.c (compact_small_strings): Tighten assertion a little.
21837
c2982e87
PE
21838 Replace pEd with more-general pI, and fix some printf arg casts.
21839 * lisp.h (pI): New macro, generalizing old pEd macro to other
21840 conversion specifiers. For example, use "...%"pI"d..." rather
21841 than "...%"pEd"...".
21842 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 21843 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
21844 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21845 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21846 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21847 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21848 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21849 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21850 64-bit hosts.
21851 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21852 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21853 * print.c (safe_debug_print, print_object): Likewise.
21854 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21855 to int.
6f04d126
PE
21856 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21857 avoiding the 0 flag, which is not portable.
c2982e87
PE
21858 * process.c (Fmake_network_process): Use pI to avoid cast.
21859 * region-cache.c (pp_cache): Likewise.
21860 * xdisp.c (decode_mode_spec): Likewise.
21861 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21862 behavior on 64-bit hosts with printf arg.
6f04d126 21863 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
21864 (x_stop_queuing_selection_requests): Likewise.
21865 (x_get_window_property): Don't truncate byte count to an 'int'
21866 when tracing.
0b432f21 21867
5e073ec7
PE
21868 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21869 here, since it parses constructs like leading '-' and spaces,
21870 which are not wanted; and it overflows with large numbers.
21871 Instead, simply match F[0-9]+, which is what is wanted anyway.
21872
36372bf9
PE
21873 * alloc.c: Remove unportable assumptions about struct layout.
21874 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21875 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21876 (allocate_vectorlike, make_pure_vector): Use the new macros,
21877 plus offsetof, to remove unportable assumptions about struct layout.
21878 These assumptions hold on all porting targets that I know of, but
21879 they are not guaranteed, they're easy to remove, and removing them
21880 makes further changes easier.
21881
0b432f21
PE
21882 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21883 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21884 (string_overrun_cookie): Now const. Use initializers that
21885 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21886 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21887 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21888 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21889 multiple of sizeof (EMACS_INT); it need not be, if
21890 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21891 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21892
895009e1
JB
218932011-04-26 Juanma Barranquero <lekktu@gmail.com>
21894
21895 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21896
6a7a1b0b
TZ
218972011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21898
21899 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21900 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21901 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21902
841a1577 219032011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21904
21905 * lisp.h (Qdebug): List symbol.
895009e1 21906 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21907 * keyboard.c (debug-on-event): New variable.
21908 (handle_user_signal): Break into debugger when debug-on-event
21909 matches the current signal symbol.
21910
f2d3ba6f
DN
219112011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21912
21913 * alloc.c (check_sblock, check_string_bytes)
21914 (check_string_free_list): Convert to standard C.
21915
42ce4c63
TZ
219162011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21917
21918 * w32.c (emacs_gnutls_push): Fix typo.
21919
825cd63c
EZ
219202011-04-25 Eli Zaretskii <eliz@gnu.org>
21921
fb11d64d
EZ
21922 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21923 "cast to pointer from integer of different size".
21924
825cd63c
EZ
21925 Improve doprnt and its use in verror. (Bug#8545)
21926 * doprnt.c (doprnt): Document the set of format control sequences
21927 supported by the function. Use SAFE_ALLOCA instead of always
21928 using `alloca'.
21929
21930 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21931 is one byte too soon. Don't use xrealloc; instead xfree and
21932 xmalloc anew.
21933
e061a11b
TZ
219342011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21935
21936 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21937 callbacks stage.
21938
21939 * gnutls.c: Renamed global_initialized to
21940 gnutls_global_initialized. Added internals for the
21941 :verify-hostname-error, :verify-error, and :verify-flags
21942 parameters of `gnutls-boot' and documented those parameters in the
21943 docstring. Start callback support.
9173deec
JB
21944 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21945 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21946 on error. Return error code.
e061a11b
TZ
21947 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21948 (emacs_gnutls_read): Likewise.
21949 (Fgnutls_boot): Return handshake error code.
21950 (emacs_gnutls_handle_error): New function.
21951 (wsaerror_to_errno): Likewise.
21952
21953 * w32.h (emacs_gnutls_pull): Add prototype.
21954 (emacs_gnutls_push): Likewise.
21955
21956 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21957 (emacs_gnutls_push): Likewise.
21958
219592011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21960
21961 * process.c (wait_reading_process_output): Check if GnuTLS
21962 buffered some data internally if no FDs are set for TLS
21963 connections.
21964
21965 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21966 (LIBS): Link to USER_LIBS.
21967 ($(BLD)/gnutls.$(0)): New target.
21968
fa6996bc
EZ
219692011-04-24 Eli Zaretskii <eliz@gnu.org>
21970
eb35682e
EZ
21971 * xdisp.c (handle_single_display_spec): Rename the
21972 display_replaced_before_p argument into display_replaced_p, to
21973 make it consistent with the commentary. Fix typos in the
21974 commentary.
21975
e2ad650c
EZ
21976 * textprop.c (syms_of_textprop): Remove dead code.
21977 (copy_text_properties): Delete obsolete commentary about an
21978 interface that was deleted long ago. Fix typos in the description
21979 of arguments.
21980
1b2de274
EZ
21981 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21982 to changes in oldXMenu/XMenu.h from 2011-04-16.
21983 <menu_help_message, prev_menu_help_message>: Constify.
21984 (IT_menu_make_room): menu->help_text is now `const char **';
21985 adjust.
21986
21987 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21988 to changes in oldXMenu/XMenu.h from 2011-04-16.
21989 (struct XMenu): Declare `help_text' `const char **'.
21990
21991 * xfaces.c <Qunspecified>: Make extern again.
21992
21993 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21994 required by POSIX.
1b2de274 21995
762b15be
EZ
21996 * doc.c (get_doc_string): Improve the format passed to `error'.
21997
21998 * doprnt.c (doprnt): Improve commentary.
21999
22000 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
22001
22002 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
22003 them with etags.
22004
f1052e5d
EZ
22005 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
22006 changes in globals.h immediately force recompilation.
762b15be
EZ
22007 (TAGS): Depend on $(CURDIR)/m/intel386.h and
22008 $(CURDIR)/s/ms-w32.h.
22009 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 22010
fa6996bc
EZ
22011 * character.c (Fchar_direction): Function deleted.
22012 (syms_of_character): Don't defsubr it.
22013 <char-direction-table>: Deleted.
22014
e6c3da20
EZ
220152011-04-23 Eli Zaretskii <eliz@gnu.org>
22016
22017 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
22018 * doprnt.c: Include limits.h.
22019 (SIZE_MAX): New macro.
04f2d78b
CB
22020 (doprnt): Return a size_t value. 2nd arg is now size_t.
22021 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
22022 Improve overflow protection. Support `l' modifier for integer
22023 conversions. Support %l conversion. Don't assume an EMACS_INT
22024 argument for integer conversions and for %c.
22025
22026 * lisp.h (doprnt): Restore prototype.
22027
22028 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
22029 $(SRC)/character.h.
22030
22031 * Makefile.in (base_obj): Add back doprnt.o.
22032
22033 * deps.mk (doprnt.o): Add back prerequisites.
22034 (callint.o): Depend on character.h.
22035
22036 * eval.c (internal_lisp_condition_case): Include the handler
22037 representation in the error message.
22038 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
22039 when breaking from the loop.
22040
22041 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
22042
22043 * callint.c (Fcall_interactively): When displaying error message
22044 about invalid control letter, pass the character's codepoint, not
22045 a pointer to its multibyte form. Improve display of the character
22046 in octal and display also its hex code.
22047
22048 * character.c (char_string): Use %x to display the (unsigned)
22049 codepoint of an invalid character, to avoid displaying a bogus
22050 negative value.
22051
22052 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
22053 `error', not SYMBOL_NAME itself.
22054
22055 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
22056 character arguments to `error'.
22057
22058 * charset.c (check_iso_charset_parameter): Fix incorrect argument
22059 to `error' in error message about FINAL_CHAR argument. Make sure
22060 FINAL_CHAR is a character, and use %c when it is passed as
22061 argument to `error'.
22062
4ffd0d6b 220632011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
22064
22065 * s/ms-w32.h (localtime): Redirect to sys_localtime.
22066
22067 * w32.c: Include <time.h>.
22068 (sys_localtime): New function.
22069
4ffd0d6b 220702011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
22071
22072 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
22073
4ffd0d6b 22074 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 22075
4ffd0d6b 220762011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 22077
4ffd0d6b
GM
22078 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
22079 zombies (Bug#8467).
aac0c6e3 22080
04c56954
EZ
220812011-04-19 Eli Zaretskii <eliz@gnu.org>
22082
22083 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
22084 gl_state.e_property when gl_state.object is Qt.
22085
22086 * insdel.c (make_gap_larger): Remove limitation of buffer size
22087 to <= INT_MAX.
22088
16a43933
CY
220892011-04-18 Chong Yidong <cyd@stupidchicken.com>
22090
22091 * xdisp.c (lookup_glyphless_char_display)
22092 (produce_glyphless_glyph): Handle cons cell entry in
22093 glyphless-char-display.
22094 (Vglyphless_char_display): Document it.
22095
22096 * term.c (produce_glyphless_glyph): Handle cons cell entry in
22097 glyphless-char-display.
22098
4581706e
CY
220992011-04-17 Chong Yidong <cyd@stupidchicken.com>
22100
22101 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
22102
22103 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
22104
22105 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
22106 definition for no-X builds.
22107
4887c6e2 221082011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 22109
fd35b6f9
PE
22110 Static checks with GCC 4.6.0 and non-default toolkits.
22111
5c1ccb01
PE
22112 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
22113
006c5daa
PE
22114 * process.c (keyboard_bit_set): Define only if SIGIO.
22115 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
22116 (send_process): Repair possible setjmp clobbering.
22117
efc736d3
PE
22118 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
22119
4e2fe2e6
PE
22120 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
22121
f97334a2
PE
22122 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
22123
4e75f29d
PE
22124 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
22125 Define only if needed.
22126
90efadd1
PE
22127 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
22128 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 22129 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 22130
3c647824
PE
22131 * dispextern.h (struct redisplay_interface): Rename param
22132 to avoid shadowing.
e264f262 22133 * termhooks.h (struct terminal): Likewise.
761383f4 22134 * xterm.c (xembed_send_message): Likewise.
3c647824 22135
b58c5c4a
PE
22136 * insdel.c (make_gap_smaller): Define only if
22137 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
22138
cad59032
PE
22139 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
22140 it.
22141
c339dc2e
PE
22142 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
22143 so that we aren't warned about unused symbols.
22144
91a3e27b
PE
22145 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
22146
399c71d3 22147 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 22148
8ffc96f5
PE
22149 * xfns.c (x_real_positions): Mark locals as initialized.
22150
eef9bc79
PE
22151 * xmenu.c (xmenu_show): Don't use uninitialized vars.
22152
098db9dd
PE
22153 * xterm.c: Fix problems found by static analysis with other toolkits.
22154 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
22155 (x_dispatch_event): Declare static if USE_GTK, and
22156 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 22157 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 22158 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
22159 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
22160 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 22161
eb18f6cc
PE
22162 * xmenu.c (menu_help_callback): Pointer type fixes.
22163 Use const pointers when pointing at readonly data. Avoid pointer
22164 signedness clashes.
22165 (FALSE): Remove unused macro.
22166 (update_frame_menubar): Remove unused decl.
22167
1fe72bf8
PE
22168 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
22169
60d9e1db
PE
22170 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
22171 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
22172 (single_menu_item): Rename local to avoid shadowing.
22173
39261c26
PE
22174 * keyboard.c (make_lispy_event): Remove unused local var.
22175
018c5e19
PE
22176 * frame.c, frame.h (x_get_resource_string): Bring this back, but
22177 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
22178
63d2b86e
PE
22179 * bitmaps: Change bitmaps from unsigned char back to the X11
22180 compatible char. Avoid the old compiler warnings about
22181 out-of-range initializers by using, for example, '\xab' rather
22182 than 0xab.
22183
aefd87e1
PE
22184 * xgselect.c (xgselect_initialize): Check vs interface
22185 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
22186
bf501fb9
PE
22187 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
22188
e9829fdf
PE
22189 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
22190 to read-only memory.
22191
1086c095
PE
22192 * fns.c (vector): Remove; this old hack is no longer needed.
22193
2baccd04 22194 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 22195 Remove unused var.
dde42981 22196 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 22197
72391843 22198 * xrdb.c (x_load_resources): Omit unused local.
3565b346 22199
436c16df 22200 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 22201 (x_window): Rename locals to avoid shadowing.
dc5ddd85 22202 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 22203
92bb796d 22204 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 22205 (x_term_init): Remove local to avoid shadowing.
92bb796d 22206
764430a3 22207 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
22208
22209 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
22210 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
22211
d1dfb56c
EZ
222122011-04-16 Eli Zaretskii <eliz@gnu.org>
22213
c4354cb4
EZ
22214 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
22215
d1dfb56c
EZ
22216 Fix regex.c, syntax.c and friends for buffers > 2GB.
22217 * syntax.h (struct gl_state_s): Declare character position members
22218 EMACS_INT.
22219
22220 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
22221
04f2d78b
CB
22222 * textprop.c (verify_interval_modification, interval_of):
22223 Declare arguments EMACS_INT.
d1dfb56c
EZ
22224
22225 * intervals.c (adjust_intervals_for_insertion): Declare arguments
22226 EMACS_INT.
22227
22228 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
22229
22230 * indent.c (Fvertical_motion): Local variable it_start is now
22231 EMACS_INT.
22232
22233 * regex.c (re_match, re_match_2, re_match_2_internal)
22234 (bcmp_translate, regcomp, regexec, print_double_string)
22235 (group_in_compile_stack, re_search, re_search_2, regex_compile)
22236 (re_compile_pattern, re_exec): Declare arguments and local
22237 variables `size_t' and `ssize_t' and return values `regoff_t', as
22238 appropriate.
22239 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
22240 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
22241 <compile_stack_type>: `size' and `avail' are now `size_t'.
22242
22243 * regex.h <regoff_t>: Use ssize_t, not int.
22244 (re_search, re_search_2, re_match, re_match_2): Arguments that
22245 specify buffer/string position and length are now ssize_t and
22246 size_t. Return type is regoff_t.
22247
613052cd
BK
222482011-04-16 Ben Key <bkey76@gmail.com>
22249
22250 * nsfont.m: Fixed bugs in ns_get_family and
22251 ns_descriptor_to_entity that were caused by using free to
22252 deallocate memory blocks that were allocated by xmalloc (via
22253 xstrdup). This caused Emacs to crash when compiled with
22254 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
22255 --enable-checking=xmallocoverrun). xfree is now used to
22256 deallocate these memory blocks.
22257
4170f62f 222582011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 22259
71b41406
PE
22260 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
22261
9587a89d
PE
22262 emacs_write: Accept and return EMACS_INT for sizes.
22263 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
22264 et seq.
22265 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
22266 Accept and return EMACS_INT.
22267 (emacs_gnutls_write): Return the number of bytes written on
22268 partial writes.
22269 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
22270 (emacs_read, emacs_write): Remove check for negative size, as the
22271 Emacs source code has been audited now.
9587a89d
PE
22272 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
22273 (emacs_read, emacs_write): Use it.
273a5f82
PE
22274 * process.c (send_process): Adjust to the new signatures of
22275 emacs_write and emacs_gnutls_write. Do not attempt to store
22276 a byte offset into an 'int'; it might overflow.
9587a89d 22277 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 22278
3e047f51
PE
22279 * sound.c: Don't assume sizes fit in 'int'.
22280 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 22281 Return EMACS_INT, not int.
3e047f51 22282 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
22283 Accept EMACS_INT, not int.
22284 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
22285 record read return values.
22286
cc39a9db
BK
222872011-04-15 Ben Key <bkey76@gmail.com>
22288
c9d0ec6d
JB
22289 * keyboard.c (Qundefined): Don't declare static since it is used
22290 in nsfns.m.
22291 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22292 static since they are used in nsfont.m.
cc39a9db 22293
6c60eb9f
SM
222942011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22295
22296 * process.c (Qprocessp): Don't declare static.
22297 * lisp.h (Qprocessp): Declare again.
22298
7990b61a
JB
222992011-04-15 Juanma Barranquero <lekktu@gmail.com>
22300
22301 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22302
5d4cb038
PE
223032011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22304
8bd7b830 22305 Improve C-level modularity by making more things 'static'.
cd64ea1d 22306
e3b27b31
PE
22307 Don't publish debugger-only interfaces to other modules.
22308 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22309 (verify_bytepos, count_markers): Move decls to the only modules
22310 that need them.
22311 * region-cache.h (pp_cache): Likewise.
22312 * window.h (check_all_windows): Likewise.
22313 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22314
5d4cb038
PE
22315 * sysdep.c (croak): Now static, if
22316 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22317 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
22318
22319 * alloc.c (refill_memory_reserve): Now static if
22320 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22321 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 22322
e87b6180
PE
22323 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22324 Define only if USE_LUCID.
22325
ac64929e
PE
22326 * xrdb.c (x_customization_string, x_rm_string): Now static.
22327
6f37259d
PE
22328 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22329 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22330
1683e3ab
PE
22331 * xdisp.c (draw_row_with_mouse_face): Now static.
22332 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22333
de9c2632
PE
22334 * window.h (check_all_windows): Mark externally visible.
22335
2b96acb7
PE
22336 * window.c (window_deletion_count): Now static.
22337
22338 * undo.c: Make symbols static if they're not exported.
22339 (last_undo_buffer, last_boundary_position, pending_boundary):
22340 Now static.
22341
50436f33
PE
22342 * textprop.c (interval_insert_behind_hooks): Now static.
22343 (interval_insert_in_front_hooks): Likewise.
22344
64520e5c
PE
22345 * term.c: Make symbols static if they're not exported.
22346 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22347 (max_frame_lines, tty_set_terminal_modes):
22348 (tty_reset_terminal_modes, tty_turn_off_highlight):
22349 (get_tty_terminal): Now static.
22350 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22351 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 22352 HAVE_WINDOW_SYSTEM.
64520e5c
PE
22353 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22354 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22355
1fa53021
PE
22356 * sysdep.c: Make symbols static if they're not exported.
22357 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22358 Now static.
22359 (sigprocmask_set, full_mask): Remove; unused.
22360 (wait_debugging): Mark as visible.
22361 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22362 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22363
d4b43b22
PE
22364 * syntax.c (syntax_temp): Define only if !__GNUC__.
22365
b7c513d0
PE
22366 * sound.c (current_sound_device, current_sound): Now static.
22367
989b29ad
PE
22368 * search.c (searchbufs, searchbuf_head): Now static.
22369
13a55a78
PE
22370 * scroll.c (scroll_cost): Remove; unused.
22371 * dispextern.h (scroll_cost): Remove decl.
22372
de68a1fc
PE
22373 * region-cache.h (pp_cache): Mark as externally visible.
22374
40ccffa6
PE
22375 * process.c: Make symbols static if they're not exported.
22376 (process_tick, update_tick, create_process, chan_process):
22377 (Vprocess_alist, proc_buffered_char, datagram_access):
22378 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22379 (deactivate_process): Mark defn as static, as well as decl.
22380 * lisp.h (create_process): Remove decl.
22381 * process.h (chan_process, Vprocess_alist): Remove decls.
22382
ad64fc97
PE
22383 * print.c: Make symbols static if they're not exported.
22384 (print_depth, new_backquote_output, being_printed, print_buffer):
22385 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22386 (print_interval, print_number_index, initial_stderr_stream):
22387 Now static.
22388 * lisp.h (Fprinc): Remove decl.
22389 (debug_output_compilation_hack): Mark as externally visible.
22390
adddb265
PE
22391 * sysdep.c (croak): Move decl from here to syssignal.h.
22392 * syssignal.h (croak): Put it here, so the API can be checked when
22393 'croak' is called from dissociate_if_controlling_tty.
22394
1717ede2
PE
22395 * minibuf.c: Make symbols static if they're not exported.
22396 (minibuf_save_list, choose_minibuf_frame): Now static.
22397 * lisp.h (choose_minibuf_frame): Remove decl.
22398
fa5fb2bc
PE
22399 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22400
1e3890d1
PE
22401 * lread.c: Make symbols static if they're not exported.
22402 (read_objects, initial_obarray, oblookup_last_bucket_number):
22403 Now static.
22404 (make_symbol): Remove; unused.
22405 * lisp.h (initial_obarray, make_symbol): Remove decls.
22406
8a1414fa
PE
22407 * keyboard.c: Make symbols static if they're not exported.
22408 (single_kboard, recent_keys_index, total_keys, recent_keys):
22409 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22410 (this_single_command_key_start, echoing, last_auto_save):
22411 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22412 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22413 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22414 (Vlispy_mouse_stem, double_click_count):
22415 Now static.
22416 (force_auto_save_soon): Define only if SIGDANGER.
22417 (ignore_mouse_drag_p): Now static if
22418 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22419 (print_help): Remove; unused.
22420 (stop_character, last_timer_event): Mark as externally visible.
22421 * keyboard.h (ignore_mouse_drag_p): Declare only if
22422 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22423 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22424 * lisp.h (echoing): Remove decl.
22425 (force_auto_save_soon): Declare only if SIGDANGER.
22426 * xdisp.c (redisplay_window): Simplify code, to make it more
22427 obvious that ignore_mouse_drag_p is not accessed if !defined
22428 USE_GTK && !defined HAVE_NS.
22429
93ea6e8f
PE
22430 * intervals.c: Make symbols static if they're not exported.
22431 (merge_properties_sticky, merge_interval_right, delete_interval):
22432 Now static.
22433 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22434
77382fcc
PE
22435 * insdel.c: Make symbols static if they're not exported.
22436 However, leave prepare_to_modify_buffer alone. It's never
22437 called from outside this function, but that appears to be a bug.
22438 (combine_after_change_list, combine_after_change_buffer):
4889fc82 22439 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
22440 (adjust_after_replace_noundo): Remove; unused.
22441 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 22442 (signal_before_change): Remove decls.
77382fcc 22443
9306c32e
PE
22444 * indent.c (val_compute_motion, val_vmotion): Now static.
22445
cd44d2eb
PE
22446 * image.c: Make symbols static if they're not exported.
22447 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22448 if USE_GTK.
22449 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22450 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22451
ad9a7a06
PE
22452 * fringe.c (standard_bitmaps): Now static.
22453 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22454
81626931
PE
22455 * frame.c: Make symbols static if they're not exported.
22456 (x_report_frame_params, make_terminal_frame): Now static.
22457 (get_frame_param): Now static, unless HAVE_NS.
22458 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22459 (x_get_resource_string): Remove; not used.
22460 * frame.h (make_terminal_frame, x_report_frame_params):
22461 (x_get_resource_string); Remove decls.
22462 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22463 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22464
239f9db9
PE
22465 * font.c, fontset.c: Make symbols static if they're not exported.
22466 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22467 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22468 * font.c (font_close_object): Now static.
22469 * font.h (font_close_object): Remove.
22470 * fontset.c (FONTSET_OBJLIST): Remove.
22471 (free_realized_fontset) #if-0 the body, which does nothing.
22472 (face_suitable_for_char_p): #if-0, as it's never called.
22473 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
22474 * xfaces.c (face_at_string_position):
22475 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
22476 since 0 is always ASCII.
22477
dfcf3579
PE
22478 * fns.c (weak_hash_tables): Now static.
22479
5045092b
PE
22480 * fileio.c: Make symbols static if they're not exported.
22481 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22482 (Vwrite_region_annotation_buffers): Now static.
22483
57a96f5c
PE
22484 * eval.c: Make symbols static if they're not exported.
22485 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22486 * lisp.h (backtrace_list): Remove decl.
22487
35f08c38
PE
22488 * emacs.c: Make symbols static if they're not exported.
22489 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22490 (fatal_error_code, fatal_error_signal_hook, standard_args):
22491 Now static.
22492 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22493 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22494 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22495 * lisp.h (fatal_error_signal_hook): Remove decl.
22496 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22497
f44bd759
PE
22498 * editfns.c: Move a (normally-unused) function to its only use.
22499 * editfns.c, lisp.h (get_operating_system_release): Remove.
22500 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22501 worth the hassle of breaking this out.
22502
b532497d
PE
22503 * xterm.c: Make symbols static if they're not exported.
22504 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22505 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22506 (x_destroy_window, x_delete_display):
22507 Now static.
22508 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22509 (x_mouse_leave): Remove; unused.
22510 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22511 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22512 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22513 Remove decls.
22514 (x_mouse_leave): Declare only if WINDOWSNT.
22515 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22516 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22517 USE_X_TOOLKIT.
22518
1675728f
PE
22519 * ftxfont.c: Make symbols static if they're not exported.
22520 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22521 HAVE_FREETYPE.
22522 * font.h (ftxfont_driver): Likewise.
22523
e4cebfca
PE
22524 * xfns.c: Make symbols static if they're not exported.
22525 (x_last_font_name, x_display_info_for_name):
22526 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22527 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22528 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22529 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22530 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22531 (last_show_tip_args): Now static.
22532 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22533 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22534 (x_screen_planes): Remove; unused.
22535 * dispextern.h (x_screen_planes): Remove decl.
22536
5bf46f05
PE
22537 * dispnew.c: Make symbols static if they're not exported.
22538 * dispextern.h (redraw_garbaged_frames, scrolling):
22539 (increment_row_positions): Remove.
22540 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22541 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22542 Now static.
22543 (redraw_garbaged_frames): Remove; unused.
22544
435f4c28
PE
22545 * xfaces.c: Make symbols static if they're not exported.
22546 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22547 Remove decls.
22548 * xterm.h (defined_color): Remove decls.
22549 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22550 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22551 (menu_face_changed_default, defined_color, free_realized_face):
22552 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22553 (ascii_face_of_lisp_face): Remove; unused.
22554
8524aef3
PE
22555 * xdisp.c: Make symbols static if they're not exported.
22556 * dispextern.h (scratch_glyph_row, window_box_edges):
22557 (glyph_to_pixel_coords, set_cursor_from_row):
22558 (get_next_display_element, set_iterator_to_next):
22559 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22560 (show_mouse_face): Remove decls
22561 * frame.h (message_buf_print): Likewise.
22562 * lisp.h (pop_message, set_message, check_point_in_composition):
22563 Likewise.
22564 * xterm.h (set_vertical_scroll_bar): Likewise.
22565 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22566 (message_buf_print, scratch_glyph_row, displayed_buffer):
22567 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22568 (get_next_display_element, show_mouse_face, window_box_edges):
22569 (frame_to_window_pixel_xy, check_point_in_composition):
22570 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22571 (glyph_to_pixel_coords): Remove; unused.
22572
16390cd2
PE
22573 * dired.c (file_name_completion): Now static.
22574
22575 * dbusbind.c (xd_in_read_queued_messages): Now static.
22576
a25f4dfa
PE
22577 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22578 * data.c (circular_list_error): Remove.
22579
14a9c8df
PE
22580 * commands.h (last_point_position, last_point_position_buffer):
22581 (last_point_position_window): Remove decls.
22582 * keyboard.c: Make these variables static.
22583
04f2d78b
CB
22584 * coding.h (coding, code_convert_region, encode_coding_gap):
22585 Remove decls.
74ab6df5
PE
22586 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22587 (iso_code_class, detect_coding, code_convert_region): Now static.
22588 (encode_coding_gap): Remove; unused.
22589
38dfbee1
PE
22590 * chartab.c (chartab_chars, chartab_bits): Now static.
22591
a2cb4e63
PE
22592 * charset.h (charset_iso_8859_1): Remove decl.
22593 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22594 Now static.
22595
127198fd
PE
22596 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22597 * ccl.c (Vccl_program_table): Now static.
22598 (check_ccl_update): Remove; unused.
22599
d85b608f
PE
22600 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22601 * category.h: ... from here.
22602 * category.c (check_category_table, set_category_set): Now static.
22603
31cd66f3
PE
22604 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22605 * lisp.h: Remove these decls.
22606
c358e587
PE
22607 * buffer.c (buffer_count): Remove unused var.
22608
e78aecca
PE
22609 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22610 so that it's not optimized away.
22611 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22612 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22613 exported only to the debugger.
22614
e192d7d3 22615 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 22616 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 22617
92470028
PE
22618 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22619 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22620 was inaccessible from Lisp.
22621 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22622 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22623
244ed907
PE
22624 alloc.c: Import and export fewer symbols, and remove unused items.
22625 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22626 is defined.
22627 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22628 it's not optimized away by whole-program optimization.
22629 (message_enable_multibyte, free_misc): Remove.
22630 (catchlist, handlerlist, mark_backtrace):
22631 Declare only if BYTE_MARK_STACK.
22632 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22633 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22634 (message_enable_multibyte): Remove decl.
22635 (free_misc, interval_free_list, float_block, float_block_index):
22636 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22637 (cons_free_list, last_marked_index):
22638 Now static.
22639 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22640 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22641 (mark_backtrace): Define only if BYTE_MARK_STACK.
22642 * xdisp.c (message_enable_multibyte): Now static.
22643
61c2b50e 22644 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
22645 This makes it easier for human readers (and static analyzers)
22646 to see whether these variables are used from other modules.
22647 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22648 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22649 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22650 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22651 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22652 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22653 * xmenu.c, xselect.c:
22654 Declare Q* vars static if they are not used in other modules.
22655 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22656 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22657 Remove decls of unexported vars.
22658 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22659
95c82688
PE
22660 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22661
16a97296
PE
22662 Make Emacs functions such as Fatom 'static' by default.
22663 This makes it easier for human readers (and static analyzers)
22664 to see whether these functions can be called from other modules.
22665 DEFUN now defines a static function. To make the function external
22666 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
22667 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22668 (Finit_image_library):
16a97296
PE
22669 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22670 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22671 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22672 Remove decls, since these functions are now static.
22673 (Funintern, Fget_internal_run_time): New decls, since these functions
22674 were already external.
95c82688 22675
16a97296
PE
22676 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22677 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22678 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22679 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22680 * keyboard.c, keymap.c, lread.c:
22681 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22682 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22683 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22684 Mark functions with DEFUE instead of DEFUN,
22685 if they are used in other modules.
22686 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22687 decls for now-static functions.
22688 * buffer.h (Fdelete_overlay): Remove decl.
22689 * callproc.c (Fgetenv_internal): Mark as internal.
22690 * composite.c (Fremove_list_of_text_properties): Remove decl.
22691 (Fcomposition_get_gstring): New forward static decl.
22692 * composite.h (Fcomposite_get_gstring): Remove decl.
22693 * dired.c (Ffile_attributes): New forward static decl.
22694 * doc.c (Fdocumntation_property): New forward static decl.
22695 * eval.c (Ffetch_bytecode): New forward static decl.
22696 (Funintern): Remove extern decl; now in .h file where it belongs.
22697 * fileio.c (Fmake_symbolic_link): New forward static decl.
22698 * image.c (Finit_image_library): New forward static decl.
22699 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22700 * intervals.h (Fprevious_property_change):
22701 (Fremove_list_of_text_properties): Remove decls.
22702 * keyboard.c (Fthis_command_keys): Remove decl.
22703 (Fcommand_execute): New forward static decl.
22704 * keymap.c (Flookup_key): New forward static decl.
22705 (Fcopy_keymap): Now static.
22706 * keymap.h (Flookup_key): Remove decl.
22707 * process.c (Fget_process): New forward static decl.
22708 (Fprocess_datagram_address): Mark as internal.
22709 * syntax.c (Fsyntax_table_p): New forward static decl.
22710 (skip_chars): Remove duplicate decl.
22711 * textprop.c (Fprevious_property_change): New forward static decl.
22712 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22713 Now internal.
22714 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22715 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22716
785bbd42
PE
22717 * editfns.c (Fformat): Remove unreachable code.
22718
8b913b57
AS
227192011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22720
22721 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22722 change. (Bug#8496)
22723
a6744a35
EZ
227242011-04-13 Eli Zaretskii <eliz@gnu.org>
22725
22726 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22727 when at ZV. (Bug#8487)
22728
e7974947
AS
227292011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22730
baad03f0
AS
22731 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22732 (Bug#8437)
22733 * keyboard.c (parse_tool_bar_item): Likewise.
22734 * sound.c (sound_cleanup, alsa_close): Likewise.
22735 * termcap.c (tgetent): Likewise.
22736 * xfns.c (x_default_font_parameter): Likewise.
22737 * xsettings.c (read_and_apply_settings): Likewise.
22738
e7974947
AS
22739 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22740 (overrun_check_free): Protoize.
22741
28272684
PE
227422011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22743
22744 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22745 since callers should never pass a negative size.
22746 Change the signature to match that of plain 'read' and 'write'; see
22747 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22748 * lisp.h: Update prototypes of emacs_write and emacs_read.
22749
11997c76
EZ
227502011-04-11 Eli Zaretskii <eliz@gnu.org>
22751
22752 * xdisp.c (redisplay_window): Don't try to determine the character
22753 position of the scroll margin if the window start point w->startp
e896f03c 22754 is outside the buffer's accessible region. (Bug#8468)
11997c76 22755
8a2cbd72
EZ
227562011-04-10 Eli Zaretskii <eliz@gnu.org>
22757
22758 Fix write-region and its subroutines for buffers > 2GB.
22759 * fileio.c (a_write, e_write): Modify declaration of arguments and
22760 local variables to support buffers larger than 2GB.
22761 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22762
22763 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22764 argument, local variables, and return value.
22765
22766 * lisp.h: Update prototypes of emacs_write and emacs_read.
22767
22768 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22769
4073e537 227702011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 22771
1ebfdcb6
PE
22772 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22773
b2ded58d
PE
22774 Fix more problems found by GCC 4.6.0's static checks.
22775
7d66342c
PE
22776 * xdisp.c (vmessage): Use a better test for character truncation.
22777
bbf47d44
PE
22778 * charset.c (load_charset_map): <, not <=, for optimization,
22779 and to avoid potential problems with integer overflow.
9248994d 22780 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 22781 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 22782 * editfns.c (Fformat): Likewise.
1e69125e 22783 * syntax.c (skip_chars): Likewise.
3befa583 22784
e3019616
PE
22785 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22786 This also lets GCC 4.6.0 generate slightly better loop code.
22787
becfa255
PE
22788 * callint.c (Fcall_interactively): <, not <=, for optimization.
22789 (Fcall_interactively): Count the number of arguments produced,
22790 not the number of arguments given. This is simpler and lets GCC
22791 4.6.0 generate slightly better code.
22792
dae0cd48
PE
22793 * ftfont.c: Distingish more carefully between FcChar8 and char.
22794 The previous code passed unsigned char * to a functions like
22795 strlen and xstrcasecmp that expect char *, which does not
22796 conform to the C standard.
22797 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22798 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22799 char * when the C standard requires it.
22800
76032d70
PE
22801 * keyboard.c (read_char): Remove unused var.
22802
eb3f1cc8
PE
22803 * eval.c: Port to Windows vsnprintf (Bug#8435).
22804 Include <limits.h>.
22805 (SIZE_MAX): Define if the headers do not.
22806 (verror): Do not give up if vsnprintf returns a negative count.
22807 Instead, grow the buffer. This ports to Windows vsnprintf, which
22808 does not conform to C99. Problem reported by Eli Zaretskii.
22809 Also, simplify the allocation scheme, by avoiding the need for
22810 calling realloc, and removing the ALLOCATED variable.
22811
70476b54
PE
22812 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22813
12020a9e
PE
22814 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22815 But keep the doprint source code for now, as we might revamp it
22816 and use it again (Bug#8435).
ea6c7ae6
PE
22817 * lisp.h (doprnt): Remove.
22818 * Makefile.in (base_obj): Remove doprnt.o.
22819 * deps.mk (doprnt.o): Remove.
22820
5fdb398c
PE
22821 error: Print 32- and 64-bit integers portably (Bug#8435).
22822 Without this change, on typical 64-bit hosts error ("...%d...", N)
22823 was used to print both 32- and 64-bit integers N, which relied on
22824 undefined behavior.
61bdb816 22825 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
22826 * lisp.h (error, verror): Mark as printf-like functions.
22827 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22828 Report overflow in size calculations when allocating printf buffer.
22829 Do not truncate output string at its first null byte.
22830 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22831 Truncate the output at a character boundary, since vsnprintf does not
22832 do that.
22833 * charset.c (check_iso_charset_parameter): Convert internal
22834 character to string before calling 'error', since %c now has the
22835 printf meaning.
22836 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22837 overflow when computing char to be passed to 'error'. Do not
22838 pass Lisp_Object to 'error'; pass the integer instead.
22839 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22840 formatted with plain %d.
22841
b189fa66
PE
22842 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22843
bff87ef0
PE
22844 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22845
7e2cac20
PE
22846 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22847
ce4d90b5
PE
22848 * xterm.c (x_catch_errors): Remove duplicate declaration.
22849
266c9547
PE
22850 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22851
79c49ad2
PE
22852 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22853
368f4090
JM
228542011-04-10 Jim Meyering <meyering@redhat.com>
22855
22856 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22857 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22858 return ssize_t not "int", and use size_t as the buffer length.
22859 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22860 * gnutls.h: Update declarations.
22861 * process.c (read_process_output): Use ssize_t, to match.
22862 (send_process): Likewise.
22863
a32d4040
CY
228642011-04-09 Chong Yidong <cyd@stupidchicken.com>
22865
22866 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22867
8546720e 228682011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 22869
04f2d78b
CB
22870 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22871 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22872
8546720e
GM
22873 * xterm.c (handle_one_xevent):
22874 * xmenu.c (create_and_show_popup_menu):
22875 * xselect.c (x_decline_selection_request)
22876 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22877
0a2f5c1a 228782011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22879
22880 Fix some uses of `int' instead of EMACS_INT.
22881 * search.c (string_match_1, fast_string_match)
22882 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22883 (scan_buffer, find_next_newline_no_quit)
22884 (find_before_next_newline, search_command, Freplace_match)
22885 (Fmatch_data): Make some `int' variables be EMACS_INT.
22886
22887 * xdisp.c (display_count_lines): 3rd argument and return value now
22888 EMACS_INT. All callers changed.
22889 (pint2hrstr): Last argument is now EMACS_INT.
22890
22891 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22892 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22893 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22894 (decode_coding_utf_16, decode_coding_emacs_mule)
22895 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22896 (decode_coding_ccl, decode_coding_charset)
22897 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22898 (decode_coding_iso_2022, decode_coding_emacs_mule)
22899 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22900 <char_offset, last_offset>: Declare EMACS_INT.
22901 (encode_coding_utf_8, encode_coding_utf_16)
22902 (encode_coding_emacs_mule, encode_invocation_designation)
22903 (encode_designation_at_bol, encode_coding_iso_2022)
22904 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22905 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22906 Declare EMACS_INT.
22907 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22908 (encode_invocation_designation): Last argument P_NCHARS is now
22909 EMACS_INT.
22910 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22911 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22912
22913 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22914 All users changed.
22915
22916 * ccl.c (Fccl_execute_on_string): Declare some variables
22917 EMACS_INT.
22918
8546720e 229192011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22920
22921 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22922
4e19a977
CS
229232011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22924
22925 * process.c (Fformat_network_address): Doc fix.
22926
87302331
R
229272011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22928
ee7683eb 22929 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22930
cbb59342
CY
229312011-04-08 Chong Yidong <cyd@stupidchicken.com>
22932
22933 * keyboard.c (read_char): Call Lisp function help-form-show,
22934 instead of using internal_with_output_to_temp_buffer.
22935 (Qhelp_form_show): New var.
e0d38eeb 22936 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22937
22938 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22939
22940 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22941
e67a13ab
CY
229422011-04-06 Chong Yidong <cyd@stupidchicken.com>
22943
04f2d78b
CB
22944 * process.c (Flist_processes): Remove to Lisp.
22945 (list_processes_1): Delete.
e67a13ab 22946
973f782d
EZ
229472011-04-06 Eli Zaretskii <eliz@gnu.org>
22948
7c106b1e
EZ
22949 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22950
973f782d
EZ
22951 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22952
41cf7d1a 229532011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22954
ca23cc88
PE
22955 Fix more problems found by GCC 4.6.0's static checks.
22956
f390e2d5
PE
22957 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22958
42eea0d0
PE
22959 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22960
b69769da 22961 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22962
f9541e84
PE
22963 * xdisp.c (vmessage): Mark as a printf-like function.
22964
13841b55
PE
22965 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22966
c136c10f
PE
22967 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22968
5e2d4a30
PE
22969 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22970 printf-like functions.
22971 (tiff_load): Add casts to remove these marks before passing them
22972 to system-supplied API.
22973
583f48b9
PE
22974 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22975
b25d760e
PE
22976 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22977 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22978 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22979 directly, rather than having caller test rule sign. This avoids
22980 some unnecessary tests.
22981 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22982 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22983 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22984
bc7b6697 22985 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22986 (xfont_open): Avoid unnecessary tests.
bc7b6697 22987
27ccc379
PE
22988 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22989
dcd5c89a
PE
22990 * composite.h, composite.c (composition_gstring_put_cache):
22991 Use EMACS_INT, not int, for length.
22992
b13a45c6
PE
22993 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22994 breaking out part of COMPOSITION_DECODE_RULE.
22995 (COMPOSITION_DECODE_RULE): Use it.
22996 * composite.c (get_composition_id): Remove unused local vars,
22997 by using the new macro.
22998
1e792e4d
PE
22999 * textprop.c (set_text_properties_1): Change while to do-while,
23000 since the condition is always true at first.
23001
dc6c6455 23002 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
23003 (interval_deletion_adjustment): Return unsigned value.
23004 All uses changed.
dc6c6455 23005
aba7731a
PE
23006 * process.c (list_processes_1, create_pty, read_process_output):
23007 (exec_sentinel): Remove vars that were set but not used.
afd4052b 23008 (create_pty): Remove unnecessary "volatile"s.
bc57d757 23009 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 23010 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 23011 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 23012
fdfc4bf3
PE
23013 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
23014
fca8fe46 23015 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 23016 (update_syntax_table): Use unsigned instead of int.
fca8fe46 23017
06a0259a 23018 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 23019 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 23020 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 23021
e7b9e80f
PE
23022 * print.c (print_error_message): Avoid int overflow.
23023
56201685
PE
23024 * font.c (font_list_entities): Redo for clarity,
23025 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
23026
78834453 23027 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 23028 (font_score): Avoid potential overflow in diff calculation.
78834453 23029
0bc0b309 23030 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 23031 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 23032
e610eaca
PE
23033 * eval.c (funcall_lambda): Rename local to avoid shadowing.
23034
b895abce
PE
23035 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
23036 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
23037 can always succeed if overflow has undefined behavior.
23038
1f1d9321 23039 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 23040 (wordify): Omit three unnecessary tests.
1f1d9321 23041
c59478bc
PE
23042 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
23043 All callers changed. This avoids the need for an unused var.
23044
79b73827
PE
23045 * casefiddle.c (casify_region): Remove var that is set but not used.
23046
a4db5dfe
PE
23047 * dired.c (file_name_completion): Remove var that is set but not used.
23048
43aae36e
PE
23049 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
23050
2a47c44d 23051 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 23052 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 23053
a37c69bf
PE
23054 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
23055 Check for integer overflow on size calculations.
23056
328ab8e7
PE
23057 * buffer.c (Fprevious_overlay_change): Remove var that is set
23058 but not used.
23059
e5a2a5cb
PE
23060 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
23061 Remove vars that are set but not used.
8d84a6eb 23062 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 23063 (timer_check_2): Mark vars as initialized.
e5a2a5cb 23064
a60e5f68
PE
23065 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
23066
f661cb61 23067 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 23068 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 23069
f0397f5a
PE
23070 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
23071 that are set but not used.
23072
8664db06 23073 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 23074 if XCreateBitmapFromData fails (Bug#8410).
8664db06 23075
6abdaa4a
PE
23076 * xselect.c (x_get_local_selection, x_handle_property_notify):
23077 Remove vars that are set but not used.
23078
0ce7538d 23079 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 23080 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 23081
9ae848fc
PE
23082 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
23083 Remove var that is set but not used.
0b918413
PE
23084 (scroll_bar_windows_size): Now size_t, not int.
23085 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
23086 Check for overflow.
9ae848fc 23087
a5a62657
PE
23088 * xfaces.c (realize_named_face): Remove vars that are set but not used.
23089 (map_tty_color) [!defined MSDOS]: Likewise.
23090
5c5cdd39
PE
23091 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
23092
66ebf983
PE
23093 * coding.c: Remove vars that are set but not used.
23094 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
23095 All callers changed.
23096 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
23097 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
23098 (decode_coding_charset): Remove vars that are set but not used.
23099
1be4d761
PE
23100 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
23101 that is set but not used.
23102
47553fa8
PE
23103 * print.c (print_object): Remove var that is set but not used.
23104
1f7196bf 23105 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
23106 The gnulib version avoids calling malloc in the usual case,
23107 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
23108 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
23109 * filelock.c (current_lock_owner): Likewise.
23110 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
23111 * sysdep.c: Include allocator.h, careadlinkat.h.
23112 (emacs_no_realloc_allocator): New static constant.
23113 (emacs_readlink): New function.
fdb61804
PE
23114 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
23115 ../lib/careadlinkat.h.
d1fdcab7 23116
f84c17c7
SM
231172011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
23118
23119 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
23120 first non-nil return value).
23121
ef3862ad
JD
231222011-04-03 Jan Djärv <jan.h.d@swipnet.se>
23123
23124 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
23125 if not defined (Bug#8403).
23126
376a7006
JB
231272011-04-02 Juanma Barranquero <lekktu@gmail.com>
23128
23129 * xdisp.c (display_count_lines): Remove parameter `start',
23130 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23131 (get_char_face_and_encoding): Remove parameter `multibyte_p',
23132 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23133 (fill_stretch_glyph_string): Remove parameters `row' and `area',
23134 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
23135 and thereabouts. All callers changed.
23136 (get_per_char_metric): Remove parameter `f', unused since
23137 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
23138
6ca3801d
JM
231392011-04-02 Jim Meyering <meyering@redhat.com>
23140
23141 do not dereference NULL upon failed strdup
23142 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
23143 (ns_get_family): Likewise.
23144
d8e2b5ba
JB
231452011-04-02 Juanma Barranquero <lekktu@gmail.com>
23146
23147 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
23148
8c74fcbd
JD
231492011-04-02 Jan Djärv <jan.h.d@swipnet.se>
23150
23151 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
23152 later (Bug#8403).
23153
7200d79c
SM
231542011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
23155
03408648 23156 Add lexical binding.
7200d79c 23157
03408648
SM
23158 * window.c (Ftemp_output_buffer_show): New fun.
23159 (Fsave_window_excursion):
23160 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
23161
23162 * lread.c (lisp_file_lexically_bound_p): New function.
23163 (Fload): Bind Qlexical_binding.
23164 (readevalloop): Remove `evalfun' arg.
23165 Bind Qinternal_interpreter_environment.
23166 (Feval_buffer): Bind Qlexical_binding.
23167 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
23168 Mark as dynamic.
23169 (syms_of_lread): Declare `lexical-binding'.
23170
23171 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
23172
23173 * keyboard.c (eval_dyn): New fun.
23174 (menu_item_eval_property): Use it.
ca105506
SM
23175
23176 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 23177
03408648
SM
23178 * fns.c (concat, mapcar1): Accept byte-code-functions.
23179
23180 * eval.c (Fsetq): Handle lexical vars.
23181 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
23182 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
23183 (FletX, Flet): Obey lexical binding.
23184 (Fcommandp): Handle closures.
23185 (Feval): New `lexical' arg.
23186 (eval_sub): New function extracted from Feval. Use it almost
23187 everywhere where Feval was used. Look up vars in lexical env.
23188 Handle closures.
23189 (Ffunctionp): Move from subr.el.
23190 (Ffuncall): Handle closures.
23191 (apply_lambda): Remove `eval_flags'.
23192 (funcall_lambda): Handle closures and new byte-code-functions.
23193 (Fspecial_variable_p): New function.
23194 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
23195 but without exporting it to Lisp.
23aba0ea 23196
23aba0ea 23197 * doc.c (Fdocumentation, store_function_docstring):
03408648 23198 * data.c (Finteractive_form): Handle closures.
23aba0ea 23199
03408648
SM
23200 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
23201 interactive spec.
ba83908c 23202
04f2d78b
CB
23203 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
23204 New byte-codes.
03408648
SM
23205 (exec_byte_code): New function extracted from Fbyte_code to handle new
23206 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 23207
03408648 23208 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 23209
03408648 23210 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 23211
e2abce01
JB
232122011-03-31 Juanma Barranquero <lekktu@gmail.com>
23213
23214 * xdisp.c (redisplay_internal): Fix prototype.
23215
63696a73 232162011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 23217
63696a73 23218 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
23219 (try_scrolling): Use it when setting scroll_limit.
23220 Limit scrolling to 100 screen lines.
63696a73
EZ
23221 (redisplay_window): Even when falling back on "recentering",
23222 position point in the window according to scroll-conservatively,
23223 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
23224
23225 (try_scrolling): When point is above the window, allow searching
23226 as far as scroll_max, or one screenful, to compute vertical
23227 distance from PT to the scroll margin position. This prevents
23228 try_scrolling from unnecessarily failing when
23229 scroll-conservatively is set to a value slightly larger than the
23230 window height. Clean up the case of PT below the margin at bottom
23231 of window: scroll_max can no longer be INT_MAX. When aggressive
23232 scrolling is in use, don't let point enter the opposite scroll
23233 margin as result of the scroll.
23234 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
23235 threshold of 100 lines for never-recentering scrolling.
23236
e4cc2dfc
JB
232372011-03-31 Juanma Barranquero <lekktu@gmail.com>
23238
23239 * dispextern.h (move_it_by_lines):
23240 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
23241 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
23242 (message_log_check_duplicate): Remove parameters `prev_bol' and
23243 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
23244 (redisplay_internal): Remove parameter `preserve_echo_area',
23245 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
23246
23247 * indent.c (Fvertical_motion):
23248 * window.c (window_scroll_pixel_based, Frecenter):
23249 Don't pass `need_y_p' to `move_it_by_lines'.
23250
1c470562
SM
232512011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
23252
44f230aa
SM
23253 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
23254 steal a few bits to be more compact.
23255 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
23256 Remove unneeded casts.
23257
1c470562
SM
23258 * bytecode.c (Fbyte_code): CAR and CDR can GC.
23259
888adce9
ZK
232602011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
23261
23262 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
23263 binding" message (bug#7967).
23264
f838ed7b
PE
232652011-03-30 Paul Eggert <eggert@cs.ucla.edu>
23266
77861b95
PE
23267 Fix more problems found by GCC 4.6.0's static checks.
23268
de6dbc14
PE
23269 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
23270 Remove unused local var.
23271
f838ed7b
PE
23272 * editfns.c (Fmessage_box): Remove unused local var.
23273
792c7b2b
PE
23274 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
23275 (note_mode_line_or_margin_highlight, note_mouse_highlight):
23276 Omit unused local vars.
c499e557 23277 * window.c (shrink_windows): Omit unused local var.
b01a1c29 23278 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
23279 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23280 Omit unused local var.
23281
ba0165e1
PE
23282 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23283 Don't assume string length fits in int.
32ad8845 23284 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 23285 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 23286
3c59b4c9
PE
23287 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23288 instead of alloca (Bug#8344).
23289
a3eed478 23290 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 23291 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 23292
eb4d412d
PE
23293 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23294
1658b401
PE
23295 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23296 concerns.
23297
23298 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23299
23300 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 23301
9a2c6e05
PE
23302 * keyboard.c (syms_of_keyboard): Use the same style as later
23303 in this function when indexing through an array. This also
23304 works around GCC bug 48267.
23305
03d0a109
PE
23306 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23307
44f730c8
PE
23308 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23309
fe75f926
PE
23310 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23311 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23312
ffa8c828
PE
23313 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23314 This avoids undefined behavior on integer overflow, and is a bit
23315 more convenient anyway since it is compared to a size_t variable.
23316
c5101a77
PE
23317 Variadic C functions now count arguments with size_t, not int.
23318 This avoids an unnecessary limitation on 64-bit machines, which
23319 caused (substring ...) to crash on large vectors (Bug#8344).
23320 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23321 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 23322 All variadic functions and their callers changed accordingly.
c5101a77
PE
23323 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23324 * data.c (arith_driver, float_arith_driver): Likewise.
23325 * editfns.c (general_insert_function): Likewise.
23326 * eval.c (struct backtrace.nargs, interactive_p)
23327 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23328 (funcall_lambda, mark_backtrace): Likewise.
23329 * fns.c (concat): Likewise.
23330 * frame.c (x_set_frame_parameters): Likewise.
23331 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23332 0 if not found, not -1. All callers changed.
23333
dd3f25f7
PE
23334 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23335 (stack_copy_size): Now size_t, not int.
23336 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23337
461c2ab9
JB
233382011-03-28 Juanma Barranquero <lekktu@gmail.com>
23339
23340 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23341 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23342 All callers changed.
23343
23344 * lisp.h (multibyte_char_to_unibyte):
23345 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23346 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23347 * character.h (CHAR_TO_BYTE8):
23348 * cmds.c (internal_self_insert):
23349 * editfns.c (general_insert_function):
23350 * keymap.c (push_key_description):
23351 * search.c (Freplace_match):
23352 * xdisp.c (message_dolog, set_message_1): All callers changed.
23353
f6d62986
SM
233542011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23355
23356 * keyboard.c (safe_run_hook_funcall): New function.
23357 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23358 don't set the hook to nil, but remove the offending function instead.
23359 (Qcommand_hook_internal): Remove, unused.
23360 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23361 Vcommand_hook_internal.
23362
23363 * eval.c (enum run_hooks_condition): Remove.
23364 (funcall_nil, funcall_not): New functions.
23365 (run_hook_with_args): Call each function through a `funcall' argument.
23366 Remove `cond' argument, now redundant.
23367 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23368 (Frun_hook_with_args_until_failure): Adjust accordingly.
23369 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23370
1db5b1ad
JB
233712011-03-28 Juanma Barranquero <lekktu@gmail.com>
23372
23373 * dispextern.h (string_buffer_position): Remove declaration.
23374
23375 * print.c (strout): Remove parameter `multibyte', unused since
23376 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23377
23378 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23379 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23380 All callers changed.
23381
23382 * w32.c (_wsa_errlist): Use braces for struct initializers.
23383
23384 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23385 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23386 All callers changed.
23387 (string_buffer_position): Likewise. Also, make static (it's never
23388 used outside xdisp.c).
23389 (cursor_row_p): Remove parameter `w', unused since
23390 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23391 (decode_mode_spec): Remove parameter `precision', introduced during
23392 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23393 All callers changed.
23394
5ffb62aa
JD
233952011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23396
23397 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23398
461c2ab9 233992011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
23400
23401 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23402 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23403 (ns_update_auto_hide_menu_bar): New functions.
23404 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23405 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23406 ns_constrain_all_frames.
23407 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23408 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23409
5c380ffb
JD
234102011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23411
23412 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23413
9af30bdf
GM
234142011-03-27 Glenn Morris <rgm@gnu.org>
23415
23416 * syssignal.h: Replace RETSIGTYPE with void.
23417 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23418 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23419 Replace SIGTYPE with void everywhere.
23420 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23421 * s/template.h (SIGTYPE): Remove commented out definition.
23422
e2abce01
JB
234232011-03-26 Eli Zaretskii <eliz@gnu.org>
23424
23425 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23426 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23427
f868cd8a
JB
234282011-03-26 Juanma Barranquero <lekktu@gmail.com>
23429
59eb0929
JB
23430 * w32.c (read_unc_volume): Use parameter `henum', instead of
23431 global variable `wget_enum_handle'.
23432
23433 * keymap.c (describe_vector): Remove parameters `indices' and
23434 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23435 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23436
f868cd8a
JB
23437 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23438
23439 * keyboard.c (timer_check): Remove parameter `do_it_now',
23440 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23441 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23442 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23443
23444 * keyboard.c (read_char):
23445 * w32menu.c (w32_menu_display_help):
23446 * xmenu.c (show_help_event, menu_help_callback):
23447 Adjust calls to `show_help_echo'.
23448
23449 * gtkutil.c (xg_maybe_add_timer):
23450 * keyboard.c (readable_events):
23451 * process.c (wait_reading_process_output):
23452 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23453
23454 * insdel.c (adjust_markers_gap_motion):
23455 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23456 (gap_left, gap_right): Don't call it.
23457
2ecf6fdb
CY
234582011-03-25 Chong Yidong <cyd@stupidchicken.com>
23459
23460 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23461 incurred during fontification.
23462
6b1f9ba4
JB
234632011-03-25 Juanma Barranquero <lekktu@gmail.com>
23464
23465 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23466 (DEFVAR_PER_BUFFER): Don't pass it.
23467
23468 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23469 (scrolling_window): Don't pass it.
23470
0f4a96b5
JB
234712011-03-25 Juanma Barranquero <lekktu@gmail.com>
23472
23473 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23474
23475 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23476 and `suffix'.
23477 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23478 of variables specific to SELinux and computation of `encoded_absname'.
23479
23480 * image.c (XPutPixel): Remove unused variable `height'.
23481
23482 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23483
23484 * unexw32.c (get_section_info): Remove unused variable `section'.
23485
23486 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23487 (system_process_attributes): Remove unused variable `sess'.
23488 (sys_read): Remove unused variable `err'.
23489
23490 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23491 (w32_wnd_proc): Remove unused variable `isdead'.
23492 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23493 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23494 (x_create_tip_frame): Remove unused variable `tem'.
23495
23496 * w32inevt.c (w32_console_read_socket):
23497 Remove unused variable `no_events'.
23498
23499 * w32term.c (x_draw_composite_glyph_string_foreground):
23500 Remove unused variable `width'.
23501
1149507c
JB
235022011-03-24 Juanma Barranquero <lekktu@gmail.com>
23503
23504 * w32term.c (x_set_glyph_string_clipping):
23505 Don't pass uninitialized region to CombineRgn.
23506
9c88f339
JB
235072011-03-23 Juanma Barranquero <lekktu@gmail.com>
23508
23509 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23510 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23511 (Fx_close_connection): Remove unused variable `i'.
23512
23513 * w32font.c (w32font_draw): Return number of glyphs.
23514 (w32font_open_internal): Remove unused variable `i'.
23515 (w32font_driver): Add missing initializer.
23516
23517 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23518 (fill_in_menu): Remove unused variable `items_added'.
23519
23520 * w32term.c (last_mouse_press_frame): Remove static global variable.
23521 (w32_clip_to_row): Remove unused variable `f'.
23522 (x_delete_terminal): Remove unused variable `i'.
23523
23524 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23525 (NOTHING): Remove unused static global variable.
23526 (uniscribe_check_otf): Remove unused variable `table'.
23527 (uniscribe_font_driver): Add missing initializers.
23528
dee091a3
JD
235292011-03-23 Julien Danjou <julien@danjou.info>
23530
23531 * term.c (Fsuspend_tty, Fresume_tty):
23532 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23533 * window.c (temp_output_buffer_show):
23534 * insdel.c (signal_before_change):
23535 * frame.c (Fhandle_switch_frame):
23536 * fileio.c (Fdo_auto_save):
23537 * emacs.c (Fkill_emacs):
23538 * editfns.c (save_excursion_restore):
23539 * cmds.c (internal_self_insert):
23540 * callint.c (Fcall_interactively):
23541 * buffer.c (Fkill_all_local_variables):
23542 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23543 Use Frun_hooks.
0f4a96b5 23544 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 23545 unconditionally since it does the check itself.
dee091a3 23546
2c520ab5 235472011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 23548
c9c49752
PE
23549 Fix more problems found by GCC 4.5.2's static checks.
23550
8abc3f12
PE
23551 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23552 the first time through the loop, since we know p0 < p1 then.
23553 This also avoids a gcc -Wstrict-overflow warning.
23554
a2d26660
PE
23555 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23556 leading to a memory leak, possible in functions like
23557 load_charset_map_from_file that can allocate an unbounded number
b12ef411 23558 of objects (Bug#8318).
a2d26660 23559
916c72e9
PE
23560 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23561 that could (at least in theory) be that large.
23562
19ab8a18
PE
23563 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23564 This is less likely to overflow, and avoids undefined behavior if
23565 overflow does occur. All callers changed. Use strtoul to scan
23566 for the unsigned long integer.
b7cbbd6f
PE
23567 (pint2hrstr): Simplify and tune code slightly.
23568 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 23569
f0641eff
PE
23570 * scroll.c (do_scrolling): Work around GCC bug 48228.
23571 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23572
7f650bb9
PE
23573 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23574 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
23575 (validate_x_resource_name): Simplify count usage.
23576 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 23577
37dd57d1
PE
23578 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23579 fail (Bug#8306).
81e56e61 23580
699979fc 23581 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 23582
401bf9b4
PE
23583 * process.c (Fmake_network_process): Use socklen_t, not int,
23584 where POSIX says socklen_t is required in portable programs.
23585 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 23586 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
23587 (Fmake_network_process, server_accept_connection):
23588 (wait_reading_process_output, read_process_output):
23589 Likewise.
23590
b93aacde
PE
23591 * process.c: Rename or move locals to avoid shadowing.
23592 (list_processes_1, Fmake_network_process):
23593 (read_process_output_error_handler, exec_sentinel_error_handler):
23594 Rename or move locals.
4dc343ee 23595 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 23596 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 23597 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 23598 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 23599 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 23600
af8a867c 23601 Make tparam.h and terminfo.c consistent.
44f230aa
SM
23602 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23603 Include tparam.h instead, since it declares them.
af8a867c
PE
23604 * cm.h (PC): Remove extern decl; tparam.h now does this.
23605 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23606 * terminfo.c: Include tparam.h, to check interfaces.
23607 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23608 (tparam): Adjust signature to match interface in tparam.h;
23609 this removes some undefined behavior. Check that outstring and len
23610 are zero, which they always are with Emacs.
23611 * tparam.h (PC, BC, UP): New extern decls.
23612
0248044d 23613 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 23614 (xftfont_open): Rename locals to avoid shadowing.
0248044d 23615
8ff096c1 23616 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
23617 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23618 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 23619 (ftfont_list): Remove unused local.
49eaafba
PE
23620 (get_adstyle_property, ftfont_pattern_entity):
23621 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23622 Rename locals to avoid shadowing.
8ff096c1 23623
e2be39f6
PE
23624 * xfont.c (xfont_list_family): Mark var as initialized.
23625
c9735e30
PE
23626 * xml.c (make_dom): Now static.
23627
8f5201ae
PE
23628 * composite.c (composition_compute_stop_pos): Rename local to
23629 avoid shadowing.
b246f932
PE
23630 (composition_reseat_it): Remove unused locals.
23631 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 23632 (composition_update_it): Mark var as initialized.
11b61122
PE
23633 (find_automatic_composition): Mark vars as initialized,
23634 with a FIXME (Bug#8290).
8f5201ae 23635
760fbc2c
PE
23636 character.h: Rename locals to avoid shadowing.
23637 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23638 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23639 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23640 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23641 to avoid shadowing.
23642
ff08eb85
PE
23643 * textprop.c (property_change_between_p): Remove; unused.
23644
fc7bf025
PE
23645 * intervals.c (interval_start_pos): Now static.
23646
235d7abc
PE
23647 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23648
44f230aa
SM
23649 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23650 Rename locals to avoid shadowing.
3e7d6594 23651
50060332
PE
23652 * sound.c (wav_play, au_play, Fplay_sound_internal):
23653 Fix pointer signedness.
d01f234b 23654 (alsa_choose_format): Remove unused local var.
c83b8872
PE
23655 (wav_play): Initialize a variable to 0, to prevent undefined
23656 behavior (Bug#8278).
50060332 23657
c4fc4e30
PE
23658 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23659
918436ed
PE
23660 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23661
c939f91b
PE
23662 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23663 clobbering (Bug#8298).
b9c7f648
PE
23664 * sysdep.c (sys_subshell): Likewise.
23665 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 23666
6bd8c144
PE
23667 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23668 This should get cleaned up, so that child_setup has the
23669 same signature on all platforms.
23670
7710357c 23671 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 23672 (relocate_fd): Rename locals to avoid shadowing.
7710357c 23673
c59da222
CY
236742011-03-22 Chong Yidong <cyd@stupidchicken.com>
23675
23676 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23677 not to be necessary, and produces flickering.
23678
66b87493
GM
236792011-03-20 Glenn Morris <rgm@gnu.org>
23680
23681 * config.in: Remove file.
23682
45b6f6d5
JB
236832011-03-20 Juanma Barranquero <lekktu@gmail.com>
23684
23685 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23686 are now in src/globals.h.
23687 (syms_of_minibuf): Remove spurious & from previous change.
23688
cd394be1 236892011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
23690
23691 * minibuf.c (completing-read-function): New variable.
23692 (completing-read-default): Rename from completing-read.
23693 (completing-read): Call completing-read-function.
23694
b14e3e21
CY
236952011-03-19 Juanma Barranquero <lekktu@gmail.com>
23696
23697 * xfaces.c (Fx_load_color_file):
23698 Read color file from absolute filename (bug#8250).
23699
f2b726e6
JB
237002011-03-19 Juanma Barranquero <lekktu@gmail.com>
23701
23702 * makefile.w32-in: Update dependencies.
23703
09f6ff02
EZ
237042011-03-17 Eli Zaretskii <eliz@gnu.org>
23705
23706 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23707
29a6015a
PE
237082011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23709
a3a6c54e
PE
23710 Fix more problems found by GCC 4.5.2's static checks.
23711
b766f867
PE
23712 * process.c (make_serial_process_unwind, send_process_trap):
23713 (sigchld_handler): Now static.
23714
be02381c
PE
23715 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23716 That way, the code declares only the vars that it needs.
23717 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23718 * s/cygwin.h (PTY_ITERATION): Likewise.
23719 * s/darwin.h (PTY_ITERATION): Likewise.
23720 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23721
57048744
PE
23722 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23723 * process.c (allocate_pty): Don't declare stb unless it's needed.
23724
7914961c 23725 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
23726 (CONSTANTLIM): Remove; unused.
23727 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23728 Define only if needed.
7914961c 23729
b3967b18
PE
23730 * unexelf.c (unexec): Name an expression,
23731 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
23732 Use a different way to cause a compilation error if anyone uses
23733 n rather than nn, a way that does not involve shadowing.
73366a00 23734 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 23735
29a6015a
PE
23736 * deps.mk (unexalpha.o): Remove; unused.
23737
43cfc33e 23738 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 23739 * unexec.h: New file.
ce701a33
PE
23740 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23741 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23742 Depend on unexec.h.
23743 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23744 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23745 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 23746 Change as necessary to match prototype in unexec.h.
ce701a33 23747
01f44d5a
PE
23748 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23749 shadowing.
4f63c6bb 23750 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 23751
a6670b0b
PE
23752 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23753 Rename locals to avoid shadowing.
23754
cef2010d 23755 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 23756 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 23757
d4d7173a
PE
23758 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23759
f08b802a
PE
23760 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23761 warning when compiling print.c.
23762
3ddb0639
PE
23763 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23764 instead of using an uninitialized var.
5ad03b97 23765 (font_sort_entities): Mark var as initialized.
3ddb0639 23766
170a2692
PE
23767 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23768
e663c700
PE
23769 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23770 pointers to constants.
89bc529a 23771 (font_parse_fcname): Remove unused vars.
7b81e2d0 23772 (font_delete_unmatched): Now static.
ea838e10 23773 (font_get_spec): Remove; unused.
13a547c6
PE
23774 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23775 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23776 Rename or move locals to avoid shadowing.
e663c700 23777
2a80c887 23778 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 23779 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 23780
1384fa33 23781 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 23782 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 23783
8b2c52e9
PE
23784 * alloc.c (mark_backtrace): Move decl from here ...
23785 * lisp.h: ... to here, so that it can be checked.
23786
475545b5 23787 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 23788 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
23789 (lisp_indirect_variable): Name an expression,
23790 to avoid gcc -Wbad-function-cast warning.
1faed8ae 23791 (Fdefvar): Rename locals to avoid shadowing.
475545b5 23792
b1349114 23793 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 23794 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 23795 Use const pointer when appropriate.
b1349114 23796
a2928364
PE
23797 * lisp.h (get_system_name, get_operating_system_release):
23798 Move decls here, to check interfaces.
23799 * process.c (get_operating_system_release): Move decl to lisp.h.
23800 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
23801 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23802 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23803 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
23804 (Fformat_time_string, Fencode_time, Finsert_char):
23805 (Ftranslate_region_internal, Fformat):
23806 Rename or remove local vars to avoid shadowing.
9710023e 23807 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 23808
a415e694
PE
23809 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23810 avoid shadowing.
23811
8ef4622d
PE
23812 * lisp.h (eassert): Check that the argument compiles, even if
23813 ENABLE_CHECKING is not defined.
23814
946f9a5b
PE
23815 * data.c (Findirect_variable): Name an expression, to avoid
23816 gcc -Wbad-function-cast warning.
112396d6 23817 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 23818 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
23819 (Fmake_variable_buffer_local, Fmake_local_variable):
23820 Mark variables as initialized.
52746918 23821 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 23822
e5aab7e7 23823 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
23824 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23825 Rename locals to avoid shadowing.
dff45157
PE
23826 (mark_stack): Move local variables into the #ifdef region where
23827 they're used.
7bc26fdb
PE
23828 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23829 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23830 needed otherwise.
23831 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23832 (GC_STRING_CHARS): Remove; not used.
d40d4be1 23833 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 23834
e5aab7e7
PE
23835 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23836 avoids undefined behavior in theory.
23837
4da60324
PE
23838 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23839
88043301
PE
23840 Use functions, not macros, for up- and down-casing (Bug#8254).
23841 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23842 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23843 to use the following functions instead of these macros.
23844 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23845 EMACS_INT, since callers assume the returned value fits in int.
23846 (upcase1): Likewise, for UPCASE_TABLE.
23847 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 23848 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 23849 the race-condition problem in the old DOWNCASE.
88043301 23850
19ed5445
PE
23851 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23852 Rename locals to avoid shadowing.
23853 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
23854 (regex_compile, re_search_2, re_match_2_internal):
23855 Remove unused local vars.
952db0d7
PE
23856 (FREE_VAR): Rewrite so as not to use empty "else",
23857 which gcc can warn about.
da053e48 23858 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
23859 (RETALLOC_IF): Define only if needed.
23860 (WORDCHAR_P): Likewise. This one is never needed, but is used
23861 only in a comment talking about a compiler bug, so put inside
23862 the #if 0 of that comment.
23863 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23864 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23865 Remove; unused.
19ed5445 23866
1f3561e4 23867 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
23868 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23869 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 23870
ded6f8f7
PE
23871 * search.c (simple_search): Remove unused var.
23872
dbd37a95
PE
23873 * dired.c (compile_pattern): Move decl from here ...
23874 * lisp.h: ... to here, so that it can be checked.
23875 (struct re_registers): New forward decl.
23876
7e47afad
PE
23877 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23878
85f24f61
PE
23879 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23880 All uses changed.
23881 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23882 Rename locals to avoid shadowing.
5671df8f 23883 (Fvertical_motion): Mark locals as initialized.
85f24f61 23884
181aa2be 23885 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23886 (casify_region): Mark local as initialized.
181aa2be 23887
930d429c
PE
23888 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23889
7082eac6
PE
23890 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23891 New macros, so that the caller can use some names other than
23892 gcpro1, gcpro2, etc.
23893 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23894 of the new macros.
23895 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23896 argument, for consistency with GCPRO2_VAR, etc: it is now the
23897 prefix of the variable, not the variable itself. All uses
23898 changed.
38b2c076
PE
23899 * dired.c (directory_files_internal, file_name_completion):
23900 Rename locals to avoid shadowing.
23901
15206ed9
PE
23902 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23903 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23904 dired.c's scmp function, had undefined behavior.
23905 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23906 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23907 * buffer.h: ... to here, because these macros use current_buffer,
23908 and the new implementation with inline functions needs to have
23909 current_buffer in scope now, rather than later when the macros
23910 are used.
23911 (downcase, upcase1): New static inline functions.
23912 (DOWNCASE, UPCASE1): Reimplement using these functions.
23913 This avoids undefined behavior in expressions like
23914 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23915 from race conditions in accessing the global variables
23916 case_temp1 and case_temp2.
23917 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23918 * lisp.h (case_temp1, case_temp2): Remove their decls.
23919 * character.h (ASCII_CHAR_P): Move from here ...
23920 * lisp.h: ... to here, so that the inline functions mentioned
23921 above can use them.
23922
4a6bea26
PE
23923 * dired.c (directory_files_internal_unwind): Now static.
23924
f14b7e14
PE
23925 * fileio.c (file_name_as_directory, directory_file_name):
23926 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23927 Now static.
2893f146
PE
23928 (file_name_as_directory): Use const pointers when appropriate.
23929 (Fexpand_file_name): Likewise. In particular, newdir might
23930 point at constant storage, so make it a const pointer.
fd4ead52 23931 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23932 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23933 signedness issues.
f839df0c
PE
23934 (Fset_file_times, Finsert_file_contents, auto_save_error):
23935 Rename locals to avoid shadowing.
f14b7e14 23936
5716756e 23937 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23938 (Ftry_completion, Fall_completions): Rename or remove locals
23939 to avoid shadowing.
5716756e 23940
b4c3046a
PE
23941 * marker.c (bytepos_to_charpos): Remove; unused.
23942
b45db522
PE
23943 * lisp.h (verify_bytepos, count_markers): New decls,
23944 so that gcc does not warn that these functions aren't declared.
23945
85876d07
PE
23946 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23947 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23948 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23949 (copy_text): Remove unused local var.
85876d07 23950
03d78a21 23951 * filelock.c (within_one_second): Now static.
b3dd38ab 23952 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23953
5df8f01b
PE
23954 * buffer.c (fix_overlays_before): Mark locals as initialized.
23955 (fix_start_end_in_overlays): Likewise. This function should be
23956 simplified by using pointers-to-pointers, but that's a different
23957 matter.
b1d876f1 23958 (switch_to_buffer_1): Now static.
8f54f30a
PE
23959 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23960 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23961
a70072c9 23962 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23963 Fix pointer signedness issue.
edced198
PE
23964 (sys_subshell): Mark local as volatile if checking for lint,
23965 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23966 (MAXPATHLEN): Define only if needed.
a70072c9 23967
a0977c44
PE
23968 * process.c (serial_open, serial_configure): Move decls from here ...
23969 * systty.h: ... to here, so that they can be checked.
23970
a884fdcc
PE
23971 * fns.c (get_random, seed_random): Move extern decls from here ...
23972 * lisp.h: ... to here, so that they can be checked.
23973
604efe86 23974 * sysdep.c (reset_io): Now static.
b8950c94 23975 (wait_for_termination_signal): Remove; unused.
604efe86 23976
38fc62d9
PE
23977 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23978 (copy_keymap_item, append_key, push_text_char_description):
23979 Now static.
1004a21a 23980 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23981 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23982 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23983 (describe_map_tree):
23984 Rename locals to avoid shadowing.
38fc62d9 23985
2f2650da
PE
23986 * keyboard.c: Declare functions static if they are not used elsewhere.
23987 (echo_char, echo_dash, cmd_error, top_level_2):
23988 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23989 (read_char, kbd_buffer_get_event, make_lispy_position):
23990 (make_lispy_event, make_lispy_movement, apply_modifiers):
23991 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23992 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23993 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23994 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23995 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23996
a053e86c 23997 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23998 (mark_kboards): Move decl here ...
23999 * alloc.c (mark_kboards): ... from here.
a053e86c 24000
4752793e
PE
24001 * lisp.h (force_auto_save_soon): New decl.
24002
74f10ca7 24003 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
24004 (DEFINE_DUMMY_FUNCTION): New macro.
24005 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
24006 Use it.
c03cd23f
PE
24007 (main): Add casts to avoid warnings
24008 if GCC considers string literals to be constants.
74f10ca7 24009
022e70d4
PE
24010 * lisp.h (fatal_error_signal): Add decl, since it's exported.
24011
59d6fe83
PE
24012 * dbusbind.c: Pointer signedness fixes.
24013 (xd_signature, xd_append_arg, xd_initialize):
24014 (Fdbus_call_method, Fdbus_call_method_asynchronously):
24015 (Fdbus_method_return_internal, Fdbus_method_error_internal):
24016 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
24017 (Fdbus_register_signal): Use SSDATA when the context wants char *.
24018
78320123
PE
24019 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
24020 if GCC considers string literals to be constants.
49cebcca 24021 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 24022
35ac2a97
SM
240232011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
24024
fb103ca9
SM
24025 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
24026 (print_preprocess, print_object): New macro to fix last change.
24027
35ac2a97
SM
24028 * print.c (print_preprocess): Don't forget font objects.
24029
62973b41
JB
240302011-03-16 Juanma Barranquero <lekktu@gmail.com>
24031
24032 * emacs.c (USAGE3): Doc fixes.
24033
0e48bb22
AS
240342011-03-15 Andreas Schwab <schwab@linux-m68k.org>
24035
24036 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
24037 structure.
24038
7684e57b
JB
240392011-03-14 Juanma Barranquero <lekktu@gmail.com>
24040
24041 * lisp.h (VWindow_system, Qfile_name_history):
24042 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
24043 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
24044 (w32_system_caret_x, w32_system_caret_y): Declare extern.
24045
24046 * w32select.c: Don't #include "keyboard.h".
c96bbc66 24047 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
24048
24049 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
24050 * w32console.c (detect_input_pending, read_input_pending)
24051 (encode_terminal_code):
24052 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
24053 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
24054 (w32_system_caret_y, Qfile_name_history):
24055 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
24056 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
24057 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
24058 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
24059 * w32proc.c (Qlocal, report_file_error):
24060 * w32term.c (Vwindow_system, updating_frame):
24061 * w32uniscribe.c (initialized, uniscribe_font_driver):
24062 Remove unneeded extern declarations.
24063
2aa46d6c
CY
240642011-03-14 Chong Yidong <cyd@stupidchicken.com>
24065
c96bbc66 24066 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 24067
cffc6f3b
CY
240682011-03-13 Chong Yidong <cyd@stupidchicken.com>
24069
24070 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
24071 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
24072 These macros can no longer be used for assignment.
24073
44f230aa
SM
24074 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
24075 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
24076 (record_buffer_markers, fetch_buffer_markers): New functions for
24077 recording and fetching special buffer markers.
24078 (set_buffer_internal_1, set_buffer_temp): Use them.
24079
24080 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
24081
24082 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
24083
24084 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
24085 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
24086
24087 * xdisp.c (hscroll_window_tree):
24088 (reconsider_clip_changes): Use PT instead of BUF_PT.
24089
d251f04b
EZ
240902011-03-13 Eli Zaretskii <eliz@gnu.org>
24091
24092 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
24093 $(EMACS_ROOT)/lib/intprops.h.
24094
f0c77cd1
PE
240952011-03-13 Paul Eggert <eggert@cs.ucla.edu>
24096
3eca4629
PE
24097 Fix more problems found by GCC 4.5.2's static checks.
24098
7c86ee98
PE
24099 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
24100 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
24101 (xg_free_frame_widgets): Make it clear that a local variable is
24102 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
24103 (gdk_window_get_screen): Make it clear that this macro is needed
24104 only if USE_GTK_TOOLTIP.
1e5524e7
PE
24105 (int_gtk_range_get_value): New function, which avoids a diagnostic
24106 from gcc -Wbad-function-cast.
24107 (xg_set_toolkit_scroll_bar_thumb): Use it.
24108 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
24109 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
24110 (get_utf8_string, xg_get_file_with_chooser):
24111 Rename locals to avoid shadowing.
24112 (create_dialog): Move locals to avoid shadowing.
7c86ee98 24113
41729b81
PE
24114 * xgselect.c (xg_select): Remove unused var.
24115
f0c77cd1
PE
24116 * image.c (four_corners_best): Mark locals as initialized.
24117 (gif_load): Initialize transparent_p to zero (Bug#8238).
24118 Mark another local as initialized.
ec6cf4c6 24119 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 24120
ce0ad53d 24121 * image.c (clear_image_cache): Now static.
d5d5a617 24122 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 24123 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
24124 (x_edge_detection): Remove unnecessary cast that
24125 gcc -Wbad-function-cast diagnoses.
2037898d 24126 (gif_load): Fix pointer signedness.
6ae141d6
PE
24127 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
24128 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 24129
33383987 241302011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 24131
d32df629
PE
24132 Improve quality of tests for time stamp overflow.
24133 For example, without this patch (encode-time 0 0 0 1 1
24134 1152921504606846976) returns the obviously-bogus value (-948597
24135 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
24136 reports time overflow. See
24137 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
24138 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
24139 * editfns.c: Include limits.h and intprops.h.
24140 (TIME_T_MIN, TIME_T_MAX): New macros.
24141 (time_overflow): Move earlier, to before first use.
24142 (hi_time, lo_time): New functions, for an accurate test for
24143 out-of-range times.
24144 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
24145 (Fget_internal_run_time): Don't assume time_t fits in int.
24146 (make_time): Use list2 instead of Fcons twice.
24147 (Fdecode_time): More accurate test for out-of-range times.
24148 (check_tm_member): New function.
24149 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
24150 (lisp_time_argument): Don't rely on undefined left-shift and
24151 right-shift behavior when checking for time stamp overflow.
8be6f318 24152
fe31d94c
PE
24153 * editfns.c (time_overflow): New function, refactoring common code.
24154 (Fformat_time_string, Fdecode_time, Fencode_time):
24155 (Fcurrent_time_string): Use it.
24156
8be6f318
PE
24157 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
24158 * dired.c (make_time): Move to ...
24159 * editfns.c (make_time): ... here.
24160 * systime.h: Note the move.
24161
09d9db2c 241622011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 24163
126bc0dc
YM
24164 * fringe.c (update_window_fringes): Remove unused variables.
24165
c47cbdfd
YM
24166 * unexmacosx.c (copy_data_segment): Also copy __got section.
24167 (Bug#8223)
24168
7ac80be9
EZ
241692011-03-12 Eli Zaretskii <eliz@gnu.org>
24170
c96bbc66 24171 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
24172 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
24173 Constify `char *' arguments and their references according to
24174 prototypes in tparam.h.
24175
ecb0f94d 24176 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 24177
7ac80be9
EZ
24178 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
24179 Adapt all references accordingly.
24180
24181 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
24182
ef1fd07e
TT
241832011-03-11 Tom Tromey <tromey@redhat.com>
24184
24185 * buffer.c (syms_of_buffer): Remove obsolete comment.
24186
7ef4b50c
EZ
241872011-03-11 Eli Zaretskii <eliz@gnu.org>
24188
24189 * termhooks.h (encode_terminal_code): Declare prototype.
24190
24191 * msdos.c (encode_terminal_code): Don't declare prototype.
24192
24193 * term.c (encode_terminal_code): Now external again, used by
24194 w32console.c and msdos.c.
24195
44f230aa
SM
24196 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
24197 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 24198
4b1ec863 241992011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 24200
1714f52b 24201 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 24202
4b1ec863
PE
24203 * fringe.c (update_window_fringes): Mark locals as initialized
24204 (Bug#8227).
24205 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 24206
524c7aa6
PE
24207 * alloc.c (mark_fringe_data): Move decl from here ...
24208 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
24209 to check its interface.
24210 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
24211
a5c0af81 24212 * fontset.c (free_realized_fontset): Now static.
7519b8cd 24213 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 24214 (fontset_font): Mark local as initialized.
a9a06e0b 24215 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 24216
b4716021
PE
24217 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
24218
811e9bac 24219 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 24220 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
24221 (x_own_selection, Fx_disown_selection_internal): Rename locals
24222 to avoid shadowing.
24223 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 24224
7e3ab302
PE
24225 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
24226 so that the caller can use some name other than gcpro1.
24227 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
24228 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24229 (Fx_backspace_delete_keys_p):
24230 Use them to avoid shadowing, and rename vars to avoid shadowing.
24231 (x_decode_color, x_set_name, x_window): Now static.
6b437900 24232 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 24233 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
24234 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
24235 Remove unused locals.
7e3ab302
PE
24236 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
24237 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
24238 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
24239 macros.
f78faa98 24240
e2b13473
PE
24241 * xterm.h (x_mouse_leave): New decl.
24242
77f23912
PE
24243 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
24244 Remove unused functions.
cdf4ba58
PE
24245 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
24246 (x_calc_absolute_position): Now static.
7411c686 24247 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 24248 Don't declare local "event" unless it's used.
ed7bf3a5
PE
24249 (x_iconify_frame, x_free_frame_resources): Don't declare locals
24250 unless they are used.
38d0b34a
PE
24251 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
24252 (x_fatal_error_signal): Remove; not used.
a6067996
PE
24253 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
24254 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
24255 (x_error_catcher, x_connection_closed, x_error_handler):
24256 (x_error_quitter, xembed_send_message, x_iconify_frame):
24257 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 24258 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 24259 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 24260
44f230aa
SM
24261 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
24262 Rename or move locals to avoid shadowing.
6b463e58 24263 (tty_defined_color, merge_face_heights): Now static.
5967d051 24264 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
24265 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
24266 does not deduce is never used uninitialized.
73719eba
PE
24267 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
24268 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 24269
426994c3 24270 * terminal.c (store_terminal_param): Now static.
5489860b 24271
032f1620 24272 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 24273 (set_frame_menubar): Remove unused local.
d4323972 24274 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
24275 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
24276 since they might point to immutable storage.
281585b0
PE
24277 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
24278 since it's unused otherwise.
032f1620 24279
367c19e5 24280 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 24281 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
24282 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24283 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 24284 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
24285 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24286 does not deduce are never used uninitialized.
70739cbe 24287
07b48fa9
PE
24288 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24289
8868a238 24290 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
24291 * window.c (window_loop, size_window):
24292 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 24293
7e5cf297 24294 * window.c (display_buffer): Now static.
d6550a9f
PE
24295 (size_window): Mark variables that gcc -Wuninitialized
24296 does not deduce are never used uninitialized.
a586633d
PE
24297 * window.h (check_all_windows): New decl, to forestall
24298 gcc -Wmissing-prototypes diagnostic.
5b555da1 24299 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 24300
f6095868
PE
24301 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24302 shadowing.
24303 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
24304 Include <limits.h>.
24305 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24306 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
24307 (load_charset_map): Mark variables that gcc -Wuninitialized
24308 does not deduce are never used uninitialized.
53df7c11 24309 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 24310
f38b440c
PE
24311 * coding.c (coding_set_source, coding_set_destination):
24312 Use "else { /* comment */ }" rather than "else /* comment */;"
24313 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
24314 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24315 a block, when the outer 'i' will do.
24316 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24317 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24318 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24319 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24320 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24321 Rename locals to avoid shadowing.
24322 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
24323 * coding.c (emacs_mule_char, encode_invocation_designation):
24324 Now static, since they're not used elsewhere.
413bb2db 24325 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 24326 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
24327 (decode_coding_emacs_mule): Mark variables that gcc
24328 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
24329 (detect_coding_iso_2022): Initialize a local variable that might
24330 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 24331 this initialization is needed. (Bug#8211)
5f58e762
PE
24332 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24333 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24334 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24335 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24336 Remove unused macros.
f38b440c 24337
232b38b9 24338 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 24339 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 24340 * character.c (string_count_byte8): Likewise.
232b38b9 24341
fb90da1b
PE
24342 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24343 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24344
fb93dbc2
PE
24345 * chartab.c (copy_sub_char_table): Now static, since it's not used
24346 elsewhere.
5c156ace
PE
24347 (sub_char_table_ref_and_range, char_table_ref_and_range):
24348 Rename locals to avoid shadowing.
bbcd0949 24349 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 24350
7d3b3862 24351 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 24352 (BIDI_BOB): Remove unused macro.
7d3b3862 24353
6be7d3da
PE
24354 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24355 deduce are never used uninitialized.
c2ed9c8b 24356 * term.c (encode_terminal_code): Likewise.
6be7d3da 24357
75f8807f 24358 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 24359
50938595
PE
24360 * tparam.h: New file.
24361 * term.c, tparam.h: Include it.
24362 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24363 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24364 Move these decls to tparam.h, and make them agree with what
24365 is actually in tparam.c. The previous trick of using incompatible
24366 decls in different modules does not conform to the C standard.
24367 All callers of tparam changed to use tparam's actual API.
24368 * tparam.c (tparam1, tparam, tgoto):
24369 Use const pointers where appropriate.
24370
fbceeba2
PE
24371 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24372 * cm.h (struct cm): Likewise.
24373 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24374 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24375 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24376 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24377 (turn_on_face, init_tty): Likewise.
24378 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 24379
7f3f1250
PE
24380 * term.c (term_mouse_position): Rename local to avoid shadowing.
24381
e6ca6543
PE
24382 * alloc.c (mark_ttys): Move decl from here ...
24383 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24384
c40f8d15
AS
243852011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24386
24387 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24388
cfe0661d
JB
243892011-03-09 Juanma Barranquero <lekktu@gmail.com>
24390
24391 * search.c (compile_pattern_1): Remove argument regp, unused since
24392 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24393 (compile_pattern): Don't pass it.
24394
0afb4571
J
243952011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24396
24397 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24398 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24399 for ! HAVE_GTK3.
24400 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24401
24402 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24403
24404 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24405 gdk_window_get_screen, gdk_window_get_geometry,
24406 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24407 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24408 (xg_get_pixbuf_from_pixmap): New function.
24409 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24410 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24411 Call xg_get_pixbuf_from_pixmap instead of
24412 gdk_pixbuf_get_from_drawable.
24413 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24414 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24415 (xg_check_special_colors): Use GtkStyleContext and its functions
24416 for HAVE_GTK3.
24417 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24418 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24419 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
24420 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24421 Call gtk_widget_get_preferred_size.
0afb4571
J
24422 (xg_frame_resized): gdk_window_get_geometry only takes 5
24423 parameters.
44f230aa
SM
24424 (xg_win_to_widget, xg_event_is_for_menubar):
24425 Call gdk_x11_window_lookup_for_display.
0afb4571
J
24426 (xg_set_widget_bg): New function.
24427 (delete_cb): New function.
895009e1 24428 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 24429 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
24430 (xg_set_background_color): Call xg_set_widget_bg.
24431 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24432 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24433 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24434 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24435 if ! HAVE_GTK3.
24436 (update_frame_tool_bar): Call gtk_widget_hide.
24437 (xg_initialize): Use GDK_KEY_g.
24438
24439 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24440 if ! HAVE_GTK3
24441 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24442
24443 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24444 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24445 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24446
1c2cc4ef
JB
244472011-03-08 Juanma Barranquero <lekktu@gmail.com>
24448
24449 * w32xfns.c (select_palette): Check success of RealizePalette against
24450 GDI_ERROR, not zero.
24451
33383987 24452See ChangeLog.11 for earlier changes.
aac0c6e3
MR
24453
24454;; Local Variables:
24455;; coding: utf-8
aac0c6e3
MR
24456;; End:
24457
ab422c4d 24458 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
24459
24460 This file is part of GNU Emacs.
24461
24462 GNU Emacs is free software: you can redistribute it and/or modify
24463 it under the terms of the GNU General Public License as published by
24464 the Free Software Foundation, either version 3 of the License, or
24465 (at your option) any later version.
24466
24467 GNU Emacs is distributed in the hope that it will be useful,
24468 but WITHOUT ANY WARRANTY; without even the implied warranty of
24469 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24470 GNU General Public License for more details.
24471
24472 You should have received a copy of the GNU General Public License
24473 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.